Skip to content

Commit adff638

Browse files
committed
Add WSA runtime ksud check
1 parent 7c115a5 commit adff638

3 files changed

Lines changed: 53 additions & 3 deletions

File tree

docs/FAQ.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Either reinstall the previous known-good Manager APK, or install a Manager build
2727
If the live self-test prints `/data/adb/ksud does not expose the kpm subcommand`, the running WSA userspace is still missing the KPM-capable `ksud`. Confirm it with:
2828

2929
```bash
30-
adb shell su -M -c "/data/adb/ksud --help 2>&1 | head -80"
30+
ADB="/mnt/d/Programy/Path Tools/adb.exe" ADB_TARGET=127.0.0.1:58526 \
31+
bash scripts/wsa-check-runtime-ksud.sh
3132
```
3233

3334
The kernel cannot make the userspace `kpm` command appear. Install a Manager or `libksud.so` build that passes the x86_64 guard, then rerun `RUN_WSA=1 bash KernelSU/scripts/kpm-x86-preflight.sh`.

docs/WSA_COMPATIBILITY_MATRIX.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WSA is now an archive-style target: Microsoft archived the public WSA app reposi
66

77
| WSA package/build | Windows build | Kernel base | HVCI / Memory Integrity | Manager / libksud.so | KPM status | Notes |
88
| --- | ---: | --- | --- | --- | --- | --- |
9-
| booted local WSA `2026-04-27` | `26200` | 5.15.104 | on | installed `/data/adb/ksud` lacks `kpm` subcommand | blocked-userspace | ADB connected to `127.0.0.1:58526`; `uname -a` reported kernel `#28` with `WSA-ReSukiSU+`; `KernelSU/scripts/kpm-x86-runtime-selftest.sh` now stops with a clear Manager/libksud mismatch before loading KPMs. |
9+
| booted local WSA `2026-04-27` | `26200` | 5.15.104 | on | installed `/data/adb/ksud` lacks `kpm` subcommand | blocked-userspace | ADB connected to `127.0.0.1:58526`; `uname -a` reported kernel `#28` with `WSA-ReSukiSU+`; `scripts/wsa-check-runtime-ksud.sh` and `KernelSU/scripts/kpm-x86-runtime-selftest.sh` stop with a clear Manager/libksud mismatch before loading KPMs. |
1010
| local main build `2026-04-27` | `26200` | 5.15.104 | on | release `ksud` SHA256 `68368b32b98adb6ffb2164c6551e0684c2d193e35fbde196384f4948b89573bf`, guard pass | build pass, live runtime pending | Kernel `#34`, SHA256 `c93249f528f515cc0d0cd2030e55791bf3c12bdc07a18748af645a4aefeeb50e`; sidecar manifest verifies the current WSA commit, ReSukiSU submodule, helper script hashes and artifact SHA; `scripts/kpm-x86-preflight.sh` passed without `RUN_WSA=1`. |
1111
| `MicrosoftCorporationII.WindowsSubsystemForAndroid_2407.40000.4.0_x64__8wekyb3d8bbwe` | `26200` | 5.15.104 | on | release `ksud` SHA256 `68368b32b98adb6ffb2164c6551e0684c2d193e35fbde196384f4948b89573bf` | pass | Validated locally with kernel `#30`, SHA256 `037b9507707bffca33c56cc421b5ff7085f8ec8b8f3d2abedb93072bdadfae46`, `scripts/kpm-x86-preflight.sh RUN_WSA=1` and `scripts/wsa-kpm-boot-smoke.sh`. |
1212
| 2407-style known-good local package | record exact package version | 5.15.104 | off | x86_64 KPM-capable ReSukiSU Manager | expected pass | Same package family as the validated HVCI-on row; validate separately before release claims. |
@@ -21,4 +21,5 @@ For each release candidate, add a row with:
2121
5. `adb shell su -c "ksud kpm doctor --json"`.
2222
6. `adb shell su -c "ksud kpm audit --json"` after a load/control/unload cycle.
2323
7. `KernelSU/scripts/check-manager-kpm-x86.sh` result for the Manager APK used in that row.
24-
8. If live validation is blocked before KPM load, record the exact `ksud` error and do not promote the row to `pass`.
24+
8. `scripts/wsa-check-runtime-ksud.sh` result.
25+
9. If live validation is blocked before KPM load, record the exact `ksud` error and do not promote the row to `pass`.

scripts/wsa-check-runtime-ksud.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ADB="${ADB:-adb}"
5+
ADB_TARGET="${ADB_TARGET:-127.0.0.1:58526}"
6+
KSUD="${KSUD:-/data/adb/ksud}"
7+
LOCAL_KSUD="${LOCAL_KSUD:-KernelSU/userspace/ksud/target/x86_64-linux-android/release/ksud}"
8+
9+
log() {
10+
printf '[wsa-ksud-check] %s\n' "$*"
11+
}
12+
13+
adb_shell() {
14+
"$ADB" -s "$ADB_TARGET" shell "$@"
15+
}
16+
17+
adb_su() {
18+
adb_shell "su -M -c \"$*\""
19+
}
20+
21+
log "connecting to $ADB_TARGET"
22+
"$ADB" connect "$ADB_TARGET" >/dev/null || true
23+
"$ADB" -s "$ADB_TARGET" wait-for-device
24+
25+
log "kernel"
26+
adb_shell uname -a
27+
28+
if [ -f "$LOCAL_KSUD" ]; then
29+
log "local release ksud"
30+
sha256sum "$LOCAL_KSUD"
31+
if [ -x KernelSU/scripts/check-manager-kpm-x86.sh ]; then
32+
KernelSU/scripts/check-manager-kpm-x86.sh "$LOCAL_KSUD"
33+
fi
34+
else
35+
log "local release ksud not found: $LOCAL_KSUD"
36+
fi
37+
38+
log "remote ksud path: $KSUD"
39+
if adb_su "$KSUD kpm --help" >/dev/null 2>&1; then
40+
log "remote ksud exposes kpm"
41+
adb_su "$KSUD kpm version" || true
42+
adb_su "$KSUD kpm doctor --json" || true
43+
exit 0
44+
fi
45+
46+
log "remote ksud does not expose kpm"
47+
adb_su "$KSUD --help 2>&1 | head -80" || true
48+
exit 1

0 commit comments

Comments
 (0)