Update Installer
authormauronofrio matarrese <poronofrio@gmail.com>
Thu, 4 Apr 2019 22:45:57 +0000 (00:45 +0200)
committermauronofrio matarrese <poronofrio@gmail.com>
Thu, 4 Apr 2019 22:45:57 +0000 (00:45 +0200)
installer/META-INF/CERT.RSA [deleted file]
installer/META-INF/CERT.SF [deleted file]
installer/META-INF/MANIFEST.MF [deleted file]
installer/META-INF/com/google/android/update-binary
installer/magiskboot

diff --git a/installer/META-INF/CERT.RSA b/installer/META-INF/CERT.RSA
deleted file mode 100644 (file)
index 8c3a62d..0000000
Binary files a/installer/META-INF/CERT.RSA and /dev/null differ
diff --git a/installer/META-INF/CERT.SF b/installer/META-INF/CERT.SF
deleted file mode 100644 (file)
index 42d5d98..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-Signature-Version: 1.0
-SHA1-Digest-Manifest: i7FHYIpuyxsM6HD3efSwslaJZXc=
-Created-By: 1.0 (Android SignApk)
-
-Name: META-INF/com/google/android/updater-script
-SHA1-Digest-Manifest: pVUJ9D5th6d2sD8aeNp5zhiBUcs=
-
-Name: ramdisk-twrp.cpio
-SHA1-Digest-Manifest: QxC9ruvvkW9+V3vsNYql1IeieCo=
-
-Name: META-INF/com/google/android/update-binary
-SHA1-Digest-Manifest: zkbZ60ZI+Dta6BdGxxHnCmAX7qY=
-
-Name: magiskboot
-SHA1-Digest-Manifest: 73OeOdGxnv1r0iM1NaJW+Y1NP1U=
-
diff --git a/installer/META-INF/MANIFEST.MF b/installer/META-INF/MANIFEST.MF
deleted file mode 100644 (file)
index 3c01a06..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Created-By: 1.0 (Android SignApk)
-
-Name: META-INF/com/google/android/updater-script
-SHA1-Digest: Lzl1y1cC6TvXytLj6okU81/P8AA=
-
-Name: ramdisk-twrp.cpio
-SHA1-Digest: DGb/yAJO6TXiv1zWztNkwyxaFUs=
-
-Name: META-INF/com/google/android/update-binary
-SHA1-Digest: hZ5S81htomhMGZS8euHbmuq97vI=
-
-Name: magiskboot
-SHA1-Digest: npI5rDS2Z1cFaQBGpqfb5LMyANo=
-
index fe8365291f430b0b52719262343a17bc12ca3b11..6dae8c55c4b67e2ae04137b23bc852bc1f5246f1 100644 (file)
@@ -1,5 +1,6 @@
 #!/sbin/sh
 # LazyFlasher installer backend (for helper functions only)
+# Heavily modified by Dees_Troy and osm0sis
 
 tmp=/dev/tmp/twrp-install
 
@@ -36,7 +37,7 @@ print "#            by mauronofrio            #"
 print "########################################"
 print
 
-# Unpack the installer
+# unpack the installer
 [ "$zip" ] && {
        print "Unpacking the installer..."
        extract "$zip" "$tmp"
@@ -47,24 +48,28 @@ toolname="/magiskboot"
 tool="$tmp$toolname"
 targetfile="/boot.img"
 target="$tmp$targetfile"
+recoverycpio=`(ls ramdisk-twrp.cpio || ls ramdisk-recovery.cpio) 2>/dev/null`
 
 chmod 755 "$tool"
 
 for slot in a b; do
        print "Running boot image patcher on slot $slot..."
        dd if=/dev/block/bootdevice/by-name/boot_$slot "of=$target"
-       "$tool" --unpack boot.img
+       "$tool" unpack -h boot.img
+
        # kernel string want_initramfs -> skip_initramfs (Magisk)
-       "$tool" --hexpatch kernel 77616E745F696E697472616D6673 736B69705F696E697472616D6673
+       "$tool" hexpatch kernel 77616E745F696E697472616D6673 736B69705F696E697472616D6673
        # kernel string trip_initramfs -> skip_initramfs (SuperSU)
-       "$tool" --hexpatch kernel 747269705F696E697472616D6673 736B69705F696E697472616D6673
-       cp -f ramdisk-recovery.cpio ramdisk.cpio
-       "$tool" --repack boot.img
-       # boot.img cmdline skip_override -> '             ' (flar2 patch)
-       "$tool" --hexpatch new-boot.img 736B69705F6F76657272696465 20202020202020202020202020
+       "$tool" hexpatch kernel 747269705F696E697472616D6673 736B69705F696E697472616D6673
+
+       # boot.img cmdline remove skip_override (flar2 patch)
+       sed -i "s|$(grep '^cmdline=' header | cut -d= -f2-)|$(grep '^cmdline=' header | cut -d= -f2- | sed -e 's/skip_override//' -e 's/  */ /g' -e 's/[ \t]*$//')|" header
+
+       cp -f $recoverycpio ramdisk.cpio
+       "$tool" repack boot.img
        dd if=new-boot.img of=/dev/block/bootdevice/by-name/boot_$slot
 
-       "$tool" --cleanup
+       "$tool" cleanup
        rm -f new-boot.img
 done
 
index 0f5f2314a9a3aeaa3ad7d992a70ff257eff32c7d..18d044a91a8057118b60aa547cbf1ebb24f71474 100644 (file)
Binary files a/installer/magiskboot and b/installer/magiskboot differ