linux下安卓刷机脚本

0x00 前几天尝试了下在linux下刷安卓,写出来做学习交流。fastboot 暴力刷机。


0x01 flash_all.sh

echo "ido Fastboot Tool Ver 4.0"

fastboot $* getvar product 2>&1 | grep "^product: ido"

if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
fastboot $* flash partition `dirname $0`/images/gpt_both0.bin
fastboot $* flash tz `dirname $0`/images/tz.mbn
fastboot $* flash sbl1 `dirname $0`/images/sbl1.mbn
fastboot $* flash rpm `dirname $0`/images/rpm.mbn
fastboot $* flash aboot `dirname $0`/images/emmc_appsboot.mbn
fastboot $* flash hyp `dirname $0`/images/hyp.mbn

fastboot $* flash tzbak `dirname $0`/images/tz.mbn
fastboot $* flash sbl1bak `dirname $0`/images/sbl1.mbn
fastboot $* flash rpmbak `dirname $0`/images/rpm.mbn
fastboot $* flash abootbak `dirname $0`/images/emmc_appsboot.mbn
fastboot $* flash hypbak `dirname $0`/images/hyp.mbn

fastboot $* erase boot
fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
fastboot $* flash system `dirname $0`/images/system.img
fastboot $* flash cache `dirname $0`/images/cache.img
fastboot $* flash userdata `dirname $0`/images/userdata.img
fastboot $* flash recovery `dirname $0`/images/recovery.img
fastboot $* flash boot `dirname $0`/images/boot.img

fastboot $* flash misc `dirname $0`/images/misc.img
fastboot $* flash splash `dirname $0`/images/splash.img
fastboot $* flash cust `dirname $0`/images/cust.img
fastboot $* reboot
 清空所有数据。
0x02 flash_all_except_data_storage.sh

echo "ido Fastboot Tool Ver 4.0"

fastboot $* getvar product 2>&1 | grep "^product: ido"

if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
fastboot $* flash partition `dirname $0`/images/gpt_both0.bin
fastboot $* flash tz `dirname $0`/images/tz.mbn
fastboot $* flash sbl1 `dirname $0`/images/sbl1.mbn
fastboot $* flash rpm `dirname $0`/images/rpm.mbn
fastboot $* flash aboot `dirname $0`/images/emmc_appsboot.mbn
fastboot $* flash hyp `dirname $0`/images/hyp.mbn

fastboot $* flash tzbak `dirname $0`/images/tz.mbn
fastboot $* flash sbl1bak `dirname $0`/images/sbl1.mbn
fastboot $* flash rpmbak `dirname $0`/images/rpm.mbn
fastboot $* flash abootbak `dirname $0`/images/emmc_appsboot.mbn
fastboot $* flash hypbak `dirname $0`/images/hyp.mbn

fastboot $* erase boot
fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
fastboot $* flash system `dirname $0`/images/system.img
fastboot $* flash cache `dirname $0`/images/cache.img

fastboot $* flash recovery `dirname $0`/images/recovery.img
fastboot $* flash boot `dirname $0`/images/boot.img

fastboot $* flash misc `dirname $0`/images/misc.img
fastboot $* flash splash `dirname $0`/images/splash.img
fastboot $* reboot
不清空用户数据。

0x03 flash_all_lock.sh

echo "ido Fastboot Tool Ver 3.0"

fastboot $* getvar product 2>&1 | grep "^product: ido"

if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
fastboot $* flash partition `dirname $0`/images/gpt_both0.bin
fastboot $* flash tz `dirname $0`/images/tz.mbn
fastboot $* flash sbl1 `dirname $0`/images/sbl1.mbn
fastboot $* flash rpm `dirname $0`/images/rpm.mbn
fastboot $* flash aboot `dirname $0`/images/emmc_appsboot.mbn
fastboot $* flash hyp `dirname $0`/images/hyp.mbn

fastboot $* flash tzbak `dirname $0`/images/tz.mbn
fastboot $* flash sbl1bak `dirname $0`/images/sbl1.mbn
fastboot $* flash rpmbak `dirname $0`/images/rpm.mbn
fastboot $* flash abootbak `dirname $0`/images/emmc_appsboot.mbn
fastboot $* flash hypbak `dirname $0`/images/hyp.mbn

fastboot $* erase boot
fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
fastboot $* flash system `dirname $0`/images/system.img
fastboot $* flash cache `dirname $0`/images/cache.img
fastboot $* flash userdata `dirname $0`/images/userdata.img
fastboot $* flash recovery `dirname $0`/images/recovery.img
fastboot $* flash boot `dirname $0`/images/boot.img
fastboot $* flash persist `dirname $0`/images/persist.img

fastboot $* flash misc `dirname $0`/images/misc.img
fastboot $* flash splash `dirname $0`/images/splash.img
fastboot $* flash cust `dirname $0`/images/cust.img
fastboot $* oem lock
fastboot $* reboot
锁OEM。

0x04 其中images是文件目录,机型不一样线刷包里面的文件不一样,根据自己机型进行修改。

0x05 如果用第三方recovery,可以尝试在第三方recovery下使用 adb sideload images.zip(images.zip是当前电脑目录下的文件)



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值