Android10.0 OTA 错误解决办法(@/cache/recovery/block.map‘ failed)
发布日期:2021-06-29 13:07:42 浏览次数:5 分类:技术文章

本文共 4414 字,大约阅读时间需要 14 分钟。

最开始犯的低级错误

验证安装包的时候出现了 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=1I//system/bin/uncrypt: uncrypt called in debug mode, skip socket communicationI/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=1I//system/bin/uncrypt: update package is "/data/media/update.zip"I//system/bin/uncrypt: encryptable: yesI//system/bin/uncrypt: encrypted: yesI//system/bin/uncrypt: writing block map /cache/recovery/block.mapI//system/bin/uncrypt: block size: 4096 bytesI//system/bin/uncrypt: file size: 736913983 bytes, 179911 blocksI//system/bin/uncrypt: uncrypt succeededD/RecoverySystem: try uncrypt-cmd!!!

失败

I sysUpgrade:: verifyPackage is completed and it okI sysUpgrade:: It will install packageW 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=0I /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=0I /system/bin/uncrypt: encryptable: yesI /system/bin/uncrypt: encrypted: yesI /system/bin/uncrypt: writing block map /cache/recovery/block.mapI /system/bin/uncrypt: block size: 4096 bytesI /system/bin/uncrypt: file size: 736913983 bytes, 179911 blocksE /system/bin/uncrypt: failed to open /data/media/update.zip for reading: Permission deniedI /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 };

至此问题解决

转载地址:https://cczheng.blog.csdn.net/article/details/115394237 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Android 11---WMS之横竖屏切换流程详解
下一篇:AndroidQ 以上禁用 wifi 随机mac功能

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月18日 10时52分27秒