From 2f354b160ba09a0af1ee7888a71d0525a20fb713 Mon Sep 17 00:00:00 2001 From: Scott Date: Sat, 9 Jul 2016 10:02:47 -0500 Subject: [PATCH 1/2] Fix libxposed_art.so on 64bit and also make sure its uninstalled Also remove the .no_orig stuff from the installer. libxposed_art.so was the only consumer. Its intentionally left in the uninstaller so that the uninstaller will clean it up on people's devices over time. --- .../_all/META-INF/com/google/android/flash-script.sh | 10 +++------- .../META-INF/com/google/android/flash-script.sh | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/zipstatic/_all/META-INF/com/google/android/flash-script.sh b/zipstatic/_all/META-INF/com/google/android/flash-script.sh index 3cce8a0..bc697fd 100644 --- a/zipstatic/_all/META-INF/com/google/android/flash-script.sh +++ b/zipstatic/_all/META-INF/com/google/android/flash-script.sh @@ -71,15 +71,11 @@ install_overwrite() { return fi BACKUP="${1}.orig" - NO_ORIG="${1}.no_orig" - if [ ! -f $TARGET ]; then - touch $NO_ORIG || exit 1 - set_perm $NO_ORIG 0 0 600 - elif [ -f $BACKUP ]; then + if [ -f $BACKUP ]; then rm -f $TARGET gzip $BACKUP || exit 1 set_perm "${BACKUP}.gz" 0 0 600 - elif [ ! -f "${BACKUP}.gz" -a ! -f $NO_ORIG ]; then + elif [ ! -f "${BACKUP}.gz" ]; then mv $TARGET $BACKUP || exit 1 gzip $BACKUP || exit 1 set_perm "${BACKUP}.gz" 0 0 600 @@ -181,7 +177,7 @@ if [ $IS64BIT ]; then install_overwrite /system/lib64/libart-compiler.so 0 0 0644 install_overwrite /system/lib64/libart-disassembler.so 0 0 0644 install_overwrite /system/lib64/libsigchain.so 0 0 0644 - install_overwrite /system/lib64/libxposed_art.so 0 0 0644 + install_nobackup /system/lib64/libxposed_art.so 0 0 0644 fi if [ "$API" -ge "22" ]; then diff --git a/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh b/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh index f15ab16..cdacb69 100644 --- a/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh +++ b/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh @@ -55,7 +55,7 @@ restore_backup() { rm -f $TARGET $NO_ORIG gunzip "${BACKUP}.gz" mv_perm $BACKUP $TARGET $2 $3 $4 $5 - elif [ -f $NO_ORIG ]; then + else rm -f $TARGET $NO_ORIG fi } From fd594a0934e3ce6334e4e165cb9072561b7601e9 Mon Sep 17 00:00:00 2001 From: Scott Date: Sat, 9 Jul 2016 10:21:48 -0500 Subject: [PATCH 2/2] Minor change to restore_backup() Let's not rm -f target if there was no backup. This might make a device unbootable (more so than it might already be). Instead we'll just rm -f libxposed_art.so and libxposed_art.so.no_orig. --- .../META-INF/com/google/android/flash-script.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh b/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh index cdacb69..012b876 100644 --- a/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh +++ b/zipstatic/_uninstaller/META-INF/com/google/android/flash-script.sh @@ -47,16 +47,12 @@ restore_link() { restore_backup() { TARGET=$1 BACKUP="${1}.orig" - NO_ORIG="${1}.no_orig" if [ -f $BACKUP ]; then mv_perm $BACKUP $TARGET $2 $3 $4 $5 - rm -f $NO_ORIG elif [ -f "${BACKUP}.gz" ]; then - rm -f $TARGET $NO_ORIG + rm -f $TARGET gunzip "${BACKUP}.gz" mv_perm $BACKUP $TARGET $2 $3 $4 $5 - else - rm -f $TARGET $NO_ORIG fi } @@ -108,14 +104,14 @@ restore_backup /system/lib/libart.so 0 0 0644 restore_backup /system/lib/libart-compiler.so 0 0 0644 restore_backup /system/lib/libart-disassembler.so 0 0 0644 restore_backup /system/lib/libsigchain.so 0 0 0644 -restore_backup /system/lib/libxposed_art.so 0 0 0644 +rm -f /system/lib/libxposed_art.so /system/lib/libxposed_art.so.no_orig if [ $IS64BIT ]; then restore_link /system/bin/app_process64 0 2000 0755 u:object_r:zygote_exec:s0 restore_backup /system/lib64/libart.so 0 0 0644 restore_backup /system/lib64/libart-compiler.so 0 0 0644 restore_backup /system/lib64/libart-disassembler.so 0 0 0644 restore_backup /system/lib64/libsigchain.so 0 0 0644 - restore_backup /system/lib64/libxposed_art.so 0 0 0644 + rm -f /system/lib64/libxposed_art.so /system/lib64/libxposed_art.so.no_orig fi if [ "$API" -ge "22" ]; then