--- name: wechathook-do-not-break description: Critical rules to prevent breaking WeChat tablet login on Pixel devices with LSPosed Vector. Hermes MUST load this skill before any WeChatHook build/modify/deploy operation. trigger: When Hermes is about to build, modify, recompile, repackage, re-sign, or reinstall the WeChatHook Xposed module. --- # WeChatHook — Do Not Break Three mistakes Hermes made on 2026-07-03 that together killed WeChat tablet login. ## Rule 1: NEVER recompile with standard XposedBridgeApi.jar LSPosed Vector (JingMatrix fork) provides obfuscated XposedHelpers at runtime: `lwhVNgqLnt.mxUMcgFJoCZ.XposedHelpers` Standard XposedBridgeApi.jar compiles against the original package name → every `findAndHookMethod` at runtime = `NoSuchMethodError`. **Correct JAR (Mac only):** `/tmp/LSPosed/legacy/build/intermediates/compile_library_classes_jar/release/bundleLibCompileToJarRelease/classes.jar` **If unavailable → extract DEX from working APK instead of recompiling.** ## Rule 2: xposed_init at assets/xposed_init (NOT root) LSPosed daemon validates `assets/xposed_init` on every startup. Missing/wrong location → daemon auto-deletes module from DB. **Correct:** `zip APK.apk assets/xposed_init ...` with content `com.example.wechathook.WeChatHook` ## Rule 3: Only sign with ~/.android/debug.keystore Different keystore → INSTALL_FAILED_UPDATE_INCOMPATIBLE ## Safe Reinstall ```bash # 1. Backup DB adb shell su -c 'cp /data/adb/lspd/config/modules_config.db /data/local/tmp/modules_backup.db' # 2. Uninstall adb shell pm uninstall com.example.wechathook # 3. Install (must follow all 3 rules) adb install --no-incremental /path/to/new.apk # 4. Fix DB adb shell su -c 'python3 /sdcard/wechathook/fix_lspd_final.py' # 5. Reboot adb shell su -c reboot ``` ## Verify hooks working ```bash su -c 'grep "\[WeChatHook\]" /data/adb/lspd/log/modules_*.log | head -30' ``` Expected: no NoSuchMethodError. Hooked bk.B, bk.A, Activity.onResume, LoginPasswordUI, etc. ## Known-Good State (2026-07-05) | Item | Value | |------|-------| | APK | com.example.wechathook v1 (deployed 2026-07-04 23:48) | | APK path | /data/app/~~bgsCVU01BJNgQPVePXq3xQ==/com.example.wechathook-AKTKHSyeEHmUaTT6hZ8pJw==/base.apk | | Sign | ~/.android/debug.keystore | | LSPosed mid | 120 (changed from 42 during re-deploy) | | Scope | (120, com.tencent.mm, 0) | | Good DEX source | extract from working APK (obfuscated XposedHelpers: lwhVNgqLnt.mxUMcgFJoCZ) | ⚠️ The mid is NOT static — it changes on every pm install. Always query the DB for the current mid: ```bash su -c 'sqlcipher -header -column /data/adb/lspd/config/modules_config.db "SELECT mid, module_pkg_name, enabled FROM modules;"' ``` ⚠️ The mid value is NOT stable across reinstalls. Always query the live DB: `su -c 'sqlcipher -header -column /data/adb/lspd/config/modules_config.db "SELECT mid,module_pkg_name,enabled FROM modules;"'` ## Also: send_wechat_message_ui force-stops WeChat `~/pixelphone/event_bus/wechat_send.py` line 363: `am force-stop com.tencent.mm` — kills tablet login on every send. Full reference: `/sdcard/wechathook/do_not_break.md`