Accessing the UI¶
The server is bound to loopback (127.0.0.1) on the device, so reach it from your desktop over
adb port forwarding:
-
Forward the port from your machine to the device:
-
Open http://localhost:8080 in a desktop browser.
-
Every request needs a token, and this is always on. Read the token from logcat. Lustro logs one line at the
LustroTokentag each time the server binds its port, in a fixed format that scripts can parse.-dprints the log and exits, instead of waiting for new lines:Some devices drop Info logs: with
adb shell getprop log.tagset toE, the line never reaches logcat.adb shell setprop log.tag.LustroToken Ilets it through until the device restarts, and the line comes again when the app returns to the foreground. The token, and the host and port of the last bind, are also in the app's prefs, which a debuggable app lets you read:adb shell run-as <package> cat shared_prefs/lustro_debug.xml. ThelustroCLI reads them on its own: first with--package, and else when the log has no line. -
Authenticate the browser with that token, either by:
- using the
lustroCLI (lustro open, see ThelustroCLI); or - appending
#lustro_token=<token>to the URL once (http://localhost:8080/#lustro_token=<token>). The page posts the token to set anHttpOnly; SameSite=Strictcookie, then strips the fragment from the address bar.
- using the
The server runs only while the app is foregrounded. When the app goes to the background the server drains in-flight requests and closes the socket; it rebinds when the app returns to the foreground.