TrollScript provides a powerful JavaScript environment with access to various system features. Below is the comprehensive API reference for all available modules.
The following icons indicate API compatibility when running in background trigger mode:
| Icon | Status | Description |
|---|---|---|
| ✅ | Full | Full Support - Functions correctly under triggers |
| Limited | Limited Support - Some features may be restricted or ineffective | |
| ❌ | None | No Support - Requires foreground execution; unavailable under triggers |
- console ✅ - Console output
- device ✅ - Device information
- clipboard ✅ - Clipboard operations & text input field writing
- storage ✅ - Local key-value storage
- icloud ✅ - iCloud file operations
- file ✅ - File system operations
- http ✅ - Network requests (Async Promise-based)
- network
⚠️ - Network operations - app
⚠️ - App operations and management - haptic
⚠️ - Haptic feedback - display
⚠️ - Display and screen control - hud ✅ - HUD System - Create floating windows and UI elements
- util ✅ - Utility functions
- location
⚠️ - Location services - calendar
⚠️ - System calendar - reminder
⚠️ - Reminders and checklists - contacts
⚠️ - Contact management operations - notification
⚠️ - Local notifications - sms ✅ - SMS and messaging operations
- sql ✅ - SQLite database operations
- shortcuts ❌ - Shortcuts operations
- system ✅ - System settings control
Console output
Signature: log(...args)
Output log messages
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
...args |
any[] |
Content to be logged | No |
Returns: void
Signature: error(...args)
Output error messages
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
...args |
any[] |
Content to be logged as an error | No |
Returns: void
Signature: warn(...args)
Output warning messages
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
...args |
any[] |
Content to be logged as a warning | No |
Returns: void
Signature: info(...args)
Output informational messages
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
...args |
any[] |
Content to be logged as info | No |
Returns: void
Signature: debug(...args)
Output debug messages
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
...args |
any[] |
Content to be logged for debugging | No |
Returns: void
Signature: clear()
Clear the console
Returns: void
Device information
Signature: info()
Retrieve general device information
Returns: { name: string, model: string, systemName: string, systemVersion: string, identifier: string }
An object containing device name, model, OS name, OS version, and identifier
Signature: battery()
Get battery and power status
Returns: { level: number, state: string, lowPowerMode: boolean }
An object containing battery level (0-1), charging state, and Low Power Mode status
Signature: screen()
Retrieve screen and display metrics
Returns: { width: number, height: number, scale: number, brightness: number }
An object containing screen dimensions, display scale (PPI factor), and brightness level
Clipboard operations & text input field writing
Signature: getText()
Get text from the clipboard
Returns: string
The text content currently in the clipboard
Signature: setText(text)
Set text to the clipboard
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
text |
string |
The text content to be set | No |
Returns: void
Signature: clear()
Clear the clipboard
Returns: void
Signature: hasText()
Check if the clipboard contains text
Returns: boolean
Whether the clipboard has text content
Local key-value storage
Signature: get(key)
Retrieve a stored value
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
key |
string |
The unique key for the stored data | No |
Returns: any
The stored value, or undefined if the key does not exist
Signature: set(key, value)
Store a value associated with a key
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
key |
string |
The key under which to store the value | No |
value |
any |
The data to be persisted | No |
Returns: void
Signature: remove(key)
Delete a specific key and its associated value
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
key |
string |
The key to be removed | No |
Returns: void
Signature: clear()
Remove all stored keys and values
Returns: void
Signature: has(key)
Check if a specific key exists in storage
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
key |
string |
The key to check | No |
Returns: boolean
Whether the key exists
Signature: keys()
Get all stored keys
Returns: string[]
An array of all keys in storage
iCloud file operations
Signature: containerPath()
Get the iCloud container path
Returns: string \| null
Local path of the iCloud container, or null if unavailable
Signature: read(path)
Read a file from iCloud
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File path (relative to the iCloud container) | No |
Returns: string
The content of the file
Signature: write(path, content)
Write content to an iCloud file
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File path | No |
content |
string |
The content to be written | No |
Returns: boolean
Whether the write operation was successful
Signature: delete(path)
Delete a file from iCloud
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File path | No |
Returns: boolean
Whether the deletion was successful
Signature: list(path?)
List contents of an iCloud directory
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Directory path, defaults to the root directory | Yes |
Returns: [string]
An array of file names
File system operations
Signature: read(path)
Read file content
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Absolute file path | No |
Returns: string
The content of the file
Signature: write(path, content)
Write content to a file
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Absolute file path | No |
content |
string |
The content to be written | No |
Returns: boolean
Whether the write operation was successful
Signature: append(path, content)
Append content to a file
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Absolute file path | No |
content |
string |
The content to be appended | No |
Returns: boolean
Whether the append operation was successful
Signature: exists(path)
Check if a file exists
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Absolute file path | No |
Returns: boolean
Whether the file exists
Signature: delete(path)
Delete a file
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Absolute file path | No |
Returns: boolean
Whether the deletion was successful
Signature: move(from, to)
Move a file
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
from |
string |
Source path | No |
to |
string |
Destination path | No |
Returns: boolean
Whether the move operation was successful
Signature: copy(from, to)
Copy a file
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
from |
string |
Source path | No |
to |
string |
Destination path | No |
Returns: boolean
Whether the copy operation was successful
Signature: list(path)
List directory contents
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Directory path | No |
Returns: [string]
An array of file names
Signature: mkdir(path)
Create a new directory
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Directory path | No |
Returns: boolean
Whether the directory was successfully created
Signature: stat(path)
Retrieve file information
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File path | No |
Returns: { size: number, modificationDate: number, creationDate: number, type: string }
Object containing size (bytes), modification timestamp, creation timestamp, and type (file/directory)
Signature: isDirectory(path)
Check if the path is a directory
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File path | No |
Returns: boolean
Whether the path is a directory
Signature: documentsPath()
Get the Documents directory path
Returns: string
The absolute path of the Documents directory
Signature: cachePath()
Get the Caches directory path
Returns: string
The absolute path of the Caches directory
Signature: tempPath()
Get the Temporary directory path
Returns: string
The absolute path of the Temporary directory
Signature: debug(path)
Debug access permission details for a path
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File path | No |
Returns: string
Debug information string
Signature: rootRead(path)
Read protected files with Root privileges (requires TrollStore)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Absolute file path | No |
Returns: string \| null
File content, or null if reading failed
Signature: rootList(path)
List protected directory contents with Root privileges (requires TrollStore)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Absolute directory path | No |
Returns: [string] \| null
An array of file names, or null if it failed
Signature: rootCopy(src, dest)
Copy protected files with Root privileges (requires TrollStore)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
src |
string |
Source file path | No |
dest |
string |
Destination file path | No |
Returns: boolean
Whether the copy was successful
Signature: rootCheck(path)
Inspect path details with Root privileges (requires TrollStore)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File or directory path | No |
Returns: { readable: boolean, writable: boolean, exists: boolean, isDirectory: boolean }
Object containing read/write permissions, existence, and other debug info
Signature: rootExists(path)
Check file existence with Root privileges (requires TrollStore)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
File path | No |
Returns: boolean
Whether it exists
Signature: rootAvailable()
Check if the Root Helper is available
Returns: boolean
Whether the helper is available
Network requests (Async Promise-based)
Signature: get(url, options?)
Send a GET request (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Target URL | No |
options |
object |
Request options { headers, timeout, insecure, sync } | Yes |
Returns: Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }>
Returns a Promise that resolves with success status, status code, response data, and headers. Set sync: true for synchronous mode
Signature: post(url, options?)
Send a POST request (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Target URL | No |
options |
object |
Request options { body, headers, timeout, insecure, sync } | Yes |
Returns: Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }>
Returns a Promise that resolves with the response. Set sync: true for synchronous mode
Signature: put(url, options?)
Send a PUT request (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Target URL | No |
options |
object |
Request options { body, headers, timeout, insecure, sync } | Yes |
Returns: Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }>
Returns a Promise that resolves with the response
Signature: delete(url, options?)
Send a DELETE request (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Target URL | No |
options |
object |
Request options { headers, timeout, insecure, sync } | Yes |
Returns: Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }>
Returns a Promise that resolves with the response
Signature: patch(url, options?)
Send a PATCH request (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Target URL | No |
options |
object |
Request options { body, headers, timeout, insecure, sync } | Yes |
Returns: Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }>
Returns a Promise that resolves with the response
Signature: head(url, options?)
Send a HEAD request (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Target URL | No |
options |
object |
Request options { headers, timeout, insecure, sync } | Yes |
Returns: Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }>
Returns a Promise that resolves with the response (data is typically empty for HEAD requests)
Signature: request(url, options)
Send a custom HTTP request (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Target URL | No |
options |
object |
Request options { method, body, headers, timeout, insecure, sync } | No |
Returns: Promise<{ success: boolean, status?: number, data?: string, headers?: object, error?: string }>
Returns a Promise that resolves with the response
Signature: download(url, path, options?)
Download a file (async, returns Promise)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Download source URL | No |
path |
string |
Local destination path to save the file | No |
options |
object |
Request options { insecure, sync } | Yes |
Returns: Promise<{ success: boolean, path?: string, error?: string }>
Returns a Promise that resolves with success status and local file path
Network operations
Trigger Note: The 'openSettings' method requires UI interaction and is unavailable in Daemon mode.
Signature: isReachable()
Check if the network is reachable
Returns: boolean
Whether the network is available
Signature: getConnectionType()
Get current connection type
Returns: 'wifi' \| 'cellular' \| 'none'
Connection type (wifi/cellular/none)
Signature: getIPAddress()
Get the device's IP address
Returns: string \| null
IP address string
Signature: encodeURL(string)
Percent-encode a URL string
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
string |
string |
The string to encode | No |
Returns: string
Encoded URL string
Signature: decodeURL(string)
Decode a percent-encoded URL string
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
string |
string |
The string to decode | No |
Returns: string
Decoded URL string
Signature: parseURL(url)
Parse a URL into its components
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
The URL to parse | No |
Returns: { scheme: string, host: string, path: string, query: string, params: object }
Object containing URL components
Signature: buildURL(baseURL, params?)
Construct a URL with query parameters
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
baseURL |
string |
The base URL | No |
params |
object |
Query parameters | Yes |
Returns: string
The constructed URL string
Signature: ping(host)
Ping a remote host
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
host |
string |
Hostname or IP address | No |
Returns: { success: boolean, latency: number }
Object containing success status and latency (ms)
Signature: download(url, filename?)
Download a file from a URL
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Download source URL | No |
filename |
string |
Local filename to save as | Yes |
Returns: { success: boolean, path?: string, error?: string }
Object containing success status and the local file path
Signature: listVPNs()
List all VPN configurations
Returns: [{ name: string, active: boolean }]
A list of VPN configuration objects
Signature: connectVPN(name?)
Establish a VPN connection
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
VPN configuration name (defaults to the first one) | Yes |
Returns: boolean
Whether the connection request was successful
Signature: disconnectVPN()
Terminate the VPN connection
Returns: boolean
Whether the disconnection request was successful
Signature: getVPNStatus()
Get current VPN connection status
Returns: { connected: boolean, name?: string }
Object containing connection state and VPN name
Signature: openSettings(section?)
Open system network settings
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
section |
string |
Specific setting section (e.g., 'WIFI') | Yes |
Returns: boolean
Whether the settings page was opened
App operations and management
Trigger Note: The 'open/launch' methods require the app to be in the foreground; 'vibrate' may not work in the background.
Signature: version()
Get app version
Returns: string
App version number
Signature: build()
Get app build number
Returns: string
App build number (CFBundleVersion)
Signature: bundleId()
Get app Bundle ID
Returns: string
App's Bundle Identifier
Signature: info()
Get full app information
Returns: AppInfo
App info object containing name, version, build, bundleId, language
Signature: open(url)
Open a URL or URI Scheme
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
The URL to open | No |
Returns: boolean
Whether the URL was opened successfully
Signature: canOpen(url)
Check if a URL can be opened
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
The URL to check | No |
Returns: boolean
Whether the URL can be opened
Signature: vibrate()
Trigger haptic feedback
Returns: void
Signature: getLogs(limit?)
Get app logs
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
limit |
number |
Maximum number of log entries to return | Yes |
Returns: [LogMessage]
Array of log message objects
Signature: exportLogs()
Export logs as a string
Returns: string
Exported log content
Signature: getCrashReports()
Get all crash reports
Returns: [CrashReport]
Array of crash reports
Signature: getLastCrash()
Get the most recent crash report
Returns: CrashReport \| null
The most recent crash report
Signature: clearLogs()
Clear all logs
Returns: void
Signature: exit(code?)
Exit the app (for debugging only)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
code |
number |
Exit code, defaults to 0 | Yes |
Returns: void
Signature: openSettings()
Open app settings page
Returns: boolean
Whether settings was opened successfully
Signature: restartDaemon()
Restart the TrollScript HUD daemon process
Returns: boolean
Whether the restart request was issued successfully
Signature: list()
Get all installed apps (TrollStore privilege)
Returns: [AppInfo]
Array of app info objects containing bundleIdentifier, name, version, type, etc.
Signature: getAppInfo(bundleId)
Get detailed info for a specific app (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
bundleId |
string |
The app's Bundle Identifier | No |
Returns: AppInfo \| null
App info object containing bundleIdentifier, name, version, build, type, teamID, bundlePath, dataContainerPath, urlSchemes, etc.
Signature: launch(bundleId)
Launch a specific app (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
bundleId |
string |
The app's Bundle Identifier | No |
Returns: boolean
Whether the app was launched successfully
Signature: terminate(bundleId)
Terminate a specific app (TrollStore privilege, requires background permission)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
bundleId |
string |
The app's Bundle Identifier | No |
Returns: boolean
Whether the app was terminated successfully
Signature: isInstalled(bundleId)
Check if an app is installed
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
bundleId |
string |
The app's Bundle Identifier | No |
Returns: boolean
Whether the app is installed
Signature: getDataContainer(bundleId)
Get the data container path for an app (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
bundleId |
string |
The app's Bundle Identifier | No |
Returns: string \| null
Data container path, or null if not found
Signature: cpuUsage()
Get CPU usage (process-level + system-level)
Returns: CPUUsage
Object containing process (process CPU %) and system (system CPU object with total/user/system/idle/nice/cores)
Signature: memoryUsage()
Get memory usage information
Returns: MemoryUsage
Object containing usage (current MB), peak (peak MB), unit (unit string)
Signature: fps()
Get current frame rate
Returns: FPSInfo
Object containing fps (frame rate), isWarning (warning state), isCritical (critical state)
Signature: performanceSnapshot()
Get complete performance metrics snapshot
Returns: PerformanceSnapshot
Complete performance snapshot containing cpu, memory, fps, isMonitoring, timestamp
Signature: startMonitoring()
Start performance monitoring (FPS sampling, metrics recording)
Returns: boolean
Whether monitoring started successfully
Signature: stopMonitoring()
Stop performance monitoring
Returns: boolean
Whether monitoring stopped successfully
Signature: performanceRecords(limit?)
Get historical performance records
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
limit |
number |
Number of records to return, defaults to 50 | Yes |
Returns: [PerformanceRecord]
Array of performance records containing id, scriptName, executionTime, peakMemory, averageCPU, timestamp, success
Signature: clearPerformanceRecords()
Clear all performance records
Returns: void
Signature: notifyPost(name)
Send a Darwin Notification
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Notification name | No |
Returns: boolean
Whether the notification was sent successfully
Signature: notifyRegister(name)
Register to listen for a Darwin Notification
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Notification name | No |
Returns: number
Listener token
Signature: notifyCancel(token)
Cancel listening for a Darwin Notification
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
token |
number |
Listener token | No |
Returns: boolean
Whether the listener was cancelled successfully
Haptic feedback
Trigger Note: Haptic feedback may not function in background mode and requires hardware support.
Signature: impact(style?)
Trigger impact feedback
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
style |
string |
The intensity style: 'light' | 'medium' | 'heavy' | 'soft' | 'rigid' | Yes |
Returns: void
Signature: notification(type)
Trigger notification feedback
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
type |
string |
The notification type: 'success' | 'warning' | 'error' | No |
Returns: void
Signature: selection()
Trigger selection feedback (for picker changes, etc.)
Returns: void
Signature: vibrate()
Standard device vibration
Returns: void
Signature: light()
Light impact feedback
Returns: void
Signature: medium()
Medium impact feedback
Returns: void
Signature: heavy()
Heavy impact feedback
Returns: void
Signature: success()
Success notification feedback
Returns: void
Signature: warning()
Warning notification feedback
Returns: void
Signature: error()
Error notification feedback
Returns: void
Display and screen control
Trigger Note: Brightness settings and 'keepAwake' may not function in the background; 'openSettings' requires UI interaction.
Signature: getBrightness()
Get current screen brightness
Returns: number
Current brightness level (0.0 to 1.0)
Signature: setBrightness(value)
Set screen brightness
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
value |
number |
Brightness value (0.0 to 1.0) | No |
Returns: boolean
Whether the operation was successful
Signature: increaseBrightness(amount?)
Increase screen brightness
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
amount |
number |
Amount to increase (defaults to 0.1) | Yes |
Returns: boolean
Whether the operation was successful
Signature: decreaseBrightness(amount?)
Decrease screen brightness
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
amount |
number |
Amount to decrease (defaults to 0.1) | Yes |
Returns: boolean
Whether the operation was successful
Signature: getScreenInfo()
Get screen dimensions and scale
Returns: { width: number, height: number, scale: number, nativeWidth: number, nativeHeight: number }
Object containing width, height, display scale, and native dimensions
Signature: getOrientation()
Get current screen orientation
Returns: 'portrait' \| 'landscape'
Screen orientation mode
Signature: isLowPowerModeEnabled()
Check if Low Power Mode is enabled
Returns: boolean
Whether the mode is active
Signature: setLowPowerMode(enabled)
Toggle Low Power Mode
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Low Power Mode | No |
Returns: boolean
Whether the state was successfully updated
Signature: isAutoBrightnessEnabled()
Check if Auto-Brightness is enabled
Returns: boolean
Whether Auto-Brightness is on
Signature: setAutoBrightness(enabled)
Toggle Auto-Brightness
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Auto-Brightness | No |
Returns: boolean
Whether the update was successful
Signature: openSettings()
Open system display settings
Returns: boolean
Whether the settings page was opened
Signature: keepAwake(enabled)
Keep screen awake and prevent dimming
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to keep the screen on | No |
Returns: boolean
Whether the operation was successful
HUD System - Create floating windows and UI elements
Trigger Note: Fully supported in trigger mode, can create system-level floating windows
Signature: createWindow(config)
Create a HUD window
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
config |
object |
Window config { id?, width?, height?, x?, y?, alignment?, draggable?, dismissible?, autoClear?, style? }, alignment: 'leading'|'center'|'trailing'|'fill' (default leading), style is { backgroundColor?, textColor?, fontSize?, fontWeight?, cornerRadius?, padding?, opacity?, shadow? } | No |
Returns: Window
Window object for adding elements and controlling the window
Signature: getWindow(id)
Get an existing window by ID
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
id |
string |
Window ID | No |
Returns: Window \| null
Window object if found, null otherwise
Signature: getScreenSize()
Get screen size information
Returns: { width: number, height: number, scale: number }
Screen info object containing width, height, scale
Signature: clearAll()
Clear all HUD windows
Returns: void
Signature: getAllWindows()
Get all window IDs
Returns: [string]
Array of window IDs
Utility functions
Signature: uuid()
Generate a unique UUID
Returns: string
The generated UUID string
Signature: md5(string)
Calculate the MD5 hash of a string
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
string |
string |
The input string to hash | No |
Returns: string
The resulting MD5 hash value
Signature: base64Encode(string)
Encode a string to Base64 format
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
string |
string |
The string to encode | No |
Returns: string
The Base64 encoded string
Signature: base64Decode(string)
Decode a Base64 encoded string
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
string |
string |
The Base64 string to decode | No |
Returns: string
The decoded original string
Signature: sha256(string)
Calculate the SHA256 hash of a string
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
string |
string |
The input string to hash | No |
Returns: string
The resulting SHA256 hash value
Signature: formatDate(timestamp, format?)
Format a timestamp into a string
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
timestamp |
number |
The timestamp in milliseconds | No |
format |
string |
The format pattern (e.g., 'yyyy-MM-dd'), defaults to 'yyyy-MM-dd HH:mm:ss' | Yes |
Returns: string
The formatted date string
Signature: now()
Get the current timestamp in milliseconds
Returns: number
The current timestamp
Signature: sleep(ms)
Sleep for a specified duration
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
ms |
number |
Duration in milliseconds | No |
Returns: void
Location services
Trigger Note: The 'requestAccess' method requires UI interaction; 'getCurrent' requires prior authorization.
Signature: requestAccess()
Request location access permissions
Returns: void
Signature: getAccessStatus()
Get current authorization status
Returns: 'authorized' \| 'denied' \| 'restricted' \| 'notDetermined' \| 'unknown'
Current permission status
Signature: isAuthorized()
Check if location access is granted
Returns: boolean
Whether access is authorized
Signature: getCurrent()
Retrieve current geographic location
Returns: { lat: number, lng: number, alt: number, course: number, speed: number, accuracy: number, timestamp: number } \| null
Location data object containing coordinates, altitude, etc., or null if failed
Signature: current()
Get current location (Alias for getCurrent)
Returns: { lat: number, lng: number, alt: number, course: number, speed: number, accuracy: number, timestamp: number } \| null
Location data object, or null if failed
Signature: distance(lat1, lng1, lat2, lng2)
Calculate the distance between two points
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
lat1 |
number |
Latitude of point 1 | No |
lng1 |
number |
Longitude of point 1 | No |
lat2 |
number |
Latitude of point 2 | No |
lng2 |
number |
Longitude of point 2 | No |
Returns: number
Distance in meters
Signature: geocode(address)
Geocoding: Address to coordinates
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
address |
string |
Target address string | No |
Returns: [{ lat: number, lng: number, name: string }]
An array of geographic location objects
Signature: reverseGeocode(lat, lng, locale?)
Reverse Geocoding: Coordinates to address
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
lat |
number |
Latitude | No |
lng |
number |
Longitude | No |
locale |
string |
Locale identifier (optional, e.g., 'en_US', defaults to system language) | Yes |
Returns: [{ name: string, country: string, locality: string, administrativeArea: string, subLocality: string, thoroughfare: string, postalCode: string }]
An array of address information objects
Signature: isLocationServicesEnabled()
Check if system-wide location services are enabled
Returns: boolean
Whether services are enabled
Signature: hasTrollStorePermission()
Check for TrollStore-specific permissions
Returns: boolean
Whether permission is present
Signature: setLocationServicesEnabled(enabled)
Toggle system location services (Requires TrollStore)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
True to enable, false to disable | No |
Returns: { success: boolean, enabled?: boolean, message?: string }
Operation result (success status and current state)
Signature: toggleLocationServices()
Switch location services state (Requires TrollStore)
Returns: { success: boolean, enabled?: boolean, message?: string }
Operation result (success status and new state)
System calendar
Trigger Note: The 'requestAccess' method requires UI interaction; other operations require prior authorization.
Signature: isAuthorized()
Check current authorization status
Returns: boolean
Signature: requestAccess()
Request calendar access permissions
Returns: boolean
Whether authorization was granted
Signature: getCalendars()
Retrieve all available calendars
Returns: [{ id: string, title: string, color: string, type: number, allowsModify: boolean }]
An array of calendar objects
Signature: getToday()
Fetch today's events
Returns: [{ id: string, title: string, startDate: number, endDate: number, calendar: string, calendarId: string, isAllDay: boolean, location: string, notes: string }]
An array of events for today
Signature: getEvents(start, end, calendarId?)
Retrieve events within a specific time range
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
start |
number |
Start timestamp | No |
end |
number |
End timestamp | No |
calendarId |
string |
Specific calendar ID to filter by | Yes |
Returns: [{ id: string, title: string, startDate: number, endDate: number, calendar: string, calendarId: string, isAllDay: boolean, location: string, notes: string }]
An array of event objects
Signature: create(title, start, end, options?)
Create a new calendar event
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
title |
string |
Event title | No |
start |
number |
Start timestamp | No |
end |
number |
End timestamp | No |
options |
object |
Options { calendarId, notes, location, url, allDay } | Yes |
Returns: string \| null
ID of the newly created event, or null if failed
Signature: delete(id)
Delete a specific calendar event
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
id |
string |
Event ID | No |
Returns: boolean
Whether the deletion was successful
Reminders and checklists
Trigger Note: The 'requestAccess' method requires UI interaction; other operations require prior authorization.
Signature: isAuthorized()
Check current authorization status
Returns: boolean
Whether access is granted
Signature: requestAccess()
Request reminder access permissions
Returns: boolean
Whether authorization was granted
Signature: getLists()
Retrieve all reminder lists
Returns: [{ id: string, title: string, color: string, isSystem: boolean }]
An array of reminder list objects
Signature: getAll(listId?)
Retrieve all reminder items
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
listId |
string |
Specific list ID to filter by | Yes |
Returns: [{ id: string, title: string, isCompleted: boolean, listId: string, listTitle: string, notes: string, priority: number, creationDate: number, dueDate?: number, isOverdue?: boolean }]
An array of reminder items
Signature: create(title, options?)
Create a new reminder
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
title |
string |
Reminder title | No |
options |
object |
Options: { listId, notes, dueDate, priority, location: { latitude, longitude, radius, onArrive, name } } | Yes |
Returns: string \| { success: boolean, id?: string, title?: string, isSystemReminder?: boolean }
The unique ID of the created reminder, or object with details if location-based
Signature: complete(id)
Mark a reminder as completed
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
id |
string |
Reminder ID | No |
Returns: boolean
Whether the operation was successful
Signature: delete(id)
Delete a specific reminder
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
id |
string |
Reminder ID | No |
Returns: boolean
Whether the deletion was successful
Signature: getSorted(options?)
Retrieve sorted reminders
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
options |
object |
{ sortBy: 'createdAt'|'dueDate'|'priority'|'title', ascending: boolean, completed: boolean } | Yes |
Returns: [Reminder]
A list of sorted reminder items
Signature: getUpcoming(days?)
Retrieve reminders due soon
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
days |
number |
Number of days in the future, defaults to 7 | Yes |
Returns: [Reminder]
A list of upcoming reminders
Signature: getOverdue()
Retrieve all overdue reminders
Returns: [Reminder]
A list of reminders past their due date
Signature: reorder(ids)
Batch reorder reminders
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
ids |
string[] |
An ordered array of reminder IDs | No |
Returns: { success: boolean, error?: string }
Result object (note: system reminders do not support reordering)
Signature: createSystemReminder(title, options?)
Create a system reminder with advanced features (e.g., location-based triggers)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
title |
string |
Reminder title | No |
options |
object |
{ listId, notes, dueDate, priority, location: { latitude, longitude, radius, onArrive, name } } | Yes |
Returns: string \| { success: boolean, id?: string, title?: string, isSystemReminder?: boolean }
Object containing success status and system reminder details
Signature: getSystemLists()
Retrieve system-managed reminder lists
Returns: [{ id: string, title: string, color: string, isSystem: boolean }]
An array of system reminder lists
Contact management operations
Trigger Note: The 'requestAccess' method requires UI interaction; other operations require prior authorization.
Signature: requestAccess()
Request access permissions for contacts
Returns: { granted: boolean, error?: string }
An object containing the authorization result
Signature: getAccessStatus()
Get current permission status
Returns: 'authorized' \| 'denied' \| 'restricted' \| 'notDetermined'
The permission status string
Signature: isAuthorized()
Check if the app is already authorized
Returns: boolean
Whether access is granted
Signature: getAll(offset?, limit?)
Retrieve all contacts with pagination
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
offset |
number |
Number of records to skip, defaults to 0 | Yes |
limit |
number |
Maximum number of records to return, defaults to all | Yes |
Returns: [Contact]
An array of contact objects
Signature: getCount()
Get the total number of contacts
Returns: number
Total count of contacts
Signature: search(query)
Search contacts by name
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
query |
string |
Search keyword (matches name fields) | No |
Returns: [Contact]
An array of matching contact objects
Signature: searchByPhone(phone)
Search contacts by phone number
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
phone |
string |
Phone number (supports fuzzy matching) | No |
Returns: [Contact]
An array of matching contact objects
Signature: getById(id)
Get a contact by its unique identifier
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
id |
string |
Unique identifier of the contact | No |
Returns: Contact \| null
The contact object or null if not found
Signature: create(data)
Create a new contact
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
data |
object |
Contact data including givenName, familyName, phoneNumbers, emailAddresses, etc. | No |
Returns: { success: boolean, id?: string, error?: string }
An object containing success status and the new contact ID
Signature: delete(id)
Delete a specific contact
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
id |
string |
Unique identifier of the contact | No |
Returns: { success: boolean, error?: string }
An object containing the success status
Signature: getGroups()
Retrieve all contact groups
Returns: [{ id: string, name: string }]
An array of group objects
Local notifications
Trigger Note: The 'requestAccess' method requires UI interaction; other operations require prior authorization.
Signature: send(title, body, options?)
Send an immediate notification
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
title |
string |
Notification title | No |
body |
string |
Notification body content | No |
options |
object |
Options: { id, subtitle, badge, userInfo, copyOnTap, delay, date } | Yes |
Returns: string \| { success: boolean, error: string }
The unique ID of the sent notification, or error object if failed
Signature: cancel(id)
Cancel a specific notification
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
id |
string |
Notification ID | No |
Returns: boolean
Whether the cancellation was successful
Signature: cancelAll()
Cancel all scheduled notifications
Returns: boolean
Whether the operation was successful
Signature: getPending()
Retrieve all pending (scheduled) notifications
Returns: [{ id: string, title: string, body: string, subtitle: string, delay?: number, date?: number }]
A list of notifications waiting to be triggered
Signature: getDelivered()
Retrieve all delivered notifications
Returns: [{ id: string, title: string, body: string, subtitle: string, date: number }]
A list of notifications currently displayed in the notification center
Signature: requestAccess()
Request user permission for notifications
Returns: { granted: boolean, error?: string }
Authorization result object
Signature: getAccessStatus()
Get current authorization status
Returns: 'authorized' \| 'denied' \| 'notDetermined' \| 'provisional' \| 'ephemeral' \| 'unknown'
Current permission status string
Signature: isAuthorized()
Check if notification permission is authorized
Returns: boolean
Whether notifications are authorized
Signature: setBadge(count)
Set the application badge number
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
count |
number |
The number to display on the badge | No |
Returns: boolean
Whether the operation was successful
Signature: clearBadge()
Clear the application badge
Returns: boolean
Whether the operation was successful
Signature: schedule(title, body, options)
Schedule a notification
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
title |
string |
Notification title | No |
body |
string |
Notification body content | No |
options |
object |
Options: { id, subtitle, badge, userInfo, copyOnTap, delay, date } | No |
Returns: string \| { success: boolean, error: string }
The unique ID of the scheduled notification, or error object if failed
SMS and messaging operations
Trigger Note: TrollStore Root privileges are required to access the system SMS database.
Signature: isRealDataAvailable()
Check if real SMS data is accessible
Returns: boolean
Whether the app has access to the SMS database
Signature: read(limit?, offset?)
Read recent SMS messages
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
limit |
number |
Maximum number of messages to retrieve (defaults to 50) | Yes |
offset |
number |
Number of messages to skip (defaults to 0) | Yes |
Returns: [{ id: number, guid: string, address: string, text: string, date: string, isFromMe: boolean, isRead: boolean, service: string, hasAttachments: boolean }]
An array of message objects
Signature: search(keyword, limit?)
Search messages by keyword
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
keyword |
string |
Search keyword | No |
limit |
number |
Maximum number of results (defaults to 50) | Yes |
Returns: [{ id: number, guid: string, address: string, text: string, date: string, isFromMe: boolean, isRead: boolean }]
An array of matching message objects
Signature: getByAddress(address, limit?)
Retrieve messages from a specific phone number
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
address |
string |
Sender's phone number or address | No |
limit |
number |
Maximum number of messages (defaults to 50) | Yes |
Returns: [{ id: number, guid: string, address: string, text: string, date: string, isFromMe: boolean, isRead: boolean }]
An array of message objects
Signature: getChats(limit?)
Retrieve a list of conversation threads
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
limit |
number |
Maximum number of chats (defaults to 50) | Yes |
Returns: [{ id: number, identifier: string, displayName: string, unreadCount: number, participants: [string], lastMessageDate: string }]
An array of chat session objects
Signature: getStatistics()
Get SMS usage statistics
Returns: { totalMessages: number, unreadCount: number, chatCount: number, contactCount: number, attachmentCount: number }
An object containing summary statistics
Signature: getLatest()
Retrieve the most recent message
Returns: { id: number, guid: string, address: string, text: string, date: string, isFromMe: boolean, isRead: boolean } \| null
The latest message object or null
Signature: getUnread(limit?)
Retrieve all unread messages
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
limit |
number |
Maximum number of messages (defaults to 50) | Yes |
Returns: [{ id: number, guid: string, address: string, text: string, date: string, isFromMe: boolean, isRead: boolean }]
An array of unread message objects
Signature: helperCheck()
Check SMS database access via Root Helper
Returns: object
Access status information
Signature: helperCopy()
Copy SMS database to temporary directory via Root Helper
Returns: { success: boolean, path: string, error: string }
Copy operation result
Signature: helperList(path)
List directory contents via Root Helper
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
path |
string |
Directory path to list | No |
Returns: object
Directory listing result
Signature: helperAvailable()
Check if Root Helper is available
Returns: boolean
Whether Root Helper is accessible
SQLite database operations
Signature: open(name?)
Open or create a SQLite database
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default'). File will be created as {name}.sqlite in Documents directory | Yes |
Returns: boolean
Whether the database was successfully opened
Signature: close(name?)
Close a database connection
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
Returns: boolean
Always returns true
Signature: execute(name?, sql, params?)
Execute INSERT, UPDATE, DELETE, or DDL statements
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
sql |
string |
SQL statement to execute | No |
params |
any[] |
Parameters for prepared statement (use ? placeholders) | Yes |
Returns: { success: boolean, changes?: number, lastInsertId?: number, error?: string }
Result object containing success status, affected rows count, and last inserted row ID
Signature: exec(name?, sql, params?)
Alias for execute()
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
sql |
string |
SQL statement to execute | No |
params |
any[] |
Parameters for prepared statement | Yes |
Returns: { success: boolean, changes?: number, lastInsertId?: number, error?: string }
Result object
Signature: query(name?, sql, params?)
Execute a SELECT query and return all matching rows
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
sql |
string |
SELECT query to execute | No |
params |
any[] |
Parameters for prepared statement | Yes |
Returns: [object]
An array of row objects (column name -> value)
Signature: queryOne(name?, sql, params?)
Execute a SELECT query and return the first row
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
sql |
string |
SELECT query to execute | No |
params |
any[] |
Parameters for prepared statement | Yes |
Returns: object \| null
The first row object, or null if no results
Signature: tableExists(name?, tableName)
Check if a table exists in the database
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
tableName |
string |
Name of the table to check | No |
Returns: boolean
Whether the table exists
Signature: getTables(name?)
List all tables in the database
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
Returns: [string]
An array of table names
Signature: getTableInfo(name?, tableName)
Get column information for a table
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
tableName |
string |
Name of the table | No |
Returns: [{ cid: number, name: string, type: string, notnull: boolean, pk: boolean }]
An array of column information objects
Signature: beginTransaction(name?)
Begin a database transaction
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
Returns: boolean
Whether the transaction was started successfully
Signature: commit(name?)
Commit the current transaction
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
Returns: boolean
Whether the commit was successful
Signature: rollback(name?)
Roll back the current transaction
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
Returns: boolean
Whether the rollback was successful
Signature: vacuum(name?)
Optimize the database by reclaiming unused space
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Database name (defaults to 'default') | Yes |
Returns: boolean
Whether the vacuum operation was successful
Shortcuts operations
Trigger Note: Running shortcuts and opening apps require foreground UI interaction; completely unavailable in Daemon mode
Signature: run(name, input?)
Run a shortcut
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Shortcut name | No |
input |
string |
Input text (optional) | Yes |
Returns: boolean
Whether the shortcut was successfully opened
Signature: runWithCallback(name, input?)
Run a shortcut with x-callback-url support
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Shortcut name | No |
input |
string |
Input text (optional) | Yes |
Returns: boolean
Whether the shortcut was successfully opened
Signature: open()
Open the Shortcuts app
Returns: boolean
Whether the app was successfully opened
Signature: openGallery()
Open the Shortcuts gallery
Returns: boolean
Whether the gallery was successfully opened
Signature: create(name)
Create a new shortcut
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
name |
string |
Shortcut name | No |
Returns: boolean
Whether the creation interface was successfully opened
Signature: import(url)
Import a shortcut from URL
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
url |
string |
Shortcut URL | No |
Returns: boolean
Whether the import interface was successfully opened
Signature: isAvailable()
Check if Shortcuts app is installed
Returns: boolean
Whether Shortcuts is available
Signature: donateInteraction(title, identifier)
Donate a Siri suggestion
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
title |
string |
Suggestion title/invocation phrase | No |
identifier |
string |
Interaction identifier | No |
Returns: boolean
Whether the donation was successful
Signature: deleteInteraction(identifier)
Delete a specific Siri suggestion
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
identifier |
string |
Interaction identifier | No |
Returns: boolean
Whether the deletion was successful
Signature: deleteAllInteractions()
Delete all Siri suggestions
Returns: boolean
Whether the deletion was successful
System settings control
Trigger Note: Most methods require TrollStore privileges to work properly
Signature: isWiFiEnabled()
Check if WiFi is enabled
Returns: boolean
Whether WiFi is enabled
Signature: setWiFi(enabled)
Set WiFi enabled state (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable WiFi | No |
Returns: boolean
Whether the operation succeeded
Signature: isBluetoothEnabled()
Check if Bluetooth is enabled
Returns: boolean
Whether Bluetooth is enabled
Signature: setBluetooth(enabled)
Set Bluetooth enabled state (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Bluetooth | No |
Returns: boolean
Whether the operation succeeded
Signature: isAirplaneModeEnabled()
Check if Airplane Mode is enabled
Returns: boolean
Whether Airplane Mode is enabled
Signature: setAirplaneMode(enabled)
Set Airplane Mode state (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Airplane Mode | No |
Returns: boolean
Whether the operation succeeded
Signature: isDoNotDisturbEnabled()
Check if Do Not Disturb is enabled
Returns: boolean
Whether Do Not Disturb is enabled
Signature: setDoNotDisturb(enabled)
Set Do Not Disturb state
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Do Not Disturb | No |
Returns: boolean
Whether the operation succeeded
Signature: getVolume(category?)
Get system volume
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
category |
string |
Volume category: 'System', 'Ringer', 'Media', defaults to 'Media' | Yes |
Returns: number
Current volume level (0.0 - 1.0)
Signature: setVolume(level, category?)
Set system volume
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
level |
number |
Volume level (0.0 - 1.0) | No |
category |
string |
Volume category: 'System', 'Ringer', 'Media', defaults to 'Media' | Yes |
Returns: boolean
Whether the operation succeeded
Signature: hasFlashlight()
Check if device has flashlight
Returns: boolean
Whether device has flashlight
Signature: isFlashlightOn()
Check if flashlight is on
Returns: boolean
Whether flashlight is on
Signature: setFlashlight(enabled, level?)
Set flashlight state
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to turn on flashlight | No |
level |
number |
Brightness level (0.0 - 1.0), defaults to 1.0 | Yes |
Returns: boolean
Whether the operation succeeded
Signature: isOrientationLockEnabled()
Check if orientation lock is enabled
Returns: boolean
Whether orientation lock is enabled
Signature: setOrientationLock(enabled)
Set orientation lock state
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable orientation lock | No |
Returns: boolean
Whether the operation succeeded
Signature: isLowPowerModeEnabled()
Check if Low Power Mode is enabled
Returns: boolean
Whether Low Power Mode is enabled
Signature: setLowPowerMode(enabled)
Set Low Power Mode state (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Low Power Mode | No |
Returns: boolean
Whether the operation succeeded
Signature: isLocationServicesEnabled()
Check if Location Services are enabled
Returns: boolean
Whether Location Services are enabled
Signature: setLocationServices(enabled)
Set Location Services state (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Location Services | No |
Returns: boolean
Whether the operation succeeded
Signature: isCellularDataEnabled()
Check if Cellular Data is enabled
Returns: boolean
Whether Cellular Data is enabled
Signature: setCellularData(enabled)
Set Cellular Data state (TrollStore privilege)
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
enabled |
boolean |
Whether to enable Cellular Data | No |
Returns: boolean
Whether the operation succeeded
Signature: openSettings(section?)
Open system settings
Parameters:
| Name | Type | Description | Optional |
|---|---|---|---|
section |
string |
Settings section: 'WIFI', 'BLUETOOTH', 'CELLULAR', 'VPN', 'GENERAL', 'DISPLAY', 'SOUND', 'NOTIFICATION', 'PRIVACY', 'BATTERY', 'STORAGE', 'WALLPAPER', 'SIRI', 'ACCESSIBILITY', 'DND', 'SCREEN_TIME', 'PASSWORDS' | Yes |
Returns: boolean
Whether settings was opened successfully