Database Schema

AVNC uses the Android Jetpack Room library, which provides an abstraction layer over SQLite. Connection configurations are stored in the profiles table.

Entity: ServerProfile

Field SQLite Type Description
ID INTEGER (PK) Auto-generated unique identifier.
name TEXT User-friendly display name.
host TEXT IP address or hostname of the VNC server (or Repeater).
port INTEGER TCP Port number (default: 5900).
username TEXT VNC Username (Apple/VeNCrypt).
password TEXT VNC Password.
securityType INTEGER Specific RFB security type, or 0 for auto-negotiation.
channelType INTEGER 1 for TCP, 24 for SSH Tunnel.
imageQuality INTEGER JPEG compression level (0-9).
useRawEncoding INTEGER (Bool) Forces uncompressed RAW encoding.
zoom1 REAL Saved zoom level for Portrait orientation.
zoom2 REAL Saved zoom level for Landscape orientation.
viewMode INTEGER 0 = Normal, 1 = No Input, 2 = No Video.
gestureStyle TEXT Enforced pointer mode: auto, touchscreen, or touchpad.
useRepeater INTEGER (Bool) If true, host acts as an UltraVNC repeater.
idOnRepeater INTEGER The numeric ID sent to the repeater to route the connection.
flags INTEGER Bitmask for various toggles (fZoomLocked, fButtonUpDelay, fConnectOnAppStart).
useCount INTEGER Times connected. Used to rank Android App Shortcuts.
enableWol INTEGER (Bool) Dispatch a Magic Packet before connecting.
wolMAC TEXT The MAC Address for Wake-on-LAN.
wolBroadcastAddress TEXT Optional custom subnet broadcast address.
wolPort INTEGER UDP Port for WoL (default 9).
sshHost / sshPort TEXT / INTEGER SSH Tunnel destination and port.
sshUsername / sshPassword TEXT SSH credentials.
sshAuthType INTEGER 1 = Key, 2 = Password.
sshPrivateKey TEXT PEM or PKCS8 encoded string of the private key.

Schema Migrations

As features have been added, the Room schema has evolved via AutoMigration specs defined in MainDb.kt:

  • v1 to v2: Added fields for image quality, raw encoding, split zoom states, and gesture styles.
  • v2 to v3: Renamed keyCompatMode to compatFlags to hold multiple toggles.
  • v4 to v5: Converted compatFlags to a long flags bitmask. Renamed shortcutRank to useCount.
  • v6 to v7: Replaced the viewOnly boolean with a viewMode integer enum to support the new "No Video" mode. Removed sshPrivateKeyPassword from disk persistence (it is now only held in ephemeral memory to improve security).