Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shravan #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scotty2/psneuter/README
Original file line number Diff line number Diff line change
@@ -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.
Binary file modified scotty2/psneuter/psneuter
Binary file not shown.
22 changes: 22 additions & 0 deletions scotty2/psneuter/psneuter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected])
Add support for devices like lgp970 which restart immediately after the adb deamon is killed and drop back into the user mod. */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -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;
}