一、准备工具
(1)驱动,(MotorolaDeviceManager),自行百度下最新的即可;
(2)准备ADB工具,(adb工具包 1.0.32),我试过下最新的有问题;
(3)准备镜像,请下载第一版本的(https://mirrors.lolinet.com/firmware/moto/nash/official/ATT/XT1789-04_NASH_ATT_8.0.0_OCX27.109-47_subsidy-ATT_regulatory-DEFAULT_CFC.xml.zip)。
我使用工具进行最新的版本刷机会出现以下报错:
D:\platform-tools>fastboot flash bootloader bootloader.img
(bootloader) is-logical:bootloader: not found
Sending ‘bootloader‘ (9884 KB) OKAY [ 0.351s]
Writing ‘bootloader‘ (bootloader) Validating ‘bootloader.default.xml‘
(bootloader) Committing ‘bootloader.default.xml‘
(bootloader) - flashing ‘xbl.elf‘ to ‘xbl‘
(bootloader) - flashing ‘cmnlib.mbn‘ to ‘cmnlib‘
(bootloader) - flashing ‘cmnlib64.mbn‘ to ‘cmnlib64‘
(bootloader) - flashing ‘abl.elf‘ to ‘abl‘
(bootloader) - flashing ‘keymaster.mbn‘ to ‘keymaster‘
(bootloader) - flashing ‘rpm.mbn‘ to ‘rpm‘
(bootloader) - flashing ‘pmic.elf‘ to ‘pmic‘
(bootloader) - flashing ‘hyp.mbn‘ to ‘hyp‘
(bootloader) - flashing ‘tz.mbn‘ to ‘tz‘
(bootloader) - flashing ‘devcfg.mbn‘ to ‘devcfg‘
(bootloader) - flashing ‘storsec.mbn‘ to ‘storsec‘
(bootloader) - flashing ‘prov64.mbn‘ to ‘prov‘
OKAY [ 0.197s]
Finished. Total time: 0.579s
D:\platform-tools>fastboot flash modem NON-HLOS.bin
(bootloader) is-logical:modema: not found
Sending ‘modema‘ (97415 KB) OKAY [ 3.430s]
Writing ‘modema‘ (bootloader) Invalid partition name modema
FAILED (remote: ‘‘)
fastboot: error: Command failed
D:\platform-tools>fastboot flash fsg fsg.mbn
(bootloader) is-logical:fsga: not found
Sending ‘fsga‘ (5596 KB) OKAY [ 0.196s]
Writing ‘fsga‘ (bootloader) Invalid partition name fsga
FAILED (remote: ‘‘)
fastboot: error: Command failed
二、安装
(1)安装驱动
(2)解码ADB工具和镜像包到同一个文件夹(不要保存到C盘,有可能需要权限执行问题):
(3)制作刷机脚本,用notepad.exe编辑,保存为test.bat,和ADB、镜像放在同一目录:
fastboot getvar max-sparse-size
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash bluetooth BTFM.bin
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system_b system_b.img_sparsechunk.0
fastboot flash system_b system_b.img_sparsechunk.1
fastboot flash oem oem.img_sparsechunk.0
fastboot flash oem oem.img_sparsechunk.1
fastboot erase carrier
fastboot erase cache
fastboot erase userdata
fastboot erase ddr
fastboot oem fb_mode_clear
fastboot reboot
(3)将手机关机,进入ap fastboot模式(先按住音量减不放,再按开关机键);
(4)执行bat脚本。进行cmd,执行test.bat即可。
原文地址:https://blog.51cto.com/ringwater/2387192