在Android P之前的ud版本执行adb root;adb remount 是没有问题的,但是在P userdebug版本上执行adb remount会提示以下错误:
remount of the / superblock failed: Permission denied
remount failed
** 原因是android P版本后google启用avb(Android Verified Boot)2.0,verified boot and DM-verity默认启用策略发生了变化。详情如下:**
DM-Verity behavior changes from vboot1.0 to avb2.0.
On vboot1.0, dm-verity is turned off on eng build and is enabled on userdebug/user build.
DM-verity could be disabled with adb (not fastboot) on userdebug build without unlocking device first.
DM-Verity could not be disabled on user build.
On avb2.0, dm-verity behavior are the same on all build variants.
It's turned on by default and could only be disabled after device is unlocked.
dm-verity disable flag is moved from system image dm-verity metadata(vboot1.0) to vbmeta image(avb2.0), and you have two ways to disable it: adb and fastboot.
解决方案:
go to setting -> system -> Developer options -> OEM unlocking(ps:如果发现 OEM unlocking不能打开,需要将MTK_SEC_FASTBOOT_UNLOCK_SUPPORT这个宏改成yes。)
- adb reboot bootloader
- fastboot flashing unlock(ps,可能会识别不到设备,需要将SDK环境更新到最新)
- press volume up key(ps.音量上键不起作用的话需要找驱动修改)
- fastboot reboot
- adb root
- adb disable-verity
- adb reboot
- adb root
- adb remount
在执行上面这些命令的时候,可能会不起作用,需要加上sudo 来执行。