ADB shell su: permission denied while in Recovery mode - Android Software/Hacking General [Developers Only]

Hey guys,
I just can't figure this one on my own. My phone is bricked, so I'm trying to use ADB in Recovery mode to fix it. The problem is, that 'su' always returns 'permission denied', so I can't mount system rw and that's where I'm stuck.
Phone is fully rooted - that's how I was able to brick it in the first place.
'/system/xbin/su' is also present (checked via Aroma).
Is there any way to "fix" this?

in the recovery go to mount and storage then mount /system.It will be mounted as RW.

I have the e3 stock recovery, so there are only these options:
reboot system now
apply update from sdcard
wipe data/factory reset
wipe cache partition

use aroma file manager it have terminal.You can use it in recovery.
or try adb remount

Yes, I know about the aroma terminal and I also tried some commands in it, but without a positive result. But just to be sure, what command(s) did you have in mind?
And 'adb remount' returns:
remount failed: Operation not permitted

if you have e3 recovery that means you havent rooted your phone which means su wont work first root your phone
also it would be great if you could explain a little more as to what you want to accomplish

Oh.. That doesn't sound very good..
I need to modify some files in the system/framework folder.
Anyway, it should be rooted, because I already replaced a system file.

I just found out on the web that in the system settings on CM10 -> Developer settings -> you can set root access also for ADB.
Maybe it helps?

Related

Can't manage to modify the /system folder

I've been trying for a couple of days now to try and modify the /system folder because I want to edit the host file and delete standard .apk's. However I just can't get it to work and I don't understand why.
I got a rooted 2.2 legend with modaco stock htc sense rom.
Things I tried:
Root explorer: For some reason I can't write files to the folder. It always says there is not enough free space while there is something like 6mb available. Also, deleting files doesn't actually seem to work. Root exploreres says the files are deleted but after a reboot they are there again!
Also root explorer makes my phone reboot.
ADB: Basically the same thing. Also I don't get adb to work when i'm in recovery mode (red traingle screen, I used to have clockwork but even after trying to reflash the clockwork recovery that just doesn't show up anymore and gone fubar out of the blue....) and want to enter the /system folder.
Terminal app: Same thing as above.
All 3 make my phone reboot.
What am I doing wrong?
I don't use the same phone as you, but I think that /system is usually mounted as read only (ro). Some file managers can mount /system as read/write (rw). Or I think you can chmod /system to 777 in your terminal as su with the command chmod 777 /system. Also I think CWM has an option to mount /system as rw, but I may be wrong. If you chmod, remember to set it back. You'll need to know shell commands and how to read permissions from an ls -a -l command and reset them. Hope this helps.
Sent from my SAMSUNG-SGH-I897 using XDA App

adb root: Permission denied but OK in recovery mode.

Dear Sirs,
I have HTC Desire Z with CM 7.0.3 (superuser installed) and s-off. Posting here since the issue seems relevant to android in general rather than specific hardware...
I have already seen the following threads before opening this one but they do not help since I cannot issue any of the commands that they mention:
:http://forum.xda-developers.com/showthread.php?t=1364521
:http://forum.xda-developers.com/showthread.php?t=1087350
:http://forum.xda-developers.com/showthread.php?t=837102 (it says to use mount command but thats exactly where I get the permission denied)
When I boot the phone normally and "adb shell", I can get a root prompt (id command shows root user, "cd" shows "/"). But ANY command I run brings permission denied (even ls, chmod, mount). I literally can't do anything. Same whether I boot with/without S D card. I CAN however issue commands such as "adb pull /init.rc" if I exit and go back to DOS.
If I open a terminal session (with Superuser full permissions), I can SU as root, but again cannot issue any commands without getting "permission denied"/
However if I boot into clockworkmod recovery and mount /data and /system, and then open an adb shell via USB, I can connect as root and browse everything, everything is fine and all commands work OK. /etc/fstab shows all partitions would be mounted as rw.
So it looks like some application during boot, is resetting the permission for /system to be ro, and also removing root's privileges.
Please could you let us know if there is a method to determine what app is doing this during boot. I cannot see anywhere in init.rc where I can catch this application that is doing this and prevent it from making /system inaccessible after boot.
Preferably if someone could point me to the complete log of the boot process that shows each command that is run, I might have a clue as to where in the boot up process, the /system partition suddenly becomes ro and root loses all permissions.
The problem prevents busybox updating and other root apps that need to write to /system.
This was not a problem for months after installing and rooting CM 703, only recently it has become an issue, perhaps following some hidden Google update???
Thanks

[Q] Help setCPU on boot

Hello community,
Earlier I was messing with the voltages on setcpu, and I guess I ticked the box "set on boot" and now my phone wont boot pass the lockscreen. I don't want to wipe my phone if i don't need to.
I tried removing it via adb shell with these instructions i found:
1) Boot into recovery
2) Connect USB
3) open ADB shell - 'adb shell'
4) mount the Data folder - 'mount /data'
5) navigate to the Data folder - 'cd /data/data'
6) Remove the config file - 'rm -r com.mhuang.overclocking'
7) exit and reboot phone
but i can't mount data. any help would be great. Thank you
Hello,
The SetCPU program can generate a "safe mode" script in case that happens.
It puts it into the root directory of the sdcard.
You have to generate it from within the program, it does not do it automatically.
I have attached the file I generated on my phone, I hope it can help you.
I think the instructions will be to boot in "red recovery" then flash the safe mode file to remove the "set on boot" flag.
Do not set on boot until you are sure the OC/UV settings do not crash your phone.
Good luck!
jayson94538 said:
Hello community,
Earlier I was messing with the voltages on setcpu, and I guess I ticked the box "set on boot" and now my phone wont boot pass the lockscreen. I don't want to wipe my phone if i don't need to.
I tried removing it via adb shell with these instructions i found:
1) Boot into recovery
2) Connect USB
3) open ADB shell - 'adb shell'
4) mount the Data folder - 'mount /data'
5) navigate to the Data folder - 'cd /data/data'
6) Remove the config file - 'rm -r com.mhuang.overclocking'
7) exit and reboot phone
but i can't mount data. any help would be great. Thank you
Click to expand...
Click to collapse
A lot of the time the recovery isn't setup to properly use adb but maybe you just need to try a different command.
First see what is mounted and
ih what mount options by simply typing 'mount' in adb shell
Normally about halfway down you will see /dev/block/mmcblk0p2 /data make sure it is there and mounted read write. If it's not mounted try mounting it with 'mount -o rw /dev/block/mmcblk0p2 /data'
Or if it is mounted read only (which would be weird) try mount -o remount rw /dev/block/mmcblk0p2 /data
If that doesn't help you might need to do a nand droid backup, wipe data, reboot, create a safemode script like mentioned above, restore the nand backup and run the script in recovery.
Thank you very much for your replies. Helped me a ton. I got it fixed thanks to you guys.
Sent from my SAMSUNG-SGH-I997

[Q] [HELP] /system read-only can't fix on adb no su response

i ported a LeWa OS ROM for my device and everything seemed to work perfectly, booted up without hassle, apps working, and everything was fine. not until i came to the point where i have to check the root capability. it seems like the /system partition was locked as read-only. i pre-rooted the rom with supersu and su binaries properly placed just like i do with other roms i ported. but this one is different. even on adb, the su isn't responding. although the request is showing on the phone and i click on grant, still there is no su response or whatsoever, that is why i cant remount it as rw.
so i was wondering if there is something i have to port from stock boot.img to port boot.img to permanently mount /system partition in RW capability.
i hope anyone can help me
How about making an insecure kernel so you can access root without requesting su?
xlSKYFiRElx said:
i ported a LeWa OS ROM for my device and everything seemed to work perfectly, booted up without hassle, apps working, and everything was fine. not until i came to the point where i have to check the root capability. it seems like the /system partition was locked as read-only. i pre-rooted the rom with supersu and su binaries properly placed just like i do with other roms i ported. but this one is different. even on adb, the su isn't responding. although the request is showing on the phone and i click on grant, still there is no su response or whatsoever, that is why i cant remount it as rw.
so i was wondering if there is something i have to port from stock boot.img to port boot.img to permanently mount /system partition in RW capability.
i hope anyone can help me
Click to expand...
Click to collapse
Download SuperSU and reinstall its binaries again.
Or you can try adbd Insecure app (not free)
janekmuric said:
Download SuperSU and reinstall its binaries again.
Or you can try adbd Insecure app (not free)
Click to expand...
Click to collapse
supersu or any of its binaries cannot help me. as every app that request root privileges hangs when grant permission is given. ill try adbd insecure app. gonna throw my money to this one
xlSKYFiRElx said:
supersu or any of its binaries cannot help me. as every app that request root privileges hangs when grant permission is given. ill try adbd insecure app. gonna throw my money to this one
Click to expand...
Click to collapse
I think the adb insecure app still requires su, you can upload the boot.img and i'll make it insecure (automatically root via adb, no su required)
Oooohh
xlSKYFiRElx said:
supersu or any of its binaries cannot help me. as every app that request root privileges hangs when grant permission is given. ill try adbd insecure app. gonna throw my money to this one
Click to expand...
Click to collapse
I didn't understand you correctly. Anyways from what I understand noe you can't give root to any app at all. Try using framaroot to re-root maybe it works. You have to find out the reason it hangs. I'm placing my bet on the corrupt or bad binary.
janekmuric said:
I didn't understand you correctly. Anyways from what I understand noe you can't give root to any app at all. Try using framaroot to re-root maybe it works. You have to find out the reason it hangs. I'm placing my bet on the corrupt or bad binary.
Click to expand...
Click to collapse
He's right, redownload the binaries again, if it still hangs, it might be the ROM.
Add this to build.prop if you want root via adb:
ro.secure=0
janekmuric said:
I didn't understand you correctly. Anyways from what I understand noe you can't give root to any app at all. Try using framaroot to re-root maybe it works. You have to find out the reason it hangs. I'm placing my bet on the corrupt or bad binary.
Click to expand...
Click to collapse
3DMapPlayer said:
He's right, redownload the binaries again, if it still hangs, it might be the ROM.
Add this to build.prop if you want root via adb:
ro.secure=0
Click to expand...
Click to collapse
sorry for the confusion but here is the case, i ported this (LEWA) ROM and i pre rooted with, placed the updated su binary to /system/xbin and the latest supersu.apk to /system/app. the phone boots properly and according to the rom. i installed root checker but when it checked for root it says the root is not installed properly but the supersu dialog box is appearing and i can press the grant button and a toast appears saying that it is granted superuser permissions. i tried to re-root using framaroots barahir exploit but it said "Half-Success" because the system partition is mounted read-only.
i tried using root explorer, when i try to mount system as r/w the supersu dialog appears and i can press the grant button again, also the toast appears saying that the app is granted superuser permission but then the application (root explorer) hangs, i tried other root explorer application still the same.
so what i want to achieve is to mount /system as read-write partition
i tried using ADB, but when i try to type su everything i type reappears
example: when i type 'su' the result is like this:
Code:
what i type: su
what show: su
what i type: busybox mount
what show: busybox mount
or simply, everything i type reappears and the command is not executed.
i tried to modify boot.img by editing build.prop and setting this values
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=1
persist.mtk.aee.aed=on
ro.debuggable=1
persist.sys.usb.config=mass_storage,mtp
persist.service.acm.enable=0
ro.mount.fs=EXT4
Click to expand...
Click to collapse
and also editing init.rc and setting this values
Code:
mount yaffs2 [email protected] /system rw remount
mount ubifs [email protected] /system rw remount
but still no luck. i hope you guys understand, sorry for my crappy english. not my language
i'll try to reflash the rom so that i can supply screenshots
also, here is a copy of my boot.img
Got it!
xlSKYFiRElx said:
sorry for the confusion but here is the case, i ported this (LEWA) ROM and i pre rooted with, placed the updated su binary to /system/xbin and the latest supersu.apk to /system/app. the phone boots properly and according to the rom. i installed root checker but when it checked for root it says the root is not installed properly but the supersu dialog box is appearing and i can press the grant button and a toast appears saying that it is granted superuser permissions. i tried to re-root using framaroots barahir exploit but it said "Half-Success" because the system partition is mounted read-only.
i tried using root explorer, when i try to mount system as r/w the supersu dialog appears and i can press the grant button again, also the toast appears saying that the app is granted superuser permission but then the application (root explorer) hangs, i tried other root explorer application still the same.
so what i want to achieve is to mount /system as read-write partition
i tried using ADB, but when i try to type su everything i type reappears
example: when i type 'su' the result is like this:
Code:
what i type: su
what show: su
what i type: busybox mount
what show: busybox mount
or simply, everything i type reappears and the command is not executed.
i tried to modify boot.img by editing build.prop and setting this values
and also editing init.rc and setting this values
Code:
mount yaffs2 [email protected] /system rw remount
mount ubifs [email protected] /system rw remount
but still no luck. i hope you guys understand, sorry for my crappy english. not my language
i'll try to reflash the rom so that i can supply screenshots
also, here is a copy of my boot.img
Click to expand...
Click to collapse
Flash the attached ZIP. It will reinstall SuperSU and all needed files.

Question How to pull Build.Prop...

Here's where I'm at. I've got the system to give me the Mount /System option in recovery, now i just need assistance getting the build.prop pulled to my PC. What's the procedure for pulling the build.prop from the Android to PC via ADB while the system is mounted in recovery? Why am I getting one of these two ADB errors?
Error 1: Connect failed: closed.
error 2: Failed to get feature set: no devices or emulators
OR, am I approaching it wrong?
Thanks in advance,
K0mraid3
you dont need to be in recovery to do it via adb....
adb pull /system/build.prop
that will pull it to where evr you run the adb command
which would be
C;\adb more than likely
or you can choose a destination with
adb pull /system/build.prop c:\buildprop
if you create a folder called "buildprop" in the root directory of c:\
at least thats how i remember doing it many years ago, ive been away for a while at her majesties pleasure, so i cant try it currently as im not rooted
gav83collins said:
you dont need to be in recovery to do it via adb....
adb pull /system/build.prop
that will pull it to where evr you run the adb command
which would be
C;\adb more than likely
or you can choose a destination with
adb pull /system/build.prop c:\buildprop
if you create a folder called "buildprop" in the root directory of c:\
at least thats how i remember doing it many years ago, ive been away for a while at her majesties pleasure, so i cant try it currently as im not rooted
Click to expand...
Click to collapse
Thanks, so far, its still for some reason denying me permission when OS is booted. So i just cant quite figure out where im supposed to execute these commands, is my issue. I can boot directly to BL from recovery menu, but i can also mount system. i think maybe i need sto send command for r/w.. will try that now.
Another question, when i mount /system in recovery, does that carry over on boot?
no you can re mount system via adb though
Code:
$ adb shell
$ su
# mount -o rw,remount /system
gav83collins said:
no you can re mount system via adb though
Code:
$ adb shell
$ su
# mount -o rw,remount /system
Click to expand...
Click to collapse
1.Needs root for this command. If he have rooted device then why so much trouble needed. Simply use root explorer to copy
2.Since long Samsung have removed system from proc/mounts still magisk system_root can be used
3.Even with system in mounts you can't do system rw on S22 because of Samsung have implemented extra layer of protection. Even not with magisk system_root too
Indeed as of now there is no method available to make stock system/vendor/product/odm rw on S22 even with root access.
4.To copy file from system rw mount not needed, ro is fine
dr.ketan said:
1.Needs root for this command. If he have rooted device then why so much trouble needed. Simply use root explorer to copy
2.Since long Samsung have removed system from proc/mounts still magisk system_root can be used
3.Even with system in mounts you can't do system rw on S22 because of Samsung have implemented extra layer of protection. Even not with magisk system_root too
Indeed as of now there is no method available to make stock system/vendor/product/odm rw on S22 even with root access.
4.To copy file from system rw mount not needed, ro is fine
Click to expand...
Click to collapse
im yet to root my device so i cant test but what about
Code:
adb root
adb disable-verity
adb reboot
Then
Code:
adb root
adb remount
gav83collins said:
im yet to root my device so i cant test but what about
Code:
adb root
adb disable-verity
adb reboot
Then
Code:
adb root
adb remount
Click to expand...
Click to collapse
Do you got what I meant?
leave it.
dr.ketan said:
WTF
Do you got what I meant?
leave it.
Click to expand...
Click to collapse
look, there is no need for condescension and bad language, a simple "no" would have sufficed
Lol not meant to hurt you! but on which planet WTF is bad language
Here search WTF on xda
dr.ketan said:
1.Needs root for this command. If he have rooted device then why so much trouble needed. Simply use root explorer to copy
2.Since long Samsung have removed system from proc/mounts still magisk system_root can be used
3.Even with system in mounts you can't do system rw on S22 because of Samsung have implemented extra layer of protection. Even not with magisk system_root too
Indeed as of now there is no method available to make stock system/vendor/product/odm rw on S22 even with root access.
4.To copy file from system rw mount not needed, ro is fine
Click to expand...
Click to collapse
So my device is strange. It doesn't have root, but it indeed shows options in recovery to apply updates from ADB, SD Card aswell as boot directly to BL and to Mount /System, but when I'm booted, the OS is denying me permission to "Su" . I have verified that USB debugging is activated. So I'm trying to see if there's a way to pull the build.prop from Recovery since the Mount /System option is available, but my computer refuses to recognize the device in while in recovery, but easily finds it in Download, BL mode. No FRP lock. No accounts on device. But also no option to unlock bootloader. This device in particular is/was a development sample so I have no clue what the current state of the bootloader etc is in terms of being unlocked prior to me working on it.
It'd also worth noting that this device was loaded with Android 11 when I received it. I'm not kidding. So idk what's going on with this FrankenGalaxy
K0mraid3 said:
It'd also worth noting that this device was loaded with Android 11 when I received it. I'm not kidding. So idk what's going on with this FrankenGalaxy
Click to expand...
Click to collapse
K0mraid3 said:
So my device is strange. It doesn't have root, but it indeed shows options in recovery to apply updates from ADB, SD Card aswell as boot directly to BL and to Mount /System, but when I'm booted, the OS is denying me permission to "Su" . I have verified that USB debugging is activated. So I'm trying to see if there's a way to pull the build.prop from Recovery since the Mount /System option is available, but my computer refuses to recognize the device in while in recovery, but easily finds it in Download, BL mode. No FRP lock. No accounts on device. But also no option to unlock bootloader. This device in particular is/was a development sample so I have no clue what the current state of the bootloader etc is in terms of being unlocked prior to me working on it.
Click to expand...
Click to collapse
These options are normal in stock recovery and can be used only for flashing official zip (OTA), To have root access on your recovery, you needs custom one (TWRP) which is in development stage on S22
Without twrp, You needs to root device (must have oem unlock option in development option) to access system files while you are booted to android.
Android 11 on S22? Can you show me screenshot of settings - about phone - software info?
dr.ketan said:
These options are normal in stock recovery and can be used only for flashing official zip (OTA), To have root access on your recovery, you needs custom one (TWRP) which is in development stage on S22
Without twrp, You needs to root device (must have oem unlock option in development option) to access system files while you are booted to android.
Android 11 on S22? Can you show me screenshot of settings - about phone - software info?
Click to expand...
Click to collapse
Thanks for the clear answer, that's kind of what I'm working on is trying to gain root access, but like you said, I need oem unlocking, which isn't on this device. So I'm trying to find a backdoor/vulnerability that will take me even one step closer to atleast finding a way to set ro.secure. prop. Something VERY interesting I did find, is that if you put the device to Debug medium or high via device keystring activity, and play with the key combos, you can get booted into a mode called RDX, if you plug it into your dev system with the right drivers, it's treats the phone as if it were a Disk and shows a bunch of VZW upgrade software ment for PCs. I've installed it but haven't got it working quite yett.
No idea what you have shown in screenshot, I'd asked something else.
dr.ketan said:
No idea what you have shown in screenshot, I'd asked something else.
Click to expand...
Click to collapse
Maybe Heindall will give me better results. I just refuse to believe the manufacturers have outsmarted us all on this.

Categories

Resources