feat(logging): per-UID NDJSON on external storage
Move debug diagnostics off /data/local/tmp/teesim to /data/media/0/TEESimulator (visible at /sdcard/TEESimulator), so users can pull them without a root explorer. The logging code runs in the keystore SELinux domain, so a debug-only media_rw_data_file grant plus a debug-only diag.sh fragment gate the plane: diag.sh's presence is the signal service.sh (setup) and action.sh (export) test. customize.sh extracts diag.sh on debug installs or sweeps the dir on release, since the release keystore domain cannot remove it itself. Replace the per-call .bin parcel dumps (a fresh undecodable file per generateKey) with one NDJSON record per event on the UID's own file, carrying decoded fields plus the raw parcel as base64 for the offline parsers. computeIfAbsent makes per-UID writer creation atomic.
This commit is contained in:
@@ -76,6 +76,16 @@ mv "$MODPATH/libsupervisor.so" "$MODPATH/supervisor"
|
||||
chmod 755 "$MODPATH/inject"
|
||||
chmod 755 "$MODPATH/supervisor"
|
||||
|
||||
# Debug builds carry diag.sh (the diagnostic plane); release builds do not. Extract it when
|
||||
# present; otherwise sweep any external-storage diagnostics a prior debug install left behind,
|
||||
# since the release keystore domain has no grant to remove them itself.
|
||||
if unzip -qqjo "$ZIPFILE" "diag.sh" -d "$MODPATH" 2>/dev/null; then
|
||||
chmod 644 "$MODPATH/diag.sh"
|
||||
ui_print "- Debug diagnostic plane enabled"
|
||||
else
|
||||
rm -rf /data/media/0/TEESimulator /data/local/tmp/teesim
|
||||
fi
|
||||
|
||||
# --- Configuration Files ---
|
||||
if [ ! -d "$CONFIG_DIR" ]; then
|
||||
ui_print "- Creating configuration directory"
|
||||
|
||||
Reference in New Issue
Block a user