Backend: fix debugging .tgz creation for booted installs

- some apps copy the zip to be flashed to the app cache, which would result in the .tgz going either somewhere unknown/inaccessbile to the user or get deleted when the app cleans up after flash, so instead send to /sdcard if the device is booted to Android
This commit is contained in:
osm0sis committed 2019-06-07 20:22:03 -03:00
1 parent 76d59d67e6
commit da324c430f
1 file changed
+6 -2
+6 -2
View File
@@ -4,7 +4,11 @@
OUTFD=/proc/self/fd/$2;
ZIPFILE="$3";
DIR=$(dirname "$ZIPFILE");
ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false;
$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true;
$BOOTMODE && DIR=/sdcard || DIR=$(dirname "$ZIPFILE");
test "$home" || home=/tmp/anykernel;
parent=$(dirname $home);
@@ -33,7 +37,7 @@ cleanup() {
debugging() {
case $(basename "$ZIPFILE" .zip) in
*-debugging)
ui_print " " "Creating debugging archive in zip directory...";
ui_print " " "Creating debugging archive in $DIR...";
$bb tar -czvf "$DIR/anykernel3-$(date +%Y-%m-%d_%H%M%S)-debug.tgz" $parent/*;
;;
esac;