CWM ADB Shell All Commands Permission Denied - Galaxy S 4 Q&A, Help & Troubleshooting

--- I posted to general by accident, meant to do Q&A, but don't have permission to delete as a new user. --
--- Please see the question in Q&A ---
Greetings,
I'm new here, and can't get over to the developers forums to ask. I have two GT-I9500s for development purposes, one if full of junk, and the other is still stock, except for recovery. They both have CWM Recovery v6.0.3.2, the latest available pre-compiled I've found. The stock phone has only been booted once. That system is not rooted (and this is my whole point, I want as close to stock as possible)
I am attempting to extract the system image from Stock I9500. I have booted into CWM Recovery mode, then "adb shell" into the device. All commands I issue to the shell return "Permission Denied"
Code:
:$ adb shell
~ $ ls
/sbin/sh: ls: Permission denied
~ $ dd of=/storage/extSdCard/SYSTEM.img if=/dev/block/mmcblk0p20 bs=4069
/sbin/sh: dd: Permission denied
~ $ su
/sbin/sh: su: Permission denied
~ $ sudo su
/sbin/sh: sudo: Permission denied
I have tried to use Advanced->Fix Permissions to no avail.
CWM is pure and latest from www dot clockworkmod dot com slash rommanager (new users apparently cannot post links). CWM is able successfully operate "Backup to External" from the stock device.
The end goal is to clone the clean, stock device onto the other one. CWM claims success on "Restore from External" to the other device, but it sits on the "Samsung" loading screen forever.
A solution to either or both of these problems would be appreciated.
-MM

same issue
I have the same issue. I first also didn't adb shell available. But I fixed it in recovery mode by doing mount /system. However, now like you I have no permissions at all. I'm considering doing a factory reset, but that's gonna be my final resort. I first go looking for other ways to come around it.

ansjovis86 said:
I have the same issue. I first also didn't adb shell available. But I fixed it in recovery mode by doing mount /system. However, now like you I have no permissions at all. I'm considering doing a factory reset, but that's gonna be my final resort. I first go looking for other ways to come around it.
Click to expand...
Click to collapse
You need to allow your pc first to use adb. Boot into android, use adb and press allow. After that you can use adb in recovery. If it still fails, then try a different recovery. Philz or TWRP.

Related

Remove CityID after root and recovery flash

So I've rooted and installed the new recovery on my incredible. I want to remove CityID now, forgot to after root. When I launch recovery and run adb devices it shows my device. I then run adb shell, immediately getting the # for su (instead of the $ prompt for non su access). I execute /system/bin/rm /system/app/CityID.apk as instructed by the wiki and get /sbin/sh: /system/bin/rm: not found. I browse to /system/bin and do a listing and see nothing. So am I doing something wrong?
**EDIT**
Forgive my ignorance, but I forgot to mount system in the partitions menu of recovery. Doubtful this would be of any help to anyone, but there ya go.
Also in the How To:
StirCwazy said:
So I've rooted and installed the new recovery on my incredible. I want to remove CityID now, forgot to after root. When I launch recovery and run adb devices it shows my device. I then run adb shell, immediately getting the # for su (instead of the $ prompt for non su access). I execute /system/bin/rm /system/app/CityID.apk as instructed by the wiki and get /sbin/sh: /system/bin/rm: not found. I browse to /system/bin and do a listing and see nothing. So am I doing something wrong?
**EDIT**
Forgive my ignorance, but I forgot to mount system in the partitions menu of recovery. Doubtful this would be of any help to anyone, but there ya go.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=709220 - It's a few posts down, but will update first post later today.

Rooting... just getting su?

Hi there...
I'm finally considering rooting, however all the guides lead to flashing a custom rom... but actually I don't want to flash a custom ROM, I want to keep everything as it is, with the difference that I (and preferably only I) can become super user on the shell when I need to do some changes (like fixing the stock widget bug in the internal database).
I've read this right now:
http://forum.xda-developers.com/showthread.php?t=724741
And they say I can flash this files called EngTools.zip
Does this also work on the Hero assuming the guide (PossibleGSMRoot or something... fromt he villainforum) works on my phone?
I don't even want to permanently have some kind of AmonRa blabla recovery boot image on my phone. If I need it while I get root that's fine, but I want to get rid of it afterwards. I really don't need root for any applications liek overclocking etc. etc. just for smaller dives into the files system and changes there via adb.
olafos said:
Hi there...
I'm finally considering rooting, however all the guides lead to flashing a custom rom... but actually I don't want to flash a custom ROM, I want to keep everything as it is, with the difference that I (and preferably only I) can become super user on the shell when I need to do some changes (like fixing the stock widget bug in the internal database).
I've read this right now:
http://forum.xda-developers.com/showthread.php?t=724741
And they say I can flash this files called EngTools.zip
Does this also work on the Hero assuming the guide (PossibleGSMRoot or something... fromt he villainforum) works on my phone?
I don't even want to permanently have some kind of AmonRa blabla recovery boot image on my phone. If I need it while I get root that's fine, but I want to get rid of it afterwards. I really don't need root for any applications liek overclocking etc. etc. just for smaller dives into the files system and changes there via adb.
Click to expand...
Click to collapse
Hmmm. If you are on 2.1, then you can use the GSM root i posted over at VR. The recovery needs to be flashed to the phone though, so you can flash zips to the phone from there.
As for your wish to get rid of the patched recovery afterwards, you're missing out a lot, but if you can find the stock recovery img file, you can simply flash that using
"flash_image recovery FilenameHero.img" via the phone's shell or adb (once rooted, presuming you added the flash_image binary).
As for that file, I don't know, as I've never checked if that will work on the hero.
I'd be inclined to say DON'T TRY IT, since it will contain a kernel, and flashing the wrong kernel can brick your device's radio, essentially ruining it.
But if you locate the correct files for the GSM hero, and package them similarly, you could flash that onto your phone via recovery
Bear in mind the stock HTC ROM is basically full on the system partition, so you might have issues actually fitting the files on.
I've been a lurker for some time here but just before I had thought about exactly the same issue as OP... I always wondered why there's no way to just get root access temporarily. Most people told me I'd have to flash a custom ROM.
So today I finally looked into the matter and based on your (anon2122) post on VillainROM and the Eris exploits etc. I managed to do exactly what I wanted... and thought it's time to get an account...
I only really needed root for the Stock app currency issue: [HTTP]://forum[DOT]xda-developers[DOT]com/showthread[DOT]php?t=719149 which I was now able to fix.
HTC Hero GSM soft root guide by ixampl
(... credits belong to / based on: [HTTP]://www[DOT]villainrom[DOT]co[DOT] uk/viewtopic[DOT]php?f=110&t=2096)
1 Flashing a custom recovery image
1.1 Backup (1)
Code:
adb shell mkdir /data/local/backup
adb shell cat /data/local/rights/mid.txt > /data/local/backup/mid.txt
1.2 Uploading custom recovery image and image flashing tool and setting correct permissions
Code:
adb push recovery-RA-hero-v1.6.2.img /data/local/
adb push flash_image /data/local/
adb shell chmod 777 /data/local/recovery-RA-hero-v1.6.2.img
adb shell chmod 777 /data/local/flash_image
1.3 Center piece of the permissions exploit for the recovery ROM
Code:
adb shell ln -s /dev/mtd/mtd1 /data/local/rights/mid.txt
1.4 Normal reboot
Code:
adb reboot
1.5 Now that the recovery ROM (/dev/mtd/mtd1) is accessible: Backup (2)
Code:
adb shell cat /dev/mtd/mtd1 > /data/local/backup/recovery.img
1.6 Flashing the previously uploaded custom recovery image
Code:
adb shell /data/local/flash_image recovery /data/local/recovery.img
1.7 Rebooting into recovery mode
Code:
adb reboot recovery
2 Adding root shell (optional)
2.1 Mounting all devices
Code:
adb shell mount -a
2.2 Adding rootsh
Code:
adb shell cat /system/bin/sh > /system/bin/rootsh
adb shell chmod 4755 /system/bin/rootsh
2.3 Rebooting into system
Code:
adb reboot
After this you can flash the recovery.img you backed up in step 1.5 just as you flashed in step 1.6 (adjust the parameters accordingly).
ixampl said:
I've been a lurker for some time here but just before I had thought about exactly the same issue as OP... I always wondered why there's no way to just get root access temporarily. Most people told me I'd have to flash a custom ROM.
So today I finally looked into the matter and based on your (anon2122) post on VillainROM and the Eris exploits etc. I managed to do exactly what I wanted... and thought it's time to get an account...
I only really needed root for the Stock app currency issue: [HTTP]://forum[DOT]xda-developers[DOT]com/showthread[DOT]php?t=719149 which I was now able to fix.
HTC Hero GSM soft root guide by ixampl
(... credits belong to / based on: [HTTP]://www[DOT]villainrom[DOT]co[DOT] uk/viewtopic[DOT]php?f=110&t=2096)
1 Flashing a custom recovery image
1.1 Backup (1)
Code:
adb shell mkdir /data/local/backup
adb shell cat /data/local/rights/mid.txt > /data/local/backup/mid.txt
1.2 Uploading custom recovery image and image flashing tool and setting correct permissions
Code:
adb push recovery-RA-hero-v1.6.2.img /data/local/
adb push flash_image /data/local/
adb shell chmod 777 /data/local/recovery-RA-hero-v1.6.2.img
adb shell chmod 777 /data/local/flash_image
1.3 Center piece of the permissions exploit for the recovery ROM
Code:
adb shell ln -s /dev/mtd/mtd1 /data/local/rights/mid.txt
1.4 Normal reboot
Code:
adb reboot
1.5 Now that the recovery ROM (/dev/mtd/mtd1) is accessible: Backup (2)
Code:
adb shell cat /dev/mtd/mtd1 > /data/local/backup/recovery.img
1.6 Flashing the previously uploaded custom recovery image
Code:
adb shell /data/local/flash_image recovery /data/local/recovery.img
1.7 Rebooting into recovery mode
Code:
adb reboot recovery
2 Adding root shell (optional)
2.1 Mounting all devices
Code:
adb shell mount -a
2.2 Adding rootsh
Code:
adb shell cat /system/bin/sh > /system/bin/rootsh
adb shell chmod 4755 /system/bin/rootsh
2.3 Rebooting into system
Code:
adb reboot
After this you can flash the recovery.img you backed up in step 1.5 just as you flashed in step 1.6 (adjust the parameters accordingly).
Click to expand...
Click to collapse
That is a nice method.
I've long thought about making something similar, so maybe today I'll try, as an idea has come back to me...
I am thinking that I can avoid the whole recovery flashing, though I'm not going to say the idea till I've thought it through, as someone might try it before I realise how stupid an idea it is...
But I'll certainly see if it can get permanent root sorted out on the phone, although it won't give root adb access, as that is defined in the boot.img, though I guess I could flash that while I'm at it...
Good work.
Thanks!
Yes, a method to (safely) acquire super user access without flashing anything would be highly appreciated There's a small risk involved with flashing. Granted it usually causes no issues, but there is the slight possibility of bricking your phone.
Good work.
Click to expand...
Click to collapse
Thanks, although - as you know - I really didn't do anything special there
[...] although it won't give root adb access [...]
Click to expand...
Click to collapse
Yes, that's a minor annoyance, but really minor ... for the currency fix I naturally couldn't do
Code:
adb pull /data/data/com.htc.dcs.service.stock/databases/stock.db stock.db
or
Code:
adb push stock.db /data/data/com.htc.dcs.service.stock/databases/stock.db
but it's not that hard to just work around that via /data/local:
Code:
adb shell
$ rootsh
# cat /data/data/com.htc.dcs.service.stock/databases/stock.db > data/local/stock.db
then pull from there etc.
I really think "rooting" is a misnomer for most of the current guides.
I can see that most people "root" their phone in order to get custom ROMs (and I have no issue with that, it's just too much overkill for someone who just wanted to fix a small bug ) but In fact most people don't care about rooting per se, they care about flashing a recovery image which enables them to flash custom ROMs.
I actually wanted to try:
Code:
adb shell ln -s /dev/mtd/mtd3 /data/local/rights/mid.txt
...and see what happens if I remount after boot. If it causes the system to follow back the link with user permissions for the recovery ROM, maybe the system ROM could be (write-)accessed as well. Then again, it was my first venture into rooting so naturally there would have been no way to fix a broken system image safe for reflashing the 1.5 RUU.
Do you have any details about what the original purpose of the (original) mid.txt was? I mean, it was there, sitting in a directory named rights... quite an invitation (of course, we didn't actually "set" rights in that file or anything for the exploit, but still...)
Is it safe to delete mid.txt and will it be recreated with some default values by the system?
Click to expand...
Click to collapse

[Q] Su: Permission Denied

i cant enable superuser..
i followed the instruction from
link = wiki.cyanogenmod.com/index.php?title=HTC_Tattoo:_Full_Update_Guide
and when im installing the clockworkmod,
adb shell
$ su
$ su: permission denied
Someone please help me..
this is my first time flashing,
i already read lots of forum, but they doesnt help..
uhm, btw there is no pop up that says "allow" when i type $ su and adb shell..
Are you referring to this? Did you successfully push image to /data/local/bin
adb push flash_image /data/local/bin/
adb shell
su
cd /data/local/bin/
chmod 755 flash_image
flash_image recovery /sdcard/recovery-clockwork-3.0.0.6-click.img
androidcues said:
Are you referring to this? Did you successfully push image to /data/local/bin
adb push flash_image /data/local/bin/
adb shell
su
cd /data/local/bin/
chmod 755 flash_image
flash_image recovery /sdcard/recovery-clockwork-3.0.0.6-click.img
Click to expand...
Click to collapse
yes i successfully push image.
i took a screenshot.
look.
i544.photobucket.com/albums/hh334/yanyan4u2008/Supermissiondenied.jpg
(can't post a image link because im still new in here)
but still, super user denied.
Im sure youve tried stuff -- did you try clearing superuser cache -- refresh the slate and confirmed you did not miss the SU popup? just be sure the screen is on and look for it like 2 seconds after you hit enter after "adb shell"
yanyan4u2008 said:
i cant enable superuser..
i followed the instruction from
link = wiki.cyanogenmod.com/index.php?title=HTC_Tattoo:_Full_Update_Guide
Click to expand...
Click to collapse
The cyanogenmod update guide assumes that you have a rom with tattoo-hack loaded, and the path to su is not set.
Look in this post:
http://forum.xda-developers.com/showthread.php?t=716282
in the sections
1.3 Tools you need
1.5 The manual way (recommended by the author)
2.3 How to flash/tools needed
Do the steps in 1.5, use the rom image and recovery from cyanogenmods wiki, in 2.3, do the second line, for flashing recovery. After that you can flash cyanogenMod from the recovery menu (Accessed by booting to recovery by holding home+power)
regards
T.I.A.
Thanks in advance, although i haven't tried it already.
I'll try it maybe on Wednesday..
Hope to flash the CyanogenMod 7.0.0-RC1.7003 2.3.3 Gingerbread..
More powers to all of you guys, keep up the good work!
finnk said:
The cyanogenmod update guide assumes that you have a rom with tattoo-hack loaded, and the path to su is not set.
Look in this post:
http://forum.xda-developers.com/showthread.php?t=716282
in the sections
1.3 Tools you need
1.5 The manual way (recommended by the author)
2.3 How to flash/tools needed
Do the steps in 1.5, use the rom image and recovery from cyanogenmods wiki, in 2.3, do the second line, for flashing recovery. After that you can flash cyanogenMod from the recovery menu (Accessed by booting to recovery by holding home+power)
regards
Click to expand...
Click to collapse
works for me
it worked for me too
Guide
Works for me too
im currently running Gingerbread, thanks!
yanyan4u2008 said:
Works for me too
im currently running Gingerbread, thanks!
Click to expand...
Click to collapse
Glad to help Credit goes to TheSSJ who made the guide

[Q] CWM ADB Shell All Commands Permission Denied

Greetings,
I'm new here, and can't get over to the developers forums to ask. I have two GT-I9500s for development purposes, one if full of junk, and the other is still stock, except for recovery. They both have CWM Recovery v6.0.3.2, the latest available pre-compiled I've found. The stock phone has only been booted once. That system is not rooted (and this is my whole point, I want as close to stock as possible)
I am attempting to extract the system image from Stock I9500. I have booted into CWM Recovery mode, then "adb shell" into the device. All commands I issue to the shell return "Permission Denied"
Code:
:$ adb shell
~ $ ls
/sbin/sh: ls: Permission denied
~ $ dd of=/storage/extSdCard/SYSTEM.img if=/dev/block/mmcblk0p20 bs=4069
/sbin/sh: dd: Permission denied
~ $ su
/sbin/sh: su: Permission denied
~ $ sudo su
/sbin/sh: sudo: Permission denied
I have tried to use Advanced->Fix Permissions to no avail.
CWM is pure and latest from www dot clockworkmod dot com slash rommanager (new users apparently cannot post links). CWM is able successfully operate "Backup to External" from the stock device.
The end goal is to clone the clean, stock device onto the other one. CWM claims success on "Restore from External" to the other device, but it sits on the "Samsung" loading screen forever.
A solution to either or both of these problems would be appreciated.
This was accidentally posted to General a few minutes ago, but as a new user, I don't have the ability to delete it.
-MM
You need to boot the device and then connect it to adb. Then you get a popup on your phone to allow your pc. After that you can use adb from cwm.
Lennyz1988 said:
You need to boot the device and then connect it to adb. Then you get a popup on your phone to allow your pc. After that you can use adb from cwm.
Click to expand...
Click to collapse
I booted into android, connected it to Ubuntu, enabled ADB, authorized the device, chose to remember the device, then "adb shell" into the phone. I can LS and CD around.
I rebooted into CWM Recovery, did "adb shell" and still cannot execute LS. CD works but that is bash internal not a program. Other programs are still "Permission Denied"
I am not that an expert of adb, but couldn't that be caused by the fact that you are not rooted?
Lennyz1988 said:
I am not that an expert of adb, but couldn't that be caused by the fact that you are not rooted?
Click to expand...
Click to collapse
You're conflating the environments. CWMis inherently rooted; when in recovery, Android is never booted. I have execute permission in Android, not in CWM.
nvm
As resolution to my problem, I never did fix Clockwork Mod. Instead, I flashed TWRP for the I9500 and it allows me to execute
Code:
adb shell su -c ...

Help! Two Bricked V20s! H918

So I have two v20s with 10d firmware.
I have followed Github's instruction to root the phones. Which are as follows:
Building:
lunch your_device-eng
make -j5 dirtycow recowvery-applypatch recowvery-app_process recowvery-run-as
Running:
Note: Use app_process32 on 32-bit targets.
adb push dirtycow /data/local/tmp
adb push recowvery-applypatch /data/local/tmp
adb push recowvery-app_process64 /data/local/tmp
adb push recowvery-run-as /data/local/tmp
adb shell
$ cd /data/local/tmp
$ chmod 0777 *
$ ./dirtycow /system/bin/applypatch recowvery-applypatch
"<wait for completion>"
$ ./dirtycow /system/bin/app_process64 recowvery-app_process64
"<wait for completion, your phone will look like it's crashing>"
$ exit
adb logcat -s recowvery
"<wait for it to tell you it was successful>"
"[CTRL+C]"
adb shell reboot recovery
"<wait for phone to boot up again, your recovery will be reflashed to stock>"
adb shell
$ getenforce
"<it should say Permissive, adjust source and build for your device!>"
$ cd /data/local/tmp
$ ./dirtycow /system/bin/run-as recowvery-run-as
$ run-as exec ./recowvery-applypatch boot
"<wait for it to flash your boot image this time>"
$ run-as su
#
"<play around in your somewhat limited root shell full of possibilities>"
From your root shell, it's possible to use commands such as:
dd if=/sdcard/twrp.img of=/dev/block/bootdevice/by-name/recovery
Now, first phone I was able to get TWRP however when I rebot the phone to recovery, it would ask me for password. It would not instal super user without the password. It would be read only. When I reset the phone, it went into infamous recovery bootloop. It would only boot to TWRP.
Second phone I have got to as far as getenforce however it says enforcing instead of permissive.
Now I am sure what to do next and I am stuck with two bricked? phone.
I have been trying to find firmware 10d but I could not find it. Only 10i or 10j were found. Do I restore it to stock then re-root? What would be best solutions for me? Thanks in advance.
Edit: I am reading several threads and I do see same symptoms but no solutions were posted later. So I dont know what were done to fix it. I just don't what to do next at this point.
sharpeyedman said:
The 1st one that is asking for password is because you have not FORMATTED DATA
this is required for twrp to be able to read the entire phone as it was encrypted by lg.
FORMAT DATA OPTION requires you to type YES if you haven't done that it needs done,
after flash a stock rom and reboot. Usually 1st boot is 10-20 min wait time for it to setup.
This is covered on the main thread that it must be done to resolve.
If you get boot loops, put the device into fastboot ,
wipe /fota , /misc , /cache and /etc using
fastboot erase fota replace "fota" with each directory.
Furthermore, you can also wipe "system" and "data" also but you will have to flash rom again if you wipe those 2.
as well there has been some devices that wouldn't boot or booted 10x slower, and the resolution was to
push a alternate boot.img to the device that was not the engineering/debug image.
For the 2nd one, you've not provided enough info.
What software version are you on?
as well you may need to post in the root/unlock page for direct assistance to the process on this one.
.......
Click to expand...
Click to collapse
Team DevDigitel said:
sharpeyedman said:
The 1st one that is asking for password is because you have not FORMATTED DATA
this is required for twrp to be able to read the entire phone as it was encrypted by lg.
FORMAT DATA OPTION requires you to type YES if you haven't done that it needs done,
after flash a stock rom and reboot. Usually 1st boot is 10-20 min wait time for it to setup.
This is covered on the main thread that it must be done to resolve.
If you get boot loops, put the device into fastboot ,
wipe /fota , /misc , /cache and /etc using
fastboot erase fota replace "fota" with each directory.
Furthermore, you can also wipe "system" and "data" also but you will have to flash rom again if you wipe those 2.
as well there has been some devices that wouldn't boot or booted 10x slower, and the resolution was to
push a alternate boot.img to the device that was not the engineering/debug image.
For the 2nd one, you've not provided enough info.
What software version are you on?
as well you may need to post in the root/unlock page for direct assistance to the process on this one.
.......
Click to expand...
Click to collapse
Both are on 10d stock firmware. When I run getenforce then it prompts me with "enforcing". Instead of "permissive". Now when I ignore the prompt and proceed further, it later would not let me install new recovery or TWRP. So I cannot boot to customer recovery it TWRP. If I retry the procedures all over from the beginning then it would not run chmod 0777 *. It would say not granted or permitted. What should I do with the second phone? Thanks so much for your help.
Click to expand...
Click to collapse
sharpeyedman said:
Team DevDigitel said:
Both are on 10d stock firmware. When I run getenforce then it prompts me with "enforcing". Instead of "permissive". Now when I ignore the prompt and proceed further, it later would not let me install new recovery or TWRP. So I cannot boot to customer recovery it TWRP. If I retry the procedures all over from the beginning then it would not run chmod 0777 *. It would say not granted or permitted. What should I do with the second phone? Thanks so much for your help.
Click to expand...
Click to collapse
i dont know, post this one in other page
Click to expand...
Click to collapse

Categories

Resources