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

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

当然,也是有门槛的

  1. 一个拥有adb和fastboot支持的平台,电脑,路由器,另一个手机都可以(Windows请使用utf8的cmd)
  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 目录
    可以尝试用命令或是手动找find /dev/block -name by-name
    这里教你几个常用的Linux命令
    切换到某个目录 cd 目录
    显示当前目录下的文件 ls
    显示当前所在目录的路径 pwd
    补全路径或命令 按键盘上的tab按钮
  3. 这里以TicwatchPro为例,找到的路径是

    /dev/block/platform/soc/7824900.sdhci/by-name

    进去ls -l可以竖着输出目录中的文件名,拼接成这样的命令(仅Linux或Mac)
    adb shell cat 路径/文件名 > 文件名.img
    或是(包括Windows可用,甚至不用切utf-8)
    adb pull 路径/文件名
    然后拿着像vscode这种按住shift+alt(shift+option)可以同时编辑多行的编辑器操作一番,就能得到这样一堆命令

    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/DDR
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/aboot
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/abootbak
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/cache
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/cmnlib
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/cmnlibbak
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/config
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/devinfo
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/fsc
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/fsg
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/keymaster
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/keymasterbak
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/keystore
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/misc
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/modem
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/modemst1
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/modemst2
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/oem
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/pad
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/persist
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/recovery
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/rpm
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/rpmbak
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/sbl1
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/sbl1bak
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/sec
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/splash
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/ssd
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/system
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/ticnv
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/tz
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/tzbak
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/userdata
    adb pull /dev/block/platform/soc/7824900.sdhci/by-name/vendor
  4. 在需要存放备份的目录打开一个终端(Windows请使用utf8的cmd),运行第三步拼出的命令,fastboot线刷包就备份完成了