现在Android版本更新太快,2.1是最普遍的版本,不过马上都开始升级2.2版本了,目前网路上提供了很多自制作的andorid ROM,通过刷机工具进行刷机,最普遍的是利用android的recovery机制进行update,现将recovery的
内部工作原理摘录如下(摘自recovery源码注释,等有空时候我来翻译下)
/*
* The recovery tool communicates with the main system through /cache files.
* /cache/recovery/command - INPUT - command line for tool, one arg per line
* /cache/recovery/log - OUTPUT - combined log file from recovery run(s)
* /cache/recovery/intent - OUTPUT - intent that was passed in
*
* The arguments which may be supplied in the recovery.command file:
* --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
* --set_encrypted_filesystem=on|off - enables / diasables encrypted fs
*
* After completing, we remove /cache/recovery/command and reboot.
* Arguments may also be supplied in the bootloader control block (BCB).
* These important scenarios must be safely restartable at any point:
*
* FACTORY RESET
* 1. user selects "factory reset"
* 2. main system writes "--wipe_data" to /cache/recovery/command
* 3. main system reboots into recovery
* 4. get_args() writes BCB with "boot-recovery" and "--wipe_data"
* -- after this, rebooting will restart the erase --
* 5. erase_root() reformats /data
* 6. erase_root() reformats /cache
* 7. finish_recovery() erases BCB
* -- after this, rebooting will restart the main system --
* 8. main() calls reboot() to boot main system
*
* OTA INSTALL
* 1. main system downloads OTA package to /cache/some-filename.zip
* 2. main system writes "--update_package=CACHE:some-filename.zip"
* 3. main system reboots into recovery
* 4. get_args() writes BCB with "boot-recovery" and "--update_package=..."
* -- after this, rebooting will attempt to reinstall the update --
* 5. install_package() attempts to install the update
* NOTE: the package install must itself be restartable from any point
* 6. finish_recovery() erases BCB
* -- after this, rebooting will (try to) restart the main system --
* 7. ** if install failed **
* 7a. prompt_and_wait() shows an error icon and waits for the user
* 7b; the user reboots (pulling the battery, etc) into the main system
* 8. main() calls maybe_install_firmware_update()
* ** if the update contained radio/hboot firmware **:
* 8a. m_i_f_u() writes BCB with "boot-recovery" and "--wipe_cache"
* -- after this, rebooting will reformat cache & restart main system --
* 8b. m_i_f_u() writes firmware image into raw cache partition
* 8c. m_i_f_u() writes BCB with "update-radio/hboot" and "--wipe_cache"
* -- after this, rebooting will attempt to reinstall firmware --
* 8d. bootloader tries to flash firmware
* 8e. bootloader writes BCB with "boot-recovery" (keeping "--wipe_cache")
* -- after this, rebooting will reformat cache & restart main system --
* 8f. erase_root() reformats /cache
* 8g. finish_recovery() erases BCB
* -- after this, rebooting will (try to) restart the main system --
* 9. main() calls reboot() to boot main system
*
* ENCRYPTED FILE SYSTEMS ENABLE/DISABLE
* 1. user selects "enable encrypted file systems"
* 2. main system writes "--set_encrypted_filesystem=on|off" to
* /cache/recovery/command
* 3. main system reboots into recovery
* 4. get_args() writes BCB with "boot-recovery" and
* "--set_encrypted_filesystems=on|off"
* -- after this, rebooting will restart the transition --
* 5. read_encrypted_fs_info() retrieves encrypted file systems settings from /data
* Settings include: property to specify the Encrypted FS istatus and
* FS encryption key if enabled (not yet implemented)
* 6. erase_root() reformats /data
* 7. erase_root() reformats /cache
* 8. restore_encrypted_fs_info() writes required encrypted file systems settings to /data
* Settings include: property to specify the Encrypted FS status and
* FS encryption key if enabled (not yet implemented)
* 9. finish_recovery() erases BCB
* -- after this, rebooting will restart the main system --
* 10. main() calls reboot() to boot main system
*/
分享到:
相关推荐
Android系统Recovery模式的工作原理 在使用update.zip包升级时怎样从主系统(main system)重启进入Recovery模式,进入Recovery模式后怎样判断做何种操作,以及怎样获得主系统发送给Recovery服务的命令,这一系列...
Android系统ROM刷机原理及ROM制作技术初探
高通平台的 小辣椒android刷机 USB驱动
Android系统的三种启动模式 ... 无论将升级包放在什么位置,在使用update.zip更新时都会重启并进入Recovery模式,然后启动recovery服务(/sbin/recovery)来安装我们的update.zip包。 ............
Fastboot(Android刷机工具)
解决Android手机刷机失败 无法进入Recovery模式 无法开机
Recovery刷机图文教程
ANDROID刷机驱动,fastbootANDROID刷机驱动,fastboot ANDROID刷机驱动,fastbootANDROID刷机驱动,fastboot ANDROID刷机驱动,fastbootANDROID刷机驱动,fastboot
刷机工具,RECOVERY格式化了手机下的所有分区,结果再开机时,机子一抖就再也没半点反应了,彻底黑砖。经过在各论坛搜近一周时间,参考了A820E和小米MIFLASH才把小820救回来
安卓刷机教程,Recovery刷机,HD2刷机教程.pdf
一、刷机原理 说起来,刷机就是两种方法: 一是recovery方法,就是我们平时将update.zip入到SD卡,然后alt-s的方法,这种方法是调用了recovery的方法将各种img或文件进行复制等操作。 二是fastboot方法,这个方法...
Android 刷机工具包 刷机驱动 刷机软件
Windows系统制作安卓Android手机系统刷机ROM
手把手教你Android如何刷机手把手教你Android如何刷机
小米6一键刷机工具recovery.rar
OPPO VIVO手机 10 11版本安卓刷机原理解释工作原理分析.zip
该工具可以刷入中文版的recovery以及root权限获取,本人中兴u930测试通过
用刷机精灵 或 甜椒刷机助手 均可刷机 各种智能手机 出了苹果 只可刷安卓系统
android 刷机包 修改 移植 里程碑