Skip to content

Instantly share code, notes, and snippets.

@pexcn
Last active November 18, 2024 02:39
Show Gist options
  • Save pexcn/71d7d242c5e805d9346d2dc9db17fb90 to your computer and use it in GitHub Desktop.
Save pexcn/71d7d242c5e805d9346d2dc9db17fb90 to your computer and use it in GitHub Desktop.

Fix magisk stock backup does not exist

# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)

# repack boot.img.gz
gzip -9f /sdcard/boot-stock.img

# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot-stock.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
@M3551
Copy link

M3551 commented Sep 25, 2024

bro I don't have SD card. Can I done with internal storage??

"/sdcard" is your internal storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment