通用方法
注册模块方法app
- app:
string模块名 - fun:
string方法名
返回值: 无
let app = "test"//模块名
let fun = "add"//方法名
let res =await android.app.registerRouteApp(app,fun)
console.log("执行结果",res);//注册模块方法sys
- app:
string模块名 - fun:
string
返回值: 无
let app = "test"//模块名
let fun = "add"//
let res =await android.app.registerRouteSys(app,fun)
console.log("执行结果",res);//获取设备详细信息底层
- 返回值:
GetDeviceInfoSysRes
let res =await android.app.getDeviceInfoSys()
console.log("执行结果",res);//{"model":"MIX 3","version":"10","sdkInt":"29","manufacturer":"Xiaomi","brand":"Xiaomi","hardware":"qcom","product":"perseus","display":"QKQ1.190828.002 test-keys","packName":"vip.accbot.app","androidId":"e2d96abd019f4530","screenWidth":1080,"screenHeight":2340,"type":0}toast吐司消息
- msg:
string提示内容 - t:
int64显示时间毫秒 时间高于5秒可能不准确,取决于系统
返回值: 无
let msg = "你好AccBot"//提示内容
let t = 3000//显示时间毫秒 时间高于5秒可能不准确,取决于系统
let res =await android.app.toast(msg,t)
console.log("执行结果",res);//获取内存占用
- 返回值:
GetRamRes内存信息
let res =await android.app.getRam()
console.log("执行结果",res);//{"availMem":4040654848,"totalMem":11742183424,"threshold":783360000,"lowMemory":false,"usedMemInBytes":5967632,"maxHeapSizeInBytes":268435456,"availHeapSizeInBytes":262467824}点亮屏幕
返回值: 无
let res =await android.app.openPm()
console.log("执行结果",res);//获取设备详细信息
- 返回值:
GetDeviceInfoRes
let res =await android.app.getDeviceInfo()
console.log("执行结果",res);//{"model":"MIX 3","version":"10","sdkInt":"29","manufacturer":"Xiaomi","brand":"Xiaomi","hardware":"qcom","product":"perseus","display":"QKQ1.190828.002 test-keys","packName":"vip.accbot.app","androidId":"e2d96abd019f4530","screenWidth":1080,"screenHeight":2340,"type":0}显示桌面图标
- show:
bool是否显示桌面图标
返回值: 无
let show = true// 是否显示桌面图标
let res =await android.app.showIcon(show)
console.log("执行结果",res);//隐藏最近任务
- show:
bool是否显示在最近任务
返回值: 无
let show = true// 是否显示在最近任务
let res =await android.app.showTaskBar(show)
console.log("执行结果",res);//退出程序
返回值: 无
let res =await android.app.quit()
console.log("执行结果",res);//打开App详情界面
- packName:
string包名
返回值: 无
let packName = "vip.accbot.app"// 包名
let res =await android.app.openAppInfo(packName)
console.log("执行结果",res);//启动其它程序
- packName:
string包名
返回值: 无
let packName = "vip.accbot.app"// 包名
let res =await android.app.runApp(packName)
console.log("执行结果",res);//获取app列表
- 返回值:
[]GetAppListRes
let res =await android.app.getAppList()
console.log("执行结果",res);//[
{
"appName": "屏幕录制",
"packageName": "com.miui.screenrecorder",
"versionCode": 94,
"versionName": "1.9.4",
"firstInstallTime": 1715081745078,
"lastUpdateTime": 1715081745078
}
]获取AccUUID
- 返回值:
string返回值 返回值
let res =await android.app.AccUUID()
console.log("执行结果",res);//获取开发者UUID
返回值: 无
let res =await android.app.getDeveloperId()
console.log("执行结果",res);//获取sdk构建时间
返回值: string
let res =await android.app.getBuildSdkTime()
console.log("执行结果",res);//