Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

OpenRemote: TV Remote

A free, open-source smart TV remote for Android and iOS, built with Flutter. It works entirely on your local Wi-Fi: no accounts, ads, tracking or paid features. Its main feature is typing into TV text fields with the phone's own keyboard.

The full design is in docs/TECHNICAL_DESIGN.md; what works on which TV is in docs/COMPATIBILITY.md. To try it on your own TV, see docs/TESTING_ON_LG.md. Test builds are made on every push: an Android APK (Actions → Build Android APK) and an unsigned iPhone IPA to sideload from Windows (Actions → Build iOS IPA (unsigned)). Both are under each run's Artifacts.

Status

Design phases 1–2 are done for Roku, LG webOS and Android TV / Google TV, along with the keyboard, touchpad and app-launcher work from phases 3–4. Samsung Tizen, Fire TV and Apple TV are not implemented yet.

Nothing has been tested on a physical TV yet. All three adapters are tested only against mock protocol servers. See the compatibility matrix.

Area State
Flutter app (Android + iOS), Riverpod, Material 3 light/dark themes ✅
Unified adapter contract with capability gating and structured errors ✅
SSDP discovery, manual IP entry, saved TVs, favorites, rooms ✅
SQLite metadata storage; pairing secrets in Keychain/Keystore ✅
Roku ECP adapter ✅ (mock-tested)
LG webOS adapter (pairing prompt, pointer, IME text, focus events) ✅ (mock-tested)
Android TV / Google TV adapter (PIN pairing, TLS client certs, IME text, app links) ✅ (mock-tested)
Samsung Tizen adapter (2016+: prompt + token pairing, IME text, pointer, apps and icons) ✅ (mock-tested)
Demo TV (simulated, for trying the app and store review) ✅
mDNS discovery (Android multicast lock included) ✅
Keyboard subsystem: diffed edits, batching, state machine, live/manual send ✅
Touchpad: pointer on webOS, swipe-to-arrows elsewhere, two-finger scroll, adjustable sensitivity ✅
Keyboard extras: clipboard paste, local search history (with privacy switch), arrow keys on the keyboard screen ✅
App launcher ✅
Wake-on-LAN power on, auto-reconnect with backoff ✅
Haptics (off/light/medium/strong; distinct tap and hold), left-handed layout, TalkBack/VoiceOver labels ✅
App icons fetched from the TV (Roku, LG) ✅
User themes: import/export/share JSON theme files (format) ✅
Macros (power on, wait, keys, apps/inputs, volume, delays, text) with per-TV capability checks; sleep timer; per-TV volume limit ✅
Now Playing card (progress on Roku), adaptive remote (playback controls while playing, touchpad hint in browsers) ✅
Watchlist: save links (Android share sheet or paste), open on the TV (exact on Android TV; YouTube/Netflix deep links on Roku and LG), backup/restore ✅
Household profiles: child mode with PIN, simple remote, allowed apps, volume ceiling, viewing hours (phone-side only) ✅
Custom remote builder: drag/resize/remove buttons (keys, D-pad, apps, macros, custom commands, now playing), Music and Minimal templates, import/export ✅
Custom commands per TV system (ECP keys/launch, SSAP requests/buttons, Android key codes/links), validated with a block list for destructive operations ✅
Samsung, Fire TV, Apple TV adapters —
Widgets, Quick Settings tile, IR, voice —

Architecture

lib/
  app/              App shell and top-level providers
  core/
    adapter/        SmartTVAdapter contract, ProtocolDriver (discovery + factory)
    capabilities/   DeviceCapabilities, RemoteKey
    connection/     Backoff, Wake-on-LAN
    discovery/      SSDP and mDNS clients, DiscoveryService
    security/       CredentialStore (flutter_secure_storage)
    storage/        SQLite DeviceRepository
  protocols/
    roku/           ECP over HTTP :8060
    lg_webos/       SSAP over WebSocket :3001 (wss) / :3000 (ws)
    android_tv/     Android TV Remote v2: protobuf over TLS :6467 (pair) / :6466
    registry.dart   The drivers this build ships
  features/
    remote/         RemoteSession (unified controller) and the remote screen
    keyboard/       TextEdit diff, KeyboardController state machine, panel
    touchpad/  applications/  devices/  settings/
  ui/               Shared components (RemoteButton, DPad) and themes
  • Adapters (SmartTVAdapter) speak one protocol. Every method is capability-gated and throws TvRemoteException with a TvErrorCode instead of failing silently.
  • Drivers (ProtocolDriver) tell discovery how to find a protocol's TVs and build adapters for them. Adding a platform means adding a driver to protocols/registry.dart; the UI needs no changes.
  • RemoteSession is the unified controller. It owns the active adapter, checks capabilities before routing commands, saves pairing keys to the secure store, persists device info, and reconnects with backoff.
  • The UI hides controls that the connected TV does not report as supported.

Keyboard

KeyboardController implements the design's state machine (disconnected → connected → textFieldDetected → keyboardActive → textEditing → textSubmitted → keyboardClosed). It remembers what it has already sent and transmits only the difference (TextEdit.between, computed on Unicode code points), batched over a configurable 20–75 ms window. That works for append-only TVs (Roku Lit_ keypresses plus Backspace) and for text APIs (webOS IME insert/delete) alike, and it never resends the whole buffer. Edits are serialized so they arrive in order. Text is never logged, and buffers are cleared on submit, focus loss and disconnect.

Development

Requires Flutter 3.47 or later.

flutter pub get
flutter analyze
flutter test
flutter run            # on a device or emulator on the same Wi-Fi as the TV

Tests run the real adapters against local mock servers: an HTTP server for Roku ECP, a WebSocket server for webOS SSAP (pairing prompt, pointer socket, IME focus events), and a pair of TLS servers for Android TV (PIN pairing with client certificates, certificate pinning, remote handshake, IME edits). The Android TV pairing hash was also checked byte-for-byte against the androidtvremote2 Python implementation. Repository tests use in-memory SQLite through sqflite_common_ffi, which needs the system libsqlite3 (apt install libsqlite3-dev on Debian/Ubuntu).

Platform notes

  • Android: cleartext traffic is allowed because Roku ECP and webOS port 3000 are plain HTTP/WS on the LAN (see android/app/src/main/res/xml/network_security_config.xml). The app makes no internet requests.
  • Android mDNS: Android drops incoming multicast unless the app holds a Wi-Fi MulticastLock. MainActivity.kt exposes one over a method channel, and it is held only while a scan runs.
  • iOS: NSLocalNetworkUsageDescription, NSAllowsLocalNetworking and NSBonjourServices (_androidtvremote2._tcp) are set. SSDP and mDNS discovery also need the com.apple.developer.networking.multicast entitlement, which Apple must grant to your team. Add it to Runner.entitlements once you have it. Until then, use Add by IP.

License

Apache License 2.0. Roku, LG, webOS, Android TV and Google TV are trademarks of their respective owners. This project is not affiliated with or endorsed by them.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages