Commit cfac4e6562daf063930608185c8beb08932aa456
1 parent
7eff1666
docs(xhshook): update STATUS + fix update_xhshook_db.sh scope handling
- STATUS.md: file index updated to v3 (DEX=6328B, HTTP forwarding), add ~/.hermes/event_bus/event_server.py to index - update_xhshook_db.sh: phase 3 — after checkpoint, verify scope table has row for current mid; auto-insert if missing (mid changes after every reinstall, missing scope → lspd skips injection silently) - .gitignore: ignore *.idsig (apksigner side-car, not useful in git) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Showing
3 changed files
with
22 additions
and
4 deletions
.gitignore
xhs_lsposed_a16_fix/STATUS.md
| ... | ... | @@ -282,8 +282,11 @@ uvicorn event_server:app --host 127.0.0.1 --port 8765 |
| 282 | 282 | ├── ipc_bridge.h ← 已打补丁的头文件 |
| 283 | 283 | ├── ipc_bridge.cpp ← 已打补丁的源文件 |
| 284 | 284 | ├── xhshook_src/ |
| 285 | -│ └── Hook.java ← xhshook v2 源码 | |
| 286 | -└── xhshook_v2_signed.apk ← 预构建的 APK(当前已安装版本,classes.dex=3400 字节) | |
| 285 | +│ └── Hook.java ← xhshook v3 源码(含 HTTP 转发到 :8765/xhs_params) | |
| 286 | +└── xhshook_v2_signed.apk ← 预构建的 APK(当前已安装版本,classes.dex=6328 字节,含 HTTP 转发) | |
| 287 | + | |
| 288 | +~/.hermes/event_bus/ | |
| 289 | +└── event_server.py ← FastAPI event bus,含 POST/GET /xhs_params 端点 | |
| 287 | 290 | ``` |
| 288 | 291 | |
| 289 | 292 | --- | ... | ... |
xhs_lsposed_a16_fix/update_xhshook_db.sh
| ... | ... | @@ -43,5 +43,19 @@ echo "Verified path in DB: $ACTUAL" |
| 43 | 43 | $ADB push /tmp/mc_upd.db /data/local/tmp/mc_upd_clean.db |
| 44 | 44 | $ADB shell 'su -c "cp /data/local/tmp/mc_upd_clean.db /data/adb/lspd/config/modules_config.db && rm -f /data/adb/lspd/config/modules_config.db-wal /data/adb/lspd/config/modules_config.db-shm && echo phase2 done"' |
| 45 | 45 | |
| 46 | -echo "DB updated. Now: am force-stop com.xingin.xhs → open XHS manually." | |
| 47 | -echo "(If lspd cache doesn't auto-refresh, reboot is needed for changes to take effect.)" | |
| 46 | +# --- Phase 3: verify + fix scope table (mid can change after reinstall) --- | |
| 47 | +# Get current mid for xhshook from the freshly-checkpointed DB | |
| 48 | +MID=$(sqlite3 /tmp/mc_upd.db "SELECT mid FROM modules WHERE module_pkg_name='com.hermes.xhshook';") | |
| 49 | +echo "Current mid: $MID" | |
| 50 | +SCOPE=$(sqlite3 /tmp/mc_upd.db "SELECT count(*) FROM scope WHERE mid=$MID AND app_pkg_name='com.xingin.xhs';") | |
| 51 | +if [ "$SCOPE" -eq 0 ]; then | |
| 52 | + echo "scope table missing entry for mid=$MID — inserting..." | |
| 53 | + sqlite3 /tmp/mc_upd.db "INSERT OR REPLACE INTO scope (mid, app_pkg_name, user_id) VALUES ($MID, 'com.xingin.xhs', 0);" | |
| 54 | + $ADB push /tmp/mc_upd.db /data/local/tmp/mc_upd_scope.db | |
| 55 | + $ADB shell "su -c 'cp /data/local/tmp/mc_upd_scope.db /data/adb/lspd/config/modules_config.db && rm -f /data/adb/lspd/config/modules_config.db-wal /data/adb/lspd/config/modules_config.db-shm && echo phase3 scope fixed'" | |
| 56 | +else | |
| 57 | + echo "scope table OK (mid=$MID, com.xingin.xhs row exists)" | |
| 58 | +fi | |
| 59 | + | |
| 60 | +echo "DB updated. Reboot required for lspd to reload config." | |
| 61 | +echo "After reboot: unlock PIN → open XHS manually." | ... | ... |