Android Recovery模式
来源: ChinaUnix博客 日期: 2009.04.25 22:58 (共有条评论) 我要评论
Android Recovery模式
(muddogxp 原创,转载请注明) Recovery简介
Android利用Recovery模式,进行恢复出厂设置,OTA升级,patch升级及firmware升级。
升级一般通过运行升级包中的META-INF/com/google/android/update-script脚本来执行自定义升级,脚本中是一组recovery系统能识别的UI控制,文件系统操作命令,例如write_raw_image(写FLASH分区),copy_dir(复制目录)。该包一般被下载至SDCARD和CACHE分区下。如果对该包内容感兴趣,可以从http://forum.xda-developers.com/showthread.php?t=442480下载JF升级包来看看。
升级中还涉及到包的数字签名,签名方式和普通JAR文件签名差不错。公钥会被硬编译入recovery,编译时生成在:out/target/product/XX/obj/PACKAGING/ota_keys_inc_intermediates/keys.inc G1中的三种启动模式 MAGIC KEY:
?
camera +
power:bootloader模式,ADP里则可以使用fastboot模式
?
home + power:recovery模式
?
正常启动
Bootloader正常启动,又有三种方式,按照BCB(Bootloader Control Block, 下节介绍)中的command分类:
?
command == 'boot-recovery'
→ 启动recovery.img。recovery模式
?
command ==
'update-radio/hboot' → 更新firmware(bootloader)
?
其他 → 启动boot.img
Recovery涉及到的其他系统及文件
? CACHE分区文件
Recovery
工具通过NAND
cache分区上的三个文件和主系统打交道。主系统(包括恢复出厂设置和OTA升级)可以写入recovery所需的命令,读出recovery过程中的LOG和intent。
o /cache/recovery/command:
recovery命令,由主系统写入。所有命令如下:
? --send_intent=anystring
- write the text out to recovery.intent
? --update_package=root:path
- verify install an OTA package file
? --wipe_data
- erase user data (and cache), then reboot
? --wipe_cache
- wipe cache (but not user data), then reboot
Android Recovery模式与Recovery界面的中文详细说明



