Contain various methods to communicate with the system
static void noti(name: string = null)
Notify the user by playing the notification sound. Call this method again or stop the macro will stop the sound immediately
Parameters | |
name | Name of the notification sound on your device. null to use the default |
static void playMedia(name: string, duration: number = -1, interval: number = 0, repeat: number = 1)
Play media file on the app data folder (/sdcard/Android/data/com.kok_emm.mobile/files)
Parameters | |
name | Name of the file |
duration | Custom duration. -1 for using the duration of the actual media file. Default: -1 |
interval | Time to wait after each repeat. Default: 0 |
repeat | Number of time to repeat playing the file. Default: 1 |
static void toast(message: string)
Notify the user by showing a toast message
Parameters | |
message | The message |
static void alert(message: string)
Notify the user by showing an alert popup
Parameters | |
message | The message |
static void log(message: string)
Log message
to the console in Play Mode only if "debug" is enabled
Parameters | |
message | The message |
static void err(message: string)
Notify the user by showing an alert popup and stop the macro
Parameters | |
message | The message |
static number currentTime()
Return the current time in miliseconds
Return | |
number | The current time |
static number elapsedTime()
Return the time since boot in milliseconds. Should be used to measure duration.
Return | |
number | The time since boot. |
static Version currentVersion()
Return the current Version of the app
Return | |
Version | The current Version of the app |
static number sdk()
Return the sdk number of the device
Return | |
number | The sdk number of the device |
static string lang()
Return the current language code of the device (en, fr, es, etc...)
Return | |
string | The current language code |
static number dpi()
Return the current dpi
Return | |
string | The current dpi |
static bool darkMode()
Return true if darkmode is on, false otherwise
Return | |
bool | true if darkmode is on, false otherwise |
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 |
|
static void setControlOpacity(opacity: number)
Set the opacity to Play Mode control
Deprecated: Please use Overlay.setOpacity() instead
Parameters | |
opacity | The opacity. Value 0.1-1 |
static void globalAction(action: string)
Perform Global Action. Require Accessibility Service turn on
Parameters | |
action |
|
static void openApp(packageName: string, activity: string = null)
Open another App
1.3.8+: You only need the packageName on Android 10-. The app will automatically query the main activity. On Android 11+ due to the new restriction you must specify the activity to start using the 2nd parameter.
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.ActivityMain |
static void openUrl(url: string, newTab: bool)
Open a url with the default browser or pick from browser chooser.
Parameters | |
url | The url to open |
newTab | true to open in new tab |
static void toggleFeature(feature: number, enable: bool)
Toggle the implemention of some features.
Parameters | |
feature |
The feature to toggle.
|
enable | Enable the feature |
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
static void stop()
Stop the macro
© 2024 - Macrorify by KoK-CODE