Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Androidのイメージバックアップ (パスやファイル名は適宜変更してください)
# 1. root権限で実行するためsuに
su
# 2. 各イメージがあるパスへ移動する
cd /dev/block/bootdevice/by-name/
# 3. cacheとuserdata以外すべてを/sdcardへバックアップする
for file in *; do
if [[ "${file}" == "cache" || "${file}" == "userdata" ]]; then continue ; else dd if=/dev/block/bootdevice/by-name/"${file}" of=/sdcard/"${file}".img ; fi
done
# 1. root権限で実行するためsuに
su
# 2. 各イメージがあるパスへ移動する
cd /dev/block/bootdevice/by-name/
# 3. /sdcardへバックアップする
for file in *; do
if [[ "${file}" == "boot" || "${file}" == "devcfg" || "${file}" == "dtbo" || "${file}" == "oem" || "${file}" == "recovery" || "${file}" == "rpm" || "${file}" == "sbl1" || "${file}" == "system" || "${file}" == "tz" || "${file}" == "vbmeta" || "${file}" == "modem" || "${file}" == "vendor" ]]; then dd if=/dev/block/bootdevice/by-name/"${file}" of=/sdcard/"${file}".img ; else continue ; fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.