linux下安卓刷机脚本
linux下安卓刷机脚本
0x00 前几天尝试了下在linux下刷安卓,写出来做学习交流。fastboot 暴力刷机。
0x01 flash_all.sh
(代码如下:)
[plain] view plain copy
1.echo "ido Fastboot Tool Ver 4.0"
2.
3.fastboot $* getvar product 2>&1 | grep "^product: ido"
4.
5.if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
6.fastboot $* flash partition `dirname $0`/images/gpt_both0.bin
7.fastboot $* flash tz `dirname $0`/images/tz.mbn
8.fastboot $* flash sbl1 `dirname $0`/images/sbl1.mbn
9.fastboot $* flash rpm `dirname $0`/images/rpm.mbn
10.fastboot $* flash aboot `dirname $0`/images/emmc_appsboot.mbn
11.fastboot $* flash hyp `dirname $0`/images/hyp.mbn
12.
13.fastboot $* flash tzbak `dirname $0`/images/tz.mbn
14.fastboot $* flash sbl1bak `dirname $0`/images/sbl1.mbn
15.fastboot $* flash rpmbak `dirname $0`/images/rpm.mbn
16.fastboot $* flash abootbak `dirname $0`/images/emmc_appsboot.mbn
17.fastboot $* flash hypbak `dirname $0`/images/hyp.mbn
18.
19.fastboot $* erase boot
20.fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
21.fastboot $* flash system `dirname $0`/images/system.img
22.fastboot $* flash cache `dirname $0`/images/cache.img
23.fastboot $* flash userdata `dirname $0`/images/userdata.img
24.fastboot $* flash recovery `dirname $0`/images/recovery.img
25.fastboot $* flash boot `dirname $0`/images/boot.img
26.
27.fastboot $* flash misc `dirname $0`/images/misc.img
28.fastboot $* flash splash `dirname $0`/images/splash.img
29.fastboot $* flash cust `dirname $0`/images/cust.img
30.fastboot $* reboot
清空所有数据。
0x02 flash_all_except_data_storage.sh
(代码如下:)
[plain]
1.echo "ido Fastboot Tool Ver 4.0"
2.
3.fastboot $* getvar product 2>&1 | grep "^product: ido"
4.
5.if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
6.fastboot $* flash partition `dirname $0`/images/gpt_both0.bin
7.fastboot $* flash tz `dirname $0`/images/tz.mbn
8.fastboot $* flash sbl1 `dirname $0`/images/sbl1.mbn
9.fastboot $* flash rpm `dirname $0`/images/rpm.mbn
10.fastboot $* flash aboot `dirname $0`/images/emmc_appsboot.mbn
11.fastboot $* flash hyp `dirname $0`/images/hyp.mbn
12.
13.fastboot $* flash tzbak `dirname $0`/images/tz.mbn
14.fastboot $* flash sbl1bak `dirname $0`/images/sbl1.mbn
15.fastboot $* flash rpmbak `dirname $0`/images/rpm.mbn
16.fastboot $* flash abootbak `dirname $0`/images/emmc_appsboot.mbn
17.fastboot $* flash hypbak `dirname $0`/images/hyp.mbn
18.
19.fastboot $* erase boot
20.fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
21.fastboot $* flash system `dirname $0`/images/system.img
22.fastboot $* flash cache `dirname $0`/images/cache.img
23.
24.fastboot $* flash recovery `dirname $0`/images/recovery.img
25.fastboot $* flash boot `di