这篇文章教你备份现有设备的fastboot镜像,可以是手机,手表,电子书,甚至智能音响

优点是可以无视设备的可用空间,比如像手表的sdcard所在分区没有system大,以至于无法使用twrp备份system。以及备份的是image,还原之后可以过ota的md5验证

当然,也是有门槛的

  1. 一个拥有adb和fastboot支持的平台,电脑,路由器,另一个手机都可以
  2. adb工具(android-tools-adb)
  3. fastboot工具(android-tools-fastboot)
  4. 设备已解锁拥有对应twrp或是已经root

使用twrp的情况

  1. 将设备启动到fastboot并连接电脑
  2. 启动twrp,这里使用设备的twrp.img,如果要备份原厂recovery请别把twrp刷进去 ``` fastboot boot twrp.img ```
  3. 请看备份部分

设备已root的情况

  1. 将设备启动到Android并连接到电脑
  2. 将adb切换到root模式 ``` adb root ```
  3. 请看备份部分

备份

  1. 打开一个shell ``` adb shell ```
  2. 在 /dev/block/platform 中的任意文件夹下找到找到 by-name 目录 这里教你几个常用的Linux命令 切换到某个目录 ``` cd 目录 ``` 显示当前目录下的文件 ``` ls ``` 显示当前所在目录的路径 ``` pwd ``` 补全路径或命令 按键盘上的tab按钮
  3. 这里以TicwatchPro为例,找到的路径是 ``` /dev/block/platform/soc/7824900.sdhci/by-name ``` 进去ls -l可以竖着输出目录中的文件名,拼接成这样的命令 adb shell cat 路径/文件名 > 文件名.img 然后拿着像vscode这种按住shift+alt(shift+option)可以同时编辑多行的编辑器操作一番,就能得到这样一堆命令(请无视>的转义,复制请自行改回来) ``` adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/DDR > DDR.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/aboot > aboot.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/abootbak > abootbak.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/boot > boot.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/cache > cache.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/cmnlib > cmnlib.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/cmnlibbak > cmnlibbak.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/config > config.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/devinfo > devinfo.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/fsc > fsc.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/fsg > fsg.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/keymaster > keymaster.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/keymasterbak > keymasterbak.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/keystore > keystore.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/misc > misc.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/modem > modem.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/modemst1 > modemst1.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/modemst2 > modemst2.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/oem > oem.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/pad > pad.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/persist > persist.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/recovery > recovery.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/rpm > rpm.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/rpmbak > rpmbak.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/sbl1 > sbl1.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/sbl1bak > sbl1bak.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/sec > sec.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/splash > splash.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/ssd > ssd.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/system > system.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/ticnv > ticnv.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/tz > tz.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/tzbak > tzbak.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/userdata > userdata.img adb shell cat /dev/block/platform/soc/7824900.sdhci/by-name/vendor > vendor.img ```
  4. 在需要存放备份的目录打开一个终端,运行第三步拼出的命令,fastboot线刷包就备份完成了