#!/system/bin/sh
# 抓到 getprop 子进程瞬间 dump 其 syscall/status（验证 exit_group 被 seccomp 卡住）
PKG="my.com.tngdigital.ewallet"

am force-stop "$PKG" 2>/dev/null
sleep 1
am start -n "$PKG/.ui.SplashActivity" 2>/dev/null

i=0
while [ $i -lt 200 ]; do
  i=$((i+1))
  for gp in $(pidof getprop 2>/dev/null); do
    ppid=$(awk '/^PPid/{print $2}' /proc/$gp/status 2>/dev/null)
    pp=$(tr '\0' ' ' < /proc/$ppid/cmdline 2>/dev/null)
    echo "GETPROP pid=$gp ppid=$ppid pp=[$pp]"
    echo "  seccomp: $(grep -i seccomp /proc/$gp/status 2>/dev/null | tr '\n' ' ')"
    echo "  syscall: $(cat /proc/$gp/syscall 2>/dev/null)"
    echo "  wchan: $(cat /proc/$gp/wchan 2>/dev/null) state=$(awk '/^State/{print $2}' /proc/$gp/status 2>/dev/null)"
  done
  sleep 0.05
done
echo "=== done ==="
