android_tv_remote_package

An Android tv Remote Package

Getting Started

PHASE 1: Initialize ├─ Generate RSA Certificate (DER + PKCS#12) ├─ Store securely in app filesystem └─ Initialize Certificate Manager

PHASE 2: Discovery ├─ Request mDNS/NSD permissions ├─ Scan for _androidtvremote._tcp services ├─ Resolve services to IP:Port └─ Return device list to Flutter

PHASE 3: Connection ├─ Create SSL Context with client certificate ├─ Initiate TLS 1.2 connection (port 6466/6467) ├─ Verify mutual certificate authentication └─ Open encrypted channel

PHASE 4: Pairing ├─ Send pairing request (protobuf message) ├─ Wait for TV to display 6-char PIN ├─ Pass PIN to Flutter UI ├─ Receive PIN confirmation from user ├─ Send PIN back to TV (protobuf format) └─ Verify pairing success

PHASE 5: Ready ├─ Build command queue ├─ Send keycode messages (protobuf format) ├─ Handle media/text commands └─ Maintain persistent connection