help!! - General Questions and Answers

hiya everyone, im new on here and really need some help.
im trying to downgrade my android software so im able to root it. only problem being ive never used command prompt lol!!
the guide im using says:
Launch a Command Prompt window and browse to the location of the files extracted in Step 1.
Enter the following commands:
adb push psneuter /data/local/tmp
adb push misc_version /data/local/tmp
adb shell chmod 777 /data/local/tmp/psneuter
adb shell chmod 777 /data/local/tmp/misc_version
adb shell /data/local/tmp/psneuter
adb shell
You should now get the # prompt, indicating temporary root.
Enter these commands:
cd /data/local/tmp
./misc_version -s 1.31.405.6
but how do i browse for the files if ive stored them in my documents and in a folder called downgrade android.
many thanks

keeps saying not a batch file :s

Moving them into the SDK tools folder temporarily would make things easier and would mean only the file name needs to be typed rather than the specific location, try it out, I hope I remembered correctly

dannysissons said:
hiya everyone, im new on here and really need some help.
im trying to downgrade my android software so im able to root it. only problem being ive never used command prompt lol!!
the guide im using says:
Launch a Command Prompt window and browse to the location of the files extracted in Step 1.
Enter the following commands:
adb push psneuter /data/local/tmp
adb push misc_version /data/local/tmp
adb shell chmod 777 /data/local/tmp/psneuter
adb shell chmod 777 /data/local/tmp/misc_version
adb shell /data/local/tmp/psneuter
adb shell
You should now get the # prompt, indicating temporary root.
Enter these commands:
cd /data/local/tmp
./misc_version -s 1.31.405.6
but how do i browse for the files if ive stored them in my documents and in a folder called downgrade android.
many thanks
Click to expand...
Click to collapse
you can either modify the command like this:
adb push C:\users\[YOURUSERNAME]\My documents\downgrade\psneuter /data/local/tmp
or setup a locale path variable to the dir, where adb is stored as mentioned in THIS thread. (step 4)
Then you can simply cd to the dir, where your files are stored, and run adb from there (actually you can run adb from any dir then)

Related

[Q] adb shell in batch

Hi,
I'm making a batch file (*.bat) for myself to try make some things easier file where I enter commands with adb.exe.
The problem is, any code after 'adb shell' is not executed in the batch.
So if I had a batch with the following:
Code:
adb shell
su
'su' will not be executed and stays at '$'.
It seems like it's too deep for a batch file to enter codes.
I also tried pushing a sh with the same script and run it from adb but then all I get it permission denied.
I have also tried 'adb shell su' without any luck.
Anyone with a solution?
Anyone? Or how about a .rc file that gets su and runs commands...
Sent from my HTC
To execute a script, you can always push your script and then execute it:
Code:
adb push script /sdcard/script
adb shell sh /sdcard/script
As for the commands you have shown, keep in mind that su doesn't simply change the running shell's permissions or the like but creates a new child environment within its own shell. You leave your script and after the new shell has finished, you're back in your old environment and the script continues.
mizch said:
To execute a script, you can always push your script and then execute it:
Code:
adb push script /sdcard/script
adb shell sh /sdcard/script
As for the commands you have shown, keep in mind that su doesn't simply change the running shell's permissions or the like but creates a new child environment within its own shell. You leave your script and after the new shell has finished, you're back in your old environment and the script continues.
Click to expand...
Click to collapse
yes, is there any way to automate the script inside the shell and use exit to finally go back to the batch script.
Can you provide me with an example of what you want to achieve?
To execute shell commands from a batch, it doesn't matter if I have to push a script and execute it. It's so that I get su and automate commands after that. Like flash_image, remount, chmod etc..
you will need to use the 'adb shell command' ad 'sh' files
I am trying to create a unix script file that copies files from /dbdata/databases to another folder as a backup.
When I try running the script in adb shell as SU, I get
cd: can't cd to /dbdata/databases
This is on a rooted Captivate. Any help would be greatly appreciated!
Hi,
su -c "command" should do the job for you. You will need to enclose the whole of the command in quotes however, otherwise su will be expecting the command to execute, doing nothing.
Example: adb shell "su -c 'sqlite3 /data/data/my.db/databases/mydb.db < /sdcard/dump.sql'" (run from a Unix or Windows(?) shell). Notice the use of "" and ''.
(in this case dump.sql contains .dump, for instance)
Of course the sqlite3 command could be placed within another script on the android device.
Hope that helps.
I looked around a bit and found the answer.
The simple answer is, wrap the command
Code:
cp "source" "destination"
in double quotes!
Thank you grindingbob for the adb shell "su -c 'sh /mnt/sdcard/tmp/2.sh'" command.
No probs I was more referring to executing commands as a su without interacting with adb shell.
As a side-note, cp might not be a good idea, unless you're sure no db accessing is taking place at the same time.
I am pretty sure well as sure as a novice can be! The files I am backing up are log files, call history and text message history.
The results from running a unix script which contains
Code:
cp "/dbdata/databases/com.android.providers.contacts/contacts2.db" "/mnt/sdcard/tmp4/contacts2.db"
cp "/dbdata/databases/com.android.providers.telephony/mmssms.db" "/mnt/sdcard/tmp4/mmssms.db"
cp "/dbdata/databases/com.sec.android.provider.logsprovider/logs.db" "/mnt/sdcard/tmp4/logs.db"
are only the logs.db file is copied, the other two are not.
grindingbob said:
No probs I was more referring to executing commands as a su without interacting with adb shell.
As a side-note, cp might not be a good idea, unless you're sure no db accessing is taking place at the same time.
Click to expand...
Click to collapse
Permission issues for *.sh files from ADB
Dear All,
I have a 3.2 device with Root permissions & Busybox.
I created a sample *.sh file, Pushed to SDcard, and gave '777' Permissions. When i Try to run it from ADB shell its not working Any help...
CMD prompt Traces:
Step -1: Created a sh file
cat TAB.sh
#!/bin/sh
cd /data/data/com.android.gallery/shared_prefs
Step -2 Pushed the file to SDcard
# ls -l *.sh
ls -l *.sh
-rw-rw-r-- root sdcard_rw 56 2012-03-13 15:06 SP.sh
-rw-rw-r-- root sdcard_rw 62 2012-03-13 15:05 TAB.sh
Step -3 Gave 777 permission for *.sh files
# chmod 777 *.sh
chmod 777 *.sh
# ls -l
ls -l
-rw-rw-r-- root sdcard_rw 56 2012-03-13 15:06 SP.sh
-rw-rw-r-- root sdcard_rw 62 2012-03-13 15:05 TAB.sh
Execute permission not applied
Tried other operations, dint workout
Step 4 other options:
# chmod +X *.sh
chmod +X *.sh
Bad mode
# chmod +x *.sh
chmod +x *.sh
Bad mode
# chmod u+x *.sh
chmod u+x *.sh
Bad mode
Any Help?

[Q] downgrading android software. stuck on command prompt

hiya everyone, im new on here and really need some help.
im trying to downgrade my android software so im able to root it. only problem being ive never used command prompt lol!!
the guide im using says:
Launch a Command Prompt window and browse to the location of the files extracted in Step 1.
Enter the following commands:
adb push psneuter /data/local/tmp
adb push misc_version /data/local/tmp
adb shell chmod 777 /data/local/tmp/psneuter
adb shell chmod 777 /data/local/tmp/misc_version
adb shell /data/local/tmp/psneuter
adb shell
You should now get the # prompt, indicating temporary root.
Enter these commands:
cd /data/local/tmp
./misc_version -s 1.31.405.6
but how do i browse for the files if ive stored them in my documents and in a folder called downgrade android.
many thanks
What device are you trying to downgrade and what version of Android are you currently on? If it's Gingerbread there is a oneclick root called gingerbreak that works for a lot of people.
More info needed really.

The adb shell cd command doesn't change directories

When I use adb shell <cmd>, the commands work as expected, except for cd. If I run the following two commands, it shows I'm still in the root directory.
Code:
adb shell cd /any/valid/path
adb shell pwd
The cd command just doesn't ever change directories.
For completeness, I can not do abd shell ls ~/, as I have no HOME, but I assume this is normal?? I'm not concerned about HOME, it's fixable, but I really need to have the cd command working as I'm writing an IPython extension that wraps adb.
Cheers
Carl
I realise that this is a reply to an older question, but the answer might still be of use to some.
You first have to enter the shell before executing the 'cd' command.
STEP 1.
Code:
adb shell
STEP 2.
Code:
cd /any/valid/path
You don't use cd just type the directory you want to go to

[GUIDE][ROOT] Root almost any china android phone

Use any 1 of the following methods.
I have personally tried these on 2 of my china android phones.
1. Using linux {Recommended}Install Ubuntu or DebianEither
Install the android-sdk.
dl.google.com/android/adt/adt-bundle-linux-x86-20130717.zip <==x86
dl.google.com/android/adt/adt-bundle-linux-x86_64-20130717.zip <==x86_64
or
Just get the standalone adb and fastboot executables
texasice-cream-sandwich-mirror.googlecode.com/files/adb_fastboot.zip​Install ia32-libsRun this in a terminal
Code:
sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
Now download the files required for root and put it in the same folder as adbmir.cr/GDEPZT4V​After you finish installing the files,
Connect your device with debugging mode enabled
Run
Code:
cd path/to/adb
where "path/to/adb" is the directory of your adb file
Now run
Code:
sudo chmod a+x adb
sudo chmod a+x fastboot
>>Root
Code:
./adb devices
./adb push psneuter /data/local/tmp/
./adb push busybox /data/local/tmp/
./adb push su /data/local/tmp/
./adb push Superuser.apk /data/local/tmp/
./adb shell
Chmod and run the exploit under adb shell
Code:
cd /data/local/tmp/
chmod 755 psneuter
./psneuter
Now re-engage an adb shell to check if the exploit worked.
Code:
./adb kill-server
./adb devices
./adb shell
If you see a # sign, the exploit was was successful. Otherwise repeat from >>Root
Now run these on the same adb shell
Code:
cd /data/local/tmp
./busybox ash
mount -o remount,rw /dev/block/mtdblock0 /system
cp /data/local/tmp/su /system/xbin/su
chmod 6755 /system/xbin/su
chown 0.0 /system/xbin/su
cp /data/local/tmp/Superuser.apk /system/app/Superuser.apk
chmod 777 /system/app/Superuser.apk
cp /data/local/tmp/busybox /system/xbin/busybox
chmod 6755 /system/xbin/busybox
Now reboot your device and open up SuperSU. Let it update the binary.
Your device should be rooted. ​2. Use Windows + MoboroboMethod 1 {Recommended but hard}
Download Moborobo from
Code:
moborobo.com
This software can Install drivers for many china phones and other branded phones.
After installing Moborobo download the files required for root
Code:
mir.cr/GDEPZT4V
Extract the files to the installation directory of Moborobo.
Code:
C:\Program Files (x86)\Moborobo
Run a CMD window under that directory and type
Code:
xcopy AndroidInterface.exe adb.exe
Connect your device in debugging mode & Open up Moborobo, It will install the drivers.
Keep Moborobo open & Follow the instructions mentioned in >>Root
P.S- the linux commands begin with a "./" remove this in windows or else it won't work. Note: Wherever I mentioned a terminal, the windows equivalent to this would be cmd​Method 2 {Easier}
Download and Install Moborobo just like above and run this under a cmd on that folder
Code:
xcopy AndroidInterface.exe adb.exe
Also download UnlockRoot or SuperOneClick
To make sure the adb files are of the same version, Copy over
Code:
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
to UnlockRoot's tools directory or SOC's ADB directory
Connect your device in debugging mode and open up moborobo.
Now keep Moborobo open and Run UnlockRoot or SOC. ​Good Luck :good:
---Smo0thK, team BL4CKF1R3---
Click thanks if I helped you.
[/COLOR]
Hi there!
under method 2 in the end...I could not locate ROOT nowhere.....
>>Root
arena1 said:
Hi there!
under method 2 in the end...I could not locate ROOT nowhere.....
Click to expand...
Click to collapse
I said follow the instructions mentioned in ">>Root".
I named a step in Method one as ">>Root". So I meant you should repeat those steps.
Now download the files required for root and put it in the same folder as adb
mir.cr/GDEPZT4V
Click to expand...
Click to collapse
What files?
EDIT: managed to do all the steps using method 1 in windows but got this message with executing ./psneuter :
mnmap() failed. Invalid argument
I used windows to root
failed at adb shell psneuter command...
/system/bin/sh: psneuter: not found
how to proceed ?

HOW to root qubo big one

i got a new qubo big one and wanted to root it
Your phone's Android OS is rooted as soon as the cmdlet named su - what by default is left off - is present in Android's file system and executable.
Hence add a suitable version of su to Android OS: can be done via ADB.
Please can I get a step by step
xXx yYy said:
Your phone's Android OS is rooted as soon as the cmdlet named su - what by default is left off - is present in Android's file system and executable.
Hence add a suitable version of su to Android OS: can be done via ADB.
Click to expand...
Click to collapse
Instruction?
Please I need a step by step guide
A: To run Android shell commands with super-user right from within the shell on desktop computer ( AKA Command Prompt ) you have to run within desktop computer shell
Code:
adb devices
adb push <LOCATION-OF-SUITABLE-SU-BINARY-ON-PC-HERE> /data/local/tmp/
what will 1. connect the Android device to your desktop computer and 2. upload the su binary in the Android device temporary directory always available for the user.
B: Then, in desktop computer shell type
Code:
adb shell "cd /data/local/tmp & chmod 776 su"
what makes the su binary executable: its ownership by default is set to shell.
C: Then in desktop computer shell type
Code:
adb shell "ls -l"
what will show you content and permissions on recently uploaded files.
D:
To apply a series of Android shell commands what require super-user rights you now would run
Code:
adb shell
export PATH=/data/local/tmp:$PATH"
su -c "<SHELL-CMD-HERE>"
....
su -c "<SHELL-CMD-HERE">
exit
.
xXx yYy said:
A: To run Android shell commands with super-user right from within the shell on desktop computer ( AKA Command Prompt ) you have to run within desktop computer shell
Code:
adb devices
adb push <LOCATION-OF-SUITABLE-SU-BINARY-ON-PC-HERE> /data/local/tmp/
what will 1. connect the Android device to your desktop computer and 2. upload the su binary in the Android device temporary directory always available for the user
xXx yYy said:
A: To run Android shell commands with super-user right from within the shell on desktop computer ( AKA Command Prompt ) you have to run within desktop computer shell
Code:
adb devices
adb push <LOCATION-OF-SUITABLE-SU-BINARY-ON-PC-HERE> /data/local/tmp/
what will 1. connect the Android device to your desktop computer and 2. upload the su binary in the Android device temporary directory always available for the user.
B: Then, in desktop computer shell type
Code:
adb shell "cd /data/local/tmp & chmod 776 su"
what makes the su binary executable: its ownership by default is set to shell.
C: Then in desktop computer shell type
Code:
adb shell "ls -l"
what will show you content and permissions on recently uploaded files.
D:
To apply a series of Android shell commands what require super-user rights you now would run
Code:
adb shell
export PATH=/data/local/tmp:$PATH"
su -c "<SHELL-CMD-HERE>"
....
su -c "<SHELL-CMD-HERE">
exit
Click to expand...
Click to collapse
B: Then, in desktop computer shell type
Code:
adb shell "cd /data/local/tmp & chmod 776 su"
what makes the su binary executable: its ownership by default is set to shell.
C: Then in desktop computer shell type
Code:
adb shell "ls -l"
what will show you content and permissions on recently uploaded files.
D:
To apply a series of Android shell commands what require super-user rights you now would run
Code:
adb shell
export PATH=/data/local/tmp:$PATH"
su -c "<SHELL-CMD-HERE>"
....
su -c "<SHELL-CMD-HERE">
exit
Click to expand...
Click to collapse
Thanks

Categories

Resources