Android10.0 OTA 错误解决办法(@/cache/recovery/block.map‘ failed)

简介: Android10.0 OTA 错误解决办法(@/cache/recovery/block.map‘ failed)

最开始犯的低级错误


验证安装包的时候出现了 java.security.SignatureException: no signature in file (no footer) 这个错误


这个是由于拷贝的 update.zip 文件不对引起的 校验的时候 RecoverySystem 会读取zip文件前6个字节判断


正确的完整升级包拷贝 out 目录下 system.img 同级下 full_xxxx-ota-mp1xx.zip


错误的升级包我拷贝了 obj\PACKAGING\target_files_intermediates 目录下的 full_xxxx.zip


这个目录下的zip是用来制作差异包的,真是憨憨了。


言归正传,当校验通过后重启进入recovery界面时,就会出现 @/cache/recovery/block.map’ failed 错误,


这个错误你需要eng版本才能看见,user版本只是一个小机器人error然后自动重启。


设备重启后 adb pull /cache/recovery/ 查看 last_log

[    0.166714] I:Got 3 arguments from /cache/recovery/command
[    0.180099] /system/bin/recovery: unrecognized option `--update_package=@/cache/recovery/block.map'
[    0.183039] Loading make_device from librecovery_ui_ext.so
[    0.192444] I:Brightness: 127 (50%)
[    0.204379] Failed to find/open a drm device: No such file or directory
[    0.204902] fb0 reports (possibly inaccurate):
[    0.204925]   vi.bits_per_pixel = 32
[    0.204942]   vi.red.offset   =   0   .length =   8
[    0.204959]   vi.green.offset =   8   .length =   8
[    0.204975]   vi.blue.offset  =  16   .length =   8
[    0.235279] framebuffer: 0 (800 x 1280)
[    0.277860]           erasing_text: zh_CN (55 x 19 @ 2540)
[    0.282375]        no_command_text: zh_CN (42 x 19 @ 2540)
[    0.286267]             error_text: zh_CN (46 x 19 @ 2540)
[    0.287852] E:Failed to load bitmap cancel_wipe_data_text (error -1)
[    0.288308] E:Failed to load bitmap factory_data_reset_text (error -1)
[    0.288725] E:Failed to load bitmap try_again_text (error -1)
[    0.289150] E:Failed to load bitmap wipe_data_confirmation_text (error -1)
[    0.289577] E:Failed to load bitmap wipe_data_menu_header_text (error -1)
[    0.553152] __bionic_open_tzdata: couldn't find any tzdata when looking for America/New_York!
[    0.553469] I:Starting recovery (pid 320) on Mon Feb  1 02:07:18 2021
[    0.553647] I:
[    0.554056] I:locale is [zh_CN]
[    0.562685] SELinux:  Skipping /product_file_contexts:  empty file
[    0.563427] SELinux:  Skipping /odm_file_contexts:  empty file
[    0.563908] SELinux: Loaded file_contexts

看着错误信息是和 SELinux 权限相关,将 SELinux 临时关闭后重新升级了一次发现可成功升级,这样确定了和 SELinux 相关

那么我们要找到 user 版本缺少的权限,设备重启前看到的关键日志

成功

D/RecoverySystem:  try uncryptUpdatePacks!!!
D/RecoverySystem:  try uncrypt-block!!!
I/uncrypt: type=1400 audit(0.0:2057): avc: denied { search } for name="gsi" dev="mmcblk0p10" ino=16 scontext=u:r:uncrypt:s0 tcontext=u:object_r:gsi_metadata_file:s0 tclass=dir permissive=1
I//system/bin/uncrypt: uncrypt called in debug mode, skip socket communication
I/uncrypt: type=1400 audit(0.0:2058): avc: denied { write } for name="update.zip" dev="mmcblk0p36" ino=1368153 scontext=u:r:uncrypt:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
I//system/bin/uncrypt: update package is "/data/media/update.zip"
I//system/bin/uncrypt: encryptable: yes
I//system/bin/uncrypt:   encrypted: yes
I//system/bin/uncrypt: writing block map /cache/recovery/block.map
I//system/bin/uncrypt:  block size: 4096 bytes
I//system/bin/uncrypt:   file size: 736913983 bytes, 179911 blocks
I//system/bin/uncrypt: uncrypt succeeded
D/RecoverySystem:  try uncrypt-cmd!!!

失败

I sysUpgrade:: verifyPackage is completed and it ok
I sysUpgrade:: It will install package
W RecoverySystem: !!! REBOOTING TO INSTALL /data/media/update.zip !!!
D RecoverySystem:  try uncryptUpdatePacks!!!
D RecoverySystem:  try uncrypt-block!!!
W uncrypt : type=1400 audit(0.0:27111): avc: denied { search } for name="/" dev="mmcblk0p10" ino=2 scontext=u:r:uncrypt:s0 tcontext=u:object_r:metadata_file:s0 tclass=dir permissive=0
I /system/bin/uncrypt: update package is "/data/media/update.zip"
01-31 21:07:45.012  5554  5554 W uncrypt : type=1400 audit(0.0:27112): avc: denied { write } for name="update.zip" dev="mmcblk0p36" ino=1368153 scontext=u:r:uncrypt:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=0
I /system/bin/uncrypt: encryptable: yes
I /system/bin/uncrypt:   encrypted: yes
I /system/bin/uncrypt: writing block map /cache/recovery/block.map
I /system/bin/uncrypt:  block size: 4096 bytes
I /system/bin/uncrypt:   file size: 736913983 bytes, 179911 blocks
E /system/bin/uncrypt: failed to open /data/media/update.zip for reading: Permission denied
I /system/bin/uncrypt: uncrypt failed

根据 avc denied 权限,查找 uncrypt.te

device/mediatek/sepolicy/basic/non_plat/uncrypt.te

allow uncrypt metadata_file:dir { search };
allow uncrypt media_rw_data_file:file { write };

至此问题解决


Android 9 § recovery升级Map of ‘@/cache/recovery/block.map‘ failed问题分析指南

recovery 升级’@/cache/recovery/block.map’ failed错误问题

目录
相关文章
|
8月前
|
定位技术 API 开发工具
Android 按照步骤接入百度地图API,定位显示不了解决办法
Android 按照步骤接入百度地图API,定位显示不了解决办法
225 0
|
2月前
|
编译器 开发工具 Android开发
|
8月前
|
Android开发
android.view.WindowLeaked的解决办法
我们知道Android的每一个Activity都有个WindowManager窗体管理器,同样,构建在某个Activity之上的对话框、PopupWindow也有相应的WindowManager窗体管理器。
60 0
|
8月前
|
Android开发
Android 使用DataBinding时 将布局页面转换为数据绑定布局(Convert to data binding layout) 不出现提示解决办法
Android 使用DataBinding时 将布局页面转换为数据绑定布局(Convert to data binding layout) 不出现提示解决办法
90 0
|
8月前
|
Android开发
Android中使用Tortoise SVN遇到代码被锁定的解决办法
Android中使用Tortoise SVN遇到代码被锁定的解决办法
74 0
|
11月前
|
监控 开发工具 Android开发
AMD机器:Android Studio启动模拟器提示“HAXM is not installed”的解决办法
AMD机器:Android Studio启动模拟器提示“HAXM is not installed”的解决办法
1470 0
|
12月前
|
Java Android开发 开发者
Android9.0 无锁屏下连续锁屏-解屏2次,画面点击无响应 bug 解决办法
Android9.0 无锁屏下连续锁屏-解屏2次,画面点击无响应 bug 解决办法
98 0
|
12月前
|
Android开发
Permission failure: android.permission.CAPTURE_AUDIO_OUTPUT 解决办法
Permission failure: android.permission.CAPTURE_AUDIO_OUTPUT 解决办法
288 0
|
Android开发
Android Studio 编译输出中文乱码的解决办法
Android Studio 编译输出中文乱码的解决办法
95 0
|
IDE Java 开发工具
解决办法:eclipse查看安卓8.0及以上设备的LOG
解决办法:eclipse查看安卓8.0及以上设备的LOG
77 0