Separate command line tool and jni library parts
Make /dev/sh if the calling user is root

In this case the program is invoked through uevent_helper.