Sys

Contain various methods to communicate with the system

Static Methods
noti
static void noti(name: string = null)

Notify the user by playing the notification sound

Parameters
name Name of the notification sound on your device. null to use the default
toast
static void toast(message: string)

Notify the user by showing a toast message

Parameters
message The message
alert
static void alert(message: string)

Notify the user by showing an alert popup

Parameters
message The message
log
static void log(message: string)

Log message to the console in Play Mode only if "debug" is enabled

Parameters
message The message
err
static void err(message: string)

Notify the user by showing an alert popup and stop the macro

Parameters
message The message
currentTime
static number currentTime()

Return the current time in miliseconds

Return
number The current time
currentVersion
static Version currentVersion()

Return the current Version of the app

Return
Version The current Version of the app
sdk
static number sdk()

Return the sdk number of the device

Return
number The sdk number of the device
lang
static string lang()

Return the current language code of the device (en, fr, es, etc...)

Return
string The current language code
dpi
static number dpi()

Return the current dpi

Return
string The current dpi
darkMode
static bool darkMode()

Return true if darkmode is on, false otherwise

Return
bool true if darkmode is on, false otherwise
info
static any info(property: string)

Query information about the system. Some of the calls are expensive so try not to query them in a constant loop manner. Return null if not found

Parameters
property
  • dev.isEmulator: true if emulator (bool)
  • dev.darkmode: true if dark mode is ON (bool)
  • dev.language: Language code of the device (string)
  • dev.sdk: The device sdk version (number)
  • battery.level: Current battery level (number)
  • battery.charge: true if charging (bool)
  • battery.ac: true if charging using AC (bool)
  • battery.usb: true if charging using USB (bool)
  • screen.dpi: The screen dpi (number)
  • screen.state: true if screen is on (bool)
  • screen.timeout: The amount of time in milliseconds before the device goes to sleep (number)
  • memory.total: RAM size of the device (number)
  • memory.free: The available memory on the system (number)
  • memory.threshold: The threshold of memory.free at which the device considers memory to be low and start killing background services (number)
  • memory.low: Set to true if the system considers itself to currently be in a low memory situation (number)
setControlOpacity
static void setControlOpacity(opacity: number)

Set the opacity to Play Mode control

Parameters
opacity The opacity. Value 0.1-1
globalAction
static void globalAction(action: string)

Perform Global Action. Require Accessibility Service turn on

Parameters
action
  • back: Press the Back button
  • home: Press the Home button
  • recent: Press the Recent button
  • noti: Open notification tray
  • lockscreen: Lock the screen (Android 9+)
  • powerdialog: Open the power dialog (Android 5+)
  • quicksetting: Open quick setting
  • screenshot: Take screenshot (Android 9+)
openApp
static void openApp(packageName: string, activity: string)

Open another App

Parameters
packageName The package name of the app. Ex: com.kok_emm.mobile
activity The main activity to start. You can get this from adb command: "adb shell dumpsys activity" and filter it using grep. Ex: com.kok_emm.mobile.activity.MainActivity
wake
static void wake()

Wake the screen. "Auto Stop Macro When Screen Off" feature should be turned off. If your keyguard is secured then It'll ask for your interaction otherwise the keyguard is automatically cleared

stop
static void stop()

Stop the macro

© 2021 - Macrorify by KoK-CODE