From 4a2755781f85558c281f12f79e2ad653c0ce0f90 Mon Sep 17 00:00:00 2001 From: Sangam Shrestha <2shrestha22@gmail.com> Date: Sun, 5 Mar 2023 17:36:03 +0545 Subject: [PATCH] add uninstaller --- .../META-INF/com/google/android/update-binary | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/recovery/META-INF/com/google/android/update-binary b/recovery/META-INF/com/google/android/update-binary index 45adb6e..dda65ab 100755 --- a/recovery/META-INF/com/google/android/update-binary +++ b/recovery/META-INF/com/google/android/update-binary @@ -76,15 +76,9 @@ find_block() { ui_print "****************************" -ui_print "Lineage Dialer RRO installer" +ui_print "Lineage Dialer RRO" ui_print "****************************" -ui_print "Extracting files" -TMP=/tmp -cd "$TMP" || exit 1 -unzip -o "$ZIP" -rm -rf META-INF - ui_print "Mounting partitions" # Ensure system is unmounted so mounting succeeds @@ -151,7 +145,29 @@ if [ -n "$VENDOR_BLOCK" ]; then fi fi -# Enter inside Flashable system. +# Uninstaller +if echo "$3" | grep -q "uninstall"; then + ui_print "Uninstalling" + rm "${SYSTEM_OUT}/addon.d/20-lineage-dialer-rro.sh" + rm "${SYSTEM_OUT}/vendor/overlay/lineage-dialer-rro.apk" + if [ -n "$VENDOR_BLOCK" ]; then + rm "/vendor/overlay/lineage-dialer-rro.apk" + fi + + ui_print "Done uninstalling!" + ui_print "Unmounting partitions" + umount -l "$SYSTEM_MNT" + umount -l /vendor || true + exit 0 +fi + +ui_print "Extracting files" +TMP=/tmp +cd "$TMP" || exit 1 +unzip -o "$ZIP" +rm -rf META-INF + +# Enter inside extracted files system. cd system || exit 1 ui_print "Preparing files for copying"