diff --git a/scotty2/psneuter/README b/scotty2/psneuter/README new file mode 100644 index 0000000..546154f --- /dev/null +++ b/scotty2/psneuter/README @@ -0,0 +1,11 @@ +Follow these instructions to gain temporary root accesss. +1. Upload the psneuter binary onto your phone using adb + >> adb push psneuter /data/local/tmp/ +2. Run the binary + >> adb shell /data/local/tmp/psneuter +3. Open another terminal and kill the adb process if you see the prompt has hung (most comon case) + >> adb kill-server +4. Reopen the adb connection and you should have root access with PS1 as # + >> adb shell + +This is a reliable method as we don't wait for adb to restart manually. diff --git a/scotty2/psneuter/psneuter b/scotty2/psneuter/psneuter index 7c9c41b..ba2fe99 100755 Binary files a/scotty2/psneuter/psneuter and b/scotty2/psneuter/psneuter differ diff --git a/scotty2/psneuter/psneuter.c b/scotty2/psneuter/psneuter.c index 7d119d1..3cecf27 100644 --- a/scotty2/psneuter/psneuter.c +++ b/scotty2/psneuter/psneuter.c @@ -10,6 +10,9 @@ // service and things like dns broken. // thus, we will want to use this, see if we can fix the misc partition, and downgrade the firmware as a whole to something more root friendly. +/* Shravan (shravan@kusraho.in) +Add support for devices like lgp970 which restart immediately after the adb deamon is killed and drop back into the user mod. */ + #include #include #include @@ -143,6 +146,25 @@ int main(int argc, char **argv, char **envp) fprintf(stderr, "Failed to kill adbd (%s)\n", strerror(errno)); exit(1); } + else + { + /* For devices like lgp970 which dies immediately after the adb deamon is killed. */ + adbdpid = fork(); + if(adbdpid > 0) + { + /* This is the parent process. + * Kill it I don't need you. */ + exit(0); + } + else if(adbdpid == 0) + { + /* This is nice little child. Let is start running + * the adb deamon again. */ + char *arg[] = {"NULL"}; + execv("/sbin/adbd", arg); + } + + } return 0; }