To (re-)enable adb root
you have to modify your prop.default
file. This file was traditionally named default.prop
and stored inside the ramdisk of boot.img
- however, for system-as-root devices it is inside /vendor
.
change the line ro.build.type=eng
into:
ro.build.type=userdebug
from the Magisk Troubleshoot Wiki:
ADB cannot run as root in production builds
If you're having issues running the ADB root command after installing Magisk this is because of MagiskHide setting a few prop values to known "safe" values. You can get ADB root working again by turning of MagiskHide and rebooting, but if you need MagiskHide for some app or service this could quickly become annoying.
A more convenient solution is to reset ro.build.type
and ro.debuggable
to their original values (userdebug
and 1
respectively). This can be done by using the Magisk resetprop tool (see the Magisk Documentation for details), either by running it directly in a terminal emulator, in a late_start service boot script, or by using the MagiskHide Props Config Magisk module's "Edit MagiskHide props" function.