Closed GunjanSkry closed 1 year ago
It seems that adb shell can get root access. https://stackoverflow.com/a/73257890
So if you try
adb shell
su
it works on your phone? Because that doesn't work for me on multiple devices
Ok, I got it working on an emulator
Since we do not use shell ls
, there is no point in using shell root
So if you try
adb shell su
it works on your phone? Because that doesn't work for me on multiple devices
Ok, I got it working on an emulator
Sorry for the late reply, yes it works on any magisk rooted phone. Since adb root
is not allowed after Android 10, apparently this is the only way to get root access.
So what I was trying to do is that I wanted to copy app data into data/data dir in my device but in order to do so you need root I looked at your code and I found that you are using adb root
to get access. Now my device is running on Android 11 so it does not work.
I solution that I looked at was that you first copy to temp location on phone using adb push
and then using adb shell, su
you will get root access now you can copy the data from temp location to wherever you want in side root of the device. Hope I was clear in my explanation.
Also if anyone came across this issue, one can try this https://liwugang.github.io/2021/07/11/magisk_enable_adbr_root.html
One of the devices I test with is OnePlus 3T with LineageOS Android 11.
On this phone, adb root
works for me, but running su
in shell gives me:
/system/bin/sh: su: inaccessible or not found
I also tested this on an emulator - API 32 (Android 12) with no Google Play.
On it, both adb root
and shell su
are working.
As I mentioned before, we use adb ls
to get folder structure.
And as it cannot benefit from shell su
, I do not see the point in adding it.
Switching to shell ls
is highly discouraged as it wasn't really built for parsing, and has inconsistent behavior across devices.
If you think this is a useful addition specifically for your case, we can discuss adding a non-global feature for that (like copy as root / push as root). But then again, you probably wouldn't be able to see those files in the destination.
Unable to get root access on Android 11 getting the following status on root enable -> [ Root Access: Status Forbidden ].