android恢复出厂设置流程图,Android recovery 系统

ui_init():ui.c[UI initialize]

gr_init():minui/graphics.c[set tty0 to graphic mode, open fb0]

ev_init():minui/events.c [open /dev/input/event*]

res_create_surface:minui/resource.c [create surfaces for all bitmaps used later, include icons, bmps]

create 2 threads: progress/input_thread [create progress show and input event handler thread]

get_args():recovery.c

get_bootloader_message():bootloader.c [read mtdblock0(misc partition) 2nd page for commandline]

check if nand misc partition has boot message. If yes, fill argc/argv.

If no, get arguments from /cache/recovery/command, and fill argc/argv.

set_bootloader_message():bootloader.c [set bootloader message back to mtdblock0]

Parser argv[] filled above

register_update_commands():commands.c [ register all commands with name and hook function ]

registerCommand():commands.c

Register command with name, hook, type, cookie.

Commands, e.g: assert, delete, copy_dir, symlink, write_raw_image.

registerFunction():commands.c

Register function with name, hook, cookie.

Function, e.g: get_mark, matches, getprop, file_contains

install_package():

translate_root_path():roots.c [ "SYSTEM:lib" and turns it into a string like "/system/lib", translate the updater.zip path ]

mzOpenZipArchive():zip.c [ open updater.zip file (uncompass) ]

handle_update_package():install.c

verify_jar_signature():verifier.c [ verify signature with keys.inc key; verify manifest and zip package archive ]

verifySignature() [ verify the signature file: CERT.sf/rsa. ]

digestEntry():verifier.c [ get SHA-1 digest of CERT.sf file ]

RSA_verify(public

key:keys.inc, signature:CERT.rsa, CERT.sf's digest):libc/rsa.c [ Verify

a 2048 bit RSA PKCS1.5 signature against an expected SHA-1 hash. Use

public key to decrypt the CERT.rsa to get original SHA digest, then

compare to digest of CERT.sf ]

verifyManifest() [ Get manifest SHA1-Digest from CERT.sf. Then do digest to MANIFEST.MF. Compare them ]

verifyArchive() [ verify all the files in update.zip with digest listed in MANIFEST.MF ]

find_update_script():install.c [ find META-INF/com/google/android/update-script updater script ]

handle_update_script():install.c [ read cmds from script file, and do parser, exec ]

parseAmendScript():amend.c [ call yyparse() to parse to command ]

exeCommandList():install.c

exeCommand():execute.c [ call command hook function ]

erase DATA/CACHE partition

prompt_and_wait():recovery.c [ wait for user input: 1) reboot 2) update.zip 3) wipe data ]

ui_key_xxx get ALT+x keys

1) do nothing

2) install_package('SDCARD:update.zip')

3) erase_root() → format_root_device() DATA/CACHE

may_install_firmware_update():firmware.c

[ remember_firmware_update() is called by write_hboot/radio_image

command, it stores the bootloader image to CACHE partition, and write

update-hboot/radio command to MISC partition for bootloader message to

let bootloader update itself after reboot ]

set_bootloader_message()

write_update_for_bootloader():bootloader.c

[ write firmware image into CACHE partition with update_header,

busyimage and failimage ]

finish_recovery():recovery.c

[ clear the recovery command and prepare to boot a (hopefully working)

system, copy our log file to cache as well (for the system to read), and

record any intent we were asked to communicate back to the system. ]

reboot()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值