Tham chiếu API

App

Lấy thông tin thiết bị và ứng dụng, đặt clipboard, khởi chạy lại ứng dụng và quản lý cài đặt cấp thiết bị. Các mutation thư mục yêu thích được tài liệu hóa trong phần Files.

Định nghĩa kiểu

bash
type App {
  usbConnected: Boolean!
  urlToken: String!              # current session token
  httpPort: Int!
  httpsPort: Int!
  appDir: String!
  deviceName: String!
  battery: Int!                  # battery level 0–100
  appVersion: Int!               # versionCode
  osVersion: Int!                # Android SDK level e.g. 35
  channel: String!               # "github" | "google"
  permissions: [String!]!        # granted API permissions
  audios: [PlaylistAudio!]!      # current playlist
  audioMode: MediaPlayMode!      # REPEAT | REPEAT_ONE | SHUFFLE
  audioCurrent: String!          # path of the playing track
  sdcardPath: String!
  usbDiskPaths: [String!]!
  internalStoragePath: String!
  downloadsDir: String!
  developerMode: Boolean!
  favoriteFolders: [FavoriteFolder!]!
}

type FavoriteFolder {
  rootPath: String!
  fullPath: String!
  alias: String              # optional display alias, nullable
}

type TempValue {
  key: String!
  value: String!
}

type DeviceInfo {
  # Hardware + OS info: manufacturer, model, sdkInt, buildChannel, etc.
  # Fields are platform-dependent; see PlainApp source for the full list.
}

type Battery {
  level: Int!                # 0–100
  status: BatteryStatus!     # CHARGING | DISCHARGING | FULL | NOT_CHARGING
  health: BatteryHealth!
  plugged: BatteryPlugged!
  temperature: Int!          # tenths of a degree Celsius
  voltage: Int!              # millivolts
}

enum BatteryStatus   { CHARGING DISCHARGING FULL NOT_CHARGING UNKNOWN }
enum BatteryHealth   { GOOD OVERHEAT DEAD OVER_VOLTAGE UNSPECIFIED_FAILURE UNKNOWN COLD }
enum BatteryPlugged  { AC USB WIRELESS NONE }

Thao tác

query

app

Lấy tất cả trạng thái thiết bị và ứng dụng trong một query duy nhất.

bash
query GetApp {
  app {
    usbConnected urlToken httpPort httpsPort appDir deviceName
    battery appVersion osVersion channel permissions
    audios { title path duration } audioMode audioCurrent
    sdcardPath usbDiskPaths internalStoragePath downloadsDir developerMode
    favoriteFolders { rootPath fullPath alias }
  }
}
query

deviceInfo

Lấy thông tin phần cứng và hệ điều hành (nhà sản xuất, mẫu, cấp SDK, v.v.).

bash
query GetDeviceInfo {
  deviceInfo { manufacturer model sdkInt buildChannel }
}
query

battery

Lấy mức pin hiện tại, trạng thái sạc, sức khỏe và điện áp.

bash
query GetBattery {
  battery { level status health plugged temperature voltage }
}
mutation

setTempValue

Đặt một cặp key/value tạm thời trong bộ nhớ máy chủ. Được xóa khi máy chủ HTTP khởi động lại.

bash
mutation SetTempValue($key: String!, $value: String!) {
  setTempValue(key: $key, value: $value) { key value }
}
mutation

relaunchApp

Khởi động lại quy trình PlainApp trên thiết bị.

bash
mutation RelaunchApp {
  relaunchApp
}
mutation

openAccessibilitySettings

Mở màn hình cài đặt Android Accessibility trên thiết bị. Yêu cầu trước khi sendScreenMirrorControl có thể điều phối cử chỉ.

bash
mutation OpenAccessibilitySettings {
  openAccessibilitySettings
}
mutation

openWebSettings

Mở màn hình cài đặt web-UI PlainApp trên thiết bị (mật khẩu, 2FA, v.v.).

bash
mutation OpenWebSettings {
  openWebSettings
}
mutation

setClip

Đặt clipboard thiết bị thành văn bản đã cho.

bash
mutation SetClip($text: String!) {
  setClip(text: $text)
}
mutation

updateDeviceName

Thay đổi tên hiển thị thiết bị được hiển thị trong web UI và phát sóng đến các peer đã ghép nối.

bash
mutation UpdateDeviceName($name: String!) {
  updateDeviceName(name: $name)
}