Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magisk Hide on ADB #688

Closed
zeromod opened this issue Oct 18, 2018 · 10 comments
Closed

Magisk Hide on ADB #688

zeromod opened this issue Oct 18, 2018 · 10 comments

Comments

@zeromod
Copy link

zeromod commented Oct 18, 2018

ADB is failing to detect root due to magisk hide.
Scenario : adb root command from pc doesn't work when magisk hide is activated, when disable it and rebooted, command works.
Magisk version : 17.2
Android : 9.0
Device : mido

@vvb2060
Copy link
Collaborator

vvb2060 commented Oct 18, 2018

Intended behavior. You can use su after adb shell.

@zeromod
Copy link
Author

zeromod commented Oct 18, 2018

I want to push an apk from pc to /system via adb push by remounting as rw after a adb root command.

@vvb2060
Copy link
Collaborator

vvb2060 commented Oct 18, 2018

su -mm use global mount namespace

@zeromod zeromod closed this as completed Oct 18, 2018
@nlburgin
Copy link

nlburgin commented May 5, 2019

If this is intended behavior, then it needs to be documented better, somewhere besides here.

Like in the README.md and/or in here

It may be intended behavior, but unless Magisk warns that this is going to happen, then it is very counter-intuitive for the user. The user doesn't understand why they get a adbd cannot run as root in production builds message, and when they search the internet for answers, usually they find instructions on how to patch the boot img to set the security settings in default.prop (except in this case, they're already set and Magisk is just hiding them).

I spent the whole day assuming it was my ROM that had failed to set up its adbd as root-capable, but it turned out that Magisk Hide was hiding the relevant properties, not just from apps that were specifically enabled for Magisk Hide, but from the whole system (including from adbd which is something that one would intuitively expect to have access to root).

And simply running adb shell and then su is only a partial workaround because it still doesn't give root access to adb push, adb pull, etc. Unless I'm mistaken, running su from adb shell doesn't really give you any more access than you'd have by running su from the terminal app inside the phone; it doesn't give you the full functionality of a rooted Debug Bridge.

If the design of Magisk Hide is inherently incompatible with rooted debug bridge, that's fine, but users should at least be warned of this incompatibility, preventing it from appearing as unexpected and confusing behavior.

EDIT: And the documentation should also note that (at least on Android 9) disabling Hide to get a plain umasked rooted system, doesn't seem to take full effect until after a reboot. That was the only way I could get rooted adb working, was to reboot the phone after disabling Hide.

If turning Hide off is supposed to work without a reboot, then I can file a separate bug report for that. But if it's intended behavior, then once again that should be made more obvious with some sort of documentation somewhere.

EDIT 2: I'm making this it's own issue since I'm not sure it will get noticed here. I don't think that's really redundant/a duplicate issue if it's phrased as a documentation bug rather than a functionality bug.

@edrex
Copy link

edrex commented May 12, 2019

I am seeing the message with adb root but disabling Magisk Hide and rebooting doesn't help (Bullhead/stock 8.1.0). Is there some other condition under which this is known to happen?

@nyanpasu64
Copy link

Same issue, moto g5 plus, potter, stock ROM with ElementalX kernel to fix magisk module loopback mounting, Android 7.0. Disabling Magisk Hide and rebooting still produces adbd cannot run as root in production builds.

@daedroza
Copy link

daedroza commented Aug 31, 2019

@nlburgin : Thanks for explaining things clearly. Clearly, A/B is just a waste of time. I have to flash whole ROM for one line of code change and it is getting on my nerves.

@ytrezq
Copy link

ytrezq commented Mar 30, 2020

Intended behavior. You can use su after adb shell.

@vvb2060 this is problematic because it also means it‘s impossible to use adb push or adb pull commands which would require rooting.
Something impossible to do through the shell especially if the files are too large.

@ytrezq
Copy link

ytrezq commented Mar 30, 2020

Same issue, moto g5 plus, potter, stock ROM with ElementalX kernel to fix magisk module loopback mounting, Android 7.0. Disabling Magisk Hide and rebooting still produces adbd cannot run as root in production builds.

@nyanpasu64 you have to set ro.adb.secure=0 and ro.secure=0 and ro.oem_unlock_supported=1 and ro.debuggable=1 in order to get the adb binary to accept running as root (accept to perform the steps required to be launched as root).

But depending on your case (like mine) this isn’t enough as oem security measures might prevent the steps done by the adb binary to become successful.

@vaishnavmhetre
Copy link

I've observed that Hsbc India app uses adb shell to detect root. Hence Magisk Hide fails whatsoever.

Any probable solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants