Commit Graph

2 Commits

Author SHA1 Message Date
subochev 8a0b7832c0 phone: autonomous Shizuku revive over wireless-adb; glasses screen on/off buttons
AdbClient wraps the bundled libadb.so (useLegacyPackaging -> exec from nativeLibraryDir, HOME/TMPDIR overridden, adb key injected into BuildConfig from ~/.android at build time and never committed). ShizukuProvisioner: on each BLE+WiFi connect it enables ADB-over-WiFi via Mercury, connects with mDNS fallback, pushes the Shizuku starter and runs it; runs once per BLE session, does not relaunch GlassesApp when the WS channel is already up, and exposes runShell() for arbitrary commands. DebugReceiver (DUMP) + am start --ez provision for diagnostics.

Protocol: ShizukuStatus(running/granted) + RequestShizukuStatus; glasses push it on connect and on Shizuku state change, using a passive probe() that never shows a permission dialog. Glasses kill-guard now recreates its UserService when the Shizuku binder dies instead of spamming DeadObjectException. Mercury: brightness disables auto-brightness first (was silently ignored), BLE auto-connect loop retries every 6s (fixes 'searches then stops'). New phone section 'Экран очков' with wake/sleep via adb (input keyevent 224/223).
2026-09-27 03:52:05 +03:00
subochev 42f117796a glasses: ShizukuBootstrap rewrite per docs (sticky listener + activity context)
Rewrite the Shizuku integration to follow https://github.com/RikkaApps/Shizuku-API:

- attach(activity) instead of attach(): requestPermission() must run from
  an Activity context (Manager's RequestPermissionActivity is a normal
  Activity started from ours).
- addBinderReceivedListenerSticky: ensures our listener fires even if the
  binder was already received before we attached (race against the
  ShizukuProvider init).
- addRequestPermissionResultListener: routes the dialog's allow/deny
  back into the StateFlow.
- onRequestPermissionResult(requestCode, grant): helper for the Activity
  to forward the system callback.
- pingBinder / checkSelfPermission / requestPermission gates follow the
  state machine from the docs (Waiting → NeedsPermission → Granted).

Move attach() out of GlassesVmApp.onCreate (no Activity context there)
into MainActivity.onCreate after super.onCreate.
2026-09-25 15:21:34 +03:00