From c4d0ed8f9c9e604c6f484f7dea86af2a672988fb Mon Sep 17 00:00:00 2001 From: osm0sis Date: Sun, 28 May 2017 18:44:46 -0300 Subject: [PATCH] Backend: add developer option to create a debugging archive - to make it easier to diagnose issues with patches, image creation or flashing, adding "-debugging" to the end of the AK2 zip filename will enable the creation of a tar.gz of the entire /tmp directory after the installation process (but before cleanup, of course), this includes recovery.log, boot.img, boot-new.img and any other remnants to allow more thorough, direct debugging at a later time --- META-INF/com/google/android/update-binary | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 59cb7d1..79e061a 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -3,8 +3,8 @@ # osm0sis @ xda-developers OUTFD=/proc/self/fd/$2; -ZIP="$3"; -DIR=`dirname "$ZIP"`; +ZIPFILE="$3"; +DIR=`dirname "$ZIPFILE"`; ui_print() { until [ ! "$1" ]; do @@ -37,7 +37,7 @@ ui_print " "; cleanup; mkdir -p /tmp/anykernel/bin; cd /tmp/anykernel; -unzip -o "$ZIP"; +unzip -o "$ZIPFILE"; if [ $? != 0 -o -z "$(ls /tmp/anykernel/tools)" ]; then abort "Unzip failed. Aborting..."; fi; @@ -89,6 +89,14 @@ if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.modules)" == 1 ]; then mount -o ro,remount -t auto /system; fi; +case $(basename "$ZIPFILE" .zip) in + *-debugging) + ui_print " "; + ui_print "Creating debugging archive in zip directory..."; + $bb tar -czvf "$DIR/anykernel2-$(date +%Y-%m-%d_%H%M%S)-debug.tgz" /tmp/*; + ;; +esac; + if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.cleanup)" == 1 ]; then cleanup; fi;