A small standalone utility for Wear OS to toggle the captive_portal_mode system flag on watches with dual architecture like the One Plus watch 3. Works directly on the watch without a phone connection.
Wear OS's captive portal detection actively disconnects the watch from networks that
require a browser-based login (hotel WiFi, gym, etc.). The setting responsible,
captive_portal_mode, can be disabled via ADB. However, on devices with a Dual-Engine
Architecture (at least on the OnePlus Watch 3), the flag seems to be silently reset
every time the watch exits deep sleep.
These watches use a low-power RTOS (Real-Time Operating System) co-processor to handle
sleep and sensors. When the main CPU wakes and Wear OS re-initializes, Settings.Global
values seem to be restored to factory defaults (captive_portal_mode = 2), as if the
watch had rebooted. A one-time ADB fix does not seem to survive this cycle in these
devices.
This fixes this issue with two layers of protection:
- A
BroadcastReceiverlistening forACTION_BOOT_COMPLETEDapplies the fix immediately every time Wear OS re-initializes after deep sleep (in the One Plus watch this matches the "Sleep mode" to "Smart mode" transition) - A WorkManager periodic worker runs hourly as a safety net, correcting the flag if it was reset while Wear OS was already running
Both layers skip when Power Save Mode is active. This lets you apply and maintain Wi-Fi connectivity to these networks directly from the watch, without a paired phone or a computer running ADB nearby.
This app requires the WRITE_SECURE_SETTINGS permission. Since this is a protected
system permission, it must be granted manually via ADB:
adb shell pm grant com.tferr.captivity android.permission.WRITE_SECURE_SETTINGS- Clone the repository
- Open in Android Studio
- Build using ./gradlew assembleRelease
- Install and grant permission in one go:
./gradlew assembleRelease
adb pair 192.X.X.X:<connection-port>
adb connect 192.X.X.X:<connection-port>
adb install -r app/build/outputs/apk/release/Captivity-release-1.0.apk
adb shell pm grant com.tferr.captivity android.permission.WRITE_SECURE_SETTINGS