P平台之后fastboot加密后adb无法push问题解决方案----需要解锁bootloader

在android P版本上如果按照“FAQ18076 android 6.0 M userdebug版本执行adb remount失败”的做法在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

如何确认 bootloader unlock 解锁成功

1、fastboot 模式下按音量上键后是否提示 Unlock Pass…return to fastboot in 3s

2、fastboot 模式下 fastboot getvar unlocked,是否显示 unlocked: yes

3、重启后界面是否显示
orange state
Your deivce has been unlocked and can’t be trusted
your device will boot in 5 seconds

4、解锁成功后检查这两个属性会从
[ro.boot.flash.locked]: [1]
[ro.boot.verifiedbootstate]: [green]
变成
[ro.boot.flash.locked]: [0]
[ro.boot.verifiedbootstate]: [orange]

猜你喜欢

转载自blog.csdn.net/zhangqi6627/article/details/107705878