Skip to content

Commit

Permalink
Let magisk handle the recovery.img shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
dan committed Jul 12, 2024
1 parent 870852b commit f28bba0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions script1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ if [ -f recovery.img.lz4 ];then
lz4 -B6 --content-size -f recovery.img.lz4 recovery.img
fi

off=$(grep -ab -o SEANDROIDENFORCE recovery.img |tail -n 1 |cut -d : -f 1)
dd if=recovery.img of=r.img bs=4k count=$off iflag=count_bytes
#off=$(grep -ab -o SEANDROIDENFORCE recovery.img |tail -n 1 |cut -d : -f 1)
#dd if=recovery.img of=r.img bs=4k count=$off iflag=count_bytes
cp recovery.img r.img

if [ ! -f phh.pem ];then
openssl genrsa -f4 -out phh.pem 4096
Expand Down
8 changes: 6 additions & 2 deletions script2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ cd unpack
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot hexpatch system/bin/recovery 27f02eeb30b1681c 27f02eeb30b9681c
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot hexpatch system/bin/recovery b4f082ee28b1701c b4f082ee28b970c1
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot hexpatch system/bin/recovery 9ef0f4ec28b1701c 9ef0f4ec28b9701c
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot cpio ramdisk.cpio 'add 0755 system/bin/recovery system/bin/recovery'
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot repack ../r.img new-boot.img
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot hexpatch system/bin/recovery 9ef00ced28b1701c 9ef00ced28b9701c
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot hexpatch system/bin/recovery 2001597ae0000054 2001597ae1000054 # ccmp w9, w25, #0, eq ; b.e #0x20 ===> b.ne #0x20
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot hexpatch system/bin/recovery 24f0f2ea30b1681c 24f0f2ea30b9681c
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot hexpatch system/bin/recovery 41010054a0020012f44f48a9 4101005420008052f44f48a9
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot cpio ramdisk.cpio 'add 0755 system/bin/recovery system/bin/recovery'
~runner/work/Patch-Recovery/Patch-Recovery/magiskboot repack ../r.img new-boot.img
cp new-boot.img ../recovery-patched.img

0 comments on commit f28bba0

Please sign in to comment.