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:
1 file changed
+6
-2
@@ -4,7 +4,11 @@
|
|||||||
|
|
||||||
OUTFD=/proc/self/fd/$2;
|
OUTFD=/proc/self/fd/$2;
|
||||||
ZIPFILE="$3";
|
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;
|
test "$home" || home=/tmp/anykernel;
|
||||||
parent=$(dirname $home);
|
parent=$(dirname $home);
|
||||||
@@ -33,7 +37,7 @@ cleanup() {
|
|||||||
debugging() {
|
debugging() {
|
||||||
case $(basename "$ZIPFILE" .zip) in
|
case $(basename "$ZIPFILE" .zip) in
|
||||||
*-debugging)
|
*-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/*;
|
$bb tar -czvf "$DIR/anykernel3-$(date +%Y-%m-%d_%H%M%S)-debug.tgz" $parent/*;
|
||||||
;;
|
;;
|
||||||
esac;
|
esac;
|
||||||
|
|||||||
Reference in new issue
Block a user