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错误问题

目录
相关文章
|
6月前
|
Android开发
Android Mediatek 增加Recovery模式下读cmdline的强制工厂重置选项
Android Mediatek 增加Recovery模式下读cmdline的强制工厂重置选项
59 0
|
6月前
|
算法 搜索推荐 Android开发
android的A/B到底是什么?OTA升级又是什么?
android的A/B到底是什么?OTA升级又是什么?
227 0
|
6月前
|
Android开发
【Bug】Android resource linking failed和error: failed linking references.
【Bug】Android resource linking failed和error: failed linking references.
|
6月前
|
Android开发
如何在Android真机上检测是否有Google Map add-on
如何在Android真机上检测是否有Google Map add-on
73 3
|
3月前
|
安全 Java Android开发
【Android P】OTA升级包定制,移除不需要更新的分区,重新打包签名
如何解压OTA升级包、编辑升级包内容(例如移除不需要更新的分区)、重新打包、签名以及验证OTA文件的过程。
279 2
【Android P】OTA升级包定制,移除不需要更新的分区,重新打包签名
|
2月前
|
Android开发
Android中SurfaceView的双缓冲机制和普通View叠加问题解决办法
本文介绍了 Android 平台上的 SurfaceView,这是一种高效的图形渲染控件,尤其适用于视频播放、游戏和图形动画等场景。文章详细解释了其双缓冲机制,该机制通过前后缓冲区交换来减少图像闪烁,提升视觉体验。然而,SurfaceView 与普通 View 叠加时可能存在 Z-Order 不一致、同步问题及混合渲染难题。文中提供了使用 TextureView、调整 Z-Order 和创建自定义组合控件等多种解决方案。
127 9
|
6月前
|
Android开发
Caused by: android.system.ErrnoException: android_getaddrinfo failed: EACCES (Permission denied)
Caused by: android.system.ErrnoException: android_getaddrinfo failed: EACCES (Permission denied)
71 3
|
6月前
Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associate
Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associate
183 2
|
3月前
|
Android开发
Android Studio: 解决Gradle sync failed 错误
本文介绍了解决Android Studio中出现的Gradle同步失败错误的步骤,包括从`gradle-wrapper.properties`文件中获取Gradle的下载链接,手动下载Gradle压缩包,并替换默认下载路径中的临时文件,然后重新触发Android Studio的"Try Again"来完成同步。
1346 0
Android Studio: 解决Gradle sync failed 错误
|
3月前
|
开发工具 Android开发
解决Manifest merger failed : android:exported needs to be explicitly specified for <activity>
解决Manifest merger failed : android:exported needs to be explicitly specified for <activity>
79 1