Version 0.4 incorporates a variety of improvements and QOL features. This is a significant update and all users are encouraged to adopt it.
Before you upgrade: the web interface and API now need a 6-digit access code. Open the app on the device once after updating and the code is on the main screen. Scripts and Home Assistant setups need to send it in an X-Access-Code header. A few endpoints changed too, see "Upgrading from 0.3.x" below.
On the back end the CI/CD has been expanded and hardened, with significant automated testing. Prior releases were cobbled together using Android Studio. This release was written entirely on GitHub. Manual testing has been overhauled, with scripted tests running on an emulator for every change, on top of manual button pressing on a real Android TV.
Dependencies have all been bumped. I have added supply chain hardening by pinning every GitHub Action to a full commit SHA, and made bumping versions much easier by way of Dependabot. CodeQL scanning is on too.
Generated APKs now support attestation. Each release APK comes with a signed build provenance record from GitHub, tying the file to the exact commit and workflow run that built it. If you want to be sure the APK you downloaded really came from this repo's build, run gh attestation verify <apk> --repo mouldybread/adb-auto-enable. A SHA-256 checksum file sits next to the APK as well.
Permission granting is an issue after all. There are devices out there that don't allow it, and users of those devices now see a card in the web interface explaining what is going on, with a button to retry the grant that reports what really happened. If wireless debugging is already on, the boot run now carries on without the permission. If it is off, the app says so straight away instead of retrying three times. With thanks to @potplant15 for their contribution (this is built on their work in #26) and to @ddnsmax for the report in #25. I could not test the restricted-device paths on real hardware, so if you are on one of those devices, please tell me how it goes.
Discovery now does a better job of telling you why it failed, if it does. The "Last known port" box shows what is happening ("Discovery in progress", "Not found", " (not responding)"), and the boot status no longer reports a failure while your target port is answering. The process of discovery has also been tweaked to try and reduce the chances of it missing a working adb port: a stale mDNS entry is no longer trusted unless it accepts a connection (#32, thanks @miguel-belbut).
The web based GUI has been hardened, and will now resist the most common forms of interference (cross-site requests, DNS rebinding, framing and brute-forcing the code). It will no longer allow you to load it from a hostname, only the device IP. It is still plain HTTP, so keep it on a network you trust.
Dark mode has been added to the web based GUI and the light mode has been tweaked for contrast, making it more readable. The top status bar has been repaired and now provides immediate feedback for button presses, and the duplicate messages under each button are gone. The on-device screen follows the system light/dark setting too, and its two switches now keep up with changes made from the web interface.
Also new: the legacy port switch is now optional, so you can just have Wireless Debugging enabled at boot if that is all you want, and the HTTP API is fully documented in API.md.
What's Changed
Web interface and API
- Add a dark mode to the web interface, fix the hidden top status bar, make light-theme button text readable, report every action in the top bar only, and make the on-device screen follow the system theme and keep its switches in sync with the web interface by @mouldybread in #57
- Documented API, 6-digit access code and web server hardening (part of #33) by @mouldybread in #51
- Optional legacy ADB port switch: setting, API and web UI (part of #33) by @mouldybread in #49
- Show the last known port and discovery state (Refs #32) by @mouldybread in #53
- Serve the web UI from asset files instead of an inline string, no behaviour change by @mouldybread in #50
- Tidy the on-device screen: address on the first line, access code with a Generate new code button, scrollable (in #51)
Discovery and boot
- Only use an mDNS port that accepts a connection, fall back to the port sweep otherwise (#32) by @mouldybread in #52
- Do not report a failed boot run while the target port answers (Refs #30) by @mouldybread in #55
- Handle a missing WRITE_SECURE_SETTINGS permission at boot, with a retry in the web UI (Refs #25) by @mouldybread in #56, co-authored by @potplant15
Build, CI and release
- Consolidated PR workflow: build, unit tests and lint, with lint errors blocking and JDK 21, replacing three older workflows by @mouldybread in #34
- Release workflow: JDK 21, mandatory signing certificate check, SHA-256 checksum, draft releases by @mouldybread in #35
- Attest build provenance for the release APK by @mouldybread in #36
- Emulator smoke test of the boot path on API 34 by @mouldybread in #37, plus an emulator API test that checks every endpoint, the access code and request guards, secrets in logs and a real reboot (in #51)
- Bump actions to their Node 24 majors by @mouldybread in #38
- Pin actions to commit SHAs, add Dependabot and CodeQL, validate the Gradle wrapper by @mouldybread in #39
- Generated release notes configuration, excluding Dependabot by @mouldybread in #45
- Remove unused resources and move test dependencies into the version catalog by @mouldybread in #47
- Untagged builds now install over each other: versionCode comes from the version and the commits since the tag. Existing installs update as normal by @mouldybread in #54
Dependencies
- org.json 20250517 to 20260814 (#40), androidx.annotation 1.10.0 to 1.11.0 (#41), mockito-core 5.14.2 to 5.25.0 (#42), conscrypt-android 2.6.1 to 2.10.0 (#43), Android Gradle Plugin 9.3.1 to 9.5.3 (#44), Gradle wrapper 9.7.0 to 9.9.3 (#48), all by @dependabot
Docs
- New README sections for the Secure Settings permission, optional port switching, the Last known port box and the web interface and API (with an upgrade guide), plus API.md and an updated SECURITY.md
Upgrading from 0.3.x
- Open the app once and note the access code on its main screen. Browsers log in once and stay logged in for a year. Five wrong codes lock that address out for a minute, doubling up to an hour. Generate new code on the device logs everything out.
- Scripts: send the code in an
X-Access-Codeheader, or log in once withPOST /api/loginand reuse the cookie. /api/switchand/api/testnow needPOST. They used to acceptGET./api/webservernow needsenabled=trueorenabled=false. It used to treat a missing value astrue.- Use the device IP in the URL. Other hostnames and reverse proxies are refused.
- Request bodies of 1 KB or more are refused.
- With port switching turned off, TCL devices may not finish the AUTO_START step, because it connects to the target port.
Thanks
- @potplant15: co-author of the Secure Settings retry work in #56, based on their #26
- @ddnsmax: reported #25
- @miguel-belbut: reported #32 and #33
- @MulverineX: reported the boot status problem that became #30, in #29
Full Changelog: v0.3.7...v0.4.0