Skip to content

Commit a119acd

Browse files
committed
fix: DebugAssistant folder permission allowing app access and chown as shell
+ specify dmesg log name when copying to Download Signed-off-by: TheSillyOk <priv.ld@proton.me>
1 parent 2ee1b3c commit a119acd

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

action.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
# A tool to redact sensitive information from the extremely verbose debug logs of Meow's Debug Assistant.
44
# LICENSE: BSD 3-Clause by ThePedroo
55

6+
SAVE_FOLDER="/data/local/tmp/DebugAssistant"
7+
68
log() {
79
echo "$1"
810
echo ""
911
}
1012

11-
SAVE_FOLDER="/data/local/tmp/DebugAssistant"
12-
mkdir -p "$SAVE_FOLDER"
13-
1413
log "Selecting the latest debug log file..."
1514

1615
LATEST_SUFFIX=$(basename $(ls -t "$SAVE_FOLDER/"DebugAssistant* | grep -v "-Redacted" | head -n 1) | grep -oE "(-[0-9]+)?")
@@ -62,10 +61,10 @@ sed -E \
6261
\
6362
\
6463
"$SAVE_FOLDER/$LATEST" > "$NEW_LOG"
65-
64+
chmod 751 "$NEW_LOG"
6665
log "Redacted logs in $NEW_LOG"
6766

6867
cp "$NEW_LOG" /sdcard/Download
69-
cp "$DMESG_LOG" /sdcard/Download
68+
cp "$DMESG_LOG" /sdcard/Download/DebugAssistant-DMESG.log
7069
log "Copied redacted log and matching dmesg to /sdcard/Download..."
7170
sleep 3

post-fs-data.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
SAVE_FOLDER="/data/local/tmp/DebugAssistant"
77
mkdir -p "$SAVE_FOLDER"
8+
chmod 751 "$SAVE_FOLDER"
9+
chown shell:shell "$SAVE_FOLDER"
810

911
start_log() {
1012
local suffix="$1"
@@ -19,6 +21,7 @@ prepare_file() {
1921
rm "$file_path"
2022
touch "$file_path"
2123
chown shell:shell "$file_path"
24+
chmod 751 "$file_path"
2225
}
2326

2427
watch_logcat() {
@@ -49,3 +52,4 @@ else
4952
fi
5053

5154
start_log "$SUFFIX"
55+

0 commit comments

Comments
 (0)