[GUIDE] How To Root The Sprint CDMA Hero (Linux) - Hero CDMA Android Development

If you have any suggestions on making this guide better or to correct any mistakes I may have made please let me know.
This guide is intended for any Linux OS and includes detailed instructions. It should work with another Linux OS although I have only verified these steps using Ubuntu 9.10 aka Karmic. includes detailed instructions. This will work with software versions 1.29.651.1 and 1.56.651.2 (aka Android 1.5). It will cover the steps necessary to root, flash the new recovery image, create a full backup. I am not responsible for any damage done to your phone using this guide. Root at your own risk.
Step 1: Download the Android SDK from http://developer.android.com/sdk/index.html The linux file is called android-sdk_r06-linux_86.tgz. Extract the files to your home user directory so that you now have the folder /home/USERNAME/android-sdk-linux. Please note you must replace USERNAME with your own.
Step 2: Download the asroot2 exploit file from http://forum.xda-developers.com/attachment.php?attachmentid=244212&d=1257621154 Extract asroot2.zip to /home/username/android-sdk-linux/tools folder.
Step 3: Download the Hero recovery image from http://forum.xda-developers.com/showpost.php?p=4898505&postcount=1g DO NOT OPEN. Simply place this file in /home/username/android-sdk-linux/tools as well.
Step 4: USB Debugging should be disable before connecting your phone via the USB cable. Connect your phone and now enable USB Debugging.
Step 5: Open a terminal found under Applications>Accessories>Terminal
Step 6: You will now enter a series of commands which I will place in code boxes to indicate the entire command.
A.
Code:
cd ~/android-sdk-linux/tools
B.
Code:
sudo su
C.
Code:
./adb push asroot2 /data/local/
D.
Code:
./adb shell
E.
Code:
chmod 0755 /data/local/asroot2
F.
Code:
/data/local/asroot2 /system/bin/sh
You should see an output that says:
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pope_inode_info layout
Opening: /proc/857/fd/3
SUCCESS: Enjoy the shell.
#​Now for a few last commands.
G.
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
H.
Code:
cd /system/bin
I.
Code:
cat sh > su
J.
Code:
chmod 4755 su
You are now officially rooted. A few more steps and you will have flashed the recovery image.
K.
Code:
exit
L.
Code:
exit
This will return the command line to ~/android-sdk-linux/tools.
M.
Code:
./adb push recovery-RA-heroc-v1.6.2.img /sdcard
N.
Code:
./adb shell reboot
This will cause to power off then back on automatically. Wait till the phone is fully booted to continue.
O.
Code:
./adb shell
P.
Code:
su
Q.
Code:
cd /sdcard/
R.
Code:
flash_image recovery recovery-RA-heroc-v1.6.2.img
FLASHING TO THE RECOVERY TAKES SEVERAL SECONDS-- BE PATIENT. ENTER THE NEXT COMMAND ONLY AFTER THE COMMAND PROMPT RETURNS TO THE # (ROOT SYMBOL).
S.
Code:
reboot recovery
Step 8: This is the last command; You may now close the terminal. It will cause your phone to boot into recovery mode; it should take no longer than 30 secs.
The third option on the list is "- Backup/Restore"; select it. Now, select the first option "- Nand backup". The phone will prompt you to press HOME to confirm which is want you want to do. The backup will begin. You will see the screen say, "Performing backup : .........." When done, the bottom of the screen will say "Backup complete!" and you will be given the menu options again. Go back to the main menu and select reboot system.
Step 9: Once your phone is fully booted, mount the sdcard. You will see a folder called "nandroid"; I highly recommend you copy this to your pc in case you lose your sdcard data or reformat it. Your phone is rooted, 100% backed up, and ready to install a custom rom if you wish!

[email protected]:/home/lepri/android-sdk-linux/tools# sudo su lepri
[email protected]:~/android-sdk-linux/tools$ su root
Password:
[email protected]:/home/lepri/android-sdk-linux/tools# /adb push asroot2 /data/local/
bash: /adb: No such file or directory
[email protected]:/home/lepri/android-sdk-linux/tools# ./adb push asroot2 /data/local/
828 KB/s (74512 bytes in 0.087s)
[email protected]:/home/lepri/android-sdk-linux/tools# ./adb shell
$ chmod 0755 /data/local/asroot2
$ /abd shell
/abd: not found
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pipe_inode_info layout
Opening: /proc/493/fd/3
SUCCESS: Enjoy the shell.
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /system/bin
# cat sh > su
# chmod 4755 su
# exit
$ exit
[email protected]:/home/lepri/android-sdk-linux/tools# ./adb shell
$ su
# cd /sdcard/
# flash_image recovery recovery-RA-heroc-v1.2.3.img
Thanks for guide but I dont think it worked for me, HTC logo stays on but thats it... have to pull out battery to start the phone phone works but no joy with recovery image ((
I have HTC hero with sim(If this info any use to you)

lepri13 said:
[email protected]:/home/lepri/android-sdk-linux/tools# sudo su lepri
[email protected]:~/android-sdk-linux/tools$ su root
Password:
[email protected]:/home/lepri/android-sdk-linux/tools# /adb push asroot2 /data/local/
bash: /adb: No such file or directory
[email protected]:/home/lepri/android-sdk-linux/tools# ./adb push asroot2 /data/local/
828 KB/s (74512 bytes in 0.087s)
[email protected]:/home/lepri/android-sdk-linux/tools# ./adb shell
$ chmod 0755 /data/local/asroot2
$ /abd shell
/abd: not found
$ /data/local/asroot2 /system/bin/sh
[+] Using newer pipe_inode_info layout
Opening: /proc/493/fd/3
SUCCESS: Enjoy the shell.
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /system/bin
# cat sh > su
# chmod 4755 su
# exit
$ exit
[email protected]:/home/lepri/android-sdk-linux/tools# ./adb shell
$ su
# cd /sdcard/
# flash_image recovery recovery-RA-heroc-v1.2.3.img
Thanks for guide but I dont think it worked for me, HTC logo stays on but thats it... have to pull out battery to start the phone phone works but no joy with recovery image ((
I have HTC hero with sim(If this info any use to you)
Click to expand...
Click to collapse
You have a GSM HERO not a CDMA. This guide is intended for CDMA heros only.

Updated for recovery 1.5.1 image.

I keep getting the same error of insufficient permissions for device. What am I doing wrong? I disable USB debugging before I plug my phone in. Then I plug my phone in and enable USB debugging and then actually connect my mounting the SD card.
Edit: Ok. I found how to fix the insufficient permission problem...
Code:
./adb kill-server
sudo ./adb start-server
That will get your permissions correct but once I did that, I ran across a new error once I did ./adb shell the second time after the "chmod 0755".
Code:
[email protected]:/home/justin/android-sdk-linux_86/tools# ./adb push asroot2 /data/local/
711 KB/s (74512 bytes in 0.102s)
[email protected]:/home/justin/android-sdk-linux_86/tools# ./adb shell
$ chmod 0755 /data/local/asroot2
$ ./adb shell
./adb: not found
Whats wrong now?

I couldn't edit my post anymore but I found that it works if I just skip the second ./adb shell. It just caused problems for me because I was already in shell and was coming up with errors. I skipped it and my root smoothly after that.
Part I skipped...
You must replace username with your own actual username.
C. "./adb push asroot2 /data/local/"
D. "./adb shell"
E. "chmod 0755 /data/local/asroot2"
F. "./adb shell"
G. "/data/local/asroot2 /system/bin/sh"

For some reason the forums are letting me edit my posts. I know I'm wasting space but I would like to give credit to jnwhiteh for the ./adb fix. I searched for it and found it in a different part of the forums.

Problem flashing recovery
Thank you for the Howto.
I have no problem with the howto, until i try to flash recovery. It seems its going ok without error messages, but when i try to boot in recovery mode it does'nt work. Remains with the HERO logo in the screen and nothing happens.
Anyone can help me.

goshi0 said:
Thank you for the Howto.
I have no problem with the howto, until i try to flash recovery. It seems its going ok without error messages, but when i try to boot in recovery mode it does'nt work. Remains with the HERO logo in the screen and nothing happens.
Anyone can help me.
Click to expand...
Click to collapse
You're not giving the terminal enough time to flash the image probably. Give it like 10 secs to be on the safe side.

flash image not found
everything works fine up until i get to the part where you actually flash the recovery image, at which point i get an error reading : flash_image: not found
this is my code for the last part.
"[email protected]:/home/amills/android-sdk-linux/tools# ./adb push recovery-RA-heroc-v1.5.2.img /sdcard
1106 KB/s (3356672 bytes in 2.962s)
[email protected]:/home/amills/android-sdk-linux/tools# ./adb shell reboot
[email protected]:/home/amills/android-sdk-linux/tools# ./adb shell
# su
# cd /sdcard/
# flash_image recovery recovery-RA-heroc-v1.5.2.img
flash_image: not found"

goyanks said:
everything works fine up until i get to the part where you actually flash the recovery image, at which point i get an error reading : flash_image: not found
this is my code for the last part.
"[email protected]:/home/amills/android-sdk-linux/tools# ./adb push recovery-RA-heroc-v1.5.2.img /sdcard
1106 KB/s (3356672 bytes in 2.962s)
[email protected]:/home/amills/android-sdk-linux/tools# ./adb shell reboot
[email protected]:/home/amills/android-sdk-linux/tools# ./adb shell
# su
# cd /sdcard/
# flash_image recovery recovery-RA-heroc-v1.5.2.img
flash_image: not found"
Click to expand...
Click to collapse
is the phone fully booted when you run the flash_image command?

theresthatguy said:
is the phone fully booted when you run the flash_image command?
Click to expand...
Click to collapse
Yes, sense has booted up and everything, if this matters, my current recovery image is Amon Ra v1.2.3 and i had Eclair 2.1 v1.8 on it up until last night, as of now i have Fresh 1.1

If you're going to transfer the recovery image to the sdcard using adb push (as opposed to using usb-storage to drag/drop) you need to make sure that usb storage is turned off and the sdcard is mounted when you push the file.
My guess is that the sdcard wasn't mounted, and the file went to the (empty) /sdcard directory. Then when the sdcard is mounted, you can't see it. If you just reboot and do:
Code:
./adb shell
cd /sdcard
ls
does the recovery image file show up in the list?
I'm assuming that "flash_image: not found" means that the image file isn't where you're telling it to look.

buck2202 said:
If you're going to transfer the recovery image to the sdcard using adb push (as opposed to using usb-storage to drag/drop) you need to make sure that usb storage is turned off and the sdcard is mounted when you push the file.
My guess is that the sdcard wasn't mounted, and the file went to the (empty) /sdcard directory. Then when the sdcard is mounted, you can't see it. If you just reboot and do:
Code:
./adb shell
cd /sdcard
ls
does the recovery image file show up in the list?
I'm assuming that "flash_image: not found" means that the image file isn't where you're telling it to look.
Click to expand...
Click to collapse
no, it's there, when i tyle "ls", i get the following list returned.
Code:
# ls
2.1v1.8_heroc_7_signed.zip flashrec-1.1.3-20091107-2.apk
BetterTerm15.apk fresh-cdma-hero-1.1.zip
DCIM google_maps_navigation
HTC Sync media
LOST.DIR nandroid
Music prettybattery-googlecode-com
PicSay recovery-RA-heroc-v1.2.3.img
ToggleSettings recovery-RA-heroc-v1.5.2.img
Wallpaper rosie_scroll
aHome rssreader
albumthumbs tmp
aosp_heroc_20091217d.zip uloops
dolphinbrowser_gestures waze
furthermore, when i try to flash the recovery image now, i get no such error, instead I get a seemingly infinitely repeating series of "out of memory errors"
Code:
# flash_image recovery recovery-RA-heroc-v1.5.2.img
mtd: read error at 0x00000000 (Out of memory)
mtd: read error at 0x00020000 (Out of memory)
mtd: read error at 0x00040000 (Out of memory)
mtd: read error at 0x00060000 (Out of memory)
mtd: read error at 0x00080000 (Out of memory)
mtd: read error at 0x000a0000 (Out of memory)
mtd: read error at 0x000c0000 (Out of memory)
mtd: read error at 0x000e0000 (Out of memory)
mtd: read error at 0x00100000 (Out of memory)
mtd: read error at 0x00120000 (Out of memory)
mtd: read error at 0x00140000 (Out of memory)
mtd: read error at 0x00160000 (Out of memory)
mtd: read error at 0x00180000 (Out of memory)
mtd: read error at 0x001a0000 (Out of memory)
mtd: read error at 0x001c0000 (Out of memory)
mtd: read error at 0x001e0000 (Out of memory)
mtd: read error at 0x00200000 (Out of memory)
mtd: read error at 0x00220000 (Out of memory)
mtd: read error at 0x00240000 (Out of memory)

errors
I'm going to try rebooting the device and start from there. :|
this is bizzare, the first two times i attempted this (both times in Kubuntu 10.04 Alpha), i was able to flash the image with no trouble whatsoever.
------------------------------------------------------
i dont know what was up, fixed it and 1.5.2 is working great. thanks for the advice everyone. : )

problem :-(
Here's where I get to in the procedure, what's going on?
Code:
$ chmod 0755 /data/local/asroot2
$ /data/local/asroot2 /system/bin/sh
[1] Killed /data/local/asroot2 /system/bin/sh
$
Many thanks
David

swatsbiz said:
Here's where I get to in the procedure, what's going on?
Code:
$ chmod 0755 /data/local/asroot2
$ /data/local/asroot2 /system/bin/sh
[1] Killed /data/local/asroot2 /system/bin/sh
$
Many thanks
David
Click to expand...
Click to collapse
Do you have a non-Sprint hero? If say I recommend you check out the rooting a non-sprint hero thread.

Thanks so much for this great howto!
Looking down the road..... can the phone be unroot/restored from linux?

diordnahero said:
Thanks so much for this great howto!
Looking down the road..... can the phone be unroot/restored from linux?
Click to expand...
Click to collapse
After you flash a custom rom, no. You will need to RUU from a Windows box.

Doesn't work from a VM or from Mac Bootcamp either. Need to have a Windows-only craputer.

Related

How to get APPS back into system/apps/

I updated my rom and there are some omitted apps that I would like to get back into system/apps/ for example VoiceDialer.apk, but I cannot seem to get them back on. I am using Fresh Rom 0.4 and the phone is obviously rooted. maybe I am doing something wrong in adb shell but I keep getting one of 2 different erors. Either permission denied or adb not found. Thank you in advance for your help.
flaav8r said:
I updated my rom and there are some omitted apps that I would like to get back into system/apps/ for example VoiceDialer.apk, but I cannot seem to get them back on. I am using Fresh Rom 0.4 and the phone is obviously rooted. maybe I am doing something wrong in adb shell but I keep getting one of 2 different erors. Either permission denied or adb not found. Thank you in advance for your help.
Click to expand...
Click to collapse
1) Permission denied - make sure that when you do an adb shell, you're root (have the # prompt) and make sure you've mounted /system as rw (adb remount)
2) adb not found - make sure there's only one adb.exe on your computer and that it's the one from the SDK and that the SDK's /tools directory is in your path (to be safe, you can always just run adb from that directory)
jmanley69 said:
1) Permission denied - make sure that when you do an adb shell, you're root (have the # prompt) and make sure you've mounted /system as rw (adb remount)
2) adb not found - make sure there's only one adb.exe on your computer and that it's the one from the SDK and that the SDK's /tools directory is in your path (to be safe, you can always just run adb from that directory)
Click to expand...
Click to collapse
1. the procedure I used is this: from the cmd prompt in the androidsdk/tools/ directory:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# cd /system/app
# adb push VoiceDialer.apk system/app
but its a no go. Can't understand why.
BTW, I have the VoiceDialer.apk file in the androidsdk/tools folder just to make the push easier.
Ok, here is a screen shot from my command prompt window. I know someone knows what the hell I'm doing wrong. Just wanna get the damn voice dialer back on my phone. Please help, thank you.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Barry>cd \
C:\>cd androidsdk\tools\
C:\AndroidSDK\tools>adb shell
* daemon not running. starting it now *
* daemon started successfully *
$ su
su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# adb push VoiceDialer.apk /system/app/
adb push VoiceDialer.apk /system/app/
adb: not found
#
you cant do adb push while in shell ($ or #). Exit out and just try tying the adb push
goku14238 said:
you cant do adb push while in shell ($ or #). Exit out and just try tying the adb push
Click to expand...
Click to collapse
When I do that I get permission denied or something to that effect.
Yeah there's a post about this in the Fresh thread.
The most straightforward way is this:
Reboot to the recovery partition.
adb shell into the phone.
Issue the following command to mount the system partition:
mount -t yaffs2 /dev/block/mtdblock3 /system
Type exit to exit the shell.
Then do:
adb push c:\directory-with-the-apks /system/app
jonnythan said:
Yeah there's a post about this in the Fresh thread.
The most straightforward way is this:
Reboot to the recovery partition.
adb shell into the phone.
Issue the following command to mount the system partition:
mount -t yaffs2 /dev/block/mtdblock3 /system
Type exit to exit the shell.
Then do:
adb push c:\directory-with-the-apks /system/app
Click to expand...
Click to collapse
Thank-you, I will give it a try.

What is wrong with my script - going crazy

so I'm new to scripting, and I have a TON of lg optimus S's to root for work. So I figured I'd write a script to make life easy. I know all the shell commands are correct as if I manually type everything in it works. What happens is it gets through gingerbreak exploit and when the prompt returns # - everything seems to go to hell.
Here is my script I am using. I'm using Kubuntu 11.04 writing it in Kate, name of my script is Script2 and I'm executing it in bash via $sh Script2
echo "removing TMP directory";adb shell rm -r /data/local/tmp
echo "creating TMP directory";adb shell mkdir /data/local/tmp
echo "pushing gingerbreak";adb push gingerbreak /data/local/tmp/gingerbreak
echo "CD TMP";adb shell cd /data/local/tmp
echo "CHMOD TMP";adb shell chmod 777 /data/local/tmp/*
echo "running gingerbreak";adb shell /data/local/tmp/gingerbreak &
sleep 32
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock5 /system
adb shell cat /sdcard/flash_image > /system/bin/flash_image
adb shell chmod 755 /system/bin/flash_image
adb shell mount -o remount,ro -t yaffs2 /dev/block/mtdblock5 /system
adb shell flash_image recovery /sdcard/xionia_cwma_12518.6.img
adb shell reboot recovery
I've tried with out sleep command and also with out "&" at the end of gingerbreak, and when I do that and it returns # it seems like no commands will work, even if I type them in it returns just a blank line with out #.
With that current script after sleep 32, it returns #, few seconds later it tries to mount and I get (including the end of gingerbreak exploit).
[!] dance forever my only one
# mount: Operation not permitted
Script2: 9: cannot create /system/bin/flash_image: Directory nonexistent
Unable to chmod /system/bin/flash_image Read-only file system
mount -o: permission denied
reboot: Operation not permitted
then it returns me to bash$
Thanks!
So something interesting, I've been playing with this for awhile, and I took everything out past the
adb shell /data/local/tmp/gingerbreak
it seems if I run it as
bash$ adb shell /data/local/tmp/gingerbreak
vs
bash$ adb shell
$ cd /data/local/tmp
$ ./gingerbreak
when # is returned, the first option won't take any commands its like it hangs, if I type out the next command it will just return a blank line with out $ or #, I have to forcibly end the process by CTRL+C and it will return me to bash, if I do the second option it works and I can enter the next command in and it takes and returns me to #. Anyone know why this is? I'm pretty sure this is the problem.
I would happily use the second option, but I'm not sure how to get the script to take any android shell commands without a "adb shell" infront. If anyone knows how to get around this, that would be awesome =)

How do I install netflix patch

Hi,
I am rooted now (I guess/hope) I would like to fix it, I have the patch and have tried to copy the libnvomx.so to the lib dir n my TF using file manager HD, but it wont let me paste it, I dont have or seem to have access.
also, is the libnvomx.so the only one I need to copy from the patch?
does this mean I am not rooted?
Is there somewhere/link where I can learn how to, and what terms like adb, push, clear the cache sideload, quickboot, recovery, etc... mean? (search hasnt helped me much with the ones I have looked for, too many results or too few)
thanks for any help,
John
use the terminal emulator, and make sure you "su" before you try to copy.
Another option is Root Explorer: https://market.android.com/details?id=com.speedsoftware.rootexplorer
Root Explorer will allow you to establish write access to system files. It's what I used to get Netflix working on my Transformer
AustinMartin said:
use the terminal emulator, and make sure you "su" before you try to copy.
Click to expand...
Click to collapse
Hi,
Thanks, what is su?
I tried using adb (at dos prompt) I tried
adb push libnvomx.so /system/lib/
it said read only access
will the su give me access? how do I su?
I am not even sure what the terminal emu is?
thanks,
John
I don't know if your rooting added the terminal app to the tf101.
You need to run the su(superuser) command to gain access to the system files.
I think you can run it from adb as well, if you used adb to root, then you probably already used this command.
you can also just download the netflix patch zip to the microsd card, and install the zip from cwm recovery mode.
Xerravon said:
Hi,
Thanks, what is su?
I tried using adb (at dos prompt) I tried
adb push libnvomx.so /system/lib/
it said read only access
will the su give me access? how do I su?
I am not even sure what the terminal emu is?
thanks,
John
Click to expand...
Click to collapse
Close, no cigar:
try this:
adb remount
adb pull /system/lib/libnvomx.so libnvomx.so.orig
adb push libnvomx.so /system/lib/
adb chmod 644 /system/lib/libnvomx.so
adb remount
adb reboot
----
I'm not recalling if you can do an adb chmod, but probably you can so I'll add that in up there just in case it works: Also I added a bit where you get a copy of the original in case this all somehow goes bad.
hachamacha said:
Close, no cigar:
try this:
adb remount
adb pull /system/lib/libnvomx.so libnvomx.so.orig
adb push libnvomx.so /system/lib/
adb chmod 644 /system/lib/libnvomx.so
adb remount
adb reboot
----
I'm not recalling if you can do an adb chmod, but probably you can so I'll add that in up there just in case it works: Also I added a bit where you get a copy of the original in case this all somehow goes bad.
Click to expand...
Click to collapse
hI,
Thanks,
I havnt tried yet but will asap. Where did you learn this stuff? I was reading this thread (I finally looked in general)
http://forum.xda-developers.com/showthread.php?t=872128
It has some info but real detailed, like in your script, the "chmod 644" the 644 part. I guess it takes time, I ave only had this TF for a week or so and it is my first android OS.
thanks again, (I will let you know when I try,
John
edit
Just wondering before I try this, the pull command (Is that backing up the libnvomx file to the pc?
after reading the thread linked above, wont I have to be in adb shell to geet permission to copy the file to the lib dir?
AustinMartin said:
I don't know if your rooting added the terminal app to the tf101.
You need to run the su(superuser) command to gain access to the system files.
I think you can run it from adb as well, if you used adb to root, then you probably already used this command.
Click to expand...
Click to collapse
I used nvflash and adb to install busybox and superuser and su.
I dont know anything about su or superuser, I havent found any threads with info on them yet.
thanks,
It might sound confusing but this is just all basic linux.
when you're running the adb shell just enter su. This gives you permission to edit the /system files
Then pull(copy) the file from your tf101, to your local machine. this is a backup.
Then change the permissions on the file on your tf101.
Then push the new file from your local machine to your tf101.
AustinMartin said:
It might sound confusing but this is just all basic linux.
when you're running the adb shell just enter su. This gives you permission to edit the /system files
Then pull(copy) the file from your tf101, to your local machine. this is a backup.
Then change the permissions on the file on your tf101.
Then push the new file from your local machine to your tf101.
Click to expand...
Click to collapse
Hi,
I broke down and used your script, I tried doing it on my own but kept getting errors. I did seem to get one error in this line of yours
adb chmod 644 /system/lib/libnvomx.so
when I ran it (and I copy and pasted it to dos window)) it gave an error, well not an error but it listed commands and switches like if there is a typo. I dont know if it took the command or not here is a paste
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Kerr Avon>cd adb
The system cannot find the path specified.
C:\Users\Kerr Avon>
C:\Users\Kerr Avon>cd\adb
C:\ADB>adb remount
remount succeeded
C:\ADB>adb pull /system/lib/libnvomx.so libnvomx.so.orig
3429 KB/s (189660 bytes in 0.054s)
C:\ADB>adb push libnvomx.so /system/lib/
1174 KB/s (164764 bytes in 0.137s)
C:\ADB>adb chmod 644 /system/lib/libnvomx.so
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storag
e)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or
recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specifie
d port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
C:\ADB>remount
'remount' is not recognized as an internal or external command,
operable program or batch file.
C:\ADB>adb remount
remount succeeded
C:\ADB>adb reboot
C:\ADB>adb reboot
Click to expand...
Click to collapse
Looks like it probably did work, anyway netflix is running.
some of the lines I tried that didnt work (and did) are here, not sure what was wrong.
adb push libnvomx.so /system/lib/
adb pull /system/lib/libnvomx.so libnvomx.so.orig
(I think push and pull wont work under shell)
*******************************************
cp /system/lib/libnvomx.so removable/microsd/isoa/libnvomx.so.orig
cp /system/lib/libnvomx.so removable/microsd/isoa/libnvomx.so.orig
cp isoa/libnvomx.so /system/lib/libnvomx.so
(dont know why these didnt work, I did su first)
***************************************************************
this worked!!!
cp /system/lib/libnvomx.so sdcard/isoa/libnvomx.so.orig
***************************************************************
cp sdcard/isoa/libnvomx.so system/lib/libnvomx.so
file exists error
********************************************************
Click to expand...
Click to collapse
Oh, so the android runs linux, or a version of it (like ubuntu, freebsd, etc...)? that should help me a lot. I installed ubuntu on one of my PC's a few years back but they didnt have drivers for sli and raid for my system at the time, I played with it a day or 2 and went back to MS. It has always been on the list to do. I am going to have to try it again.
I just looked, it looks like there are lots of new "distro's" (versions) now a day from back when I tried it.
anyway, thank you very much for the help,
John
once you did this:
C:\ADB>adb push libnvomx.so /system/lib/
1174 KB/s (164764 bytes in 0.137s)
you already copied it, so you must have already had permissions. Therefore this next command:
C:\ADB>adb chmod 644 /system/lib/libnvomx.so
Android Debug Bridge version 1.0.26
was redundant anyways. I suspect you needed to run
adb shell chmod 664 /system/lib/libnvomx.so
for adb to run the command on the transformer(shell) rather than in the dos directory.
AustinMartin said:
once you did this:
C:\ADB>adb push libnvomx.so /system/lib/
1174 KB/s (164764 bytes in 0.137s)
you already copied it, so you must have already had permissions. Therefore this next command:
C:\ADB>adb chmod 644 /system/lib/libnvomx.so
Android Debug Bridge version 1.0.26
was redundant anyways. I suspect you needed to run
adb shell chmod 664 /system/lib/libnvomx.so
for adb to run the command on the transformer(shell) rather than in the dos directory.
Click to expand...
Click to collapse
I see, so shell is like I am running it in/from the TF. I guess that is why push and pull doesn't work in shell, it could be confusing??
I downloaded/installed root explorer but I would rather learn it the harder way.
thanks again for your help!!
John
Cool. I wasn't sure about the "adb chmod" working since I'd only done that from a linux shell before this, but it was worth a shot. If you went into adb shell, then typed "mount -o rw,remount /system"; chmod 644 /system/lib/{whatever that file name was}; and mount -o remount,ro the thatt that would work", or I suspect he is right about how you can use "adb shell chmod 644 /../../.....".
Anyway, glad it worked out.
hachamacha said:
Cool. I wasn't sure about the "adb chmod" working since I'd only done that from a linux shell before this, but it was worth a shot. If you went into adb shell, then typed "mount -o rw,remount /system"; chmod 644 /system/lib/{whatever that file name was}; and mount -o remount,ro the thatt that would work", or I suspect he is right about how you can use "adb shell chmod 644 /../../.....".
Anyway, glad it worked out.
Click to expand...
Click to collapse
Hi,
If I shell, do su, then exit the shell (which I couldn't figure out how to do) do the su rights still apply, if I then use adb commands?
mount and remount, I see those are for mounting partitions, do the partitions each have different rights? and what does chmod do?
thanks again,
John
Xerravon said:
Hi,
If I shell, do su, then exit the shell (which I couldn't figure out how to do) do the su rights still apply, if I then use adb commands?
mount and remount, I see those are for mounting partitions, do the partitions each have different rights? and what does chmod do?
thanks again,
John
Click to expand...
Click to collapse
If you did an $su ; # inside the shell (adb shell), then when you typed in exit, that'd exit the shell, and cause any subshell's kicked off with a command (like "su" to pick one from a hat), to 'go away', So no, you wouldn't still be su.
But: There is a 'switch' or setting somewhere that brings up the adb shell in # su mode, but it escapes me right now.
Mount -o remount,rw||ro /{mountshare} (one command) will just remount some partition like system as you direct it to. It will 'outlast' the adb session. If you leave adb after doing a mount -o remount,rw /system, then you've left /system mounted rw. It doesn't hurt anything, but in theory you type in $sync; sync and $ mount -o remount,ro, and then the clean police will be happier.
chmod changes permissions. You could look up the man page on google, and it'll show you that you have 3 groups, owner, group and world. You could do the command in a couple forms, like #chmod {permission mask like 777} {filename} or chmod w+x {filename} where first one gave all permissions (rwe/rwe/rwe) to some file, 2nd gave the world execute permission.
hachamacha said:
If you did an $su ; # inside the shell (adb shell), then when you typed in exit, that'd exit the shell, and cause any subshell's kicked off with a command (like "su" to pick one from a hat), to 'go away', So no, you wouldn't still be su.
But: There is a 'switch' or setting somewhere that brings up the adb shell in # su mode, but it escapes me right now.
Mount -o remount,rw||ro /{mountshare} (one command) will just remount some partition like system as you direct it to. It will 'outlast' the adb session. If you leave adb after doing a mount -o remount,rw /system, then you've left /system mounted rw. It doesn't hurt anything, but in theory you type in $sync; sync and $ mount -o remount,ro, and then the clean police will be happier.
chmod changes permissions. You could look up the man page on google, and it'll show you that you have 3 groups, owner, group and world. You could do the command in a couple forms, like #chmod {permission mask like 777} {filename} or chmod w+x {filename} where first one gave all permissions (rwe/rwe/rwe) to some file, 2nd gave the world execute permission.
Click to expand...
Click to collapse
hI,
Thanks again, this is over my head right now, I am going to do like you say and search Google for a good beginners site. I am thinking about putting linux on my pc also, been wanting to for a while, I think that will help. I do know a lot more than I did when I started the thread
thank you,
John

[Q] adb push- why am I getting permission denied?

phone: LG esteem ms910
Rooted: Yes
I'm trying to adb push a .apk file into my phones /system/app folder. These are the steps I am taking in trying to do this, but I am getting a permission denied response at the "adb push" part. Oh and my phone is under the "internet connection" setting. The other two (mass storage, charge only) wont let my phone enter debugging mode.
Code:
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
exit
exit
adb push C:\Myfile.apk /system/app
Also when I enter the "mount -o remount,rw /dev/block/stl9 /system" command, It pops up twice but without the # symbol, not sure if there is an error there but it ends up looking like this:
Code:
C:\Android\android-sdk\platform-tool>adb shell
$ su
# mount -o remount,rw /dev/block/stl9 /system
mount -o remount,rw /dev/block/stl9 /system
# exit
exit
$ exit
exit
C:\Android\android-sdk\platform-tool>
I think you would want it to be on charge only, as the other options are utilizing the USB while charge only does not. That is how my setup functions... I did have the permission denied error before when I was using Ubuntu 10.04. Are you sure you have an up to date version of JDK? And the USB rules?
your command should be
adb push C:\Myfile.apk /system/app/myfile.apk
you have also to run adb as root or enable rw for /system/app
Basically:
______________________________________________
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
chmod 777 /system/app
exit
exit
adb push C:\Myfile.apk /system/app/myfile.apk
________________________________________________
should do the job
@imheroldman- I tried leaving it on charge only, but the devices wasnt found when I ran the adb devices command, and yes the JDK is the latest.
@djodjoni -Hey I tried your suggestions and it worked.
Thanks to the both of you for helping.
FWIW, I got permission denied errors when I tried to push busybox via adb. I just downloaded a busybox .zip and flashed it via TWRP, it seems to have worked, and the busybox app recognizes it as installed.
I can't use adb push. It says Read Only file system when I try to push things to /sdcard. Don't know why
kavinzhao said:
I can't use adb push. It says Read Only file system when I try to push things to /sdcard. Don't know why
Click to expand...
Click to collapse
Use this:
Code:
[path] > adb shell
# mount -o rw,remount rootfs /
# chmod 777 /sdcard
# exit
[path] > adb push [file path on your PC] /sdcard
ИΘΘK¡€ said:
Use this:
Code:
[path] > adb shell
# mount -o rw,remount rootfs /
# chmod 777 /sdcard
# exit
[path] > adb push [file path on your PC] /sdcard
Click to expand...
Click to collapse
Thanks. I was using the recovery to receive before this. I think that should save me some time.
hello, I am having same problem, can you please help me out?
[email protected]_himaulatt:/data/local # adb push C:\firewater /data/local/temp
adb push C:\firewater /data/local/temp
error: device not found
1|[email protected]_himaulatt:/data/local # adb push C:\firewater /data/local/
adb push C:\firewater /data/local/
error: device not found
1|[email protected]_himaulatt:/data/local # adb push C:\firewater /data/l
adb push C:\firewater /data/l
error: device not found
1|[email protected]_himaulatt:/data/local # adb push C:\firewater /data/
adb push C:\firewater /data/
error: device not found
1|[email protected]_himaulatt:/data/local # cd ..
cd ..
[email protected]_himaulatt:/data # cd ..
cd ..
[email protected]_himaulatt:/ # exit
exit
[email protected]_himaulatt:/ $ exit
exit
C:\Users\Winpc\Downloads\fastboot-win>adb push C:\firewater /data/local/temp
failed to copy 'C:\firewater' to '/data/local/temp/firewater': Permission denied
C:\Users\Winpc\Downloads\fastboot-win>adb wait-for-devices push firewater /data/local/temp
failed to copy 'firewater' to '/data/local/temp/firewater': Permission denied
C:\Users\Winpc\Downloads\fastboot-win>adb shell
[email protected]_himaulatt:/ $ su
su
[email protected]_himaulatt:/ # mount -o rw,remount rootfs/
mount -o rw,remount rootfs/
Usage: mount [-r] [-w] [-o options] [-t type] device directory
1|[email protected]_himaulatt:/ # mount -o rw,remount rootfs /
mount -o rw,remount rootfs /
[email protected]_himaulatt:/ # chmod 777 /sdcard
chmod 777 /sdcard
[email protected]_himaulatt:/ # exit
exit
[email protected]_himaulatt:/ $ adb push C:\firewater /data/
adb push C:\firewater /data/
error: device not found
1|[email protected]_himaulatt:/ $ exit
exit
C:\Users\Winpc\Downloads\fastboot-win>adb wait-for-devices push firewater /data/local/temp
failed to copy 'firewater' to '/data/local/temp/firewater': Permission denied
C:\Users\Winpc\Downloads\fastboot-win>
Make sure you have phone detected and correct drivers and adb installed.
Once ADB is functioning properly, then let's PUSH files!
First let's make sure adb is running and make sure adb see's the phone. Please run these commands:
Code:
adb kill-server
adb start-server
adb devices
The output after devices will be a serial number, if this looks good, move on. First you need to make
sure the apk you want to push is in the same directory as adb.exe
once you have moved the apk to the adb.exe directory, then run the following:
Code:
[FONT=Verdana]adb remount
adb push myfile.apk /system/app/
adb shell chmod 644 /system/app/myfile.apk
adb reboot[/FONT]
adb remount mounts the phone as read write so you can write thru adb, it will be automatically unmounted when phone disconnected or rebooted
assuming your APK you want moved is called "myfile.apk"
adb push file_myfile.apk /system/app/ this command moves the "myfile.apk" (the apk you want moved) to the /system/app/ directory on your phone
adb shell chmod 644 /system/app/myfile.apk this command sets the correct file permissions for APKs
adb reboot this reboots the phone so that the new apk can be detected
Good luck
hi:
phone is rooted;
android 5.0 ;
adb start-server is OK;
adb devices is OK;
adb root is adbd is already running as root;
system and system/app are "chomd is 777 ";
I want to "adb push myfile /system/app/ "
Question: Permission denied .
- -
thx
other:
adb remount is Permission denied too.
"adb push ./build.gradle /storage/sdcard0/ " is OK.
opalescent said:
hi:
phone is rooted;
android 5.0 ;
adb start-server is OK;
adb devices is OK;
adb root is adbd is already running as root;
system and system/app are "chomd is 777 ";
I want to "adb push myfile /system/app/ "
Question: Permission denied .
- -
thx
other:
adb remount is Permission denied too.
"adb push ./build.gradle /storage/sdcard0/ " is OK.
Click to expand...
Click to collapse
sounds like you possibly do not have proper permission for the user you are logged into your computers operating system with. make sure you have the proper permissions and rights to access the folders you are trying to access. For a quick fix you can try loging into the system using the root user or administrator of the system that you are using and then try the adb commands. and you can just do a quick su switch from the Computer OS's konsole/terminal.
XeoNoX said:
First you need to make sure the apk you want to push is in the same directory as adb.exe
Click to expand...
Click to collapse
OMG thanks, mine wasn't working because something as simple as that!

Ways to root .29?

I've got some questions about rooting on a locked device, which I may as well fire away.
I'm on .17 DE and has got it setup nicely, so I don't want to go to .29 just to try things out, and if something goes wrong it's better if the tablet has got a boot manager installed so rescue flash is possible. So, if someone who knows what they're doing wants to unroot and try this out (or just tell me if anything is feasible) I believe many people (primarily not rooted .WW-people, but maybe all current ICS-device owners) would be very happy.
Q1 - In the "tweaks" post seanzscreams mentions there may be a way to push build.prop to /system/ at boot.
Wouldn't it be possible to create some root stuff to push and run, like
(pushsu.bat)
Code:
adb wait-for-device
adb push su /system/
run it, reboot tablet
create a shell script file for permissions (or some other mojo) and push it aswell:
(permsu.sh)
Code:
chown 0.0 /system/su
chmod 06755 /system/su
and then run:
(pushper.bat)
Code:
adb wait-for-device
adb push permsu.sh /system/
and finally run and reboot:
(setperms.bat)
Code:
adb wait-for-device
adb shell sh /system/permsu.sh
?
Q2 - wolf849 is doing some funky stuff to downgrade firmware where he's mounting stuff at /data/local/tmp and rebooting for (I assume) permissions to write to the "stuff".
Would it be possible to test these commands (modified to possibly work or break something) (mmcblk0p1 = /system on my device):
(in adb shell or something)
Code:
mv /data/local/tmp /data/local/tmp.bak
ln -s /dev/block/mmcblk0p1 /data/local/tmp
exit
Then reboot and see if /data/local/tmp is in fact /system mounted rw (ie "copy or push su"-able).
If the former wouldn't work because of symlinking rights maybe another approach would be a bat file, like
Code:
adb mv /data/local/tmp /data/local/tmp.bak
adb reboot
adb wait-for-device
adb ln -s /dev/block/mmcblk0p1 /data/local/tmp
adb reboot
Please don't try these suggestions if you don't know how to recover from possible bootloops or semibricks.
I would try them if I'd been unlocked and boot managered, but I'm out of luck if something goes wrong.

Categories

Resources