From: mauronofrio matarrese Date: Thu, 4 Apr 2019 22:45:57 +0000 (+0200) Subject: Update Installer X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=be3b820d2ed6dd522d93baa799f8232cb3690562;p=GitHub%2Fmoto-9609%2Ftwrp_device_motorola_troika.git Update Installer --- diff --git a/installer/META-INF/CERT.RSA b/installer/META-INF/CERT.RSA deleted file mode 100644 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 index 42d5d98..0000000 --- a/installer/META-INF/CERT.SF +++ /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 index 3c01a06..0000000 --- a/installer/META-INF/MANIFEST.MF +++ /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= - diff --git a/installer/META-INF/com/google/android/update-binary b/installer/META-INF/com/google/android/update-binary index fe83652..6dae8c5 100644 --- a/installer/META-INF/com/google/android/update-binary +++ b/installer/META-INF/com/google/android/update-binary @@ -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 diff --git a/installer/magiskboot b/installer/magiskboot index 0f5f231..18d044a 100644 Binary files a/installer/magiskboot and b/installer/magiskboot differ