From e2fc9d42e83072b8bdc57b7030bd44d8341428eb Mon Sep 17 00:00:00 2001 From: SuperMonster003 Date: Sat, 21 Jan 2023 22:13:36 +0800 Subject: [PATCH] =?UTF-8?q?2.3.0=20-=20=E4=BF=AE=E5=A4=8D=E8=9A=82?= =?UTF-8?q?=E8=9A=81=E6=A3=AE=E6=9E=97=E9=A1=B5=E9=9D=A2=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E6=97=A0=E6=B3=95=E6=94=B6=E5=8F=96=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E5=8F=8A=E5=A5=BD=E5=8F=8B=E8=83=BD=E9=87=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- README.md | 63 +- ant-forest-launcher.js | 1665 +++++++++-------- ant-forest-settings.js | 1341 +++++++------ assets/data/default-config.js | 218 ++- assets/data/dialog-contents.js | 91 +- assets/docs/CHANGELOG-2.md | 12 + assets/docs/MANUAL.md | 4 +- assets/docs/MEMORANDUM.md | 2 +- assets/docs/TODO.md | 166 +- assets/indices/glossary.json | 2 + assets/indices/xml-nodes.json | 32 +- modules/ext-a11y.js | 701 +------ modules/ext-app.js | 40 +- modules/ext-colors.js | 90 - modules/ext-console.js | 10 +- modules/ext-device.js | 529 ++---- modules/ext-dialogs.js | 65 +- modules/ext-engines.js | 8 +- modules/ext-events.js | 24 +- modules/ext-files.js | 22 +- modules/ext-http.js | 14 +- modules/ext-images.js | 51 +- modules/ext-storages.js | 8 +- modules/ext-threads.js | 108 +- modules/ext-timers.js | 486 ----- modules/ext-ui.js | 25 +- modules/mod-alipay.js | 10 +- modules/mod-ant-forest.js | 81 +- modules/mod-autojs.js | 60 +- modules/mod-database.js | 8 +- modules/mod-global.js | 496 +---- modules/mod-project.js | 35 +- modules/plugin-ant-forest-deployment.js | 7 +- modules/plugin-ant-forest-energy-rain.js | 62 +- ...lugin-ant-forest-on-screen-off-launcher.js | 15 +- modules/plugin-autojs-memory-info.js | 33 +- modules/plugin-device-next-alarm-clock.js | 14 +- project.json | 4 +- tools/ant-forest-deployment-tool.min.js | 2 +- tools/inspect-lock-screen-layout.js | 6 +- tools/inspect-specified-screen-layout.js | 4 +- tools/show-next-auto-task-countdown.js | 9 +- 43 files changed, 2320 insertions(+), 4306 deletions(-) delete mode 100644 modules/ext-colors.js delete mode 100644 modules/ext-timers.js diff --git a/.gitignore b/.gitignore index 274a615..2ef68e4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ test*.js /.git /.github /.idea -/assets/declarations/* \ No newline at end of file +/assets/declarations/* +/checkin-alipay.js diff --git a/README.md b/README.md index 83da72d..3f2e261 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

- AF_Banner + AF_Banner

基于 Auto.js 的蚂蚁森林能量自动收取脚本

@@ -11,10 +11,9 @@

GitHub release (latest by date) GitHub closed issues - GitHub AutoJs6 repository + GitHub AutoJs6 repository GitHub top language CodeFactor Grade - LGTM Grade
Created GitHub Code Size @@ -31,21 +30,21 @@ ****** -| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | -| ✔️ | 推迟任务加入下次关屏选项 | 2021-11-01 18:16:56 | 5 | 1 | -| ✔️ | 能量雨加入近似区域点击检测 | 2021-10-27 14:48:18 | 3 | 1 | -| ✔️ | v2.2.0 发布后检查 documents 相关的链接 | 2021-10-26 23:07:16 | 1 | 1 | -| ✒️ | 扩展模块及插件重构 | 2021-10-26 14:37:07 | ! 8 | 0.39 | -| ✒️ | 排行榜策略加入黑名单检测方案配置 (#529) | 2021-10-31 18:57:17 | ! 5 | 0.00 | -| ✒️ | 事件监测配置 (#533) | 2021-10-26 10:50:40 | ! 6 | 0.00 | -| ✒️ | 自动关闭屏幕配置 (#476) | 2021-10-26 11:15:11 | ! 6 | 0.00 | -| ✒️ | 提取 JSDoc@typedef 到 TS 声明文件 | 2021-10-25 22:25:18 | 10 | 0.94 | -| ✒️ | 保护地巡护工具 | 2021-10-26 10:34:25 | 9 | 0.20 | -| ✒️ | 将 tool functions 转换为 OOP | 2021-10-25 22:24:13 | 10 | 0.18 | -| ✒️ | 分离 appx 模块 (autojs / alipay ...) | 2021-10-25 22:24:13 | 6 | 0.17 | -| ✒️ | 启动器模块化 | 2021-10-26 08:25:42 | 10 | 0.00 | -| ✒️ | 配置工具模块化 | 2021-10-26 08:24:34 | 10 | 0.00 | +| Status | Task | Date | Cost | Progress | +|:------:|----------------------------------|:-------------------:|:----:|:------------------------------:| +| ✔️ | 推迟任务加入下次关屏选项 | 2021-11-01 18:16:56 | 5 | 1 | +| ✔️ | 能量雨加入近似区域点击检测 | 2021-10-27 14:48:18 | 3 | 1 | +| ✔️ | v2.2.0 发布后检查 documents 相关的链接 | 2021-10-26 23:07:16 | 1 | 1 | +| ✒️ | 扩展模块及插件重构 | 2021-10-26 14:37:07 | ! 8 | 0.39 | +| ✒️ | 排行榜策略加入黑名单检测方案配置 (#529) | 2021-10-31 18:57:17 | ! 5 | 0.00 | +| ✒️ | 事件监测配置 (#533) | 2021-10-26 10:50:40 | ! 6 | 0.00 | +| ✒️ | 自动关闭屏幕配置 (#476) | 2021-10-26 11:15:11 | ! 6 | 0.00 | +| ✒️ | 提取 JSDoc@typedef 到 TS 声明文件 | 2021-10-25 22:25:18 | 10 | 0.94 | +| ✒️ | 保护地巡护工具 | 2021-10-26 10:34:25 | 9 | 0.20 | +| ✒️ | 将 tool functions 转换为 OOP | 2021-10-25 22:24:13 | 10 | 0.18 | +| ✒️ | 分离 appx 模块 (autojs / alipay ...) | 2021-10-25 22:24:13 | 6 | 0.17 | +| ✒️ | 启动器模块化 | 2021-10-26 08:25:42 | 10 | 0.00 | +| ✒️ | 配置工具模块化 | 2021-10-26 08:24:34 | 10 | 0.00 | > 全部待办事项可参阅 [TODO.md](https://github.com/SuperMonster003/Ant-Forest/blob/master/assets/docs/TODO.md) (共计 56 项) @@ -64,23 +63,23 @@ - [AutoJs6](https://github.com/SuperMonster003/AutoJs6/releases/latest) (`开源免费`) > 自 v2.3.0 起将仅支持使用 AutoJs6 运行当前项目 -> 因项目运行依赖于 [Rhino 引擎](https://github.com/mozilla/rhino) 的部分 [新特性](https://github.com/SuperMonster003/AutoJs6/blob/master/app/src/main/assets/doc/RHINO.md) 及 AutoJs6 的部分自定义模块 +> 因项目运行依赖于 [Rhino 引擎](https://github.com/mozilla/rhino) 的部分 [新特性](https://github.com/SuperMonster003/AutoJs6/blob/master/app/src/main/assets/doc/RHINO.md) 及 AutoJs6 的部分新 API 及内置模块 3. 下载并部署项目 (任意一种方式) - [下载项目部署工具](https://raw.githubusercontent.com/SuperMonster003/Ant-Forest/master/tools/ant-forest-deployment-tool.min.js) (`*.js`) 1. 将部署工具 (脚本文件) `保存` 或 `另存为` 至本地存储 - 2. 用 `Auto.js` 直接运行 (或导入后运行) 脚本文件完成部署 - 3. 部署后可能需要关闭并重启 `Auto.js` 才能看到项目目录 + 2. 用 `AutoJs6` 直接运行 (或导入后运行) 脚本文件完成部署 + 3. 部署后可能需要关闭并重启 `AutoJs6` 才能看到项目目录 - [下载最新项目数据包](https://github.com/SuperMonster003/Ant-Forest/archive/master.zip) (`*.zip`) 1. 将项目数据包解压到本地存储 2. 定位到设备的内部存储目录 如: `/内部存储/` `/Internal Storage/` `/sdcard/` `/storage/emulated/0/` 等 - 3. 在此目录下找到 `Auto.js` 默认工作目录 + 3. 在此目录下找到 `AutoJs6` 默认工作目录 · 中文系统默认目录 `./脚本/` · 英文系统默认目录 `./Scripts/` 4. 若不存在则需手动建立工作目录 - 或在 `Auto.js` 软件中设置工作目录 + 或在 `AutoJs6` 软件中设置工作目录 5. 将解压后的项目文件夹放置在工作目录中 > 项目支持更新版本的自动检查/提示/下载/版本忽略等相关功能 @@ -162,6 +161,12 @@ [comment]: <> (Version history only shows last 3 versions) +# v2.3.1 + +###### 2023/01/21 + +* `修复` 蚂蚁森林页面更新后无法收取自己及好友能量的问题 + # v2.3.0 ###### 2022/03/20 - 代码重构 谨慎升级 @@ -181,16 +186,6 @@ * `管理` 项目图片资源文件夹移除打赏二维码并迁移至README.md中 * `管理` 项目图片资源文件夹内增加.nomedia防止媒体库中出现无关资源 -# v2.2.1 - -###### 2021/10/27 - -* `修复` 能量雨工具运行时旧窗口实例没有按预期移除的问题 -* `修复` 能量雨工具增加近似区域点击检测避免错误的结束条件检测 _[`issue #527`](https://github.com/SuperMonster003/Ant-Forest/issues/527#issuecomment-952476244)_ _[`#530`](https://github.com/SuperMonster003/Ant-Forest/issues/530)_ -* `修复` imagesx.concat()潜在的内存泄漏问题 _[`issue #527`](https://github.com/SuperMonster003/Ant-Forest/issues/527#issuecomment-952084434)_ -* `修复` a11yx扩展模块无阻塞方法内部arguments的语法错误 _[`issue #527`](https://github.com/SuperMonster003/Ant-Forest/issues/527)_ _[`#530`](https://github.com/SuperMonster003/Ant-Forest/issues/530)_ -* `修复` Pro版本Auto.js内存管理工具重启进程后的任务残余 (试修) _[`issue #528`](https://github.com/SuperMonster003/Ant-Forest/issues/528)_ - ##### 更多版本历史可参阅 * [CHANGELOG-2.md](https://github.com/SuperMonster003/Ant-Forest/blob/master/assets/docs/CHANGELOG-2.md) ( 2.x 版本 ) @@ -205,7 +200,7 @@ * [Auto.js](https://github.com/hyb1996/Auto.js) { author: [hyb1996](https://github.com/hyb1996) } - `安卓平台 JavaScript 自动化工具` * [Auto.js-TypeScript-Declarations](https://github.com/SuperMonster003/Auto.js-TypeScript-Declarations) { author: [SuperMonster003](https://github.com/SuperMonster003) } - - `Auto.js 声明文件 (.d.ts)` + - `Auto.js 声明文件 (d.ts)` ****** diff --git a/ant-forest-launcher.js b/ant-forest-launcher.js index 6bf03ac..9e033a8 100644 --- a/ant-forest-launcher.js +++ b/ant-forest-launcher.js @@ -10,33 +10,29 @@ let { $$und, $$obj, $$arr, $$cvt, $$bool, $$func, $$num, $$impeded, $$str, $$link, } = require('./modules/mod-global'); -let {uix} = require('./modules/ext-ui'); -let {appx} = require('./modules/ext-app'); -let {db} = require('./modules/mod-database'); -let {afrst} = require('./modules/mod-ant-forest'); -let {alipay} = require('./modules/mod-alipay'); -let {autojs} = require('./modules/mod-autojs'); -let {filesx} = require('./modules/ext-files'); -let {cryptox} = require('./modules/ext-crypto'); -let {imagesx} = require('./modules/ext-images'); -let {timersx} = require('./modules/ext-timers'); -let {colorsx} = require('./modules/ext-colors'); -let {eventsx} = require('./modules/ext-events'); -let {project} = require('./modules/mod-project'); -let {dialogsx} = require('./modules/ext-dialogs'); -let {threadsx} = require('./modules/ext-threads'); -let {enginesx} = require('./modules/ext-engines'); -let {consolex} = require('./modules/ext-console'); -let {pluginsx} = require('./modules/ext-plugins'); -let {storagesx} = require('./modules/ext-storages'); -let {a11yx, $$sel} = require('./modules/ext-a11y'); -let {devicex, $$disp} = require('./modules/ext-device'); +let { uix } = require('./modules/ext-ui'); +let { appx } = require('./modules/ext-app'); +let { db } = require('./modules/mod-database'); +let { afrst } = require('./modules/mod-ant-forest'); +let { alipay } = require('./modules/mod-alipay'); +let { filesx } = require('./modules/ext-files'); +let { cryptox } = require('./modules/ext-crypto'); +let { imagesx } = require('./modules/ext-images'); +let { eventsx } = require('./modules/ext-events'); +let { project } = require('./modules/mod-project'); +let { dialogsx } = require('./modules/ext-dialogs'); +let { enginesx } = require('./modules/ext-engines'); +let { consolex } = require('./modules/ext-console'); +let { pluginsx } = require('./modules/ext-plugins'); +let { storagesx } = require('./modules/ext-storages'); +let { a11yx, $$sel } = require('./modules/ext-a11y'); +let { devicex, $$disp } = require('./modules/ext-device'); let $$init = { check() { - devicex.ensureSdkInt(); - autojs.ensureVersion(); - alipay.ensureAppInstalled(); + requiresApi(util.versionCodes.N.apiLevel); + requiresAutojsVersion('6.1.1'); + App.ALIPAY.ensureInstalled(); a11yx.ensureSvcAndFunc(); devicex.checkScreenOffTimeout(); @@ -48,19 +44,19 @@ let $$init = { setGlobalLog(); consolex.__(); - consolex._('开发者测试日志已启用', 0, 0, -2); - consolex._('设备型号: ' + device.brand + ' ' + device.product); + consolex._(`开发者测试日志已启用`, 0, 0, -2); + consolex._(`设备型号: ${device.brand} ${device.product}`); $$disp.debug(); appSetter().setTask().setBlist().setPages().setLayout().setIntent(); accSetter().setParams().setMain(); - consolex._('Auto.js版本: ' + $$app.autojs_ver_name); - consolex._('项目版本: ' + $$app.project_ver_name); - consolex._('安卓SDK版本: ' + device.sdkInt); - consolex._('安卓系统版本: ' + device.release); - consolex._('Root权限: ' + ($$app.has_root ? '已获取' : '未获取')); + consolex._(`Auto.js版本: ${autojs.versionName}`); + consolex._(`项目版本: ${project.getLocalVerName()}`); + consolex._(`安卓SDK版本: ${device.sdkInt}`); + consolex._(`安卓系统版本: ${device.release}`); + consolex._(`Root权限: ${$$app.hasRootAccess ? '已获取' : '未获取'}`); return $$init; @@ -68,32 +64,28 @@ let $$init = { function setGlobalObjects() { global.$$flag = { - autojs_has_root: appx.hasRoot(), - autojs_has_secure: appx.hasSecure(), + autojsHasRoot: appx.hasRoot(), + autojsHasSecure: appx.hasSecure(), }; global.$$cfg = Object.assign({}, storagesx['@default'].af, storagesx.af_cfg.get('config')); - global.$$db = db.create('af', {alter_type: 'union'}); + global.$$db = db.create('af', { alterType: 'union' }); global.$$app = { - developer: String.unTap('434535154232343343441542000003'), - rl_title: String.unEsc('2615FE0F0020597D53CB6392884C699C'), - task_name: String.unEsc('8682868168EE6797').surround('"'), - autojs_name: autojs.getAppName(), - autojs_pkg: autojs.getPackageName(), - autojs_ver_name: autojs.getVerName(), - project_ver_name: project.getLocalVerName(), - init_scr_on: devicex.is_init_screen_on, - init_fg_pkg: currentPackage(), - engines_exec_argv: enginesx.my_engine_exec_argv, + developer: String.unTap(`434535154232343343441542${'\x33'.padStart(6, '0')}`), + rankListTitle: String.unEsc('2615FE0F0020597D53CB6392884C699C'), + taskName: String.unEsc('8682868168EE6797').surround('"'), + isInitScreenOn: devicex.isInitScreenOn, + initForegroundPackageName: currentPackage(), + enginesExecArgv: enginesx.my_engine_exec_argv, cwd: enginesx.cwd, cwp: enginesx.cwp, - has_root: $$flag.autojs_has_root, - root_fxs: $$cfg.root_access_functions, - fri_drop_by: { + hasRootAccess: $$flag.autojsHasRoot, + rootAccessPrivileges: $$cfg.rootAccessPrivileges, + friendDropBy: { _pool: [], _max: 5, ic(name) { @@ -101,7 +93,7 @@ let $$init = { if (_ctr === this._max) { consolex._('发送排行榜复查停止信号'); consolex._('已达连续好友访问最大阈值'); - $$flag.rl_review_stop = true; + $$flag.isRankListReviewStopped = true; } this._pool[name] = ++_ctr; }, @@ -116,7 +108,7 @@ let $$init = { get ts() { return Date.now(); }, - get ts_sec() { + get tsSeconds() { return Date.now() / 1e3 >> 0; }, exit() { @@ -124,19 +116,19 @@ let $$init = { this.layout.closeAll(); floaty.closeAll(); // just in case - if (this.queue.excl_tasks_all_len > 1) { + if (this.queue.getExclusiveAllTasksLength() > 1) { consolex._('移除当前脚本广播监听器'); events.broadcast.removeAllListeners(); consolex._('发送初始屏幕开关状态广播'); - events.broadcast.emit('init_scr_on_state_change', this.init_scr_on); + events.broadcast.emit('init_scr_on_state_change', this.isInitScreenOn); } } catch (e) { console.error(e + '\n' + e.stack); } finally { - consolex.$((this.task_name || '"Unknown"') + '任务结束', 1, 0, 0, '2n'); + consolex.$((this.taskName || '"Unknown"') + '任务结束', 1, 0, 0, '2n'); // exit() might cause ScriptInterruptedException - // as $$app.exit might invoked within Promise + // as $$app.exit might be invoked within Promise ui.post(exit); } }, @@ -148,77 +140,73 @@ let $$init = { this.monitor.insurance.finish(_status); - dialogsx.clearPool(); - imagesx.clearPool(); $$db.close(); $$flag.glob_e_scr_privilege = true; }, }; - $$sel.add('af', ['蚂蚁森林', {isAlipay: true}]) - .add('alipay_home', [/首页|Homepage/, {bi$: [0, cY(0.7), W, H], isAlipay: true}]) - .add('af_title', [/蚂蚁森林|Ant Forest/, {bi$: [0, 0, cX(0.4), cY(0.2)], isAlipay: true}]) - .add('af_home', [/合种|背包|通知|攻略|任务|.*大树养成.*/, {isAlipay: true}]) - .add('energy_amt', [/^\s*\d+(\.\d+)?(k?g|t)\s*$/, {isAlipay: true}]) - .add('rl_title', [$$app.rl_title, {isAlipay: true}]) - .add('rl_ent', [/查看更多好友|View more friends/, {isAlipay: true}]) - .add('rl_end_idt', [/.*没有更多.*/, {isAlipay: true}]) - .add('list', [className('ListView'), {isAlipay: true}]) - .add('fri_tt', [/.+的蚂蚁森林/, {bi$: [0, 0, cX(0.95), cY(0.2)], isAlipay: true}]) - .add('cover_used', [/.*使用了.*保护罩.*/, {isAlipay: true}]) - .add('wait_awhile', [/.*稍等片刻.*/, {isAlipay: true}]) - .add('reload_frst_page', ['重新加载', {isAlipay: true}]) - .add('close_btn', [/关闭|Close/, {isAlipay: true}]) - .add('login_btn', [/登录|Log in|.*loginButton/, {isAlipay: true}]) - .add('login_new_acc', [/换个新账号登录|[Aa]dd [Aa]ccount/, {isAlipay: true}]) - .add('login_other_acc', [/换个账号登录|.*switchAccount/, {isAlipay: true}]) - .add('login_other_mthd_init_pg', [/其他登录方式|Other accounts/, {isAlipay: true}]) - .add('login_other_mthd', [/换个方式登录|.*[Ss]w.+[Ll]og.+thod/, {isAlipay: true}]) - .add('login_by_code', [/密码登录|Log ?in with password/, {isAlipay: true}]) - .add('login_next_step', [/下一步|Next|.*nextButton/, {isAlipay: true}]) + $$sel.add('af', [ '蚂蚁森林', { currentApp: 'alipay' } ]) + .add('alipay_home', [ /首页|Homepage/, { boundsInside: [ 0, cY(0.7), W, H ], currentApp: 'alipay' } ]) + .add('af_title', [ /蚂蚁森林|Ant Forest/, { boundsInside: [ 0, 0, cX(0.4), cY(0.2) ], currentApp: 'alipay' } ]) + // .add('af_home', [/合种|背包|通知|攻略|任务|.*大树养成.*/, {currentApp: 'alipay'}]) + .add('af_home', [ /^(共被你收[\u4e00-\u9fff]?\d+g|\d+g被好友收[\u4e00-\u9fff]?|收[\u4e00-\u9fff]?好友\d+g|今日最慷慨|森林新消息)$/, { currentApp: 'alipay' } ]) + .add('rl_ent', [ /查看更多好友|View more friends/, { currentApp: 'alipay' } ]) + .add('rankListTitle', [ $$app.rankListTitle, { currentApp: 'alipay' } ]) + .add('list', [ className('ListView'), { currentApp: 'alipay' } ]) + .add('fri_tt', [ /.+的蚂蚁森林/, { boundsInside: [ 0, 0, cX(0.95), cY(0.2) ], currentApp: 'alipay' } ]) + .add('shield_used', [ /.*使用了.*保护罩.*/, { currentApp: 'alipay' } ]) + .add('wait_awhile', [ /.*稍等片刻.*/, { currentApp: 'alipay' } ]) + .add('reload_frst_page', [ '重新加载', { currentApp: 'alipay' } ]) + .add('close_btn', [ /关闭|Close/, { currentApp: 'alipay' } ]) + .add('login_btn', [ /登录|Log in|.*loginButton/, { currentApp: 'alipay' } ]) + .add('login_new_acc', [ /换个新账号登录|[Aa]dd [Aa]ccount/, { currentApp: 'alipay' } ]) + .add('login_other_acc', [ /换个账号登录|.*switchAccount/, { currentApp: 'alipay' } ]) + .add('login_other_mthd_init_pg', [ /其他登录方式|Other accounts/, { currentApp: 'alipay' } ]) + .add('login_other_mthd', [ /换个方式登录|.*[Ss]w.+[Ll]og.+thod/, { currentApp: 'alipay' } ]) + .add('login_by_code', [ /密码登录|Log ?in with password/, { currentApp: 'alipay' } ]) + .add('login_next_step', [ /下一步|Next|.*nextButton/, { currentApp: 'alipay' } ]) .add('input_username', { className: 'EditText', - filter: w => /(会员|用户)名|手机|邮箱/.test($$sel.pickup(w, 'txt')), - isAlipay: true, + filter: w => /(会员|用户)名|手机|邮箱/.test(w.content()), + currentApp: 'alipay', }) .add('input_password', () => { - if ($$sel.pickup(/.*(忘记密码|输入.*密码).*/)) { - let wc = $$sel.pickup({className: 'EditText', isAlipay: true}, 'wc'); + if (pickup(/.*(忘记密码|输入.*密码).*/)) { + let wc = pickup({ className: 'EditText', currentApp: 'alipay' }, 'w[]'); return wc.length ? wc[wc.length - 1] : null; } return null; }) .add('switch_to_other_acc', { idMatches: /.+_item_account/, - isAlipay: true, + currentApp: 'alipay', }) - .add('login_err_ensure', idMatches(/.*ensure/)) - .add('login_err_msg', (type) => { - let _t = type || 'txt'; - return $$sel.pickup([id('com.alipay.mobile.antui:id/message'), {isAlipay: true}], _t) - || $$sel.pickup([$$sel.get('login_err_ensure'), {isAlipay: true}, 'p2c0>0>0'], _t); + .add('login_err_ensure', idEndsWith('ensure')) + .add('login_err_msg', () => { + return pickup([ id('com.alipay.mobile.antui:id/message'), { currentApp: 'alipay' } ], 'txt') + || pickup([ $$sel.get('login_err_ensure'), { currentApp: 'alipay' } ], 'p2c0>0>0', 'txt'); }) - .add('acc_logged_out', [new RegExp('.*(' + .add('acc_logged_out', [ new RegExp('.*(' + /在其他设备登录|logged +in +on +another/.source + '|' + /.*账号于.*通过.*登录.*|account +logged +on +to/.source + ').*'), { - isAlipay: true, - }]); + currentApp: 'alipay', + } ]); } function setGlobalFlags() { - let _dbg_info_sw = $$cfg.debug_info_switch; - let _msg_sw = $$cfg.message_showing_switch; - let _console_msg_sw = _msg_sw && $$cfg.console_log_switch; + let _dbg_info_sw = $$cfg.debugInfoSwitch; + let _msg_sw = $$cfg.messageShowingSwitch; + let _console_msg_sw = _msg_sw && $$cfg.consoleLogSwitch; $$flag.show_debug_info = _dbg_info_sw && _console_msg_sw; - $$flag.show_energy_result = _msg_sw && $$cfg.result_showing_switch; - $$flag.show_floaty_result = $$cfg.floaty_result_switch; + $$flag.show_energy_result = _msg_sw && $$cfg.resultShowingSwitch; + $$flag.show_floaty_result = $$cfg.floatyResultSwitch; _console_msg_sw ? consolex.print.enable() : consolex.print.disable(); - let _e_argv = $$app.engines_exec_argv; - if (Object.size(_e_argv, {exclude: 'intent'}) > 0) { + let _e_argv = $$app.enginesExecArgv; + if (Object.size(_e_argv, { exclude: 'intent' }) > 0) { if (!$$und(_e_argv.isDebug)) { $$flag.show_debug_info = Boolean(_e_argv.isDebug); } @@ -232,11 +220,11 @@ let $$init = { } function setGlobalLog() { - $$cfg.aj_global_log_switch && consolex.setGlobalLogConfig({ - file: $$cfg.aj_global_log_cfg_path + 'auto.js-log.log', - filePattern: $$cfg.aj_global_log_cfg_file_pattern, - maxBackupSize: $$cfg.aj_global_log_cfg_max_backup_size, - maxFileSize: $$cfg.aj_global_log_cfg_max_file_size << 10, + $$cfg.autojsGlobalLogSwitch && consolex.setGlobalLogConfig({ + file: $$cfg.autojsGlobalLogConfigPath + 'auto.js-log.log', + filePattern: $$cfg.autojsGlobalLogConfigFilePattern, + maxBackupSize: $$cfg.autojsGlobalLogConfigMaxBackupSize, + maxFileSize: $$cfg.autojsGlobalLogConfigMaxFileSize << 10, }); consolex.debug.switchSet($$flag.show_debug_info); } @@ -246,7 +234,7 @@ let $$init = { setTask() { /** * @param {number} du_minute - * @param {{is_toast?: boolean, is_async?: boolean}} [options] + * @param {{isToast?: boolean, isAsync?: boolean}} [options] */ $$app.setPostponedTask = function (du_minute, options) { if ($$flag.postponed_task_deploying) { @@ -255,12 +243,12 @@ let $$init = { $$flag.postponed_task_deploying = true; let _opt = options || {}; - let _is_async = _opt.is_async === undefined || _opt.is_async === true; - let _is_toast = _opt.is_toast === undefined || _opt.is_toast === true; + let _is_async = _opt.isAsync === undefined || _opt.isAsync === true; + let _is_toast = _opt.isToast === undefined || _opt.isToast === true; - let _task_s = this.task_name + '任务'; + let _task_s = this.taskName + '任务'; let _toast_lv = _is_toast ? 2 : 0; - let _msg = s => consolex.d(['推迟' + _task_s, s], _toast_lv, 0, 2); + let _msg = s => consolex.d([ '推迟' + _task_s, s ], _toast_lv, 0, 2); let _ts = this.ts + du_minute * 60e3; let _suff = storagesx.af.get('fg_blist_ctr') ? '_auto' : ''; @@ -279,10 +267,10 @@ let $$init = { }); } else { _msg('推迟时长: ' + du_minute + '分钟'); - timersx.addDisposableTask({ + tasks.addDisposableTask({ path: $$app.cwp, date: _ts, - is_async: _is_async, + isAsync: _is_async, callback(task) { $$app.setStoAutoTask({ task: task, @@ -341,11 +329,11 @@ let $$init = { let _sto_task = this.getStoAutoTask(); let _sto_id = _sto_task.task_id; if (_sto_id > 0 && _sto_id !== task.task_id) { - consolex._(['移除旧的自动定时任务', '任务ID: ' + _sto_id]); + consolex._([ '移除旧的自动定时任务', '任务ID: ' + _sto_id ]); if (_sto_task.timestamp < 0) { - timersx.removeIntentTask(_sto_id, {is_async: true}); + tasks.removeIntentTask(_sto_id, { isAsync: true }); } else { - timersx.removeTimedTask(_sto_id, {is_async: true}); + tasks.removeTimedTask(_sto_id, { isAsync: true }); } } }; @@ -367,11 +355,11 @@ let $$init = { let _d = Math.trunc(_du_ts / _d_unit); let _d_str = _d ? _d + '天' : ''; let _h = _du_date.getHours(); - let _h_str = _h ? _h.padStart(2, 0) + '时' : ''; + let _h_str = _h ? Numberx.padStart(_h, 2) + '时' : ''; let _m = _du_date.getMinutes(); - let _m_str = _h || _m ? _m.padStart(2, 0) + '分' : ''; + let _m_str = _h || _m ? Numberx.padStart(_m, 2) + '分' : ''; let _s = _du_date.getSeconds(); - let _s_str = (_h || _m ? _s.padStart(2, 0) : _s) + '秒'; + let _s_str = (_h || _m ? Numberx.padStart(_s, 2) : _s) + '秒'; consolex.$(_d_str + _h_str + _m_str + _s_str + '后解除', 1, 0, 1); }, @@ -400,7 +388,7 @@ let $$init = { }, reason(o) { this._msg({ - protect_cover: '好友使用能量保护罩', + shield: '好友使用能量保护罩', by_user: '用户自行设置', }[o.reason]); }, @@ -411,10 +399,10 @@ let $$init = { }, }, _save() { - storagesx.af_blist.put('blacklist', this._data, {is_forcible: true}); + storagesx.af_blist.put('blacklist', this._data, { is_forcible: true }); }, reason: { - cover: 'protect_cover', + shield: 'shield', user: 'by_user', }, contains(name) { @@ -427,11 +415,11 @@ let $$init = { }, add(name, ts, reason) { let _member = arguments.length === 3 - ? {name: name, timestamp: ts, reason: reason} + ? { name: name, timestamp: ts, reason: reason } : name; for (let i = 0; i < this._data.length; i += 1) { if (this._data[i].name === _member.name) { - if (this._data[i].reason === this.reason.cover) { + if (this._data[i].reason === this.reason.shield) { this._data.splice(i--, 1); } } @@ -448,7 +436,7 @@ let $$init = { if ($$obj(_old)) { consolex._('转换传统黑名单数据格式'); _old = Object.keys(_old).map((n) => ( - Object.assign({name: n}, _old[n]) + Object.assign({ name: n }, _old[n]) )); } if ($$arr(_old)) { @@ -491,25 +479,25 @@ let $$init = { _plans: { back: (function $iiFe() { let _text = () => { - return $$sel.pickup(['返回', {c$: true}, 'c0']) - || $$sel.pickup(['返回', {c$: true}]); + return pickup([ '返回', { clickable: true } ], 'c0') + || pickup([ '返回', { clickable: true } ]); }; let _id = () => { - return $$sel.pickup(idMatches(/.*h5.+nav.back|.*back.button/)); + return pickup(idMatches(/.*h5.+nav.back|.*back.button/)); }; - let _bak = [0, 0, cX(100), cYx(200)]; // backup plan + let _bak = [ 0, 0, cX(100), cYx(200) ]; // backup plan - return [_text, _id, _bak]; + return [ _text, _id, _bak ]; })(), close: (function $iiFe() { let _text = () => { - return $$sel.pickup([/关闭|Close/, {c$: true}, 'c0']) - || $$sel.pickup([/关闭|Close/, {c$: true}]); + return pickup([ /关闭|Close/, { clickable: true } ], 'c0') + || pickup([ /关闭|Close/, { clickable: true } ]); }; let _id = () => null; // so far - let _bak = [cX(0.8), 0, -1, cYx(200)]; // backup plan + let _bak = [ cX(0.8), 0, -1, cYx(200) ]; // backup plan - return [_text, _id, _bak]; + return [ _text, _id, _bak ]; })(), launch: { af: { @@ -517,7 +505,7 @@ let $$init = { $$app.monitor.launch_confirm.start(); $$app.monitor.permission_allow.start(0); let _res = appx.launch(trigger, Object.assign({ - task_name: $$app.task_name, + taskName: $$app.taskName, package_name: 'alipay', screen_orientation: 0, condition_launch() { @@ -525,7 +513,7 @@ let $$init = { }, condition_ready() { let _nec_sel_key = 'af_title'; - let _opt_sel_keys = ['af_home', 'rl_ent']; + let _opt_sel_keys = [ 'af_home', 'rl_ent' ]; if (_necessary() && _orientation() && _optional()) { delete $$flag.launch_necessary; @@ -543,7 +531,7 @@ let $$init = { consolex._('等待启动必要条件'); } if ($$sel.get(_nec_sel_key)) { - consolex._(['已满足启动必要条件:', _nec_sel_key]); + consolex._([ '已满足启动必要条件:', _nec_sel_key ]); return $$flag.launch_necessary = true; } return $$flag.launch_necessary = false; @@ -570,7 +558,7 @@ let $$init = { } return _opt_sel_keys.some((key) => { if ($$sel.get(key)) { - consolex._(['已满足启动可选条件:', key]); + consolex._([ '已满足启动可选条件:', key ]); return true; } }) || ($$flag.launch_optional = false); @@ -602,8 +590,8 @@ let $$init = { function _alipayHome() { return $$app.page.alipay.home() && a11yx.waitAndClick(() => { - return $$sel.pickup([idMatches(/.*InputBoxContainer/), 'c0']); - }, 1.5e3, 80, {cs$: 'w'}); + return pickup(idMatches(/.*InputBoxContainer/), 'c0'); + }, 1.5e3, 80, { cs$: 'w' }); } function _search() { @@ -620,25 +608,25 @@ let $$init = { } function _launch() { - return _this._launcher(() => a11yx.click($$sel.pickup(['蚂蚁森林', { + return _this._launcher(() => a11yx.click(pickup([ '蚂蚁森林', { filter: (w) => { - return !!$$sel.traverse([w, 'p3'], (o) => { - return /官方/.test($$sel.pickup(o, 'txt')); - }); + /** @type {UiObject$} */ + let p = w.compass('p3'); + return p !== null && pickup(w, { filter: w => /官方/.test(w.content()) }, '?'); }, - }]), 'w'), shared_opt); + } ]), 'w'), shared_opt); } }, }, rl: { _launcher(trigger, shared_opt) { return appx.launch(trigger, Object.assign({ - task_name: '好友排行榜', + taskName: '好友排行榜', package_name: alipay.package_name, screen_orientation: android.view.Surface.ROTATION_0, condition_launch: () => true, condition_ready() { - let _loading = () => $$sel.pickup(/加载中.*/); + let _loading = () => pickup(/加载中.*/); let _cA = () => !_loading(); let _cB = () => !a11yx.wait(_loading, 360, 120); let _listLoaded = () => _cA() && _cB(); @@ -646,7 +634,7 @@ let $$init = { return $$app.page.rl.isInPage() && _listLoaded(); }, disturbance() { - a11yx.click($$sel.pickup(/再试一次|打开/), 'w'); + a11yx.click(pickup(/再试一次|打开/), 'w'); }, }, shared_opt)); }, @@ -670,14 +658,14 @@ let $$init = { return true; } if ($$sel.get('alipay_home')) { - consolex._(['检测到支付宝主页页面', '尝试进入蚂蚁森林主页']); + consolex._([ '检测到支付宝主页页面', '尝试进入蚂蚁森林主页' ]); $$app.page.af.launch(); - } else if ($$sel.get('rl_title')) { - consolex._(['检测到好友排行榜页面', '尝试关闭当前页面']); + } else if ($$sel.get('rankListTitle')) { + consolex._([ '检测到好友排行榜页面', '尝试关闭当前页面' ]); $$app.page.back(); } else { - consolex._(['未知页面', '尝试关闭当前页面']); - devicex.keycode(4, {rush: true}); + consolex._([ '未知页面', '尝试关闭当前页面' ]); + devicex.keycode(4, { rush: true }); } } if (_max >= 0) { @@ -736,10 +724,10 @@ let $$init = { }, autojs: { /** @param {RegExp} rex */ - _pickupTitle: rex => $$sel.pickup([rex, { - cn$: 'TextView', - bi$: [cX(0.12), cYx(0.03), halfW, cYx(0.12)], - }]), + _pickupTitle: rex => pickup([ rex, { + className: 'TextView', + boundsInside: [ cX(0.12), cYx(0.03), halfW, cYx(0.12) ], + } ]), get is_log() { return this._pickupTitle(/日志|Log/); }, @@ -747,23 +735,23 @@ let $$init = { return this._pickupTitle(/设置|Settings?/); }, get is_home() { - return $$sel.pickup(idMatches(/.*action_(log|search)/)); + return pickup(idMatches(/.*action_(log|search)/)); }, get is_fg() { - return $$sel.pickup(['Navigate up', {cn$: 'ImageButton'}]) + return pickup([ 'Navigate up', { className: 'ImageButton' } ]) || this.is_home || this.is_log || this.is_settings - || $$sel.pickup(idMatches(/.*md_\w+/)); + || pickup(idMatches(/.*md_\w+/)); }, spring_board: { - on: () => $$cfg.app_launch_springboard === 'ON', + on: () => $$cfg.appLaunchSpringboard === 'ON', employ() { if (!this.on()) { return false; } consolex._('开始部署启动跳板'); - let _aj_name = $$app.autojs_name; - let _res = appx.launch($$app.autojs_pkg, { + let _aj_name = autojs.name; + let _res = appx.launch(context.getPackageName(), { app_name: _aj_name, isDebug: false, condition_ready() { @@ -791,7 +779,7 @@ let $$init = { return _checkInitState(); } // language=JS - consolex._(`等待返回${$$app.autojs_name}应用页面超时`); + consolex._(`等待返回${autojs.name}应用页面超时`); // tool function(s) // @@ -818,7 +806,7 @@ let $$init = { // tool function(s) // function _back2() { - devicex.keycode(4, {rush: true}); + devicex.keycode(4, { rush: true }); sleep(400); } @@ -868,7 +856,7 @@ let $$init = { close() { consolex._('关闭支付宝'); if (appx.close(alipay.package_name, { - shell_acceptable: $$app.has_root && $$app.root_fxs.force_stop, + shell_acceptable: $$app.hasRootAccess && $$app.rootAccessPrivileges.forceStopApp, })) { consolex._('支付宝关闭完毕'); return $$flag.alipay_closed = true; @@ -885,7 +873,7 @@ let $$init = { $$app.page.autojs.spring_board.employ(); // TODO loadFromConfig - let _plans = ['intent', 'click_btn', 'search_kw']; + let _plans = [ 'intent', 'click_btn', 'search_kw' ]; let _res = $$app.page._plansLauncher('af', _plans, shared_opt); $$app.monitor.mask_layer.start(); @@ -902,20 +890,20 @@ let $$init = { return _res; }, close() { - let _tOut = () => timersx.rec.gt('close_af_win', 10e3); + let _tOut = () => recorder.isGreaterThan('close_af_win', 10e3); let _cond = () => { return $$sel.get('af_title') - || $$sel.get('rl_title') - || $$sel.pickup([/浇水|发消息/, {cn$: 'Button'}]) + || $$sel.get('rankListTitle') + || pickup([ /浇水|发消息/, { className: 'Button' } ]) || $$sel.get('login_new_acc'); }; consolex._('关闭全部蚂蚁森林相关页面'); - timersx.rec.save('close_af_win'); + recorder.save('close_af_win'); while (_cond() && !_tOut()) { devicex.keycode(4); sleep(700); } - let _succ = ['相关页面关闭完毕', '保留当前支付宝页面']; + let _succ = [ '相关页面关闭完毕', '保留当前支付宝页面' ]; consolex._(_tOut() ? '页面关闭可能未成功' : _succ); }, isInPage() { @@ -934,7 +922,7 @@ let $$init = { return this.capt(); }, capt() { - return this._capt = imagesx.capt({clone: true}); + return this._capt = imagesx.capt({ clone: true }); }, reclaimAll() { imagesx.reclaim(this._capt); @@ -976,18 +964,18 @@ let $$init = { if (_pool.length !== 2) { return true; } - let [_img, _tpl] = _pool; + let [ _img, _tpl ] = _pool; return !imagesx.findImage(_img, _tpl, { compress_level: 4, }); }, }, launch(shared_opt) { - // TODO split from alipay spring board + // TODO split from alipay springboard $$app.page.autojs.spring_board.employ(); // TODO loadFromConfig - let _plans = ['intent', 'click_btn']; + let _plans = [ 'intent', 'click_btn' ]; return $$app.page._plansLauncher('rl', _plans, shared_opt); }, @@ -1010,30 +998,24 @@ let $$init = { } } if ($$app.page.alipay.isInPage()) { - consolex._(['当前页面为支付宝首页', '重新跳转至排行榜页面']); + consolex._([ '当前页面为支付宝首页', '重新跳转至排行榜页面' ]); return this.launch(); } consolex._('返回排行榜单次超时'); } - consolex._(['返回排行榜失败', '尝试重启支付宝到排行榜页面'], 3); + consolex._([ '返回排行榜失败', '尝试重启支付宝到排行榜页面' ], 3); $$app.page.af.launch(); $$app.page.rl.launch(); $$app.monitor.rl_in_page.start(); }, isInPage() { let _fg = $$flag.rl_in_page; - return $$und(_fg) ? $$sel.get('rl_title') : _fg; + return $$und(_fg) ? $$sel.get('rankListTitle') : _fg; }, }, fri: { in_page_rex: new RegExp([ - /来浇过水.+/, /收取\s?\d+g/, - /赠送的\s?\d+g\s?.*能量/, - /点击加载更多/, /.*暂无最新动态.*/, - ].map(rex => rex.source).join('|')), - in_page_rex_spe: new RegExp([ - /今天/, /昨天/, /\d{2}-\d{2}/, - /((TA|你)(收取)?){2}/, + /TA收取你/, /你收取TA/, /展开好友动态/, /暂无最新动态/, ].map(rex => rex.source).join('|')), isInPage() { let _this = this; @@ -1052,12 +1034,7 @@ let $$init = { } function _chkPageRex() { - let _cA = () => $$sel.pickup(_this.in_page_rex); - let _cB = () => { - let _bnd = $$sel.pickup(_this.in_page_rex_spe, 'bounds'); - return _bnd && _bnd.top > cYx(0.85); - }; - if (_cA() || _cB()) { + if (pickup(_this.in_page_rex)) { delete _this._is_title_ready_fg; return true; } @@ -1078,17 +1055,17 @@ let $$init = { let _sec = (_max_bak - _max) / 1e3; if (_sec >= 6) { - consolex._('进入好友森林时间较长: ' + _sec.toFixedNum(2) + '秒'); + consolex._('进入好友森林时间较长: ' + Numberx.toFixedNum(_sec, 2) + '秒'); } $$app.monitor.reload_btn.interrupt(); return _max > 0 || consolex.$('进入好友森林超时', 3, 1); }, pool: new afrst.ForestImagePool({ - interval: $$cfg.forestImagePoolItv, + interval: $$cfg.forestImagePoolInterval, limit: $$cfg.forestImagePoolLimit, }), - cover: { + shield: { ready() { consolex._('开始能量保护罩检测准备'); @@ -1131,10 +1108,10 @@ let $$init = { }, detect() { let _pool = $$app.page.fri.pool; - let _color = $$cfg.protect_cover_detect_color_val; - let _par = {threshold: $$cfg.protect_cover_detect_threshold}; + let _color = $$cfg.shieldDetectColorValue; + let _par = { threshold: $$cfg.shieldDetectThreshold }; let _clip = (img) => images.clip(img, - cX(288), cYx(210), cX(142), cYx(44)); + cX(308), cYx(272), cX(102), cYx(18)); let _res = _pool.data.some((img) => { let _c = !imagesx.isRecycled(img) && _clip(img); if (_c) { @@ -1155,30 +1132,30 @@ let $$init = { return this._carry(this._plans.close, no_bak); }, closeIntelligently() { - let _cA = () => $$cfg.kill_when_done_switch; - let _cB1 = () => $$cfg.kill_when_done_intelligent; - let _cB2 = () => $$app.init_fg_pkg !== alipay.package_name; + let _cA = () => $$cfg.killWhenDoneSwitch; + let _cB1 = () => $$cfg.killWhenDoneIntelligent; + let _cB2 = () => $$app.initForegroundPackageName !== alipay.package_name; let _cB = () => _cB1() && _cB2(); if (_cA() || _cB()) { return this.alipay.close(); } - if (!$$cfg.kill_when_done_keep_af_pages) { + if (!$$cfg.killWhenDoneKeepRelatedPages) { return this.af.close(); } }, closeAllRelated() { let _trig = () => { return $$sel.get('af_title') - || $$sel.get('rl_title') + || $$sel.get('rankListTitle') || $$app.page.fri.isInPage(); }; if (_trig()) { let _max = 20; let _ctr = 0; do { - devicex.keycode(4, {rush: true}); + devicex.keycode(4, { rush: true }); _ctr += 1; sleep(500); } while (_max-- && _trig()); @@ -1283,12 +1260,12 @@ let $$init = { let _tsToTime = (ts, is_gap) => { if (is_gap) { - ts += new Date(new Date().toLocaleDateString()).getTime(); + ts += new Date().setHours(0, 0, 0, 0); } let _d = new Date(ts); - return _d.getHours().padStart(2, 0) + ':' + - _d.getMinutes().padStart(2, 0) + ':' + - _d.getSeconds().padStart(2, 0); + return Numberx.padStart(_d.getHours(), 2) + ':' + + Numberx.padStart(_d.getMinutes(), 2) + ':' + + Numberx.padStart(_d.getSeconds(), 2); }; let _aim = (function $iiFe() { @@ -1308,7 +1285,7 @@ let $$init = { } _aim_str = t; // noinspection JSCheckFunctionSignatures - let _args = [Date].concat([_now_yy, _now_MM, _now_dd], t.split(':')); + let _args = [ Date ].concat([ _now_yy, _now_MM, _now_dd ], t.split(':')); return new (Array.bind.apply(Date, _args)); })(); let _aim_ts = _aim.getTime(); @@ -1356,9 +1333,9 @@ let $$init = { $$app.layout.closeAll(); if ($$app.next_auto_task_ts) { - timersx.addDisposableTask({ + tasks.addDisposableTask({ path: './tools/show-next-auto-task-countdown.js', - is_async: true, + isAsync: true, }); } }, @@ -1391,7 +1368,7 @@ let $$init = { , deploy(data) { let _win = this.window; - let _stp = {up: _win['stp_up'], dn: _win['stp_dn']}; + let _stp = { up: _win['stp_up'], dn: _win['stp_dn'] }; let _e_own = data.own, _e_fri = data.fri; let _c = this.cfg.colors; let _w = this.cfg.layout_width; @@ -1406,24 +1383,24 @@ let $$init = { _win.setPosition(halfW - _w / 2, _y); if (!_e_own && !_e_fri) { - this._setBg([_stp.up, _stp.dn], _c.vain); + this._setBg([ _stp.up, _stp.dn ], _c.vain); _w_hint_t.setText(this._getHints()); _w_sum_t.setText('0'); } else if (_e_own > 0) { - this._setBg([_stp.up, _stp.dn], _c.own); + this._setBg([ _stp.up, _stp.dn ], _c.own); _w_hint_t.setText('Yourself'); _w_sum_t.setText(_e_own.toString()); } else if (_e_fri > 0) { - this._setBg([_stp.up, _stp.dn], _c.fri); + this._setBg([ _stp.up, _stp.dn ], _c.fri); _w_hint_t.setText('Friends'); _w_sum_t.setText(_e_fri.toString()); } else { - this._setBg([_stp.up, _stp.dn], _c.failed); + this._setBg([ _stp.up, _stp.dn ], _c.failed); _w_hint_t.setText('Failed'); _w_sum_t.setText('Statistics failed'); } - uix.setTextColor([_w_hint_t, _w_sum_t, _w_ctd_t], _c.text); + uix.setTextColor([ _w_hint_t, _w_sum_t, _w_ctd_t ], _c.text); }); }, }, @@ -1450,7 +1427,7 @@ let $$init = { , deploy(data) { let _win = this.window; - let _stp = {up: _win['stp_up'], dn: _win['stp_dn']}; + let _stp = { up: _win['stp_up'], dn: _win['stp_dn'] }; let _e_own = data.own, _e_fri = data.fri; let _c = this.cfg.colors; let _w = this.cfg.layout_width; @@ -1469,9 +1446,9 @@ let $$init = { _w_hint_f.setText('Friends: ' + _e_fri); _w_sum_t.setText((_e_own + _e_fri).toString()); - this._setBg([_stp.up['own'], _stp.dn['own']], _c.own); - this._setBg([_stp.up['fri'], _stp.dn['fri']], _c.fri); - uix.setTextColor([_w_hint_o, _w_hint_f, _w_sum_t, _w_ctd_t], _c.text); + this._setBg([ _stp.up['own'], _stp.dn['own'] ], _c.own); + this._setBg([ _stp.up['fri'], _stp.dn['fri'] ], _c.fri); + uix.setTextColor([ _w_hint_o, _w_hint_f, _w_sum_t, _w_ctd_t ], _c.text); }); }, }, @@ -1479,7 +1456,7 @@ let $$init = { * @param {{countdown:number,own:number,fri:number}} data */ deploy(data) { - threadsx.start(() => this._deploy(data)); + threads.start(() => this._deploy(data)); }, close() { _closeWindow.call(this); @@ -1521,17 +1498,18 @@ let $$init = { ]; consolex._('随机挑选提示语'); - return _notes[Math.rand(_notes.length, -0)]; + return _notes[Mathx.randInt(_notes.length - 1)]; }, _countdown(n) { - let _n = parseInt(n); + let _n = parseInt(n) + 1; let _w = this.window['ctd']['text']; let _err_ctr = 0; let _fin = (fx) => { - fx && fx.call(null); + this.close(); consolex._('发送Floaty结束等待信号'); $$flag.floaty_result_fin = true; - clearInterval(_itv_id); + clearInterval(this.itv_id); + fx && fx.call(null); }; let _setText = function () { _err_ctr < 3 || _fin(() => { @@ -1539,17 +1517,21 @@ let $$init = { consolex.$('建议改用Toast方式显示收取结果', 3); }); try { - ui.post(() => _w.setText('- ' + _n + ' -')); - _n-- || _fin(() => { - consolex._('Floaty倒计时结束'); - consolex._('统计结果展示完毕'); - }); + if (_n > 1) { + ui.post(() => _w.setText('- ' + _n + ' -')); + } else { + ui.post(() => _fin(() => { + consolex._('Floaty倒计时结束'); + consolex._('统计结果展示完毕'); + })); + } + _n -= 1; } catch (e) { _err_ctr += 1; } }; _setText(); - let _itv_id = this.itv_id = setInterval(_setText, 1e3); + this.itv_id = setInterval(_setText, 1e3); }, }, update_avail: { @@ -1576,9 +1558,9 @@ let $$init = { let _this = this; let _ver = ''; let _getVer = () => _ver = $$app.newest_release_ver_name; - threadsx.start(function () { + threads.start(function () { if (a11yx.wait(_getVer, 0, 120)) { - if (appx.version.isNewer(_ver, $$app.project_ver_name)) { + if (appx.version.isNewer(_ver, project.getLocalVerName())) { _this._deploy(); } } @@ -1588,7 +1570,7 @@ let $$init = { _closeWindow.call(this); }, _deploy() { - let _ver_local = $$app.project_ver_name; + let _ver_local = project.getLocalVerName(); let _ver_newest = $$app.newest_release_ver_name; if (appx.version.isNewer(_ver_newest, _ver_local)) { _initCfgColors.call(this); @@ -1622,30 +1604,30 @@ let $$init = { let _newest = $$app.newest_release; let _newest_ver = _newest.version_name; - dialogsx.builds(['项目更新', - '本地版本: ' + $$app.project_ver_name + '\n' + + dialogsx.builds([ '项目更新', + '本地版本: ' + project.getLocalVerName() + '\n' + '最新版本: ' + _newest_ver, - ['忽略此版本', 'warn'], 'X', - ['查看更新', 'attraction'], 1, + [ '忽略此版本', 'warn' ], 'X', + [ '查看更新', 'attraction' ], 1, ], { keycode_back: 'disabled', }).on('neutral', (d) => { d.dismiss(); - timersx.rec.save('update_dialog_uphold'); + recorder.save('update_dialog_uphold'); dialogsx.builds([ '版本忽略提示', 'update_ignore_confirm', - 0, 'Q', ['确定忽略', 'caution'], 1, + 0, 'Q', [ '确定忽略', 'caution' ], 1, ], { keycode_back: 'disabled', }).on('negative', (ds) => { d.show(); ds.dismiss(); - timersx.rec.save('update_dialog_uphold'); + recorder.save('update_dialog_uphold'); }).on('positive', (ds) => { ds.dismiss(); - let _k = 'update_ignore_list'; + let _k = 'updateIgnoreList'; let _new = {}; - _new[_k] = $$cfg[_k].concat([_newest_ver]); + _new[_k] = $$cfg[_k].concat([ _newest_ver ]); storagesx.af_cfg.put('config', _new); toast('已忽略当前版本', 'long'); delete $$flag.update_dialog_uphold; @@ -1655,21 +1637,21 @@ let $$init = { delete $$flag.update_dialog_uphold; }).on('positive', (d) => { d.dismiss(); - timersx.rec.save('update_dialog_uphold'); + recorder.save('update_dialog_uphold'); dialogsx.builds([ '版本详情', _newest.brief_info_str, - ['浏览器查看', 'hint'], 'B', - ['立即更新', 'attraction'], 1, + [ '浏览器查看', 'hint' ], 'B', + [ '立即更新', 'attraction' ], 1, ], { keycode_back: 'disabled', }).on('neutral', (ds) => { ds.dismiss(); app.openUrl(_newest.html_url); - timersx.rec.save('update_dialog_uphold'); + recorder.save('update_dialog_uphold'); }).on('negative', (ds) => { d.show(); ds.dismiss(); - timersx.rec.save('update_dialog_uphold'); + recorder.save('update_dialog_uphold'); }).on('positive', (ds) => { let _clearFlags = () => { delete $$flag.update_dialog_deploying; @@ -1708,7 +1690,7 @@ let $$init = { }, }, deploy() { - threadsx.start(() => this._deploy()); + threads.start(() => this._deploy()); }, close() { _closeWindow.call(this); @@ -1733,7 +1715,7 @@ let $$init = { this.itv_id = setInterval(() => { android.animation.ObjectAnimator - .ofFloat(_w_img, 'rotation', [0, 180]) + .ofFloat(_w_img, 'rotation', [ 0, 180 ]) .setDuration(1.6e3) .start(); }, 2.4e3); @@ -1836,7 +1818,7 @@ let $$init = { appId: 20000067, url: { src: 'https://60000002.h5app.alipay.com/www/listRank.html', - query: {conf: '["totalRank"]'}, + query: { conf: '["totalRank"]' }, }, __webview_options__: { transparentTitle: 'none', @@ -1849,7 +1831,7 @@ let $$init = { enableScrollBar: 'NO', closeCurrentWindow: 'YES', readTitle: 'NO', - defaultTitle: $$app.rl_title, + defaultTitle: $$app.rankListTitle, }, }, exclude: 'defaultTitle', @@ -1868,18 +1850,18 @@ let $$init = { setParams() { //// -=-= PENDING =-=- //// global.$$acc = { - switch: $$cfg.account_switch, + switch: $$cfg.accountSwitch, user_list: { _plans: { intent() { alipay.startApp('account_manager'); }, pipeline() { - $$app.page.alipay.home({isDebug: false}); + $$app.page.alipay.home({ isDebug: false }); return a11yx.pipeline('账号切换页面', [ - ['我的', 'p1'], - ['设置', {boundsInside: [cX(0.8), 0, W, cYx(0.2)]}], + [ '我的', 'p1' ], + [ '设置', { boundsInside: [ cX(0.8), 0, W, cYx(0.2) ] } ], '换账号登录', ]); }, @@ -1888,7 +1870,7 @@ let $$init = { consolex._('打开"账号切换"页面'); // TODO if (!plans_arr) loadFromConfig - return (plans_arr || ['intent', 'pipeline']).some((plan) => { + return (plans_arr || [ 'intent', 'pipeline' ]).some((plan) => { let _task_nm = '计划' + plan.surround('"'); this._plans[plan](); if (a11yx.wait(this.isInPage.bind(this), 2e3)) { @@ -1900,7 +1882,7 @@ let $$init = { }, parse(name_str) { if (!this.isInPage()) { - consolex.$(['解析用户名信息失败', '当前非账户切换页面'], 8, 1, 0, -2); + consolex.$([ '解析用户名信息失败', '当前非账户切换页面' ], 8, 1, 0, -2); } let _sltr = idMatches(/.+_item_current/); @@ -1908,7 +1890,7 @@ let $$init = { sleep(240); // current logged-in user abbr (with a list arrow) - let _cur_abbr = $$sel.pickup([_sltr, 's-1'], 'txt'); + let _cur_abbr = pickup(_sltr, 's-1', 'txt'); // abbr of param 'name_str' let _name_abbr = this.getAbbrFromList(name_str); // let _is_logged_in = $$acc.isMatchAbbr(name_str, _cur_abbr); @@ -1923,9 +1905,9 @@ let $$init = { }; }, isInList(name_str) { - return $$sel.pickup([/.+\*{3,}.+/, {cn$: 'TextView'}], 'wc') + return pickup([ /.+\*{3,}.+/, { className: 'TextView' } ], 'w[]') .some((w) => { - let _abbr_name = $$sel.pickup(w, 'txt'); + let _abbr_name = w.content(); if ($$acc.isMatchAbbr(name_str, _abbr_name)) { return this.abbr_name_in_list = _abbr_name; } @@ -1943,10 +1925,10 @@ let $$init = { }, _codec(str, operation) { let _res = ''; - let _factor = {e: 1, d: -1}[operation[0]]; + let _factor = { e: 1, d: -1 }[operation[0]]; for (let i in str) { let _char_code = str.charCodeAt(+i); - let _shifting = ((996).ICU + +i) * _factor; + let _shifting = (Numberx.ICU + +i) * _factor; _res += String.fromCharCode(_char_code + _shifting); } return _res; @@ -2091,30 +2073,30 @@ let $$init = { let _conds = { name: '列表快捷切换账户', time: 1, // 1 min - wait: [{ + wait: [ { remark: '登录中进度条', - cond: () => $$sel.pickup(className('ProgressBar')), - }], - success: [{ + cond: () => pickup(className('ProgressBar')), + } ], + success: [ { remark: '支付宝首页', cond: () => $$sel.get('alipay_home'), }, { remark: 'H5关闭按钮', cond: () => $$sel.get('close_btn'), - }], - fail: [{ + } ], + fail: [ { remark: '出现登录页面', cond: () => $$acc.isInLoginPg(), - }], - timeout_review: [{ + } ], + timeout_review: [ { remark: '强制账号列表检查', cond: () => _isLoggedIn(), - }], + } ], }; for (let i = 0; i < 3; i += 1) { consolex._((i ? '再次尝试' : '') + '点击列表中的账户'); - a11yx.click([_usr.abbr, 'p5'], 'w'); + a11yx.click([ _usr.abbr, 'p5' ], 'w'); consolex._('开始监测账户切换结果'); if (!_condChecker(_conds)) { @@ -2137,31 +2119,31 @@ let $$init = { function _ready() { /** @type {{trigger:function():*,exec:function():boolean}[]} */ - let _monitors = [{ + let _monitors = [ { trigger() { return $$sel.get('acc_logged_out'); }, exec() { - return a11yx.click($$sel.pickup(/好的|OK/), 'w'); + return a11yx.click(pickup(/好的|OK/), 'w'); }, }, { trigger() { - return this.w = $$sel.pickup(/.+img_dialog_close/); + return this.w = pickup(/.+img_dialog_close/); }, exec() { return a11yx.click(this.w, 'w'); }, }, { trigger() { - return $$sel.pickup(/android:id\/autofill_dataset.*/); + return pickup(/android:id\/autofill_dataset.*/); }, exec() { return back(); }, - }]; - let _thd_monitor = threadsx.start(function () { - timersx.rec.save('acc_login_by_input_text'); - while (timersx.rec.lt('acc_login_by_input_text', 30e3)) { + } ]; + let _thd_monitor = threads.start(function () { + recorder.save('acc_login_by_input_text'); + while (recorder.isLessThan('acc_login_by_input_text', 30e3)) { _monitors.some(o => o.trigger() && o.exec()) && sleep(500); sleep(240); } @@ -2178,7 +2160,7 @@ let $$init = { } if (!$$acc.isInLoginPg()) { let _w = $$sel.get('login_new_acc'); - if (!a11yx.click([_w, 'k4'], 'w')) { + if (!a11yx.click([ _w, 'k4' ], 'w')) { alipay.startApp('account_login'); } } @@ -2196,7 +2178,7 @@ let $$init = { a11yx.wait(() => _a() || _m1() || _m2() || _ipt(), 3e3); // since Oct 25, 2021 (around) - if ($$sel.pickup('更多')) { + if (pickup('更多')) { consolex._('点击"更多"按钮'); a11yx.click('更多', 'w'); if (a11yx.wait('换个账号')) { @@ -2241,7 +2223,7 @@ let $$init = { let _w_acc = null; let _sel_acc = () => _w_acc = $$sel.get('input_username'); - let _inputted = () => $$sel.pickup(name); + let _inputted = () => pickup(name); let _noInputted = () => !_inputted(); let _cA = () => a11yx.wait(_inputted, 1e3); let _cB = () => !a11yx.wait(_noInputted, 500); @@ -2307,7 +2289,7 @@ let $$init = { function _click() { consolex._('点击"下一步"按钮'); let _sel = () => $$sel.get('login_next_step'); - a11yx.click([_sel(), 'k1'], 'w', { + a11yx.click([ _sel(), 'k1' ], 'w', { max_check_times: 2, check_time_once: 5e3, condition: () => !_sel(), @@ -2315,7 +2297,7 @@ let $$init = { } function _check() { - let _again = () => $$sel.pickup(/重新输入|Try again/); + let _again = () => pickup(/重新输入|Try again/); let _other = () => $$sel.get('login_other_mthd'); let _by_code = () => $$sel.get('login_by_code'); let _cond = () => ( @@ -2332,7 +2314,7 @@ let $$init = { return true; } if (_err_ens() || _again()) { - consolex.$(['登录失败', _err_msg()], 8, 1, 0, -2); + consolex.$([ '登录失败', _err_msg() ], 8, 1, 0, -2); } if (_other()) { consolex._('点击"换个方式登录"按钮'); @@ -2360,11 +2342,16 @@ let $$init = { let _code = cryptox.dec(code_raw, 'af'); let _pref = '布局树查找可编辑"密码"控件'; - let _sel = $$sel.pickup([_ipt_pw(), 'p2c1']); + + let _sel = _ipt_pw(); + if (_sel !== null) { + _sel = _sel.compass('p2c1'); + } + if (_sel && _sel.setText(_code)) { consolex._(_pref + '成功'); } else { - consolex._([_pref + '失败', '尝试使用通用可编辑控件'], 3); + consolex._([ _pref + '失败', '尝试使用通用可编辑控件' ], 3); let _w = className('EditText').findOnce(); let _input = _w && _w.setText(_code); let _suff = _input ? '成功' : '失败'; @@ -2372,7 +2359,7 @@ let $$init = { } consolex._('点击"登录"按钮'); - if (a11yx.waitAndClick(/登录|Log in|.*loginButton/, 3e3, {cs$: 'w'})) { + if (a11yx.waitAndClick(/登录|Log in|.*loginButton/, 3e3, { cs$: 'w' })) { return true; } consolex.$('输入密码后点击"登录"失败', 4, 1, 0, -2); @@ -2380,7 +2367,7 @@ let $$init = { function _manIpt() { consolex._('需要手动输入密码'); - devicex.vibrate([100, 200, 100, 200, 200]); + devicex.vibrate([ 100, 200, 100, 200, 200 ]); let _user_tt = 2; // min let _btn_tt = 2; // min @@ -2388,7 +2375,7 @@ let $$init = { devicex.keepOn(Math.floor(_user_tt + _btn_tt) * 60e3); let _flag = false; - threadsx.start(_thdUserAct); + threads.start(_thdUserAct); while (!_flag) { sleep(500); @@ -2424,7 +2411,7 @@ let $$init = { } devicex.cancelOn(); _d.dismiss(); - consolex.$(['登录失败', '需要密码时等待用户响应超时'], 8, 4, 0, 2); + consolex.$([ '登录失败', '需要密码时等待用户响应超时' ], 8, 4, 0, 2); } function _waitForBtn() { @@ -2434,12 +2421,12 @@ let $$init = { let _rex = '.*(confirmSet.*|mainTip|登录中.*|message)'; let _cond = () => !$$sel.get('login_btn') && !a11yx.wait(() => ( - $$sel.pickup(_rex) || _err_ens() + pickup(_rex) || _err_ens() ), 500); if (!a11yx.wait(_cond, _btn_tt * 60e3)) { devicex.cancelOn(); _d.dismiss(); // just in case - consolex.$(['登录失败', '等待"登录"按钮消失超时'], 8, 4, 0, 2); + consolex.$([ '登录失败', '等待"登录"按钮消失超时' ], 8, 4, 0, 2); } return true; } @@ -2452,11 +2439,11 @@ let $$init = { let _conds = { name: '登录账户', time: 0.5, // 30 sec - wait: [{ + wait: [ { remark: '登录中进度条', - cond: () => $$sel.pickup(/.*登录中.*/), - }], - success: [{ + cond: () => pickup(/.*登录中.*/), + } ], + success: [ { remark: '支付宝首页', cond: () => $$sel.get('alipay_home'), }, { @@ -2464,27 +2451,27 @@ let $$init = { cond: () => $$sel.get('close_btn'), }, { remark: '支付宝设置页面', - cond: () => $$sel.pickup(/(退出|换账号)登录/), - }], - fail: [{ + cond: () => pickup(/(退出|换账号)登录/), + } ], + fail: [ { remark: '失败提示', cond: () => _err_ens(), feedback() { devicex.cancelOn(); - consolex.$(['登录失败', _err_msg()], 8, 4, 0, 2); + consolex.$([ '登录失败', _err_msg() ], 8, 4, 0, 2); }, }, { remark: '失败提示', - cond: () => $$sel.pickup(/.*confirmSetting|.*mainTip/), + cond: () => pickup(/.*confirmSetting|.*mainTip/), feedback() { let _fail_pref = '失败提示信息: '; - let _fail_main = $$sel.pickup(/.*mainTip/, 'txt'); + let _fail_main = pickup(/.*mainTip/, 'txt'); let _fail_msg = _fail_pref + _fail_main; devicex.cancelOn(); - consolex.$(['登录失败', _fail_msg], 8, 4, 0, 2); + consolex.$([ '登录失败', _fail_msg ], 8, 4, 0, 2); }, - }], - timeout_review: [{ + } ], + timeout_review: [ { remark: '强制账号列表检查', cond() { if ($$acc.isLoggedIn(_usr.name)) { @@ -2492,7 +2479,7 @@ let $$init = { } consolex.$('切换主账户超时', 8, 4, 0, 2); }, - }], + } ], }; return _condChecker(_conds); @@ -2501,7 +2488,7 @@ let $$init = { function _condChecker(cond) { if (!$$obj(cond)) { - consolex._(['条件检查器参数无效', cond]); + consolex._([ '条件检查器参数无效', cond ]); return false; } @@ -2548,7 +2535,7 @@ let $$init = { consolex._(_name + '成功'); return true; } - consolex._(['超时复检失败', _name + '失败'], 3); + consolex._([ '超时复检失败', _name + '失败' ], 3); // tool function(s) // @@ -2595,7 +2582,7 @@ let $$init = { return _clearSto(); } - if (!$$cfg.account_log_back_in_switch) { + if (!$$cfg.accountLogBackInSwitch) { consolex._('无需回切账户'); consolex._('旧账户回切功能未开启'); return _clearSto(); @@ -2608,13 +2595,13 @@ let $$init = { return _clearSto(); } - let _init_data = {name: _init_usr, times: 0}; + let _init_data = { name: _init_usr, times: 0 }; let _sto_data = storagesx.af.get(_sto_key, _init_data); if (_sto_data.name !== _init_usr) { _sto_data = _init_data; } - let _k = 'account_log_back_in_max_continuous_times'; + let _k = 'accountLogBackInMaxContinuousTimes'; if (_sto_data.times >= $$cfg[_k]) { consolex._('禁止回切账户'); consolex._('此旧账户回切次数已达上限'); @@ -2667,7 +2654,7 @@ let $$init = { consolex._('检测到账户登出状态'); return false; } - timersx.rec.save('avt_chk'); + recorder.save('avt_chk'); let _img = images.read(path || this._path); let _res; if (_img) { @@ -2675,7 +2662,7 @@ let $$init = { imagesx.reclaim(_img); _img = null; } - $$app.avatar_checked_time = $$cvt.time(timersx.rec('avt_chk'), '$zh'); + $$app.avatar_checked_time = $$cvt.time(recorder('avt_chk'), '$zh'); if (_res) { consolex._('当前账户符合主账户身份'); consolex._('本地主账户头像匹配成功'); @@ -2721,7 +2708,7 @@ let $$init = { return false; } - let [l, t, w, h] = [_b.left, _b.top, _b.width(), _b.height()]; + let [ l, t, w, h ] = [ _b.left, _b.top, _b.width(), _b.height() ]; if (w < 3 || h < 3) { consolex.$('无法继续匹配当前头像样本', 3, 0, 0, -0.5); consolex.$('森林主页头像控件数据无效', 3, 0, 1, 0.5); @@ -2740,11 +2727,11 @@ let $$init = { let _bnd = null; void [ '我的大树养成记录', - [idMatches(/.*us.r.+e.+gy/), 'p2c0'], - ['种树', {className: 'Button'}, 'p1c0'], - [idMatches(/.*home.*panel/), 'c0>0>0'], + [ idMatches(/.*us.r.+e.+gy/), 'p2c0' ], + [ '种树', { className: 'Button' }, 'p1c0' ], + [ idMatches(/.*home.*panel/), 'c0>0>0' ], ].some((kw) => { - if ((_bnd = $$sel.pickup(kw, 'bounds'))) { + if ((_bnd = kw.bounds())) { consolex._('森林主页头像控件定位成功'); return true; } @@ -2785,21 +2772,21 @@ let $$init = { return !this._isTotalGreen(clip); }, }, - name_raw: $$cfg.main_account_info.account_name, - code_raw: $$cfg.main_account_info.account_code, + name_raw: $$cfg.mainAccountInfo.account_name, + code_raw: $$cfg.mainAccountInfo.account_code, isAvail() { if (!$$acc.switch) { - return {code: 1, msg: '账户功能未开启'}; + return { code: 1, msg: '账户功能未开启' }; } if (!this.name_raw) { - return {code: 1, msg: '主账户用户名未设置'}; + return { code: 1, msg: '主账户用户名未设置' }; } - return {code: 0}; + return { code: 0 }; }, ensureAvail() { - let {code, msg} = this.isAvail(); + let { code, msg } = this.isAvail(); if (code !== 0) { - consolex.$(['主账户登录失败', msg], 8, 4, 0, 2); + consolex.$([ '主账户登录失败', msg ], 8, 4, 0, 2); } }, isMain(name_str) { @@ -2835,18 +2822,18 @@ let $$init = { } }, queue() { - let _my_e = enginesx.my_engine; - let _my_e_id = enginesx.my_engine_id; - let _excl_tag = 'exclusive_task'; - let _ts_tag = 'launch_timestamp'; - _my_e.setTag(_excl_tag, 'af'); - _my_e.setTag(_ts_tag, $$app.ts); + let myEngine = enginesx.my_engine; + let myEngineId = enginesx.my_engine_id; + let exclusiveTaskTag = 'exclusive_task'; + let launchTimestampTag = 'launch_timestamp'; + myEngine.setTag(exclusiveTaskTag, 'af'); + myEngine.setTag(launchTimestampTag, $$app.ts); - let _b = bombSetter(); - _b.trigger() && _b.explode(); + let b = bombSetter(); + b.trigger() && b.explode(); - let _q = $$app.queue = queueSetter(); - _q.trigger() && _q.monitor() && _q.queue(); + let q = $$app.queue = queueSetter(); + q.trigger() && q.monitor() && q.queue(); return $$init; @@ -2859,10 +2846,10 @@ let $$init = { while (_max--) { try { return engines.all().filter((e) => { - let _gap = () => $$app.ts - e.getTag(_ts_tag); - return e.getTag(_excl_tag) === 'af' - && _my_e_id > e.id - && _gap() < $$cfg.min_bomb_interval_global; + let _gap = () => $$app.ts - e.getTag(launchTimestampTag); + return e.getTag(exclusiveTaskTag) === 'af' + && myEngineId > e.id + && _gap() < $$cfg.minBombIntervalGlobal; }).length; } catch (e) { // Wrapped java.util.ConcurrentModificationException @@ -2882,45 +2869,15 @@ let $$init = { function queueSetter() { return { - get excl_tasks_all() { - while (1) { - try { - return engines.all().filter(e => e.getTag(_excl_tag)); - } catch (e) { - // Wrapped java.util.ConcurrentModificationException - // exception happens with a small possibility - sleep(20, 50); - } - } - }, - get excl_tasks_ahead() { - while (1) { - try { - return engines.all().filter((e) => ( - e.getTag(_excl_tag) && e.id < _my_e_id - )); - } catch (e) { - // Wrapped java.util.ConcurrentModificationException - // exception happens with a small possibility - sleep(20, 50); - } - } - }, - get excl_tasks_ahead_len() { - return this.excl_tasks_ahead.length; - }, - get excl_tasks_all_len() { - return this.excl_tasks_all.length; - }, trigger() { - return this.excl_tasks_ahead_len; + return this.getExclusiveAheadTasksLength(); }, monitor() { consolex._('设置广播监听器'); events.broadcast.on('init_scr_on_state_change', (v) => { consolex._('接收到初始屏幕开关状态广播'); - if (!$$app.queue.excl_tasks_ahead_len) { + if (!$$app.queue.getExclusiveAheadTasksLength()) { consolex._('根据广播消息修改状态参数'); $$app.init_scr_on_from_broadcast = v; } else { @@ -2932,19 +2889,19 @@ let $$init = { return this; }, queue() { - timersx.rec.save('sc_q'); // script queue - timersx.rec.save('sc_q_total'); + recorder.save('sc_q'); // script queue + recorder.save('sc_q_total'); - let _init_que_len = this.excl_tasks_ahead_len; + let _init_que_len = this.getExclusiveAheadTasksLength(); let _que_len = _init_que_len; - let _sto_max_que_t = $$cfg.max_queue_time_global; + let _sto_max_que_t = $$cfg.maxQueueTimeGlobal; consolex._('排他性任务排队中: ' + _que_len + '项'); let _init_max_que_t = _sto_max_que_t * _que_len; let _max_que_t = _init_max_que_t; consolex._('已设置最大排队时间: ' + _max_que_t + '分钟'); - while ((_que_len = this.excl_tasks_ahead_len)) { + while ((_que_len = this.getExclusiveAheadTasksLength())) { if (_que_len !== _init_que_len) { consolex._('排他性任务队列发生变更', 0, 0, -1); let _amt = _init_que_len + '->' + _que_len; @@ -2954,10 +2911,10 @@ let $$init = { let _t = _init_max_que_t + '->' + _max_que_t; consolex._('最大排队: ' + _t + '分钟'); _init_max_que_t = _max_que_t; - timersx.rec.save('sc_q'); // refresh + recorder.save('sc_q'); // refresh } - if (timersx.rec.gt('sc_q', _max_que_t * 60e3)) { - this.excl_tasks_ahead.forEach(e => e.forceStop()); + if (recorder.isGreaterThan('sc_q', _max_que_t * 60e3)) { + this.getExclusiveAheadTasks().forEach(e => e.forceStop()); consolex._('强制停止队前所有排他性任务'); consolex._('已达最大排队等待时间'); } @@ -2965,7 +2922,37 @@ let $$init = { } consolex.debug.__('solid', 1); - consolex._('任务排队用时: ' + $$cvt.time(timersx.rec('sc_q_total'), '$zh')); + consolex._('任务排队用时: ' + $$cvt.time(recorder('sc_q_total'), '$zh')); + }, + getExclusiveAllTasks() { + while (1) { + try { + return engines.all().filter(e => e.getTag(exclusiveTaskTag)); + } catch (e) { + // Wrapped java.util.ConcurrentModificationException + // exception happens with a small possibility + sleep(20, 50); + } + } + }, + getExclusiveAheadTasks() { + while (1) { + try { + return engines.all().filter((e) => ( + e.getTag(exclusiveTaskTag) && e.id < myEngineId + )); + } catch (e) { + // Wrapped java.util.ConcurrentModificationException + // exception happens with a small possibility + sleep(20, 50); + } + } + }, + getExclusiveAheadTasksLength() { + return this.getExclusiveAheadTasks().length; + }, + getExclusiveAllTasksLength() { + return this.getExclusiveAllTasks().length; }, }; } @@ -2986,7 +2973,7 @@ let $$init = { // tool function(s) // function _screenOn() { - if (devicex.is_init_screen_on) { + if (devicex.isInitScreenOn) { return true; } consolex._('跳过前置应用黑名单检测'); @@ -2994,15 +2981,15 @@ let $$init = { } function _inBlist() { - let _i_pkg = $$app.init_fg_pkg; + let _i_pkg = $$app.initForegroundPackageName; let _passed = '前置应用黑名单检测通过'; - let _res = $$cfg.foreground_app_blacklist.some((o) => { - let [_name, _pkg] = o.app_combined_name.split('\n'); + let _res = $$cfg.foregroundAppBlacklist.some((o) => { + let [ _name, _pkg ] = o.app_combined_name.split('\n'); if (_i_pkg === _pkg) { return $$app.fg_black_app = _name; } }); - _res || consolex._(_i_pkg ? [_passed + ':', _i_pkg] : _passed); + _res || consolex._(_i_pkg ? [ _passed + ':', _i_pkg ] : _passed); return _res; } }, @@ -3023,14 +3010,14 @@ let $$init = { } storagesx.af.put('fg_blist_ctr', _ctr); - $$app.setPostponedTask(_time, {is_async: true, is_toast: false}); // `exit()` included + $$app.setPostponedTask(_time, { isAsync: true, isToast: false }); // `exit()` included sleep(9e3); // in case task isn't set successfully before `exit()` exit(); // thoroughly prevent script from going on (main thread) // tool function(s) // function delayInfoSetter(minutes) { - let _mm = minutes || [1, 1, 2, 3, 5, 8, 10]; + let _mm = minutes || [ 1, 1, 2, 3, 5, 8, 10 ]; let _ctr = storagesx.af.get('fg_blist_ctr', 0); let _max_mm = _mm[_mm.length - 1]; let _time = _mm[_ctr] || _max_mm; @@ -3070,8 +3057,8 @@ let $$init = { let _keys = { ins_tasks: 'insurance_tasks', ins_accu: 'insurance_tasks_continuous_times', - ins_accu_max: 'timers_insurance_max_continuous_times', - ins_itv: 'timers_insurance_interval', + ins_accu_max: 'timersInsuranceMaxContinuousTimes', + ins_itv: 'timersInsuranceInterval', }; return { @@ -3088,25 +3075,25 @@ let $$init = { }, get _sto_ids() { return storagesx.af_ins.get(_keys.ins_tasks, []) - .filter(id => timersx.getTimedTask(id)); + .filter(id => tasks.getTimedTask(id)); }, get _next_task_time() { return $$app.ts + $$cfg[_keys.ins_itv] * 60e3; }, trigger() { - if (!$$cfg.timers_switch) { + if (!$$cfg.timersSwitch) { consolex._('定时循环功能未开启'); return false; } - if (!$$cfg.timers_self_manage_switch) { + if (!$$cfg.timersSelfManageSwitch) { consolex._('定时任务自动管理未开启'); return false; } - if (!$$cfg.timers_insurance_switch) { + if (!$$cfg.timersInsuranceSwitch) { consolex._('意外保险未开启'); return false; } - if ($$app.engines_exec_argv.no_insurance) { + if ($$app.enginesExecArgv.no_insurance) { consolex._('检测到"无需保险"引擎参数'); return false; } @@ -3122,16 +3109,16 @@ let $$init = { consolex._('任务已达最大连续次数限制: ' + _max); this.clean().reset(); }, - /** @param {Timersx.TimedTask.Extension} [task_options] */ + /** @param {Tasks.TimedTask.Extension} [task_options] */ clean(task_options) { this.interrupt(); let _ids = this._sto_ids; if (_ids.length) { - _ids.forEach(id => timersx.removeTimedTask(id, task_options)); - consolex._(['已移除意外保险定时任务:', '任务ID: ' + ( + _ids.forEach(id => tasks.removeTimedTask(id, task_options)); + consolex._([ '已移除意外保险定时任务:', '任务ID: ' + ( _ids.length > 1 ? '[ ' + _ids.join(', ') + '] ' : _ids[0] - )]); + ) ]); } storagesx.af_ins.remove(_keys.ins_tasks); @@ -3146,26 +3133,26 @@ let $$init = { let _cbk = (task) => { this.task = task; this.monitor(); - let _ids = this._sto_ids.concat([task.id]); + let _ids = this._sto_ids.concat([ task.id ]); storagesx.af_ins.put(_keys.ins_tasks, _ids); consolex._('已设置意外保险定时任务'); consolex._('任务ID: ' + task.id); this.increase(); }; let _nxt_time = this._next_task_time; - timersx.addDisposableTask({ + tasks.addDisposableTask({ path: $$app.cwp, date: _nxt_time, - is_async: true, + isAsync: true, callback: _cbk.bind(this), }); return this; }, monitor() { - this._thd = threadsx.start(() => setInterval(() => { + this._thd = threads.start(() => setInterval(() => { if (this.task) { this.task.setMillis(this._next_task_time); - timersx.updateTask(this.task); + tasks.updateTask(this.task); } }, 10e3)); return this; @@ -3178,7 +3165,7 @@ let $$init = { }, remove() { this.interrupt(); - this.id > 0 && timersx.removeTimedTask(this.id, {is_async: true}); + this.id > 0 && tasks.removeTimedTask(this.id, { isAsync: true }); return this; }, increase() { @@ -3189,7 +3176,7 @@ let $$init = { */ finish(status) { status === undefined || status === 0 - ? this.clean({is_async: true}).reset() + ? this.clean({ isAsync: true }).reset() : this.reset(); }, }; @@ -3198,9 +3185,9 @@ let $$init = { function instantMonSetter() { return { maxRun() { - let _max = Number($$cfg.max_running_time_global); + let _max = Number($$cfg.maxRunningTimeGlobal); - _max > 0 && threadsx.start(function () { + _max > 0 && threads.start(function () { setTimeout(() => { devicex.cancelOn(); ui.post(() => consolex.$('超时强制退出', 8, 4, 0, '2n')); @@ -3212,7 +3199,7 @@ let $$init = { volKeys() { consolex._('设置音量键监听器'); - threadsx.start(function () { + threads.start(function () { /* Do not add `threads.shutDownAll()` in this thread. */ @@ -3224,7 +3211,7 @@ let $$init = { events.observeKey(); events.setKeyInterceptionEnabled('volume_down', true); events.onceKeyUp('volume_down', function (e) { - consolex.$('强制停止' + $$app.task_name + '任务', 3, 1, 0, -1); + consolex.$('强制停止' + $$app.taskName + '任务', 3, 1, 0, -1); consolex.$('触发按键: 音量减/VOL-', 3, 0, 1); consolex.$(_keyMsg(e), 3, 0, 1, 1); $$app.tidy(1); @@ -3247,7 +3234,7 @@ let $$init = { phone: { _getStoState() { let _self = { - state_key: 'phone_call_state_idle_value', + state_key: 'phoneCallStateIdleValue', get cur_state() { return $$cfg[this.state_key]; }, @@ -3313,7 +3300,7 @@ let $$init = { return _sto.filled_up ? _sto.reap() : _sto.fillIn(); }, - switching: 'phone_call_state_monitor_switch', + switching: 'phoneCallStateMonitorSwitch', trigger() { return devicex.getCallState() !== this._getStoState(); }, @@ -3368,18 +3355,18 @@ let $$init = { _msgAboutToTrigger() { try { pluginsx.device.next_alarm_clock.run({ - is_async: true, title: '闹钟即将触发', + isAsync: true, title: '闹钟即将触发', }); } catch (e) { let _delay = 2; setTimeout(() => { let _t = Math.ceil(devicex.getNextAlarmClockTriggerGap() / 1e3); - toast('闹钟即将在 ' + (_t - _delay) + ' 秒内触发', 'L', 'F'); + toast('闹钟即将在 ' + (_t - _delay) + ' 秒内触发', 'l', 'f'); }, _delay * 1e3); } }, _msgTriggered() { - toast('支付宝界面前置时\n脚本将自动继续', 'L', 'F'); + toast('支付宝界面前置时\n脚本将自动继续', 'l', 'f'); }, trigger() { return devicex.isNextAlarmClockTriggered(this._thrd); @@ -3396,7 +3383,7 @@ let $$init = { } }, onRelease() { - toast('闹钟事件已解除', 'S', 'F'); + toast('闹钟事件已解除', 's', 'f'); }, }, }, @@ -3427,7 +3414,7 @@ let $$init = { */ function Monitor(desc, limit, options) { let _limit = _handleLimitParam(limit); - Object.assign(options, {_limit: _limit}); + Object.assign(options, { _limit: _limit }); let _desc = desc.surround('"'); let _sw = _handleSwitch(options.switching); @@ -3438,13 +3425,13 @@ let $$init = { consolex._(_sw ? _e_name + '已开启' : _e_name + '未开启'); return _sw; }; - /** @return {com.stardust.autojs.core.looper.TimerThread} */ + /** @return {org.autojs.autojs.core.looper.TimerThread} */ this.monitor = function () { let _o = { _onTriggerMsg() { - timersx.rec.save('glob_e' + _desc); + recorder.save('glob_e' + _desc); - consolex.$(['触发' + _desc + '事件', _getCtdMsg()], 1, 4, 0, 2); + consolex.$([ '触发' + _desc + '事件', _getCtdMsg() ], 1, 4, 0, 2); // tool function(s) // @@ -3477,7 +3464,7 @@ let $$init = { _onReleaseMsg() { consolex.$([ '解除' + _desc + '事件', - '解除用时: ' + $$cvt.time(timersx.rec('glob_e' + _desc), '$zh'), + '解除用时: ' + $$cvt.time(recorder('glob_e' + _desc), '$zh'), ], 1, 0, 0, -2); }, onTrigger() { @@ -3487,11 +3474,11 @@ let $$init = { }, keepWaiting() { while (options.trigger()) { - if (timersx.rec.gt('glob_e' + _desc, _limit)) { - let _msg = '强制停止' + $$app.task_name + '任务'; + if (recorder.isGreaterThan('glob_e' + _desc, _limit)) { + let _msg = '强制停止' + $$app.taskName + '任务'; let _rsn = _desc + '事件解除超时'; - toast(_msg + '\n' + _rsn, 'L', 'F'); - consolex.$([_msg, _rsn], 8, 4, 0, 2); + toast(_msg + '\n' + _rsn, 'l', 'f'); + consolex.$([ _msg, _rsn ], 8, 4, 0, 2); } sleep(240); } @@ -3502,7 +3489,7 @@ let $$init = { this._onReleaseMsg(); }, }; - return threadsx.start(function () { + return threads.start(function () { while (1) { if (options.trigger()) { _o.onTrigger(); @@ -3514,7 +3501,7 @@ let $$init = { } }); }; - /** @return {boolean|com.stardust.autojs.core.looper.TimerThread} */ + /** @return {boolean|org.autojs.autojs.core.looper.TimerThread} */ this.start = function () { return this.valid() && this.monitor(); }; @@ -3586,11 +3573,11 @@ let $$init = { * desc: string, * }[]} */ - let _samples = [{ + let _samples = [ { trig: '关闭蒙层', desc: '蒙层遮罩', }, { - trig: ['关闭', {bi$: [0, halfW, W, H]}], + trig: [ '关闭', { boundsInside: [ 0, halfW, W, H ] } ], desc: '关闭按钮遮罩', }, { trig: idMatches(/.*treedialog.close/), @@ -3598,10 +3585,10 @@ let $$init = { }, { trig: idMatches(/.*J_strollGuide/), desc: '逛一逛向导遮罩', // new button name: "找能量" - }].map((o) => { + } ].map((o) => { if (!$$func(o.trig)) { let _trig = o.trig; - o.trig = () => $$sel.pickup(_trig); + o.trig = () => pickup(_trig); } return o; }); @@ -3611,7 +3598,7 @@ let $$init = { return _samples.some((o) => { let _w = o.trig(); if (_w) { - this._smp = Object.assign({widget: _w}, o); + this._smp = Object.assign({ widget: _w }, o); return true; } }); @@ -3624,22 +3611,22 @@ let $$init = { let _smp = this._smp; consolex._('检测到' + _smp.desc); - timersx.rec.save('_mask_layer'); + recorder.save('_mask_layer'); $$flag.mask_layer_monitoring = true; let _cA1 = () => { - if ($$sel.pickup(_smp.widget, 'clickable')) { + if (pickup(_smp.widget, 'clickable')) { return a11yx.click(_smp.widget, 'w'); } }; - let _cA2 = () => a11yx.click(_smp.widget, 'press', {pt$: 80}); + let _cA2 = () => a11yx.click(_smp.widget, 'press', { pt$: 80 }); let _cA = () => _cA1() || _cA2(); let _cB1 = () => a11yx.wait(() => !_smp.trig(), 1.2e3, 80); let _cB2 = () => !a11yx.wait(_smp.trig, 320, 80); let _cB = () => _cB1() && _cB2(); if (_cA() && _cB()) { - let _et = $$cvt.time(timersx.rec('_mask_layer'), '$zh'); - consolex._(['关闭' + _smp.desc + '成功', '遮罩关闭用时: ' + _et]); + let _et = $$cvt.time(recorder('_mask_layer'), '$zh'); + consolex._([ '关闭' + _smp.desc + '成功', '遮罩关闭用时: ' + _et ]); } else { consolex._('关闭' + _smp.desc + '单次失败', 3); } @@ -3668,19 +3655,26 @@ let $$init = { }), rl_in_page: new Monitor('排行榜页面', function () { while (1) { - $$sel.cache.refresh('rl_title'); // including `save()` - $$flag.rl_in_page = $$sel.cache.load('rl_title'); + $$sel.cache.refresh('rankListTitle'); // including `save()` + $$flag.rl_in_page = $$sel.cache.load('rankListTitle'); sleep(120); } }), rl_bottom: new Monitor('排行榜底部', function () { - let _list_w = null, _rl_end_w = null; + /** + * @type {UiObject} + */ + let _list_w = null; + /** + * @type {UiObject} + */ + let _rl_end_w = null; while (!$$flag.rl_bottom_rch) { $$impeded('排行榜底部监测线程'); try { if ($$app.page.rl.isInPage() && _locate()) { - $$link(_text).$(_height).$(_signal); + $$link(_text).$(_scrollable).$(_signal); break; } } catch (e) { @@ -3694,7 +3688,7 @@ let $$init = { function _locate() { consolex._('开始定位排行榜可滚动控件'); - let _sel = () => _list_w = $$sel.pickup({ + let _sel = () => _list_w = pickup({ scrollable: true, filter(w) { let bnd = w.bounds(); @@ -3728,7 +3722,7 @@ let $$init = { _child_w_tmp = null; } _rl_end_w = _child_w; - if ($$sel.pickup(_rl_end_w, 'txt').match(/没有更多/)) { + if (_rl_end_w.content().match(/没有更多/)) { consolex._('列表底部控件描述文本匹配'); break; } @@ -3736,17 +3730,22 @@ let $$init = { } } - function _height() { - consolex._('开始监测列表底部控件屏幕高度'); + function _scrollable() { + consolex._('开始监测列表控件状态'); - while (1) { - sleep(120); - if (_rl_end_w.bounds().height() >= cX(0.04)) { - imagesx.reclaim(_rl_end_w); - consolex._('列表底部控件高度满足条件'); + while (true) { + if (!$$flag.scroll_down_state) { + consolex._('列表底部控件滚动状态满足条件'); + _rl_end_w.recycle(); break; } + // if (_rl_end_w.bounds().height() > cX(0.09)) { + // consolex._('列表底部控件高度满足条件'); + // _rl_end_w.recycle(); + // break; + // } _rl_end_w.refresh(); + sleep(120); } } @@ -3769,26 +3768,26 @@ let $$init = { }), unregistered: new Monitor('未注册检测', function () { while (1) { - if ($$sel.pickup(/.*\u300a.*用户须知.*\u300b,*/)) { - consolex.$(['脚本无法继续', '用户未注册蚂蚁森林'], 8, 4, 0, 2); + if (pickup(/.*\u300a.*用户须知.*\u300b,*/)) { + consolex.$([ '脚本无法继续', '用户未注册蚂蚁森林' ], 8, 4, 0, 2); } sleep(240); } }), pattern_lock: new Monitor('支付宝手势锁', function () { while (1) { - if ($$sel.pickup(/.+\/(AlipayPattern|patternCheck)/)) { - consolex.$(['脚本无法继续', '检测到支付宝手势锁'], 8, 4, 0, 2); + if (pickup(/.+\/(AlipayPattern|patternCheck)/)) { + consolex.$([ '脚本无法继续', '检测到支付宝手势锁' ], 8, 4, 0, 2); } sleep(240); } }), launch_confirm: new Monitor('允许打开', function (tt) { - threadsx.monitor('ensure_open', tt); + threads.start(() => wait('打开', tt, { then: w => w.click() })); }), collect_confirm: new Monitor('立即收取', function () { while (1) { - let _w = $$sel.pickup('立即收取'); + let _w = pickup('立即收取'); _w && a11yx.click(_w, 'w'); sleep(300); } @@ -3799,20 +3798,20 @@ let $$init = { // will stop current script from carrying out a11yx.waitAndClick(() => { - return $$sel.pickup(idMatches(/.*btn_confirm/)) - || $$sel.pickup(/[Aa][Ll]{2}[Oo][Ww]|允许/); - }, tt === undefined ? 2.4e3 : tt || Infinity, 300, {cs$: 'w'}); + return pickup(idMatches(/.*btn_confirm/)) + || pickup(/[Aa][Ll]{2}[Oo][Ww]|允许/); + }, tt === undefined ? 2.4e3 : tt || Infinity, 300, { cs$: 'w' }); }), expand_feed: new Monitor('展开动态列表', function (tt) { let _tt = tt === undefined ? 9e3 : tt || Infinity; let _itv = 240; let _w = null; let _rex = /.*展开(好友)?(动态|列表){1,2}/; - let _sel = () => _w = $$sel.pickup([_rex, {isCenterX: true}]); + let _sel = () => _w = pickup([ _rex, { screenCenterX: true } ]); if (a11yx.wait(_sel, _tt, _itv)) { do { - consolex._('点击' + $$sel.pickup(_w, 'txt').surround('"') + '按钮'); - a11yx.click(_w, 'w', {bt$: _itv}); + consolex._('点击' + _w.content().surround('"') + '按钮'); + a11yx.click(_w, 'w', { bt$: _itv }); } while (!a11yx.wait(() => !_sel(), 600, _itv)); } @@ -3840,7 +3839,7 @@ let $$init = { $$acc.main.ensureAvail(); consolex.$('尝试自动登录主账户', 1, 0, 0, 1); - if (!$$acc.main.login({direct: true})) { + if (!$$acc.main.login({ direct: true })) { consolex.$('主账户登录未成功', 8, 4, 0, 2); } }), @@ -3849,14 +3848,14 @@ let $$init = { // constructor(s) // function Monitor(name, thr_f) { - /** @type {com.stardust.autojs.core.looper.TimerThread} */ + /** @type {org.autojs.autojs.core.looper.TimerThread} */ let _thd = $$app['_threads_' + name]; this.start = function () { if (!this.is_disabled) { this.interruptIFN(); consolex._('开启' + name + '监测线程'); let _args = [].slice.call(arguments); - return _thd = threadsx.start(() => thr_f.apply(global, _args)); + return _thd = threads.start(() => thr_f.apply(global, _args)); } consolex._(name + '监测线程未能开启'); consolex._('监测线程已被禁用'); @@ -3882,11 +3881,11 @@ let $$init = { } }, unlock() { - let _is_scr_on = devicex.is_init_screen_on; + let _is_scr_on = devicex.isInitScreenOn; let _is_unlked = devicex.isUnlocked(); - let _err = m => consolex.$(['脚本无法继续', m], 8, 4, 0, 2); + let _err = m => consolex.$([ '脚本无法继续', m ], 8, 4, 0, 2); - if (!$$cfg.auto_unlock_switch) { + if (!$$cfg.autoUnlockSwitch) { _is_scr_on || _err('屏幕关闭且自动解锁功能未开启'); _is_unlked || _err('设备上锁且自动解锁功能未开启'); } @@ -3907,21 +3906,21 @@ let $$init = { function preRunSetter() { return { trigger() { - if (!$$cfg.prompt_before_running_switch) { + if (!$$cfg.promptBeforeRunningSwitch) { consolex._('"运行前提示"未开启'); return false; } - if (!$$cfg.message_showing_switch) { + if (!$$cfg.messageShowingSwitch) { consolex._('"消息提示"未开启'); return false; } - if ($$app.engines_exec_argv.is_instant_running) { + if ($$app.enginesExecArgv.is_instant_running) { consolex._('跳过"运行前提示"'); consolex._('检测到"立即运行"引擎参数'); return false; } - if ($$cfg.prompt_before_running_auto_skip) { - if (!devicex.is_init_screen_on) { + if ($$cfg.promptBeforeRunningAutoSkip) { + if (!devicex.isInitScreenOn) { consolex._('跳过"运行前提示"'); consolex._('屏幕未亮起'); return false; @@ -3935,38 +3934,35 @@ let $$init = { return true; }, prompt() { - dialogsx.buildCountdown(['运行提示', - '\n即将在 %timeout% 秒内运行' + $$app.task_name + '任务\n', - ['推迟任务', 'warn'], ['放弃任务', 'caution'], ['立即开始', 'attraction'], 1, + dialogsx.buildCountdown([ '运行提示', + '\n即将在 %timeout% 秒内运行' + $$app.taskName + '任务\n', + [ '推迟任务', 'warn' ], [ '放弃任务', 'caution' ], [ '立即开始', 'attraction' ], 1, ], { - timeout: $$cfg.prompt_before_running_countdown_seconds, + timeout: $$cfg.promptBeforeRunningCountdownSeconds, timeout_button: 'positive', onNeutral(d) { - let _ = { - key: 'prompt_before_running_postponed_minutes', - }; let _cfg = { /** @return {number[]} */ - sto_min_map: [-1].concat($$cfg[_.key + '_choices']), + sto_min_map: [ -1 ].concat($$cfg.promptBeforeRunningPostponedMinutes), /** @return {number} */ get sto_min() { - return Number($$cfg[_.key]); + return Number($$cfg.promptBeforeRunningPostponedMinute); }, /** @param {number} v */ set sto_min(v) { let _new = {}; - _new[_.key] = v; + _new.promptBeforeRunningPostponedMinute = v; storagesx.af_cfg.put('config', _new); Object.assign($$cfg, _new); }, /** @return {number} */ get user_min() { - return Number($$cfg[_.key + '_user']); + return Number($$cfg.promptBeforeRunningPostponedMinuteUser); }, /** @param {number} v */ set user_min(v) { let _new = {}; - _new[_.key + '_user'] = v; + _new.promptBeforeRunningPostponedMinuteUser = v; storagesx.af_cfg.put('config', _new); Object.assign($$cfg, _new); }, @@ -3974,15 +3970,15 @@ let $$init = { if (!isNaN(_cfg.sto_min) && _cfg.sto_min !== 0) { d.dismiss(); return $$app.monitor.insurance.clean({ - is_async: true, + isAsync: true, callback: () => $$app.setPostponedTask(_cfg.sto_min), }).reset(); } let _minutes = _cfg.sto_min_map; // [-1, 1, 2, 5, 10, ...] dialogsx - .builds(['设置任务推迟时间', '', - 0, 'B', ['K', 'warn'], - 1, '记住设置且不再提示'], { + .builds([ '设置任务推迟时间', '', + 0, 'B', [ 'K', 'warn' ], + 1, '记住设置且不再提示' ], { items: _minutes.map(x => x > 0 ? x + ' min' : { '-1': '息屏时', }[x]), @@ -3999,7 +3995,7 @@ let $$init = { _cfg.sto_min = _cfg.user_min; } if ($$app.monitor.insurance.trigger()) { - $$app.monitor.insurance.clean({is_async: true}).reset(); + $$app.monitor.insurance.clean({ isAsync: true }).reset(); } $$app.setPostponedTask(_cfg.user_min); }) @@ -4010,28 +4006,28 @@ let $$init = { d.dismiss(); $$app.tidy(0); // language=JS - consolex.$(`放弃${$$app.task_name}任务`, 1, 1, 0, 2); + consolex.$(`放弃${$$app.taskName}任务`, 1, 1, 0, 2); exit(); }; - if (!$$cfg.prompt_before_running_quit_confirm) { + if (!$$cfg.promptBeforeRunningQuitConfirm) { return _quitNow(); } dialogsx.builds((function $iiFe() { // language=JS - let _z = `当前未设置任何${$$app.task_name}定时任务\n\n`; + let _z = `当前未设置任何${$$app.taskName}定时任务 `; let _q = '确认要放弃本次任务吗'; - let [_title, _cnt] = timersx.queryTimedTasks({path: $$app.cwp}) + let [ _title, _cnt ] = tasks.queryTimedTasks({ path: $$app.cwp }) .filter(task => task.id !== $$app.monitor.insurance.id).length - ? [['提示', 'default'], [_q, 'default']] - : [['注意', 'caution'], [_z + _q, 'warn']]; - return [_title, _cnt, 0, 'B', ['确认放弃任务', 'caution'], 1, 1]; + ? [ [ '提示', 'default' ], [ _q, 'default' ] ] + : [ [ '注意', 'caution' ], [ _z + _q, 'warn' ] ]; + return [ _title, _cnt, 0, 'B', [ '确认放弃任务', 'caution' ], 1, 1 ]; })()).on('negative', (ds) => { dialogsx.dismiss(ds); }).on('positive', (ds) => { dialogsx.dismiss(ds); storagesx.af_cfg.put('config', { - prompt_before_running_quit_confirm: !ds.isPromptCheckBoxChecked(), + promptBeforeRunningQuitConfirm: !ds.isPromptCheckBoxChecked(), }); _quitNow(); }).show(); @@ -4040,10 +4036,10 @@ let $$init = { d.dismiss(); }, onPause: { - content: [/.*(".+".*任务).*/, '选择$1运行选项'], + content: [ /.*(".+".*任务).*/, '选择$1运行选项' ], }, onTimeout() { - consolex._(['运行提示计时器超时', '任务自动继续']); + consolex._([ '运行提示计时器超时', '任务自动继续' ]); return 'positive'; }, }).act().block({ @@ -4051,7 +4047,7 @@ let $$init = { onTimeout() { $$app.tidy(1); consolex.$([ - '强制结束' + $$app.task_name + '任务', + '强制结束' + $$app.taskName + '任务', '等待运行提示对话框操作超时', ], 8, 4, 0, 2); }, @@ -4069,7 +4065,7 @@ let $$init = { // tool function(s) // function cmdSetter() { - let _cmd = $$app.engines_exec_argv.cmd; + let _cmd = $$app.enginesExecArgv.cmd; /** * @typedef { * 'launch_rank_list'|'get_rank_list_names'|'get_current_acc_name' @@ -4077,7 +4073,7 @@ let $$init = { */ let _commands = { launch_rank_list() { - $$app.page.rl.launch({is_show_greeting: false}); + $$app.page.rl.launch({ is_show_greeting: false }); _quit('app'); }, get_rank_list_names() { @@ -4087,21 +4083,21 @@ let $$init = { // tool function(s) // function _launch() { - timersx.rec.save('get_rl_data'); - return $$app.page.rl.launch({is_show_greeting: false}); + recorder.save('get_rl_data'); + return $$app.page.rl.launch({ is_show_greeting: false }); } function _collect() { - $$app.task_name = '好友列表数据采集'.surround('"'); + $$app.taskName = '好友列表数据采集'.surround('"'); consolex.$('正在采集好友列表数据', 1, 1, 0, 2); - $$af.rl.scroll.toBottom({itv: 0}); + $$af.rl.scroll.toBottom({ itv: 0 }); let _ls_data = _getListData(); storagesx.af.remove('friends_list_data'); // discarded data storagesx.af_flist.put('friends_list_data', _ls_data); - let _et = $$cvt.time(timersx.rec('get_rl_data'), '$zh'); + let _et = $$cvt.time(recorder('get_rl_data'), '$zh'); let _sum = _ls_data.list_length + ' 项'; consolex.$('采集完毕', 1, 1, 0, -1); consolex.$('用时 ' + _et, 1, 0, 1); @@ -4112,10 +4108,10 @@ let $$init = { function _getListData() { let _fri = $$af._collector.fri; let _data = []; - $$sel.get('energy_amt', 'wc').slice(1).forEach((w, i) => { - let _nick = $$sel.pickup([w, _fri.getRlNickCompass(w)], 'txt'); - let _rank = i < 3 ? i + 1 : $$sel.pickup([w, _fri.getRlRankNum(w)], 'txt'); - _data.push({rank_num: _rank.toString(), nickname: _nick}); + pickup([ /^\s*\d+(\.\d+)?(k?g|t)\s*$/, { currentApp: 'alipay' } ], 'w[]').slice(1).forEach((w, i) => { + let _nick = detect(w, _fri.getRlNickCompass(w), 'txt'); + let _rank = i < 3 ? i + 1 : detect(w, _fri.getRlRankNum(w), 'txt'); + _data.push({ rank_num: _rank.toString(), nickname: _nick }); }); let _max_len = _data[_data.length - 1].rank_num.length; @@ -4131,7 +4127,7 @@ let $$init = { } }, get_current_acc_name() { - timersx.rec.save('cur_acc_nm'); + recorder.save('cur_acc_nm'); let _name = _byPipeline() || ''; consolex.$('采集完毕'); @@ -4140,7 +4136,7 @@ let $$init = { storagesx.af.remove(_sto_key); storagesx.af.put(_sto_key, _name); - let _et = $$cvt.time(timersx.rec('cur_acc_nm'), '$zh'); + let _et = $$cvt.time(recorder('cur_acc_nm'), '$zh'); consolex.$('用时 ' + _et, 1, 0, 1); _quit(); @@ -4149,8 +4145,8 @@ let $$init = { function _byPipeline() { let _name = ''; - let _thd_get_name = threadsx.start(_thdGetName); - let _thd_mon_logout = threadsx.start(_thdMonLogout); + let _thd_get_name = threads.start(_thdGetName); + let _thd_mon_logout = threads.start(_thdMonLogout); a11yx.wait(() => _name || $$flag.acc_logged_out, 12e3); @@ -4169,20 +4165,20 @@ let $$init = { // thread function(s) // function _thdGetName() { - $$app.task_name = '采集当前账户名'.surround('"'); + $$app.taskName = '采集当前账户名'.surround('"'); $$app.page.alipay.home(); consolex.$('正在采集当前账户名', 1, 0, 0, -1); a11yx.pipeline('支付宝个人主页', [ - ['我的', 'k1'], + [ '我的', 'k1' ], idMatches(/.*userinfo_view/), - ['个人主页', 'k4'], + [ '个人主页', 'k4' ], '支付宝账户', ]); let _txt = ''; - let _sel = () => $$sel.pickup(['支付宝账户', 's>1'], 'txt'); + let _sel = () => pickup('支付宝账户', 's>1', 'txt'); a11yx.wait(() => _txt = _sel(), 2e3); return _name = _txt ? $$acc.encode(_txt) : ''; @@ -4211,7 +4207,7 @@ let $$init = { } }, exec() { - consolex._(['执行传递指令:', _cmd]); + consolex._([ '执行传递指令:', _cmd ]); _commands[_cmd](); sleep(4e3); }, @@ -4222,7 +4218,7 @@ let $$init = { /** @param {...('alipay'|'app')} [aim] */ function _quit(aim) { let _aim = Array.from(arguments, s => s.toLowerCase()); - _aim = _aim.length ? _aim : ['alipay', 'app']; + _aim = _aim.length ? _aim : [ 'alipay', 'app' ]; _aim.includes('alipay') && $$app.page.alipay.close(); _aim.includes('app') && ui.post(exit); } @@ -4234,7 +4230,7 @@ let $$af = { _launcher: { greet() { // language=JS - consolex.$(`开始${$$app.task_name}任务`, 1, 1, 0, 2); + consolex.$(`开始${$$app.taskName}任务`, 1, 1, 0, 2); return this; }, @@ -4244,7 +4240,7 @@ let $$af = { emount_c_own: 0, // c: collected emount_c_fri: 0, stroll: { - max_cnt_cycle: $$cfg.max_continuous_not_targeted_stroll_cycle, + max_cnt_cycle: $$cfg.strollNotTargetedLimit, ignored: { samples: {}, add(sample) { @@ -4256,14 +4252,15 @@ let $$af = { this.samples = {}; }, getMaxCount() { - return Math.maxi(Object.values(this.samples)); + return Mathx.max(Object.values(this.samples)); }, }, locate(cache_fg) { if (this.pt && cache_fg) { return this.pt; } - return this.pt = _byColorMatch() || _byRelativeWidget(); + // return this.pt = _byColorMatch() || _byRelativeWidget(); + return this.pt = [ cX(0.91), cYx(1520, 1096) ]; // tool function(s) // @@ -4277,21 +4274,21 @@ let $$af = { let _xA = cX(-26), _x0 = 0, _x1 = cX(29), _x2 = cX(58); let _yA = cYx(-24), _y0 = 0, _y1 = cYx(24), _y2 = cYx(34); - let _main = colorsx.toInt($$cfg.stroll_btn_locate_main_color); - - return images.findMultiColors(imagesx.capt(), _main, [ - [_x0, _yA, _main], // O1 - [_x1, _yA, _main], // O2 - [_x2, _yA, _main], // O3 - [_xA, _y0, _main], // O4 - [_x2, _y0, _main], // O5 - [_x0, _y1, _main], // O6 - [_x1, _y1, _main], // O7 - [_x2, _y1, _main], // O8 - [_x0, _y2, -1], // W1 - [_x1, _y2, -1], // W2 - [_x2, _y2, -1], // W3 - ], {threshold: $$cfg.stroll_btn_match_threshold}); + let _main = colors.toInt($$cfg.strollButtonLocateMainColor); + + return images.findMultiColors(images.captureScreen().oneShot(), _main, [ + [ _x0, _yA, _main ], // O1 + [ _x1, _yA, _main ], // O2 + [ _x2, _yA, _main ], // O3 + [ _xA, _y0, _main ], // O4 + [ _x2, _y0, _main ], // O5 + [ _x0, _y1, _main ], // O6 + [ _x1, _y1, _main ], // O7 + [ _x2, _y1, _main ], // O8 + [ _x0, _y2, -1 ], // W1 + [ _x1, _y2, -1 ], // W2 + [ _x2, _y2, -1 ], // W3 + ], { threshold: $$cfg.strollButtonMatchThreshold }); } function _byRelativeWidget() { @@ -4308,25 +4305,30 @@ let $$af = { }); let _bottoms = Object.keys(_b_ctr) - .map(b => [b, _b_ctr[b]]) + .map(b => [ b, _b_ctr[b] ]) .sort((a, b) => a[1] === b[1] ? 0 : a[1] < b[1] ? 1 : -1)[0]; if (_bottoms && _bottoms.length) { - return [W - cX(50), _bottoms[0] - cYx(50)]; + return [ W - cX(50), _bottoms[0] - cYx(50) ]; } } }, click() { if (this.pt || this.locate()) { - return a11yx.click(this.pt, 'p', {pt$: 64, bt$: 500}); + return a11yx.click(this.pt, 'p', { pt$: 64, bt$: 500 }); } }, - isSlake() { - return this.isInSlakePage() || this.isMaxCntCycleReached(); + isEnding() { + return this.isInEndingPage() || this.isMaxCntCycleReached(); }, - isInSlakePage() { - let _sltr = [/.*返回.*森林.*/, {clickable: true}]; - return $$sel.pickup(_sltr, 'exists', {refresh: true}) + isInEndingPage() { + return pickup([ /共找到能量/, { + screenCenterX: true, + } ], '?') + || pickup([ /返回.*森林/, { + screenCenterX: true, + clickable: true, + } ], '?') || pluginsx.af.energy_rain.isInPage(); }, isMaxCntCycleReached() { @@ -4339,7 +4341,7 @@ let $$af = { this._is_disabled = true; }, trigger() { - return $$cfg.get_targets_by_stroll_btn && !this.isDisabled(); + return $$cfg.getTargetsByStrollButton && !this.isDisabled(); }, reset() { this.ignored.reset(); @@ -4392,7 +4394,7 @@ let $$af = { // CAUTION: // ! imagesx.capt() contains imagesx.permit() // ! however, which is not recommended to be used - // ! within Java Thread at the first time, + // ! within Java Thread at the first time // ! as capture permission will be forcibly interrupted // ! with this thread killed in a short time (about 300ms) imagesx.permit(); @@ -4400,7 +4402,12 @@ let $$af = { function _language() { let _tt = ''; - let _sel = () => _tt = $$sel.get('af_title', 'txt'); + let _sel = () => { + let w = $$sel.get('af_title'); + if (w) { + return _tt = w.content(); + } + }; let _chs = '简体中文'; @@ -4432,22 +4439,22 @@ let $$af = { // appx.startActivity($$app.intent.general); - return a11yx.pipeline(_chs + '语言切换', [[ + return a11yx.pipeline(_chs + '语言切换', [ [ 'Me', 'k2', ], { - locator: ['Settings', {boundsInside: [cX(0.8), 0, W, cYx(0.2)]}, 'k2'], + locator: [ 'Settings', { boundsInside: [ cX(0.8), 0, W, cYx(0.2) ] }, 'k2' ], strategy: 'click', }, [ 'General', 'k4', ], [ 'Language', 'k4', ], { - locator: [_chs, 'k4'], - condition: () => $$sel.pickup([_chs, 'p3'], 'children').length > 1, + locator: [ _chs, 'k4' ], + condition: () => pickup(_chs, 'p3', 'children').length > 1, }, { locator: 'Save', condition: 'disappear', - }]); + } ]); } // tool function(s) // @@ -4486,9 +4493,8 @@ let $$af = { _getEmount(buf) { let _amt; let _max = buf ? 10 : 1; - let _body = [/\d+g/, {bi$: [cX(0.6), 0, W, cYx(0.24)]}]; while (1) { - _amt = $$sel.pickup(_body, 'txt').match(/\d+/); + _amt = pickup([ /\d+g/, { boundsInside: [ cX(0.6), 0, W, cYx(0.24) ] } ], '$').match(/\d+/); _amt = $$arr(_amt) ? Number(_amt[0]) : _amt; if ($$num(_amt) || !--_max) { break; @@ -4498,7 +4504,7 @@ let $$af = { return _max < 0 ? -1 : _amt; }, trigger() { - if ($$cfg.self_collect_switch) { + if ($$cfg.selfCollectSwitch) { $$af.own = this; return true; } @@ -4517,8 +4523,8 @@ let $$af = { } $$af.min_ctd.own.reset(); - $$af.thrd_mon_own = $$cfg.homepage_monitor_threshold; - $$af.thrd_bg_mon_own = $$cfg.homepage_bg_monitor_threshold; + $$af.thrd_mon_own = $$cfg.homepageMonitorThreshold; + $$af.thrd_bg_mon_own = $$cfg.homepageBackgroundMonitorThreshold; return this; }, @@ -4554,7 +4560,7 @@ let $$af = { } function _ripeBalls() { - _collectRipeBalls({is_cache: true}); + _collectRipeBalls({ is_cache: true }); } function _countdown() { @@ -4567,11 +4573,11 @@ let $$af = { // tool function(s) // function _isSwitchOn() { - let _cA = $$cfg.homepage_background_monitor_switch; - let _cB1 = $$cfg.timers_switch; - let _cB2a = $$cfg.homepage_monitor_switch; - let _cB2b1 = $$cfg.timers_self_manage_switch; - let _cB2b2 = $$cfg.timers_countdown_check_own_switch; + let _cA = $$cfg.homepageBackgroundMonitorSwitch; + let _cB1 = $$cfg.timersSwitch; + let _cB2a = $$cfg.homepageMonitorSwitch; + let _cB2b1 = $$cfg.timersSelfManageSwitch; + let _cB2b2 = $$cfg.timersCountdownCheckOwnSwitch; let _cB2b = _cB2b1 && _cB2b2; let _cB2 = _cB2a || _cB2b; let _cB = _cB1 && _cB2; @@ -4583,7 +4589,7 @@ let $$af = { consolex._('开始检测自己能量球最小倒计时'); $$af.min_ctd.own.reset(); - let _nor_balls = $$af.eballs('naught', {is_cache: true}); + let _nor_balls = $$af.eballs('naught', { is_cache: true }); let _len = _nor_balls.length; if (!_len) { consolex._('未发现未成熟的能量球'); @@ -4591,9 +4597,9 @@ let $$af = { } consolex._('找到自己未成熟能量球: ' + _len + '个'); - let _t_spot = timersx.rec.save('ctd_own'); + let _t_spot = recorder.save('ctd_own'); // timestamp until next ripe - let _min_own = Math.mini(_getOwnRipeTs()); + let _min_own = Mathx.min(_getOwnRipeTs()); if (!$$num(_min_own) || _min_own <= 0) { consolex._('自己能量最小倒计时数据无效', 3); @@ -4606,11 +4612,11 @@ let $$af = { $$af.min_ctd.own.value = _min_own; - let _t = timersx.rec('ctd_own', _min_own) / 60e3; - consolex._('自己能量最小倒计时: ' + _t.toFixedNum(2) + '分钟'); + let _t = recorder('ctd_own', _min_own) / 60e3; + consolex._('自己能量最小倒计时: ' + Numberx.toFixedNum(_t, 2) + '分钟'); consolex._('时间: ' + $$cvt.date(_min_own)); - let _cA = $$cfg.homepage_monitor_switch; + let _cA = $$cfg.homepageMonitorSwitch; let _cB = _t <= $$af.thrd_mon_own; if (_cA && _cB) { consolex._('触发成熟能量球监测条件'); @@ -4621,14 +4627,14 @@ let $$af = { // tool function(s) // function _getOwnRipeTs() { - timersx.rec.save('ctd_data'); + recorder.save('ctd_data'); let _alive = thd => thd && thd.isAlive(); let _kill = thd => thd && thd.interrupt(); let _ctd_data = []; - let _thd_ocr = threadsx.start(_thdOcr); - let _thd_toast = threadsx.start(_thdToast); + let _thd_ocr = threads.start(_thdOcr); + let _thd_toast = threads.start(_thdToast); _thd_toast.join(1.5e3); @@ -4639,7 +4645,7 @@ let $$af = { } let _tt = 9e3; - _thd_ocr.join(_tt - timersx.rec('ctd_data')); + _thd_ocr.join(_tt - recorder('ctd_data')); if (_alive(_thd_ocr)) { _kill(_thd_ocr); @@ -4649,22 +4655,28 @@ let $$af = { : consolex.$('最小倒计时数据获取失败', 3, 0, 0, 1); } - return _ctd_data.map((str) => { - let _mch = (str || '').toString().match(/\d+:\d+/); - if (!_mch) { + let parseCountdown = (str) => { + let matched = (str || '').toString().match(/\d+:\d+|(\d+小?时)?\s*(\d+分钟?)?/); + if (!matched || matched[0].length === 0) { consolex.$('无效字串:', 3); consolex.$(str, 3); return Infinity; } - let _t_str = _mch[0]; - let [_hh, _mm] = _t_str.split(':').map(x => +x); - let _m = _hh * 60 + _mm; + let timeStr = (/\d+:\d+/.test(matched[0])) + ? matched[0] + : matched[0].replace(/.*?(?:(\d+)小?时)?\s*(?:(\d+)分钟?)?.*/, ($, $1, $2) => { + return `${($1 || '0').padStart(2, '0')}:${($2 || '0').padStart(2, '0')}`; + }); + let [ hh, mm ] = timeStr.split(':').map(x => +x); + let minutes = hh * 60 + mm; + + consolex._('[ ' + timeStr + ' ] -> ' + minutes + ' min'); - consolex._('[ ' + _t_str + ' ] -> ' + _m + ' min'); + return _t_spot + minutes * 60e3; + }; - return _t_spot + _m * 60e3; - }).filter(isFinite); + return _ctd_data.map(parseCountdown).filter(isFinite); // thread function(s) // @@ -4673,7 +4685,7 @@ let $$af = { let _capt = imagesx.capt(); - let [_cl, _ct, _cr, _cb] = $$cfg.energyBallsRecognitionRegion + let [ _cl, _ct, _cr, _cb ] = $$cfg.energyBallsRecognitionRegion .map((v, i) => i % 2 ? cYx(v, true) : cX(v, true)); let _clip = images.clip(_capt, _cl, _ct, _cr - _cl, _cb - _ct); @@ -4747,7 +4759,7 @@ let $$af = { consolex._('已开启倒计时数据Toast监控线程'); let _ctd = _nor_balls.map((o) => { - a11yx.click(o, 'p', {pt$: $$cfg.forest_balls_click_duration}); + a11yx.click(o, 'p', { pt$: $$cfg.forestBallsClickDuration }); return eventsx.getToasts(/才能收取/, alipay.package_name); }).flat(Infinity); @@ -4773,8 +4785,8 @@ let $$af = { let _max_mm = (_max_ts - $$app.ts) / 60e3; toast(_msg_start, 'long'); consolex._(_msg_start); - consolex._('最大超时时间: ' + _max_mm.toFixedNum(2) + '分钟'); - timersx.rec.save('monitor_own'); + consolex._('最大超时时间: ' + Numberx.toFixedNum(_max_mm, 2) + '分钟'); + recorder.save('monitor_own'); let _max_on = $$af.thrd_mon_own * 60e3 + 6e3; $$app.monitor.af_home_in_page.start(); @@ -4785,7 +4797,7 @@ let $$af = { if ($$flag.af_home_in_page) { // ripe balls recognition will be performed // in some fixed area(s) without new captures - let _opt = {is_fixed: true, isDebug: false}; + let _opt = { is_fixed: true, isDebug: false }; if (_getAndCollectRipeBalls(_opt)) { $$flag.monitor_home_ripe_captured = true; break; @@ -4797,9 +4809,9 @@ let $$af = { if (!$$flag.af_home_in_page) { consolex.$('主页能量球未点击且页面不满足', 3, 3, 0, -2); } else { - consolex.$(['等待主页能量球成熟超时', '尝试点击全部能量球'], 3, 0, 0, -2); - let _nor_balls = $$af.eballs('naught', {is_cache: true}); - _collectRipeBalls(_nor_balls, {isDebug: false}); + consolex.$([ '等待主页能量球成熟超时', '尝试点击全部能量球' ], 3, 0, 0, -2); + let _nor_balls = $$af.eballs('naught', { is_cache: true }); + _collectRipeBalls(_nor_balls, { isDebug: false }); } } @@ -4814,7 +4826,7 @@ let $$af = { toast(_msg_fin, 'long'); consolex._(_msg_fin); consolex._('本次监测收取结果: ' + ($$af.emount_c_own - _old_em) + 'g'); - consolex._('监测用时: ' + $$cvt.time(timersx.rec('monitor_own'), '$zh')); + consolex._('监测用时: ' + $$cvt.time(recorder('monitor_own'), '$zh')); // speculated helpful for _thdToast() within which // toast message didn't show up after a11yx.click() @@ -4826,21 +4838,21 @@ let $$af = { let _fg = +$$flag.af_home_in_page; if (_debug_page_state_flip !== _fg) { _debug_page_state_flip = _fg; - timersx.rec.gt('monitor_own', 1e3) && consolex._(_fg - ? ['当前页面满足森林主页条件', '继续监测自己能量'] - : ['当前页面不满足森林主页条件', '暂停监测自己能量']); + recorder.isGreaterThan('monitor_own', 1e3) && consolex._(_fg + ? [ '当前页面满足森林主页条件', '继续监测自己能量' ] + : [ '当前页面不满足森林主页条件', '暂停监测自己能量' ]); } } } } function _waterBalls() { - if (!$$cfg.homepage_wball_switch) { + if (!$$cfg.homepageWaterBallSwitch) { consolex._('浇水回赠球检测未开启'); return false; } consolex._('开始检测浇水回赠能量球'); - let _wb_cache = $$af.eballs('water', {is_cache: true}); + let _wb_cache = $$af.eballs('water', { is_cache: true }); let _ctr = 0; let _lmt = { trigger() { @@ -4848,7 +4860,7 @@ let $$af = { return --this.counter < 0; }, reset() { - this.counter = $$cfg.homepage_wball_check_limit; + this.counter = $$cfg.homepageWaterBallCheckLimit; }, shrink() { this.counter = 1; @@ -4905,15 +4917,15 @@ let $$af = { } function _fetch(o) { - timersx.rec.save('fetch_wballs'); - a11yx.click(o, 'p', {pt$: $$cfg.forest_balls_click_duration}); + recorder.save('fetch_wballs'); + a11yx.click(o, 'p', { pt$: $$cfg.forestBallsClickDuration }); if (_stableEmount()) { _ctr += 1; } else { _lmt.shrink(); - consolex._(['浇水回赠能量球点击超时', '可能是能量球误匹配']); + consolex._([ '浇水回赠能量球点击超时', '可能是能量球误匹配' ]); } - sleep(300 - timersx.rec('fetch_wballs')); + sleep(300 - recorder('fetch_wballs')); } } @@ -4935,17 +4947,17 @@ let $$af = { } let _opt = options || {}; let _noRipeBalls = () => { - return !_getRipeBallsData({isDebug: false}).length; + return !_getRipeBallsData({ isDebug: false }).length; }; let _debug = (m, lv) => _opt.isDebug === false || consolex._(m, lv); - let _itv = $$cfg.forest_balls_click_interval; - let _du = $$cfg.forest_balls_click_duration; + let _itv = $$cfg.forestBallsClickInterval; + let _du = $$cfg.forestBallsClickDuration; let _max = 4; do { _debug('点击自己成熟能量球: ' + _balls.length + '个'); - _balls.forEach(o => a11yx.click(o, 'p', {pt$: _du, bt$: _itv})); + _balls.forEach(o => a11yx.click(o, 'p', { pt$: _du, bt$: _itv })); if (!_stableEmount()) { _debug('自己能量的增量数据无效'); break; // timed out or mismatched @@ -4973,10 +4985,10 @@ let $$af = { isDebug: _o.isDebug, }, o); let _ = { - cache: () => $$af.eballs('ripe', _wrapOpt({is_cache: true})), - refresh: () => $$af.eballs('ripe', _wrapOpt({is_cache: false})), + cache: () => $$af.eballs('ripe', _wrapOpt({ is_cache: true })), + refresh: () => $$af.eballs('ripe', _wrapOpt({ is_cache: false })), fixed() { - let _cache = $$af.eballs('all', _wrapOpt({is_cache: true})); + let _cache = $$af.eballs('all', _wrapOpt({ is_cache: true })); if (!_cache.length) { this.refresh(); _cache = this.cache(); @@ -4984,7 +4996,7 @@ let $$af = { let _res = []; if (_cache.length) { let _capt = imagesx.capt(); - _cache.forEach(o => afrst.isRipeBall(o, {capt: _capt, container: _res})); + _cache.forEach(o => afrst.isRipeBall(o, { capt: _capt, container: _res })); } return _res; }, @@ -5008,7 +5020,7 @@ let $$af = { function _stableEmount() { let _t = $$af.emount_t_own; let _getEm = buf => _own._getEmount(buf); - let _i = a11yx.waitAndStable(_getEm, 3e3, {reference: _t}) - _t; + let _i = a11yx.waitAndStable(_getEm, 3e3, { reference: _t }) - _t; if (_i > 0 && !isNaN(_i)) { $$af.emount_t_own += _i; $$af.emount_c_own += _i; @@ -5027,7 +5039,7 @@ let $$af = { consolex._('无能量球可收取'); } else { consolex._('共计收取: ' + _em + 'g'); - $$db.insert(['%SELF%', $$app.ts_sec, _em]); + $$db.insert([ '%SELF%', $$app.tsSeconds, _em ]); } consolex._('自己能量检查完毕'); } @@ -5053,7 +5065,14 @@ let $$af = { 'p2c2>0>0', // legacy ], condition(w, c) { - return w && !$$sel.pickup([w, c], 'txt').match(/^\s*$/); + // return w && !detect(w, c, 'txt').match(/^\s*$/); + if (!w) { + return false; + } + let r = detect(w, c, 'txt'); + if (r) { + return !r.match(/^\s*$/); + } }, }, rank: { @@ -5062,13 +5081,13 @@ let $$af = { 'p2c0>0', // legacy ], condition(w, c) { - let _s = w && $$sel.pickup([w, c], 'txt'); + let _s = w && detect(w, c, 'txt'); return _s && _s.match(/^\s*\d+\s*$/); }, }, }, _getRlCompass(w, key) { - let {presets, condition} = this._rl_compass[key]; + let { presets, condition } = this._rl_compass[key]; for (let c of presets) { if (condition(w, c)) { return c; @@ -5081,7 +5100,7 @@ let $$af = { return this.rl_samples; } - let _wc = $$sel.pickup(new RegExp('\\d+\u2019'), 'wc'); + let _wc = pickup(new RegExp('\\d+\u2019'), 'w[]'); consolex._('捕获好友能量倒计时数据: ' + _wc.length + '项'); return _parseWidgets.call(this); @@ -5091,10 +5110,10 @@ let $$af = { function _parseWidgets() { let _smp = {}; _wc.forEach((w) => { - let _mm = Number($$sel.pickup(w, 'txt').match(/\d+/)[0]); + let _mm = Number(w.content().match(/\d+/)[0]); if (_mm) { let _c = this.getRlNickCompass(w); - let _nick = $$sel.pickup([w, _c], 'txt', {default: '?_nick'}); + let _nick = detect(w, _c, 'txt') || '?_nick'; _smp[_nick] = { ts: $$app.ts + _mm * 60e3, minute: _mm, @@ -5127,7 +5146,7 @@ let $$af = { consolex._('好友能量最小倒计时: ' + _min_mm + '分钟'); consolex._('时间数据: ' + $$cvt.date(_min_ctd)); consolex._('好友能量最小倒计时检测完毕'); - return _min_mm <= $$cfg.rank_list_review_threshold; + return _min_mm <= $$cfg.rankListReviewThreshold; } consolex._('好友倒计时数据无效: ' + _min_mm, 3); } @@ -5146,7 +5165,7 @@ let $$af = { start() { let _fri = $$af._collector.fri; this.isAlive() && this.interrupt(); - this._thd = threadsx.start(function () { + this._thd = threads.start(function () { consolex._('已开启好友森林信息采集线程'); $$app.page.fri.pool.clear(); @@ -5188,7 +5207,7 @@ let $$af = { }, }, trigger() { - return $$cfg.friend_collect_switch; + return $$cfg.friendCollectSwitch; }, init() { consolex._($$flag.rl_review ? '开始复查好友能量' : '开始检查好友能量'); @@ -5207,24 +5226,24 @@ let $$af = { let _own = this.parent.own; let _rl = $$app.page.rl; - let _lmt = _limitationSetter(); + let _lmt = limitationSetter(); - while (1) { + while (!quit()) { if (_awake()) { return _reboot(); } if (_scan()) { void _gather(); } - if (_quit()) { + if (quit()) { break; } - if (_roll()) { - void _swipe(); + if (roll()) { + void swipe(); } } - _review() ? _reboot() : _fin(); + _review() ? _reboot() : fin(); // tool function(s) // @@ -5261,27 +5280,27 @@ let $$af = { } function _scanRankList() { - let _color_pick = $$cfg.friend_collect_icon_color; + let _color_pick = $$cfg.friendCollectIconColor; let _prop = { pick: { act_desc: '收取', color: _color_pick, - col_thrd: $$cfg.friend_collect_icon_threshold, + col_thrd: $$cfg.friendCollectIconThreshold, mult_col: (function $iiFe() { let _mult = [ - [cX(38), cYx(35), _color_pick], - [cX(23), cYx(26), -1], + [ cX(38), cYx(35), _color_pick ], + [ cX(23), cYx(26), -1 ], ]; // from E6683 for (let i = 16; i <= 24; i += (4 / 3)) { - _mult.push([cX(i), cY(i - 6), -1]); + _mult.push([ cX(i), cY(i - 6), -1 ]); } // from E6683 for (let i = 16; i <= 24; i += (8 / 3)) { - _mult.push([cX(i), cY(i / 2 + 16), -1]); + _mult.push([ cX(i), cY(i / 2 + 16), -1 ]); } return _mult; @@ -5302,9 +5321,9 @@ let $$af = { }, }; - _fri.targets = [_getTar('pick')]; + _fri.targets = [ _getTar('pick') ]; - return Math.sum(_fri.targets.map(x => x.length)); + return Mathx.sum(_fri.targets.map(x => x.length)); // tool function(s) // @@ -5349,24 +5368,25 @@ let $$af = { function _gather() { //// -=-= PENDING =-=- //// - $$af.stroll.trigger() ? _byStroll() : _byRankList(); + $$af.stroll.trigger() ? byStroll() : byRankList(); // tool function(s) // - function _title() { + function title() { let _title = ''; let _ctr = 0; a11yx.wait(() => { _ctr++ % 25 || a11yx.service.refreshServiceInfo(); - return _title = $$sel.get('fri_tt', 'txt') || ''; + let w = $$sel.get('fri_tt'); + return _title = w && w.content() || ''; }, 18e3, 80); $$af.nick = _title.replace(/的蚂蚁森林$/, ''); } - function _intro() { + function intro() { consolex.debug.__(); if ($$af.nick) { - $$app.fri_drop_by.ic($$af.nick); + $$app.friendDropBy.ic($$af.nick); consolex.$($$af.nick.surround('[ ')); } else { consolex.$('标题采集好友昵称超时', 3, 1); @@ -5374,46 +5394,46 @@ let $$af = { consolex.debug.__(); } - function _collect() { + function collect() { do { - if (!_inBlist() && _ready()) { - _monitor(); - !_cover() && _harvest(); + if (!inBlist() && ready()) { + monitor(); + !shield() && harvest(); } - } while (_reentry()); + } while (reentry()); // main function(s) // - function _inBlist() { + function inBlist() { if ($$app.blist.contains($$af.nick)) { - $$app.fri_drop_by.dc($$af.nick); + $$app.friendDropBy.dc($$af.nick); return true; } } - function _ready() { + function ready() { _fri.thd_info_collect.interrupt(); return $$app.page.fri.getReady(); } - function _monitor() { + function monitor() { $$app.monitor.expand_feed.start(); _fri.thd_info_collect.start(); } - function _cover() { - let _is_covered = false; - let _cover = $$app.page.fri.cover; - _cover.ready(); - _cover.detect() && _handle(); + function shield() { + let hasShield = false; + let shield = $$app.page.fri.shield; + shield.ready(); + shield.detect() && handle(); - return _is_covered; + return hasShield; // tool function(s) // - function _handle() { + function handle() { consolex._('颜色识别检测到保护罩'); - _is_covered = true; + hasShield = true; consolex._('终止好友森林信息采集线程'); _fri.thd_info_collect.interrupt(); @@ -5423,7 +5443,7 @@ let $$af = { } let _w_cvr = null; - let _thd_auto_expand = threadsx.start(_autoExpand); + let _thd_auto_expand = threads.start(_autoExpand); _getTs() && _addBlist(); @@ -5436,11 +5456,11 @@ let $$af = { let _ctr = 0; let _w = null; - if (!a11yx.wait(() => _w = $$sel.pickup(/.*加载更多\s*/), 3e3)) { + if (!a11yx.wait(() => _w = pickup(/.*加载更多\s*/), 3e3)) { consolex._('定位"加载更多"按钮超时', 3); return false; } - consolex._('成功定位' + $$sel.pickup(_w, 'txt').surround('"') + '按钮'); + consolex._('成功定位' + _w.content().surround('"') + '按钮'); while (_ctr++ < 50) { a11yx.waitAndClick(_w, 3e3, 120, { @@ -5453,7 +5473,8 @@ let $$af = { consolex._('开始采集能量罩使用时间'); let _getFeedLegends = () => { - return $$sel.pickup({cn$: 'ListView'}, 'children', {default: []}) + let children = pickup({ className: 'ListView' }, 'children'); + return !children ? [] : children.toArray() .filter((w) => { return !isNullish(w) && w.childCount() === 0 @@ -5463,12 +5484,12 @@ let $$af = { }; let _max = 12; - let _selCover = () => _w_cvr = $$sel.get('cover_used'); + let _selShield = () => _w_cvr = $$sel.get('shield_used'); // more than 2 days; like: '03-22' - let _gt2 = w => /\d{2}.\d{2}/.test($$sel.pickup(w, 'txt')); + let _gt2 = w => /\d{2}.\d{2}/.test(w.content()); while (!_w_cvr && _max--) { for (let w of _getFeedLegends()) { - if (_selCover() || _gt2(w)) { + if (_selShield() || _gt2(w)) { consolex._('能量罩信息已定位'); break; } @@ -5489,14 +5510,14 @@ let $$af = { consolex._('捕获动态列表日期字串: ' + _date_str); /* like: '03:19' */ - let _time_str = $$sel.pickup([_w_cvr, 'p2c-1'], 'txt'); + let _time_str = detect(_w_cvr, 'p2c-1', 'txt'); consolex._('捕获动态列表时间字串: ' + _time_str); - $$app.blist.add($$af.nick, _ts(), $$app.blist.reason.cover); + $$app.blist.add($$af.nick, _ts(), $$app.blist.reason.shield); // tool function(s) // - /** Returns timestamp when protect cover is invalid */ + /** Returns timestamp when shield is invalid */ function _ts() { let _offsetHr = _getOffsetHr(); let _real_h = new Date().getHours() + _offsetHr; @@ -5523,7 +5544,7 @@ let $$af = { } let _d_str = _d_str_mch[0]; // like: _MM -> 12, _dd -> 31 (Dec 31) - let [_MM, _dd] = _d_str.split(/\D/).map(x => Number(x)); + let [ _MM, _dd ] = _d_str.split(/\D/).map(x => Number(x)); _MM -= 1; let _now = new Date(); // like: Jan 1, 2011 let _n_yy = _now.getFullYear(); @@ -5540,14 +5561,14 @@ let $$af = { } function _getDateStr() { - let _txt_cvr = $$sel.pickup(_w_cvr, 'txt'); + let _txt_cvr = _w_cvr.content(); let _date_str = ''; let _max = 5; while (_max--) { let _ws = $$sel.get('list').children().filter(w => w !== null); for (let w of _ws) { if (!w.childCount()) { - _date_str = $$sel.pickup(w, 'txt'); + _date_str = w.content(); continue; } if (_childrenTextMatch(w, _txt_cvr)) { @@ -5568,7 +5589,7 @@ let $$af = { if (c !== null && c.childCount()) { return _childrenTextMatch(c, s); } - if ($$sel.pickup(c, 'txt') === s) { + if (c.content() === s) { return true; } } @@ -5579,7 +5600,7 @@ let $$af = { } } - function _harvest() { + function harvest() { _fri.thd_info_collect.join(); $$link(_pick).$(_db); @@ -5597,11 +5618,11 @@ let $$af = { } function _db() { - let _pick = _harvest['cnt_pick'] || 0; + let _pick = harvest['cnt_pick'] || 0; if (_pick) { let _name = $$af.nick || '%NULL%'; - let _ts = $$app.ts_sec; - $$db.insert([_name, _ts, _pick]); + let _ts = $$app.tsSeconds; + $$db.insert([ _name, _ts, _pick ]); } } @@ -5621,20 +5642,20 @@ let $$af = { }; let _cfg = _prop[act]; - let _ctr = threadsx.atomic(0); - let _res = threadsx.atomic(-1); + let _ctr = threads.atomic(0); + let _res = threads.atomic(-1); let _strategies = { pk: { desc: 'PK面板', - condition: () => $$sel.pickup(_cfg.pk_kw), + condition: () => pickup(_cfg.pk_kw), getSum(agent) { return agent.stab - agent.init; }, getEmount() { let _max = 10; while (_max--) { - let _s = $$sel.pickup([_cfg.pk_kw, 's>1'], 'txt'); + let _s = pickup(_cfg.pk_kw, 's>1', 'txt'); if (_s.match(/\d+\s?(kg|t)/)) { consolex._('放弃低精度参照值'); return NaN; @@ -5686,7 +5707,7 @@ let $$af = { } } }); - return {amount: _amount}; + return { amount: _amount }; } function _matchFetchedGrams(s) { @@ -5697,10 +5718,14 @@ let $$af = { getEmount() { let _w_list = this.getListWidget(); if (_w_list) { - let _txt = (w, c) => $$sel.pickup([w, c], 'txt'); + let _txt = (w, c) => { + if (w !== null) { + w = w.compass(c); + } + return w !== null ? w.content() : ''; + }; if (this.benchmark === undefined) { this.benchmark = (function $iiFe() { - let _txt = (w, c) => $$sel.pickup([w, c], 'txt'); if (_txt(_w_list, 'c0') !== this.text.TODAY) { return this.text.NO_BENCHMARK; } @@ -5730,9 +5755,9 @@ let $$af = { let _w_list = this.w_list || this.getListWidget(); return (function _getText(w) { return w.childCount() - ? w.children().map(_getText).join('\ufeff') - : $$sel.pickup(w, 'txt'); - })($$sel.pickup([_w_list, compass])); + ? w.children().toArray().map(_getText).join('\ufeff') + : w.content(); + })(detect(_w_list, compass)); }, }, }; @@ -5743,7 +5768,7 @@ let $$af = { Object.values(this.fx).forEach((fxo) => { this.pool.push({ name: _cfg.src_pref + fxo.desc, - f: threadsx.start(_thdMaker(fxo)), + f: threads.start(_thdMaker(fxo)), }); }); }, @@ -5778,7 +5803,7 @@ let $$af = { let _init = agent.init_emount; consolex._('等待' + _name + '数据稳定'); - let _stab = a11yx.waitAndStable(agent.getEmount.bind(agent), {reference: _init}); + let _stab = a11yx.waitAndStable(agent.getEmount.bind(agent), { reference: _init }); if (!isNaN(_stab)) { agent.stable_emount = _stab; @@ -5810,18 +5835,18 @@ let $$af = { function _click() { let _desc = _cfg.ball_desc; - let _du = $$cfg.forest_balls_click_duration; + let _du = $$cfg.forestBallsClickDuration; consolex._('点击' + _desc + ': ' + data.length + '个'); data.forEach((o) => { - a11yx.click(o, 'p', {pt$: _du}); - sleep($$cfg.forest_balls_click_interval); + a11yx.click(o, 'p', { pt$: _du }); + sleep($$cfg.forestBallsClickInterval); }); $$flag.avail_clicked = true; $$flag.avail_clicked_pick = act === 'pick'; - $$app.fri_drop_by.dc($$af.nick); + $$app.friendDropBy.dc($$af.nick); } function _stat() { @@ -5835,7 +5860,7 @@ let $$af = { if (_sum !== -1) { $$af[_accu] += _accu ? _sum : 0; - _harvest['cnt_' + act] = _sum; + harvest['cnt_' + act] = _sum; let _dbl = $$flag.dblclick_checked ? ' (双击卡)' : ''; consolex.$(_act + ': ' + _sum + 'g' + _dbl, +!!_sum, 0, 1); } else { @@ -5884,7 +5909,7 @@ let $$af = { } } - function _reentry() { + function reentry() { if ($$flag.avail_clicked_pick && _dblclickCardExists()) { if (!$$flag.dblclick_checked) { consolex._('开始双击卡复查', 0, 0, 2); @@ -5900,7 +5925,7 @@ let $$af = { return true; } let _t_rex = /\D*[0-5]\d:\d{2}\s*/; - let _wc = $$sel.pickup(_t_rex, 'wc').filter((w) => { + let _wc = pickup(_t_rex, 'w[]').filter((w) => { let _x = cX(50), _y = cYx(70), _d = 0.2; let _b = w.bounds(), _h = _b.height(), _w = _b.width(); return $$num(_x * (1 - _d), '<', _w, '<', _x * (1 + _d)) @@ -5918,7 +5943,7 @@ let $$af = { wc.length > 1 ? consolex._('匹配到多个双击卡控件', 3) : consolex._('匹配到双击卡控件'); - let [_mm, _ss] = $$sel.pickup(wc[0], 'txt').match(_t_rex)[0] + let [ _mm, _ss ] = detect(wc[0], 'txt').match(_t_rex)[0] .split(':').map(s => Number(s.match(/\d+/)[0])); return $$app.ts + _mm * 60e3 + _ss * 1e3; } @@ -5932,7 +5957,7 @@ let $$af = { } } - function _coda() { + function coda() { if (!$$flag.avail_clicked) { consolex.$('无能量球可操作', 0, 0, 1); } @@ -5954,16 +5979,16 @@ let $$af = { $$app.page.fri.pool.reclaimAll(); } - function _byStroll() { + function byStroll() { let _enter = () => { consolex._('点击逛一逛按钮'); $$af.stroll.click(); }; let _ready = () => { - let _thd_title = threadsx.start(_title); + let _thd_title = threads.start(title); let _is_slake = false; - let _thd_slake = threadsx.start(() => { - a11yx.wait(() => _is_slake = $$af.stroll.isInSlakePage(), 18e3, 80); + let _thd_slake = threads.start(() => { + a11yx.wait(() => _is_slake = $$af.stroll.isInEndingPage(), 18e3, 80); }); a11yx.wait(() => !_thd_title.isAlive() || !_thd_slake.isAlive()); if (_is_slake) { @@ -5972,10 +5997,10 @@ let $$af = { return '__BREAK__'; } }; - $$link(_enter).$(_ready).$(_intro).$(_collect).$(_coda); + $$link(_enter).$(_ready).$(intro).$(collect).$(coda); } - function _byRankList() { + function byRankList() { _lmt.reset(); _fri.targets.forEach(_act); _fri.targets.splice(0); @@ -5983,7 +6008,7 @@ let $$af = { // tool function(s) // function _ready() { - _title(); + title(); if (!$$af.nick) { return '__BREAK__'; } @@ -5996,18 +6021,18 @@ let $$af = { $$app.page.rl.backTo(); }; let _enter = () => { - consolex._('点击' + _item.act_desc + '目标'); - a11yx.click([halfW, _item.item_y], 'p', {pt$: 64, bt$: 500}); + consolex._(`点击${_item.act_desc}目标`); + click(halfW, _item.item_y); }; while (_next()) { - $$link(_enter).$(_ready).$(_intro).$(_collect).$(_back).$(_coda); + $$link(_enter).$(_ready).$(intro).$(collect).$(_back).$(coda); } } } } - function _quit() { + function quit() { if ($$flag.rl_bottom_rch) { consolex._('检测到排行榜停检信号'); $$app.page.rl.reclaimAll(); @@ -6019,19 +6044,19 @@ let $$af = { } } - function _fin() { - let _swA = $$cfg.timers_switch; - let _swB = $$cfg.timers_self_manage_switch; - let _swC = $$cfg.timers_countdown_check_friends_switch; + function fin() { + let _swA = $$cfg.timersSwitch; + let _swB = $$cfg.timersSelfManageSwitch; + let _swC = $$cfg.timersCountdownCheckFriendsSwitch; if (!(_swA && _swB && _swC)) { $$af.min_ctd.fri.reset(); } else if (!isFinite($$af.min_ctd.fri.value)) { if ($$af.stroll.trigger()) { toast('正在准备获取排行榜倒计时数据...', 'long'); - $$app.page.rl.launch({is_show_greeting: false}); - $$af.rl.scroll.toBottom({itv: 0}); - toast.dismiss(); + $$app.page.rl.launch({ is_show_greeting: false }); + $$af.rl.scroll.toBottom({ itv: 0 }); + toast.dismissAll(); } _fri._chkMinCtd('cache'); } @@ -6040,11 +6065,11 @@ let $$af = { _awake() ? _reboot() : consolex._('好友能量检查完毕'); } - function _roll() { + function roll() { return !$$af.stroll.trigger(); } - function _swipe() { + function swipe() { $$link(_swipeUp).$(_chkCaptDiff).$(_chkInvtBtn); // tool function(s) // @@ -6053,8 +6078,12 @@ let $$af = { $$impeded('排行榜滑动流程'); $$af.rl.isInScrollMode() - ? $$af.rl.scroll.scroll({bt$: true}) - : $$af.rl.swipe.swipe({bt$: true}); + ? $$af.rl.scroll.scroll({ bt$: true }) + : $$af.rl.swipe.swipe({ bt$: true }); + + if ($$flag.rl_bottom_rch) { + return '__BREAK__'; + } } function _chkCaptDiff() { @@ -6078,7 +6107,7 @@ let $$af = { delete $$flag.rl_capt_pool_ctr; return; } - let _max = $$cfg.rank_list_capt_pool_diff_check_threshold; + let _max = $$cfg.rankListCaptPoolDiffCheckThreshold; consolex._('排行榜截图样本池差异检测:'); consolex._('检测未通过: (' + ++_ctr + '/' + _max + ')'); if (_ctr >= _max) { @@ -6097,7 +6126,7 @@ let $$af = { // tool function(s) // function _chkLoading() { - let _sel = () => $$sel.pickup(/正在加载.*/); + let _sel = () => pickup(/正在加载.*/); if (_sel()) { let _max = 2; @@ -6116,7 +6145,7 @@ let $$af = { } function _chkBottom() { - let _bnd = $$sel.get('rl_end_idt', 'bounds'); + let _bnd = pickup([ /.*没有更多.*/, { currentApp: 'alipay' } ], 'bounds'); if (_bnd && _bnd.height() > 3) { consolex._('发送排行榜停检信号'); consolex._('已匹配列表底部控件'); @@ -6126,7 +6155,7 @@ let $$af = { function _chkDozing() { if (a11yx.wait(/.*打瞌睡.*/, 2, 360)) { - a11yx.waitAndClick('再试一次', 12e3, 600, {cs$: 'w'}); + a11yx.waitAndClick('再试一次', 12e3, 600, { cs$: 'w' }); delete $$flag.rl_bottom_rch; consolex._('排行榜停检信号撤销'); consolex._('检测到"服务器打瞌睡"页面'); @@ -6139,7 +6168,7 @@ let $$af = { let _color = '#30BF6C'; let _paths = _rl.invt_colors || _invtColors(); let _mch = images.findMultiColors(_rl.capt_img, _color, _paths, { - region: [cX(0.71), cY(0.62), cX(0.28), cY(0.37)], + region: [ cX(0.71), cY(0.62), cX(0.28), cY(0.37) ], threshold: 10, }); if (_mch) { @@ -6167,26 +6196,26 @@ let $$af = { let _y3 = _dy * 4, _y4 = _dy * 6; return _rl.invt_colors = [ - [_x1, _y0, _c_green], // G1 - [_x0, _y1, _c_green], // G2 - [_x2, _y1, _c_green], // G3 - [_x1, _y2, _c_green], // G4 - [_x0, _y3, _c_green], // G5 - [_x2, _y3, _c_green], // G6 - [_x1, _y4, _c_white], // W1 - [_x2, _y4, _c_white], // W2 + [ _x1, _y0, _c_green ], // G1 + [ _x0, _y1, _c_green ], // G2 + [ _x2, _y1, _c_green ], // G3 + [ _x1, _y2, _c_green ], // G4 + [ _x0, _y3, _c_green ], // G5 + [ _x2, _y3, _c_green ], // G6 + [ _x1, _y4, _c_white ], // W1 + [ _x2, _y4, _c_white ], // W2 ]; } } } - function _limitationSetter() { + function limitationSetter() { return $$af.stroll.trigger() ? { reset() { $$af.stroll.reset(); }, trigger() { - return $$af.stroll.isSlake(); + return $$af.stroll.isEnding(); }, message() { if ($$af.stroll.isMaxCntCycleReached()) { @@ -6195,7 +6224,7 @@ let $$af = { }, } : { reset() { - this.counter = $$cfg.rank_list_max_not_targeted_times; + this.counter = $$cfg.rankListNotTargetedLimit; }, trigger() { $$und(this.counter) && this.reset(); @@ -6213,25 +6242,25 @@ let $$af = { if ($$af.stroll.trigger()) { return; } - if (!$$cfg.timers_switch) { - consolex._([_m_quit, '定时循环功能未开启']); + if (!$$cfg.timersSwitch) { + consolex._([ _m_quit, '定时循环功能未开启' ]); return false; } - if (!$$cfg.rank_list_review_switch) { - consolex._([_m_quit, '排行榜样本复查功能未开启']); + if (!$$cfg.rankListReviewSwitch) { + consolex._([ _m_quit, '排行榜样本复查功能未开启' ]); return false; } - if ($$flag.rl_review_stop) { - consolex._([_m_quit, '检测到复查停止信号']); + if ($$flag.isRankListReviewStopped) { + consolex._([ _m_quit, '检测到复查停止信号' ]); return false; } let _trig = (s) => { - consolex._(['触发排行榜样本复查条件:', s], 0, 0, 2); + consolex._([ '触发排行榜样本复查条件:', s ], 0, 0, 2); return $$flag.rl_review = true; }; - if ($$cfg.rank_list_review_difference_switch) { + if ($$cfg.rankListReviewDifferenceSwitch) { let _smp = this.rl_samples; let _old_keys = _smp && Object.keys(_smp); let _new_keys = Object.keys(this._getSamples()); @@ -6239,13 +6268,13 @@ let $$af = { return _trig('列表状态差异'); } } - if ($$cfg.rank_list_review_samples_clicked_switch) { + if ($$cfg.rankListReviewSamplesClickedSwitch) { if ($$flag.avail_clicked) { return _trig('样本点击记录'); } } - if ($$cfg.rank_list_review_threshold_switch) { - if (this._chkMinCtd($$cfg.rank_list_review_difference_switch)) { + if ($$cfg.rankListReviewThresholdSwitch) { + if (this._chkMinCtd($$cfg.rankListReviewDifferenceSwitch)) { return _trig('最小倒计时阈值'); } } @@ -6263,27 +6292,27 @@ let $$af = { }, _timers_setter: { trigger() { - if (!$$cfg.timers_switch) { + if (!$$cfg.timersSwitch) { consolex._('定时循环功能未开启'); return false; } - if (!$$cfg.timers_self_manage_switch) { + if (!$$cfg.timersSelfManageSwitch) { consolex._('定时任务自动管理未开启'); return false; } return true; }, autoTask() { - let _ahd_own = $$cfg.timers_countdown_check_own_timed_task_ahead; - let _ahd_fri = $$cfg.timers_countdown_check_friends_timed_task_ahead; + let _ahd_own = $$cfg.timersCountdownCheckOwnTimedTaskAhead; + let _ahd_fri = $$cfg.timersCountdownCheckFriendsTimedTaskAhead; let _min_own = $$af.min_ctd.own.value - _ahd_own * 60e3; let _min_fri = $$af.min_ctd.fri.value - _ahd_fri * 60e3; let _nxt_min_ctd = Math.min(_min_own, _min_fri); let _nxt_unintrp = _nxtUnintrp() || Infinity; let _type = _nxt_min_ctd > _nxt_unintrp - ? {name: 'uninterrupted', desc: '延时接力'} - : {name: 'min_countdown', desc: '最小倒计时'}; + ? { name: 'uninterrupted', desc: '延时接力' } + : { name: 'min_countdown', desc: '最小倒计时' }; let _next_ts = $$app.next_auto_task_ts = Math.min(_nxt_min_ctd, _nxt_unintrp); if (isFinite(_next_ts)) { @@ -6301,12 +6330,12 @@ let $$af = { // tool function(s) // function _trigger() { - if (!$$cfg.timers_uninterrupted_check_switch) { + if (!$$cfg.timersUninterruptedCheckSwitch) { consolex._('延时接力机制未开启'); return false; } // eg: [{section: ['06:30', '00:00'], interval: 60}] - let _sto_sxn = $$cfg.timers_uninterrupted_check_sections; + let _sto_sxn = $$cfg.timersUninterruptedCheckSections; if (!_sto_sxn || !_sto_sxn.length) { consolex._('无延时接力区间数据'); return false; @@ -6358,7 +6387,7 @@ let $$af = { // tool function(s) // function _trigger() { - let _sxn = $$cfg.timers_auto_task_sections; + let _sxn = $$cfg.timersAutoTaskSections; if (_sxn && _sxn.length) { return _chkAutoTaskSect.sto_sxn = _sxn; } @@ -6383,23 +6412,23 @@ let $$af = { let _sxn_l = Date.parse(_d_str + _sxn[0]); let _sxn_r = Date.parse(_d_str + _sxn[1]); if (_sxn_r <= _sxn_l) { - _tss.push([_today_min, _sxn_r]); - _tss.push([_sxn_l, _today_max]); + _tss.push([ _today_min, _sxn_r ]); + _tss.push([ _sxn_l, _today_max ]); } else { - _tss.push([_sxn_l, _sxn_r]); + _tss.push([ _sxn_l, _sxn_r ]); } if (_tss.some(a => $$num(a[0], '<=', _next_ts, '<=', a[1]))) { - consolex._(['匹配到有效时段:', _getSxnStr(_sxn)]); + consolex._([ '匹配到有效时段:', _getSxnStr(_sxn) ]); return; } _sxn_l = _sxn_l > _next_ts ? _sxn_l : _sxn_l + _d_ms; - _inf.push({left_ts: _sxn_l, sxn: _sxn}); + _inf.push({ left_ts: _sxn_l, sxn: _sxn }); } } consolex._('时间数据不在有效时段范围内'); - let {sxn: _sxn, left_ts: _ts} = _inf.sort((a, b) => { + let { sxn: _sxn, left_ts: _ts } = _inf.sort((a, b) => { let _a = a.left_ts, _b = b.left_ts; return _a === _b ? 0 : _a > _b ? 1 : -1; })[0]; @@ -6410,7 +6439,7 @@ let $$af = { // tool function(s) // function _getSxnStr(sxn) { - let [_l, _r] = sxn; + let [ _l, _r ] = sxn; _r += _r <= _l ? ' (+1)' : ''; return '[ ' + _l + ' - ' + _r + ' ]'; } @@ -6418,7 +6447,7 @@ let $$af = { } function _setStoAutoTask() { - timersx.rec.save('set_auto_task'); + recorder.save('set_auto_task'); let _sxn_str = $$app.next_avail_sxn_str; if (_sxn_str) { @@ -6426,7 +6455,7 @@ let $$af = { _type.name += '_restrained'; } - $$app.thd_set_auto_task = threadsx.start(function () { + $$app.thd_set_auto_task = threads.start(function () { let _task = _update() || _add(); let _nxt_str = $$cvt.date(_next_ts); @@ -6435,8 +6464,8 @@ let $$af = { _sxn_str && consolex.$('受制区间: ' + _sxn_str, 1, 0, 1); consolex.$('任务类型: ' + _type.desc, 1, 0, 1, 1); - if ($$flag.show_energy_result && $$cfg.auto_task_show_on_e_result) { - threadsx.start(function () { + if ($$flag.show_energy_result && $$cfg.autoTaskShowOnShowingResult) { + threads.start(function () { if (a11yx.wait(() => $$flag.floaty_result_all_set, 12e3, 120)) { $$app.layout.next_auto_task.deploy(); } @@ -6450,7 +6479,7 @@ let $$af = { let _sto_nxt = $$app.getStoAutoTask(); let _sto_id = _sto_nxt.task_id; if (_sto_id) { - let _sto_task = timersx.getTimedTask(_sto_id); + let _sto_task = tasks.getTimedTask(_sto_id); if (_sto_task) { return _updateTask(_sto_task); } @@ -6462,7 +6491,7 @@ let $$af = { consolex._('开始更新自动定时任务'); task.setMillis(_next_ts); return $$app.setStoAutoTask({ - task: timersx.updateTask(task), + task: tasks.updateTask(task), next_ts: _next_ts, next_type: _type.name, }, () => { @@ -6476,7 +6505,7 @@ let $$af = { function _add() { return $$app.setStoAutoTask({ - task: timersx.addDisposableTask({ + task: tasks.addDisposableTask({ path: $$app.cwp, date: _next_ts, }), next_ts: _next_ts, @@ -6544,7 +6573,7 @@ let $$af = { } else { consolex._('模拟一次"深度返回"操作'); consolex._('检测到非用户点击行为'); - devicex.keycode(4, {rush: true}); + devicex.keycode(4, { rush: true }); } }); $$app.layout.fullscreen_cover.setOnTouchListener(function (view, e) { @@ -6570,10 +6599,10 @@ let $$af = { $$app.layout.eballs_pick_result.deploy({ own: _e_own, fri: _e_fri, - countdown: $$cfg.floaty_result_countdown_sec, + countdown: $$cfg.floatyResultCountdownSeconds, }); - if ($$cfg.update_auto_check_switch && $$cfg.update_show_on_e_result) { + if ($$cfg.updateAutoCheckSwitch && $$cfg.updateShowOnShowingResult) { $$app.layout.update_avail.deploy(); } @@ -6582,7 +6611,7 @@ let $$af = { function _msg() { let _args = [].slice.call(arguments); let _toast_msg = _args.map(s => s.replace(/^>*/, '')).join('\n'); - toast(_toast_msg, 'L', 'F'); + toast(_toast_msg, 'l', 'f'); consolex._(_args, 0, 0, 2); } } @@ -6590,16 +6619,16 @@ let $$af = { function _toastResult() { let _line = '-'.repeat(32); - if ($$cfg.auto_task_show_on_e_result) { + if ($$cfg.autoTaskShowOnShowingResult) { let _ts = $$app.next_auto_task_ts; if (_ts) { - msg = ['Next auto task:', $$cvt.date(_ts), _line, msg].join('\n'); + msg = [ 'Next auto task:', $$cvt.date(_ts), _line, msg ].join('\n'); } } - if ($$cfg.update_auto_check_switch && $$cfg.update_show_on_e_result) { + if ($$cfg.updateAutoCheckSwitch && $$cfg.updateShowOnShowingResult) { let _ver = $$app.newest_release_ver_name; - if (_ver && appx.version.isNewer(_ver, $$app.project_ver_name)) { - msg += '\n' + [_line, 'Update available:', _ver].join('\n'); + if (_ver && appx.version.isNewer(_ver, project.getLocalVerName())) { + msg += '\n' + [ _line, 'Update available:', _ver ].join('\n'); } } toast(msg, 'long'); @@ -6629,22 +6658,20 @@ let $$af = { function _floatyReady() { return $$flag.show_floaty_result && new Promise((reso) => { consolex._('监测Floaty结束等待信号'); - timersx.rec.save('floaty_result_waiting'); - timersx.setInterval(function () { - let _ctd = $$cfg.floaty_result_countdown_sec; - let _max = (_ctd + 5) * 1e3; - if (timersx.rec.gt('floaty_result_waiting', _max)) { - $$flag.floaty_result_fin = true; - consolex._('放弃等待Floaty消息结束信号', 3); - consolex._('等待结束信号超时', 3); - } - }, 200, function () { - if ($$flag.floaty_result_fin) { + recorder.save('floaty_result_waiting'); + + let limit = ($$cfg.floatyResultCountdownSeconds + 5) * 1e3; + a11yx.wait(() => $$flag.floaty_result_fin, limit, 80, { + then() { consolex._('检测到Floaty结束等待信号'); $$app.layout.closeAll('without_cover'); reso(_updateDialogAsync()); - return true; - } + }, + else() { + consolex._('放弃等待Floaty消息结束信号', 3); + consolex._('等待结束信号超时', 3); + reso($$flag.floaty_result_fin = true); + }, }); }); @@ -6653,7 +6680,7 @@ let $$af = { function _updateDialogAsync() { return $$flag.update_dialog_uphold && new Promise((resolve) => { consolex._('等待更新对话框结束信号'); - timersx.rec.save('update_dialog_uphold'); + recorder.save('update_dialog_uphold'); let _fin = (msg) => { consolex._(msg); clearInterval(_itv); @@ -6664,7 +6691,7 @@ let $$af = { if (!$$flag.update_dialog_uphold) { _fin('检测到更新对话框结束信号'); } - if (timersx.rec.gt('update_dialog_uphold', _tt())) { + if (recorder.isGreaterThan('update_dialog_uphold', _tt())) { _fin('放弃等待更新对话框结束信号'); } }, 200); @@ -6682,9 +6709,9 @@ let $$af = { }; if (!_cond()) { consolex._('等待定时任务设置完成'); - timersx.setInterval(function () { + timers.setIntervalExt(function () { let _max = 10e3; - if (timersx.rec.gt('set_auto_task', _max)) { + if (recorder.isGreaterThan('set_auto_task', _max)) { consolex.$('放弃等待定时任务设置完成', 4); consolex.$('等待超时', 4, 0, 1); _thd.interrupt(); @@ -6697,16 +6724,16 @@ let $$af = { }, scrOffIFN() { if ($$bool($$app.init_scr_on_from_broadcast)) { - $$app.init_scr_on = $$app.init_scr_on_from_broadcast; + $$app.isInitScreenOn = $$app.init_scr_on_from_broadcast; } - if ($$app.queue.excl_tasks_all_len > 1) { + if ($$app.queue.getExclusiveAllTasksLength() > 1) { consolex._('跳过关闭屏幕'); consolex._('当前存在排他性排队任务'); return false; } - if ($$app.init_scr_on) { + if ($$app.isInitScreenOn) { consolex._('无需关闭屏幕'); return false; } @@ -6727,7 +6754,7 @@ let $$af = { devicex.screenOff({ key_code: { - is_disabled: !($$app.has_root && $$app.root_fxs.screen_off), + is_disabled: !($$app.hasRootAccess && $$app.rootAccessPrivileges.screenOffByKeyEvent), }, provider: { hint() { @@ -6766,7 +6793,7 @@ let $$af = { rl: { scroll: { get itv() { - return $$cfg.rank_list_scroll_interval.clamp(100, 2.4e3); + return Numberx.clamp($$cfg.rankListScrollInterval, [ 100, 2.4e3 ]); }, /** * @param {Object} [options] @@ -6783,29 +6810,30 @@ let $$af = { do { $$impeded('排行榜控件滚动流程'); _1st ? _1st &= 0 : sleep(_itv); - let _ls = scrollable(true).findOnce(); - _ls ? _ls.scrollDown() : consolex._('scrollable(): null'); + // let _ls = scrollable(true).findOnce(); + $$flag.scroll_down_state = pickup({ scrollable: true }, 'scrollDown'); + $$flag.scroll_down_state || consolex._('scrollDown(): false'); } while (_opt.loop && _opt.loop()); let _bt = _opt.buffer_time || _opt.bt$ || 0; sleep(_bt === true || _bt === -1 ? _itv : _bt); }, toBottom(options) { - let _opt = Object.assign({loop: () => !$$flag.rl_bottom_rch}, options || {}); - let _thd = threadsx.start(() => this.scroll(_opt)); + let _opt = Object.assign({ loop: () => !$$flag.rl_bottom_rch }, options || {}); + let _thd = threads.start(() => this.scroll(_opt)); $$app.monitor.rl_bottom.start().join(_opt.timeout || 150e3); _thd.interrupt(); }, }, swipe: { get du() { - return $$cfg.rank_list_swipe_time.clamp(100, 2.4e3); + return Numberx.clamp($$cfg.rankListSwipeDuration, [ 100, 2.4e3 ]); }, get itv() { - return $$cfg.rank_list_swipe_interval.clamp(100, 2.4e3); + return Numberx.clamp($$cfg.rankListSwipeInterval, [ 100, 2.4e3 ]); }, get dist() { - let _dist = $$cfg.rank_list_swipe_distance; + let _dist = $$cfg.rankListSwipeDistance; if (_dist < 1) { _dist = Math.trunc(_dist * H); } @@ -6845,7 +6873,8 @@ let $$af = { do { _1st ? _1st &= 0 : sleep(_itv); - if (!swipe(_x1, _y1, _x2, _y2, _du)) { + $$flag.scroll_down_state = swipe(_x1, _y1, _x2, _y2, _du); + if (!$$flag.scroll_down_state) { consolex._('swipe(): false'); } // just to prevent screen from turning off @@ -6860,7 +6889,7 @@ let $$af = { let _dist0 = Math.trunc(uH * 0.95); let _top0 = Math.trunc((uH - _dist0) / 2); let _af_cfg = storagesx.af_cfg.get('config', {}); - let _data = {rank_list_swipe_distance: _dist0}; + let _data = { rankListSwipeDistance: _dist0 }; let _combined = Object.assign({}, _af_cfg, _data); consolex.$('滑动区域超限', 3); @@ -6869,24 +6898,24 @@ let $$af = { consolex.$('swipe_top: ' + _top0, 3); storagesx.af_cfg.put('config', _combined); - $$cfg.rank_list_swipe_distance = _dist0; + $$cfg.rankListSwipeDistance = _dist0; consolex.$('自动修正配置文件数据:', 3); - consolex.$('rank_list_swipe_distance: ' + _dist0, 3); + consolex.$('rankListSwipeDistance: ' + _dist0, 3); return _top0; }, toBottom(options) { - let _opt = Object.assign({loop: () => !$$flag.rl_bottom_rch}, options || {}); - let _thd = threadsx.start(() => this.swipe(_opt)); + let _opt = Object.assign({ loop: () => !$$flag.rl_bottom_rch }, options || {}); + let _thd = threads.start(() => this.swipe(_opt)); $$app.monitor.rl_bottom.start().join(_opt.timeout || 150e3); _thd.interrupt(); }, }, isInScrollMode() { - return $$cfg.rank_list_scan_strategy === 'scroll'; + return $$cfg.rankListScanStrategy === 'scroll'; }, isInSwipeMode() { - return $$cfg.rank_list_scan_strategy === 'swipe'; + return $$cfg.rankListScanStrategy === 'swipe'; }, }, launch() { @@ -6894,7 +6923,7 @@ let $$af = { return $$af; }, collect() { - let {own, fri} = this._collector; + let { own, fri } = this._collector; own.trigger() && own.init().collect(); fri.trigger() && fri.init().collect(); return $$af; @@ -6907,7 +6936,7 @@ let $$af = { epilogue() { let _ = this._epilogue_setter; _.logBackIFN(); - Promise.all([_.showResult(), _.readyExit()]) + Promise.all([ _.showResult(), _.readyExit() ]) .catch(_.err).then(_.scrOffIFN) .catch(_.err).then(_.exitNow); }, diff --git a/ant-forest-settings.js b/ant-forest-settings.js index a383733..b6b3904 100644 --- a/ant-forest-settings.js +++ b/ant-forest-settings.js @@ -5,78 +5,75 @@ let { $$und, $$obj, $$arr, $$cvt, $$T, $$F, $$0, $$func, $$num, $$str, $$nul, isNonEmptyObject, } = require('./modules/mod-global'); -let {db} = require('./modules/mod-database'); -let {project} = require('./modules/mod-project'); -let {uix} = require('./modules/ext-ui'); -let {appx} = require('./modules/ext-app'); -let {a11yx} = require('./modules/ext-a11y'); -let {filesx} = require('./modules/ext-files'); -let {autojs} = require('./modules/mod-autojs'); -let {imagesx} = require('./modules/ext-images'); -let {timersx} = require('./modules/ext-timers'); -let {cryptox} = require('./modules/ext-crypto'); -let {colorsx} = require('./modules/ext-colors'); -let {dialogsx} = require('./modules/ext-dialogs'); -let {threadsx} = require('./modules/ext-threads'); -let {consolex} = require('./modules/ext-console'); -let {storagesx} = require('./modules/ext-storages'); -let {devicex, $$disp} = require('./modules/ext-device'); +let { db } = require('./modules/mod-database'); +let { project } = require('./modules/mod-project'); +let { uix } = require('./modules/ext-ui'); +let { appx } = require('./modules/ext-app'); +let { a11yx } = require('./modules/ext-a11y'); +let { filesx } = require('./modules/ext-files'); +let { autojs: autojsExt } = require('./modules/mod-autojs'); +let { imagesx } = require('./modules/ext-images'); +let { cryptox } = require('./modules/ext-crypto'); +let { dialogsx } = require('./modules/ext-dialogs'); +let { consolex } = require('./modules/ext-console'); +let { storagesx } = require('./modules/ext-storages'); +let { devicex, $$disp } = require('./modules/ext-device'); let $$init = { check() { - devicex.ensureSdkInt(); - autojs.ensureVersion(); + requiresApi(util.versionCodes.N.apiLevel); + autojsExt.ensureVersion(); a11yx.ensureSvcAndFunc(); - uix.init({requested_orientation: 'PORTRAIT'}); + uix.init({ requested_orientation: 'PORTRAIT' }); return $$init; }, global() { global.$$cfg = { list_heads: { - project_backup_info: [{ + project_backup_info: [ { version_name: '项目版本', width: 0.5, }, { timestamp: '项目备份时间', - sort: {flag: -1, head_name: 'timestamp'}, + sort: { flag: -1, head_name: 'timestamp' }, stringTransform: { forward: t => $$tool.getTimeStrFromTs(t, 'time_str_full'), backward: t => $$tool.restoreFromTimestamp(t), }, - }], - server_releases_info: [{ + } ], + server_releases_info: [ { tag_name: '项目标签', width: 0.5, }, { published_at: '项目发布时间', - sort: {flag: -1, head_name: 'published_at'}, + sort: { flag: -1, head_name: 'published_at' }, stringTransform: { forward: t => $$tool.getTimeStrFromTs(new Date(t), 'time_str_full'), }, - }], - blacklist_by_user: [{ + } ], + blacklist_by_user: [ { name: '支付宝好友昵称', width: 0.58, }, { timestamp: '黑名单自动解除', - sort: {flag: 1, head_name: 'timestamp'}, + sort: { flag: 1, head_name: 'timestamp' }, stringTransform: { forward: t => $$tool.getTimeStrFromTs(t, 'time_str_remove'), backward: t => $$tool.restoreFromTimestamp(t), }, - }], - blacklist_protect_cover: [{ + } ], + blacklist_shield: [ { name: '支付宝好友昵称', width: 0.58, }, { timestamp: '黑名单自动解除', - sort: {flag: 1, head_name: 'timestamp'}, + sort: { flag: 1, head_name: 'timestamp' }, stringTransform: { forward: t => $$tool.getTimeStrFromTs(t, 'time_str_remove'), backward: t => $$tool.restoreFromTimestamp(t), }, - }], - foreground_app_blacklist: [{ + } ], + foregroundAppBlacklist: [ { app_combined_name: '应用名称 (含包名)', - sort: {flag: 1, head_name: 'app_combined_name'}, + sort: { flag: 1, head_name: 'app_combined_name' }, width: 0.85, }, { available: '有效', gravity: 'center', stringTransform: { @@ -86,18 +83,18 @@ let $$init = { }, backward: '__keep__', }, - }], - timers_uninterrupted_check_sections: [{ + } ], + timersUninterruptedCheckSections: [ { section: '时间区间', width: 0.58, - sort: {flag: 1, head_name: 'section'}, + sort: { flag: 1, head_name: 'section' }, stringTransform: { forward: arr => $$tool.timeSectionToStr(arr), backward: str => $$tool.timeStrToSection(str), }, }, { interval: '间隔 (分)', - }], - timed_tasks: [{ + } ], + timed_tasks: [ { type: '任务类型', width: 0.47, stringTransform: { // []: daily; number[]: weekly; 0: disposable forward: arr => $$tool.getTimedTaskTypeStr(arr), @@ -105,18 +102,18 @@ let $$init = { }, }, { next_run_time: '下次运行', - sort: {flag: 1, head_name: 'next_run_time'}, + sort: { flag: 1, head_name: 'next_run_time' }, stringTransform: { forward: t => $$tool.getTimeStrFromTs(t, 'time_str_full'), backward: t => $$tool.restoreFromTimestamp(t), }, - }], - stat_list: [{ + } ], + stat_list: [ { name: '用户昵称', width: 0.72, }, { pick: '收取量统计', - sort: {flag: -1, head_name: 'pick', type: 'number'}, - }], + sort: { flag: -1, head_name: 'pick', type: 'number' }, + } ], }, }; @@ -134,8 +131,8 @@ let $$init = { global.$$def = Object.assign({}, $$sto.def.settings, { colors: uix.colors, - item_area_width: cX($$sto.def.settings.item_area_width) + 'px', - homepage_title: $$sto.def.af.project_desc, + itemAreaWidth: cX($$sto.def.settings.itemAreaWidth) + 'px', + homepage_title: $$sto.def.af.projectDesc, }); global.$$view = { @@ -155,8 +152,8 @@ let $$init = { return dialogsx .builds([ _opt.title || this.title, _cfg_conj, - ['R', 'reset'], 'B', 'M', 1, - ], {inputHint: 'rgb(RR,GG,BB) | #RRGGBB'}) + [ 'R', 'reset' ], 'B', 'M', 1, + ], { inputHint: 'rgb(RR,GG,BB) | #RRGGBB' }) .on('neutral', (d) => { dialogsx.setInputText(d, $$sto.def.af[_cfg_conj]); }) @@ -225,14 +222,14 @@ let $$init = { let _cvt = _dist === 'H' ? cY : cX; let _div = _dist === 'H' ? H : W; _mini = _cvt(min); - _mini_p = (_mini / _div).toFixedNum(2); + _mini_p = Numberx.toFixedNum(_mini / _div, 2); _maxi = _cvt(max); - _maxi_p = (_maxi / _div).toFixedNum(2); + _maxi_p = Numberx.toFixedNum(_maxi / _div, 2); if ($$und(_content)) { _content = ''; } if (!$$arr(_content)) { - _content = [_content]; + _content = [ _content ]; } if ($$und(_content[1]) || _content[1]) { _content[1] = @@ -257,7 +254,7 @@ let $$init = { return dialogsx .builds([ _title, $$und(_content) ? _cfg_conj : $$nul(_content) ? '' : _content, - $$0(_neutral) || $$nul(_neutral) ? 0 : ['R', 'reset'], + $$0(_neutral) || $$nul(_neutral) ? 0 : [ 'R', 'reset' ], $$0(_negative) || $$nul(_negative) ? 0 : 'B', $$0(_positive) || $$nul(_positive) ? 0 : 'M', 1, @@ -281,8 +278,8 @@ let $$init = { d.dismiss(); $$save.session(_cfg_conj, _save(_n)); }; - let _range = [_mini, _maxi]; - let _range_p = [_mini_p, _maxi_p]; + let _range = [ _mini, _maxi ]; + let _range_p = [ _mini_p, _maxi_p ]; let _n = $$view.diag.getInputNumStrByCheckRange(d, _range, _range_p); if ($$str(_n) && (!_opt.positiveAddn || _opt.positiveAddn(d, _n, _f))) { return _f(); @@ -299,8 +296,8 @@ let $$init = { dialogsx .builds([ _title, _cfg_conj, - ['R', 'reset'], 'Q', 'M', 1, - ], {inputHint: 'Rect(l,t,r,b) x.like=72|0.1|10%'}) + [ 'R', 'reset' ], 'Q', 'M', 1, + ], { inputHint: 'Rect(l,t,r,b) x.like=72|0.1|10%' }) .on('neutral', (d) => { dialogsx.setInputText(d, $$sto.def[_def_key][_cfg_conj].join(',')); }) @@ -389,13 +386,13 @@ let $$init = { _neu_value = 0; _neu_lsn = () => null; } else if ($$func(_neutral)) { - _neu_value = ['T', 'hint']; + _neu_value = [ 'T', 'hint' ]; _neu_lsn = d => _neutral.call(this, d); } else if ($$obj(_neutral)) { _neu_value = _neutral.value; _neu_lsn = d => _neutral.listener.call(this, d); } else { - _neu_value = ['R', 'reset']; + _neu_value = [ 'R', 'reset' ]; _neu_lsn = d => d.setSelectedIndex(_def_sto_idx); } @@ -481,7 +478,7 @@ let $$init = { _min = Number(_arg); _max = Number(arguments[i + 1]); } else if ($$arr(_arg)) { - [_min, _max] = _arg; + [ _min, _max ] = _arg; } else { continue; } @@ -552,7 +549,7 @@ let $$init = { }, stat_page: null, blacklist_page: { - cover_blacklist_page: null, + shield_blacklist_page: null, collect_blacklist_page: null, foreground_app_blacklist_page: null, }, @@ -567,7 +564,7 @@ let $$init = { update_auto_check_page: null, }, new(title, tt_key, f) { - return this.buffer[tt_key] = f.bind(null, [title, tt_key]); + return this.buffer[tt_key] = f.bind(null, [ title, tt_key ]); }, jump(drxn, nxt) { if (!global._$_page_scrolling_locked) { @@ -580,14 +577,14 @@ let $$init = { _pool.pop(); delete global._$_page_scrolling_locked; }, - }, {pages_pool: _pool}); + }, { pages_pool: _pool }); } else { uix.smoothScrollPage('left', { onStart: () => _pool.push($$view.pages[nxt]), onSuccess() { delete global._$_page_scrolling_locked; }, - }, {pages_pool: _pool}); + }, { pages_pool: _pool }); } } } @@ -620,7 +617,7 @@ let $$init = { _pages_buffer.push(pages[key]); _pages_buffered_name[key] = true; } - if (isPlainObject(tree[key])) { + if (isObjectSpecies(tree[key])) { sub_trees.push(tree[key]); } }); @@ -633,14 +630,14 @@ let $$init = { dyn_pages: [], setHomePage(home_title, bg_color) { let _homepage = $$view.setPage(home_title, (p_view) => ( - $$view.setButtons(p_view, 'homepage', ['save', 'SAVE', 'OFF', (v) => { + $$view.setButtons(p_view, 'homepage', [ 'save', 'SAVE', 'OFF', (v) => { if ($$save.trigger()) { $$save.config(); v.switch_off(); toast('已保存'); } - }]) - ), {action_bar_bg: bg_color}); + } ]) + ), { action_bar_bg: bg_color }); _homepage.ready = function () { ui['main'].addView(_homepage); @@ -651,8 +648,8 @@ let $$init = { return _homepage; }, setPage(title, addn_func, options) { - let {no_scroll_view, check_page_state, action_bar_bg} = options || {}; - let [_title_name, _label_name] = $$arr(title) ? title : [title, '']; + let { no_scroll_view, check_page_state, action_bar_bg } = options || {}; + let [ _title_name, _label_name ] = $$arr(title) ? title : [ title, '' ]; let _page_view = ui.inflate(); @@ -677,12 +674,12 @@ let $$init = { } else { _v = ui.inflate( - ); - _v['_title'].setTextColor(colorsx.toInt($$def.colors.item_title)); + _v['_title'].setTextColor(colors.toInt($$def.colors.item_title)); } if (!$$obj(opt)) { @@ -698,7 +695,7 @@ let $$init = { }); }; _v.setHintTextColor = (c) => { - _v['_hint'] && _v['_hint'].setTextColor(colorsx.toInt(c)); + _v['_hint'] && _v['_hint'].setTextColor(colors.toInt(c)); }; _v.setHintVisibility = (v) => { _v['_hint'] && ui.post(() => { @@ -712,7 +709,7 @@ let $$init = { }); }; _v.setTitleTextColor = (c) => { - _v['_title'] && _v['_title'].setTextColor(colorsx.toInt(c)); + _v['_title'] && _v['_title'].setTextColor(colors.toInt(c)); }; _v.setChevronVisibility = (v) => { _v['_chevron_icon'] && ui.post(() => { @@ -740,10 +737,10 @@ let $$init = { let _hint = _view['_sub_hint']; if (_col) { _hint.setText('\u25D1'); // "◑" - _hint.setTextColor(colorsx.toInt(_col[0])); + _hint.setTextColor(colors.toInt(_col[0])); } else { _hint.setText(text); - _hint.setTextColor(colorsx.toInt($$def.colors.item_hint)); + _hint.setTextColor(colors.toInt($$def.colors.item_hint)); } return _view; }; @@ -855,7 +852,7 @@ let $$init = { }; // noinspection HtmlUnknownTarget,HtmlRequiredAltAttribute - /** @type {com.stardust.autojs.core.ui.widget.JsLinearLayout} */ + /** @type {org.autojs.autojs.core.ui.widget.JsLinearLayout} */ let _page_enter_view = ui.inflate( [idx, v]); + let _sess_data = $$ses[ds_k].map((v, idx) => [ idx, v ]); _sess_data.sort((a, b) => { let _is_num = (title_obj.sort || {}).type === 'number'; let _a = a[1][a[1][data_key_name]]; let _b = b[1][b[1][data_key_name]]; if (_is_num) { - [_a, _b] = [+_a, +_b]; + [ _a, _b ] = [ +_a, +_b ]; } if (_a === _b) { return 0; @@ -1137,9 +1134,9 @@ let $$init = { } function setSeekbar(options) { - let {title, unit, config_conj, nums, inc} = options; + let { title, unit, config_conj, nums, inc } = options; let _def = $$sto.def.af[config_conj]; - let [min, max, init] = nums; + let [ min, max, init ] = nums; if (isNaN(+min)) { min = 0; } @@ -1196,7 +1193,7 @@ let $$init = { if (_label_name) { $$ses['ready_signal_' + _label_name] = true; } else { - consolex.w(['页面标签不存在:', _title_name], 0, 0, 2); + consolex.w([ '页面标签不存在:', _title_name ], 0, 0, 2); } return this; }; @@ -1236,10 +1233,10 @@ let $$init = { return $$view.checkPageState() && $$view.page.jump('back'); }); _view['_title_text'].setText(_title_name); - _view['_title_text'].setTextColor(colorsx.toInt($$def.colors.page_title)); + _view['_title_text'].setTextColor(colors.toInt($$def.colors.page_title)); _view['_title_text'].getPaint().setFakeBoldText(true); - let _color = colorsx.toInt(action_bar_bg || $$def.colors.action_bar_bg); + let _color = colors.toInt(action_bar_bg || $$def.colors.action_bar_bg); _view['_title_bg'].setBackgroundColor(_color); $$func(addn_func) && addn_func(_view); @@ -1288,16 +1285,16 @@ let $$init = { let def_off_color = $$def.colors.btn_off; let view = buttonView(); /** @type {string[]} */ - let switch_on_color = [other_params['btn_on_icon_color'] || def_on_color, other_params['btn_on_text_color'] || def_on_color]; + let switch_on_color = [ other_params['btn_on_icon_color'] || def_on_color, other_params['btn_on_text_color'] || def_on_color ]; /** @type {string[]} */ - let switch_off_color = [other_params['btn_off_icon_color'] || def_off_color, other_params['btn_off_text_color'] || def_off_color]; + let switch_off_color = [ other_params['btn_off_icon_color'] || def_off_color, other_params['btn_off_text_color'] || def_off_color ]; view.switch_on = () => { view[btn_icon_id].attr('tint', switch_on_color[0]); - view[btn_text_id].setTextColor(colorsx.toInt(switch_on_color[1])); + view[btn_text_id].setTextColor(colors.toInt(switch_on_color[1])); }; view.switch_off = () => { view[btn_icon_id].attr('tint', switch_off_color[0]); - view[btn_text_id].setTextColor(colorsx.toInt(switch_off_color[1])); + view[btn_text_id].setTextColor(colors.toInt(switch_off_color[1])); }; switch_state === 'OFF' ? view.switch_off() : view.switch_on(); @@ -1327,23 +1324,23 @@ let $$init = { setListPageButtons(p_view, ds_k) { let _scenario = { blacklist_by_user: sceBlacklistByUser, - foreground_app_blacklist: sceForeAppBlacklist, + foregroundAppBlacklist: sceForeAppBlacklist, }[ds_k](); - let _args = [p_view, ds_k].concat(_scenario); + let _args = [ p_view, ds_k ].concat(_scenario); return $$view.setButtons.apply($$view.setButtons, _args); // scenario function(s) // function sceBlacklistByUser() { return [ - ['restore', 'RESTORE', 'OFF', (btn_view) => { + [ 'restore', 'RESTORE', 'OFF', (btn_view) => { let _blist_bak = $$cfg.sto[ds_k]; if (Object.isDeepEqual($$cfg.ses[ds_k], _blist_bak)) { return; } let _diag = dialogsx.builds([ '恢复列表数据', 'restore_original_list_data', - ['查看恢复列表', 'hint'], 'B', 'K', 1, + [ '查看恢复列表', 'hint' ], 'B', 'K', 1, ]); _diag.on('neutral', () => { dialogsx.builds([ @@ -1362,7 +1359,7 @@ let $$init = { _items.push(_split_ln); return _items; } - return ['列表为空']; + return [ '列表为空' ]; })(), }).on('positive', (d) => { d.dismiss(); @@ -1389,11 +1386,11 @@ let $$init = { _v['_check_all'].setChecked(false); }); _diag.show(); - }], - ['delete_forever', 'REMOVE', 'OFF', (btn_view) => { + } ], + [ 'delete_forever', 'REMOVE', 'OFF', (btn_view) => { let _del_idx_k = ds_k + '_deleted_items_idx'; let _del_ctr_k = ds_k + '_deleted_items_idx_count'; - $$ses[_del_ctr_k] && threadsx.start(function () { + $$ses[_del_ctr_k] && threads.start(function () { let _ctr_old = undefined; while ($$ses[_del_ctr_k] !== _ctr_old) { _ctr_old = $$ses[_del_ctr_k]; @@ -1428,8 +1425,8 @@ let $$init = { btn_view.switch_off(); } - }], - ['add_circle', 'NEW', 'ON', () => { + } ], + [ 'add_circle', 'NEW', 'ON', () => { let _tmp_sel_fri = []; let _blist_sel_fri = []; let _lst_pg_view = $$view.findViewByTag(p_view, 'list_page_view'); @@ -1440,17 +1437,17 @@ let $$init = { '或检索选择好友'; let _diag = dialogsx.builds([ '添加新数据', _diag_def_cnt, - ['从列表中选择', 'hint'], - ['检索选择', 'hint'], + [ '从列表中选择', 'hint' ], + [ '检索选择', 'hint' ], '确认添加', 1, - ], {items: [' ']}); + ], { items: [ ' ' ] }); _diag.on('neutral', () => { let _diag_add_from_lst = dialogsx.builds([ '列表选择好友', '', - ['刷新列表', 'hint'], + [ '刷新列表', 'hint' ], 0, '确认选择', 1, ], { - items: ['列表为空'], + items: [ '列表为空' ], itemsSelectMode: 'multi', }); _diag_add_from_lst.on('neutral', () => { @@ -1462,10 +1459,13 @@ let $$init = { }, onResume() { _diag.show(); - threadsx.start(function () { - let _btn_text = _diag.getActionButton('neutral'); - if (_btn_text) { - a11yx.waitAndClick(text(_btn_text), 4e3, 100, {cs$: 'w'}); + threads.start(function () { + let btn = _diag.getActionButton('neutral'); + if (btn !== null) { + let buttonText = btn.toString(); + if (buttonText) { + a11yx.waitAndClick(text(buttonText), 4e3, 100, { cs$: 'w' }); + } } }); }, @@ -1503,7 +1503,7 @@ let $$init = { }); } let _i_len = _items.length; - _items = _i_len ? _items : ['列表为空']; + _items = _i_len ? _items : [ '列表为空' ]; _diag_add_from_lst.setItems(_items); let _fri_lst_ts = _fri_lst.timestamp; if (!isFinite(_fri_lst_ts)) { @@ -1517,7 +1517,7 @@ let $$init = { _diag.on('negative', () => { _diag.dismiss(); let _getListData = () => $$sto - .af_flist.get('friends_list_data', {list_data: []}) + .af_flist.get('friends_list_data', { list_data: [] }) .list_data.map(o => o.nickname); $$view.setListItemsSearchAndSelectView(_getListData, { refresh_btn(ds_updater) { @@ -1527,7 +1527,7 @@ let $$init = { }); }, list_item(item, closeListPage) { - let _excluded = [_blist_sel_fri, _tmp_sel_fri]; + let _excluded = [ _blist_sel_fri, _tmp_sel_fri ]; for (let i = 0, l = _excluded.length; i < l; i += 1) { if (_excluded[i].includes(item)) { @@ -1583,33 +1583,33 @@ let $$init = { function refreshDiag() { let _tmp_items_len = _tmp_sel_fri.length; - let _tmp_items = _tmp_items_len ? _tmp_sel_fri : ['\xa0']; + let _tmp_items = _tmp_items_len ? _tmp_sel_fri : [ '\xa0' ]; _diag.setItems(_tmp_items); let _cnt_info = _tmp_items_len ? '当前选择区好友总数: ' + _tmp_items_len : _diag_def_cnt; _diag.setContent(_cnt_info); } - }], + } ], ]; } function sceForeAppBlacklist() { return [ - ['restore', 'RESTORE', 'OFF', (btn_view) => { + [ 'restore', 'RESTORE', 'OFF', (btn_view) => { let blacklist_backup = $$cfg.sto[ds_k]; if (Object.isDeepEqual($$cfg.ses[ds_k], blacklist_backup)) return; let diag = dialogsx.builds([ '恢复列表数据', 'restore_original_list_data', - ['查看恢复列表', 'hint'], 'B', 'K', 1, + [ '查看恢复列表', 'hint' ], 'B', 'K', 1, ]); diag.on('neutral', () => { - let diag_restore_list = dialogsx.builds(['查看恢复列表', '', 0, 0, 'B', 1], { + let diag_restore_list = dialogsx.builds([ '查看恢复列表', '', 0, 0, 'B', 1 ], { content: '共计 ' + blacklist_backup.length + ' 项', items: (function $iiFe() { let items = []; blacklist_backup.forEach(o => items.push(o.app_combined_name)); - return items.length ? items : ['列表为空']; + return items.length ? items : [ '列表为空' ]; })(), }); diag_restore_list.on('positive', () => diag_restore_list.dismiss()); @@ -1633,13 +1633,13 @@ let $$init = { _page_view['_check_all'].setChecked(false); }); diag.show(); - }], - ['delete_forever', 'REMOVE', 'OFF', (btn_view) => { + } ], + [ 'delete_forever', 'REMOVE', 'OFF', (btn_view) => { let deleted_items_idx = ds_k + '_deleted_items_idx'; let deleted_items_idx_count = ds_k + '_deleted_items_idx_count'; if (!$$ses[deleted_items_idx_count]) return; - let thread_items_stable = threadsx.start(function () { + let thread_items_stable = threads.start(function () { let old_count = undefined; while ($$ses[deleted_items_idx_count] !== old_count) { old_count = $$ses[deleted_items_idx_count]; @@ -1669,8 +1669,8 @@ let $$init = { _page_view['_check_all'].setChecked(true); _page_view['_check_all'].setChecked(false); btn_view.switch_off(); - }], - ['add_circle', 'NEW', 'ON', () => { + } ], + [ 'add_circle', 'NEW', 'ON', () => { let _tmp_selected = []; let _blist_selected = []; let _page_view = $$view.findViewByTag(p_view, 'list_page_view').getParent(); @@ -1680,19 +1680,19 @@ let $$init = { let diag = dialogsx.builds([ '添加新数据', '从应用列表中选择并添加应用\n或检索选择应用', - ['从列表中选择', 'hint'], - ['检索选择', 'hint'], + [ '从列表中选择', 'hint' ], + [ '检索选择', 'hint' ], '确认添加', 1, - ], {items: ['\xa0']}); + ], { items: [ '\xa0' ] }); diag.on('neutral', () => { let _diag = dialogsx .builds([ '列表选择应用', '', - ['刷新列表', 'hint'], - ['显示系统应用', 'reset'], + [ '刷新列表', 'hint' ], + [ '显示系统应用', 'reset' ], '确认选择', 1, ], { - items: ['\xa0'], + items: [ '\xa0' ], itemsSelectMode: 'multi', }) .on('neutral', _refreshDiagList) @@ -1725,15 +1725,15 @@ let $$init = { ds.setItems(Array(15).join('... ...,').split(',').slice(0, -1)); ds.setContent('当前可添加的应用总数: ... ...'); ds.setSelectedIndices([]); - threadsx.start(function () { - let _opt = {exclude: _blist_selected.concat(_tmp_selected)}; + threads.start(function () { + let _opt = { exclude: _blist_selected.concat(_tmp_selected) }; if (dialogsx.getActionButton(ds, 'negative').match(/显示/)) { _opt.is_system = false; } let _items = appx.getInstalledApplications(_opt).getJointStrArr(); ui.post(function () { ds.setSelectedIndices([]); - ds.setItems(_items.length ? _items : ['列表为空']); + ds.setItems(_items.length ? _items : [ '列表为空' ]); ds.setContent('当前可添加的应用总数: ' + _items.length); }); }); @@ -1752,7 +1752,7 @@ let $$init = { view['refresh_btn'].setText('刷新'); }, list_item(item, closeListPage) { - let _excluded = [_blist_selected, _tmp_selected]; + let _excluded = [ _blist_selected, _tmp_selected ]; for (let i = 0, l = _excluded.length; i < l; i += 1) { if (_excluded[i].includes(item)) { @@ -1770,7 +1770,7 @@ let $$init = { }); diag.on('positive', () => { _tmp_selected.forEach((n) => { - $$view.updateDataSource(ds_k, 'update_unshift', {app_combined_name: n}); + $$view.updateDataSource(ds_k, 'update_unshift', { app_combined_name: n }); }); if (_tmp_selected.length) { setTimeout(function () { @@ -1788,7 +1788,7 @@ let $$init = { let diag_items = diag.getItems().toArray(); if (diag_items.length !== 1 || diag_items[0] !== '\xa0') { dialogsx - .builds(['确认移除此项吗', '', 0, 'B', 'S', 1]) + .builds([ '确认移除此项吗', '', 0, 'B', 'S', 1 ]) .on('negative', ds => ds.dismiss()) .on('positive', (ds) => { _tmp_selected.splice(idx, 1); @@ -1806,14 +1806,14 @@ let $$init = { function _refreshDiag() { let _tmp_len = _tmp_selected.length; - let _tmp = _tmp_len ? _tmp_selected : ['\xa0']; + let _tmp = _tmp_len ? _tmp_selected : [ '\xa0' ]; diag.setItems(_tmp); let content_info = _tmp_len ? ('当前选择区应用总数: ' + _tmp_len) : '从列表中选择并添加应用\n或检索选择并添加应用'; diag.setContent(content_info); } - }], + } ], ]; } }, @@ -1945,8 +1945,8 @@ let $$init = { } function _addButtons() { - let {buttons: _btns} = _par; - let {additional: _addn} = _btns; + let { buttons: _btns } = _par; + let { additional: _addn } = _btns; _addn && _addAddnBtns(_addn); @@ -2011,7 +2011,7 @@ let $$init = { // tool function(s) // function _addAddnBtns(addn) { - let _addi_btns = $$arr(addn) ? addn.slice() : [addn]; + let _addi_btns = $$arr(addn) ? addn.slice() : [ addn ]; let _addi_btn_view = ui.inflate( @@ -2074,7 +2074,7 @@ let $$init = { let picker_views = params.picker_views; let date_or_time_indices = []; - ['date', 'time'].forEach((aim_type) => { + [ 'date', 'time' ].forEach((aim_type) => { picker_views.forEach((o, idx) => aim_type === o.type && date_or_time_indices.push(idx)); }); let date_or_time_len = date_or_time_indices.length; @@ -2126,9 +2126,9 @@ let $$init = { ); let text_widget = picker_view['picker_title']; - let {text, text_color, type, init} = o; + let { text, text_color, type, init } = o; text && text_widget.setText(text); - text_color && text_widget.setTextColor(colorsx.toInt(text_color)); + text_color && text_widget.setTextColor(colors.toInt(text_color)); if (type === 'time') { picker_view['picker_root'].addView(ui.inflate( @@ -2142,7 +2142,7 @@ let $$init = { } if ($$num(init) && init.toString().match(/^\d{13}$/)) { let date = new Date(init); - init = [date.getHours(), date.getMinutes()]; + init = [ date.getHours(), date.getMinutes() ]; } if ($$arr(init)) { picker_view['picker'].setHour(init[0]); @@ -2174,7 +2174,7 @@ let $$init = { onDateChanged: setTimeStr, })); } else if (type === 'week') { - let weeks = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + let weeks = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]; let checkbox_views = ui.inflate( @@ -2196,7 +2196,7 @@ let $$init = { checkbox_views['week_' + i].setText(weeks[i]); checkbox_views['week_' + i].on('check', (checked, view) => { week_checkbox_states[weeks.indexOf(view.text)] = checked; - threadsx.start(function () { + threads.start(function () { let max_try_times = 20; let interval = setInterval(function () { if (!max_try_times--) return clearInterval(interval); @@ -2214,8 +2214,8 @@ let $$init = { picker_view['picker_root'].addView(checkbox_views); if (init) { - if ($$num(init)) { - init = timersx.timeFlagConverter(init); + if (typeof init === 'number') { + init = tasks.timeFlagToDays(init); } init.forEach(n => picker_view['checkboxes']['week_' + n].setChecked(true)); } @@ -2227,7 +2227,7 @@ let $$init = { picker_widget.setOnTimeChangedListener(setTimeStr); } - let {yy, MM, dd, hh, mm} = { + let { yy, MM, dd, hh, mm } = { yy() { try { return picker_widget.getYear(); @@ -2307,8 +2307,8 @@ let $$init = { } function setTimeStr() { - let {picker_views} = params || []; - let {prefix, format, suffix, middle} = params.time_str || {}; + let { picker_views } = params || []; + let { prefix, format, suffix, middle } = params.time_str || {}; let getTimeInfoFromPicker = num => time_picker_view.getPickerTimeInfo[num]; prefix = prefix && prefix.replace(/: ?/, '') + ': ' || ''; @@ -2355,7 +2355,7 @@ let $$init = { ); if ((params.buttons || {}).reserved_btn) { - let {text, onClickListener} = params.buttons.reserved_btn; + let { text, onClickListener } = params.buttons.reserved_btn; let reserved_btn_view = btn_view['reserved_btn']; reserved_btn_view.setVisibility(0); text && reserved_btn_view.setText(text); @@ -2366,7 +2366,7 @@ let $$init = { time_picker_view['time_picker_view_main'].addView(btn_view); if ((params.buttons || {}).back_btn) { - let {text, onClickListener} = params.buttons.back_btn; + let { text, onClickListener } = params.buttons.back_btn; let confirm_btn_view = btn_view['back_btn']; text && confirm_btn_view.setText(text); onClickListener && confirm_btn_view.on('click', () => { @@ -2377,7 +2377,7 @@ let $$init = { } if ((params.buttons || {}).confirm_btn) { - let {text, onClickListener} = params.buttons.confirm_btn; + let { text, onClickListener } = params.buttons.confirm_btn; let confirm_btn_view = btn_view['confirm_btn']; text && confirm_btn_view.setText(text); onClickListener && confirm_btn_view.on('click', () => { @@ -2409,7 +2409,7 @@ let $$init = { } }, setListItemsSearchAndSelectView(data_source_src, listeners, is_empty_prompt) { - let {refresh_btn, list_item, on_finish} = listeners; + let { refresh_btn, list_item, on_finish } = listeners; if (!$$und(global.$$ses)) { $$ses.back_btn_consumed = true; @@ -2476,8 +2476,8 @@ let $$init = { // tool function(s) // function _afterTextChanged(input_text) { - threadsx.interrupt(_thd_calc_n_set_input); - _thd_calc_n_set_input = threadsx.start(function () { + threads.interrupt(_thd_calc_n_set_input); + _thd_calc_n_set_input = threads.start(function () { let _ds = []; if (input_text) { _ds_ori.forEach((name) => { @@ -2506,7 +2506,7 @@ let $$init = { data_source = data_source || data_source_src; $$ses.list_refreshing_counter = $$ses.list_refreshing_counter || 0; if (!$$ses.list_refreshing_counter) { - threadsx.start(function () { + threads.start(function () { $$ses.list_refreshing_counter += 1; let _ds = $$func(data_source) ? data_source() : data_source; if (!_ds.length && is_empty_prompt) { @@ -2543,26 +2543,26 @@ let $$init = { }, setTimersUninterruptedCheckAreasPageButtons(p_view, ds_k) { return $$view.setButtons(p_view, ds_k, - ['restore', 'RESTORE', 'OFF', (btn_view) => { + [ 'restore', 'RESTORE', 'OFF', (btn_view) => { let list_data_backup = $$cfg.sto[ds_k]; if (Object.isDeepEqual($$cfg.ses[ds_k], list_data_backup)) return; let diag = dialogsx.builds([ '恢复列表数据', 'restore_original_list_data', - ['查看恢复列表', 'hint'], 'B', 'K', 1, + [ '查看恢复列表', 'hint' ], 'B', 'K', 1, ]); diag.on('neutral', () => { - let diag_restore_list = dialogsx.builds(['查看恢复列表', '', 0, 0, 'B', 1], { + let diag_restore_list = dialogsx.builds([ '查看恢复列表', '', 0, 0, 'B', 1 ], { content: '共计 ' + list_data_backup.length + ' 项', items: (function $iiFe() { let split_line = ''; for (let i = 0; i < 18; i += 1) split_line += '- '; - let items = [split_line]; + let items = [ split_line ]; list_data_backup.forEach((o) => { items.push('区间: ' + $$tool.timeSectionToStr(o.section)); items.push('间隔: ' + o.interval + '分钟'); items.push(split_line); }); - return items.length > 1 ? items : ['列表为空']; + return items.length > 1 ? items : [ '列表为空' ]; })(), }); diag_restore_list.on('positive', () => diag_restore_list.dismiss()); @@ -2586,14 +2586,14 @@ let $$init = { _page_view['_check_all'].setChecked(false); }); diag.show(); - }], - ['delete_forever', 'REMOVE', 'OFF', (btn_view) => { + } ], + [ 'delete_forever', 'REMOVE', 'OFF', (btn_view) => { let deleted_items_idx = ds_k + '_deleted_items_idx'; let deleted_items_idx_count = ds_k + '_deleted_items_idx_count'; if (!$$ses[deleted_items_idx_count]) return; - let thread_items_stable = threadsx.start(function () { + let thread_items_stable = threads.start(function () { let old_count = undefined; while ($$ses[deleted_items_idx_count] !== old_count) { old_count = $$ses[deleted_items_idx_count]; @@ -2618,12 +2618,12 @@ let $$init = { _page_view['_check_all'].setChecked(true); _page_view['_check_all'].setChecked(false); btn_view.switch_off(); - }], - ['add_circle', 'NEW', 'ON', () => { + } ], + [ 'add_circle', 'NEW', 'ON', () => { let _diag = dialogsx.builds([ '添加延时接力数据', '设置新的时间区间及间隔\n点击可编辑对应项数据', 0, '放弃添加', '确认添加', 1, - ], {items: ['\xa0']}); + ], { items: [ '\xa0' ] }); refreshItems(); @@ -2638,7 +2638,7 @@ let $$init = { } }; let _items = _diag.getItems().toArray(); - let [_sect, _itv] = _items.map(x => x.split(': ')[1]); + let [ _sect, _itv ] = _items.map(x => x.split(': ')[1]); $$view.updateDataSource(ds_k, 'update', { section: sectionStringTransform().backward(_sect), interval: +_itv, @@ -2660,8 +2660,8 @@ let $$init = { _diag.dismiss(); $$view.setTimePickerView({ picker_views: [ - {type: 'time', text: '设置开始时间', init: $$tool.timeStrToSection(_cnt)[0]}, - {type: 'time', text: '设置结束时间', init: $$tool.timeStrToSection(_cnt)[1]}, + { type: 'time', text: '设置开始时间', init: $$tool.timeStrToSection(_cnt)[0] }, + { type: 'time', text: '设置结束时间', init: $$tool.timeStrToSection(_cnt)[1] }, ], time_str: { suffix(getStrFunc) { @@ -2677,7 +2677,7 @@ let $$init = { if (_pref === '间隔') { dialogsx - .builds(['修改' + _pref, '', 0, 'B', 'M', 1], { + .builds([ '修改' + _pref, '', 0, 'B', 'M', 1 ], { inputHint: '{x|1<=x<=600,x∈N}', inputPrefill: _cnt.toString(), }) @@ -2716,38 +2716,38 @@ let $$init = { Object.keys(value_obj).forEach(key => items.push(key + ': ' + value_obj[key])); _diag.setItems(items); } - }]); + } ]); }, setStatPageButtons(p_view, ds_k) { return $$view.setButtons(p_view, ds_k, - ['loop', 'FRI_LS', 'ON', () => { + [ 'loop', 'FRI_LS', 'ON', () => { $$tool.refreshFriLstByLaunchAlipay({ dialog_prompt: true, onResume() { $$view.statListDataSource('SET'); }, }); - }], ['filter_list', 'FILTER', 'ON', () => { - let _show_zero = $$ses.stat_list_show_zero; - let _sess_sel_idx = $$und(_show_zero) ? $$cfg.ses.stat_list_show_zero : _show_zero; + } ], [ 'filter_list', 'FILTER', 'ON', () => { + let _show_zero = $$ses.statListShowZero; + let _sess_sel_idx = $$und(_show_zero) ? $$cfg.ses.statListShowZero : _show_zero; dialogsx .builds([ - '收取值筛选', '', ['设为默认值', 'hint'], 'B', 'K', 1, + '收取值筛选', '', [ '设为默认值', 'hint' ], 'B', 'K', 1, ], { - items: _getItems($$sto.af_cfg.get('config', {}).stat_list_show_zero), + items: _getItems($$sto.af_cfg.get('config', {}).statListShowZero), itemsSelectMode: 'single', itemsSelectedIndex: _sess_sel_idx, }) .on('neutral', (d) => { let _sel_i = d.getSelectedIndex(); - $$sto.af_cfg.put('config', {stat_list_show_zero: _sel_i}); + $$sto.af_cfg.put('config', { statListShowZero: _sel_i }); d.setItems(_getItems(_sel_i)); }) .on('negative', (d) => { d.dismiss(); }) .on('positive', (d) => { - $$ses.stat_list_show_zero = d.getSelectedIndex(); + $$ses.statListShowZero = d.getSelectedIndex(); $$view.statListDataSource('SET'); d.dismiss(); }) @@ -2757,18 +2757,18 @@ let $$init = { /** @return {string[]} */ function _getItems(idx) { - return ['显示全部收取值', '不显示零收取值', '仅显示零收取值'] + return [ '显示全部收取值', '不显示零收取值', '仅显示零收取值' ] .map((v, i) => v + (i === idx ? ' (默认值)' : '')); } - }], ['date_range', 'RANGE', 'ON', () => { - let _range = $$ses.stat_list_date_range; - let _sess_sel_idx = $$und(_range) ? $$cfg.ses.stat_list_date_range : _range; + } ], [ 'date_range', 'RANGE', 'ON', () => { + let _range = $$ses.statListDateRange; + let _sess_sel_idx = $$und(_range) ? $$cfg.ses.statListDateRange : _range; let _posFunc = d => _posDefault(d); let _diag = dialogsx.builds([ - '日期统计范围', '', ['设为默认值', 'hint'], 'B', 'K', 1, + '日期统计范围', '', [ '设为默认值', 'hint' ], 'B', 'K', 1, ], { items: $$view.getStatPageItems({ - def: $$sto.af_cfg.get('config', {}).stat_list_date_range, + def: $$sto.af_cfg.get('config', {}).statListDateRange, }), itemsSelectMode: 'single', itemsSelectedIndex: _sess_sel_idx, @@ -2777,8 +2777,8 @@ let $$init = { if (!_sel_i || _sel_i < 1 || !$$num(_sel_i)) { _sel_i = 0; } - $$sto.af_cfg.put('config', {stat_list_date_range: _sel_i}); - d.setItems($$view.getStatPageItems({def: _sel_i})); + $$sto.af_cfg.put('config', { statListDateRange: _sel_i }); + d.setItems($$view.getStatPageItems({ def: _sel_i })); }).on('negative', (d) => { _thd.interrupt(); d.dismiss(); @@ -2786,17 +2786,17 @@ let $$init = { _posFunc(d); }).show(); - let _thd = threadsx.start(function () { + let _thd = threads.start(function () { let _set_range = '设置范围'; while (1) { if (_diag.getSelectedIndex() === 1) { - if (_diag.getActionButton('positive') === dialogsx.text.btn.K) { + if (_diag.getActionButton('positive').toString() === dialogsx.text.btn.K) { _diag.setActionButton('positive', _set_range); _diag.setActionButton('neutral', null); _posFunc = _posSetRange; } } else { - if (_diag.getActionButton('positive') === _set_range) { + if (_diag.getActionButton('positive').toString() === _set_range) { _diag.setActionButton('positive', dialogsx.text.btn.K); _diag.setActionButton('neutral', dialogsx.text.btn.R); _posFunc = _posDefault; @@ -2810,11 +2810,11 @@ let $$init = { function _posSetRange(d) { d.dismiss(); - let _sess_range = $$ses.stat_list_date_range_data || [0, 1e10 - 1]; + let _sess_range = $$ses.statListDateRangeData || [ 0, 1e10 - 1 ]; $$view.setTimePickerView({ picker_views: [ - {type: 'date', text: '设置开始日期', init: _sess_range[0] * 1e3}, - {type: 'date', text: '设置结束日期', init: _sess_range[1] * 1e3}, + { type: 'date', text: '设置开始日期', init: _sess_range[0] * 1e3 }, + { type: 'date', text: '设置结束日期', init: _sess_range[1] * 1e3 }, ], buttons: { back_btn: { @@ -2826,10 +2826,10 @@ let $$init = { }, onSuccess(ret) { if (ret) { - $$ses.stat_list_date_range = d.getSelectedIndex(); - $$ses.stat_list_date_range_data = $$tool + $$ses.statListDateRange = d.getSelectedIndex(); + $$ses.statListDateRangeData = $$tool .timeStrToSection(ret).map((str, idx) => { - let [yy, mm, dd] = str.split(/\D+/); + let [ yy, mm, dd ] = str.split(/\D+/); // both 'ss' are seconds let _ss1 = +new Date(yy, mm - 1, dd) / 1e3 >>> 0; let _ss2 = idx && 24 * 3.6e6 / 1e3 - 1; @@ -2843,13 +2843,13 @@ let $$init = { function _posDefault(d) { let _idx = d.getSelectedIndex(); - $$ses.stat_list_date_range = _idx; - $$ses.stat_list_date_range_data = $$view.getStatPageItems({sel: _idx}); + $$ses.statListDateRange = _idx; + $$ses.statListDateRangeData = $$view.getStatPageItems({ sel: _idx }); $$view.statListDataSource('SET'); _thd.interrupt(); d.dismiss(); } - }]); + } ]); }, getStatPageItems(opt) { let _opt = opt || {}; @@ -2874,42 +2874,42 @@ let $$init = { _days = !isFinite(_days) ? 1 : _days; return { item: '全部 (共' + _days + '天)', - range: [0, _today_max_sec], + range: [ 0, _today_max_sec ], }; })(), { item: '自定义范围', }, { item: '今天 (' + _pad(_mm + 1) + '/' + _pad(_dd) + ')', - range: [_today_sec, _today_max_sec], + range: [ _today_sec, _today_max_sec ], }, (function $iiFe() { let _date = new Date(+_now - _1_day_ts); let _mm = _date.getMonth(); let _dd = _date.getDate(); return { item: '昨天 (' + _pad(_mm + 1) + '/' + _pad(_dd) + ')', - range: [_today_sec - _1_day_sec, _today_sec - 1], + range: [ _today_sec - _1_day_sec, _today_sec - 1 ], }; })(), { item: '本周 (共' + _day + '天)', - range: [_today_sec - _1_day_sec * (_day - 1), _today_max_sec], + range: [ _today_sec - _1_day_sec * (_day - 1), _today_max_sec ], }, (function $iiFe() { let _date = new Date(+_now - _1_day_ts * 6); let _mm = _date.getMonth(); let _dd = _date.getDate(); return { item: '近7天 (自' + _pad(_mm + 1) + '/' + _pad(_dd) + '至今)', - range: [_today_sec - _1_day_sec * 6, _today_max_sec], + range: [ _today_sec - _1_day_sec * 6, _today_max_sec ], }; })(), { item: '本月 (共' + _dd + '天)', - range: [_today_sec - _1_day_sec * (_dd - 1), _today_max_sec], + range: [ _today_sec - _1_day_sec * (_dd - 1), _today_max_sec ], }, (function $iiFe() { let _date = new Date(+_now - _1_day_ts * 29); let _mm = _date.getMonth(); let _dd = _date.getDate(); return { item: '近30天 (自' + _pad(_mm + 1) + '/' + _pad(_dd) + '至今)', - range: [_today_sec - _1_day_sec * 29, _today_max_sec], + range: [ _today_sec - _1_day_sec * 29, _today_max_sec ], }; })(), ]; @@ -2922,7 +2922,7 @@ let $$init = { }, setTimersControlPanelPageButtons(p_view, data_source_key_name, wizardFunc) { return $$view.setButtons(p_view, data_source_key_name, - ['add_circle', 'NEW', 'ON', () => wizardFunc('add')]); + [ 'add_circle', 'NEW', 'ON', () => wizardFunc('add') ]); }, checkPageState() { let _check = $$view.page.last_rolling.checkPageState; @@ -2939,7 +2939,7 @@ let $$init = { return _deps.call(null); } if (!Array.isArray(_deps)) { - _deps = [_deps]; + _deps = [ _deps ]; } return _deps.some((dep) => $$cfg.ses[dep]); })() ? setViewEnabled(view) : setViewDisabled(view, _deps); @@ -2972,7 +2972,7 @@ let $$init = { view.setChevronVisibility(0); view.setTitleTextColor($$def.colors.item_title); view.setHintTextColor($$def.colors.item_hint); - let {next_page_backup} = view; + let { next_page_backup } = view; next_page_backup && view.setNextPage(next_page_backup); } }, @@ -2981,7 +2981,7 @@ let $$init = { .hideSoftInputFromWindow(view.getWindowToken(), 0); }, commonItemBindCheckboxClickListener(checkbox_view, item_holder) { - let {data_source_key_name: _ds_k} = this; + let { data_source_key_name: _ds_k } = this; let remove_btn_view = $$ses[_ds_k + '_btn_remove']; let item = item_holder.item; let aim_checked = !item.checked; @@ -3067,7 +3067,7 @@ let $$init = { } if (operation.match(/delete|splice/)) { - let _data_params = Array.isArray(data) ? data.slice() : [data]; + let _data_params = Array.isArray(data) ? data.slice() : [ data ]; if (_data_params.length > 2 && !_data_params[2]['list_item_name_0']) { _data_params[2] = _magicData(_data_params[2]); } @@ -3077,7 +3077,7 @@ let $$init = { if (operation.match(/update/)) { if (data && !Array.isArray(data)) { - data = [data]; + data = [ data ]; } if (!$$ses[ds_k]) { $$ses[ds_k] = []; @@ -3127,7 +3127,7 @@ let $$init = { }, showOrHideBySwitch(o, state, hide_when_checked, nearest_end_tag) { let _lbl = o.view.page_view.page_label_name; - timersx.setInterval(_act, 80, _ready); + timers.setIntervalExt(_act, 80, _ready); // tool function(s) // @@ -3172,14 +3172,14 @@ let $$init = { }, weakOrStrongBySwitch(o, state, idx_offset) { let _lbl = o.view.page_view.page_label_name; - timersx.setInterval(_act, 80, _ready); + timers.setIntervalExt(_act, 80, _ready); // tool function(s) // function _act() { ui.post(() => { if (!Array.isArray(idx_offset)) { - idx_offset = [idx_offset || 1]; + idx_offset = [ idx_offset || 1 ]; } let p = o.view.getParent(); let cur_i = p.indexOfChild(o.view); @@ -3188,7 +3188,7 @@ let $$init = { for (let i = 0, l = radio_group_view.getChildCount(); i < l; i += 1) { let v = radio_group_view.getChildAt(i); v.setClickable(state); - v.setTextColor(colorsx.toInt(state + v.setTextColor(colors.toInt(state ? $$def.colors.item_title : $$def.colors.item_title_light)); } @@ -3205,16 +3205,16 @@ let $$init = { * @return {Object[]} */ statListDataSource(act) { - let _range = $$ses.stat_list_date_range_data || []; + let _range = $$ses.statListDateRangeData || []; let _ts_a = _range[0] || 0; let _ts_b = _range[1] || 1e10 - 1; let _ts = _ts_a + ' and ' + _ts_b; - let _zero = $$ses.stat_list_show_zero; - _zero = $$und(_zero) ? $$cfg.ses.stat_list_show_zero : _zero; - let [_show_zero, _show_other] = [0, 1]; + let _zero = $$ses.statListShowZero; + _zero = $$und(_zero) ? $$cfg.ses.statListShowZero : _zero; + let [ _show_zero, _show_other ] = [ 0, 1 ]; if (_zero === 2) { - [_show_zero, _show_other] = [1, 0]; + [ _show_zero, _show_other ] = [ 1, 0 ]; } else if ($$0(_zero)) { _show_zero = 1; } @@ -3226,7 +3226,7 @@ let $$init = { if ($$und($$ses.list_data_min_ts)) { let _data = $$ses.db.rawQueryData('select timestamp as ts from ant_forest'); - $$ses.list_data_min_ts = Math.mini(_data.map(o => Number(o.ts))) * 1e3; + $$ses.list_data_min_ts = Mathx.min(_data.map(o => Number(o.ts))) * 1e3; } _show_other && _db_data.unshift({ @@ -3243,7 +3243,7 @@ let $$init = { _fri_lst.list_data.forEach((o) => { let _nick = o.nickname; if (!_db_nickname.includes(_nick)) { - _db_data.push({name: _nick, pick: 0}); + _db_data.push({ name: _nick, pick: 0 }); } }); } @@ -3255,7 +3255,7 @@ let $$init = { if (_zero === 2) { _db_data.sort((a, b) => { - let [_a, _b] = [a.name, b.name]; + let [ _a, _b ] = [ a.name, b.name ]; if (_a === _b) { return 0; } @@ -3263,7 +3263,7 @@ let $$init = { }); } else { _db_data.sort((a, b) => { - let [_a, _b] = [+a.pick, +b.pick]; + let [ _a, _b ] = [ +a.pick, +b.pick ]; if (_a === _b) { return 0; } @@ -3276,12 +3276,12 @@ let $$init = { } $$ses.stat_list.splice(0); - $$view.updateDataSource('stat_list', 'update', _db_data, {write_back: false}); + $$view.updateDataSource('stat_list', 'update', _db_data, { write_back: false }); }, }; global.$$ses = { - db: db.create('af', {alter_type: 'union'}), + db: db.create('af', { alterType: 'union' }), }; global.$$save = { @@ -3292,12 +3292,12 @@ let $$init = { } if (!quiet_flag) { $$lsn.emit('update_all'); - threadsx.start(function () { + threads.start(function () { let btn_save = null; a11yx.wait(() => btn_save = $$ses['homepage_btn_save'], 10e3, 80); - ui.post(() => { - $$save.trigger() ? btn_save.switch_on() : btn_save.switch_off(); - }); + ui.post(() => $$save.trigger() + ? btn_save.switch_on() + : btn_save.switch_off()); }); } }, @@ -3307,7 +3307,7 @@ let $$init = { writeUnlockStorage(); writeBlacklist(); // only 'cfg' reserved now (without unlock, blacklist, etc) - $$sto.af_cfg.put('config', sess_cfg_mixed, {is_forcible: true}); + $$sto.af_cfg.put('config', sess_cfg_mixed, { is_forcible: true }); $$cfg.sto = Object.deepClone($$cfg.ses); return true; @@ -3341,16 +3341,16 @@ let $$init = { timestamp: o.timestamp, }); }); - let _blist_cvr = sess_cfg_mixed.blacklist_protect_cover; + let _blist_cvr = sess_cfg_mixed.blacklist_shield; _blist_cvr.forEach((o) => { _blist.push({ name: o.name, - reason: 'protect_cover', + reason: 'shield', timestamp: o.timestamp, }); }); $$sto.af_blist.put('blacklist', _blist); - delete sess_cfg_mixed.blacklist_protect_cover; + delete sess_cfg_mixed.blacklist_shield; delete sess_cfg_mixed.blacklist_by_user; } }, @@ -3409,12 +3409,12 @@ let $$init = { return (new (Function.prototype.bind.apply(Date, _args))).getTime(); }, restoreFromTimedTaskTypeStr(str) { - if (str === '每日') return [0, 1, 2, 3, 4, 5, 6]; + if (str === '每日') return [ 0, 1, 2, 3, 4, 5, 6 ]; if (str.match(/每周/)) return str.split(/\D/).filter(x => x !== '').map(x => +x === 7 ? 0 : +x).sort(); return str === '一次性' ? 0 : str; }, refreshFriLstByLaunchAlipay(params) { - let {dialog_prompt, onTrigger, onResume} = params || {}; + let { dialog_prompt, onTrigger, onResume } = params || {}; if (dialog_prompt) { dialogsx.builds([ @@ -3434,7 +3434,7 @@ let $$init = { function refreshNow() { $$func(onTrigger) && onTrigger(); - filesx.run('launcher$', {cmd: 'get_rank_list_names', monitor: 'ensure_open'}); + filesx.run('launcher$', { cmd: 'get_rank_list_names', monitor: 'ensure_open' }); $$func(onResume) && ui.emitter.prependOnceListener('resume', onResume); setTimeout(() => toast('即将打开"支付宝"刷新好友列表'), 500); } @@ -3442,10 +3442,10 @@ let $$init = { accountNameConverter(str, opr) { let _str = str || ''; let _res = ''; - let _factor = {e: 1, d: -1}[opr[0]]; + let _factor = { e: 1, d: -1 }[opr[0]]; for (let i in _str) { let _char_code = _str.charCodeAt(+i); - let _shifting = ((996).ICU + +i) * _factor; + let _shifting = (Numberx.ICU + +i) * _factor; _res += String.fromCharCode(_char_code + _shifting); } return _res; @@ -3495,7 +3495,7 @@ let $$init = { let _par = $$obj(hint) ? hint : params || {}; let _hint = $$obj(hint) ? '' : hint === 'hint' ? '加载中...' : hint; - Object.assign(this, {hint: _hint, title: title}, _par); + Object.assign(this, { hint: _hint, title: title }, _par); let _conj = _par.config_conj; if (_conj) { @@ -3506,11 +3506,11 @@ let $$init = { Object.defineProperties(this, (function $iiFe() { let _props = { - newWindow: {get: () => _par.newWindow.bind(this)}, - infoWindow: {get: () => _par.infoWindow.bind(this)}, - listeners: {get: () => _par.listeners}, - updateOpr: {get: () => view => _par.updateOpr(view)}, - custom_data_source: {get: () => _par.custom_data_source}, + newWindow: { get: () => _par.newWindow.bind(this) }, + infoWindow: { get: () => _par.infoWindow.bind(this) }, + listeners: { get: () => _par.listeners }, + updateOpr: { get: () => view => _par.updateOpr(view) }, + custom_data_source: { get: () => _par.custom_data_source }, }; Object.keys(_props).forEach(k => _par[k] || delete _props[k]); return _props; @@ -3534,8 +3534,8 @@ let $$init = { $$cfg.ses = Object.deepClone($$cfg.sto); } - threadsx.start(_initProjBackups); - threadsx.start(_initStatData); + threads.start(_initProjBackups); + threads.start(_initStatData); return this; @@ -3553,7 +3553,7 @@ let $$init = { if (Array.isArray(_blist_sto)) { _blist_data = _blist_sto.slice(); - } else if (isPlainObject(_blist_sto)) { + } else if (isObjectSpecies(_blist_sto)) { _blist_data = Object.keys(_blist_sto).map((name) => ({ name: name, timestamp: _blist_sto[name].timestamp, @@ -3562,8 +3562,8 @@ let $$init = { } for (let o of _blist_data) { - let _data = {name: o.name, timestamp: o.timestamp}; - if (o.reason === 'protect_cover') { + let _data = { name: o.name, timestamp: o.timestamp }; + if (o.reason === 'shield') { _blist_cvr.push(_data); } else if (o.reason === 'by_user') { _blist_usr.push(_data); @@ -3571,7 +3571,7 @@ let $$init = { } let _res = { - blacklist_protect_cover: _blist_cvr, + blacklist_shield: _blist_cvr, blacklist_by_user: _blist_usr, }; Object.assign($$ses, _res); @@ -3625,7 +3625,7 @@ let $$init = { .slice(0, 200 - Object.keys(_sto_data).length) .forEach((name) => { let _fp = files.join(_path, name); // full path - let [_ts, _ver] = files.getNameWithoutExtension(_fp).split('-'); + let [ _ts, _ver ] = files.getNameWithoutExtension(_fp).split('-'); _sto_data.push({ path: _fp, version_name: appx.version.parseHex(_ver), @@ -3643,10 +3643,10 @@ let $$init = { function _initStatData() { delete $$ses.stat_page_updated; - threadsx.start(function () { + threads.start(function () { if (a11yx.wait(() => $$view && $$view.statListDataSource, 60e3)) { - $$ses.stat_list_date_range_data = $$view.getStatPageItems({ - sel: $$sto.af_cfg.get('config', {}).stat_list_date_range || 0, + $$ses.statListDateRangeData = $$view.getStatPageItems({ + sel: $$sto.af_cfg.get('config', {}).statListDateRange || 0, }); $$ses.init_stat_list_data = $$view.statListDataSource('GET'); $$ses.stat_page_updated = true; @@ -3679,8 +3679,8 @@ let $$init = { function _quitConfirm() { dialogsx - .builds(['设置未保存', '确定要退出吗', - 'B', ['强制退出', 'caution'], ['保存并退出', 'hint'], 1, + .builds([ '设置未保存', '确定要退出吗', + 'B', [ '强制退出', 'caution' ], [ '保存并退出', 'hint' ], 1, ]) .on('neutral', d => d.dismiss()) .on('negative', _quitNow) @@ -3693,7 +3693,6 @@ let $$init = { } function _quitNow() { - dialogsx.clearPool(); ui.finish(); } }); @@ -3702,13 +3701,11 @@ let $$init = { // even if in vain with a strong possibility events.on('exit', () => { $$ses.on_exit_flag = true; - $$view.updateViewByTag('aj_global_log_switch'); + $$view.updateViewByTag('autojsGlobalLogSwitch'); $$lsn.removeAllListeners(); threads.shutDownAll(); uix.main.getParent().removeAllViews(); - dialogsx.clearPool(); - imagesx.clearPool(); $$ses.db.close(); ui.finish(); @@ -3727,7 +3724,7 @@ let $$init = { $$view.dyn_pages.forEach(view => view.updateOpr(view)); }); - if ($$cfg.ses.update_auto_check_switch && $$cfg.ses.update_show_on_af_settings) { + if ($$cfg.ses.updateAutoCheckSwitch && $$cfg.ses.updateShowOnAfSettings) { project.getNewestReleaseCared({ min_version_name: 'v2.0.1', ignore_list: $$ses.ignore_list, @@ -3739,23 +3736,23 @@ let $$init = { onClick() { dialogsx.builds([ '版本详情', newest.brief_info_str, - ['忽略此版本', 'warn'], 'B', - ['立即更新', 'attraction'], 1, + [ '忽略此版本', 'warn' ], 'B', + [ '立即更新', 'attraction' ], 1, ]).on('neutral', (d) => { d.dismiss(); dialogsx.builds([ '版本忽略提示', 'update_ignore_confirm', - 0, 'Q', ['确定忽略', 'caution'], 1, + 0, 'Q', [ '确定忽略', 'caution' ], 1, ]).on('negative', (ds) => { d.show(); ds.dismiss(); }).on('positive', (ds) => { ds.dismiss(); - let _k = 'update_ignore_list'; + let _k = 'updateIgnoreList'; let _new = {}; - let _data = $$cfg.ses[_k].concat([newest.version_name]); + let _data = $$cfg.ses[_k].concat([ newest.version_name ]); _new[_k] = $$cfg.ses[_k] = _data; - $$view.updateViewByTag('update_ignore_list'); + $$view.updateViewByTag('updateIgnoreList'); $$sto.af_cfg.put('config', _new); toast('已忽略当前版本', 'long'); }).show(); @@ -3787,14 +3784,14 @@ $$init.check().global().config().listener(); $$view.setHomePage($$def.homepage_title) .add('subhead', new Layout('基本功能')) .add('page', new Layout('自收功能', 'hint', { - config_conj: 'self_collect_switch', + config_conj: 'selfCollectSwitch', next_page: 'self_collect_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); }, })) .add('page', new Layout('收取功能', 'hint', { - config_conj: 'friend_collect_switch', + config_conj: 'friendCollectSwitch', next_page: 'friend_collect_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); @@ -3802,35 +3799,35 @@ $$view.setHomePage($$def.homepage_title) })) .add('subhead', new Layout('高级功能')) .add('page', new Layout('自动解锁', 'hint', { - config_conj: 'auto_unlock_switch', + config_conj: 'autoUnlockSwitch', next_page: 'auto_unlock_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); }, })) .add('page', new Layout('消息提示', 'hint', { - config_conj: 'message_showing_switch', + config_conj: 'messageShowingSwitch', next_page: 'message_showing_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); }, })) .add('page', new Layout('本地日志', 'hint', { - config_conj: 'aj_global_log_switch', + config_conj: 'autojsGlobalLogSwitch', next_page: 'aj_global_log_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); }, })) .add('page', new Layout('定时循环', 'hint', { - config_conj: 'timers_switch', + config_conj: 'timersSwitch', next_page: 'timers_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); }, })) .add('page', new Layout('账户功能', 'hint', { - config_conj: 'account_switch', + config_conj: 'accountSwitch', next_page: 'account_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); @@ -3845,7 +3842,7 @@ $$view.setHomePage($$def.homepage_title) } let _view_tag = this.view_tag; view.setNextPage('stat_page'); - threadsx.start(function () { + threads.start(function () { if (!(a11yx.wait(() => $$view.pages[_view_tag], 5e3) && !$$ses.stat_page_created)) { return; } @@ -3865,10 +3862,10 @@ $$view.setHomePage($$def.homepage_title) let _name = item[item['name']]; - dialogsx.builds([['小心', 'caution'], - ['要删除以下用户的所有统计数据吗?\n\n' + - '用户昵称:\n' + _name + '\n\n此操作无法撤销', 'warn'], - 0, 'Q', ['S', 'caution'], 1, + dialogsx.builds([ [ '小心', 'caution' ], + [ '要删除以下用户的所有统计数据吗?\n\n' + + '用户昵称:\n' + _name + '\n\n此操作无法撤销', 'warn' ], + 0, 'Q', [ 'S', 'caution' ], 1, ]).on('negative', (d) => { d.dismiss(); }).on('positive', (d) => { @@ -3884,16 +3881,16 @@ $$view.setHomePage($$def.homepage_title) }); }, })) - .add('page', new Layout('黑名单管理', {next_page: 'blacklist_page'})) - .add('page', new Layout('运行与安全', {next_page: 'script_security_page'})) + .add('page', new Layout('黑名单管理', { next_page: 'blacklist_page' })) + .add('page', new Layout('运行与安全', { next_page: 'script_security_page' })) .add('subhead', new Layout('备份与还原')) .add('button', new Layout('还原初始设置', { newWindow() { dialogsx .builds([ '还原初始设置', 'restore_all_settings', - ['了解内部配置', 'hint'], - 'Q', ['全部还原', 'warn'], 1, + [ '了解内部配置', 'hint' ], + 'Q', [ '全部还原', 'warn' ], 1, ]) .on('neutral', () => { dialogsx.builds([ @@ -3908,7 +3905,7 @@ $$view.setHomePage($$def.homepage_title) dialogsx .builds([ '全部还原', '确定要还原全部设置吗', - 0, 'Q', ['全部还原', 'caution'], 1, + 0, 'Q', [ '全部还原', 'caution' ], 1, ]) .on('positive', (ds) => { $$init.config('reset'); @@ -3923,10 +3920,10 @@ $$view.setHomePage($$def.homepage_title) .show(); }, })) - .add('page', new Layout('项目备份还原', {next_page: 'local_project_backup_restore_page'})) + .add('page', new Layout('项目备份还原', { next_page: 'local_project_backup_restore_page' })) .add('subhead', new Layout('关于')) .add('page', new Layout('自动检查更新', 'hint', { - config_conj: 'update_auto_check_switch', + config_conj: 'updateAutoCheckSwitch', next_page: 'update_auto_check_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); @@ -3942,8 +3939,8 @@ $$view.setHomePage($$def.homepage_title) '最新版本: '; let _diag = dialogsx - .builds(['关于', _ori_cont + '检查中...', 0, 'B', '检查更新', 1], { - items: ['开发者: SuperMonster003'], + .builds([ '关于', _ori_cont + '检查中...', 0, 'B', '检查更新', 1 ], { + items: [ '开发者: SuperMonster003' ], }) .on('negative', (d) => { d.dismiss(); @@ -3970,7 +3967,7 @@ $$view.setHomePage($$def.homepage_title) } $$ses.is_checking_update = true; - $$ses.thd_checking_update = threadsx.start(function () { + $$ses.thd_checking_update = threads.start(function () { /** @type {GitHub.Releases.ExtendedListItem|string} */ let _new_ver = ''; try { @@ -3979,13 +3976,13 @@ $$view.setHomePage($$def.homepage_title) _diag.setContent(_ori_cont + '检查中...'); dialogsx.setActionButtonColor(_diag, 'positive', 'unavailable'); - timersx.rec.save('check_update'); + recorder.save('check_update'); _new_ver = project.getNewestReleaseCared({ min_version_name: 'v2.0.1', ignore_list: $$ses.ignore_list, }); } catch (e) { - _new_ver = timersx.rec('check_update') > 1e3 ? '检查超时' : '检查失败'; + _new_ver = recorder('check_update') > 1e3 ? '检查超时' : '检查失败'; } finally { let _new_ver_name = typeof _new_ver === 'object' ? _new_ver.version_name : _new_ver; @@ -4003,7 +4000,7 @@ $$view.setHomePage($$def.homepage_title) dialogsx .builds([ _new_ver_name, _new_ver.brief_info_str, - ['查看历史更新', 'hint'], 'B', ['立即更新', 'attraction'], 1, + [ '查看历史更新', 'hint' ], 'B', [ '立即更新', 'attraction' ], 1, ]) .on('neutral', () => { project.getChangelog(_new_ver_name.match(/v(\d+)/)[1], { @@ -4028,7 +4025,7 @@ $$view.setHomePage($$def.homepage_title) dialogsx.setActionButton(_diag, 'neutral', '查看历史更新', 'hint'); _diag.on('neutral', () => { let _ver_num = (_new_ver_name || _local_ver).match(/v(\d+)/)[1]; - project.getChangelog(_ver_num, {is_show_dialog: true}); + project.getChangelog(_ver_num, { is_show_dialog: true }); }); } @@ -4091,7 +4088,7 @@ $$view.setHomePage($$def.homepage_title) $$ses.avatar_recycle_opr_working_flag = true; let _recycle = [ - {name: 'avatar', src: _local_avt || _avt_det, desc: _local_avt_txt}, + { name: 'avatar', src: _local_avt || _avt_det, desc: _local_avt_txt }, ]; _setAnm('vanish'); @@ -4113,15 +4110,15 @@ $$view.setHomePage($$def.homepage_title) let _is_vanish = flg === 'vanish'; let _anm_y = android.animation.ObjectAnimator.ofFloat( _add_view['_avatar_desc'], 'translationY', - [-100 * (+!_is_vanish), -100 * (+_is_vanish)]); + [ -100 * (+!_is_vanish), -100 * (+_is_vanish) ]); let _anm_scale_x = android.animation.ObjectAnimator.ofFloat( _add_view['_avatar'], 'scaleX', - [+_is_vanish, +!_is_vanish]); + [ +_is_vanish, +!_is_vanish ]); let _anm_scale_y = android.animation.ObjectAnimator.ofFloat( _add_view['_avatar'], 'scaleY', - [+_is_vanish, +!_is_vanish]); + [ +_is_vanish, +!_is_vanish ]); let _anm_set = new android.animation.AnimatorSet(); - _anm_set.playTogether([_anm_y, _anm_scale_x, _anm_scale_y]); + _anm_set.playTogether([ _anm_y, _anm_scale_x, _anm_scale_y ]); _anm_set.setDuration(200); _anm_set.start(); } @@ -4161,7 +4158,7 @@ $$view.setHomePage($$def.homepage_title) } let _stop_load_avt_sgn = false; - _thd_load_avt = threadsx.start(function () { + _thd_load_avt = threads.start(function () { try { a11yx.wait(() => _add_view && _add_view['_avatar'], 5e3, 50); let _avt_img = null; @@ -4269,7 +4266,7 @@ $$view.setHomePage($$def.homepage_title) $$view.page.new('自收功能', 'self_collect_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'self_collect_switch', + config_conj: 'selfCollectSwitch', listeners: { _switch: { check(state) { @@ -4285,21 +4282,21 @@ $$view.page.new('自收功能', 'self_collect_page', (t) => { .add('split_line') .add('subhead', new Layout('基本设置')) .add('page', new Layout('循环监测', 'hint', { - config_conj: 'homepage_monitor_switch', + config_conj: 'homepageMonitorSwitch', next_page: 'homepage_monitor_page', updateOpr(view) { - $$view.udop.main_sw.call(this, view, 'timers_switch'); + $$view.udop.main_sw.call(this, view, 'timersSwitch'); }, })) .add('page', new Layout('返检监控', 'hint', { - config_conj: 'homepage_background_monitor_switch', + config_conj: 'homepageBackgroundMonitorSwitch', next_page: 'homepage_background_monitor_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); }, })) .add('page', new Layout('浇水回赠能量球检测', 'hint', { - config_conj: 'homepage_wball_switch', + config_conj: 'homepageWaterBallSwitch', next_page: 'homepage_wball_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); @@ -4315,7 +4312,7 @@ $$view.page.new('自收功能', 'self_collect_page', (t) => { $$view.page.new('主页能量球循环监测', 'homepage_monitor_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'homepage_monitor_switch', + config_conj: 'homepageMonitorSwitch', listeners: { _switch: { check(state) { @@ -4331,17 +4328,17 @@ $$view.page.new('主页能量球循环监测', 'homepage_monitor_page', (t) => { .add('split_line') .add('subhead', new Layout('基本设置')) .add('button', new Layout('监测阈值', 'hint', { - config_conj: 'homepage_monitor_threshold', + config_conj: 'homepageMonitorThreshold', newWindow() { $$view.diag.numSetter.call(this, 1, 3, { title: '主页能量球循环监测阈值', positiveAddn(d, input) { - let _min = $$cfg.ses.homepage_bg_monitor_threshold; + let _min = $$cfg.ses.homepageBackgroundMonitorThreshold; if (input >= _min) { return true; } dialogsx.builds([ - ['注意', 'caution'], + [ '注意', 'caution' ], '监测阈值: ' + input + '\n' + '返检阈值: ' + _min + '\n\n' + '监测阈值不可小于返检阈值\n' + @@ -4363,7 +4360,7 @@ $$view.page.new('主页能量球循环监测', 'homepage_monitor_page', (t) => { $$view.page.new('主页能量球返检监控', 'homepage_background_monitor_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'homepage_background_monitor_switch', + config_conj: 'homepageBackgroundMonitorSwitch', listeners: { _switch: { check(state) { @@ -4379,18 +4376,18 @@ $$view.page.new('主页能量球返检监控', 'homepage_background_monitor_page .add('split_line') .add('subhead', new Layout('基本设置')) .add('button', new Layout('返检阈值', 'hint', { - config_conj: 'homepage_bg_monitor_threshold', + config_conj: 'homepageBackgroundMonitorThreshold', newWindow() { $$view.diag.numSetter.call(this, 1, 3, { title: '主页能量球返检阈值', hint_set: 'R', positiveAddn(d, input) { - let _max = $$cfg.ses.homepage_monitor_threshold; + let _max = $$cfg.ses.homepageMonitorThreshold; if (input <= _max) { return true; } dialogsx.builds([ - ['注意', 'caution'], + [ '注意', 'caution' ], '返检阈值: ' + input + '\n' + '监测阈值: ' + _max + '\n\n' + '返检阈值不可大于监测阈值\n' + @@ -4409,7 +4406,7 @@ $$view.page.new('主页能量球返检监控', 'homepage_background_monitor_page $$view.page.new('浇水回赠能量球检测', 'homepage_wball_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'homepage_wball_switch', + config_conj: 'homepageWaterBallSwitch', listeners: { _switch: { check(state) { @@ -4425,7 +4422,7 @@ $$view.page.new('浇水回赠能量球检测', 'homepage_wball_page', (t) => { .add('split_line') .add('subhead', new Layout('基本设置')) .add('button', new Layout('最大检查次数', 'hint', { - config_conj: 'homepage_wball_check_limit', + config_conj: 'homepageWaterBallCheckLimit', newWindow() { $$view.diag.numSetter.call(this, 10, 300, { title: '浇水回赠球最大检查次数', @@ -4442,7 +4439,7 @@ $$view.page.new('浇水回赠能量球检测', 'homepage_wball_page', (t) => { .add('button', new Layout('最大色相值 (无蓝分量)', 'hint', { config_conj: 'homepageWaterBallMaxHueNoBlue', newWindow() { - $$view.diag.numSetter.call(this, 12, 52, {hint_set: 'R'}); + $$view.diag.numSetter.call(this, 12, 52, { hint_set: 'R' }); }, updateOpr(view) { view.setHintText($$cfg.ses[this.config_conj].toString() + '°'); @@ -4453,7 +4450,7 @@ $$view.page.new('浇水回赠能量球检测', 'homepage_wball_page', (t) => { $$view.page.new('收取功能', 'friend_collect_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'friend_collect_switch', + config_conj: 'friendCollectSwitch', listeners: { _switch: { check(state) { @@ -4479,10 +4476,10 @@ $$view.page.new('收取功能', 'friend_collect_page', (t) => { }); $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { $$view.setPage(t) - .add('subhead', new Layout('采集策略', {color: 'highlight'})) - .add('radio', new Layout(['排行榜列表', '逛一逛按钮'], { - values: [false, true], - config_conj: 'get_targets_by_stroll_btn', + .add('subhead', new Layout('采集策略', { color: 'highlight' })) + .add('radio', new Layout([ '排行榜列表', '逛一逛按钮' ], { + values: [ false, true ], + config_conj: 'getTargetsByStrollButton', listeners: { check(checked, view) { checked && $$save.session(this.config_conj, this.values[this.title.indexOf(view.text)]); @@ -4504,9 +4501,9 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('按钮定位', {color: 'highlight', view_tag: '_get_tar_by_stroll'})) + .add('subhead', new Layout('按钮定位', { color: 'highlight', view_tag: '_get_tar_by_stroll' })) .add('button', new Layout('主要色值', 'hint', { - config_conj: 'stroll_btn_locate_main_color', + config_conj: 'strollButtonLocateMainColor', view_tag: '_get_tar_by_stroll', newWindow() { $$view.diag.colorSetter.call(this, { @@ -4518,7 +4515,7 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('button', new Layout('匹配阈值', 'hint', { - config_conj: 'stroll_btn_match_threshold', + config_conj: 'strollButtonMatchThreshold', view_tag: '_get_tar_by_stroll', newWindow() { $$view.diag.numSetter.call(this, 2, 32, { @@ -4530,9 +4527,9 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('invisible_split_line') - .add('subhead', new Layout('页面滑动', {color: 'highlight', view_tag: '_get_tar_by_rl'})) + .add('subhead', new Layout('页面滑动', { color: 'highlight', view_tag: '_get_tar_by_rl' })) .add('button', new Layout('滑动策略', 'hint', { - config_conj: 'rank_list_scan_strategy', + config_conj: 'rankListScanStrategy', view_tag: '_get_tar_by_rl', map: { scroll: '控件滚动', @@ -4543,7 +4540,7 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { title: '排行榜页面滑动策略', neutral() { dialogsx.builds([ - '关于排行榜页面滑动策略', 'about_rank_list_scan_strategy', + '关于排行榜页面滑动策略', 'aboutRankListScanStrategy', 0, 0, 'C', 1, ]).on('positive', ds => ds.dismiss()).show(); }, @@ -4554,10 +4551,10 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('button', new Layout('滑动距离', 'hint', { - config_conj: 'rank_list_swipe_distance', + config_conj: 'rankListSwipeDistance', view_tag: '_get_tar_by_rl', newWindow() { - if ($$cfg.ses.rank_list_scan_strategy === 'swipe') { + if ($$cfg.ses.rankListScanStrategy === 'swipe') { let _icon_h = cYx(46); let _safe = uH - $$disp.status_bar_height - $$disp.action_bar_default_height - _icon_h; $$view.diag.numSetter.call(this, 0.4, 0.9, { @@ -4570,7 +4567,7 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { '0.6: 每次滑动 60% 屏幕距离', '%show_valid_and_default_values%', '安全值: ' + _safe + ' [ ' + - (_safe / H).toFixedNum(2) + ' ]', + Numberx.toFixedNum(_safe / H, 2) + ' ]', ], positiveAddn(d, input, positiveFunc) { if (input <= _safe) { @@ -4578,17 +4575,17 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { } dialogsx .builds([ - ['注意', 'caution'], + [ '注意', 'caution' ], '当前值: ' + input + '\n' + '安全值: ' + _safe + '\n\n' + '当前设置值大于安全值\n' + '滑动时可能出现遗漏采集目标的问题\n\n' + '确定要保留当前设置值吗', - ['什么是安全值', 'hint'], - 'Q', ['K', 'warn'], 1, + [ '什么是安全值', 'hint' ], + 'Q', [ 'K', 'warn' ], 1, ]) .on('neutral', () => { - dialogsx.builds(['滑动距离安全值', '', 0, 0, 'B'], { + dialogsx.builds([ '滑动距离安全值', '', 0, 0, 'B' ], { content: '安全值指排行榜滑动时' + '可避免采集目标遗漏的理论最大值\n\n' + '计算方法:\n屏幕高度' + @@ -4625,7 +4622,7 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { } }, updateOpr(view) { - if ($$cfg.ses.rank_list_scan_strategy === 'swipe') { + if ($$cfg.ses.rankListScanStrategy === 'swipe') { let _cfg_conj = this.config_conj; let _n = $$cfg.ses[_cfg_conj] || $$sto.def.af[_cfg_conj]; _n = _n < 1 ? cY(_n) : _n; @@ -4637,10 +4634,10 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('button', new Layout('滑动时长', 'hint', { - config_conj: 'rank_list_swipe_time', + config_conj: 'rankListSwipeDuration', view_tag: '_get_tar_by_rl', newWindow() { - if ($$cfg.ses.rank_list_scan_strategy === 'swipe') { + if ($$cfg.ses.rankListScanStrategy === 'swipe') { $$view.diag.numSetter.call(this, 100, 1.2e3, { title: '设置排行榜页面滑动时长', }); @@ -4652,7 +4649,7 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { } }, updateOpr(view) { - if ($$cfg.ses.rank_list_scan_strategy === 'swipe') { + if ($$cfg.ses.rankListScanStrategy === 'swipe') { let _cfg_conj = this.config_conj; let _n = $$cfg.ses[_cfg_conj] || $$sto.def.af[_cfg_conj]; view.setHintText(_n + ' ms'); @@ -4663,8 +4660,8 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { })) .add('button', new Layout('滑动间隔', 'hint', { _getConfigConj() { - let _stg = $$cfg.ses.rank_list_scan_strategy; - return 'rank_list_' + _stg + '_interval'; + let _stg = $$cfg.ses.rankListScanStrategy; + return 'rankList' + _stg[0].toUpperCase() + _stg.slice(1) + 'Interval'; }, get config_conj() { return this._getConfigConj(); @@ -4684,9 +4681,9 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('安全限制', {color: 'highlight', view_tag: '_get_tar_by_stroll'})) + .add('subhead', new Layout('安全限制', { color: 'highlight', view_tag: '_get_tar_by_stroll' })) .add('button', new Layout('最大无操作循环次数', 'hint', { - config_conj: 'max_continuous_not_targeted_stroll_cycle', + config_conj: 'strollNotTargetedLimit', view_tag: '_get_tar_by_stroll', newWindow() { $$view.diag.numSetter.call(this, 1, 5, { @@ -4698,17 +4695,17 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('invisible_split_line') - .add('subhead', new Layout('高级设置', {view_tag: '_get_tar_by_rl'})) + .add('subhead', new Layout('高级设置', { view_tag: '_get_tar_by_rl' })) .add('page', new Layout('样本复查', 'hint', { - config_conj: 'rank_list_review_switch', + config_conj: 'rankListReviewSwitch', view_tag: '_get_tar_by_rl', next_page: 'rank_list_review_page', updateOpr(view) { - $$view.udop.main_sw.call(this, view, 'timers_switch'); + $$view.udop.main_sw.call(this, view, 'timersSwitch'); }, })) .add('button', new Layout('截图样本池差异检测阈值', 'hint', { - config_conj: 'rank_list_capt_pool_diff_check_threshold', + config_conj: 'rankListCaptPoolDiffCheckThreshold', view_tag: '_get_tar_by_rl', newWindow() { $$view.diag.numSetter.call(this, 5, 800, { @@ -4720,7 +4717,7 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { }, })) .add('button', new Layout('最大连续无目标命中次数', 'hint', { - config_conj: 'rank_list_max_not_targeted_times', + config_conj: 'rankListNotTargetedLimit', view_tag: '_get_tar_by_rl', newWindow() { $$view.diag.numSetter.call(this, 50, 500); @@ -4744,7 +4741,7 @@ $$view.page.new('可收取目标采集', 'collectable_samples_page', (t) => { $$view.page.new('排行榜样本复查', 'rank_list_review_page', (t) => { $$view.setPage(t, null, { check_page_state(view) { - if (!$$cfg.ses.rank_list_review_switch) { + if (!$$cfg.ses.rankListReviewSwitch) { return true; } let _samp = [ @@ -4766,7 +4763,7 @@ $$view.page.new('排行榜样本复查', 'rank_list_review_page', (t) => { }, }) .add('switch', new Layout('总开关', { - config_conj: 'rank_list_review_switch', + config_conj: 'rankListReviewSwitch', listeners: { _switch: { check(state) { @@ -4780,10 +4777,10 @@ $$view.page.new('排行榜样本复查', 'rank_list_review_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('复查条件', {color: 'highlight'})) + .add('subhead', new Layout('复查条件', { color: 'highlight' })) .add('checkbox_switch', new Layout('列表状态差异', { - config_conj: 'rank_list_review_difference_switch', - view_tag: 'rank_list_review_difference_switch', + config_conj: 'rankListReviewDifferenceSwitch', + view_tag: 'rankListReviewDifferenceSwitch', listeners: { _checkbox_switch: { check(state) { @@ -4798,8 +4795,8 @@ $$view.page.new('排行榜样本复查', 'rank_list_review_page', (t) => { })) .add('split_line') .add('checkbox_switch', new Layout('样本点击记录', { - config_conj: 'rank_list_review_samples_clicked_switch', - view_tag: 'rank_list_review_samples_clicked_switch', + config_conj: 'rankListReviewSamplesClickedSwitch', + view_tag: 'rankListReviewSamplesClickedSwitch', listeners: { _checkbox_switch: { check(state) { @@ -4814,8 +4811,8 @@ $$view.page.new('排行榜样本复查', 'rank_list_review_page', (t) => { })) .add('split_line') .add('checkbox_switch', new Layout('最小倒计时阈值', { - config_conj: 'rank_list_review_threshold_switch', - view_tag: 'rank_list_review_threshold_switch', + config_conj: 'rankListReviewThresholdSwitch', + view_tag: 'rankListReviewThresholdSwitch', listeners: { _checkbox_switch: { check(state) { @@ -4829,8 +4826,8 @@ $$view.page.new('排行榜样本复查', 'rank_list_review_page', (t) => { }, })) .add('seekbar', new Layout('阈值', { - config_conj: 'rank_list_review_threshold', - nums: [1, 5], + config_conj: 'rankListReviewThreshold', + nums: [ 1, 5 ], unit: 'min', })) .add('split_line') @@ -4847,7 +4844,7 @@ $$view.page.new('排行榜样本复查', 'rank_list_review_page', (t) => { }); $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { $$view.setPage(t) - .add('subhead', new Layout('采集样本池', {color: 'highlight'})) + .add('subhead', new Layout('采集样本池', { color: 'highlight' })) .add('button', new Layout('样本池总容量', 'hint', { config_conj: 'forestImagePoolLimit', newWindow() { @@ -4858,7 +4855,7 @@ $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { }, })) .add('button', new Layout('样本采集间隔', 'hint', { - config_conj: 'forestImagePoolItv', + config_conj: 'forestImagePoolInterval', newWindow() { $$view.diag.numSetter.call(this, 10, 500); }, @@ -4866,7 +4863,7 @@ $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { view.setHintText($$cfg.ses[this.config_conj].toString()); }, })) - .add('subhead', new Layout('识别与定位', {color: 'highlight'})) + .add('subhead', new Layout('识别与定位', { color: 'highlight' })) .add('button', new Layout('能量球识别区域', 'hint', { config_conj: 'energyBallsRecognitionRegion', newWindow() { @@ -4876,9 +4873,9 @@ $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { }, updateOpr(view) { let _cfg_conj = this.config_conj; - let [_l, _t, _r, _b] = $$cfg.ses[_cfg_conj] + let [ _l, _t, _r, _b ] = $$cfg.ses[_cfg_conj] .map((v, i) => i % 2 ? cYx(v, true) : cX(v, true)); - let _rect = [[_l, _t], [_r, _b]] + let _rect = [ [ _l, _t ], [ _r, _b ] ] .map(a => a.join(' , ')).join(' - '); view.setHintText('Rect [ ' + _rect + ' ] '); }, @@ -4901,7 +4898,7 @@ $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { let _cfg_conj = this.config_conj; let _v = $$cfg.ses[_cfg_conj] || $$sto.def.af[_cfg_conj]; _v = cX(_v).toString(); - let _v_p = (_v * 100 / W).toFixedNum(2); + let _v_p = Numberx.toFixedNum(_v * 100 / W, 2); view.setHintText(_v + ' px [ ' + _v_p + '% W ]'); }, })) @@ -4911,9 +4908,9 @@ $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { .add('page', new Layout('霍夫变换数据传入与处理', { next_page: 'hough_strategy_page', })) - .add('subhead', new Layout('操作与控制', {color: 'highlight'})) + .add('subhead', new Layout('操作与控制', { color: 'highlight' })) .add('button', new Layout('能量球点击时长', 'hint', { - config_conj: 'forest_balls_click_duration', + config_conj: 'forestBallsClickDuration', newWindow() { $$view.diag.numSetter.call(this, 10, 500); }, @@ -4922,7 +4919,7 @@ $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { }, })) .add('button', new Layout('能量球点击间隔', 'hint', { - config_conj: 'forest_balls_click_interval', + config_conj: 'forestBallsClickInterval', newWindow() { $$view.diag.numSetter.call(this, 10, 2e3); }, @@ -4934,9 +4931,9 @@ $$view.page.new('能量球样本采集', 'forest_samples_collect_page', (t) => { }); $$view.page.new('颜色与阈值', 'eballs_color_config_page', (t) => { $$view.setPage(t) - .add('subhead', new Layout('成熟 (绿色) 能量球', {color: 'highlight'})) + .add('subhead', new Layout('成熟 (绿色) 能量球', { color: 'highlight' })) .add('button', new Layout('识别色值', 'hint', { - config_conj: 'ripeBallDetectColorVal', + config_conj: 'ripeBallDetectColorValue', newWindow() { $$view.diag.colorSetter.call(this, { title: '成熟能量球颜色检测色值', @@ -4958,11 +4955,11 @@ $$view.page.new('颜色与阈值', 'eballs_color_config_page', (t) => { }, })) .add('invisible_split_line') - .add('subhead', new Layout('浇水回赠 (金色) 能量球', {color: 'highlight'})) + .add('subhead', new Layout('浇水回赠 (金色) 能量球', { color: 'highlight' })) .add('button', new Layout('最大色相值 (无蓝分量)', 'hint', { config_conj: 'homepageWaterBallMaxHueNoBlue', newWindow() { - $$view.diag.numSetter.call(this, 12, 52, {hint_set: 'R'}); + $$view.diag.numSetter.call(this, 12, 52, { hint_set: 'R' }); }, updateOpr(view) { view.setHintText($$cfg.ses[this.config_conj].toString() + '°'); @@ -4972,7 +4969,7 @@ $$view.page.new('颜色与阈值', 'eballs_color_config_page', (t) => { }); $$view.page.new('霍夫变换', 'hough_strategy_page', (t) => { $$view.setPage(t) - .add('subhead', new Layout('数据传入策略', {color: 'highlight'})) + .add('subhead', new Layout('数据传入策略', { color: 'highlight' })) .add('checkbox_switch', new Layout('灰度化 (grayscale)', { kk: 'grayscale', config_conj: 'houghSrcImageStrategy', @@ -5078,7 +5075,7 @@ $$view.page.new('霍夫变换', 'hough_strategy_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('数据处理策略', {color: 'highlight'})) + .add('subhead', new Layout('数据处理策略', { color: 'highlight' })) .add('checkbox_switch', new Layout('覆盖检测', { kk: 'antiOverlap', config_conj: 'houghResultsStrategy', @@ -5156,7 +5153,7 @@ $$view.page.new('霍夫变换', 'hough_strategy_page', (t) => { $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'auto_unlock_switch', + config_conj: 'autoUnlockSwitch', listeners: { _switch: { check(state) { @@ -5172,18 +5169,18 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { .add('split_line') .add('subhead', new Layout('基本设置')) .add('button', new Layout('锁屏密码', 'hint', { - config_conj: 'unlock_code', + config_conj: 'unlockCode', newWindow() { let _cfg_conj = this.config_conj; dialogsx .builds([ '设置锁屏解锁密码', _cfg_conj, - ['查看示例', 'hint'], 'B', 'S', 1, - ], {inputHint: '密码将以密文形式存储在本地'}) + [ '查看示例', 'hint' ], 'B', 'S', 1, + ], { inputHint: '密码将以密文形式存储在本地' }) .on('neutral', () => { dialogsx.builds([ '锁屏密码示例', 'unlock_code_demo', - ['了解点阵简化', 'hint'], 0, 'C', 1, + [ '了解点阵简化', 'hint' ], 0, 'C', 1, ]).on('neutral', () => { dialogsx.builds([ '图案解锁密码简化', 'about_pattern_simplification', @@ -5207,7 +5204,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { dialogsx .builds([ '风险提示', 'unlock_code_safe_confirm', - ['T', 'hint'], 'Q', ['N', 'caution'], 1, 1, + [ 'T', 'hint' ], 'Q', [ 'N', 'caution' ], 1, 1, ]) .on('check', (c) => { _unlk_safe_fg = !!c; @@ -5248,7 +5245,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { .add('split_line') .add('subhead', new Layout('高级设置')) .add('button', new Layout('最大尝试次数', 'hint', { - config_conj: 'unlock_max_try_times', + config_conj: 'unlockTryLimit', newWindow() { $$view.diag.numSetter.call(this, 5, 50, { title: '设置解锁最大尝试次数', @@ -5261,9 +5258,9 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('提示层页面设置', {color: 'highlight'})) + .add('subhead', new Layout('提示层页面设置', { color: 'highlight' })) .add('button', new Layout('检测方式', 'hint', { - config_conj: 'unlock_dismiss_layer_strategy', + config_conj: 'unlockDismissLayerStrategy', map: { preferred: '优先', deferred: '滞后', @@ -5275,7 +5272,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { def_key: 'unlock', neutral() { dialogsx.builds([ - '关于提示层页面检测方式', 'about_unlock_dismiss_layer_strategy', + '关于提示层页面检测方式', 'about_unlockDismissLayerStrategy', 0, 0, 'C', 1, ]).on('positive', ds => ds.dismiss()).show(); }, @@ -5286,7 +5283,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { }, })) .add('button', new Layout('上滑时长', 'hint', { - config_conj: 'unlock_dismiss_layer_swipe_time', + config_conj: 'unlockDismissLayerSwipeDuration', newWindow() { $$view.diag.numSetter.call(this, 110, 1e3, { title: '提示层页面上滑时长', @@ -5298,7 +5295,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { }, })) .add('button', new Layout('起点位置', 'hint', { - config_conj: 'unlock_dismiss_layer_bottom', + config_conj: 'unlockDismissLayerBottom', newWindow() { $$view.diag.numSetter.call(this, 0.5, 0.95, { title: '提示层页面起点位置', @@ -5315,9 +5312,9 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { }, })) .add('button', new Layout('终点位置', 'hint', { - config_conj: 'unlock_dismiss_layer_top', + config_conj: 'unlockDismissLayerTop', newWindow() { - $$view.diag.numSetter.call(this, 0.05, 0.3, { + $$view.diag.numSetter.call(this, 0.05, 0.4, { title: '提示层页面终点位置', hint_set: 'R', def_key: 'unlock', @@ -5332,9 +5329,9 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('图案解锁设置', {color: 'highlight'})) + .add('subhead', new Layout('图案解锁设置', { color: 'highlight' })) .add('button', new Layout('滑动策略', 'hint', { - config_conj: 'unlock_pattern_strategy', + config_conj: 'unlockPatternStrategy', map: { segmental: '叠加路径', // gestures() solid: '连续路径', // gesture() @@ -5345,7 +5342,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { def_key: 'unlock', neutral() { dialogsx.builds([ - '关于图案解锁滑动策略', 'about_unlock_pattern_strategy', + '关于图案解锁滑动策略', 'about_unlockPatternStrategy', 0, 0, 'C', 1, ]).on('positive', ds => ds.dismiss()).show(); }, @@ -5357,9 +5354,9 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { })) .add('button', new Layout('滑动时长', 'hint', { getConfigConj() { - let _key = 'unlock_pattern_strategy'; + let _key = 'unlockPatternStrategy'; let _stg = $$cfg.ses[_key] || $$sto.def.unlock[_key]; - return 'unlock_pattern_swipe_time_' + _stg; + return 'unlockPatternSwipeDuration' + _stg[0].toUpperCase() + _stg.slice(1); }, newWindow() { let _this = this; @@ -5377,7 +5374,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { }, })) .add('button', new Layout('点阵边长', 'hint', { - config_conj: 'unlock_pattern_size', + config_conj: 'unlockPatternSize', newWindow() { $$view.diag.numSetter.call(this, 3, 6, { title: '设置图案解锁边长', @@ -5393,7 +5390,7 @@ $$view.page.new('自动解锁', 'auto_unlock_page', (t) => { $$view.page.new('消息提示', 'message_showing_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'message_showing_switch', + config_conj: 'messageShowingSwitch', listeners: { _switch: { check(state) { @@ -5409,7 +5406,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { .add('split_line') .add('subhead', new Layout('基本设置')) .add('switch', new Layout('控制台消息', { - config_conj: 'console_log_switch', + config_conj: 'consoleLogSwitch', listeners: { _switch: { check(state) { @@ -5424,7 +5421,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { })) .add('checkbox_switch', new Layout('开发者测试日志', { default_state: false, - config_conj: 'debug_info_switch', + config_conj: 'debugInfoSwitch', listeners: { _checkbox_switch: { check(state) { @@ -5438,7 +5435,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { })) .add('split_line') .add('switch', new Layout('运行前提示对话框', { - config_conj: 'prompt_before_running_switch', + config_conj: 'promptBeforeRunningSwitch', listeners: { _switch: { check(state) { @@ -5452,7 +5449,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { }, })) .add('button', new Layout('对话框倒计时时长', 'hint', { - config_conj: 'prompt_before_running_countdown_seconds', + config_conj: 'promptBeforeRunningCountdownSeconds', newWindow() { $$view.diag.numSetter.call(this, 3, 30, { title: '提示对话框倒计时时长', @@ -5463,13 +5460,13 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { }, })) .add('button', new Layout('推迟任务间隔时长', 'hint', { - config_conj: 'prompt_before_running_postponed_minutes', + config_conj: 'promptBeforeRunningPostponedMinute', map: Object.assign({ '0': '每次都询问', '-1': '息屏时', }, (function $iiFe() { let _o = {}; - let _k = 'prompt_before_running_postponed_minutes_choices'; + let _k = 'promptBeforeRunningPostponedMinutes'; $$sto.def.af[_k].forEach(n => _o[n] = n + ' min'); return _o; })()), @@ -5482,7 +5479,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { })) .add('checkbox_switch', new Layout('放弃任务时显示放弃提示', { default_state: true, - config_conj: 'prompt_before_running_quit_confirm', + config_conj: 'promptBeforeRunningQuitConfirm', listeners: { _checkbox_switch: { check(state) { @@ -5496,7 +5493,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { })) .add('checkbox_switch', new Layout('息屏或上锁启动时自动跳过', { default_state: true, - config_conj: 'prompt_before_running_auto_skip', + config_conj: 'promptBeforeRunningAutoSkip', listeners: { _checkbox_switch: { check(state) { @@ -5510,7 +5507,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { })) .add('split_line') .add('switch', new Layout('运行结果展示', { - config_conj: 'result_showing_switch', + config_conj: 'resultShowingSwitch', listeners: { _switch: { check(state) { @@ -5523,9 +5520,9 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { view['_switch'].setChecked(!!$$cfg.ses[this.config_conj]); }, })) - .add('radio', new Layout(['Floaty', 'Toast'], { - values: [true, false], - config_conj: 'floaty_result_switch', + .add('radio', new Layout([ 'Floaty', 'Toast' ], { + values: [ true, false ], + config_conj: 'floatyResultSwitch', listeners: { check(checked, view) { if (checked) { @@ -5538,25 +5535,25 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { }, updateOpr(view) { let _ses_idx = this.values.indexOf($$cfg.ses[this.config_conj]); - if (!$$ses.floaty_result_switch_inited) { + if (!$$ses.floatyResultSwitchInited) { let _def_idx = this.values.indexOf($$sto.def.af[this.config_conj]); if (_def_idx !== _ses_idx) { view['_radiogroup'].getChildAt(_def_idx).setChecked(true); } - $$ses.floaty_result_switch_inited = true; + $$ses.floatyResultSwitchInited = true; } view['_radiogroup'].getChildAt(_ses_idx).setChecked(true); }, })) .add('seekbar', new Layout('时长', { - config_conj: 'floaty_result_countdown_sec', - nums: [2, 9], + config_conj: 'floatyResultCountdownSeconds', + nums: [ 2, 9 ], unit: 's', })) .add('invisible_split_line') .add('checkbox_switch', new Layout('同时展示定时任务信息', { default_state: true, - config_conj: 'auto_task_show_on_e_result', + config_conj: 'autoTaskShowOnShowingResult', listeners: { _checkbox_switch: { check(state) { @@ -5570,7 +5567,7 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { })) .add('checkbox_switch', new Layout('同时展示版本更新提示', { default_state: true, - config_conj: 'update_show_on_e_result', + config_conj: 'updateShowOnShowingResult', listeners: { _checkbox_switch: { check(state) { @@ -5597,8 +5594,8 @@ $$view.page.new('消息提示', 'message_showing_page', (t) => { $$view.page.new('本地日志', 'aj_global_log_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'aj_global_log_switch', - view_tag: 'aj_global_log_switch', + config_conj: 'autojsGlobalLogSwitch', + view_tag: 'autojsGlobalLogSwitch', listeners: { _switch: { check(state) { @@ -5618,10 +5615,10 @@ $$view.page.new('本地日志', 'aj_global_log_page', (t) => { function _on() { consolex.setGlobalLogConfig({ - file: $$cfg.sto.aj_global_log_cfg_path + 'auto.js-log.log', - filePattern: $$cfg.sto.aj_global_log_cfg_file_pattern, - maxBackupSize: $$cfg.sto.aj_global_log_cfg_max_backup_size, - maxFileSize: $$cfg.sto.aj_global_log_cfg_max_file_size << 10, + file: $$cfg.sto.autojsGlobalLogConfigPath + 'auto.js-log.log', + filePattern: $$cfg.sto.autojsGlobalLogConfigFilePattern, + maxBackupSize: $$cfg.sto.autojsGlobalLogConfigMaxBackupSize, + maxFileSize: $$cfg.sto.autojsGlobalLogConfigMaxFileSize << 10, }); } @@ -5637,7 +5634,7 @@ $$view.page.new('本地日志', 'aj_global_log_page', (t) => { .add('split_line') .add('subhead', new Layout('基本设置')) .add('button', new Layout('文件路径', 'hint', { - config_conj: 'aj_global_log_cfg_path', + config_conj: 'autojsGlobalLogConfigPath', newWindow() { let _is_valid = true; let _cfg_conj = this.config_conj; @@ -5645,7 +5642,7 @@ $$view.page.new('本地日志', 'aj_global_log_page', (t) => { dialogsx .builds([ '本地日志文件路径', _buildContent(), - ['R', 'reset'], 'B', 'M', 1, + [ 'R', 'reset' ], 'B', 'M', 1, ], { inputHint: '输入路径', }) @@ -5718,30 +5715,30 @@ $$view.page.new('本地日志', 'aj_global_log_page', (t) => { }, })) .add('seekbar', new Layout('文件数量限制', { - config_conj: 'aj_global_log_cfg_max_backup_size', - nums: [1, 9], + config_conj: 'autojsGlobalLogConfigMaxBackupSize', + nums: [ 1, 9 ], })) .add('seekbar', new Layout('文件大小限制', { - config_conj: 'aj_global_log_cfg_max_file_size', - nums: [128, 960], + config_conj: 'autojsGlobalLogConfigMaxFileSize', + nums: [ 128, 960 ], inc: 64, unit: 'KB', })) .add('split_line') .add('subhead', new Layout('高级设置')) .add('button', new Layout('日志写入模式', 'hint', { - config_conj: 'aj_global_log_cfg_file_pattern', + config_conj: 'autojsGlobalLogConfigFilePattern', newWindow() { let _cfg_conj = this.config_conj; // noinspection HttpUrlsUsage,SpellCheckingInspection dialogsx - .builds(['本地日志写入模式', (() => context.getPackageName().match(/Pro\b/i) + .builds([ '本地日志写入模式', (() => context.getPackageName().match(/Pro\b/i) ? '注意:\n当前Auto.js为Pro版本\n可能不支持自定义日志写入模式\n\n' : '')() + '写入模式示例:\n%m%n\n%d - [%p::%c::%C] - %m%n\n' + '%d{yyyy-MM-dd HH:mm}%m%n\n\n详情参阅:\nhttp://logging.apache.org/' + 'log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html', - ['R', 'reset'], 'B', 'M', 1, + [ 'R', 'reset' ], 'B', 'M', 1, ], { inputHint: '输入日志写入模式', linkify: 'WEB_URLS', @@ -5776,18 +5773,18 @@ $$view.page.new('定时循环', 'timers_page', (t) => { check_page_state() { // this is just a simple check let switches = [ - 'homepage_monitor_switch', - 'rank_list_review_switch', - 'timers_self_manage_switch', + 'homepageMonitorSwitch', + 'rankListReviewSwitch', + 'timersSelfManageSwitch', ]; for (let i = 0, l = switches.length; i < l; i += 1) { if ($$cfg.ses[switches[i]]) return true; } - dialogsx.builds(['提示', '定时循环子功能需至少选择一个', 0, 0, 'B']).show(); + dialogsx.builds([ '提示', '定时循环子功能需至少选择一个', 0, 0, 'B' ]).show(); }, }) .add('switch', new Layout('总开关', { - config_conj: 'timers_switch', + config_conj: 'timersSwitch', listeners: { _switch: { check(state) { @@ -5801,25 +5798,25 @@ $$view.page.new('定时循环', 'timers_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('循环监测', {color: 'highlight'})) + .add('subhead', new Layout('循环监测', { color: 'highlight' })) .add('page', new Layout('主页能量球循环监测', 'hint', { - config_conj: 'homepage_monitor_switch', + config_conj: 'homepageMonitorSwitch', next_page: 'homepage_monitor_page', updateOpr(view) { - $$view.udop.main_sw.call(this, view, 'self_collect_switch'); + $$view.udop.main_sw.call(this, view, 'selfCollectSwitch'); }, })) .add('page', new Layout('好友排行榜样本复查', 'hint', { - config_conj: 'rank_list_review_switch', + config_conj: 'rankListReviewSwitch', next_page: 'rank_list_review_page', updateOpr(view) { - $$view.udop.main_sw.call(this, view, 'friend_collect_switch'); + $$view.udop.main_sw.call(this, view, 'friendCollectSwitch'); }, })) .add('split_line') - .add('subhead', new Layout('定时任务', {color: 'highlight'})) + .add('subhead', new Layout('定时任务', { color: 'highlight' })) .add('page', new Layout('定时任务自动管理', 'hint', { - config_conj: 'timers_self_manage_switch', + config_conj: 'timersSelfManageSwitch', next_page: 'timers_self_manage_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); @@ -5838,15 +5835,15 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { // tool function(s) // function _chkPageSw() { - if (!$$cfg.ses.timers_self_manage_switch) { + if (!$$cfg.ses.timersSelfManageSwitch) { return true; } let _smp = [ - 'timers_countdown_check_own_switch', - 'timers_countdown_check_friends_switch', - 'timers_uninterrupted_check_switch', - 'timers_insurance_switch', + 'timersCountdownCheckOwnSwitch', + 'timersCountdownCheckFriendsSwitch', + 'timersUninterruptedCheckSwitch', + 'timersInsuranceSwitch', ]; let _len = _smp.length; let _chk = (tag) => { @@ -5859,18 +5856,18 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { } } - dialogsx.builds(['提示', '自动管理机制需至少选择一个', 0, 0, 'B']).show(); + dialogsx.builds([ '提示', '自动管理机制需至少选择一个', 0, 0, 'B' ]).show(); } function _chkAutoUnlockSw() { - if ($$cfg.ses.auto_unlock_switch + if ($$cfg.ses.autoUnlockSwitch || $$sto.af.get('timers_prefer_auto_unlock_dialog_prompt_prompted') ) { return true; } let timers_prefer_auto_unlock_dialog_prompt_prompted = false; let diag = dialogsx.builds([ - ['注意', 'caution'], + [ '注意', 'caution' ], 'timers_prefer_auto_unlock', 0, 0, ' OK ', 1, 1, ]); diag.on('check', checked => timers_prefer_auto_unlock_dialog_prompt_prompted = !!checked); @@ -5886,7 +5883,7 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, }) .add('switch', new Layout('总开关', { - config_conj: 'timers_self_manage_switch', + config_conj: 'timersSelfManageSwitch', listeners: { _switch: { check(state) { @@ -5900,10 +5897,10 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('自动管理机制', {color: 'highlight'})) + .add('subhead', new Layout('自动管理机制', { color: 'highlight' })) .add('checkbox_switch', new Layout('主页最小倒计时机制', { - config_conj: 'timers_countdown_check_own_switch', - tag_name: 'timers_countdown_check_own_switch', + config_conj: 'timersCountdownCheckOwnSwitch', + tag_name: 'timersCountdownCheckOwnSwitch', listeners: { _checkbox_switch: { check(state) { @@ -5917,7 +5914,7 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, })) .add('button', new Layout('定时任务提前运行', 'hint', { - config_conj: 'timers_countdown_check_own_timed_task_ahead', + config_conj: 'timersCountdownCheckOwnTimedTaskAhead', newWindow() { $$view.diag.numSetter.call(this, 0, 3, { content: 'timers_countdown_check_timed_task_ahead', @@ -5930,15 +5927,15 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { return true; } let { - homepage_monitor_switch: _hp_mon_sw, - homepage_monitor_threshold: _hp_mon_thrd, + homepageMonitorSwitch: _hp_mon_sw, + homepageMonitorThreshold: _hp_mon_thrd, } = $$cfg.ses; if (!_hp_mon_sw) { dialogsx .builds([ - ['注意', 'caution'], + [ '注意', 'caution' ], 'timers_ahead_prefer_monitor_own', - 0, 'Q', ['K', 'warn'], 1, + 0, 'Q', [ 'K', 'warn' ], 1, ]) .on('negative', ds => ds.dismiss()) .on('positive', ds => _saveSess(ds)) @@ -5946,8 +5943,8 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { } else if (input > _hp_mon_thrd) { dialogsx .builds([ - ['注意', 'caution'], '', - 0, 'Q', ['K', 'warn'], 1, + [ '注意', 'caution' ], '', + 0, 'Q', [ 'K', 'warn' ], 1, ], { content: '当前设置值: ' + input + '\n' + '主页能量球监测阈值: ' + _hp_mon_thrd + '\n\n' + @@ -5974,8 +5971,8 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { })) .add('split_line') .add('checkbox_switch', new Layout('排行榜最小倒计时机制', { - config_conj: 'timers_countdown_check_friends_switch', - tag_name: 'timers_countdown_check_friends_switch', + config_conj: 'timersCountdownCheckFriendsSwitch', + tag_name: 'timersCountdownCheckFriendsSwitch', listeners: { _checkbox_switch: { check(state) { @@ -5989,7 +5986,7 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, })) .add('button', new Layout('定时任务提前运行', 'hint', { - config_conj: 'timers_countdown_check_friends_timed_task_ahead', + config_conj: 'timersCountdownCheckFriendsTimedTaskAhead', newWindow() { $$view.diag.numSetter.call(this, 0, 5, { content: 'timers_countdown_check_timed_task_ahead', @@ -6002,16 +5999,16 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { return true; } let { - rank_list_review_switch: _sw, - rank_list_review_threshold_switch: _thrd_sw, - rank_list_review_threshold: _thrd, + rankListReviewSwitch: _sw, + rankListReviewThresholdSwitch: _thrd_sw, + rankListReviewThreshold: _thrd, } = $$cfg.ses; if (!(_sw && _thrd_sw)) { dialogsx .builds([ - ['注意', 'caution'], + [ '注意', 'caution' ], 'timers_ahead_prefer_rank_list_threshold_review', - 0, 'Q', ['K', 'warn'], 1, + 0, 'Q', [ 'K', 'warn' ], 1, ]) .on('negative', ds => ds.dismiss()) .on('positive', ds => _saveSess(ds)) @@ -6019,8 +6016,8 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { } else if (input > _thrd) { dialogsx .builds([ - ['注意', 'caution'], '', - 0, 'Q', ['K', 'warn'], 1, + [ '注意', 'caution' ], '', + 0, 'Q', [ 'K', 'warn' ], 1, ], { content: '当前设置值: ' + input + '\n' + '排行榜样本复查最小倒计时阈值: ' + _thrd + '\n\n' + @@ -6047,8 +6044,8 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { })) .add('split_line') .add('checkbox_switch', new Layout('延时接力机制', { - config_conj: 'timers_uninterrupted_check_switch', - view_tag: 'timers_uninterrupted_check_switch', + config_conj: 'timersUninterruptedCheckSwitch', + view_tag: 'timersUninterruptedCheckSwitch', listeners: { _checkbox_switch: { check(state) { @@ -6062,7 +6059,7 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, })) .add('page', new Layout('时间区间管理', 'hint', { - config_conj: 'timers_uninterrupted_check_sections', + config_conj: 'timersUninterruptedCheckSections', next_page: 'timers_uninterrupted_check_sections_page', updateOpr(view) { let _areas = $$cfg.ses[this.config_conj]; @@ -6080,8 +6077,8 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { })) .add('split_line') .add('checkbox_switch', new Layout('意外保险机制', { - config_conj: 'timers_insurance_switch', - view_tag: 'timers_insurance_switch', + config_conj: 'timersInsuranceSwitch', + view_tag: 'timersInsuranceSwitch', listeners: { _checkbox_switch: { check(state) { @@ -6095,7 +6092,7 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, })) .add('button', new Layout('保险任务运行间隔', 'hint', { - config_conj: 'timers_insurance_interval', + config_conj: 'timersInsuranceInterval', newWindow() { $$view.diag.numSetter.call(this, 1, 10); }, @@ -6104,7 +6101,7 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, })) .add('button', new Layout('最大连续保险次数', 'hint', { - config_conj: 'timers_insurance_max_continuous_times', + config_conj: 'timersInsuranceMaxContinuousTimes', newWindow() { $$view.diag.numSetter.call(this, 1, 5); }, @@ -6113,9 +6110,9 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('自动管理功能有效时段', {color: 'highlight'})) + .add('subhead', new Layout('自动管理功能有效时段', { color: 'highlight' })) .add('button', new Layout('有效时段管理', 'hint', { - config_conj: 'timers_auto_task_sections', + config_conj: 'timersAutoTaskSections', newWindow() { let _this = this; let _tmp_areas = $$cfg.ses[_this.config_conj].slice(); @@ -6124,14 +6121,14 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { '有效时段管理', '', '添加时段', 'Q', 'S', 1, ], { - items: ['\xa0'], + items: [ '\xa0' ], }) .on('neutral', (d) => { d.dismiss(); $$view.setTimePickerView({ picker_views: [ - {type: 'time', text: '设置开始时间'}, - {type: 'time', text: '设置结束时间'}, + { type: 'time', text: '设置开始时间' }, + { type: 'time', text: '设置结束时间' }, ], time_str: { suffix(getStrFunc) { @@ -6162,7 +6159,7 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { dialogsx .builds([ '提示', '确定删除此时段吗', - 0, 'Q', ['D', 'caution'], 1, + 0, 'Q', [ 'D', 'caution' ], 1, ]) .on('negative', (d) => { d.dismiss(); @@ -6215,18 +6212,18 @@ $$view.page.new('定时任务自动管理', 'timers_self_manage_page', (t) => { $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => { $$view.setPage(t, (p_view) => { $$view.setTimersControlPanelPageButtons(p_view, 'timed_tasks', wizardFunc); - }, {no_scroll_view: true}) + }, { no_scroll_view: true }) .add('list', new Layout('/*管理本项目定时任务*/', { list_head: 'timed_tasks', data_source_key_name: 'timed_tasks', custom_data_source() { - return timersx.queryTimedTasks({ + return tasks.queryTimedTasks({ path: files.join(files.cwd(), 'ant-forest-launcher.js'), }).map((task) => ({ task: task, - type: _getType(timersx.timeFlagConverter(task.getTimeFlag()), task.id), + type: _getType(tasks.timeFlagToDays(task.getTimeFlag()), task.id), next_run_time: task.getNextTime(), - })).concat(timersx.queryIntentTasks().map((task) => ({ + })).concat(tasks.queryIntentTasks().map((task) => ({ task: task, type: _getType([], task.id), next_run_time: '广播事件触发', @@ -6264,7 +6261,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => listeners: { _list_data: { item_click(item) { - let {task, list_item_name_0} = item; + let { task, list_item_name_0 } = item; let type = list_item_name_0; let next_run_time = typeof task.getNextTime === 'function' ? task.getNextTime() : -1; let type_code = $$tool.restoreFromTimedTaskTypeStr(type); @@ -6294,8 +6291,8 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => dialogsx .builds([ '任务详情', showDiagContent(), - ['删除任务', 'caution'], - ['编辑任务', 'warn'], + [ '删除任务', 'caution' ], + [ '编辑任务', 'warn' ], 'C', 1, ]) .on('neutral', (d) => { @@ -6303,7 +6300,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => .builds([ '删除提示', '确认要删除当前任务吗\n此操作将立即生效且无法撤销', - 0, 'Q', ['D', 'caution'], 1, + 0, 'Q', [ 'D', 'caution' ], 1, ]) .on('negative', (ds) => { ds.dismiss(); @@ -6311,9 +6308,9 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => .on('positive', (ds) => { if (type_code === 'min_countdown') { dialogsx.builds([ - ['小心', 'caution'], - ['delete_min_countdown_task_warn', 'warn'], - 0, 'Q', ['K', 'caution'], 1, + [ '小心', 'caution' ], + [ 'delete_min_countdown_task_warn', 'warn' ], + 0, 'Q', [ 'K', 'caution' ], 1, ]).on('negative', (ds2) => { ds2.dismiss(); }).on('positive', (ds2) => { @@ -6328,7 +6325,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => function deleteNow() { dialogsx.dismiss(ds, d); - timersx.removeTimedTask(task_id, { + tasks.removeTimedTask(task_id, { callback: () => $$view.updateDataSource(_ds_k, 're_init', _custom_ds()), }); @@ -6346,7 +6343,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => 0, 0, 'B', 1, ]).on('positive', ds => ds.dismiss()).show(); } - if (!timersx.getTimedTask(task_id)) { + if (!tasks.getTimedTask(task_id)) { return dialogsx.builds([ '无法编辑', '该任务ID不存在\n可能是任务已自动完成或被删除', 0, 0, 'B', 1, @@ -6423,7 +6420,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => 0, 0, 'C', 1, ]).on('positive', ds => ds.dismiss()).show(); }, - positive: {value: '下一步', listeners: () => null}, + positive: { value: '下一步', listeners: () => null }, single_choice(i, v, d) { let _map = this.map; let _keys = Object.keys(_map); @@ -6446,7 +6443,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => // modify_mode let view_title_text_prefix = (is_modify_mode ? '修改' : '设置') + _task_type_map[type_str]; $$view.setTimePickerView({ - picker_views: [type_str === 'disposable' ? { + picker_views: [ type_str === 'disposable' ? { type: 'date', text: view_title_text_prefix + '日期', init: task ? task.getNextTime() : null, @@ -6462,7 +6459,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => type: 'time', text: view_title_text_prefix + '时间', init: task ? task.getNextTime() : null, - }], + } ], time_str: { prefix: '已选择', }, @@ -6493,7 +6490,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => }, }, onSuccess(ret) { - threadsx.start(function () { + threads.start(function () { ret && (update() || add()); // to fresh data list; maybe not a good way ui.emitter.emit('resume'); @@ -6508,7 +6505,7 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => } function update() { - let current_task = task && timersx.getTimedTask(task.id); + let current_task = task && tasks.getTimedTask(task.id); if (current_task) { if (type_str === 'disposable') { current_task.setMillis(ret); @@ -6516,28 +6513,28 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => current_task.setMillis(trimTimestamp(ret)); } else if (type_str === 'weekly') { current_task.setMillis(trimTimestamp(ret.timestamp)); - current_task.setTimeFlag(timersx.timeFlagConverter(ret.days_of_week)); + current_task.setTimeFlag(tasks.daysToTimeFlag(ret.days_of_week)); } else { return; } - return timersx.updateTask(current_task); + return tasks.updateTask(current_task); } } function add() { let path = files.join(files.cwd(), 'ant-forest-launcher.js'); if (type_str === 'disposable') { - timersx.addDisposableTask({ + tasks.addDisposableTask({ path: path, date: ret, }); } else if (type_str === 'daily') { - timersx.addDailyTask({ + tasks.addDailyTask({ path: path, time: trimTimestamp(ret, true), }); } else if (type_str === 'weekly') { - timersx.addWeeklyTask({ + tasks.addWeeklyTask({ path: path, time: trimTimestamp(ret.timestamp, true), daysOfWeek: ret.days_of_week, @@ -6551,23 +6548,23 @@ $$view.page.new('定时任务控制面板', 'timers_control_panel_page', (t) => }); $$view.page.new('延时接力区间', 'timers_uninterrupted_check_sections_page', (t) => { $$view.setPage(t, (p_view) => { - let data_source_key_name = 'timers_uninterrupted_check_sections'; + let data_source_key_name = 'timersUninterruptedCheckSections'; $$view.setTimersUninterruptedCheckAreasPageButtons(p_view, data_source_key_name); - }, {no_scroll_view: true}) + }, { no_scroll_view: true }) .add('list', new Layout('/*延时接力时间区间*/', { - list_head: 'timers_uninterrupted_check_sections', - data_source_key_name: 'timers_uninterrupted_check_sections', + list_head: 'timersUninterruptedCheckSections', + data_source_key_name: 'timersUninterruptedCheckSections', list_checkbox: 'visible', listeners: { _list_data: { item_long_click(e, item, idx, item_view) { item_view['_checkbox'].checked && item_view['_checkbox'].click(); e.consumed = true; - let {data_source_key_name: _ds_k} = this; + let { data_source_key_name: _ds_k } = this; let edit_item_diag = dialogsx.builds([ '编辑列表项', '点击需要编辑的项', 0, 'B', 'S', 1, - ], {items: ['\xa0']}); + ], { items: [ '\xa0' ] }); refreshItems(); @@ -6583,11 +6580,11 @@ $$view.page.new('延时接力区间', 'timers_uninterrupted_check_sections_page' } }; let _items = d.getItems().toArray(); - let [_sect, _itv] = _items.map(x => x.split(': ')[1]); - $$view.updateDataSource(_ds_k, 'splice', [idx, 1, { + let [ _sect, _itv ] = _items.map(x => x.split(': ')[1]); + $$view.updateDataSource(_ds_k, 'splice', [ idx, 1, { section: sectionStringTransform().backward(_sect), interval: +_itv, - }]); + } ]); if (!Object.isDeepEqual($$cfg.ses[_ds_k], $$cfg.sto[_ds_k])) { $$ses[_ds_k + '_btn_restore'].switch_on(); } @@ -6597,14 +6594,14 @@ $$view.page.new('延时接力区间', 'timers_uninterrupted_check_sections_page' d.dismiss(); }) .on('item_select', (idx, item) => { - let [_pref, _cnt] = item.split(': '); + let [ _pref, _cnt ] = item.split(': '); if (_pref === '区间') { edit_item_diag.dismiss(); $$view.setTimePickerView({ picker_views: [ - {type: 'time', text: '设置开始时间', init: $$tool.timeStrToSection(_cnt)[0]}, - {type: 'time', text: '设置结束时间', init: $$tool.timeStrToSection(_cnt)[1]}, + { type: 'time', text: '设置开始时间', init: $$tool.timeStrToSection(_cnt)[0] }, + { type: 'time', text: '设置结束时间', init: $$tool.timeStrToSection(_cnt)[1] }, ], time_str: { suffix(getStrFunc) { @@ -6632,7 +6629,7 @@ $$view.page.new('延时接力区间', 'timers_uninterrupted_check_sections_page' d.dismiss(); } }, - }, {inputPrefill: _cnt.toString()}); + }, { inputPrefill: _cnt.toString() }); } }) .show(); @@ -6670,7 +6667,7 @@ $$view.page.new('延时接力区间', 'timers_uninterrupted_check_sections_page' }, _check_all: { click(view) { - let {data_source_key_name: _ds_k} = this; + let { data_source_key_name: _ds_k } = this; let aim_checked = view.checked; let blacklist_len = $$ses[_ds_k].length; if (!blacklist_len) { @@ -6680,7 +6677,7 @@ $$view.page.new('延时接力区间', 'timers_uninterrupted_check_sections_page' $$ses[_ds_k].forEach((o, idx) => { let o_new = Object.deepClone(o); o_new.checked = aim_checked; - $$view.updateDataSource(_ds_k, 'splice', [idx, 1, o_new]); + $$view.updateDataSource(_ds_k, 'splice', [ idx, 1, o_new ]); }); let deleted_items_idx = _ds_k + '_deleted_items_idx'; @@ -6699,13 +6696,13 @@ $$view.page.new('延时接力区间', 'timers_uninterrupted_check_sections_page' })) .add('info', new Layout('/*dynamic_info*/', { updateOpr(view) { - let amount = $$cfg.ses.timers_uninterrupted_check_sections.length; + let amount = $$cfg.ses.timersUninterruptedCheckSections.length; view['_info_text'].setText(amount ? '时间区间的"+1"表示次日时间' : '点击添加按钮可添加区间'); }, })) .add('info', new Layout('长按列表项可编辑项目 点击标题可排序', { updateOpr(view) { - let amount = $$cfg.ses.timers_uninterrupted_check_sections.length; + let amount = $$cfg.ses.timersUninterruptedCheckSections.length; view.setVisibility(amount ? 0 : 8); }, })) @@ -6718,14 +6715,14 @@ $$view.page.new('账户功能', 'account_page', (t) => { if (!view['_switch'].checked) { return true; } - let _main_acc_o = $$cfg.ses.main_account_info; + let _main_acc_o = $$cfg.ses.mainAccountInfo; if (isNonEmptyObject(_main_acc_o)) { return true; } dialogsx .builds([ '提示', '当前未设置主账户信息\n继续返回将关闭账户功能', - 0, '放弃返回', ['继续返回', 'warn'], 1, + 0, '放弃返回', [ '继续返回', 'warn' ], 1, ]) .on('positive', (d) => { d.dismiss(); @@ -6737,7 +6734,7 @@ $$view.page.new('账户功能', 'account_page', (t) => { }, }) .add('switch', new Layout('总开关', { - config_conj: 'account_switch', + config_conj: 'accountSwitch', listeners: { _switch: { check(state) { @@ -6751,12 +6748,12 @@ $$view.page.new('账户功能', 'account_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('主账户设置', {color: 'highlight'})) + .add('subhead', new Layout('主账户设置', { color: 'highlight' })) .add('button', new Layout('主账户信息', 'hint', { - config_conj: 'main_account_info', + config_conj: 'mainAccountInfo', checkMainAccountInfo() { - let main_account_info = $$cfg.ses[this.config_conj]; - return isNonEmptyObject(main_account_info); + let mainAccountInfo = $$cfg.ses[this.config_conj]; + return isNonEmptyObject(mainAccountInfo); }, newWindow() { let _cfg_conj = this.config_conj; @@ -6766,13 +6763,13 @@ $$view.page.new('账户功能', 'account_page', (t) => { } = $$cfg.ses[_cfg_conj]; $$view.setInfoInputView({ - input_views: [{ + input_views: [ { type: 'account', text: '账户', hint_text: '未设置', init: _acc_n, }, { type: 'password', text: '密码', hint_text: () => _acc_c ? '已设置 (点击修改)' : '未设置', - }], + } ], buttons: { reserved_btn: { text: '帮助', @@ -6780,7 +6777,7 @@ $$view.page.new('账户功能', 'account_page', (t) => { dialogsx .builds([ '信息录入提示', 'account_info_hint', - ['了解密码存储', 'hint'], 0, 'C', 1, + [ '了解密码存储', 'hint' ], 0, 'C', 1, ]) .on('neutral', () => { dialogsx.builds([ @@ -6831,14 +6828,14 @@ $$view.page.new('账户功能', 'account_page', (t) => { }, }, additional: [ - [{ + [ { text: ' 信息销毁 ', hint_color: '#EF9A9A', onClickListener(input_views_obj) { - let config_conj = 'main_account_info'; + let config_conj = 'mainAccountInfo'; let checkMainAccountInfo = () => { - let main_account_info = $$cfg.ses[config_conj]; - return isNonEmptyObject(main_account_info); + let mainAccountInfo = $$cfg.ses[config_conj]; + return isNonEmptyObject(mainAccountInfo); }; if (!checkMainAccountInfo()) { @@ -6847,13 +6844,13 @@ $$view.page.new('账户功能', 'account_page', (t) => { let diag = dialogsx.builds([ '主账户信息销毁', 'destroy_main_account_info', - 0, 'B', ['销毁', 'warn'], + 0, 'B', [ '销毁', 'warn' ], ]); diag.on('negative', () => diag.dismiss()); diag.on('positive', () => { let diag_confirm = dialogsx.builds([ '确认销毁吗', '此操作本次会话无法撤销\n销毁后需在首页"保存"生效', - 0, 'Q', ['S', 'caution'], 1, + 0, 'Q', [ 'S', 'caution' ], 1, ]); diag_confirm.on('negative', () => diag_confirm.dismiss()); diag_confirm.on('positive', () => { @@ -6869,8 +6866,8 @@ $$view.page.new('账户功能', 'account_page', (t) => { }); diag.show(); }, - }], - [{ + } ], + [ { text: '从 [ 支付宝 ] 录入信息', hint_color: '#C5CAE9', onClickListener(input_views_obj) { @@ -6884,8 +6881,8 @@ $$view.page.new('账户功能', 'account_page', (t) => { $$sto.af.remove(storage_key_name); toast('即将打开"支付宝"采集当前账户名'); diag.dismiss(); - filesx.run('launcher$', {cmd: 'get_current_acc_name', monitor: 'ensure_open'}); - threadsx.start(function () { + filesx.run('launcher$', { cmd: 'get_current_acc_name', monitor: 'ensure_open' }); + threads.start(function () { a11yx.wait(() => currentPackage().match(/AlipayGphone/), 8e3); ui.emitter.prependOnceListener('resume', () => { let collected_name = $$sto.af.get(storage_key_name, ''); @@ -6895,11 +6892,11 @@ $$view.page.new('账户功能', 'account_page', (t) => { return toast('未能成功采集到当前账户名'); } - let {input_area} = input_views_obj['账户']; + let { input_area } = input_views_obj['账户']; let _acc = $$tool.accountNameConverter(collected_name, 'decrypt'); input_area.setText(_acc); - threadsx.start(function () { + threads.start(function () { let max_try_times_input = 3; while (max_try_times_input--) { if (a11yx.wait(() => { @@ -6931,16 +6928,16 @@ $$view.page.new('账户功能', 'account_page', (t) => { text: '从 [ 账户库 ] 录入信息', hint_color: '#D1C4E9', onClickListener() { - dialogsx.builds(['从账户库录入信息', '此功能暂未完成开发', 0, 0, 'B']).show(); + dialogsx.builds([ '从账户库录入信息', '此功能暂未完成开发', 0, 0, 'B' ]).show(); }, - }], + } ], ], }, }); if (!$$sto.af.get('before_use_main_account_dialog_prompt_prompted')) { let before_use_main_account_dialog_prompt_prompted = false; - let diag = dialogsx.builds(['功能使用提示', 'before_use_main_account', 0, 0, '继续使用', 1, 1]); + let diag = dialogsx.builds([ '功能使用提示', 'before_use_main_account', 0, 0, '继续使用', 1, 1 ]); diag.on('check', checked => before_use_main_account_dialog_prompt_prompted = !!checked); diag.on('positive', () => { if (before_use_main_account_dialog_prompt_prompted) { @@ -6958,7 +6955,7 @@ $$view.page.new('账户功能', 'account_page', (t) => { .add('split_line') .add('subhead', new Layout('高级设置')) .add('page', new Layout('旧账户回切', 'hint', { - config_conj: 'account_log_back_in_switch', + config_conj: 'accountLogBackInSwitch', next_page: 'account_log_back_in_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); @@ -6978,13 +6975,13 @@ $$view.page.new('账户功能', 'account_page', (t) => { $$view.page.new('数据统计', 'stat_page', (t) => { $$view.setPage(t, (p_view) => { $$view.setStatPageButtons(p_view, 'stat_list'); - }, {no_scroll_view: true}) + }, { no_scroll_view: true }) .ready(); }); $$view.page.new('旧账户回切', 'account_log_back_in_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'account_log_back_in_switch', + config_conj: 'accountLogBackInSwitch', listeners: { _switch: { check(state) { @@ -7000,7 +6997,7 @@ $$view.page.new('旧账户回切', 'account_log_back_in_page', (t) => { .add('split_line') .add('subhead', new Layout('基本设置')) .add('button', new Layout('最大连续回切次数', 'hint', { - config_conj: 'account_log_back_in_max_continuous_times', + config_conj: 'accountLogBackInMaxContinuousTimes', newWindow() { $$view.diag.numSetter.call(this, 0, 10, { title: '设置最大连续回切次数', @@ -7016,11 +7013,11 @@ $$view.page.new('旧账户回切', 'account_log_back_in_page', (t) => { }); $$view.page.new('黑名单管理', 'blacklist_page', (t) => { $$view.setPage(t) - .add('subhead', new Layout('蚂蚁森林名单簿', {color: 'highlight'})) + .add('subhead', new Layout('蚂蚁森林名单簿', { color: 'highlight' })) .add('page', new Layout('能量罩黑名单', 'hint', { - next_page: 'cover_blacklist_page', + next_page: 'shield_blacklist_page', updateOpr(view) { - let amount = $$cfg.ses.blacklist_protect_cover.length; + let amount = $$cfg.ses.blacklist_shield.length; view.setHintText(amount ? '包含成员: ' + amount + '人 ' : '空名单'); }, })) @@ -7032,19 +7029,19 @@ $$view.page.new('黑名单管理', 'blacklist_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('应用程序名单簿', {color: 'highlight'})) + .add('subhead', new Layout('应用程序名单簿', { color: 'highlight' })) .add('page', new Layout('前置应用黑名单', 'hint', { next_page: 'foreground_app_blacklist_page', updateOpr(view) { let hint_text = '空名单'; - let {foreground_app_blacklist: _fg_app_blist} = $$cfg.ses; + let { foregroundAppBlacklist: _fg_app_blist } = $$cfg.ses; _fg_app_blist = _fg_app_blist || []; let amount = _fg_app_blist.length; if (amount) { hint_text = '包含应用: ' + amount + ' 项'; let invalid_items_count = 0; _fg_app_blist.forEach((o) => { - let {app_combined_name} = o; + let { app_combined_name } = o; if (app_combined_name) { let pkg_name = app_combined_name.split('\n')[1]; if (!app.getAppName(pkg_name)) invalid_items_count += 1; @@ -7066,11 +7063,11 @@ $$view.page.new('黑名单管理', 'blacklist_page', (t) => { })) .ready(); }); -$$view.page.new('能量罩黑名单', 'cover_blacklist_page', (t) => { - $$view.setPage(t, null, {no_scroll_view: true}) +$$view.page.new('能量罩黑名单', 'shield_blacklist_page', (t) => { + $$view.setPage(t, null, { no_scroll_view: true }) .add('list', new Layout('/*能量罩黑名单成员*/', { - list_head: 'blacklist_protect_cover', - data_source_key_name: 'blacklist_protect_cover', + list_head: 'blacklist_shield', + data_source_key_name: 'blacklist_shield', list_checkbox: 'gone', listeners: { _list_data: { @@ -7087,7 +7084,7 @@ $$view.page.new('能量罩黑名单', 'cover_blacklist_page', (t) => { $$view.page.new('自定义黑名单', 'collect_blacklist_page', (t) => { $$view.setPage(t, (p_view) => { $$view.setListPageButtons(p_view, 'blacklist_by_user'); - }, {no_scroll_view: true}) + }, { no_scroll_view: true }) .add('list', new Layout('/*自定义黑名单成员*/', { list_head: 'blacklist_by_user', data_source_key_name: 'blacklist_by_user', @@ -7097,10 +7094,10 @@ $$view.page.new('自定义黑名单', 'collect_blacklist_page', (t) => { item_long_click(e, item, idx, item_view) { item_view['_checkbox'].checked && item_view['_checkbox'].click(); e.consumed = true; - let {data_source_key_name: _ds_k} = this; + let { data_source_key_name: _ds_k } = this; let edit_item_diag = dialogsx.builds([ '编辑列表项', '点击需要编辑的项', 0, 'B', 'S', 1, - ], {items: ['\xa0']}); + ], { items: [ '\xa0' ] }); refreshItems(); @@ -7109,7 +7106,7 @@ $$view.page.new('自定义黑名单', 'collect_blacklist_page', (t) => { new_item.name = edit_item_diag.getItems().toArray()[0].split(': ')[1]; let input = edit_item_diag.getItems().toArray()[1].split(': ')[1]; new_item.timestamp = $$tool.restoreFromTimestamp(input); - $$view.updateDataSource(_ds_k, 'splice', [idx, 1, new_item]); + $$view.updateDataSource(_ds_k, 'splice', [ idx, 1, new_item ]); if (!Object.isDeepEqual($$cfg.ses[_ds_k], $$cfg.sto[_ds_k])) { $$ses[_ds_k + '_btn_restore'].switch_on(); } @@ -7132,8 +7129,8 @@ $$view.page.new('自定义黑名单', 'collect_blacklist_page', (t) => { if (!isFinite(init_value)) init_value = null; $$view.setTimePickerView({ picker_views: [ - {type: 'date', text: '设置日期', init: init_value}, - {type: 'time', text: '设置时间', init: init_value}, + { type: 'date', text: '设置日期', init: init_value }, + { type: 'time', text: '设置时间', init: init_value }, ], time_str: { prefix: '已选择', @@ -7198,7 +7195,7 @@ $$view.page.new('自定义黑名单', 'collect_blacklist_page', (t) => { }, _check_all: { click(view) { - let {data_source_key_name: _ds_k} = this; + let { data_source_key_name: _ds_k } = this; let aim_checked = view.checked; let blacklist_len = $$ses[_ds_k].length; if (!blacklist_len) return view.checked = !aim_checked; @@ -7206,7 +7203,7 @@ $$view.page.new('自定义黑名单', 'collect_blacklist_page', (t) => { $$ses[_ds_k].forEach((o, idx) => { let o_new = Object.deepClone(o); o_new.checked = aim_checked; - $$view.updateDataSource(_ds_k, 'splice', [idx, 1, o_new]); + $$view.updateDataSource(_ds_k, 'splice', [ idx, 1, o_new ]); }); let deleted_items_idx = _ds_k + '_deleted_items_idx'; @@ -7240,11 +7237,11 @@ $$view.page.new('自定义黑名单', 'collect_blacklist_page', (t) => { }); $$view.page.new('前置应用黑名单', 'foreground_app_blacklist_page', (t) => { $$view.setPage(t, (p_view) => { - $$view.setListPageButtons(p_view, 'foreground_app_blacklist'); - }, {no_scroll_view: true}) + $$view.setListPageButtons(p_view, 'foregroundAppBlacklist'); + }, { no_scroll_view: true }) .add('list', new Layout('/*前置应用黑名单项目*/', { - list_head: 'foreground_app_blacklist', - data_source_key_name: 'foreground_app_blacklist', + list_head: 'foregroundAppBlacklist', + data_source_key_name: 'foregroundAppBlacklist', list_checkbox: 'visible', listeners: { _list_data: { @@ -7260,7 +7257,7 @@ $$view.page.new('前置应用黑名单', 'foreground_app_blacklist_page', (t) => }, _check_all: { click(view) { - let {data_source_key_name: _ds_k} = this; + let { data_source_key_name: _ds_k } = this; let aim_checked = view.checked; let blacklist_len = $$ses[_ds_k].length; if (!blacklist_len) return view.checked = !aim_checked; @@ -7268,7 +7265,7 @@ $$view.page.new('前置应用黑名单', 'foreground_app_blacklist_page', (t) => $$ses[_ds_k].forEach((o, idx) => { let o_new = Object.deepClone(o); o_new.checked = aim_checked; - $$view.updateDataSource(_ds_k, 'splice', [idx, 1, o_new]); + $$view.updateDataSource(_ds_k, 'splice', [ idx, 1, o_new ]); }); let deleted_items_idx = _ds_k + '_deleted_items_idx'; @@ -7287,13 +7284,13 @@ $$view.page.new('前置应用黑名单', 'foreground_app_blacklist_page', (t) => })) .add('info', new Layout('/*dynamic_info*/', { updateOpr(view) { - let amount = $$cfg.ses.foreground_app_blacklist.length; + let amount = $$cfg.ses.foregroundAppBlacklist.length; view['_info_text'].setText(amount ? '点击标题可排序' : '点击添加按钮可添加应用'); }, })) .add('info', new Layout('"有效"标签表示应用是否存在于设备中', { updateOpr(view) { - let amount = $$cfg.ses.foreground_app_blacklist.length; + let amount = $$cfg.ses.foregroundAppBlacklist.length; view.setVisibility(amount ? 0 : 8); }, })) @@ -7304,7 +7301,7 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { $$view.setPage(t) .add('subhead', new Layout('基本设置')) .add('button', new Layout('单次运行最大时间', 'hint', { - config_conj: 'max_running_time_global', + config_conj: 'maxRunningTimeGlobal', newWindow() { $$view.diag.numSetter.call(this, 5, 90, { title: '脚本单次运行最大时间', @@ -7315,7 +7312,7 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { }, })) .add('button', new Layout('排他性任务最大排队时间', 'hint', { - config_conj: 'max_queue_time_global', + config_conj: 'maxQueueTimeGlobal', newWindow() { $$view.diag.numSetter.call(this, 1, 120); }, @@ -7326,7 +7323,7 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { .add('split_line') .add('subhead', new Layout('高级设置')) .add('button', new Layout('脚本炸弹预防阈值', 'hint', { - config_conj: 'min_bomb_interval_global', + config_conj: 'minBombIntervalGlobal', newWindow() { $$view.diag.numSetter.call(this, 100, 800); }, @@ -7335,19 +7332,19 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { }, })) .add('button', new Layout('Root权限功能', 'hint', { - config_conj: 'root_access_functions', + config_conj: 'rootAccessPrivileges', newWindow() { let _cfg_conj = this.config_conj; let _data = $$cfg.ses[_cfg_conj]; let _fxs = [ - {key: 'screen_off', desc: '关闭屏幕'}, - {key: 'force_stop', desc: '关闭应用'}, + { key: 'screenOffByKeyEvent', desc: '关闭屏幕' }, + { key: 'forceStopApp', desc: '关闭应用' }, ]; dialogsx.builds([ 'Root权限功能', appx.hasRoot() - ? ['当前Root权限状态: 已获取', '#005005'] - : ['当前Root权限状态: 未获取', '#A30000'], - ['T', 'hint'], 'B', 'M', 1, + ? [ '当前Root权限状态: 已获取', '#005005' ] + : [ '当前Root权限状态: 未获取', '#A30000' ], + [ 'T', 'hint' ], 'B', 'M', 1, ], { items: _fxs.map(o => o.desc), itemsSelectMode: 'multi', @@ -7358,7 +7355,7 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { _fxs.forEach((o, i) => _data[o.key] = indices.indexOf(i) > -1); }).on('neutral', () => { dialogsx.builds([ - '关于Root权限功能', 'about_root_access_functions', 0, 0, 'C', 1, + '关于Root权限功能', 'about_rootAccessPrivileges', 0, 0, 'C', 1, ]).on('positive', d => d.dismiss()).show(); }).on('negative', (d) => { d.dismiss(); @@ -7373,48 +7370,8 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { view.setHintText(_fxs_len ? '已启用 ' + _fxs_len + '项 ' : '已全部禁用'); }, })) - .add('button', new Layout('自动开启无障碍服务', 'hint', { - config_conj: 'auto_enable_a11y_svc', - map: { - ON: '启用自动开启', - OFF: '禁用自动开启', - }, - newWindow() { - $$view.diag.radioSetter.call(this, { - neutral() { - dialogsx - .builds([ - '关于自动开启无障碍服务', 'about_auto_enable_a11y_svc', - ['复制授权指令', 'hint'], ['测试权限', 'hint'], 'C', 1, - ]) - .on('neutral', () => { - let _pkg = context.getPackageName(); - let _perm = 'android.permission.WRITE_SECURE_SETTINGS'; - setClip('adb shell pm grant ' + _pkg + ' ' + _perm); - toast('授权指令已复制到剪切板'); - }) - .on('negative', () => { - let _res = a11yx.test(); - dialogsx.builds([ - '权限测试结果', '测试' + (_res ? '' : '未') + '通过\n\n' + - '当前应用' + (_res ? '已' : '未') + '获得以下权限:\n' + - 'WRITE_SECURE_SETTINGS', 0, 0, 'C', 1, - ]).on('positive', d => d.dismiss()).show(); - }) - .on('positive', (d) => { - d.dismiss(); - }) - .show(); - }, - }); - }, - updateOpr(view) { - let value = $$cfg.ses[this.config_conj] || $$sto.def.af[this.config_conj]; - view.setHintText('已' + this.map[value.toString()].slice(0, 2)); - }, - })) .add('button', new Layout('支付宝应用启动跳板', 'hint', { - config_conj: 'app_launch_springboard', + config_conj: 'appLaunchSpringboard', map: { ON: '开启跳板', OFF: '关闭跳板', @@ -7435,14 +7392,14 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { }, })) .add('page', new Layout('支付宝应用及页面保留', 'hint', { - config_conj: 'kill_when_done_switch', + config_conj: 'killWhenDoneSwitch', next_page: 'kill_when_done_page', updateOpr(view) { view.setHintText(!$$cfg.ses[this.config_conj] ? '已开启' : '已关闭'); }, })) .add('page', new Layout('通话状态监测', 'hint', { - config_conj: 'phone_call_state_monitor_switch', + config_conj: 'phoneCallStateMonitorSwitch', next_page: 'phone_call_state_monitor_page', updateOpr(view) { $$view.udop.main_sw.call(this, view); @@ -7453,7 +7410,7 @@ $$view.page.new('运行与安全', 'script_security_page', (t) => { $$view.page.new('支付宝应用及页面保留', 'kill_when_done_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'kill_when_done_switch', + config_conj: 'killWhenDoneSwitch', listeners: { _switch: { check(state) { @@ -7467,13 +7424,13 @@ $$view.page.new('支付宝应用及页面保留', 'kill_when_done_page', (t) => }, })) .add('split_line') - .add('subhead', new Layout('支付宝应用保留', {color: 'highlight'})) - .add('radio', new Layout(['智能保留', '总是保留'], { - values: [true, false], - config_conj: 'kill_when_done_intelligent', + .add('subhead', new Layout('支付宝应用保留', { color: 'highlight' })) + .add('radio', new Layout([ '智能保留', '总是保留' ], { + values: [ true, false ], + config_conj: 'killWhenDoneIntelligent', listeners: { check(checked, view) { - let {text} = view; + let { text } = view; checked && $$save.session(this.config_conj, this.values[this.title.indexOf(text)]); text === this.title[0] && $$view.showOrHideBySwitch(this, checked, false, 'split_line'); }, @@ -7487,13 +7444,13 @@ $$view.page.new('支付宝应用及页面保留', 'kill_when_done_page', (t) => }, })) .add('split_line') - .add('subhead', new Layout('蚂蚁森林页面保留', {color: 'highlight'})) - .add('radio', new Layout(['智能剔除', '全部保留'], { - values: [false, true], - config_conj: 'kill_when_done_keep_af_pages', + .add('subhead', new Layout('蚂蚁森林页面保留', { color: 'highlight' })) + .add('radio', new Layout([ '智能剔除', '全部保留' ], { + values: [ false, true ], + config_conj: 'killWhenDoneKeepRelatedPages', listeners: { check(checked, view) { - let {text} = view; + let { text } = view; checked && $$save.session(this.config_conj, this.values[this.title.indexOf(text)]); text === this.title[0] && $$view.showOrHideBySwitch(this, checked, false, 'split_line'); }, @@ -7520,7 +7477,7 @@ $$view.page.new('支付宝应用及页面保留', 'kill_when_done_page', (t) => $$view.page.new('通话状态监测', 'phone_call_state_monitor_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'phone_call_state_monitor_switch', + config_conj: 'phoneCallStateMonitorSwitch', listeners: { _switch: { check(state) { @@ -7536,13 +7493,13 @@ $$view.page.new('通话状态监测', 'phone_call_state_monitor_page', (t) => { .add('split_line') .add('subhead', new Layout('高级设置')) .add('button', new Layout('空闲状态值', 'hint', { - config_conj: 'phone_call_state_idle_value', + config_conj: 'phoneCallStateIdleValue', newWindow() { dialogsx .builds([ '通话空闲状态值', this.config_conj, - ['获取空闲值', 'reset'], 'B', 'M', 1, - ], {inputHint: '{x|x∈N*}'}) + [ '获取空闲值', 'reset' ], 'B', 'M', 1, + ], { inputHint: '{x|x∈N*}' }) .on('neutral', d => dialogsx.setInputText(d, devicex.getCallState())) .on('negative', d => d.dismiss()) .on('positive', (d) => { @@ -7557,9 +7514,9 @@ $$view.page.new('通话状态监测', 'phone_call_state_monitor_page', (t) => { if (_num !== devicex.getCallState()) { dialogsx .builds([ - ['小心', 'caution'], - ['phone_call_state_idle_value_warn', 'warn'], - 0, 'Q', ['K', 'caution'], 1, + [ '小心', 'caution' ], + [ 'phoneCallStateIdleValueWarn', 'warn' ], + 0, 'Q', [ 'K', 'caution' ], 1, ]) .on('negative', (ds) => ds.dismiss()) .on('positive', (ds) => { @@ -7587,7 +7544,7 @@ $$view.page.new('通话状态监测', 'phone_call_state_monitor_page', (t) => { $$view.page.new('能量双击卡', 'e_dblclick_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'e_dblclick_switch', + config_conj: 'energyDoubleCollectSwitch', listeners: { _switch: { check(state) { @@ -7607,7 +7564,7 @@ $$view.page.new('能量双击卡', 'e_dblclick_page', (t) => { $$view.page.new('能量雨', 'e_rain_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'e_rain_switch', + config_conj: 'energyRainCollectSwitch', listeners: { _switch: { check(state) { @@ -7626,7 +7583,7 @@ $$view.page.new('能量雨', 'e_rain_page', (t) => { }); $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) => { $$view.setPage(t) - .add('subhead', new Layout('备份', {color: 'highlight'})) + .add('subhead', new Layout('备份', { color: 'highlight' })) .add('button', new Layout('备份至本地', '等待"本地还原"准备就绪...', { view_tag: 'backup_projects_from_local', newWindow() { @@ -7635,7 +7592,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = $$ses.local_restore_page_updated && dialogsx .builds([ _title, 'backup_to_local', - ['添加备注', 'hint'], 'Q', '开始备份', 1, + [ '添加备注', 'hint' ], 'Q', '开始备份', 1, ]) .on('neutral', (d) => { d.dismiss(); @@ -7643,7 +7600,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = .builds([ '为备份添加备注', '添加备注用于区分不同的项目备份\n留空可删除备注', - [_remark ? '删除备注' : 0, 'caution'], 'Q', 'K', 1, + [ _remark ? '删除备注' : 0, 'caution' ], 'Q', 'K', 1, ], { inputPrefill: _remark, }) @@ -7672,7 +7629,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = .on('negative', (d) => { d.dismiss(); }) - .on('positive', (d) => threadsx.start(function () { + .on('positive', (d) => threads.start(function () { let _ds_k = 'project_backup_info'; project.backup({ onBackupStart() { @@ -7709,7 +7666,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = }, })) .add('split_line') - .add('subhead', new Layout('还原', {color: 'highlight'})) + .add('subhead', new Layout('还原', { color: 'highlight' })) .add('page', new Layout('从本地还原', 'hint', { view_tag: 'restore_projects_from_local_page', next_page: null, @@ -7731,7 +7688,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = let _is_building = $$ses.local_restore_page_building; if (!_is_building.get()) { _is_building.incrementAndGet(); - threadsx.start(function () { + threads.start(function () { a11yx.wait(() => $$view.pages[_view_tag], 15e3, 120) ? ui.post(_createPageView) : _is_building.decrementAndGet(); @@ -7754,7 +7711,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = dialogsx .builds([ '删除备份', '确定删除此备份吗\n此操作无法撤销', - 0, 'Q', ['D', 'caution'], 1, + 0, 'Q', [ 'D', 'caution' ], 1, ]) .on('negative', (d) => { d.dismiss(); @@ -7763,7 +7720,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = .on('positive', (d) => { d.dismiss(); files.remove($$cfg.ses[_ds_k][idx].path); - $$view.updateDataSource(_ds_k, 'splice', [idx, 1], { + $$view.updateDataSource(_ds_k, 'splice', [ idx, 1 ], { is_quiet: true, sync_data_source: true, }); @@ -7782,10 +7739,10 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = item_click(item, idx) { let _data = $$cfg.ses[_ds_k][idx] || {}; let _map = { - version_name: {name: '版本', cvt: null}, - timestamp: {name: '时间', cvt: $$cvt.date}, - path: {name: '路径', cvt: null}, - remark: {name: '备注', cvt: null}, + version_name: { name: '版本', cvt: null }, + timestamp: { name: '时间', cvt: $$cvt.date }, + path: { name: '路径', cvt: null }, + remark: { name: '备注', cvt: null }, }; dialogsx .builds([ @@ -7799,8 +7756,8 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = } return _map_o.name + ': ' + _value; }).join('\n\n'), - ['删除此备份', 'caution'], 'B', - ['还原此备份', 'warn'], 1, + [ '删除此备份', 'caution' ], 'B', + [ '还原此备份', 'warn' ], 1, ]) .on('neutral', (d) => this.deleteItem(idx, { onStart: () => d.dismiss(), @@ -7812,13 +7769,13 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = dialogsx .builds([ '还原本地备份', 'restore_from_local', - 0, 'Q', ['还原', 'caution'], 1, + 0, 'Q', [ '还原', 'caution' ], 1, ]) .on('negative', (ds) => { ds.dismiss(); d.show(); }) - .on('positive', (ds) => threadsx.start(function () { + .on('positive', (ds) => threads.start(function () { project.restore(_data.path, { onStart: () => ds.dismiss(), onSuccess: () => $$view.updateViewByTag('about'), @@ -7872,7 +7829,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = view.setHintText('正在从服务器获取数据...'); view.setClickListener(() => null); - threadsx.start(function () { + threads.start(function () { let _max = 5; while (_max--) { try { @@ -7912,10 +7869,10 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = let _releases = []; let _list_item = $$ses.server_releases_info[idx] || {}; void [ - {key: 'name', desc: '标题'}, - {key: 'tag_name', desc: '标签'}, - {key: 'published_at', desc: '发布'}, - {key: 'body', desc: '内容描述'}, + { key: 'name', desc: '标题' }, + { key: 'tag_name', desc: '标签' }, + { key: 'published_at', desc: '发布' }, + { key: 'body', desc: '内容描述' }, ].forEach((o) => { let _k = o.key; if (_k in _list_item) { @@ -7932,8 +7889,8 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = dialogsx .builds([ '版本详情', _releases.join('\n\n'), - ['浏览器查看', 'hint'], 'B', - ['还原此项目', 'warn'], 1, + [ '浏览器查看', 'hint' ], 'B', + [ '还原此项目', 'warn' ], 1, ]) .on('negative', d => d.dismiss()) .on('neutral', (d) => { @@ -7945,7 +7902,7 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = dialogsx .builds([ '还原项目', 'restore_project_confirm', - 0, 'Q', ['还原', 'caution'], 1, + 0, 'Q', [ '还原', 'caution' ], 1, ]) .on('negative', (ds) => { ds.dismiss(); @@ -7985,17 +7942,17 @@ $$view.page.new('项目备份还原', 'local_project_backup_restore_page', (t) = .ready(); }); $$view.page.new('从本地还原项目', 'restore_projects_from_local_page', (t) => { - $$view.setPage(t, null, {no_scroll_view: true}) + $$view.setPage(t, null, { no_scroll_view: true }) .ready(); }); $$view.page.new('从服务器还原项目', 'restore_projects_from_server_page', (t) => { - $$view.setPage(t, null, {no_scroll_view: true}) + $$view.setPage(t, null, { no_scroll_view: true }) .ready(); }); $$view.page.new('自动检查更新', 'update_auto_check_page', (t) => { $$view.setPage(t) .add('switch', new Layout('总开关', { - config_conj: 'update_auto_check_switch', + config_conj: 'updateAutoCheckSwitch', listeners: { _switch: { check(state) { @@ -8009,10 +7966,10 @@ $$view.page.new('自动检查更新', 'update_auto_check_page', (t) => { }, })) .add('split_line') - .add('subhead', new Layout('更新提示场景', {color: 'highlight'})) + .add('subhead', new Layout('更新提示场景', { color: 'highlight' })) .add('checkbox_switch', new Layout('运行结果展示时', { - config_conj: 'update_show_on_e_result', - view_tag: 'update_show_on_e_result', + config_conj: 'updateShowOnShowingResult', + view_tag: 'updateShowOnShowingResult', listeners: { _checkbox_switch: { check(state) { @@ -8025,8 +7982,8 @@ $$view.page.new('自动检查更新', 'update_auto_check_page', (t) => { }, })) .add('checkbox_switch', new Layout('配置工具启动后', { - config_conj: 'update_show_on_af_settings', - view_tag: 'update_show_on_af_settings', + config_conj: 'updateShowOnAfSettings', + view_tag: 'updateShowOnAfSettings', listeners: { _checkbox_switch: { check(state) { @@ -8041,14 +7998,14 @@ $$view.page.new('自动检查更新', 'update_auto_check_page', (t) => { .add('split_line') .add('subhead', new Layout('高级设置')) .add('button', new Layout('版本忽略管理', 'hint', { - config_conj: 'update_ignore_list', - view_tag: 'update_ignore_list', + config_conj: 'updateIgnoreList', + view_tag: 'updateIgnoreList', newWindow() { let _cfg_conj = this.config_conj; let _tmp_list = $$cfg.ses[_cfg_conj].slice(); let _diag = dialogsx - .builds(['版本忽略管理', '', '添加版本', 'Q', 'S', 1], { - items: ['\xa0'], + .builds([ '版本忽略管理', '', '添加版本', 'Q', 'S', 1 ], { + items: [ '\xa0' ], }) .on('neutral', (d) => { d.dismiss(); @@ -8061,7 +8018,7 @@ $$view.page.new('自动检查更新', 'update_auto_check_page', (t) => { ].join('\n'); dialogsx - .builds(['添加忽略版本', _cont + _none, 0, 'Q', 'K', 1], { + .builds([ '添加忽略版本', _cont + _none, 0, 'Q', 'K', 1 ], { inputHint: '输入的内容支持实时解析', }) .on('negative', ds => ds.dismiss()) @@ -8105,7 +8062,7 @@ $$view.page.new('自动检查更新', 'update_auto_check_page', (t) => { dialogsx .builds([ '提示', '确定移除此版本吗', - 0, 'Q', ['移除', 'caution'], 1, + 0, 'Q', [ '移除', 'caution' ], 1, ]) .on('negative', (d) => { d.dismiss(); diff --git a/assets/data/default-config.js b/assets/data/default-config.js index a5f4942..67dfd10 100644 --- a/assets/data/default-config.js +++ b/assets/data/default-config.js @@ -1,53 +1,46 @@ module.exports = { af: { - // project description - project_desc: '蚂蚁森林', - // i know the trick about the reason you want to turn this switch off - self_collect_switch: true, + projectDesc: '蚂蚁森林', + selfCollectSwitch: true, // sometimes alipay will not be launched without Auto.js running in the foreground - app_launch_springboard: 'OFF', - // when turned 'ON', a11y svc could be auto-enabled with android.permission.WRITE_SECURE_SETTINGS - auto_enable_a11y_svc: 'OFF', + appLaunchSpringboard: 'OFF', // if you are multi-account user, you may turn this on and specify a 'main account' to switch - account_switch: false, + accountSwitch: false, // with this switch on, original logged in account will be logged back before exit - account_log_back_in_switch: false, + accountLogBackInSwitch: false, // with this value, logging back in will not happen in any circumstance - account_log_back_in_max_continuous_times: 3, + accountLogBackInMaxContinuousTimes: 3, // stores information of the 'main account' user - main_account_info: {}, + mainAccountInfo: {}, // 1 <= x <= 200; press time for press(); small value like 1 may be not safe in some situations - forest_balls_click_duration: 54, + forestBallsClickDuration: 54, // 10 <= x <= 2000; as the saying goes, 'Haste makes waste' - forest_balls_click_interval: 108, + forestBallsClickInterval: 108, // set true value if you need continuously check your own energy balls - homepage_monitor_switch: true, + homepageMonitorSwitch: true, // 1 <= x <= 3; continuously check your own energy balls if min countdown is within threshold - homepage_monitor_threshold: 2, + homepageMonitorThreshold: 2, // return to homepage and monitor if own energy min countdown is less than some threshold - homepage_background_monitor_switch: false, - // 1.0 <= x <= 3.0; value should not bigger than homepage_monitor_threshold - homepage_bg_monitor_threshold: 1, + homepageBackgroundMonitorSwitch: false, + // 1.0 <= x <= 3.0; value should not bigger than homepageMonitorThreshold + homepageBackgroundMonitorThreshold: 1, // set falsy to disable homepage water ball check - homepage_wball_switch: true, + homepageWaterBallSwitch: true, // just in case of infinite loop check - homepage_wball_check_limit: 120, + homepageWaterBallCheckLimit: 120, // max hue value in HSB mode without blue component for water wall identification homepageWaterBallMaxHueNoBlue: 47, - // seriously? i cannot believe it if you turn this switch off - friend_collect_switch: true, + friendCollectSwitch: true, // color for collect icon with a hand pattern - friend_collect_icon_color: '#1DA06D', + friendCollectIconColor: '#1DA06D', // 0 <= x <= 66; the smaller, the stricter; max limit tested on Sony G8441 - friend_collect_icon_threshold: 10, + friendCollectIconThreshold: 10, // set truthy value to get targets by stroll button rather than traverse rank list - get_targets_by_stroll_btn: false, - // 1 <= x <= 5; to avoid infinite loop targets detection - max_continuous_not_targeted_stroll_cycle: 3, + getTargetsByStrollButton: false, // 1 <= x <= 8; size limitation for forest balls samples pool forestImagePoolLimit: 3, // 10 <= x <= 500; interval between two samples when saving into forest balls samples pool - forestImagePoolItv: 60, + forestImagePoolInterval: 60, // rectangle region for energy balls recognition in forest page energyBallsRecognitionRegion: [0.1 /* cX */, 0.15 /* cYx */, 0.9 /* cX */, 0.45 /* cYx */], // strategies for cv::houghCircles image source (8bit, single-channel and grayscale) @@ -67,151 +60,156 @@ module.exports = { // 0 <= x <= 40; the smaller, the stricter; ripeBallDetectThreshold: 13, // color for ripe balls in forest page since Oct 16, 2020 around (old value: '#CEFF5F') - ripeBallDetectColorVal: '#DEFF00', + ripeBallDetectColorValue: '#DEFF00', // 0.06 <= x <= 0.15; minimum distance between two energy balls minBallsDistance: 0.09, - // protect cover identifying color from a certain point in countdown area - protect_cover_detect_color_val: '#BEF658', // TODO... - // do not set this value too big in case that green balls will be recognized as protect cover - protect_cover_detect_threshold: 5, // TODO... + // shield identifying color from a certain point in countdown area + shieldDetectColorValue: '#BEF888', // TODO... + // do not set this value too big in case that green balls will be recognized as shield + shieldDetectThreshold: 5, // TODO... // set true if you wish your dream's coming true when you are making a sweet dream or snoring - auto_unlock_switch: false, + autoUnlockSwitch: false, // set false value if you need a clean console or hide what you've done to your friends - message_showing_switch: true, + messageShowingSwitch: true, // if false was set, message in console will not be printed, but toast or floaty not included - console_log_switch: true, + consoleLogSwitch: true, // show debug logs in console to debug this script or to give developer feedback - debug_info_switch: false, + debugInfoSwitch: false, // information will show in floaty way with true or toast way with false - result_showing_switch: true, + resultShowingSwitch: true, // result will show in floaty way with 'true value' or toast way with 'false value' - floaty_result_switch: true, + floatyResultSwitch: true, // 2 <= x <= 9; countdown seconds before floaty window going dismissed - floaty_result_countdown_sec: 6, + floatyResultCountdownSeconds: 6, // review rank list samples if one or more of conditions met - rank_list_review_switch: true, + rankListReviewSwitch: true, // rank list review condition: min countdown threshold - rank_list_review_threshold_switch: true, + rankListReviewThresholdSwitch: true, // 1 <= x <= 5; check if rank list min countdown is less than threshold - rank_list_review_threshold: 1, + rankListReviewThreshold: 1, // rank list review condition: samples clicked flag - rank_list_review_samples_clicked_switch: true, + rankListReviewSamplesClickedSwitch: true, // rank list review condition: samples difference between last two samples nickname data - rank_list_review_difference_switch: true, + rankListReviewDifferenceSwitch: true, // 'swipe' may be not helpful sometimes (e.g. some Android 11 devices) - rank_list_scan_strategy: 'scroll', + rankListScanStrategy: 'scroll', // [0.4, 0.9] for percentage, or integer for pixel distance (like 1260) - rank_list_swipe_distance: 0.75, + rankListSwipeDistance: 0.75, // 100 <= x <= 1200; duration for swiping up each time - rank_list_swipe_time: 150, + rankListSwipeDuration: 150, // 100 <= x <= 2400; interval between swipes - rank_list_swipe_interval: 300, + rankListSwipeInterval: 300, // 100 <= x <= 2400; - rank_list_scroll_interval: 240, + rankListScrollInterval: 240, // 50 <= x <= 500; just in case of infinite loop check - rank_list_max_not_targeted_times: 200, + rankListNotTargetedLimit: 200, // 5 <= x <= 800; to prevent infinity swipe up at rank list page - rank_list_capt_pool_diff_check_threshold: 20, + rankListCaptPoolDiffCheckThreshold: 20, // fantastic function which almost everybody wants it, however, i still need to switch it off initially - timers_switch: false, + timersSwitch: false, // set false value if you prefer a manual timer management - timers_self_manage_switch: true, + timersSelfManageSwitch: true, // whether to auto-calc next running timestamp and set a timed task - timers_countdown_check_own_switch: true, + timersCountdownCheckOwnSwitch: true, // 0 <= x <= 3; if you prefer an earlier timed task before own balls ripe - timers_countdown_check_own_timed_task_ahead: 2, + timersCountdownCheckOwnTimedTaskAhead: 2, // whether to auto-calc next running timestamp and set a timed task - timers_countdown_check_friends_switch: true, + timersCountdownCheckFriendsSwitch: true, // 0 <= x <= 5; if you prefer an earlier timed task before friends' balls ripe - timers_countdown_check_friends_timed_task_ahead: 1, + timersCountdownCheckFriendsTimedTaskAhead: 1, // whether to set a timed task in the future when there are no other tasks set - timers_uninterrupted_check_switch: true, + timersUninterruptedCheckSwitch: true, // 1 <= x <= 600; multi sections available - timers_uninterrupted_check_sections: [{section: ['06:30', '00:00'], interval: 60}], + timersUninterruptedCheckSections: [{section: ['06:30', '00:00'], interval: 60}], // set if you were bothered by auto timed task system; like: [['21:00', '07:45'], ['11:30', '13:30']] - timers_auto_task_sections: [], + timersAutoTaskSections: [], // just in case, as you know; timed task will be set on running and removed when script finished - timers_insurance_switch: true, + timersInsuranceSwitch: true, // 1 <= x <= 10; timed task will be extended every 10 sec to avoid interval's consumption - timers_insurance_interval: 5, + timersInsuranceInterval: 5, // 1 <= x <= 5; auto-insurance task will be dysfunctional with to many continuous attempts - timers_insurance_max_continuous_times: 3, + timersInsuranceMaxContinuousTimes: 3, // 5 <= x <= 90; max running time for a single script - max_running_time_global: 45, + maxRunningTimeGlobal: 45, // 1 <= x <= 120; max queue time for every exclusive task if exclusive tasks ahead is running or queueing - max_queue_time_global: 60, + maxQueueTimeGlobal: 60, // 100 <= x <= 800; exclusive tasks with too small intervals will be taken as bomb tasks - min_bomb_interval_global: 300, + minBombIntervalGlobal: 300, // ant forest timed task will be auto-delayed if battery percentage is lower than specified value - min_battery_percentage: 20, + minBatteryPercentage: 20, // decide whether to kill alipay app before script ended - kill_when_done_switch: false, + killWhenDoneSwitch: false, // true value for an intelligent check before killing alipay - kill_when_done_intelligent: true, + killWhenDoneIntelligent: true, // set true value if you prefer to keep ant forest pages before script ended - kill_when_done_keep_af_pages: false, + killWhenDoneKeepRelatedPages: false, // when switched on, script will be paused if phone call state is not idle - phone_call_state_monitor_switch: true, + phoneCallStateMonitorSwitch: true, // dynamic; will be initialized when script running (often among 0, 1 and 2) - phone_call_state_idle_value: undefined, + phoneCallStateIdleValue: undefined, // set false value if you do not need a countdown dialog before running script - prompt_before_running_switch: true, + promptBeforeRunningSwitch: true, // 3 <= x <= 30; countdown seconds before dialog dismissed automatically - prompt_before_running_countdown_seconds: 5, + promptBeforeRunningCountdownSeconds: 5, // dialog won't prompt with truthy value when running with screen off or device locked - prompt_before_running_auto_skip: true, + promptBeforeRunningAutoSkip: true, // confirmation won't prompt with truthy value before quit current running task - prompt_before_running_quit_confirm: true, + promptBeforeRunningQuitConfirm: true, // default choices for a postponed minute - prompt_before_running_postponed_minutes_choices: [1, 2, 3, 5, 10, 15, 20, 30, 60], + promptBeforeRunningPostponedMinutes: [1, 2, 3, 5, 10, 15, 20, 30, 60], // 0 for ask every time, other number like 1, 2, 5 for specific postponed minute - prompt_before_running_postponed_minutes: 0, + promptBeforeRunningPostponedMinute: 0, // record user selected value of postponed settings dialog in countdown dialog - prompt_before_running_postponed_minutes_user: 3, + promptBeforeRunningPostponedMinuteUser: 3, // ant forest timed task will be auto-delayed if current foreground app is in this list - foreground_app_blacklist: [], + foregroundAppBlacklist: [], // some others - update_ignore_list: [], - update_auto_check_switch: true, - update_show_on_af_settings: true, - update_show_on_e_result: true, - auto_task_show_on_e_result: true, - stat_list_show_zero: 1, // hide zero - stat_list_date_range: 2, // today - aj_global_log_switch: true, - aj_global_log_cfg_path: './log/', - aj_global_log_cfg_file_pattern: '%d{yyyy-MM-dd/}%m%n', - aj_global_log_cfg_max_backup_size: 7, - aj_global_log_cfg_max_file_size: 320, // KB - e_dblclick_switch: false, - e_rain_switch: false, - stroll_btn_match_threshold: 10, - stroll_btn_locate_main_color: '#FF7E00', - root_access_functions: {force_stop: false, screen_off: true}, + updateIgnoreList: [], + updateAutoCheckSwitch: true, + updateShowOnAfSettings: true, + updateShowOnShowingResult: true, + autoTaskShowOnShowingResult: true, + statListShowZero: 1, // hide zero + statListDateRange: 2, // today + autojsGlobalLogSwitch: true, + autojsGlobalLogConfigPath: './log/', + autojsGlobalLogConfigFilePattern: '%d{yyyy-MM-dd/}%m%n', + autojsGlobalLogConfigMaxBackupSize: 7, + autojsGlobalLogConfigMaxFileSize: 320, // KB + energyDoubleCollectSwitch: false, + energyRainCollectSwitch: false, + strollButtonMatchThreshold: 10, + strollButtonLocateMainColor: '#FF7E00', + // 1 <= x <= 5; to avoid infinite loop targets detection + strollNotTargetedLimit: 3, + rootAccessPrivileges: { + forceStopApp: false, + screenOffByKeyEvent: true, + }, }, unlock: { // when we first met, i do not know your name, your age, or, your sexual orientation, wow... - unlock_code: null, + unlockCode: null, // max times for trying unlocking your phone - unlock_max_try_times: 20, + unlockTryLimit: 20, // 'segmental' for faster and more accurate swipe and 'solid' for stable swipe without break - unlock_pattern_strategy: 'segmental', + unlockPatternStrategy: 'segmental', // side size of a speed-dial-like pattern for unlocking your phone, and 3 is the most common value - unlock_pattern_size: 3, + unlockPatternSize: 3, // swipe time for pattern unlock each two points; may be auto modified - unlock_pattern_swipe_time_segmental: 120, + unlockPatternSwipeDurationSegmental: 120, // swipe time for pattern unlock each time; may be auto modified - unlock_pattern_swipe_time_solid: 200, + unlockPatternSwipeDurationSolid: 200, // also, 'delay' or 'disable' dismiss layer check is optional - unlock_dismiss_layer_strategy: 'preferred', + unlockDismissLayerStrategy: 'preferred', // 0.5 <= x <= 0.95; great value (like 0.95) may cause unexpected object activation - unlock_dismiss_layer_bottom: 0.7, - // 0.05 <= x <= 0.3; this value may be not that important - unlock_dismiss_layer_top: 0.2, + unlockDismissLayerBottom: 0.7, + // 0.05 <= x <= 0.4; this value may be not that important + unlockDismissLayerTop: 0.3, // time for swiping up to dismiss the lock screen layer; will be auto modified initially - unlock_dismiss_layer_swipe_time: 110, + unlockDismissLayerSwipeDuration: 110, }, settings: { - item_area_width: 0.78, + itemAreaWidth: 0.78, }, }; \ No newline at end of file diff --git a/assets/data/dialog-contents.js b/assets/data/dialog-contents.js index dea596d..dfc4a30 100644 --- a/assets/data/dialog-contents.js +++ b/assets/data/dialog-contents.js @@ -117,7 +117,7 @@ module.exports = { '如有疑问或疑虑\n' + '可按音量键强制停止脚本\n' + '成功登陆后再重新运行脚本', - account_log_back_in_max_continuous_times: // 最大连续回切次数 + accountLogBackInMaxContinuousTimes: // 最大连续回切次数 '计数器达最大次数时将不再回切\n' + '且计数器将自动清零\n\n' + '* 设置 0 值可不限制回切次数\n' + @@ -145,7 +145,7 @@ module.exports = { '推迟分钟按以下方案逐次增量\n' + '[ 1, 1, 2, 3, 5, 8, 10 ]\n' + '达到 10 后将一直保持 10 分钟', - forest_balls_click_duration: // 能量球点击时长 + forestBallsClickDuration: // 能量球点击时长 '此设置值影响能量球的点击时间\n' + '点击方法采用press()\n\n' + '注意:\n' + @@ -154,7 +154,7 @@ module.exports = { '2. 好友森林能量球 (绿/橙/金)\n\n' + '设置过小值可能造成点击不被响应\n' + '设置过大值将影响快速收取体验', - forest_balls_click_interval: // 能量球点击间隔 + forestBallsClickInterval: // 能量球点击间隔 '当可点击的能量球数量超过 1 时\n' + '此设置值影响能量球之间的点击间隔\n\n' + '注意:\n' + @@ -176,7 +176,7 @@ module.exports = { '统计出可同时适配白天及黑夜场景\n' + '且数值出现概率合适的极大值\n' + '将此值作为参数值即可实现匹配', - homepage_monitor_threshold: // 主页能量球循环监测阈值 + homepageMonitorThreshold: // 主页能量球循环监测阈值 '当进入主页存在未成熟能量球\n' + '且最小成熟倒计时达到阈值时\n' + '将循环监测直到能量球成熟并收取\n' + @@ -185,7 +185,7 @@ module.exports = { '则继续重复循环监测操作\n' + '直到没有未成熟能量球\n' + '或最小倒计时未达到设定阈值为止', - homepage_bg_monitor_threshold: // 主页能量球返检阈值 + homepageBackgroundMonitorThreshold: // 主页能量球返检阈值 '好友排行榜操作期间\n' + '若主页能量最小成熟时间达到阈值\n' + '则返回森林主页开始监控能量球\n' + @@ -196,12 +196,12 @@ module.exports = { '* 返检阈值不可大于监测阈值\n' + '* 接受非整数数值' + '-- 如 1.5, 2.8 等', - friend_collect_icon_color: // 收取图标颜色色值 + friendCollectIconColor: // 收取图标颜色色值 '排行榜识别绿色手形图标的参照色值\n\n' + '示例:\n' + 'rgb(67,160,71)\n' + '#AEB0B3', - friend_collect_icon_threshold: // 收取图标颜色检测阈值 + friendCollectIconThreshold: // 收取图标颜色检测阈值 '排行榜识别绿色手形图标的\n' + '参照色值检测阈值\n' + '阈值越大 匹配越宽松 反之越严格\n' + @@ -213,7 +213,7 @@ module.exports = { '影响收取体验\n' + '数量过少将导致识别率受影响\n' + '出现遗漏或误判', - forestImagePoolItv: // 能量球样本采集间隔 + forestImagePoolInterval: // 能量球样本采集间隔 '森林页面样本采集池样本之间的' + '存放间隔\n\n' + '间隔的意义主要在于保证\n' + @@ -232,7 +232,7 @@ module.exports = { '示例 2 : 0.1,120,0.9,53%\n\n' + '也可使用可视化工具进行参数设置:\n' + 'tools/Floaty_Rectangle_Region.js', - ripeBallDetectColorVal: // 成熟能量球颜色色值 + ripeBallDetectColorValue: // 成熟能量球颜色色值 '森林页面识别成熟能量球的参照色值\n\n' + '示例:\n' + 'rgb(67,160,71)\n' + @@ -242,7 +242,7 @@ module.exports = { '参照色值检测阈值\n' + '阈值越大 匹配越宽松 反之越严格\n' + '0 表示完全相似', - unlock_code: // 设置锁屏解锁密码 + unlockCode: // 设置锁屏解锁密码 '密码长度不小于 3 位\n' + '无密码可留空\n\n' + '若采用图案解锁方式\n' + @@ -291,21 +291,21 @@ module.exports = { '如 微博/微信/支付宝 以及 QQ 等\n' + '详情参阅:\n' + 'https://www.zhihu.com/question/20206696', - unlock_dismiss_layer_swipe_time: // 提示层页面上滑时长 + unlockDismissLayerSwipeDuration: // 提示层页面上滑时长 '设置整百值可保证匀速滑动\n' + '十位小于5可实现不同程度惯性滑动\n\n' + '* 通常无需自行设置\n' + '* 脚本会自动尝试增量赋值\n' + '-- 以获得最佳值', - unlock_dismiss_layer_bottom: // 提示层页面起点位置 + unlockDismissLayerBottom: // 提示层页面起点位置 '设置滑动起点的屏高百分比\n\n' + '* 通常无需自行设置\n' + '* 设置过大值可能激活非预期控件', - unlock_dismiss_layer_top: // 提示层页面终点位置 + unlockDismissLayerTop: // 提示层页面终点位置 '设置滑动终点的屏高百分比\n\n' + '* 通常无需自行设置\n' + '* 此配置值对滑动影响程度较小', - about_unlock_pattern_strategy: // 关于图案解锁滑动策略 + about_unlockPatternStrategy: // 关于图案解锁滑动策略 '叠加路径:\n\n' + '采用 gestures() 方法\n' + '将每两个点组成直线路径\n' + @@ -331,7 +331,7 @@ module.exports = { '* 推荐优先使用\'叠加路径\'策略\n' + '-- 当出现路径断开现象时\n' + '-- 可尝试"连续路径"策略', - about_unlock_dismiss_layer_strategy: // 关于提示层页面检测方式 + about_unlockDismissLayerStrategy: // 关于提示层页面检测方式 '解锁前通常需要上滑提示层页面\n' + '然后再输入密码或进行图案解锁\n\n' + '解锁模块执行逻辑默认会\n' + @@ -341,7 +341,7 @@ module.exports = { '滞后: 先判断解锁页面\n' + '禁用: 只判断解锁页面\n\n' + '* 通常无需修改此项设置', - unlock_pattern_swipe_time_segmental: // 设置图案解锁滑动时长 - 叠加路径策略 + unlockPatternSwipeDurationSegmental: // 设置图案解锁滑动时长 - 叠加路径策略 '此参数表示两拐点间滑动时长\n' + '并非表示滑动总时间\n' + '总时间=(拐点数+1)×此参数\n' + @@ -354,13 +354,13 @@ module.exports = { '* 通常无需自行设置\n' + '-- 脚本会自动尝试增量赋值\n' + '-- 以获得最佳值', - unlock_pattern_swipe_time_solid: // 设置图案解锁滑动时长 - 连续路径策略 + unlockPatternSwipeDurationSolid: // 设置图案解锁滑动时长 - 连续路径策略 '此参数表示首末点间滑动时长\n' + '亦即表示滑动总时间\n\n' + '* 通常无需自行设置\n' + '-- 脚本会自动尝试增量赋值\n' + '-- 以获得最佳值', - unlock_pattern_size: // 设置图案解锁边长 + unlockPatternSize: // 设置图案解锁边长 '图案解锁通常为 N × N 的点阵\n' + '通常边长 N 为 3\n\n' + '若未使用图案解锁方式\n' + @@ -420,13 +420,13 @@ module.exports = { '-- 目标可收取前不断检测倒计时\n' + '-- 进而保证目标及时收取\n\n' + '确定要保留当前设置值吗', - timers_insurance_interval: // 保险任务运行间隔 + timersInsuranceInterval: // 保险任务运行间隔 '设置值用于当保险任务保留时\n' + '下次定时任务启动的时间间隔\n\n' + '* 保险任务在脚本运行时设置\n' + '* 脚本运行中每10秒钟自动重置间隔\n' + '* 脚本结束前自动移除所有保险任务', - timers_insurance_max_continuous_times: // 最大连续保险次数 + timersInsuranceMaxContinuousTimes: // 最大连续保险次数 '设置值用于当保险任务连续激活\n' + '次数超过一定值时\n' + '不再继续自动设置保险任务\n' + @@ -538,11 +538,11 @@ module.exports = { '则时段管理将失去意义\n' + '如 [ 05:23, 05:23 ]\n' + '等同于"全天有效"的效果', - max_running_time_global: // 脚本单次运行最大时间 + maxRunningTimeGlobal: // 脚本单次运行最大时间 '设置值用于脚本单次运行\n' + '可消耗的最大时间\n' + '避免无人值守时的无响应情况', - max_queue_time_global: // 排他性任务最大排队时间 + maxQueueTimeGlobal: // 排他性任务最大排队时间 '当旧排他性任务运行或排队时\n' + '新排他性任务将继续排队\n' + '排队时间与排他性任务总数相关\n\n' + @@ -550,7 +550,7 @@ module.exports = { '-- 当前正在运行的排他性任务\n' + '* 设置过小的值可能在脚本\n' + '-- 正常结束前被意外终止', - min_bomb_interval_global: // 脚本炸弹预防阈值 + minBombIntervalGlobal: // 脚本炸弹预防阈值 '若当前脚本与最近一个正在运行的蚂蚁森林脚本的运行时间差小于此阈值\n' + '则视当前脚本为炸弹脚本\n' + '炸弹脚本将自动强制停止\n' + @@ -598,17 +598,17 @@ module.exports = { '4. 解锁模块的开发者测试模式\n' + '5. 重要的工具函数\n\n' + '缺少工具函数将导致项目无法运行', - rank_list_swipe_time: // 设置排行榜页面滑动时长 + rankListSwipeDuration: // 设置排行榜页面滑动时长 '通常无需自行设置\n' + '若出现滑动异常现象\n' + '可尝试适当增大此设置值', - rank_list_swipe_interval: // 设置排行榜页面滑动间隔 + rankListSwipeInterval: // 设置排行榜页面滑动间隔 '若出现遗漏目标的情况\n' + '可尝试适当增大此设置值', - rank_list_scroll_interval: // 设置排行榜页面滑动间隔 + rankListScrollInterval: // 设置排行榜页面滑动间隔 '若出现遗漏目标的情况\n' + '可尝试适当增大此设置值', - rank_list_capt_pool_diff_check_threshold: // 排行榜截图样本池差异检测阈值 + rankListCaptPoolDiffCheckThreshold: // 排行榜截图样本池差异检测阈值 '排行榜滑动前后截图样本相同时\n' + '脚本认为滑动无效 并进行无效次数统计 ' + '当连续无效次数达到阈值时 将放弃滑动并结束好友能量检查\n\n' + @@ -616,7 +616,7 @@ module.exports = { '根据实际情况点击"再试一次"或等待"正在加载"按钮消失 (最大等待2分钟)\n\n' + '* 此参数主要避免因意外情况导致当前页面不在排行榜页面时的无限滑动\n' + '* 截图样本相同指: 相似度极高', - rank_list_max_not_targeted_times: // 最大连续无目标命中次数 + rankListNotTargetedLimit: // 最大连续无目标命中次数 '排行榜每滑动一次\n' + '若当前页面没有好友\n' + '则记录一次无目标命中次数\n' + @@ -652,13 +652,13 @@ module.exports = { '则触发复查条件\n\n' + '* 有效点击指进入好友森林后\n' + '-- 点击过可收取的能量球', - stroll_btn_locate_main_color: // 逛一逛按钮定位主要色值 + strollButtonLocateMainColor: // 逛一逛按钮定位主要色值 '参数用于配置多点取色方式\n' + '定位逛一逛按钮时的基准色值', - stroll_btn_match_threshold: // 逛一逛按钮定位匹配阈值 + strollButtonMatchThreshold: // 逛一逛按钮定位匹配阈值 '参数用于配置多点取色方式\n' + '定位逛一逛按钮时的匹配阈值', - max_continuous_not_targeted_stroll_cycle: // 逛一逛最大无操作循环次数 + strollNotTargetedLimit: // 逛一逛最大无操作循环次数 '参数用于防止逛一逛策略\n' + '在采集过程中遇到无操作好友\n' + '可能引起的无限循环\n\n' + @@ -707,7 +707,7 @@ module.exports = { '手动添加易出错\n' + '且难以键入特殊字符\n' + '建议使用列表导入功能', - phone_call_state_idle_value: // 通话空闲状态值 + phoneCallStateIdleValue: // 通话空闲状态值 '当设备当前通话状态值\n' + '与空闲状态值不一致时\n' + '将触发通话状态事件\n' + @@ -717,7 +717,7 @@ module.exports = { '-- 脚本将执行一次支付宝前置操作\n' + '* 不同设备的通话空闲状态值\n' + '-- 可能存在差异', - phone_call_state_idle_value_warn: // 通话空闲状态值设置警告 + phoneCallStateIdleValueWarn: // 通话空闲状态值设置警告 '输入值与当前通话空闲值不一致\n' + '此配置将导致脚本无法正常运行\n\n' + '确定要使用当前输入值吗', @@ -733,7 +733,7 @@ module.exports = { rank_list_bottom_template_hint_not_exists: // 排行榜底部控件图片模板不存在附加提示 '当前暂未生成图片模板\n' + '脚本在下次运行时将自动生成新模板', - about_root_access_functions: // 关于Root权限功能 + about_rootAccessPrivileges: // 关于Root权限功能 '当Auto.js被授予Root权限时\n' + '可通过Root权限实现功能升级\n' + '如可以直接模拟按键实现快速关屏\n' + @@ -746,25 +746,6 @@ module.exports = { '可能出现几秒钟的黑屏现象\n' + '此时Toast及Floaty消息会出现阻塞\n' + '因此可能影响运行结果展示的效果', - about_auto_enable_a11y_svc: // 关于自动开启无障碍服务 - '通过修改系统无障碍服务的列表参数\n' + - '实现Auto.js无障碍服务的自动开启\n' + - '此过程需要授予Auto.js以下权限:\n\n' + - 'WRITE_SECURE_SETTINGS\n\n' + - '如果设备已经获取Root权限\n' + - '脚本将自动完成上述所需权限的授权\n' + - '否则需要将手机连接到计算机\n' + - '然后在计算机使用ADB工具\n' + - '执行以下指令(无换行):\n\n' + - 'adb shell pm grant org.autojs.autojs ' + - 'android.permission.WRITE_SECURE_SETTINGS\n\n' + - '执行后Auto.js将获取上述权限\n' + - '如需撤销授权需将上述指令的\n' + - 'grant替换为revoke\n\n' + - '注: 如果没有权限授权\n' + - '脚本则会在需要的时候\n' + - '提示用户手动开启无障碍服务\n\n' + - '* 参数默认值: 禁用自动启动', about_app_launch_springboard: // 关于启动跳板 '某些设备或应用无法直接调用 APP\n' + '如 launch() 或 startActivity() 等\n' + @@ -793,7 +774,7 @@ module.exports = { '除非已确定此任务的异常性\n' + '否则强烈不建议删除此任务\n\n' + '确定要删除最小倒计时任务吗', - prompt_before_running_countdown_seconds: // 提示对话框倒计时时长 + promptBeforeRunningCountdownSeconds: // 提示对话框倒计时时长 '倒计时结束前\n' + '用户可自主点击按钮执行相应操作\n' + '否则倒计时超时后脚本将自动执行', @@ -937,7 +918,7 @@ module.exports = { '此时如果再将v2.0.3添加至列表\n' + '则脚本依然会提示项目有更新\n' + '且最新版本为v2.0.2\n', - about_rank_list_scan_strategy: // 关于排行榜页面滑动策略 + aboutRankListScanStrategy: // 关于排行榜页面滑动策略 '控件滚动:\n' + '基于排行榜可滚动控件的\n' + '无障碍行为实现列表滚动\n' + diff --git a/assets/docs/CHANGELOG-2.md b/assets/docs/CHANGELOG-2.md index 00b947f..5a6811b 100644 --- a/assets/docs/CHANGELOG-2.md +++ b/assets/docs/CHANGELOG-2.md @@ -4,6 +4,18 @@ ****** +# v2.3.1 + +###### 2023/01/21 + +* `修复` 蚂蚁森林页面更新后无法收取自己及好友能量的问题 + +# v2.3.0 + +###### 2022/03/20 - 代码重构 谨慎升级 + +* `优化` 重构部分模块以适配 AutoJs6 + # v2.2.2 ###### 2021/11/01 diff --git a/assets/docs/MANUAL.md b/assets/docs/MANUAL.md index 0143564..dbeb983 100644 --- a/assets/docs/MANUAL.md +++ b/assets/docs/MANUAL.md @@ -83,9 +83,7 @@ Auto.js 的自动操作主要基于控件与坐标 ##### 软件安装 -- 免费版本 [4.1.1 Alpha2](https://github.com/SuperMonster002/Hello-Sockpuppet/raw/master/%5Bauto.js%5D%5B4.1.1_alpha2%5D%5Barm-v7a%5D(b69a4e23).apk?raw=true) - -- 其他版本详见 [README.md](https://github.com/SuperMonster003/Ant-Forest#autojs%E5%8F%AF%E7%94%A8%E7%89%88%E6%9C%AC) +- [AutoJs6](https://github.com/SuperMonster003/AutoJs6/releases/latest) (`开源免费`) ##### 开启无障碍服务 diff --git a/assets/docs/MEMORANDUM.md b/assets/docs/MEMORANDUM.md index f70556e..6cdfcd7 100644 --- a/assets/docs/MEMORANDUM.md +++ b/assets/docs/MEMORANDUM.md @@ -8,7 +8,7 @@ Thank [TonyJiangWJ](https://github.com/TonyJiangWJ) for the great idea :) . ```typescript runtime.getAccessibilityBridge() - .setWindowFilter(new com.stardust.autojs.core.accessibility + .setWindowFilter(new org.autojs.autojs.core.accessibility .AccessibilityBridge$WindowFilter({ filter: (info: android.view.accessibility .AccessibilityWindowInfo) => boolean, diff --git a/assets/docs/TODO.md b/assets/docs/TODO.md index 6494053..f642dd0 100644 --- a/assets/docs/TODO.md +++ b/assets/docs/TODO.md @@ -2,7 +2,7 @@

- AF_Banner + AF_Banner

Todo List

@@ -12,124 +12,124 @@
表头
-| Status: 状态 | Cost: 开发难度 | Progress: 进度 | -| --- | --- | --- | -| ✔️ - 已完成
✒️ - 开发中
🦴 - 待开发
❌ - 已放弃 | x - x ∈ \[1,10]
? - 可能放弃
= - 受到牵制
! - 亟待解决 | x - x ∈ \[0,1]
1 - 100%
0.23 - 23% +| Status: 状态 | Cost: 开发难度 | Progress: 进度 | +|---------------------------------------------------|-----------------------------------------------------------|----------------------------------------------| +| ✔️ - 已完成
✒️ - 开发中
🦴 - 待开发
❌ - 已放弃 | x - x ∈ \[1,10]
? - 可能放弃
= - 受到牵制
! - 亟待解决 | x - x ∈ \[0,1]
1 - 100%
0.23 - 23% |
基本
-| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | -| ✔️ | 推迟任务加入下次关屏选项 | 2021-11-01 18:16:56 | 5 | 1 | -| ✔️ | 浇水能量球误识别导致假死 | 2021-10-26 10:24:44 | 2 | 1 | -| ✔️ | 排行榜图标自动替换 (文件摘要) | 2021-10-26 08:47:07 | 9 | 1 | -| ✔️ | 排行榜图标分辨率自适应 | 2021-10-26 08:46:22 | 5 | 1 | -| ✔️ | 推迟任务时可能出现假死 | 2021-10-26 08:23:38 | 3 | 1 | -| ✒️ | 启动器模块化 | 2021-10-26 08:25:42 | 10 | 0.00 | -| 🦴 | 夜晚主题时能量球识别率降低 | 2021-10-26 10:24:01 | ! 5 | - | -| 🦴 | 开发者测试日志不打印控制台而直接写入文件 | 2021-10-25 22:29:48 | = 9 | 0.40 | -| 🦴 | 使用安卓广播替换现有监听器 | 2021-10-25 22:15:08 | ? 8 | - | -| 🦴 | 结果展示倒计时结束时立即关闭悬浮窗 | 2021-10-25 22:27:55 | 2 | - | -| 🦴 | 增加支付宝最小化超时检测 | 2021-10-25 22:29:48 | 2 | - | -| 🦴 | 支持收取好友赠送的工具 (双击卡等) | 2021-10-26 17:58:34 | 6 | - | -| 🦴 | 主账户切换时可能因控件位于屏外而无法获取 | 2021-10-26 09:45:18 | = 1 | - | -| 🦴 | 逛一逛方案连续运行优化 | 2021-10-26 10:56:03 | 4 | - | -| 🦴 | 健康状态监测功能 | 2021-10-26 10:59:57 | 10 | - | -| 🦴 | 支付宝英文控件识别 (#402) | 2021-10-26 14:09:08 | 3 | - | -| 🦴 | 运行结果展示加入今日统计内容 | 2021-10-26 11:36:28 | = 5 | - | -| 🦴 | 部分MIUI设备解析能量球数据用时过多 (#531) | 2021-10-31 18:59:56 | 9 | - | -| 🦴 | 账户模块重构 | 2021-11-15 22:05:32 | 8 | - | +| Status | Task | Date | Cost | Progress | +|:------:|------------------------------------------------|:-------------------:|:-----------------------------------:|:------------------------------:| +| ✔️ | 推迟任务加入下次关屏选项 | 2021-11-01 18:16:56 | 5 | 1 | +| ✔️ | 浇水能量球误识别导致假死 | 2021-10-26 10:24:44 | 2 | 1 | +| ✔️ | 排行榜图标自动替换 (文件摘要) | 2021-10-26 08:47:07 | 9 | 1 | +| ✔️ | 排行榜图标分辨率自适应 | 2021-10-26 08:46:22 | 5 | 1 | +| ✔️ | 推迟任务时可能出现假死 | 2021-10-26 08:23:38 | 3 | 1 | +| ✒️ | 启动器模块化 | 2021-10-26 08:25:42 | 10 | 0.00 | +| 🦴 | 夜晚主题时能量球识别率降低 | 2021-10-26 10:24:01 | ! 5 | - | +| 🦴 | 开发者测试日志不打印控制台而直接写入文件 | 2021-10-25 22:29:48 | = 9 | 0.40 | +| 🦴 | 使用安卓广播替换现有监听器 | 2021-10-25 22:15:08 | ? 8 | - | +| 🦴 | 结果展示倒计时结束时立即关闭悬浮窗 | 2021-10-25 22:27:55 | 2 | - | +| 🦴 | 增加支付宝最小化超时检测 | 2021-10-25 22:29:48 | 2 | - | +| 🦴 | 支持收取好友赠送的工具 (双击卡等) | 2021-10-26 17:58:34 | 6 | - | +| 🦴 | 主账户切换时可能因控件位于屏外而无法获取 | 2021-10-26 09:45:18 | = 1 | - | +| 🦴 | 逛一逛方案连续运行优化 | 2021-10-26 10:56:03 | 4 | - | +| 🦴 | 健康状态监测功能 | 2021-10-26 10:59:57 | 10 | - | +| 🦴 | 支付宝英文控件识别 (#402) | 2021-10-26 14:09:08 | 3 | - | +| 🦴 | 运行结果展示加入今日统计内容 | 2021-10-26 11:36:28 | = 5 | - | +| 🦴 | 部分MIUI设备解析能量球数据用时过多 (#531) | 2021-10-31 18:59:56 | 9 | - | +| 🦴 | 账户模块重构 | 2021-11-15 22:05:32 | 8 | - |
配置
-| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | -| ✔️ | 查看历史更新失败率高 | 2021-10-25 22:37:19 | 3 | 1 | -| ✒️ | 配置工具模块化 | 2021-10-26 08:24:34 | 10 | 0.00 | -| ✒️ | 事件监测配置 (#533) | 2021-10-26 10:50:40 | ! 6 | 0.00 | -| ✒️ | 排行榜策略加入黑名单检测方案配置 (#529) | 2021-10-31 18:57:17 | ! 5 | 0.00 | -| 🦴 | 运行提示增加新 UI (保留旧 UI) | 2021-10-26 09:29:23 | = 9 | 0.40 | -| 🦴 | 查看历史更新失败后尝试从本地获取 | 2021-10-25 22:39:59 | 2 | - | -| 🦴 | 主页能量球倒计时获取方式配置 (BaiduOCR / Toast) | 2021-10-25 22:35:25 | 4 | - | -| 🦴 | a11yx.enableByRoot() 整合至配置工具 | 2021-10-26 08:12:09 | 4 | - | -| 🦴 | 有效时段增加应用范围 (自收 / 收取) | 2021-10-26 08:22:44 | 4 | - | -| 🦴 | 主页能量成熟时间 (自动计算 / 手动设置) (#500) | 2021-10-26 10:28:50 | = 7 | - | -| 🦴 | 双击卡最佳使用时刻统计 (根据数据库) | 2021-10-26 08:22:44 | = 4 | - | -| 🦴 | 多语言设置 | 2021-10-26 14:11:22 | = 10 | - | -| 🦴 | 测试还原初始设置功能 | 2021-10-26 14:25:36 | 4 | - | +| Status | Task | Date | Cost | Progress | +|:------:|---------------------------------------------------------|:-------------------:|:----------------------------:|:-----------------------------:| +| ✔️ | 查看历史更新失败率高 | 2021-10-25 22:37:19 | 3 | 1 | +| ✒️ | 配置工具模块化 | 2021-10-26 08:24:34 | 10 | 0.00 | +| ✒️ | 事件监测配置 (#533) | 2021-10-26 10:50:40 | ! 6 | 0.00 | +| ✒️ | 排行榜策略加入黑名单检测方案配置 (#529) | 2021-10-31 18:57:17 | ! 5 | 0.00 | +| 🦴 | 运行提示增加新 UI (保留旧 UI) | 2021-10-26 09:29:23 | = 9 | 0.40 | +| 🦴 | 查看历史更新失败后尝试从本地获取 | 2021-10-25 22:39:59 | 2 | - | +| 🦴 | 主页能量球倒计时获取方式配置 (BaiduOCR / Toast) | 2021-10-25 22:35:25 | 4 | - | +| 🦴 | a11yx.enableByRoot() 整合至配置工具 | 2021-10-26 08:12:09 | 4 | - | +| 🦴 | 有效时段增加应用范围 (自收 / 收取) | 2021-10-26 08:22:44 | 4 | - | +| 🦴 | 主页能量成熟时间 (自动计算 / 手动设置) (#500) | 2021-10-26 10:28:50 | = 7 | - | +| 🦴 | 双击卡最佳使用时刻统计 (根据数据库) | 2021-10-26 08:22:44 | = 4 | - | +| 🦴 | 多语言设置 | 2021-10-26 14:11:22 | = 10 | - | +| 🦴 | 测试还原初始设置功能 | 2021-10-26 14:25:36 | 4 | - |
模块
-| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | -| ✔️ | cryptox 模块 (根据 Pro 版本) | 2021-10-26 08:49:39 | 9 | 1 | -| ✔️ | appx.startActivity 增加 monitor 和 package 支持 | 2021-10-26 09:13:07 | 5 | 1 | -| ✒️ | 扩展模块及插件重构 | 2021-10-26 14:37:07 | ! 8 | 0.39 | -| ✒️ | 自动关闭屏幕配置 (#476) | 2021-10-26 11:15:11 | ! 6 | 0.00 | -| ✒️ | 将 tool functions 转换为 OOP | 2021-10-25 22:24:13 | 10 | 0.18 | -| ✒️ | 分离 appx 模块 (autojs / alipay ...) | 2021-10-25 22:24:13 | 6 | 0.17 | -| 🦴 | Pro 版本 cryptox 功能测试 | 2021-10-25 23:01:30 | ! 2 | - | -| 🦴 | consolex的border状态没有全局共享 | 2021-10-25 22:21:52 | ? 2 | - | -| 🦴 | unlock 功能插件化 | 2021-10-25 22:41:01 | 8 | - | -| 🦴 | inspect-lock-screen-layout 合并进 unlock 插件 | 2021-10-25 22:40:42 | ? 8 | - | -| 🦴 | login 功能插件化 | 2021-10-26 09:05:48 | 10 | - | -| 🦴 | dialogsx.buildFlow 终止按钮及返回键功能问题 | 2021-10-26 09:39:42 | 4 | - | +| Status | Task | Date | Cost | Progress | +|:------:|-----------------------------------------------------------|:-------------------:|:----:|:---------------------------:| +| ✔️ | cryptox 模块 (根据 Pro 版本) | 2021-10-26 08:49:39 | 9 | 1 | +| ✔️ | appx.startActivity 增加 monitor 和 package 支持 | 2021-10-26 09:13:07 | 5 | 1 | +| ✒️ | 扩展模块及插件重构 | 2021-10-26 14:37:07 | ! 8 | 0.39 | +| ✒️ | 自动关闭屏幕配置 (#476) | 2021-10-26 11:15:11 | ! 6 | 0.00 | +| ✒️ | 将 tool functions 转换为 OOP | 2021-10-25 22:24:13 | 10 | 0.18 | +| ✒️ | 分离 appx 模块 (autojs / alipay ...) | 2021-10-25 22:24:13 | 6 | 0.17 | +| 🦴 | Pro 版本 cryptox 功能测试 | 2021-10-25 23:01:30 | ! 2 | - | +| 🦴 | consolex的border状态没有全局共享 | 2021-10-25 22:21:52 | ? 2 | - | +| 🦴 | unlock 功能插件化 | 2021-10-25 22:41:01 | 8 | - | +| 🦴 | inspect-lock-screen-layout 合并进 unlock 插件 | 2021-10-25 22:40:42 | ? 8 | - | +| 🦴 | login 功能插件化 | 2021-10-26 09:05:48 | 10 | - | +| 🦴 | dialogsx.buildFlow 终止按钮及返回键功能问题 | 2021-10-26 09:39:42 | 4 | - |
工具
-| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | -| ✔️ | 能量雨加入近似区域点击检测 | 2021-10-27 14:48:18 | 3 | 1 | -| ✒️ | 保护地巡护工具 | 2021-10-26 10:34:25 | 9 | 0.20 | -| 🦴 | Auto.js 权限管理工具 | 2021-10-26 10:47:04 | = 9 | 0.10 | -| 🦴 | 数据库 (db文件) 迁移 / 合并 | 2021-10-25 22:57:56 | 4 | - | -| 🦴 | 能量雨配置工具 | 2021-10-25 23:00:50 | 3 | - | -| 🦴 | 能量雨适配安卓 999 用户 (#510) | 2021-10-25 23:03:02 | ? 3 | - | -| 🦴 | 能量雨结果存入统计数据库 | 2021-10-26 08:35:01 | 4 | - | -| 🦴 | 能量雨加入运行提示 / 音量键监听 / 排他性检测 | 2021-10-26 09:18:47 | 6 | - | -| 🦴 | 基于 UI 或 Dialog 的启动器 (配置 / 创建 SC ...) | 2021-10-26 09:19:54 | 10 | - | -| 🦴 | 神奇物种工具 | 2021-10-26 10:34:21 | 2 | - | -| 🦴 | 保护地巡护自动答题 | 2021-10-26 10:34:06 | = 9 | - | -| 🦴 | 双击卡获取工具 | 2021-10-26 11:24:28 | 2 | - | -| 🦴 | 双击卡使用工具 | 2021-10-26 11:24:45 | 2 | - | -| 🦴 | 项目部署工具加入 Auto.js 权限申请步骤 | 2021-10-26 11:41:53 | = 5 | - | -| 🦴 | 支付宝账户库 | 2021-10-26 14:20:12 | 7 | - | -| 🦴 | 合种浇水工具 | 2021-10-29 08:42:20 | 4 | - | +| Status | Task | Date | Cost | Progress | +|:------:|--------------------------------------|:-------------------:|:---------------------------:|:------------------:| +| ✔️ | 能量雨加入近似区域点击检测 | 2021-10-27 14:48:18 | 3 | 1 | +| ✒️ | 保护地巡护工具 | 2021-10-26 10:34:25 | 9 | 0.20 | +| 🦴 | Auto.js 权限管理工具 | 2021-10-26 10:47:04 | = 9 | 0.10 | +| 🦴 | 数据库 (db文件) 迁移 / 合并 | 2021-10-25 22:57:56 | 4 | - | +| 🦴 | 能量雨配置工具 | 2021-10-25 23:00:50 | 3 | - | +| 🦴 | 能量雨适配安卓 999 用户 (#510) | 2021-10-25 23:03:02 | ? 3 | - | +| 🦴 | 能量雨结果存入统计数据库 | 2021-10-26 08:35:01 | 4 | - | +| 🦴 | 能量雨加入运行提示 / 音量键监听 / 排他性检测 | 2021-10-26 09:18:47 | 6 | - | +| 🦴 | 基于 UI 或 Dialog 的启动器 (配置 / 创建 SC ...) | 2021-10-26 09:19:54 | 10 | - | +| 🦴 | 神奇物种工具 | 2021-10-26 10:34:21 | 2 | - | +| 🦴 | 保护地巡护自动答题 | 2021-10-26 10:34:06 | = 9 | - | +| 🦴 | 双击卡获取工具 | 2021-10-26 11:24:28 | 2 | - | +| 🦴 | 双击卡使用工具 | 2021-10-26 11:24:45 | 2 | - | +| 🦴 | 项目部署工具加入 Auto.js 权限申请步骤 | 2021-10-26 11:41:53 | = 5 | - | +| 🦴 | 支付宝账户库 | 2021-10-26 14:20:12 | 7 | - | +| 🦴 | 合种浇水工具 | 2021-10-29 08:42:20 | 4 | - |
项目
-| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | -| ✔️ | v2.2.0 发布后检查 documents 相关的链接 | 2021-10-25 23:01:55 | 1 | 1 | -| ✒️ | 提取 JSDoc@typedef 到 TS 声明文件 | 2021-10-25 22:25:18 | 10 | 0.94 | -| 🦴 | FAQ 文档 | 2021-10-26 10:44:53 | 10 | - | -| 🦴 | 新仓库 (Auto.js-TypeScript-Declarations) | 2021-10-25 22:26:18 | 10 | - | +| Status | Task | Date | Cost | Progress | +|:------:|------------------------------------------------------|:-------------------:|:----:|:------------------------:| +| ✔️ | v2.2.0 发布后检查 documents 相关的链接 | 2021-10-25 23:01:55 | 1 | 1 | +| ✒️ | 提取 JSDoc@typedef 到 TS 声明文件 | 2021-10-25 22:25:18 | 10 | 0.94 | +| 🦴 | FAQ 文档 | 2021-10-26 10:44:53 | 10 | - | +| 🦴 | 新仓库 (Auto.js-TypeScript-Declarations) | 2021-10-25 22:26:18 | 10 | - |
其他
-| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | -| 🦴 | Pro 版本 org.apache.log4j.Logger 被混淆 | 2021-10-25 22:20:46 | ? 5 | - | -| 🦴 | Pro 版本 org.autojs.autojs.autojs.AutoJs.getInstance() 无效 | 2021-10-25 22:21:25 | ? 2 | - | +| Status | Task | Date | Cost | Progress | +|:------:|---------------------------------------------------------|:-------------------:|:----:|:--------:| +| 🦴 | Pro 版本 org.apache.log4j.Logger 被混淆 | 2021-10-25 22:20:46 | ? 5 | - | +| 🦴 | Pro 版本 org.autojs.autojs.autojs.AutoJs.getInstance() 无效 | 2021-10-25 22:21:25 | ? 2 | - |
归档
| Status | Task | Date | Cost | Progress | -| :---: | --- | :---: | :---: | :---: | +|:------:|------|:----:|:----:|:--------:|
diff --git a/assets/indices/glossary.json b/assets/indices/glossary.json index b105056..7b26fce 100644 --- a/assets/indices/glossary.json +++ b/assets/indices/glossary.json @@ -1,4 +1,5 @@ { + "AXR": "Arrow function returns without (X) the 'return' keyword", "a11y": "accessibility", "acc": "account", "accu": "accumulated", @@ -186,6 +187,7 @@ "idt": "identification", "idx": "index", "ifn": "if needed", + "IIFE": "Immediately-Invoked Function Expression", "inc": "increment", "inf": "information", "info": "information", diff --git a/assets/indices/xml-nodes.json b/assets/indices/xml-nodes.json index 91483dc..da054ef 100644 --- a/assets/indices/xml-nodes.json +++ b/assets/indices/xml-nodes.json @@ -3,32 +3,32 @@ ":example_1": "console.log(ui.inflate() instanceof android.widget.CheckBox); // true", ":example_2": "console.log(ui.inflate() instanceof com.google.android.material.appbar.AppBarLayout); // true", "appbar": "com.google.android.material.appbar.AppBarLayout", - "button": "com.stardust.autojs.core.ui.widget.JsButton", - "canvas": "com.stardust.autojs.core.graphics.ScriptCanvasView", + "button": "org.autojs.autojs.core.ui.widget.JsButton", + "canvas": "org.autojs.autojs.core.graphics.ScriptCanvasView", "card": "androidx.cardview.widget.CardView", "checkbox": "android.widget.CheckBox", "datepicker": "android.widget.DatePicker", "drawer": "androidx.drawerlayout.widget.DrawerLayout", "fab": "com.google.android.material.floatingactionbutton.FloatingActionButton", - "frame": "com.stardust.autojs.core.ui.widget.JsFrameLayout", - "grid": "com.stardust.autojs.core.ui.widget.JsGridView", - "img": "com.stardust.autojs.core.ui.widget.JsImageView", - "input": "com.stardust.autojs.core.ui.widget.JsEditText", - "linear": "com.stardust.autojs.core.ui.widget.JsLinearLayout", - "list": "com.stardust.autojs.core.ui.widget.JsListView", + "frame": "org.autojs.autojs.core.ui.widget.JsFrameLayout", + "grid": "org.autojs.autojs.core.ui.widget.JsGridView", + "img": "org.autojs.autojs.core.ui.widget.JsImageView", + "input": "org.autojs.autojs.core.ui.widget.JsEditText", + "linear": "org.autojs.autojs.core.ui.widget.JsLinearLayout", + "list": "org.autojs.autojs.core.ui.widget.JsListView", "progressbar": "android.widget.ProgressBar", "radio": "android.widget.RadioButton", "radiogroup": "android.widget.RadioGroup", - "relative": "com.stardust.autojs.core.ui.widget.JsRelativeLayout", + "relative": "org.autojs.autojs.core.ui.widget.JsRelativeLayout", "scroll": "android.widget.ScrollView", "seekbar": "android.widget.SeekBar", - "spinner": "com.stardust.autojs.core.ui.widget.JsSpinner", - "tabs": "com.stardust.autojs.core.ui.widget.JsTabLayout", - "text": "com.stardust.autojs.core.ui.widget.JsTextView", + "spinner": "org.autojs.autojs.core.ui.widget.JsSpinner", + "tabs": "org.autojs.autojs.core.ui.widget.JsTabLayout", + "text": "org.autojs.autojs.core.ui.widget.JsTextView", "timepicker": "android.widget.TimePicker", - "toolbar": "com.stardust.autojs.core.ui.widget.JsToolbar", - "vertical": "com.stardust.autojs.core.ui.widget.JsLinearLayout", - "viewpager": "com.stardust.autojs.core.ui.widget.JsViewPager", + "toolbar": "org.autojs.autojs.core.ui.widget.JsToolbar", + "vertical": "org.autojs.autojs.core.ui.widget.JsLinearLayout", + "viewpager": "org.autojs.autojs.core.ui.widget.JsViewPager", "AbsoluteLayout": "android.widget.AbsoluteLayout", "ActionMenuView": "android.widget.ActionMenuView", "AnalogClock": "android.widget.AnalogClock", @@ -44,7 +44,7 @@ "EditText": "android.widget.EditText", "FrameLayout": "android.widget.FrameLayout", "GridLayout": "android.widget.GridLayout", - "horizontal": "com.stardust.autojs.core.ui.widget.JsLinearLayout", + "horizontal": "org.autojs.autojs.core.ui.widget.JsLinearLayout", "HorizontalScrollView": "android.widget.HorizontalScrollView", "ImageButton": "android.widget.ImageButton", "ImageSwitcher": "android.widget.ImageSwitcher", diff --git a/modules/ext-a11y.js b/modules/ext-a11y.js index 042108d..c197d46 100644 --- a/modules/ext-a11y.js +++ b/modules/ext-a11y.js @@ -1,7 +1,7 @@ let { $$impeded, $$str, $$num, $$rex, isNonEmptyObject, requirex, } = require('./mod-global'); -let {consolex} = require('./ext-console'); +let { consolex } = require('./ext-console'); /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ @@ -10,10 +10,7 @@ let Settings = android.provider.Settings; let Secure = Settings.Secure; let Rect = android.graphics.Rect; let Point = org.opencv.core.Point; -let Intent = android.content.Intent; -let UiObject = com.stardust.automator.UiObject; -let UiSelector = com.stardust.autojs.core.accessibility.UiSelector; -let AccessibilityService = com.stardust.autojs.core.accessibility.AccessibilityService; +let AccessibilityService = org.autojs.autojs.core.accessibility.AccessibilityService; let AccessibilityWindowInfo = android.view.accessibility.AccessibilityWindowInfo; let _ = { @@ -28,7 +25,7 @@ let _ = { * @return {{svc: string[], forcible: boolean}} */ parseArgs(args) { - let _svc = [this.autojs_a11y_svc_name]; + let _svc = [ this.autojs_a11y_svc_name ]; let _forcible = false; let _type0 = typeof args[0]; if (_type0 !== 'undefined') { @@ -36,7 +33,7 @@ let _ = { _svc = args[0]; _forcible = !!args[1]; } else if (_type0 === 'string') { - _svc = [args[0]]; + _svc = [ args[0] ]; _forcible = !!args[1]; } else if (_type0 === 'boolean') { _forcible = args[0]; @@ -54,8 +51,8 @@ let _ = { }, tryEnableAndRestart() { if (exp.enable(true)) { - let {enginesx} = requirex('ext-engines'); - consolex.$(['已自动开启无障碍服务', '尝试一次项目重启操作'], 1, 0, 0, 2); + let { enginesx } = requirex('ext-engines'); + consolex.$([ '已自动开启无障碍服务', '尝试一次项目重启操作' ], 1, 0, 0, 2); enginesx.restart({ isDebug: true, is_instant_running: false, @@ -127,6 +124,7 @@ let exp = { }, service: { refreshServiceInfo() { + automator.waitForService(3e3); auto.service.setServiceInfo(auto.service.getServiceInfo()); }, }, @@ -145,7 +143,7 @@ let exp = { */ enable() { try { - let {forcible, svc} = _.parseArgs(arguments); + let { forcible, svc } = _.parseArgs(arguments); let _svc; if (!this.state(svc)) { _svc = this.enabled_svc.split(':') @@ -183,7 +181,7 @@ let exp = { Secure.putInt(_.ctx_reso, Secure.ACCESSIBILITY_ENABLED, 1); return true; } - let {forcible, svc} = _.parseArgs(arguments); + let { forcible, svc } = _.parseArgs(arguments); let _enabled_svc = _.getString(); let _contains = function () { for (let i = 0, l = svc.length; i < l; i += 1) { @@ -233,9 +231,9 @@ let exp = { if (Array.isArray(services)) { _services = services.slice(); } else if (typeof services === 'undefined') { - _services = [_.autojs_a11y_svc_name]; + _services = [ _.autojs_a11y_svc_name ]; } else if (typeof services === 'string') { - _services = [services]; + _services = [ services ]; } else { throw TypeError('Unknown a11y state type'); } @@ -264,570 +262,6 @@ let exp = { cache_pool: {}, }; let _ext = { - /** - * @param {A11yx.Pickup.Locators} [locator] - * @param {A11yx.Pickup.Result.Type} [type='widget'] - * @param {A11yx.Pickup.Options} [options] - * @return {A11yx.Pickup.Results} - */ - pickup(locator, type, options) { - let $ = { - /** @see {A11yx.Pickup.Select.Abbr} */ - loc_keys_abbr: { - bi$: 'boundsInside', - c$: 'clickable', - cn$: 'className', - }, - options: options || {}, - /** @return {A11yx.Pickup.Result.CanonicalType|any} */ - get res_type() { - return this._res_type = this._res_type || this.getResultType(type); - }, - /** @return {UiObject$|UiSelector$} */ - get locator() { - return this._locator || null; - }, - /** @return {?UiObject$} */ - get widget() { - return this._widget || null; - }, - /** @return {UiObject$[]} */ - get widget_collection() { - return this._wc || []; - }, - /** @return {?UiSelector$} */ - get selector() { - return this._selector || null; - }, - tools: { - /** - * @param {UiObject$|any} w - * @return {?org.opencv.core.Point} - */ - uiObject2Point(w) { - if (w instanceof UiObject) { - return new Point(w.bounds().centerX(), w.bounds().centerY()); - } - return null; - }, - wrapStrByOptDef(s) { - return !s && 'default' in $.options ? $.options.default : s; - }, - isArrResType() { - return /^(widgets|points)$/.test($.res_type); - }, - isCompass(o) { - return typeof o === 'string' && /([pck]\d*)+/.test(o); - }, - }, - refreshSvcInfoIFN() { - this.options.refresh && exp.service.refreshServiceInfo(); - }, - /** - * @return {A11yx.Pickup.Locators} - */ - parseRawLocator() { - let _locator = locator; - let _addition; - let _compass; - - if (Array.isArray(_locator)) { - let _loc = _locator.slice(); - if (this.tools.isCompass(_loc[_loc.length - 1])) { - _compass = _loc.pop(); - } - [_locator, _addition] = _loc; - } - - let _loc = this.setUniqueLocator(_locator, _addition); - - if (_loc instanceof UiSelector) { - this._selector = _loc; - this._widget = this.getWidgetByCompass(_loc.findOnce(), _compass); - if (this.tools.isArrResType()) { - this._wc = _loc.find().toArray(); - } - } else if (_loc instanceof UiObject) { - this._selector = null; - this._widget = this.getWidgetByCompass(_loc, _compass); - if (this.tools.isArrResType()) { - this._wc = [_loc]; - } - } - }, - /** - * @param {UiObject$|A11yx.Pickup.Locators} [locator] - * @param {A11yx.Pickup.Select.Object} [addition] - */ - setUniqueLocator(locator, addition) { - if (locator instanceof UiSelector) { - return this._locator = this.assembleSelectors(locator, addition); - } - if ($$str(locator) || $$num(locator) || $$rex(locator)) { - // noinspection JSCheckFunctionSignatures - let _loc = this.parseTextSelector(locator); - return this._locator = this.assembleSelectors(_loc, addition); - } - if (isPlainObject(locator)) { - let _loc = global.selector(); - let _addi = Object.assign(locator, addition); - return this._locator = this.assembleSelectors(_loc, _addi); - } - return this._locator = locator; - }, - /** - * @param {UiSelector$} selector - * @param {string} key - * @param {any[]} [args] - * @return {UiSelector$|void} - */ - extendLocator(selector, key, args) { - let {$$disp} = require('./ext-device'); - let _ext = { - get W() { - return typeof $$disp === 'object' ? $$disp.W : device.width; - }, - get H() { - return typeof $$disp === 'object' ? $$disp.H : device.height; - }, - /** - * @param {number|boolean} [ft=0.01] - fault tolerance - * @return {UiSelector$} - */ - isCenterX(ft) { - let _def = 0.01; - let _ft_num = Number(ft); - let _ft = ft === true || isNullish(ft) || isNaN(_ft_num) - ? _def - : ft === false ? ft : _ft_num.clamp(0, 0.25); - /** - * @param {UiObject$} w - * @return {boolean} - */ - let _v = w => Math.abs(w.bounds().centerX() - this.W / 2) <= this.W * _ft; - return _ft !== false - ? selector.filter(_v.toRegular()) - : selector.filter((w => !_v(w)).toRegular()); - }, - /** - * @param {number|boolean} [ft_y=0.15] - fault tolerance - * @return {UiSelector$} - */ - isFullScreen(ft_y) { - let _def = 0.15; - let _ft_y_num = Number(ft_y); - let _ft_y = ft_y === true || isNaN(_ft_y_num) - ? _def - : ft_y === false ? ft_y : _ft_y_num.clamp(0, 0.5); - let _v = w => { - return w.bounds().height() / this.H >= 1 - _ft_y - && Math.abs(w.bounds().width() - this.W) <= 4; - }; - return _ft_y !== false - ? selector.filter(_v.toRegular()) - : selector.filter((w => !_v(w)).toRegular()); - }, - isAlipay(sw) { - if (typeof sw === 'undefined') { - return sw; - } - let _rex = '.*(Alipay|alipay).*'; - return sw - ? selector.packageNameMatches(_rex) - : selector.filter((w => !w.packageName().match(_rex)).toRegular()); - }, - }; - let _res; - try { - _res = _ext[key].apply(_ext, args); - } catch (e) { - console.warn(e.message); - throw Error('Cannot apply extended locator: ' + key); - } - if (_res instanceof UiSelector) { - return _res; - } - throw Error('Extended locator (' + key + ') returns non-UiSelector type'); - }, - /** - * @param {?UiSelector$} locator - * @param {A11yx.Pickup.Select.Object} [addition] - * @return {?UiSelector$} - */ - assembleSelectors(locator, addition) { - if (isNullish(locator) || !isNonEmptyObject(addition)) { - return locator; - } - Object.keys(addition).forEach((k) => { - let _k = k in this.loc_keys_abbr ? this.loc_keys_abbr[k] : k; - let _mapper = o => typeof o === 'function' ? o.toRegular() : o; - let _v = Array.isArray(addition[k]) - ? addition[k].map(_mapper) - : [addition[k]].map(_mapper); - - let _sel = locator[_k]; - if (typeof _sel === 'function') { - try { - return locator = _sel.apply(locator, _v); - } catch (e) { - console.warn(e.message); - throw Error('Cannot apply selector: ' + _k); - } - } - return locator = this.extendLocator(locator, _k, _v); - }); - return locator; - }, - /** - * @param {A11yx.Pickup.Select.Text} locator - * @param {{[prop:string]: function(A11yx.Pickup.Select.Text):UiSelector$}} fn - * @return {?UiSelector$} - */ - getTextSelector(locator, fn) { - let _desc = { - sel: fn.desc(locator), - get txt() { - let _w = this.sel.findOnce(); - return _w && _w.desc() || ''; - }, - }; - let _text = { - sel: fn.text(locator), - get txt() { - let _w = this.sel.findOnce(); - return _w && _w.text() || ''; - }, - }; - let _dl = _desc.txt.length; - let _tl = _text.txt.length; - if (_dl || _tl) { - return _tl > _dl ? _text.sel : _desc.sel; - } - let _id_sel = fn.id(locator); - if (_id_sel.exists()) { - return _id_sel; - } - return null; - }, - /** - * @param {A11yx.Pickup.Select.Text} locator - * @return {UiSelector$} - */ - parseTextSelector(locator) { - if (locator instanceof RegExp) { - return this.getTextSelector(locator, { - desc: descMatches, text: textMatches, id: idMatches, - }); - } - if (typeof locator === 'number') { - locator = locator.toString(); - } - if (typeof locator === 'string') { - return this.getTextSelector(locator, { - desc: desc, text: text, id: id, - }); - } - return null; - }, - /** - * Returns a relative widget (UiObject) with compass - * @param {?UiObject$} [w] - * @param {string|any} [compass] - * @return {?UiObject$} - */ - getWidgetByCompass(w, compass) { - if (!(w instanceof UiObject)) { - return null; - } - if (typeof compass !== 'string') { - return w; - } - // noinspection SpellCheckingInspection - while (compass.length > 0) { - let _mch_p, _mch_c, _mch_s, _mch_k; - // p2 ( .parent().parent() ) - // pppp ( p4 ) - // p ( p1 ) - // p4pppp12p ( p4 ppp p12 p -> 4 + 3 + 12 + 1 -> p20 ) - if ((_mch_p = /^p[p\d]*/.exec(compass))) { - let _up_max = compass.match(/^p\d+|^p+(?!\d)/g).reduce((a, b) => ( - a + (/\d/.test(b) ? Number(b.slice(1)) : b.length) - ), 0); - while (_up_max--) { - if (!(w = w.parent())) { - return null; - } - } - compass = compass.slice(_mch_p[0].length); - continue; - } - // c0c2c0c1 ( .child(0).child(2).child(0).child(1) ) - // c0>2>0>1 ( .child(0).child(2).child(0).child(1) ) - // c-3 ( .child(childCount()-3) ) - // c-3c2c-1 ( .child(childCount()-3).child(2).child(childCount()-1) ) - // c1>2>3>0>-1>1 ( c1 c2 c3 c0 c-1 c1 ) - if ((_mch_c = /^c-?\d+([>c]?-?\d+)*/.exec(compass))) { - let _nums = _mch_c[0].split(/[>c]/); - for (let s of _nums) { - if (s.length) { - if (!(w instanceof UiObject)) { - return null; - } - let _cc = w.childCount(); - let _i = Number(s); - if (_i < 0) { - _i += _cc; - } - if (_i < 0 || _i >= _cc) { - return null; - } - w = w.child(_i); - } - } - compass = compass.slice(_mch_c[0].length); - continue; - } - // s2 ( .parent().child(2) ) - // s-2 ( .parent().child(childCount()-2) ) - // s>2 ( .parent().child(idxInParent()+2) ) - // s<2 ( .parent().child(idxInParent()-2) ) - if ((_mch_s = /^s[<>]?-?\d+/.exec(compass))) { - let _parent = w.parent(); - if (!(_parent instanceof UiObject)) { - return null; - } - let _idx = w.indexInParent(); - if (_idx < 0) { - return null; - } - let _cc = _parent.childCount(); - let _str = _mch_s[0]; - let _offset = +_str.match(/-?\d+/)[0]; - if (_str.includes('>')) { - _idx += _offset; - } else if (_str.includes('<')) { - _idx -= _offset; - } else { - _idx = _offset < 0 ? _offset + _cc : _offset; - } - if (_idx < 0 || _idx >= _cc) { - return null; - } - w = _parent.child(_idx); - compass = compass.slice(_mch_s[0].length); - continue; - } - // k/k1 ( .clickable() || .parent().clickable() aka pk/p1k ) - // k2 ( .clickable() || .parent().clickable() || .p2.clickable() aka p2k ) - // kn ( .clickable() || .pn.clickable() aka pnk ) - if ((_mch_k = /^k[k\d]*/.exec(compass))) { - let _up_max = compass.match(/^k(\d*)/g).map((s) => { - let _mch = s.match(/\d+/); - return _mch ? Number(_mch[0]) : 1; - }).reduce((a, b) => a + b); - - /** @type {?UiObject$} */ - w = function $iiFe() { - let _w_tmp = w; - do { - if (!(_w_tmp instanceof UiObject)) { - return null; - } - if (_w_tmp.clickable()) { - return _w_tmp; - } - if (!_up_max--) { - return w; - } - _w_tmp = _w_tmp.parent(); - } while (1); - }(); - compass = compass.slice(_mch_k[0].length); - continue; - } - - throw Error('Invalid rest compass for $$sel.pickup(): ' + compass); - } - return w || null; - }, - /** - * @param {A11yx.Pickup.Result.Type} type - * @return {A11yx.Pickup.Result.CanonicalType|any} - */ - getResultType(type) { - let _type = type ? String(type) : null; - if (_type === null || _type.match(/^w(idget)?$/)) { - return 'widget'; - } - if (_type.match(/^(w(idget)?_?c(ollection)?|wid(get)?s)$/)) { - return 'widgets'; - } - if (_type.match(/^t(xt)?$/)) { - return 'txt'; - } - if (_type.match(/^s(el(ector)?)?$/)) { - return 'selector'; - } - if (_type.match(/^e(xist(s)?)?$/)) { - return 'exists'; - } - if (_type.match(/^s(el(ector)?)?(_?s)(tr(ing)?)?$/)) { - return 'selector_name'; - } - if (_type.match(/^p(oin)?ts?$/)) { - return _type.includes('s') ? 'points' : 'point'; - } - return _type; - }, - /** - * @return {UiSelector$|UiObject$|UiObject$[]|OpenCV.Point|OpenCV.Points|string|any} - */ - getInternalResult() { - return { - selector: this.selector, - widget: this.widget, - widgets: this.widget_collection, - exists: Boolean(this.widget), - get selector_name() { - if (!this.widget || !this.selector) { - return $.tools.wrapStrByOptDef(''); - } - let _mch = this.selector.toString().match(/[a-z]+/); - return $.tools.wrapStrByOptDef(_mch ? _mch[0] : ''); - }, - get txt() { - let _text = this.widget && this.widget.text() || ''; - let _desc = this.widget && this.widget.desc() || ''; - return _desc.length > _text.length - ? $.tools.wrapStrByOptDef(_desc) - : $.tools.wrapStrByOptDef(_text); - }, - get point() { - return $.tools.uiObject2Point(this.widget); - }, - get points() { - return this.widgets.map($.tools.uiObject2Point).filter(w => w !== null); - }, - }[this.res_type]; - }, - /** - * @return {UiSelector$|UiObject$|UiObject$[]|OpenCV.Point|OpenCV.Points|string|any} - */ - getResult() { - this.refreshSvcInfoIFN(); - this.parseRawLocator(); - - let _res = function $iiFe() { - let _internal = this.getInternalResult(); - if (typeof _internal !== 'undefined') { - return _internal; - } - if (this.widget === null) { - return null; - } - let _prop = this.widget[this.res_type]; - return typeof _prop === 'function' ? _prop.call(this.widget) : _prop; - }.call(this); - - if (!isNullish(_res)) { - return _res; - } - return 'default' in this.options ? this.options.default : null; - }, - }; - - return $.getResult(); - }, - /** - * @param {A11yx.Pickup.Locators} locator - * @param {(function(w:UiObject$):boolean)|A11yx.Pickup.Result.Type} [filter] - * @param {A11yx.Pickup.Result.Type} [type='widget'] - * @return {A11yx.Pickup.Results} - */ - traverse(locator, filter, type) { - let $ = { - parseFilter() { - if (typeof filter === 'string') { - this.filter = w => _ext.pickup(w, filter); - } else { - this.filter = typeof filter === 'function' ? filter : () => true; - } - }, - parseArgs() { - this.parseFilter(); - - this.type = type || 'widget'; - this.pickup = _ext.pickup.bind(_ext); - this.pickup_null_res = this.pickup(null, this.type); - }, - traverse(locator) { - for (let c of this.pickup(locator, 'children', {default: []})) { - if (!(c instanceof UiObject)) { - continue; - } - if (this.filter(c)) { - return this.pickup(c, this.type); - } - let _res = this.traverse(c); - if (_res !== this.pickup_null_res) { - return _res; - } - } - return this.pickup_null_res; - }, - getResult() { - this.parseArgs(); - - return this.filter(locator) - ? this.pickup(locator, this.type) - : this.traverse(locator); - }, - }; - - return $.getResult(); - }, - /** - * @param {A11yx.Pickup.Locators} locator - * @param {(function(w:UiObject$):boolean)|A11yx.Pickup.Result.Type} filter - * @param {A11yx.Pickup.Result.Type} [type='widget'] - * @return {A11yx.Pickup.Results[]} - */ - traverseAll(locator, filter, type) { - let $ = { - results: [], - type: type || 'widget', - filter: function $iiFe() { - if (typeof filter === 'string') { - return w => _ext.pickup(w, filter); - } - return typeof filter === 'function' ? filter : () => true; - }(), - pickup: _ext.pickup.bind(_ext), - traverse(locator) { - for (let c of this.pickup(locator, 'children', {default: []})) { - if (!(c instanceof UiObject)) { - continue; - } - if (this.filter(c)) { - this.results.push(this.pickup(c, 'widget')); - } - this.traverse(c); - } - if (this.type.match(/^w(idget)?$/)) { - return this.results; - } - return this.results.map(o => this.pickup(o, this.type)); - }, - getResult() { - if (this.filter(locator)) { - this.results.push(this.pickup(locator, 'widget')); - } - return this.traverse(locator); - }, - }; - - return $.getResult(); - }, /** * @param {string} key * @param {A11yx.Pickup.Locators|(function(A11yx.Pickup.Result.Type):A11yx.Pickup.Results)} sel @@ -835,32 +269,21 @@ let exp = { */ add(key, sel) { if (typeof sel === 'function') { - _.sel_body_pool[key] = type => sel(type); + _.sel_body_pool[key] = sel; } else { - _.sel_body_pool[key] = type => this.pickup(sel, type); + _.sel_body_pool[key] = () => pickup(sel); } return this; // to make method chaining possible }, /** * @param {string} key - * @param {A11yx.Pickup.Result.Type|'cache'} [type] - * @example - * $$sel.add('list', className('ListView')); - * // recommended - * console.log($$sel.get('list', 'bounds')); - * // NullPointerException may occur - * console.log($$sel.get('list').bounds()); - * // traditional way, and NullPointerException may occur - * console.log(className('ListView').findOnce().bounds()); * @throws {Error} `sel key '${key}' not set in pool` * @return {A11yx.Pickup.Results} */ - get(key, type) { + get(key) { let _picker = _.sel_body_pool[key]; if (typeof _picker !== 'undefined') { - return !_picker ? null : type === 'cache' - ? (_.cache_pool[key] = _picker('w')) - : _picker(type); + return typeof _picker === 'function' ? _picker() : null; } throw Error('Key "' + key + '" is not in the pool'); }, @@ -869,16 +292,20 @@ let exp = { * @return {?UiObject$} */ getAndCache(key) { - return this.get(key, 'cache'); // UiObject only + let result = this.get(key); + if (result) { + _.cache_pool[key] = result; // UiObject only + } + return result; }, cache: { save(key) { _ext.getAndCache(key); }, /** @return {?A11yx.Pickup.Results} */ - load(key, type) { + load(key) { let _cache = _.cache_pool[key]; - return _cache ? _ext.pickup(_cache, type) : null; + return _cache || null; }, refresh(key) { let _cache = _.cache_pool[key]; @@ -919,7 +346,7 @@ let exp = { }, /** * @param {number} [timeout=60e3] - * @throws com.stardust.autojs.runtime.exception.ScriptInterruptedException + * @throws org.autojs.autojs.runtime.exception.ScriptInterruptedException * @return {boolean} */ waitForEnabled(timeout) { @@ -935,16 +362,6 @@ let exp = { }, }); }, - /** @return {boolean} */ - isAutoEnableEnabled() { - try { - let {storagesx: _storagesx} = requirex('ext-storages'); - return _storagesx.create('af_cfg') - .get('config', {prop: 'auto_enable_a11y_svc'}) === 'ON'; - } catch (e) { - return false; - } - }, /** * @param {A11yx.Functional.AutoEnable.Options} [options] * @returns {boolean} @@ -957,12 +374,8 @@ let exp = { let _is_ess = _opt.is_essential; let _no_man = _opt.is_manual_disallowed; - if (!this.isAutoEnableEnabled()) { - if (!_is_ess) { - consolex._('自动开启无障碍服务未启用', 3); - return false; - } - consolex.$('无障碍服务关闭且自动启用未开启', 8, 2, 0, 2); + if (!_is_ess) { + return false; } let _perm = 'android.permission.WRITE_SECURE_SETTINGS'; @@ -1024,7 +437,7 @@ let exp = { } }, ensureService() { - this.autoEnable({is_essential: true}); + this.autoEnable({ is_essential: true }); }, ensureFunctionality() { if (typeof activity === 'undefined') { @@ -1062,7 +475,7 @@ let exp = { */ click(o, strategy, options) { // @Overload - if (isPlainObject(strategy)) { + if (isObjectSpecies(strategy)) { return this.click(o, 'widget', strategy); } @@ -1078,37 +491,36 @@ let exp = { container: [], options: options || {}, wait: exp.wait.bind(exp), - pickup: _.sel.pickup.bind(_.sel), impededIFN() { this.options.no_impeded || typeof $$impeded === 'function' && $$impeded('a11yx.click'); }, parsePadding() { let _pad = this.options.padding; if (!_pad) { - return this.padding = {x: 0, y: 0}; + return this.padding = { x: 0, y: 0 }; } if (typeof _pad === 'number') { - _pad = [0, _pad]; + _pad = [ 0, _pad ]; } else if (!Array.isArray(_pad)) { throw Error('Invalid paddings for a11yx.click()'); } let _coords = function $iiFe() { if (_pad.length === 1) { - return [0, _pad[0]]; + return [ 0, _pad[0] ]; } if (_pad.length === 2) { - let [_k, _v] = _pad; - return _k === 'x' ? [_v, 0] : _k === 'y' ? [0, _v] : [_k, _v]; + let [ _k, _v ] = _pad; + return _k === 'x' ? [ _v, 0 ] : _k === 'y' ? [ 0, _v ] : [ _k, _v ]; } throw Error('Invalid paddings amount for a11yx.click()'); }(); - let [_x, _y] = _coords.map(n => Number(n)); + let [ _x, _y ] = _coords.map(n => Number(n)); if (!(!isNaN(_x) && !isNaN(_y))) { throw Error('Invalid paddings calc results for a11yx.click()'); } - this.padding = {x: _x, y: _y}; + this.padding = { x: _x, y: _y }; }, parseStrategy() { let _stg = this.options.strategy || this.options.click_strategy @@ -1155,7 +567,7 @@ let exp = { let _w = o.findOnce(); return !_w || !this.container.includes(_w.hashCode()); } - return this.checkDisappearance(this.pickup(o)); + return this.checkDisappearance(pickup(o)); }, /** * @param {UiSelector$|UiObject$|Android.Rect|number[]|{x:number,y:number}} o @@ -1195,7 +607,7 @@ let exp = { if (o instanceof Point) { return _click(o.x, o.y); } - if (isPlainObject(o)) { + if (isObjectSpecies(o)) { if (typeof o.x === 'number' && typeof o.y === 'number') { return _click(o.x, o.y); } @@ -1206,7 +618,7 @@ let exp = { } } - let _w = this.pickup(o, 'widget'); + let _w = o.findOnce(); return _w ? this.clickOnce(_w) : false; }, getResult() { @@ -1248,10 +660,9 @@ let exp = { get name() { return this._name = this._name || String(this.options.name || 'pipeline').surround('"'); }, - pickup: _.sel.pickup.bind(_.sel), waitAndClick: exp.waitAndClick.bind(exp), parseActions() { - return this.actions = actions.map(o => isPlainObject(o) ? o : {locator: o}); + return this.actions = actions.map(o => isObjectSpecies(o) ? o : { locator: o }); }, getResult() { return this.parseActions().every((pipe, idx) => { @@ -1261,11 +672,11 @@ let exp = { return pipe.condition; } if (idx < this.actions.length - 1) { - return () => this.pickup(this.actions[idx + 1].locator); + return () => pickup(this.actions[idx + 1].locator); } }.call(this), strategy: pipe.strategy, - })) || consolex.w([this.name + '管道破裂', pipe.locator], 2, 0, -2); + })) || consolex.w([ this.name + '管道破裂', pipe.locator ], 2, 0, -2); }); }, }; @@ -1281,19 +692,18 @@ let exp = { */ wait(condition, limit, interval, options) { // @Overload - if (isPlainObject(limit)) { + if (isObjectSpecies(limit)) { return this.wait(condition, null, null, limit); } // @Overload - if (isPlainObject(interval)) { + if (isObjectSpecies(interval)) { return this.wait(condition, limit, null, interval); } let $ = { result: false, start: Date.now(), - pickup: _.sel.pickup.bind(_.sel), options: options || {}, impededIFN() { this.options.no_impeded || typeof $$impeded === 'function' && $$impeded('a11yx.wait'); @@ -1317,7 +727,10 @@ let exp = { if (typeof condition === 'function') { return condition(); } - return this.pickup(condition); + if (condition instanceof UiObject) { + return condition; + } + return pickup(condition); }, wait() { while (this.times--) { @@ -1367,22 +780,22 @@ let exp = { */ waitAndClick(condition, limit, interval, click_options) { // @Overload - if (isPlainObject(limit)) { + if (isObjectSpecies(limit)) { return this.waitAndClick(condition, null, null, limit); } // @Overload - if (isPlainObject(interval)) { + if (isObjectSpecies(interval)) { return this.waitAndClick(condition, limit, null, interval); } let _res_click = true; - let _res_wait = this.wait(condition, limit, interval, { - then: function (res) { + let _res_wait = wait(condition, limit, interval, { + then: (res) => { let _opt = click_options || {}; sleep(_opt.intermission || 240); _res_click = this.click(res, _opt) && _res_click; - }.bind(this), + }, }); return _res_wait && _res_click; }, @@ -1404,12 +817,12 @@ let exp = { */ waitAndStable(condition, limit, interval, stable_options) { // @Overload - if (isPlainObject(limit)) { + if (isObjectSpecies(limit)) { return this.waitAndStable(condition, null, null, limit); } // @Overload - if (isPlainObject(interval)) { + if (isObjectSpecies(interval)) { return this.waitAndStable(condition, limit, null, interval); } @@ -1485,7 +898,7 @@ let exp = { */ parsePoint(o) { if (typeof o === 'number') { - return {x: halfW, y: this.scale(o, 'y')}; + return { x: halfW, y: this.scale(o, 'y') }; } if (Array.isArray(o)) { if (o.length !== 2 || !o.every(x => $$num(x))) { @@ -1496,7 +909,7 @@ let exp = { y: this.scale(o[1], 'y'), }; } - if (isPlainObject(o)) { + if (isObjectSpecies(o)) { if (typeof o.x !== 'number' || typeof o.y !== 'number') { throw Error('Invalid object point: ' + o.x + ', ' + o.y); } @@ -1515,7 +928,7 @@ let exp = { }, parseDuration() { this.duration = duration >= 200 - ? duration : Math.max(Math.dist(this.start, this.end) / 5, 200); + ? duration : Math.max(Mathx.dist(this.start, this.end) / 5, 200); }, parseArgs() { this.options = options || {}; @@ -1847,4 +1260,4 @@ let exp = { /** * @type {Mod.a11yx} */ -module.exports = {a11yx: exp, $$sel: exp.selector()}; \ No newline at end of file +module.exports = { a11yx: exp, $$sel: exp.selector() }; \ No newline at end of file diff --git a/modules/ext-app.js b/modules/ext-app.js index 5ace237..f4374c4 100644 --- a/modules/ext-app.js +++ b/modules/ext-app.js @@ -3,7 +3,6 @@ let { } = require('./mod-global'); let {a11yx} = require('./ext-a11y'); let {devicex} = require('./ext-device'); -let {timersx} = require('./ext-timers'); let {consolex} = require('./ext-console'); let {threadsx} = require('./ext-threads'); @@ -14,7 +13,6 @@ let Uri = android.net.Uri; let Runtime = java.lang.Runtime; let Manifest = android.Manifest; let Process = android.os.Process; -let Intent = android.content.Intent; let Context = android.content.Context; let System = android.provider.Settings.System; let ApplicationInfo = android.content.pm.ApplicationInfo; @@ -23,11 +21,11 @@ let ActivityManager = android.app.ActivityManager; let ScriptFile = org.autojs.autojs.model.script.ScriptFile; let ActivityNotFoundException = android.content.ActivityNotFoundException; let ShortcutCreateActivity = org.autojs.autojs.ui.shortcut.ShortcutCreateActivity; -let TimerThread = com.stardust.autojs.core.looper.TimerThread; +let TimerThread = org.autojs.autojs.core.looper.TimerThread; let _ = { alipay_pkg: 'com.eg.android.AlipayGphone', - autojs_pkg: context.getPackageName(), + autojsPackageName: context.getPackageName(), pkg_mgr: context.getPackageManager(), get autojs_ver() { // Pro version(s) (e.g. 8.8.16-0) returns abnormal value like '${xxx.xxx}' @@ -223,7 +221,7 @@ let exp = { parsePkgName() { if (typeof source === 'string') { if (source.match(/^auto\.?js$/i)) { - return _.autojs_pkg; + return _.autojsPackageName; } if (source.match(/^current$/i)) { return currentPackage(); @@ -457,7 +455,7 @@ let exp = { * @example * appx.launch('com.eg.android.AlipayGphone'); * appx.launch('com.eg.android.AlipayGphone', { - * task_name: '\u652F\u4ED8\u5B9D\u6D4B\u8BD5', + * taskName: '\u652F\u4ED8\u5B9D\u6D4B\u8BD5', * // is_show_toast: true, * }); * appx.launch({ @@ -465,7 +463,7 @@ let exp = { * data: 'alipays://platformapi/startapp?appId=60000002&appClearTop=false&startMultApp=YES', * }, { * package_name: 'com.eg.android.AlipayGphone', - * task_name: '\u8682\u8681\u68EE\u6797', + * taskName: '\u8682\u8681\u68EE\u6797', * condition_launch: () => currentPackage().match(/AlipayGphone/), * condition_ready: () => descMatches(/../).find().size() > 6, * launch_retry_times: 4, @@ -482,7 +480,7 @@ let exp = { start() { if (typeof $.options.disturbance === 'function') { $.debug('已开启干扰排除线程'); - this.thread = threadsx.start(() => { + this.thread = threads.start(() => { while (1) { sleep(1.2e3); $.options.disturbance(); @@ -501,7 +499,7 @@ let exp = { this.options.no_impeded || typeof $$impeded === 'function' && $$impeded('appx.launch'); }, parseTrigger() { - this.trigger = !isNullish(trigger) ? trigger : _.autojs_pkg; + this.trigger = !isNullish(trigger) ? trigger : _.autojsPackageName; this.debug('启动参数类型: ' + typeof this.trigger); }, parsePackage() { @@ -512,7 +510,7 @@ let exp = { if (typeof this.trigger === 'string' && app.getAppName(this.trigger)) { return this.pkg_name = this.trigger; } - if (isPlainObject(this.trigger)) { + if (isObjectSpecies(this.trigger)) { if (this.trigger.packageName) { return this.pkg_name = this.trigger.packageName; } @@ -546,12 +544,12 @@ let exp = { this.app_name_quo = this.app_name.surround('"'); }, parseTaskName() { - let _name = this.options.task_name || this.app_name || String(); + let _name = this.options.taskName || this.app_name || String(); - this.task_name = _name.replace(/^['"]?(.*?)['"]?$/, '$1'); - this.debug('启动目标名称: ' + this.task_name); + this.taskName = _name.replace(/^['"]?(.*?)['"]?$/, '$1'); + this.debug('启动目标名称: ' + this.taskName); - this.task_name_quo = this.task_name.surround('"'); + this.task_name_quo = this.taskName.surround('"'); }, wrapDebug() { this.debug = consolex.debug.fuel(this.options.isDebug); @@ -616,7 +614,7 @@ let exp = { }); }, parseToast() { - this.toast_message = this.task_name + this.toast_message = this.taskName ? '开始' + this.task_name_quo + '任务' : '启动' + this.app_name_quo + '应用'; this.is_show_toast = this.options.is_show_toast && this.options.is_show_toast !== 'none'; @@ -734,7 +732,7 @@ let exp = { * @return {Intent} */ getLaunchIntentForPackage(pkg) { - return _.pkg_mgr.getLaunchIntentForPackage(pkg || _.autojs_pkg); + return _.pkg_mgr.getLaunchIntentForPackage(pkg || _.autojsPackageName); }, /** @@ -877,8 +875,8 @@ let exp = { * Main process of Auto.js will be killed * @param {{ * pid?: number, - * is_async?: boolean, - * pending_task?: Timersx.TimedTask.Disposable|'launcher'|'launcher+3s'|'current'|'current+3s'|string, + * isAsync?: boolean, + * pending_task?: Tasks.TimedTask.Disposable|'launcher'|'launcher+3s'|'current'|'current+3s'|string, * }} [options] */ killProcess(options) { @@ -898,7 +896,7 @@ let exp = { return { path: engines.myEngine().getSource(), date: Date.now() + (_mch_min ? _mch_min[0] : 5) * 1e3, - is_async: $.options.is_async, + isAsync: $.options.isAsync, }; } } @@ -906,7 +904,7 @@ let exp = { }, addTask() { if ((this.pending_task = this.options.pending_task)) { - timersx.addDisposableTask(Object.assign(this.parseTask(), { + tasks.addDisposableTask(Object.assign(this.parseTask(), { callback() { $.killNow(); }, @@ -945,7 +943,7 @@ let exp = { */ hasRoot() { try { - // 1. com.stardust.autojs.core.util.ProcessShell + // 1. org.autojs.autojs.core.util.ProcessShell // .execCommand('date', true).code === 0; // code above doesn't work on Auto.js Pro // 2. some devices may stop the script without diff --git a/modules/ext-colors.js b/modules/ext-colors.js deleted file mode 100644 index 0361c82..0000000 --- a/modules/ext-colors.js +++ /dev/null @@ -1,90 +0,0 @@ -let ColorStateList = android.content.res.ColorStateList; - -let exp = { - /** - * @param {Color$} color - * @param {boolean|number|'auto'|'none'|'keep'} [alpha=8] - * @return {string} - */ - toStr(color, alpha) { - if (typeof color === 'string') { - if (Number(color).toString() === color) { - color = Number(color); - } - } - let _c = typeof color === 'number' ? colors.toString(color) : color; - if (typeof _c !== 'string') { - throw TypeError('Unknown type of color for colorsx.toStr()'); - } - let _A = colors.alpha(_c); - let _R = colors.red(_c); - let _G = colors.green(_c); - let _B = colors.blue(_c); - - if (alpha === undefined || alpha === true || alpha === 'keep' || alpha === 8) { - return _c; - } - if (alpha === false || alpha === 'none' || alpha === 6) { - return '#' + colors.toString(colors.rgb(_R, _G, _B)).slice(-6); - } - if (alpha === 'auto') { - return _A < 255 ? _c : colors.toString(colors.rgb(_R, _G, _B)); - } - throw TypeError('Unknown type of alpha for colorsx.toStr()'); - }, - /** - * @param {Color$} color - * @return {number} - */ - toInt(color) { - if (typeof color === 'string') { - if (Number(color).toString() === color) { - color = Number(color); - } - } - let _c; - try { - _c = typeof color === 'string' ? colors.parseColor(color) : color; - } catch (e) { - console.error('Passed color: ' + color); - throw Error(e + '\n' + e.stack); - } - if (typeof _c !== 'number') { - throw TypeError('Unknown type of color for colorsx.toInt()'); - } - return _c; - }, - /** - * @param {string} rgba_hex - * @example - * colorsx.hrgba('#rrggbbaa') -> colorsx.toInt('#aarrggbb') - * @return {number} - */ - hrgba(rgba_hex) { - if (typeof rgba_hex !== 'string') { - throw Error('Param rgba_hex must be a string type'); - } - if (rgba_hex[0] !== '#') { - throw Error('Param rgba_hex must started with hash symbol'); - } - - rgba_hex = rgba_hex.trim().toUpperCase(); - - if (rgba_hex.length === 7) { - rgba_hex += 'FF'; - } - if (rgba_hex.length !== 9) { - throw Error('Length of param rgba_hex must be 7 or 9'); - } - return this.toInt('#' + rgba_hex.slice(-2) + rgba_hex.slice(1, -2)); - }, - /** - * @param {Color$} color - * @return {android.content.res.ColorStateList} - */ - toColorStateList(color) { - return ColorStateList.valueOf(this.toInt(color)); - }, -}; - -module.exports = {colorsx: exp}; \ No newline at end of file diff --git a/modules/ext-console.js b/modules/ext-console.js index de6d134..e52b44b 100644 --- a/modules/ext-console.js +++ b/modules/ext-console.js @@ -27,7 +27,7 @@ let exp = { }, switchSet(state) { this.last_state = this.state; - this.state = isPlainObject(state) ? state.isDebug : state; + this.state = isObjectSpecies(state) ? state.isDebug : state; }, switchBack() { // [this.state, this.last_state] = [this.last_state, this.state]; @@ -113,7 +113,7 @@ let exp = { * @return {function(msg: Consolex.Print.Message, msg_lv?: Consolex.Print.MessageLevel, indent_lv?: Consolex.Print.IndentLevel, border_line_lv?: Consolex.Print.BorderLevel)} */ fuel(petrol) { - let _pet = isPlainObject(petrol) ? petrol.isDebug : petrol; + let _pet = isObjectSpecies(petrol) ? petrol.isDebug : petrol; return new exp.DebugConstructor(_pet, _debug); }, /** @@ -343,7 +343,7 @@ let exp = { if (Array.isArray(o)) { return o.join(', ').surround('[ '); } - if (isPlainObject(o)) { + if (isObjectSpecies(o)) { return Object.keys(o).map(k => k + ': ' + o[k]).join(', ').surround('{ '); } if (o && typeof o.toString === 'function') { @@ -386,7 +386,7 @@ let exp = { border_line_break: _break, } = this; let {border_prefix: _prefix} = this.options; - let _border_lv = (msg_lv === undefined ? 1 : Number(msg_lv) || 0).clamp(0, 1); + let _border_lv = Numberx.clamp(msg_lv === undefined ? 1 : Number(msg_lv) || 0, [0, 1]); let _border_it = [() => { if (_style_before !== undefined && !this.no_msg_level) { if (!_.last_border.match(_style_before, _border_lv)) { @@ -447,7 +447,7 @@ let exp = { border(style, border_lv, break_lv, is_save_state, prefix) { let $ = { style: String(style || 'solid'), - level: (border_lv === undefined ? 1 : Number(border_lv) || 0).clamp(0, 1), + level: Numberx.clamp(border_lv === undefined ? 1 : Number(border_lv) || 0, [0, 1]), break: '\n'.repeat(Math.max(Number(break_lv) || 0, 0)), prefix: prefix === undefined ? '' : String(prefix) + ' ', trigger() { diff --git a/modules/ext-device.js b/modules/ext-device.js index c2c32bb..574c7bc 100644 --- a/modules/ext-device.js +++ b/modules/ext-device.js @@ -2,9 +2,8 @@ let { $$impeded, $$cvt, $$link, $$str, $$und, $$nul, $$arr, $$num, $$rex, $$func, } = require('./mod-global'); -let {timersx} = require('./ext-timers'); -let {consolex} = require('./ext-console'); -let {a11yx, $$sel} = require('./ext-a11y'); +let { consolex } = require('./ext-console'); +let { a11yx, $$sel } = require('./ext-a11y'); /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ @@ -16,7 +15,6 @@ let Secure = Settings.Secure; let File = java.io.File; let Uri = android.net.Uri; let Surface = android.view.Surface; -let Intent = android.content.Intent; let Context = android.content.Context; let Resources = android.content.res.Resources; let IntentFilter = android.content.IntentFilter; @@ -37,7 +35,7 @@ let exp = { return context.getSystemService(Context.POWER_SERVICE); }, screen_metrics: { - /** @type {com.stardust.util.ScreenMetrics} */ + /** @type {org.autojs.util.ScreenMetrics} */ metrics: runtime.getScreenMetrics(), /** @return {{width: number, height: number}} */ getInfo() { @@ -63,7 +61,7 @@ let exp = { getRatio() { let _width = this.metrics.rescaleX(W) / W; let _height = this.metrics.rescaleY(H) / H; - return {width: _width, height: _height}; + return { width: _width, height: _height }; }, reset() { this.setRatio(0); @@ -311,7 +309,7 @@ let exp = { * devicex.accelerometer_rotation.toggle(); * @see https://developer.android.com/reference/android/provider/Settings.System#ACCELEROMETER_ROTATION */ - accelerometer_rotation: new StateManager('System', 'ACCELEROMETER_ROTATION', 'Int', [0, 1]), + accelerometer_rotation: new StateManager('System', 'ACCELEROMETER_ROTATION', 'Int', [ 0, 1 ]), /** * Default screen rotation when no other policy applies. * @example @@ -368,7 +366,7 @@ let exp = { * Whether user has enabled development settings. * @see https://developer.android.com/reference/android/provider/Settings.Global#DEVELOPMENT_SETTINGS_ENABLED */ - development_settings_enabled: new StateManager('Global', 'DEVELOPMENT_SETTINGS_ENABLED', 'Int', [0, 1]), + development_settings_enabled: new StateManager('Global', 'DEVELOPMENT_SETTINGS_ENABLED', 'Int', [ 0, 1 ]), /** * The user directory created by android.server.pm.UserManagerService * @type {java.io.File} @@ -448,7 +446,7 @@ let exp = { device.keepScreenOn(_du); consolex._('已设置屏幕常亮显示'); - consolex._('最大超时时间: ' + (_du / 60e3).toFixedNum(2) + '分钟'); + consolex._('最大超时时间: ' + Numberx.toFixedNum(_du / 60e3, 2) + '分钟'); }, /** * Substitution of device.keepScreenDim() @@ -461,7 +459,7 @@ let exp = { device.keepScreenDim(_du); consolex._('已设置屏幕常暗显示'); - consolex._('最大超时时间: ' + (_du / 60e3).toFixedNum(2) + '分钟'); + consolex._('最大超时时间: ' + Numberx.toFixedNum(_du / 60e3, 2) + '分钟'); }, cancelOn() { device.cancelKeepingAwake(); @@ -479,7 +477,7 @@ let exp = { screenOff(options) { // @Overload if (typeof options === 'boolean') { - return this.screenOff({isDebug: options}); + return this.screenOff({ isDebug: options }); } let _opt = options || {}; @@ -492,29 +490,26 @@ let exp = { let _msg = { key_code: { - failed: () => consolex.w(['关屏策略执行失败', '按键模拟失败'], 0, 0, -2), + failed: () => consolex.w([ '关屏策略执行失败', '按键模拟失败' ], 0, 0, -2), bugModel: () => consolex._([ '跳过当前策略', '设备不支持KeyCode方法', '设备型号: ' + device.brand, ]), }, successWithElapsedTime(et) { - consolex._(['策略执行成功', '用时: ' + et]); + consolex._([ '策略执行成功', '用时: ' + et ]); }, noWriteSettingsPermission() { let _nm = 'auto.js-write-settings-permission-helper'; let _path = files.path('./tools/' + _nm + '.js'); let _msg = '需要"修改系统设置"权限'; - consolex.w(['关屏策略执行失败', _msg, '可使用以下工具获得帮助支持', _path], 0, 0, -2); + consolex.w([ '关屏策略执行失败', _msg, '可使用以下工具获得帮助支持', _path ], 0, 0, -2); toast('关闭屏幕失败\n' + _msg, 'long'); }, noWriteSecureSettingsPermission() { let _p = 'WRITE_SECURE_SETTINGS'; - consolex.w(['无法完成屏幕关闭操作', '需要以下必要权限:', _p, - '权限的详细信息及获取方式', '可参阅项目配置工具', - '-> 运行与安全', '-> 自动开启无障碍服务', - ], 0, 0, -2); + consolex.w([ '无法完成屏幕关闭操作', '需要以下必要权限:', _p ], 0, 0, -2); toast('关闭屏幕失败\n缺少以下必要权限:\n' + _p, 'long'); }, toastWithDebugInfo(messages) { @@ -549,9 +544,9 @@ let exp = { consolex._('尝试策略: 模拟电源按键'); if (!_bugModel()) { _hint(); - timersx.rec.save('scr_off_tt'); - if (exp.keycode('KEYCODE_POWER', {no_failed_msg: true})) { - let _et_str = $$cvt.time(timersx.rec('scr_off_tt'), '$zh'); + recorder.save('scr_off_tt'); + if (exp.keycode('KEYCODE_POWER', { no_failed_msg: true })) { + let _et_str = $$cvt.time(recorder('scr_off_tt'), '$zh'); _msg.successWithElapsedTime(_et_str); return true; } @@ -572,7 +567,7 @@ let exp = { } function _bugModel() { - return [/[Mm]eizu/].some(m => device.brand.match(m)); + return [ /[Mm]eizu/ ].some(m => device.brand.match(m)); } function _hint() { @@ -623,7 +618,7 @@ let exp = { } function _hint() { - timersx.rec.save('set_provider'); + recorder.save('set_provider'); let _flag = _opt_provider.hint; if (typeof _flag === 'function') { @@ -647,11 +642,11 @@ let exp = { if (_flag.brake_is_triggered) { break; } - let _et = timersx.rec('set_provider'); + let _et = recorder('set_provider'); let _et_str = $$cvt.time(_et, '$zh'); let _et_limit = 55.23e3; if (_et > _et_limit) { - consolex.w(['关屏策略执行失败', '屏幕关闭超时', '耗时: ' + _et_str], 2, 0, -2); + consolex.w([ '关屏策略执行失败', '屏幕关闭超时', '耗时: ' + _et_str ], 2, 0, -2); break; } if (!_this.isScreenOn()) { @@ -724,7 +719,7 @@ let exp = { * @param {number|number[]} pattern - a group of times to control the vibrator * @param {number} [repeat=1] - total repeat times * @param {boolean} [async=true] - vibrator working asynchronously or not - * @see com.stardust.autojs.runtime.api.Device + * @see org.autojs.autojs.runtime.api.Device * @example * // async and repeat once * devicex.vibrate(100); @@ -741,7 +736,7 @@ let exp = { vibrate(pattern, repeat, async) { let _repeat = repeat || 1; let _async = typeof async === 'undefined' ? true : !!async; - let _pattern = typeof pattern === 'number' ? [pattern] : pattern; + let _pattern = typeof pattern === 'number' ? [ pattern ] : pattern; _async ? threads.start(_vibrate) : _vibrate(); // tool function(s) // @@ -804,13 +799,13 @@ let exp = { let $ = { options: options || {}, relations: [ - {str: 'home', num: 3}, - {str: 'back', num: 4}, - {str: 'recents', num: 187}, - {str: 'quick_settings', num: -1}, - {str: 'power_dialog', num: -1}, - {str: 'notifications', num: -1}, - {str: 'split_screen', num: -1}, + { str: 'home', num: 3 }, + { str: 'back', num: 4 }, + { str: 'recents', num: 187 }, + { str: 'quick_settings', num: -1 }, + { str: 'power_dialog', num: -1 }, + { str: 'notifications', num: -1 }, + { str: 'split_screen', num: -1 }, ], get autojs_keycode() { return this._aj_kc = this._aj_kc || this.relations.map(o => o.str); @@ -884,7 +879,7 @@ let exp = { }, showFailedMsgIFN(kc) { if (!this.options.no_failed_msg) { - consolex.w(['按键模拟失败', '键值: ' + kc], 0, 0, -2); + consolex.w([ '按键模拟失败', '键值: ' + kc ], 0, 0, -2); } }, /** @@ -974,7 +969,12 @@ let exp = { * @return {number} */ getCallState() { - return context.getSystemService(Context.TELEPHONY_SERVICE).getCallState(); + try { + return context.getSystemService(Context.TELEPHONY_SERVICE).getCallState(); + } catch (e) { + // Doesn't have READ_PHONE_STATE permission + return 0; + } }, /** * Returns display screen pixel lengths and scale transformers. @@ -994,17 +994,6 @@ let exp = { */ getDisplay() { let _ = { - /** - * @type {Object.} - */ - preset: { - get default() { - return this.xz1c; - }, - xz1c: {w: 720, h: 1280}, - z5: {w: 1080, h: 1920}, - x1m2: {w: 1096, h: 2560}, - }, /** * Return a resource identifier for the given resource name. * @param {string} name @@ -1018,87 +1007,6 @@ let exp = { return Number.NaN; } }, - /** - * @param {?string|{w:number,h:number}} [base] - * @return {{w:number,h:number}} - */ - getBase(base) { - if (isPlainObject(base)) { - return {w: base.w, h: base.h}; - } - if (isNullish(base)) { - return this.preset.default; - } - if (base in this.preset) { - return this.preset[base]; - } - throw Error('Unknown base for calcBase()'); - }, - /** - * @param {number|*} num - * @param {Devicex.Display.Scaler.Base|boolean} [base] - * @param {boolean} [is_ratio] - * @return {number} - */ - cX(num, base, is_ratio) { - // @Overload - if (typeof base === 'boolean') { - return this.cX(num, null, base); - } - let _is_ratio = Math.abs(num) < 1 || is_ratio; - if (_is_ratio) { - return Math.round($.W * num).clamp(-$.W, $.W); - } - let _base = typeof base === 'number' ? base : this.getBase(base).w; - return Math.round($.W * num / _base).clamp(-$.W, $.W); - }, - /** - * @param {number|*} num - * @param {Devicex.Display.Scaler.Base|boolean} [base] - * @param {boolean} [is_ratio] - * @return {number} - */ - cY(num, base, is_ratio) { - // @Overload - if (typeof base === 'boolean') { - return this.cY(num, null, base); - } - - let _is_ratio = Math.abs(num) < 1 || is_ratio; - if (_is_ratio) { - return Math.round($.H * num).clamp(-$.H, $.H); - } - let _base = typeof base === 'number' ? base : this.getBase(base).h; - return Math.round($.H * num / _base).clamp(-$.H, $.H); - }, - /** - * @param {number|*} num - * @param {Devicex.Display.Scaler.Base|boolean} [base] - * @param {boolean} [is_ratio] - * @return {number} - */ - cYx(num, base, is_ratio) { - // @Overload - if (typeof base === 'boolean') { - return this.cYx(num, null, base); - } - - let _is_ratio = Math.abs(num) < 1 || is_ratio; - if (_is_ratio) { - if (typeof base === 'number') { - if ($$num(0, '<', base, '<=', 1)) { - return Math.round(num * $.W / base).clamp(-$.H, $.H); - } - if (base > 1) { - return Math.round(num * $.W * base).clamp(-$.H, $.H); - } - throw Error('Base is a invalid number for cYx()'); - } - let _base = this.getBase(base); - return Math.round(num * _base.h * $.W / _base.w).clamp(-$.H, $.H); - } - return Math.round(num * $.W / this.getBase(base).w).clamp(-$.H, $.H); - }, }; let $ = { @@ -1120,21 +1028,21 @@ let exp = { this.uH = this.win_svc_disp.getHeight(); this.ROT = this.win_svc_disp.getRotation(); } catch (e) { - consolex.w(['devicex display parseBasic():', e]); + consolex.w([ 'devicex display parseBasic():', e ]); this.uH = this.uH !== undefined ? this.uH : this.H; this.uW = this.uW !== undefined ? this.uW : this.W; this.ROT = this.ROT !== undefined ? this.ROT : 0; } this.check() || consolex.$([ 'devicex display parseBasic():', - ['W: ' + this.W, 'H: ' + this.H].join(', '), + [ 'W: ' + this.W, 'H: ' + this.H ].join(', '), ], 8, 2, 0, 2); }, globalize() { /** Screen width */ - global.W = global.WIDTH = this.W; + global.W = this.W; /** Screen height */ - global.H = global.HEIGHT = this.H; + global.H = this.H; /** Semi-length of screen width */ global.halfW = this.W / 2; /** Semi-length of screen height */ @@ -1145,18 +1053,6 @@ let exp = { global.uH = this.uH; /** @type {Devicex.Display.Rotation} */ global.ROT = global.ROTATION = this.ROT; - - Object.assign(global, { - cX() { - return _.cX.apply(_, arguments); - }, - cY() { - return _.cY.apply(_, arguments); - }, - cYx() { - return _.cYx.apply(_, arguments); - }, - }); }, assign() { return this.disp = this.disp || Object.assign({ @@ -1174,16 +1070,6 @@ let exp = { || _.getDimenPixSize('action_bar_default_height'), navigation_bar_height: _.getDimenPixSize('navigation_bar_height'), navigation_bar_height_computed: $.W - $.uW, - }, { - cX() { - return _.cX.apply(_, arguments); - }, - cY() { - return _.cY.apply(_, arguments); - }, - cYx() { - return _.cYx.apply(_, arguments); - }, }, { refresh() { let _new = exp.getDisplay(); @@ -1249,10 +1135,10 @@ let exp = { }, /** * @param {number} rotation - * @param {boolean} [is_async=false] + * @param {boolean} [isAsync=false] */ - setUserRotation(rotation, is_async) { - this.setAutoRotationDisabled(is_async); + setUserRotation(rotation, isAsync) { + this.setAutoRotationDisabled(isAsync); let _aim_user_rotation = { 0: Surface.ROTATION_0, @@ -1272,41 +1158,41 @@ let exp = { if (!_cond()) { this.user_rotation.saveState(); this.user_rotation.put(_aim_user_rotation); - if (!is_async) { + if (!isAsync) { a11yx.wait(_cond, 2e3, 80); sleep(360); } } }, - setUserRotationPortrait(is_async) { - this.setUserRotation(Surface.ROTATION_0, is_async); + setUserRotationPortrait(isAsync) { + this.setUserRotation(Surface.ROTATION_0, isAsync); }, - setUserRotationInverted(is_async) { - this.setUserRotation(Surface.ROTATION_180, is_async); + setUserRotationInverted(isAsync) { + this.setUserRotation(Surface.ROTATION_180, isAsync); }, - setUserRotationLandscapeRight(is_async) { - this.setUserRotation(Surface.ROTATION_90, is_async); + setUserRotationLandscapeRight(isAsync) { + this.setUserRotation(Surface.ROTATION_90, isAsync); }, - setUserRotationLandscapeLeft(is_async) { - this.setUserRotation(Surface.ROTATION_270, is_async); + setUserRotationLandscapeLeft(isAsync) { + this.setUserRotation(Surface.ROTATION_270, isAsync); }, - setAutoRotationEnabled(is_async) { + setAutoRotationEnabled(isAsync) { let _aim_acc_rotation = 1; if (!this.accelerometer_rotation.verify(_aim_acc_rotation)) { this.accelerometer_rotation.saveState(); this.accelerometer_rotation.put(_aim_acc_rotation); - if (!is_async) { + if (!isAsync) { a11yx.wait(() => this.accelerometer_rotation.verify(_aim_acc_rotation), 2e3, 80); sleep(360); } } }, - setAutoRotationDisabled(is_async) { + setAutoRotationDisabled(isAsync) { let _aim_acc_rotation = 0; if (!this.accelerometer_rotation.verify(_aim_acc_rotation)) { this.accelerometer_rotation.saveState(); this.accelerometer_rotation.put(_aim_acc_rotation); - if (!is_async) { + if (!isAsync) { a11yx.wait(() => this.accelerometer_rotation.verify(_aim_acc_rotation), 2e3, 80); sleep(360); } @@ -1380,37 +1266,37 @@ let exp = { getVerInfo(sdk) { let $ = { raw_info: { - 1: {version: '1.0', release: 'September 23, 2008'}, - 2: {version: '1.1', release: 'February 9, 2009'}, - 3: {version: '1.5', release: 'April 27, 2009'}, - 4: {version: '1.6', release: 'September 15, 2009'}, - 5: {version: '2.0', release: 'October 27, 2009'}, - 6: {version: '2.0.1', release: 'December 3, 2009'}, - 7: {version: '2.1', release: 'January 11, 2010'}, - 8: {version: ['2.2', '2.2.3'], release: 'May 20, 2010'}, - 9: {version: ['2.3', '2.3.2'], release: 'December 6, 2010'}, - 10: {version: ['2.3.3', '2.3.7'], release: 'February 9, 2011'}, - 11: {version: '3.0', release: 'February 22, 2011'}, - 12: {version: '3.1', release: 'May 10, 2011'}, - 13: {version: ['3.2', '3.2.6'], release: 'July 15, 2011'}, - 14: {version: ['4.0', '4.0.2'], release: 'October 18, 2011'}, - 15: {version: ['4.0.3', '4.0.4'], release: 'December 16, 2011'}, - 16: {version: ['4.1', '4.1.2'], release: 'July 9, 2012'}, - 17: {version: ['4.2', '4.2.2'], release: 'November 13, 2012'}, - 18: {version: ['4.3', '4.3.1'], release: 'July 24, 2013'}, - 19: {version: ['4.4', '4.4.4'], release: 'October 31, 2013'}, - 20: {version: ['4.4W', '4.4W.2'], release: 'June 25, 2014'}, - 21: {version: ['5.0', '5.0.2'], release: 'November 4, 2014'}, - 22: {version: ['5.1', '5.1.1'], release: 'March 2, 2015'}, - 23: {version: ['6.0', '6.0.1'], release: 'October 2, 2015'}, - 24: {version: '7.0', release: 'August 22, 2016'}, - 25: {version: ['7.1', '7.1.2'], release: 'October 4, 2016'}, - 26: {version: '8.0', release: 'August 21, 2017'}, - 27: {version: '8.1', release: 'December 5, 2017'}, - 28: {version: '9', release: 'August 6, 2018'}, - 29: {version: '10', release: 'September 7, 2019'}, - 30: {version: '11', release: 'September 8, 2020'}, - 31: {version: '12', release: 'October 4, 2021'}, + 1: { version: '1.0', release: 'September 23, 2008' }, + 2: { version: '1.1', release: 'February 9, 2009' }, + 3: { version: '1.5', release: 'April 27, 2009' }, + 4: { version: '1.6', release: 'September 15, 2009' }, + 5: { version: '2.0', release: 'October 27, 2009' }, + 6: { version: '2.0.1', release: 'December 3, 2009' }, + 7: { version: '2.1', release: 'January 11, 2010' }, + 8: { version: [ '2.2', '2.2.3' ], release: 'May 20, 2010' }, + 9: { version: [ '2.3', '2.3.2' ], release: 'December 6, 2010' }, + 10: { version: [ '2.3.3', '2.3.7' ], release: 'February 9, 2011' }, + 11: { version: '3.0', release: 'February 22, 2011' }, + 12: { version: '3.1', release: 'May 10, 2011' }, + 13: { version: [ '3.2', '3.2.6' ], release: 'July 15, 2011' }, + 14: { version: [ '4.0', '4.0.2' ], release: 'October 18, 2011' }, + 15: { version: [ '4.0.3', '4.0.4' ], release: 'December 16, 2011' }, + 16: { version: [ '4.1', '4.1.2' ], release: 'July 9, 2012' }, + 17: { version: [ '4.2', '4.2.2' ], release: 'November 13, 2012' }, + 18: { version: [ '4.3', '4.3.1' ], release: 'July 24, 2013' }, + 19: { version: [ '4.4', '4.4.4' ], release: 'October 31, 2013' }, + 20: { version: [ '4.4W', '4.4W.2' ], release: 'June 25, 2014' }, + 21: { version: [ '5.0', '5.0.2' ], release: 'November 4, 2014' }, + 22: { version: [ '5.1', '5.1.1' ], release: 'March 2, 2015' }, + 23: { version: [ '6.0', '6.0.1' ], release: 'October 2, 2015' }, + 24: { version: '7.0', release: 'August 22, 2016' }, + 25: { version: [ '7.1', '7.1.2' ], release: 'October 4, 2016' }, + 26: { version: '8.0', release: 'August 21, 2017' }, + 27: { version: '8.1', release: 'December 5, 2017' }, + 28: { version: '9', release: 'August 6, 2018' }, + 29: { version: '10', release: 'September 7, 2019' }, + 30: { version: '11', release: 'September 8, 2020' }, + 31: { version: '12', release: 'October 4, 2021' }, }, month_map: { Jan: 0, Feb: 1, Mar: 2, Apr: 3, May: 4, Jun: 5, @@ -1418,7 +1304,7 @@ let exp = { }, parseDate(s) { let _date_nums = s.replace(/([A-Z]..)\D*?\s(\d\d?), (\d{4})/, ($0, $1, $2, $3) => { - return [$3, this.month_map[$1], $2].join(','); + return [ $3, this.month_map[$1], $2 ].join(','); }).split(',').map(s => Number(s)); _date_nums.unshift(null); return new (Function.prototype.bind.apply(Date, _date_nums)); @@ -1429,7 +1315,7 @@ let exp = { let _raw = this.raw_info[k]; let _ver = _raw.version; if (Array.isArray(_ver)) { - _ver = {min: _ver[0], max: _ver[1]}; + _ver = { min: _ver[0], max: _ver[1] }; } this.versions[k] = { version: _ver, @@ -1449,19 +1335,6 @@ let exp = { return $.getResult(); }, - /** - * Check if device is running compatible android sdk version - * @param {number} [minimum=24] - */ - ensureSdkInt(minimum) { - let _min = minimum || 24; - if (device.sdkInt < _min) { - let _ver = this.getVerInfo(_min).version; - let _floor = typeof _ver === 'object' ? _ver.min : _ver; - let _reason = _floor ? '安卓系统版本低于' + _floor : '安卓系统版本过低'; - consolex.$(['脚本无法继续', _reason], 8, 4, 0, 2); - } - }, /** * Make sure System.SCREEN_OFF_TIMEOUT greater than min_timeout. * Abnormal value might be auto-corrected to correct_timeout determined by is_auto_correct. @@ -1485,7 +1358,7 @@ let exp = { return this.options.is_auto_correct === undefined || this.options.is_auto_correct; }, autoCorrect() { - let _mm = (this.correct_timeout / 60e3).toFixedNum(2); + let _mm = Numberx.toFixedNum(this.correct_timeout / 60e3, 2); consolex.d([ '修正异常的设备屏幕超时参数', '修正值: ' + this.correct_timeout + ' (' + _mm + '分钟)', @@ -1493,7 +1366,7 @@ let exp = { try { exp.screen_off_timeout.put(this.correct_timeout); } catch (e) { - consolex.e(['修正失败', e], 2, 0, -2); + consolex.e([ '修正失败', e ], 2, 0, -2); } }, handle() { @@ -1514,7 +1387,7 @@ let exp = { if (typeof global._$_is_init_scr_on !== 'boolean') { global._$_is_init_scr_on = this.isScreenOn(); } - this.is_init_screen_on = global._$_is_init_scr_on; + this.isInitScreenOn = global._$_is_init_scr_on; if (typeof global._$_is_init_unlk !== 'boolean') { global._$_is_init_unlk = this.isUnlocked(); @@ -1718,7 +1591,7 @@ function StateManager(provider, key, data_type, state_set) { * @param {IArguments} args */ function _fixDataTypeAndCall(act, args) { - for (let type of ['Int', 'Long', 'Float', 'String']) { + for (let type of [ 'Int', 'Long', 'Float', 'String' ]) { if (type !== data_type) { try { let _val = Provider[act.toLowerCase() + type].apply(Provider, args); @@ -1740,7 +1613,7 @@ function unlockGenerator() { let _ak = 'com\\.android\\.keyguard:id/'; let _sk = 'com\\.smartisanos\\.keyguard:id/'; - let {storagesx} = require('./ext-storages'); + let { storagesx } = require('./ext-storages'); let _flag = {}; @@ -1750,7 +1623,7 @@ function unlockGenerator() { _wakeUpWithBuffer(); _disturbance(); - return _checkStrategy() && [{ + return _checkStrategy() && [ { desc: '通用', sel: idMatches(_as + 'preview_container'), }, { @@ -1766,16 +1639,16 @@ function unlockGenerator() { desc: 'MIUI10', sel: idMatches(_as + '(.*lock_screen_container|notification_(container|panel).*|keyguard_.*)'), }, { - sel: $$sel.pickup(/上滑.{0,4}解锁/, 'selector'), - }].some((smp) => { - let {desc: _desc, sel: _sel} = smp; - if (_sel instanceof com.stardust.autojs.core.accessibility.UiSelector) { + sel: pickup(/上滑.{0,4}解锁/, '@'), + } ].some((smp) => { + let { desc: _desc, sel: _sel } = smp; + if (_sel instanceof org.autojs.autojs.core.accessibility.UiSelector) { if (_sel.exists()) { if (_desc) { consolex._('匹配到' + _desc + '解锁提示层控件'); } else { consolex._('匹配到解锁提示层文字:'); - consolex._($$sel.pickup(_sel, 'txt')); + consolex._(pickup(_sel, 'txt')); } return (this.trigger = _sel.exists.bind(_sel))(); } @@ -1785,14 +1658,14 @@ function unlockGenerator() { // tool function(s) // function _disturbance() { - [{ + [ { desc: 'QQ锁屏消息弹框控件', trigger() { - return $$sel.pickup('按住录音') - || $$sel.pickup(idMatches(/com.tencent.mobileqq:id.+/)); + return pickup('按住录音') + || pickup(idMatches(/com.tencent.mobileqq:id.+/)); }, handle() { - a11yx.click$($$sel.pickup('关闭'), 'w'); + a11yx.click$(pickup('关闭'), 'w'); a11yx.wait$(this.trigger.bind(this), 3e3) ? consolex._('关闭弹框控件成功') : consolex._('关闭弹框控件超时', 3); @@ -1812,16 +1685,16 @@ function unlockGenerator() { ? consolex._('闹钟应用解除前置成功') : consolex._('闹钟应用解除前置超时', 3); }, - }].forEach((o) => { + } ].forEach((o) => { if (o.trigger()) { - consolex._(['检测到提示层页面干扰:', o.desc]); + consolex._([ '检测到提示层页面干扰:', o.desc ]); o.handle(); } }); } function _checkStrategy() { - let _stg = _cfg.unlock_dismiss_layer_strategy; + let _stg = _cfg.unlockDismissLayerStrategy; if (_stg === 'preferred') { return true; } @@ -1845,11 +1718,11 @@ function unlockGenerator() { }, dismiss() { let _this = this; - let _btm = _cfg.unlock_dismiss_layer_bottom; - let _top = _cfg.unlock_dismiss_layer_top; - let _time_sto = _cfg.unlock_dismiss_layer_swipe_time; + let _btm = _cfg.unlockDismissLayerBottom; + let _top = _cfg.unlockDismissLayerTop; + let _time_sto = _cfg.unlockDismissLayerSwipeDuration; let _from_sto = !!_time_sto; - let _pts = [_btm, _top]; + let _pts = [ _btm, _top ]; let _time = _time_sto; // copy /** @type {number[]} */ let _reliable = _cfg.swipe_time_reliable || []; @@ -1879,7 +1752,7 @@ function unlockGenerator() { function _dismiss() { // noinspection JSCheckFunctionSignatures - let _gesture_par = [_time].concat(_pts.map(y => [halfW, cY(y)])); + let _gesture_par = [ _time ].concat(_pts.map(y => [ halfW, cY(y) ])); let _max = 30, _ctr = 0; exp.keepOn(3); @@ -1900,7 +1773,7 @@ function unlockGenerator() { if (_from_sto) { if (--_chances < 0) { _from_sto = false; - _time = _cfg.unlock_dismiss_layer_swipe_time; + _time = _cfg.unlockDismissLayerSwipeDuration; consolex._('放弃本地存储数据'); consolex._('从默认值模块获取默认值: ' + _time); } else { @@ -1924,7 +1797,7 @@ function unlockGenerator() { let _is_lmt_reached = _ctr > _max; if (_is_lmt_reached) { _t_pool[_time] = 0; - _sto.put('config', {continuous_swipe: _t_pool}); + _sto.put('config', { continuous_swipe: _t_pool }); _err('消除解锁页面提示层失败'); } return _is_lmt_reached; @@ -1933,7 +1806,7 @@ function unlockGenerator() { function _storage() { if (_time !== _time_sto) { - _sto.put('config', {unlock_dismiss_layer_swipe_time: _time}); + _sto.put('config', { unlockDismissLayerSwipeDuration: _time }); consolex._('存储滑动时长参数: ' + _time); } @@ -1941,13 +1814,13 @@ function unlockGenerator() { _t_pool[_time] = 0; } let _new_ctr = ++_t_pool[_time]; - _sto.put('config', {continuous_swipe: _t_pool}); + _sto.put('config', { continuous_swipe: _t_pool }); consolex._('存储连续成功滑动次数: ' + _new_ctr); if (_new_ctr >= 6 && !_reliable.includes(_time)) { consolex._('当前滑动时长可信度已达标'); consolex._('存储可信滑动时长数据: ' + _time); - _sto.put('config', {swipe_time_reliable: _reliable.concat(_time)}); + _sto.put('config', { swipe_time_reliable: _reliable.concat(_time) }); } } }, @@ -1967,18 +1840,18 @@ function unlockGenerator() { if (exp.isScreenOn()) { return _pattern() || _password() || _pin() || _specials() || _unmatched(); } - consolex._(['跳过解锁控件检测', '屏幕未亮起']); + consolex._([ '跳过解锁控件检测', '屏幕未亮起' ]); // tool function(s) // function _pattern() { - return [{ + return [ { desc: '通用', sel: idMatches(_as + 'lockPatternView'), }, { desc: 'MIUI', sel: idMatches(_ak + 'lockPattern(View)?'), - }].some((smp) => { + } ].some((smp) => { if (smp.sel.exists()) { consolex._('匹配到' + smp.desc + '图案解锁控件'); return _trigger(smp.sel, _stg); @@ -1988,12 +1861,12 @@ function unlockGenerator() { // strategy(ies) // function _stg() { - let _stg = _cfg.unlock_pattern_strategy; + let _stg = _cfg.unlockPatternStrategy; let _stg_map = { segmental: '叠加路径', solid: '连续路径', }; - let _key = 'unlock_pattern_swipe_time_' + _stg; + let _key = 'unlockPatternSwipeDuration' + _stg[0].toUpperCase() + _stg.slice(1); let _time = _cfg[_key]; // swipe time let _from_sto = !!_time; @@ -2015,14 +1888,14 @@ function unlockGenerator() { let _t2 = _time; let _pt1 = _pts[i]; let _pt2 = _pts[i + 1]; - let _pts1 = [_pt1[0], _pt1[1]]; - let _pts2 = [_pt2[0], _pt2[1]]; - _args.push([_t1, _t2, _pts1, _pts2]); + let _pts1 = [ _pt1[0], _pt1[1] ]; + let _pts2 = [ _pt2[0], _pt2[1] ]; + _args.push([ _t1, _t2, _pts1, _pts2 ]); } gestures.apply(null, _args); }, solid() { - gesture.apply(null, [_time].concat(_pts)); + gesture.apply(null, [ _time ].concat(_pts)); }, }; @@ -2072,7 +1945,7 @@ function unlockGenerator() { let _bnd = _stable(_this.sel); if (!_bnd) { - return _err(['图案解锁方案失败', '无法获取点阵布局']); + return _err([ '图案解锁方案失败', '无法获取点阵布局' ]); } let _sz = _pat_sz; @@ -2098,7 +1971,7 @@ function unlockGenerator() { return $_unlk.unlock_pattern_pts = _simplify(_code, _sz) .filter(n => +n && _pts[n]) - .map(n => [_pts[n].x, _pts[n].y]); + .map(n => [ _pts[n].x, _pts[n].y ]); // tool function(s) // @@ -2125,14 +1998,14 @@ function unlockGenerator() { || $$und(_r) || $$und(_b); }; let _parse = (bnd) => { - let {left, top, right, bottom} = bnd; - return [left, top, right, bottom]; + let { left, top, right, bottom } = bnd; + return [ left, top, right, bottom ]; }; let _asg = (bnd) => { - [_l, _t, _r, _b] = _parse(bnd); + [ _l, _t, _r, _b ] = _parse(bnd); }; let _eql = (bnd) => { - let [l, t, r, b] = _parse(bnd); + let [ l, t, r, b ] = _parse(bnd); return _l === l && _t === t && _r === r && _b === b; }; @@ -2193,7 +2066,7 @@ function unlockGenerator() { let _num = 1; for (let i = 1; i <= sz; i += 1) { for (let j = 1; j <= sz; j += 1) { - _o[_num++] = [i, j]; + _o[_num++] = [ i, j ]; } } return _o; @@ -2204,8 +2077,8 @@ function unlockGenerator() { let _p1 = _coord[n1]; let _p2 = _coord[n2]; if (Array.isArray(_p1) && Array.isArray(_p2)) { - let [_x1, _y1] = _p1; - let [_x2, _y2] = _p2; + let [ _x1, _y1 ] = _p1; + let [ _x2, _y2 ] = _p2; return (_y2 - _y1) / (_x2 - _x1); } return NaN; @@ -2226,7 +2099,7 @@ function unlockGenerator() { } function _password() { - return !_misjudge() && [{ + return !_misjudge() && [ { desc: '通用', sel: idMatches('.*passwordEntry'), }, { @@ -2235,7 +2108,7 @@ function unlockGenerator() { }, { desc: '锤子科技', sel: idMatches(_sk + 'passwordEntry(_.+)?').className('EditText'), - }].some((smp) => { + } ].some((smp) => { if (smp.sel.exists()) { consolex._('匹配到' + smp.desc + '密码解锁控件'); return _trigger(smp.sel, _stg); @@ -2251,9 +2124,9 @@ function unlockGenerator() { } let _cfm_btn = (type) => ( - $$sel.pickup([/确.|完成|[Cc]onfirm|[Ee]nter/, { + pickup([ /确.|完成|[Cc]onfirm|[Ee]nter/, { className: 'Button', clickable: true, - }], type) + } ], type) ); let _ctr = 0; @@ -2335,27 +2208,27 @@ function unlockGenerator() { * }>} */ let _smp_o = { - 'HUAWEI VOG-AL00 9': {prefix: 1, keys: [[1008, 1706]]}, + 'HUAWEI VOG-AL00 9': { prefix: 1, keys: [ [ 1008, 1706 ] ] }, 'HUAWEI ELE-AL00 10': { - keys: ['DEL'], + keys: [ 'DEL' ], keys_map: (function $iiFe() { - let y = [1188, 1350, 1511, 1674, 1835]; - let x = [56, 163, 271, 378, 487, 595, 703, 810, 918, 1027]; - let xs = [109.5, 217, 324.5, 432.5, 541, 649, 756.5, 864, 972.5]; - let [y0, y1, y2, y3, y4] = y; - let [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9] = x; - let [xs0, xs1, xs2, xs3, xs4, xs5, xs6, xs7, xs8] = xs; + let y = [ 1188, 1350, 1511, 1674, 1835 ]; + let x = [ 56, 163, 271, 378, 487, 595, 703, 810, 918, 1027 ]; + let xs = [ 109.5, 217, 324.5, 432.5, 541, 649, 756.5, 864, 972.5 ]; + let [ y0, y1, y2, y3, y4 ] = y; + let [ x0, x1, x2, x3, x4, x5, x6, x7, x8, x9 ] = x; + let [ xs0, xs1, xs2, xs3, xs4, xs5, xs6, xs7, xs8 ] = xs; return { - 1: [x0, y0], 2: [x1, y0], 3: [x2, y0], 4: [x3, y0], - 5: [x4, y0], 6: [x5, y0], 7: [x6, y0], 8: [x7, y0], - 9: [x8, y0], 0: [x9, y0], q: [x0, y1], w: [x1, y1], - e: [x2, y1], r: [x3, y1], t: [x4, y1], y: [x5, y1], - u: [x6, y1], i: [x7, y1], o: [x8, y1], p: [x9, y1], - a: [xs0, y2], s: [xs1, y2], d: [xs2, y2], f: [xs3, y2], - g: [xs4, y2], h: [xs5, y2], j: [xs6, y2], k: [xs7, y2], - l: [xs8, y2], z: [xs1, y3], x: [xs2, y3], c: [xs3, y3], - v: [xs4, y3], b: [xs5, y3], n: [xs6, y3], m: [xs7, y3], - ',': [xs1, y4], ' ': [xs4, y4], '.': [xs7, y4], del: [x9, y3], + 1: [ x0, y0 ], 2: [ x1, y0 ], 3: [ x2, y0 ], 4: [ x3, y0 ], + 5: [ x4, y0 ], 6: [ x5, y0 ], 7: [ x6, y0 ], 8: [ x7, y0 ], + 9: [ x8, y0 ], 0: [ x9, y0 ], q: [ x0, y1 ], w: [ x1, y1 ], + e: [ x2, y1 ], r: [ x3, y1 ], t: [ x4, y1 ], y: [ x5, y1 ], + u: [ x6, y1 ], i: [ x7, y1 ], o: [ x8, y1 ], p: [ x9, y1 ], + a: [ xs0, y2 ], s: [ xs1, y2 ], d: [ xs2, y2 ], f: [ xs3, y2 ], + g: [ xs4, y2 ], h: [ xs5, y2 ], j: [ xs6, y2 ], k: [ xs7, y2 ], + l: [ xs8, y2 ], z: [ xs1, y3 ], x: [ xs2, y3 ], c: [ xs3, y3 ], + v: [ xs4, y3 ], b: [ xs5, y3 ], n: [ xs6, y3 ], m: [ xs7, y3 ], + ',': [ xs1, y4 ], ' ': [ xs4, y4 ], '.': [ xs7, y4 ], del: [ x9, y3 ], }; })(), get suffix() { @@ -2391,11 +2264,11 @@ function unlockGenerator() { }); if (_suff) { - if (_suff instanceof com.stardust.automator.UiObject) { + if (_suff instanceof org.autojs.autojs.core.automator.UiObject) { consolex._('辅助按键后置填充类型: 控件'); return a11yx.click$(_suff); } - if (_suff instanceof com.stardust.autojs.core.accessibility.UiSelector) { + if (_suff instanceof org.autojs.autojs.core.accessibility.UiSelector) { consolex._('辅助按键后置填充类型: 选择器'); return a11yx.click$(_suff); } @@ -2405,9 +2278,9 @@ function unlockGenerator() { } if ($$num(_suff) || $$str(_suff) || $$rex(_suff)) { consolex._('辅助按键后置填充类型: 文本'); - return a11yx.click$($$sel.pickup('(key.?)?' + _suff)); + return a11yx.click$(pickup('(key.?)?' + _suff)); } - return _err(['密码解锁失败', '无法判断末位字符类型']); + return _err([ '密码解锁失败', '无法判断末位字符类型' ]); } } } @@ -2421,7 +2294,7 @@ function unlockGenerator() { ].some((sel) => { if (_triStr(sel) || _triRex(sel)) { _this.misjudge = sel; - consolex._(['匹配到误判干扰', '转移至PIN解锁方案']); + consolex._([ '匹配到误判干扰', '转移至PIN解锁方案' ]); return true; } }); @@ -2429,7 +2302,7 @@ function unlockGenerator() { } function _pin() { - return [{ + return [ { desc: '通用', sel: idMatches(_as + 'pinEntry'), }, { @@ -2458,12 +2331,12 @@ function unlockGenerator() { get sel() { let _dial = { _side: 3, - _nums: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0], + _nums: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ], _ft: cX(0.0125), // fault tolerance _checkPoints() { this._points = this._points || {}; return this._nums.every((n) => { - return this._points[n] = $$sel.pickup(n, 'point'); + return this._points[n] = pickup(n, 'point'); }); }, _checkOffset() { @@ -2493,9 +2366,9 @@ function unlockGenerator() { } else { delete global._$_dial_points; } - return {exists: () => !!global._$_dial_points}; + return { exists: () => !!global._$_dial_points }; }, - }].some((smp) => { + } ].some((smp) => { let _desc = smp.desc; if (smp.sel.exists()) { if (_desc.match(/\w$/)) { @@ -2528,7 +2401,7 @@ function unlockGenerator() { // tool function(s) // function _lmt() { - return _ctr > _max && _err(['PIN解锁方案失败', '尝试次数已达上限']); + return _ctr > _max && _err([ 'PIN解锁方案失败', '尝试次数已达上限' ]); } function _clickKeyEnter() { @@ -2541,7 +2414,7 @@ function unlockGenerator() { } function _unlockPin() { - let _samples = [{ + let _samples = [ { desc: '通用PIN/KEY', test() { let _sel = n => idMatches(_as + 'key' + n); @@ -2565,8 +2438,8 @@ function unlockGenerator() { }, click() { let _bnd = this.widget.bounds(); - let _bi = [_bnd.left, _bnd.top, _bnd.right, _bnd.bottom]; - let _sel = n => $$sel.pickup([n, {boundsInside: _bi}]); + let _bi = [ _bnd.left, _bnd.top, _bnd.right, _bnd.bottom ]; + let _sel = n => pickup([ n, { boundsInside: _bi } ]); return _trig(() => _pw.forEach(n => a11yx.click$(_sel(n), 'w'))); }, }, { @@ -2602,11 +2475,11 @@ function unlockGenerator() { // center coordination let _ctc = (num) => { let _bnd = _sel(num).bounds(); - return {x: _bnd.centerX(), y: _bnd.centerY()}; + return { x: _bnd.centerX(), y: _bnd.centerY() }; }; // point of button '0' let _pt = n => _ctc(8)[n] + _ctc(5)[n] - _ctc(2)[n]; - return [_pt('x'), _pt('y')]; + return [ _pt('x'), _pt('y') ]; }; return _trig(() => _pw.forEach(n => a11yx.click$(_sel(n), 'w'))); @@ -2639,10 +2512,10 @@ function unlockGenerator() { }, click() { return _trig(() => _pw.forEach((n) => { - a11yx.click$((global._$_dial_points)[n], 'p', {pt$: 120}); + a11yx.click$((global._$_dial_points)[n], 'p', { pt$: 120 }); })); }, - }]; + } ]; let _max = 8; while (_max--) { for (let o of _samples) { @@ -2678,13 +2551,13 @@ function unlockGenerator() { } function _specials() { - return [{ + return [ { desc: '"Gxzw"屏下指纹设备', sel: idMatches(/.*[Gg][Xx][Zz][Ww].*/), - pw_rect: [0.0875, 0.47, 0.9125, 0.788], // [cX, cY, cX, cY] - }].some((smp) => { + pw_rect: [ 0.0875, 0.47, 0.9125, 0.788 ], // [cX, cY, cX, cY] + } ].some((smp) => { if (smp.sel.exists()) { - consolex._(['匹配到特殊设备解锁方案:', smp.desc]); + consolex._([ '匹配到特殊设备解锁方案:', smp.desc ]); return _trigger(smp.sel, _stg.bind(null, smp.pw_rect)); } }); @@ -2693,7 +2566,7 @@ function unlockGenerator() { function _stg(pw_rect) { let _rect = pw_rect.map((n, i) => i % 2 ? cY(n) : cX(n)); - let [_l, _t, _r, _b] = _rect; + let [ _l, _t, _r, _b ] = _rect; consolex._('已构建密码区域边界:'); consolex._('Rect(' + _l + ', ' + _t + ' - ' + _r + ', ' + _b + ')'); @@ -2720,7 +2593,7 @@ function unlockGenerator() { let _r_l, _r_t, _r_w, _r_h; if ($$arr(rect)) { - let [_l, _t, _r, _b] = rect; + let [ _l, _t, _r, _b ] = rect; _r_l = _l; _r_t = _t; _r_w = _r - _l; @@ -2781,9 +2654,9 @@ function unlockGenerator() { // tool function(s) // function _correct() { - let _w_bad = $$sel.pickup(/.*(重试|不正确|错误|[Ii]ncorrect|[Rr]etry|[Ww]rong).*/); + let _w_bad = pickup(/.*(重试|不正确|错误|[Ii]ncorrect|[Rr]etry|[Ww]rong).*/); if (_w_bad) { - return _err_shown_fg || consolex._($$sel.pickup(_w_bad, 'txt'), 3); + return _err_shown_fg || consolex._(_w_bad.content(), 3); } if (idMatches(new RegExp(_ak + 'phone_locked_textview')).exists()) { return _err_shown_fg || consolex._('密码错误', 3); @@ -2792,7 +2665,7 @@ function unlockGenerator() { } function _chkTryAgain() { - let _chk = () => $$sel.pickup(/.*([Tt]ry again in.+|\d+.*后重试).*/); + let _chk = () => pickup(/.*([Tt]ry again in.+|\d+.*后重试).*/); if (_chk()) { consolex._('正在等待重试超时'); a11yx.wait$(() => !_chk(), 65e3, 500); @@ -2800,9 +2673,9 @@ function unlockGenerator() { } function _chkOKBtn() { - let _w_ok = $$sel.pickup(/OK|确([认定])|好的?/); + let _w_ok = pickup(/OK|确([认定])|好的?/); if (_w_ok) { - consolex._('点击"' + $$sel.pickup(_w_ok, 'txt') + '"按钮'); + consolex._('点击"' + _w_ok.content() + '"按钮'); a11yx.click$(_w_ok, 'w'); sleep(1e3); } @@ -2815,24 +2688,24 @@ function unlockGenerator() { let _sto = storagesx.create('unlock'); let _cfg = Object.assign({ /* default unlock configs which updated at Mar 1, 2021 */ - unlock_code: null, - unlock_max_try_times: 20, - unlock_pattern_strategy: 'segmental', - unlock_pattern_size: 3, - unlock_pattern_swipe_time_segmental: 120, - unlock_pattern_swipe_time_solid: 200, - unlock_dismiss_layer_strategy: 'preferred', - unlock_dismiss_layer_bottom: 0.7, - unlock_dismiss_layer_top: 0.2, - unlock_dismiss_layer_swipe_time: 110, + unlockCode: null, + unlockTryLimit: 20, + unlockPatternStrategy: 'segmental', + unlockPatternSize: 3, + unlockPatternSwipeDurationSegmental: 120, + unlockPatternSwipeDurationSolid: 200, + unlockDismissLayerStrategy: 'preferred', + unlockDismissLayerBottom: 0.7, + unlockDismissLayerTop: 0.3, + unlockDismissLayerSwipeDuration: 110, }, _sto.get('config')); let _code = String(_sto.get('config', { - prop: 'unlock_code', is_crypto: true, default: '', + prop: 'unlockCode', is_crypto: true, default: '', })); let _pw = _code.split(/\D+/).join('').split(''); - let _max_try = _cfg.unlock_max_try_times; - let _pat_sz = _cfg.unlock_pattern_size; + let _max_try = _cfg.unlockTryLimit; + let _pat_sz = _cfg.unlockPatternSize; let _intro = device.brand + ' ' + device.product + ' ' + device.release; @@ -2877,8 +2750,8 @@ function unlockGenerator() { function _err(s) { exp.cancelOn(); - consolex.e(['解锁失败', s, _intro].flat(), 4, 0, 2); - if (!exp.is_init_screen_on) { + consolex.e([ '解锁失败', s, _intro ].flat(), 4, 0, 2); + if (!exp.isInitScreenOn) { consolex.d('自动关闭屏幕'); exp.screenOff() || consolex.w('自动关闭屏幕失败'); } diff --git a/modules/ext-dialogs.js b/modules/ext-dialogs.js index 28f70a7..93a8832 100644 --- a/modules/ext-dialogs.js +++ b/modules/ext-dialogs.js @@ -1,7 +1,6 @@ let { $$und, $$func, $$F, isXMLType, } = require('./mod-global'); -let {colorsx} = require('./ext-colors'); let {consolex} = require('./ext-console'); /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ @@ -13,7 +12,7 @@ let Looper = android.os.Looper; let Linkify = android.text.util.Linkify; let ColorStateList = android.content.res.ColorStateList; let ColorDrawable = android.graphics.drawable.ColorDrawable; -let JsDialog = com.stardust.autojs.core.ui.dialog.JsDialog; +let JsDialog = org.autojs.autojs.core.ui.dialog.JsDialog; let DialogAction = com.afollestad.materialdialogs.DialogAction; let MaterialDialog = com.afollestad.materialdialogs.MaterialDialog; @@ -163,20 +162,20 @@ let exp = { function applyDialogProperty(builder, name, value) { let propertySetters = { title: null, - titleColor: {adapter: colorsx.toInt}, - buttonRippleColor: {adapter: colorsx.toInt}, + titleColor: {adapter: colors.toInt}, + buttonRippleColor: {adapter: colors.toInt}, icon: null, content: null, - contentColor: {adapter: colorsx.toInt}, + contentColor: {adapter: colors.toInt}, contentLineSpacing: null, items: null, - itemsColor: {adapter: colorsx.toInt}, + itemsColor: {adapter: colors.toInt}, positive: {method: 'positiveText', adapter: text => this.text.btn[text] || text}, - positiveColor: {adapter: colorsx.toInt}, + positiveColor: {adapter: colors.toInt}, neutral: {method: 'neutralText', adapter: text => this.text.btn[text] || text}, - neutralColor: {adapter: colorsx.toInt}, + neutralColor: {adapter: colors.toInt}, negative: {method: 'negativeText', adapter: text => this.text.btn[text] || text}, - negativeColor: {adapter: colorsx.toInt}, + negativeColor: {adapter: colors.toInt}, cancelable: null, canceledOnTouchOutside: null, autoDismiss: null, @@ -227,7 +226,7 @@ let exp = { return true; }); } else { - throw new Error('Unknown itemsSelectMode ' + itemsSelectMode); + throw Error('Unknown itemsSelectMode ' + itemsSelectMode); } } if (properties.progress !== undefined) { @@ -272,16 +271,16 @@ let exp = { * @return {JsDialog$} */ builds(props, ext) { - if (isPlainObject(props)) { + if (isObjectSpecies(props)) { return this.builds('', props); } let [ - $tt, $cnt, $neu, $neg, $pos, $obstinate, $cbx, + $tt, $cnt, $neu, $neg, $pos, $stubborn, $cbx, ] = typeof props === 'string' ? [props] : props; let _props = { - autoDismiss: !$obstinate, - canceledOnTouchOutside: !$obstinate, + autoDismiss: !$stubborn, + canceledOnTouchOutside: !$stubborn, checkBoxPrompt: $cbx ? typeof $cbx === 'string' ? $cbx : this.text.no_more_prompt : undefined, }; @@ -312,7 +311,7 @@ let exp = { let _diag = this.build(_props); if (_ext.linkify) { - this.linkify(_diag); + this.linkify(_diag, _ext.linkify); } if (_ext.keycode_back !== undefined) { let _v = _ext.keycode_back; @@ -335,7 +334,7 @@ let exp = { let _bg = _ext.background; if (typeof _bg === 'string') { _bg.match(/^#/) - ? _win.setBackgroundDrawable(new ColorDrawable(colorsx.toInt(_bg))) + ? _win.setBackgroundDrawable(new ColorDrawable(colors.toInt(_bg))) : _win.setBackgroundDrawableResource(android.R.color[_bg]); } else if (typeof _bg === 'number') { _win.setBackgroundDrawable(new ColorDrawable(_bg)); @@ -372,7 +371,7 @@ let exp = { } let _k_c = key + 'Color'; let _c = _ext[_k_c] || color_lib[_color] || _color || color_lib.default; - _ext[_k_c] = colorsx.toInt(_c); + _ext[_k_c] = colors.toInt(_c); } } }, @@ -449,7 +448,7 @@ let exp = { _titles[d].ori_bg_color = -1; } - _setTitle(d, msg, this.colors.title.alert.map(colorsx.toInt)); + _setTitle(d, msg, this.colors.title.alert.map(colors.toInt)); duration === 0 || setTimeout(function () { --_titles.message_showing || _setTitle(d, _ori_txt, [_ori_color, _ori_bg_color]); @@ -477,7 +476,7 @@ let exp = { let _ori_view = d.getContentView(); let _ori_text = _ori_view.getText().toString(); let _is_append = is_append === 'append' || is_append === true; - let [_c_text, _c_bg] = this.colors.content.alert.map(s => colorsx.toInt(s)); + let [_c_text, _c_bg] = this.colors.content.alert.map(s => colors.toInt(s)); ui.post(() => { _ori_view.setText((_is_append ? _ori_text + '\n\n' : '') + msg); @@ -568,9 +567,6 @@ let exp = { typeof o === 'object' && o.dismiss && o.dismiss(); }); }, - clearPool() { - this.pool.clear(); - }, /** * @template {JsDialog$|MaterialDialog$} T * @param {T} d @@ -613,7 +609,7 @@ let exp = { */ setTitleTextColor(d, color) { ui.run(() => { - d && d.getTitleView().setTextColor(colorsx.toInt(this.colors.wrap(color, 'title'))); + d && d.getTitleView().setTextColor(colors.toInt(this.colors.wrap(color, 'title'))); }); }, /** @@ -622,7 +618,7 @@ let exp = { */ setTitleBackgroundColor(d, color) { ui.run(() => { - d && d.getTitleView().setBackgroundColor(colorsx.toInt(this.colors.wrap(color, 'title'))); + d && d.getTitleView().setBackgroundColor(colors.toInt(this.colors.wrap(color, 'title'))); }); }, /** @@ -655,7 +651,7 @@ let exp = { */ setContentTextColor(d, color) { ui.run(() => { - d && d.getContentView().setTextColor(colorsx.toInt(this.colors.wrap(color, 'content'))); + d && d.getContentView().setTextColor(colors.toInt(this.colors.wrap(color, 'content'))); }); }, /** @@ -664,7 +660,7 @@ let exp = { */ setContentBackgroundColor(d, color) { ui.run(() => { - d && d.getContentView().setBackgroundColor(colorsx.toInt(this.colors.wrap(color, 'content'))); + d && d.getContentView().setBackgroundColor(colors.toInt(this.colors.wrap(color, 'content'))); }); }, /** @@ -687,7 +683,7 @@ let exp = { */ setInputTextColor(d, color) { ui.run(() => { - d && d.getInputEditText().setTextColor(colorsx.toInt(color)); + d && d.getInputEditText().setTextColor(colors.toInt(color)); }); }, /** @@ -696,7 +692,7 @@ let exp = { */ setInputBackgroundColor(d, color) { ui.run(() => { - d && d.getInputEditText().setBackgroundColor(colorsx.toInt(color)); + d && d.getInputEditText().setBackgroundColor(colors.toInt(color)); }); }, /** @@ -786,7 +782,7 @@ let exp = { setActionButtonColor(d, action, color) { let _set = function (action) { let _act = action.toLowerCase(); - let _c_int = colorsx.toInt(this.colors.wrap(color, 'button')); + let _c_int = colors.toInt(this.colors.wrap(color, 'button')); let _d_act = this.getDialogAction(_act); ui.run(() => { if (_d_act !== null) { @@ -910,7 +906,7 @@ let exp = { if (_p[_k]) { if (Array.isArray(_p[_k])) { let [_s, _r] = _p[_k]; - o.set(_diag, _k, o.get(_diag, _k).replace(_s, _r)); + o.set(_diag, _k, String(o.get(_diag, _k)).replace(_s, _r)); } else { o.set(_diag, _k, _p[_k]); } @@ -979,7 +975,7 @@ let exp = { } : (r => r); let _btn = _ext.timeout_button; - let _btn_str = _btn && _diag.getActionButton(_btn); + let _btn_str = _btn && _diag.getActionButton(_btn).toString(); let _setButton = _btn ? function (t) { _diag.setActionButton(_btn, _btn_str + ' [ ' + t + ' ]'); } : (r => r); @@ -1145,7 +1141,6 @@ let exp = { message: err, btn_text: exp.text.btn[config.on_interrupt_btn_text || 'B'], onPositive() { - exp.clearPool(); exit(); }, }, _diag); @@ -1347,7 +1342,7 @@ let exp = { * @param {Dialogsx.Progress.Color} color */ setProgressTintList(d, color) { - let _c_int = colorsx.toInt(this.colors.wrap(color, 'progress')); + let _c_int = colors.toInt(this.colors.wrap(color, 'progress')); let _csl = ColorStateList.valueOf(_c_int); d.getProgressBar().setProgressTintList(_csl); }, @@ -1395,7 +1390,7 @@ let exp = { * @param {Color$} color */ setProgressBackgroundTintList(d, color) { - let _c_int = colorsx.toInt(color); + let _c_int = colors.toInt(color); let _csl = ColorStateList.valueOf(_c_int); d.getProgressBar().setProgressBackgroundTintList(_csl); }, @@ -1444,7 +1439,7 @@ let exp = { let _button_bg_tint_color = _opt.button_bg_tint_color || '#00251A'; let _button_font_family = _opt.button_font_family || 'sans-serif'; let _button_layout_gravity = _opt.button_layout_gravity || 'center'; - let _dialog_bg_color = _opt.dialog_bg_color || colorsx.hrgba('#005B4F91'); + let _dialog_bg_color = _opt.dialog_bg_color || colors.rgba('#005B4F91'); let _dialog_dim_amount = _opt.dialog_dim_amount || 90; let _view = ui.inflate( diff --git a/modules/ext-engines.js b/modules/ext-engines.js index 5b858a6..5bdf93c 100644 --- a/modules/ext-engines.js +++ b/modules/ext-engines.js @@ -4,8 +4,8 @@ let {consolex} = require('./ext-console'); /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ -let ScriptConfig = com.stardust.autojs.project.ScriptConfig; -let ExecutionConfig = com.stardust.autojs.execution.ExecutionConfig; +let ScriptConfig = org.autojs.autojs.project.ScriptConfig; +let ExecutionConfig = org.autojs.autojs.execution.ExecutionConfig; let exp = { get my_engine() { @@ -38,7 +38,7 @@ let exp = { return this.my_engine.source.toString().replace(/(.+?)(.(js|auto))?$/, '$1'); }, /** - * @return {com.stardust.autojs.engine.ScriptEngine[]} + * @return {org.autojs.autojs.engine.ScriptEngine[]} */ get all_engines() { return engines.all(); @@ -164,7 +164,7 @@ module.exports = {enginesx: exp}; /** * @param {Enginesx.ExecutionConfig} c - * @return {com.stardust.autojs.execution.ExecutionConfig} + * @return {org.autojs.autojs.execution.ExecutionConfig} */ function _fillConfig(c) { let _cfg = new ExecutionConfig(); diff --git a/modules/ext-events.js b/modules/ext-events.js index 3257db9..062d0c8 100644 --- a/modules/ext-events.js +++ b/modules/ext-events.js @@ -1,5 +1,5 @@ require('./mod-global'); -let {a11yx} = require('./ext-a11y'); +let { a11yx } = require('./ext-a11y'); let exp = { /** @@ -11,7 +11,7 @@ let exp = { */ getToasts(msg, pkg, timeout) { let $ = { - timeout: (Number(timeout) || 4.2e3).clamp(1e3, 60e3), + timeout: Numberx.clamp(Number(timeout) || 4.2e3, [ 1e3, 60e3 ]), msg_rex: new RegExp(msg || ''), pkg_rex: new RegExp(pkg || ''), results: [], @@ -19,16 +19,14 @@ let exp = { // CAUTION // ! do not interrupt this thread manually // ! or toasted message won't be received by next getToasts() - threads.start(new java.lang.Runnable({ - run: () => { - events.observeToast(); - events.on('toast', (o) => { - this.pkg_rex.test(o.getPackageName()) && - this.msg_rex.test(o.getText()) && - this.results.push(o.getText()); - }); - }, - })); + threads.start(() => { + events.observeToast(); + events.on('toast', (o) => { + this.pkg_rex.test(o.getPackageName()) && + this.msg_rex.test(o.getText()) && + this.results.push(o.getText()); + }); + }); a11yx.waitAndStable(() => this.results.length > 0, this.timeout, 50); }, clean() { @@ -45,4 +43,4 @@ let exp = { }, }; -module.exports = {eventsx: exp}; \ No newline at end of file +module.exports = { eventsx: exp }; \ No newline at end of file diff --git a/modules/ext-files.js b/modules/ext-files.js index e1ea999..16046e5 100644 --- a/modules/ext-files.js +++ b/modules/ext-files.js @@ -275,7 +275,7 @@ let exp = { } if (_opt.is_delete_source) { - this.removeWithDirs(_i_path, {is_async: true}); + this.removeWithDirs(_i_path, {isAsync: true}); } return true; @@ -465,7 +465,7 @@ let exp = { } if (_opt.is_delete_source) { - this.removeWithDirs(_i_path, {is_async: true}); + this.removeWithDirs(_i_path, {isAsync: true}); } return true; @@ -511,7 +511,7 @@ let exp = { * @param {string} target - target path (absolute or relative directory) * @param {Object} [options] * @param {boolean} [options.is_unbundled=false] - * @param {boolean} [options.is_async=false] + * @param {boolean} [options.isAsync=false] * @param {function(name:string):boolean} [options.filter] * @param {Object} [callback] * @param {function():*} [callback.onStart] @@ -620,10 +620,10 @@ let exp = { return _res; }; - if (!_opt.is_async) { + if (!_opt.isAsync) { return _act(); } - threadsx.start(_act); + threads.start(_act); }, /** * Returns current Auto.js script dir path @@ -637,7 +637,7 @@ let exp = { return Pref.getScriptDirPath(); } // for Auto.js Pro versions - return com.stardust.autojs.core['pref']['Pref']['INSTANCE']['getScriptDirPath'](); + return org.autojs.autojs.core['pref']['Pref']['INSTANCE']['getScriptDirPath'](); }, /** * @param {string} path @@ -668,7 +668,7 @@ let exp = { /** * @param {string} path * @param {Object} [options] - * @param {boolean} [options.is_async=false] + * @param {boolean} [options.isAsync=false] * @param {Object} [callback] * @param {function():*} [callback.onStart] * @param {function():*} [callback.onRemoveStart] @@ -724,7 +724,7 @@ let exp = { }; try { - return _opt.is_async ? threadsx.start(_parseLv1Depth) : _parseLv1Depth(); + return _opt.isAsync ? threads.start(_parseLv1Depth) : _parseLv1Depth(); } catch (e) { _onFailure(e); } @@ -772,7 +772,7 @@ let exp = { /** * @param {string|java.io.File} file * @param {Object} [options] - * @param {boolean} [options.is_async=false] + * @param {boolean} [options.isAsync=false] * @param {Object} [callback] * @param {function():*} [callback.onStart] * @param {function():*} [callback.onDeleteStart] @@ -794,10 +794,10 @@ let exp = { let _onSuccess = _cbk.onDeleteSuccess || _cbk.onSuccess || (r => r); let _onFailure = _cbk.onDeleteFailure || _cbk.onFailure || console.error; - if (_opt.is_async) { + if (_opt.isAsync) { return _act(); } - threadsx.start(_act); + threads.start(_act); // tool function(s) // diff --git a/modules/ext-http.js b/modules/ext-http.js index 872c4a5..f0536e1 100644 --- a/modules/ext-http.js +++ b/modules/ext-http.js @@ -1,5 +1,3 @@ -let {threadsx} = require('./ext-threads'); - /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ @@ -43,10 +41,10 @@ let exp = { let _tt = _opt.timeout || 10e3; let _ts_max = Date.now() + _tt; - let _sum_bytes = threadsx.atomic(-1); + let _sum_bytes = threads.atomic(-1); let _executor = function (resolve) { - let _thd = threadsx.start(function () { + let _thd = threads.start(function () { try { let _cxn = new URL(url).openConnection(); _cxn.setRequestProperty('Accept-Encoding', 'identity'); @@ -60,7 +58,7 @@ let exp = { // nothing to do here } }); - threadsx.start(function () { + threads.start(function () { try { while (1) { if (_sum_bytes.get() > 0) { @@ -94,7 +92,7 @@ let exp = { * @param {Object} [options] * @param {string} [options.path] * @param {Object} [options.headers] - * @param {boolean} [options.is_async=true] + * @param {boolean} [options.isAsync=true] * @return {any} */ okhttp3Request(url, callback, options) { @@ -115,10 +113,10 @@ let exp = { if (!url) { return _onFailure('url for httpx.okhttp3Request() is required'); } - if (_opt.is_async !== undefined && !_opt.is_async) { + if (_opt.isAsync !== undefined && !_opt.isAsync) { return _request(); } - threadsx.start(_request); + threads.start(_request); // tool function(s) // diff --git a/modules/ext-images.js b/modules/ext-images.js index 8f79da2..ea95d2d 100644 --- a/modules/ext-images.js +++ b/modules/ext-images.js @@ -4,10 +4,9 @@ let {a11yx, $$sel} = require('./ext-a11y'); let {filesx} = require('./ext-files'); let {devicex} = require('./ext-device'); let {cryptox} = require('./ext-crypto'); -let {threadsx} = require('./ext-threads'); let {consolex} = require('./ext-console'); -global._$_has_scr_capt_perm = global._$_has_scr_capt_perm || threadsx.atomic(0); +global._$_has_scr_capt_perm = global._$_has_scr_capt_perm || threads.atomic(0); /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ @@ -19,10 +18,7 @@ let Core = org.opencv.core.Core; let Rect = android.graphics.Rect; let Bitmap = android.graphics.Bitmap; let BitmapFactory = android.graphics.BitmapFactory; -let ImageWrapper = com.stardust.autojs.core.image.ImageWrapper; -let ScreenCapturer = com.stardust.autojs.core.image.capture.ScreenCapturer; -let UiSelector = com.stardust.autojs.core.accessibility.UiSelector; -let UiObject = com.stardust.automator.UiObject; +let ScreenCapturer = org.autojs.autojs.core.image.capture.ScreenCapturer; let ByteArrayOutputStream = java.io.ByteArrayOutputStream; let exp = { @@ -200,7 +196,7 @@ let exp = { */ getMean(img) { let [R, G, B] = Core.mean(img.getMat()).val; - return {R: R, G: G, B: B, std: Math.std([R, G, B])}; + return {R: R, G: G, B: B, std: Mathx.std([R, G, B])}; }, isRecycled(img, is_strict) { if (!this.isImageWrapper(img)) { @@ -230,9 +226,6 @@ let exp = { this.pool.reclaim(i); }); }, - clearPool() { - this.pool.clear(); - }, /** * @param {Imagesx.Capt.Options} [options] * @return {ImageWrapper$} @@ -289,7 +282,6 @@ let exp = { let javaImages = runtime.getImages(); let ResultAdapter = require.call(global, 'result_adapter'); - let _is_pro = context.getPackageName().match(/Pro\b/i); let _orientation = landscape === undefined || landscape === 'AUTO' ? ScreenCapturer.ORIENTATION_AUTO : typeof landscape === 'boolean' ? landscape @@ -298,11 +290,7 @@ let exp = { : landscape === 'LANDSCAPE' ? ScreenCapturer.ORIENTATION_LANDSCAPE : landscape === 'PORTRAIT' ? ScreenCapturer.ORIENTATION_PORTRAIT : ScreenCapturer.ORIENTATION_AUTO; - let _adapter = !_is_pro - ? javaImages.requestScreenCapture(_orientation) - : javaImages.requestScreenCapture.apply(javaImages, [ - _orientation, /* width: */ -1, /* height: */ -1, /* isAsync: */ false, - ].slice(0, app.autojs.versionName.match(/^Pro 7/) ? 3 : 4)); + let _adapter = javaImages.requestScreenCapture(_orientation); if (ResultAdapter.wait(_adapter)) { return true; @@ -335,14 +323,9 @@ let exp = { _debug('已开启弹窗监测线程'); - let _thread_prompt = threadsx.start(function () { - /** @return {A11yx.Pickup.Results} */ - let _sel_rem = () => $$sel.pickup(id('com.android.systemui:id/remember')); - /** - * @param [t] - * @return {A11yx.Pickup.Results} - */ - let _sel_sure = t => $$sel.pickup(/立即开始|允许|S(tart|TART) [Nn](ow|OW)|A(llow|LLOW)/, t); + let _thread_prompt = threads.start(function () { + let _sel_rem = () => pickup(id('com.android.systemui:id/remember')); + let _sel_sure = () => pickup(/立即开始|允许|S(tart|TART) [Nn](ow|OW)|A(llow|LLOW)/); if (a11yx.wait(_sel_sure, 4.8e3, 120)) { a11yx.wait(_sel_rem, 600, 120, { @@ -353,7 +336,7 @@ let exp = { }); a11yx.wait(_sel_sure, 2.4e3, 120, { then(w) { - _debug('点击"' + $$sel.pickup(w, 'txt') + '"按钮'); + _debug('点击"' + w.content() + '"按钮'); a11yx.click(w, 'w'); a11yx.wait(() => !_sel_sure(), 1e3, { else() { @@ -368,7 +351,7 @@ let exp = { let _sco = _opt.screen_capturer_orientation; _sco = _sco === undefined ? 'PORTRAIT' : _sco; - let _req_result = exp.requestScreenCapture(_sco); + let _req_result = images.requestScreenCapture(_sco); return a11yx.wait(() => !!_req_result, 4.8e3, 80, { then() { @@ -425,7 +408,7 @@ let exp = { let _opt = options || {}; return (function $iiFe() { - let _lv = Math.floorPow(2, Math.max(Number(_opt.compress_level) || 1, 1)); + let _lv = Mathx.floorPow(2, Math.max(Number(_opt.compress_level) || 1, 1)); let _options = { max: _opt.max_results, threshold: _opt.threshold, @@ -583,7 +566,7 @@ let exp = { * @return {T} */ compress(img, compress_level /* inSampleSize */, is_recycle_img) { - let _lv = Math.floorPow(2, Math.max(Number(compress_level) || 1, 1)); + let _lv = Mathx.floorPow(2, Math.max(Number(compress_level) || 1, 1)); let _new_wrapper = img; if (_lv > 1) { let _os = new ByteArrayOutputStream(); @@ -684,7 +667,7 @@ let exp = { */ findImage(img, template, options) { let _opt = options || {}; - let _lv = Math.floorPow(2, Math.max(Number(_opt.compress_level) || 1, 1)); + let _lv = Mathx.floorPow(2, Math.max(Number(_opt.compress_level) || 1, 1)); let _result = (function $iiFe() { if (_lv <= 1) { return images.findImage(img, template, options); @@ -718,7 +701,7 @@ let exp = { * @param {number} [options.timeout=60e3] -- no less than 5e3 * @example * // [[], [], []] -- 3 groups of data - * console.log(imagesx.baiduOcr($$sel.pickup(/\xa0/, 'widgets'), { + * console.log(imagesx.baiduOcr(pickup(/\xa0/, 'widgets'), { * fetchTimes: 3, * timeout: 12e3 * })); @@ -748,7 +731,7 @@ let exp = { let _token = ''; let _max_token = 10; - let _thd_token = threadsx.start(function () { + let _thd_token = threads.start(function () { while (_max_token--) { try { // noinspection SpellCheckingInspection @@ -785,7 +768,7 @@ let exp = { let _allDead = () => _thds.every(thd => !thd.isAlive()); while (_max--) { - _thds.push(threadsx.start(function () { + _thds.push(threads.start(function () { let _max_img = 10; let _img = _stitchImgs(src); while (_max_img--) { @@ -823,7 +806,7 @@ let exp = { sleep(_itv); } - threadsx.start(function () { + threads.start(function () { while (!_allDead()) { sleep(420); if (Date.now() >= _tt_ts) { @@ -927,7 +910,7 @@ let exp = { * @return {OpenCV.Point} */ findColor(img, color, options) { - if (isPlainObject(options) && options.region instanceof android.graphics.Rect) { + if (isObjectSpecies(options) && options.region instanceof android.graphics.Rect) { let _r = options.region; options.region = [_r.left, _r.top, _r.width(), _r.height()]; } diff --git a/modules/ext-storages.js b/modules/ext-storages.js index 1c62b49..56d02f2 100644 --- a/modules/ext-storages.js +++ b/modules/ext-storages.js @@ -130,7 +130,7 @@ let Storage = function StorageConstructor$iiFe() { return o; }; let _reEnc = (o) => { - if (isPlainObject(o)) { + if (isObjectSpecies(o)) { return _reEncObject(o); } if (typeof o === 'string') { @@ -198,7 +198,7 @@ let Storage = function StorageConstructor$iiFe() { if (!_opt.is_crypto) { return o; } - if (!isPlainObject(o) || _opt.is_forcible) { + if (!isObjectSpecies(o) || _opt.is_forcible) { return _enc(o); } let _o = {}; @@ -213,8 +213,8 @@ let Storage = function StorageConstructor$iiFe() { } if (!_opt.is_forcible - && isPlainObject(new_val) - && isPlainObject(_val[key]) + && isObjectSpecies(new_val) + && isObjectSpecies(_val[key]) && Object.keys(new_val).length > 0 ) { _tmp[key] = Object.assign(_val[key], _encodeIFN(new_val)); diff --git a/modules/ext-threads.js b/modules/ext-threads.js index 0c7cb84..160a4f5 100644 --- a/modules/ext-threads.js +++ b/modules/ext-threads.js @@ -7,10 +7,6 @@ let {a11yx} = require('./ext-a11y'); /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ let Runnable = java.lang.Runnable; -let Throwable = java.lang.Throwable; -let AtomicLong = java.util.concurrent.atomic.AtomicLong; -let TimerThread = com.stardust.autojs.core.looper.TimerThread; -let ScriptInterruptedException = com.stardust.autojs.runtime.exception.ScriptInterruptedException; let exp = { /** @@ -22,127 +18,31 @@ let exp = { return a11yx.waitAndClick(/打开/, _tt, 240, {cs$: 'w'}); }, }, - _start(f) { - let _uber = threads.start(f); - return Object.create(_uber, { - join: { - value(time) { - if (time === Infinity || time === undefined) { - time = 0; - } else if (time < 1) { - time = 1; // 1 ms - } - _uber.join(time); - }, - }, - }); - }, /** * @param {Threadsx.Monitor} [monitor] * @param {...any[]} [args] - * @return {com.stardust.autojs.core.looper.TimerThread} + * @return {org.autojs.autojs.core.looper.TimerThread} */ monitor(monitor, args) { let _mon = typeof monitor === 'string' ? this._monitor_preset[monitor] : monitor; if (typeof _mon === 'function') { - return this.start(() => _mon.apply(null, [].slice.call(arguments).slice(1))); + return threads.start(() => _mon.apply(null, [].slice.call(arguments).slice(1))); } if (_mon instanceof Runnable) { - return this.start(_mon); + return threads.start(_mon); } throw TypeError('Invalid monitor: ' + monitor); }, /** * @param {Threadsx.Monitor} [monitor] * @param {...any[]} [args] - * @return {com.stardust.autojs.core.looper.TimerThread|void} + * @return {org.autojs.autojs.core.looper.TimerThread|void} */ monitorIFN(monitor, args) { if (monitor !== undefined) { return this.monitor.apply(this, arguments); } }, - /** - * Prevent script exiting error from showing up (for both - * console and toast window) if threads were interrupted - * @param {Threadsx.Start.Func} f - * @param {Threadsx.Start.Options} [options] - * @example - * threadsx.start(() => { - * console.log('A'); - * sleep(2e3); - * console.log('C'); - * }).join(1e3); - * console.log('B'); - * @return {Threadsx.TimerThread} - */ - start(f, options) { - let _opt = options || {}; - let _state = true; - try { - if (isNormalFunction(f) || f instanceof Runnable) { - return this._start(f); - } - if (isArrowFunction(f)) { - return this._start(new Runnable({run: () => f()})); - } - _state = false; - } catch (e) { - if (!ScriptInterruptedException.causedByInterrupted(new Throwable(e))) { - if (!e.message.match(/script exiting/) && _opt.is_show_error !== false) { - throw Error(e + '\n' + e.stack); - } - } - } - if (!_state) { - throw TypeError('Unsupported type "' + typeof f + '" for threadsx.start()'); - } - }, - /** - * Degradation (zh-CN: 平稳退化) for threads.atomic() - * @param {number} [x] - * @return {{ - * incrementAndGet: function(): number, - * compareAndSet: function(number, number): boolean, - * get: function(): number - * }|java.util.concurrent.atomic.AtomicLong} - */ - atomic(x) { - let _res = threads.atomic(x); - if (_res instanceof AtomicLong) { - return _res; - } - // TODO threads.lock() might be worth a try :) - let _num = x; - return { - get() { - return _num; - }, - incrementAndGet() { - return _num += 1; - }, - /** - * @param {number} m - * @param {number} n - * @return {boolean} - */ - compareAndSet(m, n) { - if (_num === m) { - _num = n; - return true; - } - return false; - }, - }; - }, - /** - * @param {com.stardust.autojs.core.looper.TimerThread|*} thd - */ - interrupt(thd) { - if (thd instanceof TimerThread) { - thd.isAlive() && thd.interrupt(); - } - }, }; module.exports = {threadsx: exp}; \ No newline at end of file diff --git a/modules/ext-timers.js b/modules/ext-timers.js deleted file mode 100644 index 19663f4..0000000 --- a/modules/ext-timers.js +++ /dev/null @@ -1,486 +0,0 @@ -let {threadsx} = require('./ext-threads'); - -let is_pro = context.getPackageName().match(/Pro\b/i); -let timing = is_pro ? com.stardust.autojs.core['timing'] : org.autojs.autojs.timing; -let TimedTask = is_pro ? timing.TimedTask['Companion'] : timing.TimedTask; -let TimedTaskManager = timing.TimedTaskManager; -let TimedTaskMgr = is_pro ? TimedTaskManager['Companion'].getInstance() : TimedTaskManager.getInstance(); -let bridges = global.require('__bridges__'); -let days_ident = [ - 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', - 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun', - '一', '二', '三', '四', '五', '六', '日', - 1, 2, 3, 4, 5, 6, 0, - 1, 2, 3, 4, 5, 6, 7, -].map(x => typeof x === 'string' ? x : x.toString()); - -let exp = { - /** - * @param {TimedTask$|IntentTask$} task - * @param {Timersx.TimedTask.Extension} [options] - * @return {TimedTask$|null|*} - */ - _taskFulfilled(task, options) { - if (!task) { - return null; - } - let _o = options || {}; - let _cond = typeof _o.condition === 'function' ? _o.condition : () => task.id > 0; - let _cbk = typeof _o.callback === 'function' ? _o.callback : null; - let _timeout = 3e3; - let _itv = 120; - let _run = () => { - while (_timeout > 0) { - if (_cond()) { - return _cbk ? _cbk(task) : task; - } - sleep(_itv); - _timeout -= _itv; - } - return null; - }; - if (!_o.is_async) { - return _run(); - } - threadsx.start(_run); - }, - /** - * @param {TimedTask$|IntentTask$|null} task - * @return {TimedTask$|IntentTask$|null} - */ - addTask(task) { - if (task) { - if (is_pro) { - TimedTaskMgr['addTaskSync'](task); - } else { - TimedTaskMgr.addTask(task); - } - } - return task || null; - }, - /** - * @param {Timersx.TimedTask.Daily} options - * @example - * timersx.addDailyTask({ - * time: Date.now() + 3.6e6, - * path: files.path('./test.js'), - * }); - * @return {?TimedTask$} - */ - addDailyTask(options) { - let _opt = options || {}; - let _date_time = parseDateTime('LocalTime', _opt.time || Date.now()); - let _path = files.path(_opt.path); - let _cfg = parseConfig(_opt); - let _task = this.addTask(TimedTask.dailyTask(_date_time, _path, _cfg)); - return this._taskFulfilled(_task, _opt); - }, - /** - * @param {Timersx.TimedTask.Weekly} options - * @example - * timersx.addWeeklyTask({ - * time: Date.now() + 3.6e6, - * path: files.path('./test.js'), - * daysOfWeek: [1, 3, 6, 7], - * }); - * @return {?TimedTask$} - */ - addWeeklyTask(options) { - let _opt = options || {}; - let _time_flag = 0; - for (let i = 0; i < _opt.daysOfWeek.length; i++) { - let day_str = _opt.daysOfWeek[i].toString(); - let day_idx = days_ident.indexOf(day_str.toLowerCase()) % 7; - if (day_idx < 0) { - throw Error('unknown day: ' + day_str); - } - _time_flag |= TimedTask.getDayOfWeekTimeFlag(day_idx + 1); - } - let _date_time = parseDateTime('LocalTime', _opt.time || Date.now()); - let _flag_num = Number(new java.lang.Long(_time_flag)); - let _path = files.path(_opt.path); - let _cfg = parseConfig(_opt); - let _task = this.addTask(TimedTask.weeklyTask(_date_time, _flag_num, _path, _cfg)); - return this._taskFulfilled(_task, _opt); - }, - /** - * @param {Timersx.TimedTask.Disposable} options - * @example - * timersx.addDisposableTask({ - * path: engines.myEngine().source, - * date: Date.now() + 3.6e6, - * }); - * @return {?TimedTask$} - */ - addDisposableTask(options) { - let _opt = options || {}; - let _date_time = parseDateTime('LocalDateTime', _opt.date || Date.now()); - let _path = files.path(_opt.path); - let _cfg = parseConfig(_opt); - let _task = this.addTask(TimedTask.disposableTask(_date_time, _path, _cfg)) || null; - return this._taskFulfilled(_task, _opt); - }, - /** - * @param {{path:string,action?:string}&Timersx.TimedTask.Extension} options - * @example - * timersx.addIntentTask({ - * path: files.path('./test.js'), - * action: 'android.intent.action.BATTERY_CHANGED', - * }); - * @return {?IntentTask$} - */ - addIntentTask(options) { - let _opt = options || {}; - let _task = this.addTask((function $iiFe() { - let _i_task = new timing.IntentTask(); - _i_task.setScriptPath(files.path(_opt.path)); - _opt.action && _i_task.setAction(_opt.action); - return _i_task; - })()) || null; - return this._taskFulfilled(_task, _opt); - }, - /** - * @param {number} id - * @return {TimedTask$} - */ - getTimedTask(id) { - return TimedTaskMgr.getTimedTask(id); - }, - /** - * @param {number} id - * @return {IntentTask$} - */ - getIntentTask(id) { - return TimedTaskMgr.getIntentTask(id); - }, - /** - * @param {TimedTask$|IntentTask$|null} task - * @return {TimedTask$|IntentTask$} - */ - removeTask(task) { - if (!task) { - return null; - } - if (is_pro) { - TimedTaskMgr['removeTaskSync'](task); - } else { - TimedTaskMgr.removeTask(task); - } - return task; - }, - /** - * @param {number} id - * @param {Timersx.TimedTask.Extension} [options] - * @return {?TimedTask$} - */ - removeIntentTask(id, options) { - let _opt = options || {}; - let _task = this.removeTask(this.getIntentTask(id)); - return this._taskFulfilled(_task, Object.assign(_opt, { - condition: () => !this.getIntentTask(id), - })); - }, - /** - * @param {number} id - * @param {Timersx.TimedTask.Extension} [options] - * @return {?TimedTask$} - */ - removeTimedTask(id, options) { - let _opt = options || {}; - let _task = this.removeTask(this.getTimedTask(id)); - return this._taskFulfilled(_task, Object.assign(_opt, { - condition: () => !this.getTimedTask(id), - })); - }, - /** - * @param {TimedTask$|null} task - * @return {TimedTask$|null} - */ - updateTask(task) { - if (!task) { - return null; - } - task.setScheduled(false); - TimedTaskMgr.updateTask(task); - return task; - }, - /** - * @param {{path?:string}} [options] - * @return {TimedTask$[]} - */ - queryTimedTasks(options) { - let _opt = options || {}; - let _sql = ''; - let _args = []; - let _append = str => _sql += _sql.length ? ' AND ' + str : str; - let _path = _opt.path; - if (_path) { - _append('script_path = ?'); - _args.push(_path); - } - if (is_pro) { - let _tasks = TimedTaskMgr.queryTimedTasks.call(TimedTaskMgr, _sql || null, _args); - return bridges.toArray(_tasks); - } - let _list = TimedTaskMgr.getAllTasksAsList().toArray(); - return _path ? _list.filter(task => task.getScriptPath() === _path) : _list; - }, - /** - * @param {{path?:string,action?:string}} [options] - * @return {IntentTask$[]} - */ - queryIntentTasks(options) { - let _opt = options || {}; - let _sql = ''; - let _args = []; - let _append = str => _sql += _sql.length ? ' AND ' + str : str; - let {path: _path, action: _act} = _opt; - if (_path) { - _append('script_path = ?'); - _args.push(_path); - } - if (_act) { - _append('action = ?'); - _args.push(_act); - } - if (is_pro) { - let _tasks = TimedTaskMgr.queryIntentTasks.call(TimedTaskMgr, _sql || null, _args); - return bridges.toArray(_tasks); - } - let _list = TimedTaskMgr.getAllIntentTasksAsList().toArray(); - return _path || _act ? _list.filter(task => ( - !(_path && task.getScriptPath() !== _path || _act && task.getAction() !== _act) - )) : _list; - }, - /** - * Conversion between time flag and numbers - * @param src {number|number[]} -- number(s) from 0 to 127 - * @example - * // [0,1,2,4,5] -- Sun, Mon, Tue, Thu, Fri - * timersx.timeFlagConverter(55); - * // 23 -- time flag; Sun, Mon, Tue, Thu - * timersx.timeFlagConverter([0, 1, 2, 4]); - * // [0,1,2,3,4,5,6] -- every day - * timersx.timeFlagConverter(127); - * // 127 -- time flag; every day - * timersx.timeFlagConverter([0,1,2,3,4,5,6]); - * // [] -- disposable - * timersx.timeFlagConverter(0); - * @return {number|number[]} - */ - timeFlagConverter(src) { - if (Array.isArray(src)) { - return Array(7).fill(0).reduce((a, b, i) => { - return a + (src.includes(i) ? Math.pow(2, i) : 0); - }, 0); - } - let _res = []; - let _str = Number(src).toString(2); - let _num = _str.length - 1; - for (let i of _str) { - i > 0 && _res.unshift(_num); - _num -= 1; - } - return _res; - }, - /** - * Replacement of setInterval() with functional timeout supported - * @param {function} func - * @param {number} [interval=200] - * @param {number|function():boolean} [timeout=Infinity] - * @param {function} [callback] - * @example - * // print 'hello' every 1 second for 5 (or 4 sometimes) times - * timersx.setInterval(() => console.log('hello'), 1e3, 5e3); - * @example - * timersx.setInterval(() => log('Good luck comes later...'), 100, () => { - * let num = Math.random() * 100 + 1; - * return num > 90 && Math.floor(num); - * }, res => log('Your lucky number is ' + res)); - * @see https://dev.to/akanksha_9560/why-not-to-use-setinterval--2na9 - */ - setInterval(func, interval, timeout, callback) { - let $ = { - init_ts: Date.now(), - interval: interval > 0 ? interval : 200, - timeout: timeout > 0 ? timeout : Infinity, - isTimedOut() { - if (typeof this._isTimedOut !== 'function') { - this._isTimedOut = typeof timeout === 'function' - ? timeout.bind(this) - : () => Date.now() - this.init_ts > this.timeout; - } - this.timeout_result = this._isTimedOut(); - return this.timeout_result !== false && !isNullish(this.timeout_result); - }, - relayIFN() { - if (!this.isTimedOut()) { - this.setTimeout(); - } else if (typeof callback === 'function') { - callback.call(this, this.timeout_result); - } - }, - run() { - func(); - this.relayIFN(); - }, - setTimeout() { - setTimeout(this.run.bind(this), this.interval); - }, - }; - $.setTimeout(); - }, - $rec() { - let _ = { - /** - * @type {Object.} - */ - keys: {}, - /** - * @type {number[]} - */ - anonymity: [], - /** - * @param {?number} [ts] - * @return {number} - */ - ts(ts) { - return typeof ts === 'number' ? ts : Date.now(); - }, - /** - * @param {string} [key] - * @return {boolean} - */ - has(key) { - return key in this.keys; - }, - /** - * @param {string} [key] - * @param {?number} [ts] - * @return {number} - */ - add(key, ts) { - key === undefined - ? this.anonymity.push(this.ts(ts)) - : this.keys[key] = this.ts(ts); - return this.ts(ts); - }, - /** - * @param {string} [key] - * @return {number|void} - */ - get(key) { - return key === undefined ? this.anonymity.pop() : this.keys[key]; - }, - /** - * @param {string} [key] - * @param {?number} [ts] - * @return {number} - */ - save(key, ts) { - return this.add(key, ts); - }, - /** - * @param {string} [key] - * @param {?number} [ts] - * @return {number} - */ - load(key, ts) { - return this.ts(ts) - this.get(key); - }, - /** - * @param {string|function} [key] - * @param {?number} [ts] - * @return {number} - */ - shortcut(key, ts) { - if (typeof key === 'function') { - this.save(); - key.call(ts); - return this.load(); - } - return typeof key !== 'undefined' - ? this.has(key) ? this.load(key, ts) : this.save(key, ts) - : this.anonymity.length ? this.load() : this.save(); - }, - }; - - /** - * Record or get the record for a time gap - * @param {string|function} [key] - * @param {number|ThisType} [ts] - * @return {number|void} - timestamp - */ - this.rec = function (key, ts) { - return _.shortcut(key, ts); - }; - /** - * @param {string} [key] - * @param {number} [ts=Date.now()] - */ - this.rec.save = (key, ts) => _.save(key, ts); - /** - * @param {string} [key] - * @param {number} [ts=Date.now()] - * @return {number} - */ - this.rec.load = (key, ts) => _.load(key, ts); - this.rec.lt = (key, compare) => this.rec.load(key) < compare; - this.rec.gt = (key, compare) => this.rec.load(key) > compare; - this.rec.clear = () => { - _.keys = {}; - _.anonymity.splice(0); - }; - - delete this.$rec; - return this; - }, - $bind() { - this.$rec(); - - delete this.$bind; - return this; - }, -}; - -exp.$bind(); - -module.exports = {timersx: exp}; - -// tool function(s) // - -/** - * @param {Object} c - * @param {number} [c.delay=0] - * @param {number} [c.interval=0] - * @param {number} [c.loopTimes=1] - * @return {com.stardust.autojs.execution.ExecutionConfig} - */ -function parseConfig(c) { - let _ec = new com.stardust.autojs.execution.ExecutionConfig(); - _ec.delay = c.delay || 0; - _ec.interval = c.interval || 0; - _ec.loopTimes = (c.loopTimes === undefined) ? 1 : c.loopTimes; - return _ec; -} - -/** - * @param {'LocalTime'|'LocalDateTime'|string} clazz - * @param {string|Date|number} date_time - * @return {org.joda.time.DateTime|org.joda.time.LocalDateTime|*} - */ -function parseDateTime(clazz, date_time) { - let _clz = is_pro ? clazz : org.joda.time[clazz]; - let _dt = date_time; - let _dts = () => _dt.getTime(); - if (typeof date_time === 'string') { - return is_pro ? TimedTask.parseDateTime.call(TimedTask, _clz, _dt) : _clz.parse(_dt); - } - if (date_time instanceof Date) { - return is_pro ? TimedTask.parseDateTime.call(TimedTask, _clz, _dts()) : new _clz(_dts()); - } - if (typeof date_time === 'number') { - return is_pro ? TimedTask.parseDateTime.call(TimedTask, _clz, _dt) : new _clz(_dt); - } - throw new Error('Cannot parse date time: ' + date_time); -} \ No newline at end of file diff --git a/modules/ext-ui.js b/modules/ext-ui.js index ca8a704..dbabdd8 100644 --- a/modules/ext-ui.js +++ b/modules/ext-ui.js @@ -1,14 +1,13 @@ let {isXMLType} = require('./mod-global'); let {project} = require('./mod-project'); -let {colorsx} = require('./ext-colors'); /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ let Looper = android.os.Looper; let ActivityInfo = android.content.pm.ActivityInfo; -let Colors = com.stardust.autojs.core.ui.inflater.util.Colors; -let Dimensions = com.stardust.autojs.core.ui.inflater.util.Dimensions; +let Colors = org.autojs.autojs.core.ui.inflater.util.Colors; +let Dimensions = org.autojs.autojs.core.ui.inflater.util.Dimensions; let exp = { colors: { @@ -47,9 +46,9 @@ let exp = { ); let _ui_view = { - /** @type {com.stardust.autojs.core.ui.widget.JsLinearLayout} */ + /** @type {org.autojs.autojs.core.ui.widget.JsLinearLayout} */ main: ui['main'], - /** @type {com.stardust.autojs.core.ui.widget.JsLinearLayout} */ + /** @type {org.autojs.autojs.core.ui.widget.JsLinearLayout} */ sub_main: ui['sub_main'], }; @@ -243,14 +242,14 @@ let exp = { * @param {number} color */ setColorFilter(view, color) { - view.setColorFilter(Colors.parse(view, colorsx.toStr(color))); + view.setColorFilter(Colors.parse(view, colors.toString(color))); }, /** * @param {android.widget.TextView|android.widget.TextView[]} view * @param {Color$} color */ setTextColor(view, color) { - let _set = v => v.setTextColor(colorsx.toInt(color)); + let _set = v => v.setTextColor(colors.toInt(color)); Array.isArray(view) ? view.forEach(_set) : _set(view); }, /** @@ -422,7 +421,7 @@ let exp = { setter: (view, name, value) => view.setTextSize(Number(value)), }, { attr_name: ['color', 'text_color'], - setter: (view, name, value) => view.setTextColor(colorsx.toInt(value)), + setter: (view, name, value) => view.setTextColor(colors.toInt(value)), }, { attr_name: 'line_spacing', setter(view, name, value) { @@ -462,12 +461,12 @@ let exp = { }, { attr_name: 'text_color', setter(view, name, value) { - view.setTextColor(colorsx.toInt(value)); + view.setTextColor(colors.toInt(value)); }, }, { attr_name: 'background_tint', setter(view, name, value) { - view.setBackgroundTintList(colorsx.toColorStateList(value)); + view.setBackgroundTintList(colors.toColorStateList(value)); }, }]); this.registerWidget('x-img-button', function layout$iiFe() { @@ -502,8 +501,8 @@ let exp = { attr_name: 'switch', setter(view, name, value) { view['_img'].attr('tint_color', value === 'on' - ? colorsx.hrgba('#AC1900BF') - : colorsx.hrgba('#FFFFFF22')); + ? colors.rgba('#AC1900BF') + : colors.rgba('#FFFFFF22')); }, }, { attr_name: 'on_click', @@ -528,7 +527,7 @@ let exp = { }, { attr_name: 'text_color', setter(view, name, value) { - view['_text'].setTextColor(colorsx.toInt(value)); + view['_text'].setTextColor(colors.toInt(value)); }, }, { attr_name: 'text_size', diff --git a/modules/mod-alipay.js b/modules/mod-alipay.js index fe45893..961ff6b 100644 --- a/modules/mod-alipay.js +++ b/modules/mod-alipay.js @@ -50,7 +50,7 @@ let exp = { return this.startApp(20000067, app_id, url); } // @Overload - if (isPlainObject(url)) { + if (isObjectSpecies(url)) { return this.startApp(app_id, null, url); } return appx.startActivity({ @@ -81,14 +81,6 @@ let exp = { monitor: 'ensure_open', }); }, - ensureAppInstalled() { - try { - context.getPackageManager().getApplicationInfo(this.package_name, 0); - } catch (e) { - consolex.w(e, 0, 0, 2); - consolex.$(['脚本无法继续', '此设备可能未安装"支付宝"应用'], 8, 4, 0, 2); - } - }, }; /** diff --git a/modules/mod-ant-forest.js b/modules/mod-ant-forest.js index ab95678..e6fbe42 100644 --- a/modules/mod-ant-forest.js +++ b/modules/mod-ant-forest.js @@ -1,7 +1,6 @@ require('./mod-global'); let {$$disp} = require('./ext-device'); let {imagesx} = require('./ext-images'); -let {timersx} = require('./ext-timers'); let {consolex} = require('./ext-console'); let def = {}; @@ -58,7 +57,7 @@ let exp = { }, add(capt, options) { // @Overload - if (!imagesx.isImageWrapper(capt) && isPlainObject(capt)) { + if (!imagesx.isImageWrapper(capt) && isObjectSpecies(capt)) { return this.add(null, capt); } let _opt = options || {}; @@ -112,7 +111,7 @@ let exp = { // * pool?: object, // * config?: { // * forestImagePoolLimit?: number, - // * forestImagePoolItv?: number, + // * forestImagePoolInterval?: number, // * }, // * }} [options] // * @return {AntForest.EnergyBall.Result} @@ -120,7 +119,7 @@ let exp = { // findEnergyBalls(options) { // let _ = { // defaultConfig: { - // ripeBallDetectColorVal: '#DEFF00', + // ripeBallDetectColorValue: '#DEFF00', // ripeBallDetectThreshold: 13, // energyBallsRecognitionRegion: [0.1, 0.15, 0.9, 0.45], // houghSrcImageStrategy: { @@ -137,7 +136,7 @@ let exp = { // }, // minBallsDistance: 0.09, // forestImagePoolLimit: 3, - // forestImagePoolItv: 60, + // forestImagePoolInterval: 60, // homepageWaterBallMaxHueNoBlue: 47, // }, // map: { @@ -157,7 +156,7 @@ let exp = { // * @type {typeof AntForest.EnergyBall.Info.Duration.duration} // */ // duration: { - // beginning: timersx.rec.save('houghBeginning'), + // beginning: recorder.save('houghBeginning'), // }, // balls: { // /** @@ -169,7 +168,7 @@ let exp = { // * @param {AntForest.EnergyBall.Type} [type] // */ // add(o, type) { - // if (!isPlainObject(o)) { + // if (!isObjectSpecies(o)) { // throw Error(`A "data" is required for "${this.add.name}"`); // } // if (typeof o.type !== 'string') { @@ -444,14 +443,14 @@ let exp = { // // e.g.(3/3): [5, 5, 5] (length) // // @Ascend // this.dimenGroups.sort((g1, g2) => { - // let x = Math.std(g1); - // let y = Math.std(g2); + // let x = Mathx.std(g1); + // let y = Mathx.std(g2); // return x === y ? 0 : x > y ? 1 : -1; // }); // } // }, // getFirstDimenGroupMedian() { - // return Math.median(this.getFirstDimenGroup()); + // return Mathx.median(this.getFirstDimenGroup()); // }, // isSameAsLatestDimen(dimen) { // let latestDimen = this.getLatestDimen(); @@ -696,16 +695,16 @@ let exp = { // // this.pool = this.options.pool || new exp.ForestImagePool({ // limit: this.config.forestImagePoolLimit, - // interval: this.config.forestImagePoolItv, + // interval: this.config.forestImagePoolInterval, // isDebug: this.options.isDebug, // }); // }, // fillUpPool() { - // this.duration.fillUpPool = timersx.rec( + // this.duration.fillUpPool = recorder( // function fillUp$BouND() { // let max = this.pool.limit + 1; // while (max--) { - // let et = timersx.rec(this.pool.add(this.options)); + // let et = recorder(this.pool.add(this.options)); // if (this.pool.isEmpty() || this.pool.isFilledUp()) { // break; // } @@ -839,9 +838,9 @@ let exp = { // }, // getImg(name, condition, imgGenerator) { // if (condition) { - // timersx.rec.save(name); + // recorder.save(name); // let _img = imgGenerator(); - // let _et = timersx.rec(name); + // let _et = recorder(name); // _du[name] ? _du[name] = _et : _du[name] += _et; // _debug(`${_.map[name]}: ${_et}ms`); // return _img; @@ -856,7 +855,7 @@ let exp = { // $.debug(`${_.map[name]}: discarded`); // return []; // } - // timersx.rec.save(`${name}_cir`); + // recorder.save(`${name}_cir`); // let _results = images // .findCircles(img, { // dp: 1, @@ -893,7 +892,7 @@ let exp = { // // _debug(_.map[name] + ':' + ' ' // + _results.length + 'cir in' + ' ' - // + timersx.rec(name + '_cir') + 'ms'); + // + recorder(name + '_cir') + 'ms'); // // return _results; // }, @@ -945,7 +944,7 @@ let exp = { // $p.addBalls(); // // let _proc_key = 'imgSamplesProcessing'; - // timersx.rec.save(_proc_key); + // recorder.save(_proc_key); // // /** @type {AntForest.EnergyBall.Basic[]} */ // let _wballs = []; @@ -970,7 +969,7 @@ let exp = { // addBallsBAK(); // } // - // _du[_proc_key] = timersx.rec(_proc_key); + // _du[_proc_key] = recorder(_proc_key); // }, // cleanUp() { // if (typeof this.options.pool === 'object') { @@ -992,7 +991,7 @@ let exp = { // ], // fillUpPool: _du.fillUpPool, // imgSamplesProcessing: _du.imgSamplesProcessing, - // total: timersx.rec('houghBeginning'), + // total: recorder('houghBeginning'), // debug() { // _debug.__(); // _debug('图像填池: ' + this.fillUpPool + 'ms ' + [ @@ -1042,7 +1041,7 @@ let exp = { // return $.getResult(); // }, findEnergyBalls(options) { - timersx.rec.save('hough_beginning'); + recorder.save('hough_beginning'); let _opt = options || {}; let _debug = consolex.debug.fuel(_opt); @@ -1096,7 +1095,7 @@ let exp = { ], fill_up_pool: _du.fill_up_pool, img_samples_processing: _du.img_samples_processing, - total: timersx.rec('hough_beginning'), + total: recorder('hough_beginning'), debug() { _debug.__(); _debug('图像填池: ' + this.fill_up_pool + 'ms\x20\x20' + [ @@ -1227,17 +1226,17 @@ let exp = { } function _fillUpForestImgPool() { - timersx.rec.save('fill_up_pool'); + recorder.save('fill_up_pool'); let _max = _pool.limit + 1; while (_max--) { - timersx.rec.save('forest_pool_add'); + recorder.save('forest_pool_add'); _pool.add(options); if (!_pool.len || _pool.filled_up) { break; } - sleep(_pool.interval - timersx.rec('forest_pool_add')); + sleep(_pool.interval - recorder('forest_pool_add')); } - _du.fill_up_pool = timersx.rec('fill_up_pool'); + _du.fill_up_pool = recorder('fill_up_pool'); } function _analyseEnergyBalls() { @@ -1283,7 +1282,7 @@ let exp = { } let _proc_key = 'img_samples_processing'; - timersx.rec.save(_proc_key); + recorder.save(_proc_key); /** @type {Imagesx.EnergyBall.BasicProp[]} */ let _wballs = []; @@ -1313,7 +1312,7 @@ let exp = { _addBalls(); } - _du[_proc_key] = timersx.rec(_proc_key); + _du[_proc_key] = recorder(_proc_key); _debug.__(); @@ -1321,9 +1320,9 @@ let exp = { function _getImg(name, condition, imgGenerator) { if (condition) { - timersx.rec.save(name); + recorder.save(name); let _img = imgGenerator(); - let _et = timersx.rec(name); + let _et = recorder(name); _du[name] ? _du[name] = _et : _du[name] += _et; _debug(_stg_name_map[name] + ':\x20' + _et + 'ms'); return _img; @@ -1428,12 +1427,12 @@ let exp = { } if (_a.length > 1) { _a.sort((o1, o2) => { - let _a = Math.std(o1); - let _b = Math.std(o2); + let _a = Mathx.std(o1); + let _b = Mathx.std(o2); return _a === _b ? 0 : _a > _b ? 1 : -1; }); } - return Math.median(_a[0]); + return Mathx.median(_a[0]); } } @@ -1615,7 +1614,7 @@ let exp = { _debug(_stg_name_map[name] + ': discarded'); return []; } - timersx.rec.save(name + '_cir'); + recorder.save(name + '_cir'); let _results = images .findCircles(img, { dp: 1, @@ -1631,7 +1630,7 @@ let exp = { // yet x and y are absolute let _x = Number(o.x + _l); let _y = Number(o.y + _t); - let _r = o.radius.toFixedNum(2); + let _r = Numberx.toFixedNum(o.radius, 2); let _d = _r * 2; let _clip = images.clip(capt, _x - _r, _y - _r, _d, _d); let _mean = imagesx.getMean(_clip); @@ -1650,7 +1649,7 @@ let exp = { .sort(_sortX); imagesx.reclaim(img); - let _et = timersx.rec(name + '_cir'); + let _et = recorder(name + '_cir'); _debug(_stg_name_map[name] + ':\x20' + _results.length + 'cir in\x20' + _et + 'ms'); return _results; @@ -1728,10 +1727,10 @@ let exp = { // /** // * @param {AntForest.EnergyBall.Property} ball // * @param {{ - // * capt?: ImageWrapper$, + // * capt?: org.autojs.autojs.core.image.ImageWrapper$, // * isDebug?: boolean, // * config?: { - // * ripeBallDetectColorVal: Color$, + // * ripeBallDetectColorValue: Color$, // * ripeBallDetectThreshold: number, // * }, // * }} options @@ -1755,7 +1754,7 @@ let exp = { // parseArgs() { // this.capt = this.options.capt || imagesx.capt({isDebug: this.options.isDebug}); // this.config = this.options.config || {}; - // this.color = this.config.ripeBallDetectColorVal; + // this.color = this.config.ripeBallDetectColorValue; // }, // findColor() { // return imagesx.findColor(this.capt, this.color, { @@ -1770,7 +1769,7 @@ let exp = { // /** // * @param {AntForest.EnergyBall.Property} ball // * @param {{ - // * capt?: ImageWrapper$, + // * capt?: org.autojs.autojs.core.image.ImageWrapper$, // * isDebug?: boolean, // * config?: { // * homepageWaterBallMaxHueNoBlue?: number, @@ -1884,7 +1883,7 @@ let exp = { }, parseArgs() { this.tree = _.config.treeArea; - this.distPts = Math.dist(ball, this.tree); + this.distPts = Mathx.dist(ball, this.tree); this.distMax = ball.r + this.tree.r; }, }; diff --git a/modules/mod-autojs.js b/modules/mod-autojs.js index 505585d..b4210fe 100644 --- a/modules/mod-autojs.js +++ b/modules/mod-autojs.js @@ -6,54 +6,6 @@ let {consolex} = require('./ext-console'); /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ let exp = { - /** - * @return {boolean} - */ - isPro() { - return (this.isPro = () => /Pro\b/i.test(this.getPackageName()))(); - }, - /** - * @example - * console.log(autojs.getName()); // like: 'Auto.js' - * @return {string} - */ - getAppName() { - return 'Auto.js' + (this.isPro() ? ' Pro' : ''); - }, - /** - * @example - * console.log(appx.getAutoJsPkg()); // like: 'org.autojs.autojs' - * @return {string} - */ - getPackageName() { - return context.getPackageName(); - }, - /** - * @example - * console.log(appx.getAutoJsVer()); // e.g. '4.1.1 Alpha2' - * @return {?string} - */ - getVerName() { - // Pro version(s) (e.g. 8.8.16-0) returns abnormal value like '${xxx.xxx}' - let _ver = app.autojs.versionName; - return String(_ver).match(/^\d/) ? _ver : appx.getVerName('Auto.js'); - }, - getVerCode() { - return app.autojs.versionCode; - }, - /** - * @param {string|number} ver - * @example - * console.log(autojs.isVerNewer(7)); // e.g. false - * console.log(autojs.isVerNewer('4.1.0')); // e.g. true - * console.log(autojs.isVerNewer('4.1.1 alpha')); // e.g. true - * console.log(autojs.isVerNewer('4.1.1 a2')); // e.g. false - * console.log(autojs.isVerNewer('8.9.6 beta')); // e.g. false - * @return {boolean} - */ - isVerNewer(ver) { - return appx.version.isNewer(this.getVerName(), ver); - }, /** * Check if device is running compatible Auto.js version */ @@ -61,8 +13,8 @@ let exp = { let _ = { VERSION_UNKNOWN: -1, VERSION_NORMAL: 0, - bug_map: { - not_aj6: '项目自 v2.3.0 起将仅支持 Auto.js 6.x 版本\n' + + bugMap: { + notAutoJs6: '项目自 v2.3.0 起将仅支持 Auto.js 6.x 版本\n' + '因项目运行依赖于 Rhino 引擎的部分新特性及 AutoJs6 的部分自定义模块', }, /** @@ -77,7 +29,7 @@ let exp = { if (!ver.match(/^(Pro )?\d+\.\d+\.\d+.*$/)) { return this.VERSION_UNKNOWN; } - return ['not_aj6']; + return ['notAutoJs6']; }, alert(msg) { alert(msg); @@ -179,17 +131,17 @@ let exp = { let msg = ['脚本可能无法正常运行', '需更换 Auto.js 版本', '', '软件版本:', ver, '', - '异常详情:' + diagnosis.map(s => '\n' + this.bug_map[s]).join(''), '', + '异常详情:' + diagnosis.map(s => '\n' + this.bugMap[s]).join(''), '', '在项目简介中查看支持版本', ].join('\n'); - exp.isVerNewer('v4.1.0') ? this.dialog(msg) : this.alert(msg); + appx.version.isNewer(autojs.versionName, 'v4.1.0') ? this.dialog(msg) : this.alert(msg); }, }; let $ = { parseArgs() { - this.version = exp.getVerName() || '未知版本'; + this.version = app.autojs.versionName; this.diagnosis = _.diagnose(this.version); }, bugTrigger() { diff --git a/modules/mod-database.js b/modules/mod-database.js index a36d484..5235885 100644 --- a/modules/mod-database.js +++ b/modules/mod-database.js @@ -35,7 +35,7 @@ let SQLiteDBx = function SQLiteDBxConstructor$iiFe() { this.table_name = info.table_name; this.table_columns = info.table_columns; - this.alter_type = info.alter_type; + this.alterType = info.alterType; this.database = SQLiteDatabase.openOrCreateDatabase(this.path, null); this.createTableIFN(); @@ -70,8 +70,8 @@ let SQLiteDBx = function SQLiteDBxConstructor$iiFe() { } }, alterIFN() { - if (typeof this.alter_type === 'string') { - this.alter(this.alter_type); + if (typeof this.alterType === 'string') { + this.alter(this.alterType); } }, getPath() { @@ -320,7 +320,7 @@ let exp = { return new SQLiteDBx({ table_name: _opt.table_name || 'ant_forest', table_columns: this._parseTableColumns(table_columns), - alter_type: _opt.alter_type, + alterType: _opt.alterType, path: _opt.database_path ? files.path(_opt.database_path) : files.join(files.getSdcardPath(), '.local', 'ant_forest.db'), diff --git a/modules/mod-global.js b/modules/mod-global.js index a2b822e..c289271 100644 --- a/modules/mod-global.js +++ b/modules/mod-global.js @@ -1,9 +1,6 @@ /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ -let Looper = android.os.Looper; -let Toast = android.widget.Toast; -let Runnable = java.lang.Runnable; let GZIPInputStream = java.util.zip.GZIPInputStream; let ByteArrayInputStream = java.io.ByteArrayInputStream; let ByteArrayOutputStream = java.io.ByteArrayOutputStream; @@ -238,7 +235,7 @@ let ext = { if (Array.isArray(o)) { return o.length; } - if (!isPlainObject(o)) { + if (!isObjectSpecies(o)) { return -1; } let _arrayify = o => Array.isArray(o) ? o : o === undefined ? [] : [o]; @@ -334,7 +331,7 @@ let ext = { * @return {T} */ value(o) { - return isPlainObject(o) + return isObjectSpecies(o) ? Object.create(Object.getPrototypeOf(o), Object.getOwnPropertyDescriptors(o)) : Array.isArray(o) ? o.slice() : o; }, @@ -348,7 +345,7 @@ let ext = { * @return {T} */ value: function clone(o) { - if (isPlainObject(o)) { + if (isObjectSpecies(o)) { let _tmp = {}; Object.getOwnPropertyNames(o).forEach((k) => { let _des = Object.getOwnPropertyDescriptor(o, k); @@ -371,7 +368,7 @@ let ext = { * @return {boolean} */ value: function isEqual(a, b) { - if (isPlainObject(a) && isPlainObject(b)) { + if (isObjectSpecies(a) && isObjectSpecies(b)) { let _pna = Object.getOwnPropertyNames(a); let _pnb = Object.getOwnPropertyNames(b); return _pna.length === _pnb.length @@ -381,6 +378,9 @@ let ext = { return a.length === b.length && a.every((e, i) => isEqual(e, b[i])); } + if (Number.isNaN(a)) { + return Number.isNaN(b); + } return a === b; }, }); @@ -394,7 +394,7 @@ let ext = { */ value: function ensure(o, k, def) { if (!Array.isArray(k)) { - if (!isPlainObject(o)) { + if (!isObjectSpecies(o)) { throw Error('Param "o" must be a plain object'); } if (typeof k === 'undefined') { @@ -445,476 +445,6 @@ let ext = { }); } }, - number() { - if (!Number.prototype.ICU) { - Object.defineProperty(Number.prototype, 'ICU', { - value: (function $iiFe() { - let _workdays = 5; - let _weekends = 2; - let _health = '[your health]'; - let _evil = 'Hard working only' - .split(new RegExp(_health)) - .map(x => x ? x.charCodeAt(0) : 996 / _workdays / _weekends - _weekends) - .reduce((x, y) => x + y); - return Math.round(_evil); - })(), - }); - } - if (!Number.prototype.clamp) { - Object.defineProperty(Number.prototype, 'clamp', { - /** - * @param {...number|*} [args] - * @return {number} - */ - value(args) { - let _num = this.valueOf(); - let _args = (!Array.isArray(args) ? [].slice.call(arguments) : args) - .map(x => Number(x)).filter(x => !isNaN(x)) - .sort((x, y) => x === y ? 0 : x > y ? 1 : -1); - let _len = _args.length; - if (_len) { - let _min = _args[0]; - let _max = _args[_len - 1]; - if (_num < _min) { - return _min; - } - if (_num > _max) { - return _max; - } - } - return _num; - }, - }); - } - if (!Number.prototype.toFixedNum) { - Object.defineProperty(Number.prototype, 'toFixedNum', { - /** - * @param {number} [fraction=0] - * @return {number} - */ - value(fraction) { - return Number(this.toFixed(fraction)); - }, - }); - } - if (!Number.prototype.padStart) { - if (String.prototype.padStart) { - /** - * @param {number} target_len - * @param {string|number} [pad_str=' '] - * @return {string} - */ - Object.defineProperty(Number.prototype, 'padStart', { - value(target_len, pad_str) { - let _this = this.toString(); - return _this.padStart.call(_this, target_len, pad_str || 0); - }, - }); - } - } - if (!Number.prototype.padEnd) { - if (String.prototype.padEnd) { - /** - * @param {number} target_len - * @param {string|number} [pad_str=' '] - * @return {string} - */ - Object.defineProperty(Number.prototype, 'padEnd', { - value(target_len, pad_str) { - let _this = this.toString(); - return _this.padEnd.call(_this, target_len, pad_str || 0); - }, - }); - } - } - if (!Number.parsePercent) { - Object.defineProperty(Number, 'parsePercent', { - /** - * @param {Percentage$} percent - * @return {number} - */ - value(percent) { - if (typeof percent === 'string') { - let _mch = percent.replace(/\s*/g, '').match(/^(\d+(?:\.\d+)?)(%+)$/); - if (_mch) { - let _res = Number(_mch[1]); - for (let i = 0, max = _mch[2].length; i < max; i += 1) { - _res /= 100; - } - return _res; - } - } - return NaN; - }, - }); - } - }, - math() { - let $ = { - parseArgs(num_arr, fraction) { - let _arr, _fraction; - if (Array.isArray(num_arr)) { - _arr = this.spreadArr(num_arr); - _fraction = fraction; - } else { - _arr = this.spreadArr(arguments); - } - return [_arr, _fraction]; - }, - spreadArr(arr) { - let _plain = []; - let _len = (arr || []).length; - for (let i = 0; i < _len; i += 1) { - let _e = arr[i]; - Array.isArray(_e) - ? _plain = _plain.concat(this.spreadArr(_e)) - : _plain.push(_e); - } - return _plain; - }, - }; - - if (!Math.rand) { - Object.defineProperty(Math, 'rand', { - /** - * @param {number[]|number} [range=[0,1]] - * @param {number} [fraction] - * @return {number} - */ - value(range, fraction) { - let _min, _max; - let _gap = () => _max - _min; - - if (!Array.isArray(range)) { - range = [0, range || 1]; - } - range = range - .map(x => typeof x === 'number' && !isFinite(x) && !isNaN(x) - ? Object.is(0 / x, 0) - ? Number.MAX_SAFE_INTEGER - : Number.MIN_SAFE_INTEGER - : +x) - .filter(x => !isNaN(x)) - .sort((a, b) => a === b ? 0 : a > b ? 1 : -1); - _min = range[0]; - _max = range[range.length - 1]; - - let _rand = Math.random() * _gap() + _min; - if (typeof fraction === 'undefined') { - return _rand; - } - if (Object.is(fraction, -0)) { - return Math.floor(_rand); - } - return +_rand.toFixed(+fraction || 0); - }, - }); - } - if (!Math.sum) { - Object.defineProperty(Math, 'sum', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let [_arr, _frac] = $.parseArgs.apply($, arguments); - if (!_arr.length) { - return 0; - } - let _sum = _arr.reduce((a, b) => { - let [_a, _b] = [+a, +b].map(x => isNaN(x) ? 0 : x); - return _a + _b; - }); - let _frac_num = parseInt(_frac); - return isNaN(_frac_num) ? _sum : +_sum.toFixed(_frac_num); - }, - }); - } - if (!Math.avg) { - Object.defineProperty(Math, 'avg', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let [_arr, _frac] = $.parseArgs.apply($, arguments); - let _filtered = _arr.filter(x => !isNaN(+x)); - if (!_filtered.length) { - return NaN; - } - let _sum = _filtered.reduce((a, b) => +a + +b); - let _avg = _sum / _filtered.length; - let _frac_num = parseInt(_frac); - return isNaN(_frac_num) ? _avg : +_avg.toFixed(_frac_num); - }, - }); - } - if (!Math.median) { - Object.defineProperty(Math, 'median', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let [_arr, _frac] = $.parseArgs.apply($, arguments); - let _filtered = _arr.filter(x => !isNaN(+x)); - if (!_filtered.length) { - return NaN; - } - _filtered.sort((a, b) => { - let _a = Number(a); - let _b = Number(b); - return _a === _b ? 0 : _a > b ? 1 : -1; - }); - let _len = _filtered.length; - let _med = _len % 2 - ? _filtered[Math.floor(_len / 2)] - : (_filtered[_len / 2 - 1] + _filtered[_len / 2]) / 2; - let _frac_num = parseInt(_frac); - return isNaN(_frac_num) ? _med : +_med.toFixed(_frac_num); - }, - }); - } - if (!Math.var) { - Object.defineProperty(Math, 'var', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let [_arr, _frac] = $.parseArgs.apply($, arguments); - if (!_arr.length) { - return NaN; - } - let _filtered = _arr.filter(x => !isNaN(+x)); - let _avg = Math.avg(_filtered); - let _len = _filtered.length; - - let _acc = 0; - for (let i = 0; i < _len; i += 1) { - _acc += Math.pow((_filtered[i] - _avg), 2); - } - let _var = _acc / _len; - let _frac_num = parseInt(_frac); - return isNaN(_frac_num) ? _var : +_var.toFixed(_frac_num); - }, - }); - } - if (!Math.std) { - Object.defineProperty(Math, 'std', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let [_arr, _frac] = $.parseArgs.apply($, arguments); - if (!_arr.length) { - return NaN; - } - let _filtered = _arr.filter(x => !isNaN(+x)); - let _std = Math.sqrt(Math.var(_filtered)); - let _frac_num = parseInt(_frac); - return isNaN(_frac_num) ? _std : +_std.toFixed(_frac_num); - }, - }); - } - if (!Math.cv) { - Object.defineProperty(Math, 'cv', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let [_arr, _frac] = $.parseArgs.apply($, arguments); - let _filtered = _arr.filter(x => !isNaN(+x)); - let _len = _filtered.length; - if (_len < 2) { - return NaN; - } - - let _avg = Math.avg(_filtered); - let _acc = 0; - for (let i = 0; i < _len; i += 1) { - _acc += Math.pow((_filtered[i] - _avg), 2); - } - /** - * Sample Standard Deviation (zh-CN: 样本标准差) - * @type {number} - */ - let _std_smp = Math.pow(_acc / (_len - 1), 0.5); - let _cv = _std_smp / _avg; - let _frac_num = parseInt(_frac); - return isNaN(_frac_num) ? _cv : +_cv.toFixed(_frac_num); - }, - }); - } - if (!Math.maxi) { - Object.defineProperty(Math, 'maxi', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let _arr, _fraction; - - if (Array.isArray(num)) { - _arr = $.spreadArr(num); - _fraction = fraction; - } else { - _arr = $.spreadArr(arguments); - } - - let _filtered = _arr.filter(x => !isNaN(+x)); - let _max = Math.max.apply(null, _filtered); - let _frac = parseInt(_fraction); - return isNaN(_frac) ? _max : +_max.toFixed(_frac); - }, - }); - } - if (!Math.mini) { - Object.defineProperty(Math, 'mini', { - /** - * @param {number|number[]} [num] - * @param {?number} [fraction] - * @return {number} - */ - value(num, fraction) { - let _arr, _fraction; - - if (Array.isArray(num)) { - _arr = $.spreadArr(num); - _fraction = fraction; - } else { - _arr = $.spreadArr(arguments); - } - - let _filtered = _arr.filter(x => !isNaN(+x)); - let _min = Math.min.apply(null, _filtered); - let _frac = parseInt(_fraction); - return isNaN(_frac) ? _min : +_min.toFixed(_frac); - }, - }); - } - if (!Math.dist) { - Object.defineProperty(Math, 'dist', { - /** - * @param {number[]|{x:number,y:number}} point1 - * @param {number[]|{x:number,y:number}} point2 - * @return {number} - */ - value(point1, point2) { - if (Array.isArray(point1) && Array.isArray(point2)) { - let _a = Math.pow(point2[0] - point1[0], 2); - let _b = Math.pow(point2[1] - point1[1], 2); - return Math.sqrt(_a + _b); - } - if (isPlainObject(point1) && isPlainObject(point2)) { - let _a = Math.pow(point2.x - point1.x, 2); - let _b = Math.pow(point2.y - point1.y, 2); - return Math.sqrt(_a + _b); - } - return NaN; - }, - }); - } - if (!Math.logMn) { - Object.defineProperty(Math, 'logMn', { - /** - * @param {number} base - * @param {number} antilogarithm - * @param {number} [fraction=13] - * @return {number} - */ - value(base, antilogarithm, fraction) { - let _frac = typeof fraction === 'number' ? fraction : 13; - let _result = Math.log(antilogarithm) / Math.log(base); - if (isNaN(_result) || !isFinite(_result) || _frac !== -1) { - return _result; - } - return Number(_result.toFixed(_frac)); - }, - }); - } - if (!Math.floorLog) { - Object.defineProperty(Math, 'floorLog', { - /** - * @param {number} base - * @param {number} antilogarithm - * @return {number} - */ - value(base, antilogarithm) { - return Math.floor(this.logMn(base, antilogarithm)); - }, - }); - } - if (!Math.ceilLog) { - Object.defineProperty(Math, 'ceilLog', { - /** - * @param {number} base - * @param {number} antilogarithm - * @return {number} - */ - value(base, antilogarithm) { - return Math.ceil(this.logMn(base, antilogarithm)); - }, - }); - } - if (!Math.roundLog) { - Object.defineProperty(Math, 'roundLog', { - /** - * @param {number} base - * @param {number} antilogarithm - * @return {number} - */ - value(base, antilogarithm) { - return Math.round(this.logMn(base, antilogarithm)); - }, - }); - } - if (!Math.floorPow) { - Object.defineProperty(Math, 'floorPow', { - /** - * @param {number} base - * @param {number} power - * @return {number} - */ - value(base, power) { - return Math.pow(base, this.floorLog(base, power)); - }, - }); - } - if (!Math.ceilPow) { - Object.defineProperty(Math, 'ceilPow', { - /** - * @param {number} base - * @param {number} power - * @return {number} - */ - value(base, power) { - return Math.pow(base, this.ceilLog(base, power)); - }, - }); - } - if (!Math.roundPow) { - Object.defineProperty(Math, 'roundPow', { - /** - * @param {number} base - * @param {number} power - * @return {number} - */ - value(base, power) { - return Math.pow(base, this.roundLog(base, power)); - }, - }); - } - }, }; /** @@ -929,7 +459,7 @@ module.exports = { $$bigint: x => typeof x === 'bigint', $$func: f => typeof f === 'function', $$arr: o => Array.isArray(o), - $$obj: o => isPlainObject(o), + $$obj: o => isObjectSpecies(o), $$rex: o => o instanceof RegExp, $$xml: o => /^xml$/.test(typeof o), $$T: o => o === true, @@ -994,18 +524,18 @@ module.exports = { return true; }, isEmptyObject(o) { - return isPlainObject(o) + return isObjectSpecies(o) && Object.keys(Object.getOwnPropertyDescriptors(o)).length === 0; }, isNonEmptyObject(o) { - return isPlainObject(o) + return isObjectSpecies(o) && Object.keys(Object.getOwnPropertyDescriptors(o)).length > 0; }, isNormalFunction(f) { - return typeof f === 'function' && isPlainObject(f.prototype); + return typeof f === 'function' && isObjectSpecies(f.prototype); }, isArrowFunction(f) { - return typeof f === 'function' && !isPlainObject(f.prototype); + return typeof f === 'function' && !isObjectSpecies(f.prototype); }, isXMLType(o) { return /^xml$/.test(typeof o); diff --git a/modules/mod-project.js b/modules/mod-project.js index d7a5e9a..affd484 100644 --- a/modules/mod-project.js +++ b/modules/mod-project.js @@ -4,7 +4,6 @@ let { let {appx} = require('./ext-app'); let {httpx} = require('./ext-http'); let {filesx} = require('./ext-files'); -let {threadsx} = require('./ext-threads'); let {dialogsx} = require('./ext-dialogs'); let {storagesx} = require('./ext-storages'); @@ -38,8 +37,8 @@ let _ = { ], get ignore_list() { return this._ignore_list = this._ignore_list - || storagesx.af.get('update_ignore_list') - || storagesx['@default'].af.update_ignore_list; + || storagesx.af.get('updateIgnoreList') + || storagesx['@default'].af.updateIgnoreList; }, }; @@ -91,6 +90,9 @@ let exp = { * }} */ getLocal() { + if (typeof global._$_cached_local_project_ === 'object') { + return global._$_cached_local_project_; + } let _ver_name = ''; let _ver_code = -1; let _path = this.getLocalPath(); @@ -110,7 +112,7 @@ let exp = { if (files.exists(_json_path)) { try { let _o = JSON.parse(filesx.read(_json_path, '{}')); - return Object.assign(_res, { + return global._$_cached_local_project_ = Object.assign(_res, { version_name: 'v' + _o.versionName, version_code: Number(_o.versionCode), main: {name: _o.main, path: files.join(_path, _o.main)}, @@ -122,7 +124,7 @@ let exp = { } if (files.exists(_main_path)) { try { - return Object.assign(_res, { + return global._$_cached_local_project_ = Object.assign(_res, { version_name: 'v' + filesx.read(_main_path) .match(/version (\d+\.?)+( ?(Alpha|Beta)(\d+)?)?/)[0].slice(8), }); @@ -132,7 +134,7 @@ let exp = { } } console.warn('Both ' + _json_name + ' and ' + _main_name + ' do not exist'); - return _res; + return global._$_cached_local_project_ = _res; }, /** * @param {boolean} [is_with_creation=false] @@ -192,7 +194,7 @@ let exp = { if (typeof callback !== 'function') { return _getReleases(); } - threadsx.start(() => callback(_getReleases())); + threads.start(() => callback(_getReleases())); // tool function(s) // @@ -307,7 +309,7 @@ let exp = { if (typeof callback !== 'function') { return _getRelease(); } - threadsx.start(() => callback(_getRelease())); + threads.start(() => callback(_getRelease())); }, /** * @param {Object} [options] @@ -330,7 +332,7 @@ let exp = { if (typeof callback !== 'function') { return _getRelease(); } - threadsx.start(() => callback(_getRelease())); + threads.start(() => callback(_getRelease())); }, /** * @param {'1.x'|'2.x'|string|number} ver @@ -372,7 +374,7 @@ let exp = { .on('positive', dialogsx.dismiss) .show(); - threadsx.start(_getLog); + threads.start(_getLog); // tool function(s) // @@ -427,15 +429,14 @@ let exp = { function _getContentByBlob() { let _max = 5; - let _url = 'https://cdn.jsdelivr.net/gh/SuperMonster003/Ant-Forest@master' + - '/assets/docs/CHANGELOG-' + _ver_num + '.md'; + let _url = `https://github.com/SuperMonster003/Ant-Forest/blob/master/assets/docs/CHANGELOG-${_ver_num}.md`; while (_max--) { try { return httpx.okhttp3Request(_url, { onDownloadFailure(e) { _max || _onFailure('请求失败: ' + e); }, - }, {is_async: false}); + }, {isAsync: false}); } catch (e) { _onFailure(e.message); } @@ -619,7 +620,7 @@ let exp = { onDownloadFailure(e) { reject(e); }, - }, {is_async: true, path: _full_path}); + }, {isAsync: true, path: _full_path}); }), }, { desc: _steps.decompress, @@ -668,7 +669,7 @@ let exp = { }, { desc: _steps.finish_deploy, action: (v, d) => new Promise((resolve, reject) => { - filesx.deleteByList(v.unzipped_files_path, {is_async: true}, { + filesx.deleteByList(v.unzipped_files_path, {isAsync: true}, { onDeleteProgress: o => d.setProgressData(o), onDeleteSuccess: () => resolve({target_path: v.tar_proj_path}), onDeleteFailure: e => reject(e), @@ -894,7 +895,7 @@ let exp = { onDownloadFailure(e) { reject(e); }, - }, {is_async: true, path: _full_path}); + }, {isAsync: true, path: _full_path}); }), }, }, @@ -956,7 +957,7 @@ let exp = { }, { desc: _steps.finish_restore, action: (v, d) => new Promise((resolve, reject) => { - filesx.deleteByList(v.unzipped_files_path, {is_async: true}, { + filesx.deleteByList(v.unzipped_files_path, {isAsync: true}, { onStart: () => _mode === 'server' && files.remove(v.zip_src_file), onProgress: o => d.setProgressData(o), onSuccess: () => resolve({target_path: v.tar_proj_path}), diff --git a/modules/plugin-ant-forest-deployment.js b/modules/plugin-ant-forest-deployment.js index 88ad239..4991cb6 100644 --- a/modules/plugin-ant-forest-deployment.js +++ b/modules/plugin-ant-forest-deployment.js @@ -1,6 +1,5 @@ require('./mod-global.js'); let {project} = require('./mod-project'); -let {threadsx} = require('./ext-threads'); let {dialogsx} = require('./ext-dialogs'); let _export = { @@ -93,7 +92,7 @@ function _projReleaseCbk(releases) { .on('positive', (d) => { d.dismiss(); d.getSelectedIndex() === 0 - ? threadsx.start(() => _deployVersion(_newest)) + ? threads.start(() => _deployVersion(_newest)) : dialogsx.builds([ '选择其他项目版本', '', 0, '上一步', '下一步', 1, ], { @@ -106,7 +105,7 @@ function _projReleaseCbk(releases) { }).on('positive', (ds) => { ds.dismiss(); let _idx = ds.getSelectedIndex() + 1; - threadsx.start(() => _deployVersion(releases[_idx])); + threads.start(() => _deployVersion(releases[_idx])); }).show(); }) .show(); @@ -148,7 +147,6 @@ function _deployVersion(version) { function _showStatement() { let _runNow = function () { - dialogsx.clearPool(); let _pkg = context.getPackageName(); let _startActivity = (override_class_name_prefix) => { let _cls_n_pref = override_class_name_prefix || _pkg; @@ -166,7 +164,6 @@ function _deployVersion(version) { }; let _finish = function () { - dialogsx.clearPool(); exit(); }; diff --git a/modules/plugin-ant-forest-energy-rain.js b/modules/plugin-ant-forest-energy-rain.js index 1681f1d..09f67c3 100644 --- a/modules/plugin-ant-forest-energy-rain.js +++ b/modules/plugin-ant-forest-energy-rain.js @@ -1,12 +1,11 @@ require('./mod-global'); let {uix} = require('./ext-ui'); let {alipay} = require('./mod-alipay'); -let {autojs} = require('./mod-autojs'); +let { autojs: autojsExt } = require('./mod-autojs'); let {imagesx} = require('./ext-images'); let {enginesx} = require('./ext-engines'); -let {threadsx} = require('./ext-threads'); let {consolex} = require('./ext-console'); -let {a11yx, $$sel} = require('./ext-a11y'); +let {a11yx} = require('./ext-a11y'); let {devicex, $$disp} = require('./ext-device'); let _ = { @@ -21,20 +20,20 @@ let _ = { }(), }, sel: { - entrance: [/.*开[始启].*/, 'k2', {isCenterX: true}], - bonus: ['再来一次', {c$: true, isCenterX: true}], - manual: [/送TA机会|更多好友/, 'k2', {c$: true}], - result: [/恭喜获得|今日累计获取/, {isCenterX: true}], - finish: [/恭喜获得|今日累计获取/, {isCenterX: true}], - retry: ['立即重试', {c$: true}], + entrance: [/.*开[始启].*/, {screenCenterX: true}], + bonus: ['再来一次', {clickable: true, screenCenterX: true}], + manual: [/送TA机会|更多好友/, {clickable: true}], + result: [/恭喜获得|今日累计获取/, {screenCenterX: true}], + finish: [/恭喜获得|今日累计获取/, {screenCenterX: true}], + retry: ['立即重试', {clickable: true}], }, w: { cache: {}, - ent: () => _.w.cache.ent = $$sel.pickup(_.sel.entrance), - bonus: () => _.w.cache.bonus = $$sel.pickup(_.sel.bonus), - finish: () => _.w.cache.finish = $$sel.pickup(_.sel.finish), - manual: () => _.w.cache.manual = $$sel.pickup(_.sel.manual), - result: () => _.w.cache.result = $$sel.pickup(_.sel.result), + ent: () => _.w.cache.ent = pickup(_.sel.entrance, 'k2'), + bonus: () => _.w.cache.bonus = pickup(_.sel.bonus), + finish: () => _.w.cache.finish = pickup(_.sel.finish), + manual: () => _.w.cache.manual = pickup(_.sel.manual, 'k2'), + result: () => _.w.cache.result = pickup(_.sel.result), }, cond: { ent: () => _.w.ent() && !_.w.finish(), @@ -49,7 +48,7 @@ let _ = { results: [], ensureCaptPermission() { try { - if (imagesx.permit()) { + if (images.requestScreenCapture()) { return true; } } catch (e) { @@ -60,7 +59,7 @@ let _ = { exit(); }, capt() { - this.img = imagesx.capt(); + this.img = images.captureScreen(); }, findPoints() { this.pts = images.findAllPointsForColor(this.img, '#DAFF00', { @@ -97,7 +96,7 @@ let _ = { */ clickBtn(options) { let {widget, name, cond} = options || {}; - if (a11yx.click([widget, 'k2'], 'w', {condition: cond})) { + if (a11yx.click(widget.compass('k2'), 'w', {condition: cond})) { consolex._('点击' + name + '按钮成功'); return true; } @@ -107,15 +106,15 @@ let _ = { let $ = { check() { - devicex.ensureSdkInt(); - alipay.ensureAppInstalled(); - autojs.ensureVersion(); + requiresApi(util.versionCodes.N.apiLevel); + App.ALIPAY.ensureInstalled(); + autojsExt.ensureVersion(); a11yx.ensureSvcAndFunc(); devicex.checkScreenOffTimeout(); }, greet() { consolex.d('开始"能量雨"任务', 1, 0, 2); - consolex.debug.switchSet(_.cfg.isDebug); + // consolex.debug.switchSet(_.cfg.isDebug); }, launch() { alipay.startApp('af_energy_rain'); @@ -135,7 +134,7 @@ let $ = { consolex._('已匹配"额外奖励"准备条件'); return _.clickBtn({ widget: _.w.cache.bonus, - name: $$sel.pickup(_.w.cache.bonus, 'txt').surround('"'), + name: _.w.cache.bonus ?_.w.cache.bonus.content().surround('"') : 'Unknown', cond: () => !_.cond.bonus(), }) && _.ensureCaptPermission(); } @@ -189,7 +188,7 @@ let $ = { consolex._(['发送全局结束信号', '检测到预置的结束条件']); return _.flag.e_rain_finished = true; } - let _w_retry = $$sel.pickup(_.sel.retry); + let _w_retry = pickup(_.sel.retry); if (_w_retry) { a11yx.click(_w_retry, 'w'); devicex.keycode('back', {rush: true}); @@ -204,10 +203,10 @@ let $ = { consolex._(['结束"结束条件"监测线程', '检测到结束信号']); }, start() { - threadsx.start(() => { + threads.start(() => { if (this.click.firstTime()) { - threadsx.start(() => this.click.continuous()); - threadsx.start(() => this.finish()); + threads.start(() => this.click.continuous()); + threads.start(() => this.finish()); } }); }, @@ -232,14 +231,12 @@ let $ = { delete _.flag.e_rain_finished; }, statistics() { - a11yx.wait(() => _.cond.result(), 5e3, 80, { + wait(() => _.cond.result(), 5e3, 80, { then(res) { // @LegacyBackup as of Oct 22, 2021 - // let _mch = $$sel.pickup(res, 'txt').match(/\d+/); + // let _mch = res.content().match(/\d+/); - let _mch = $$sel.traverse([res, 'p2'], (w) => { - return $$sel.pickup(w, 'txt').match(/\s*\+?\d+g\s*/); - }, 'txt').match(/\d+/); + let _mch = pickup(res.compass('p2'), {filter: w => /\s*\+?\d+g\s*/.test(w.content())}, 'txt').match(/\d+/); if (_mch) { consolex._('统计数据池存入新数据: ' + _mch); _.results.push(Number(_mch)); @@ -258,10 +255,11 @@ let $ = { let _name_extra_bonus = '额外奖励'; let _bonus_triggerred = '检测到' + _name_extra_bonus + '条件'; let _bonus_not_triggerred = '未' + _bonus_triggerred; + a11yx.wait(() => _.cond.bonus() || _.cond.manual(), .8e3, 80); if (_.cond.bonus()) { let _w = _.w.cache.bonus; consolex._(_bonus_triggerred + ':'); - consolex._($$sel.pickup(_w, 'txt')); + consolex._(_w.content()); return _.clickBtn({ widget: _w, name: _name_extra_bonus, diff --git a/modules/plugin-ant-forest-on-screen-off-launcher.js b/modules/plugin-ant-forest-on-screen-off-launcher.js index 6509c4a..eead5e8 100644 --- a/modules/plugin-ant-forest-on-screen-off-launcher.js +++ b/modules/plugin-ant-forest-on-screen-off-launcher.js @@ -1,12 +1,9 @@ -let {timersx} = require('./ext-timers'); let {project} = require('./mod-project'); let {consolex} = require('./ext-console'); /* Here, importClass() is not recommended for intelligent code completion in IDE like WebStorm. */ /* The same is true of destructuring assignment syntax (like `let {Uri} = android.net`). */ -let App = org.autojs.autojs.App; - let cfg = { action: 'android.intent.action.SCREEN_OFF', path: project.getLocal().main.path, @@ -21,10 +18,10 @@ let $ = { addIntentTask(config) { Object.assign(cfg, config); - timersx.addIntentTask({ + tasks.addIntentTask({ action: cfg.action, path: files.join(project.getLocalPath(), 'modules', this.file_name), - is_async: true, + isAsync: true, callback(task) { consolex._([ 'Intent task added successfully', @@ -39,10 +36,10 @@ let $ = { }); }, removeAllTasks() { - let _tasks = timersx.queryIntentTasks({ + let _tasks = tasks.queryIntentTasks({ action: cfg.action, }); - _tasks.forEach(task => timersx.removeTask(task)); + _tasks.forEach(task => tasks.removeTask(task)); consolex._([ 'All intent tasks removed', @@ -52,7 +49,7 @@ let $ = { }, unregisterAllDynamicBroadcastReceivers() { try { - App.Companion.getApp().getDynamicBroadcastReceivers().unregisterAll(); + org.autojs.autojs.App.Companion.getApp().getDynamicBroadcastReceivers().unregisterAll(); } catch (e) { // Wrapped java.lang.IllegalArgumentException: Receiver not registered... // Error above could be ignored as the functionality @@ -62,7 +59,7 @@ let $ = { } }, addDisposableTask() { - timersx.addDisposableTask({ + tasks.addDisposableTask({ date: Date.now() + cfg.delay, path: cfg.path, }); diff --git a/modules/plugin-autojs-memory-info.js b/modules/plugin-autojs-memory-info.js index d552441..cdaed8f 100644 --- a/modules/plugin-autojs-memory-info.js +++ b/modules/plugin-autojs-memory-info.js @@ -1,7 +1,6 @@ let {$$cvt} = require('./mod-global'); let {appx} = require('./ext-app'); let {uix} = require('./ext-ui'); -let {colorsx} = require('./ext-colors'); let {dialogsx} = require('./ext-dialogs'); uix.registerWidget('mem-info-text', { @@ -103,7 +102,7 @@ _view['btn_restart_process'].on('click', function () { ['about_process_restart', '#E1F5FE'], 0, 0, ['B', '#A5D6A7'], 1, ], { - background: colorsx.hrgba('#00005139'), + background: colors.rgba('#00005139'), animation: 'input_method', dim_amount: 85, }).on('positive', (ds) => { @@ -115,7 +114,7 @@ _view['btn_restart_process'].on('click', function () { }).on('positive', (d) => { dialogsx.setContentText(d, '正在重启进程...'); dialogsx.setActionButton(d, ['neutral', 'negative', 'positive'], null); - appx.killProcess({pending_task: 'current+2s', is_async: true}); + appx.killProcess({pending_task: 'current+2s', isAsync: true}); }).show(); }); @@ -124,7 +123,7 @@ _view['btn_help'].on('click', function () { ['about_memory_info', '#E1F5FE'], 0, 0, ['B', '#A5D6A7'], 1, ], { - background: colorsx.hrgba('#00005139'), + background: colors.rgba('#00005139'), animation: 'input_method', dim_amount: 85, }).on('positive', d => d.dismiss()).show(); @@ -201,23 +200,23 @@ function _getConfigFromPreset(pct) { let preset = [{ threshold: 0.9, sentiment: 'very_dissatisfied', - tint: {icon: '#8E24AA', text: colorsx.hrgba('#EA80FCDD')}, + tint: {icon: '#8E24AA', text: colors.rgba('#EA80FCDD')}, }, { threshold: 0.8, sentiment: 'dissatisfied', - tint: {icon: '#BF360C', text: colorsx.hrgba('#E57373DD')}, + tint: {icon: '#BF360C', text: colors.rgba('#E57373DD')}, }, { threshold: 0.6, sentiment: 'neutral', - tint: {icon: '#F9A825', text: colorsx.hrgba('#FFF176DD')}, + tint: {icon: '#F9A825', text: colors.rgba('#FFF176DD')}, }, { threshold: 0.3, sentiment: 'satisfied', - tint: {icon: '#558B2F', text: colorsx.hrgba('#B3E5FCDD')}, + tint: {icon: '#558B2F', text: colors.rgba('#B3E5FCDD')}, }, { threshold: 0, sentiment: 'very_satisfied', - tint: {icon: '#039BE5', text: colorsx.hrgba('#B3E5FCDD')}, + tint: {icon: '#039BE5', text: colors.rgba('#B3E5FCDD')}, }]; return (_getConfigFromPreset = function (pct) { diff --git a/modules/plugin-device-next-alarm-clock.js b/modules/plugin-device-next-alarm-clock.js index bb7ff6c..7ca0a9b 100644 --- a/modules/plugin-device-next-alarm-clock.js +++ b/modules/plugin-device-next-alarm-clock.js @@ -1,9 +1,7 @@ require('./mod-global'); let {uix} = require('./ext-ui'); -let {colorsx} = require('./ext-colors'); let {devicex} = require('./ext-device'); let {dialogsx} = require('./ext-dialogs'); -let {threadsx} = require('./ext-threads'); uix.registerWidget('alarm-ctd-text', let _diag = dialogsx.builds({ customView: _view, canceledOnTouchOutside: false, - background: colorsx.hrgba('#005B4F91'), + background: colors.rgba('#005B4F91'), animation: 'input_method', dim_amount: 75, keycode_back: () => $exit(), @@ -30,13 +28,13 @@ let _export = { view: _view, /** * @param {{ - * is_async?: boolean, + * isAsync?: boolean, * title?: string, * }} [options] */ run(options) { let _opt = options || {}; - _opt.is_async ? threadsx.start($main.bind(null, _opt)) : $main(_opt); + _opt.isAsync ? threads.start($main.bind(null, _opt)) : $main(_opt); }, config() { uix.execScript('test', function () { @@ -78,9 +76,9 @@ function $main(options) { } let _date = new Date(ts); return (_d ? '< +' + _d + ' >\n' : '') + - _date.getHours().padStart(2, 0) + ':' + - _date.getMinutes().padStart(2, 0) + ':' + - _date.getSeconds().padStart(2, 0); + Numberx.padStart(_date.getHours(), 2) + ':' + + Numberx.padStart(_date.getMinutes(), 2) + ':' + + Numberx.padStart(_date.getSeconds(), 2); }; let _ts = _getTimeout(); diff --git a/project.json b/project.json index 8fa7469..cd55d7c 100644 --- a/project.json +++ b/project.json @@ -5,8 +5,8 @@ "build" ], "packageName": "com.sm003.ant.forest", - "versionName": "2.3.0", - "versionCode": 523, + "versionName": "2.3.1", + "versionCode": 552, "launchConfig": { "displaySplash": false, "hideLogs": false, diff --git a/tools/ant-forest-deployment-tool.min.js b/tools/ant-forest-deployment-tool.min.js index 9e14d7a..9685148 100644 --- a/tools/ant-forest-deployment-tool.min.js +++ b/tools/ant-forest-deployment-tool.min.js @@ -1,2 +1,2 @@ -(()=>{var A={518:G=>{function J(G){var J=new Error('Cannot\x20find\x20module\x20\x27'+G+'\x27');throw J['code']='MODULE_NOT_FOUND',J;}J['keys']=()=>[],J['resolve']=J,J['id']=0x206,G['exports']=J;},217:P=>{P['exports']={'af':{'project_desc':'蚂蚁森林','self_collect_switch':!0x0,'app_launch_springboard':'OFF','auto_enable_a11y_svc':'OFF','account_switch':!0x1,'account_log_back_in_switch':!0x1,'account_log_back_in_max_continuous_times':0x3,'main_account_info':{},'forest_balls_click_duration':0x36,'forest_balls_click_interval':0x6c,'homepage_monitor_switch':!0x0,'homepage_monitor_threshold':0x2,'homepage_background_monitor_switch':!0x1,'homepage_bg_monitor_threshold':0x1,'homepage_wball_switch':!0x0,'homepage_wball_check_limit':0x78,'homepageWaterBallMaxHueNoBlue':0x2f,'friend_collect_switch':!0x0,'friend_collect_icon_color':'#1DA06D','friend_collect_icon_threshold':0xa,'get_targets_by_stroll_btn':!0x1,'max_continuous_not_targeted_stroll_cycle':0x3,'forestImagePoolLimit':0x3,'forestImagePoolItv':0x3c,'energyBallsRecognitionRegion':[0.1,0.15,0.9,0.45],'houghSrcImageStrategy':{'grayscale':!0x0,'adaptiveThreshold':!0x0,'medianBlur':!0x0,'blur':!0x0,'bilateralFilter':!0x1},'houghResultsStrategy':{'antiOverlap':!0x0,'symmetrical':!0x0,'linearInterpolate':!0x0},'ripeBallDetectThreshold':0xd,'ripeBallDetectColorVal':'#DEFF00','minBallsDistance':0.09,'protect_cover_detect_color_val':'#BEF658','protect_cover_detect_threshold':0x5,'auto_unlock_switch':!0x1,'message_showing_switch':!0x0,'console_log_switch':!0x0,'debug_info_switch':!0x1,'result_showing_switch':!0x0,'floaty_result_switch':!0x0,'floaty_result_countdown_sec':0x6,'rank_list_review_switch':!0x0,'rank_list_review_threshold_switch':!0x0,'rank_list_review_threshold':0x1,'rank_list_review_samples_clicked_switch':!0x0,'rank_list_review_difference_switch':!0x0,'rank_list_scan_strategy':'scroll','rank_list_swipe_distance':0.75,'rank_list_swipe_time':0x96,'rank_list_swipe_interval':0x12c,'rank_list_scroll_interval':0xf0,'rank_list_max_not_targeted_times':0xc8,'rank_list_capt_pool_diff_check_threshold':0x14,'timers_switch':!0x1,'timers_self_manage_switch':!0x0,'timers_countdown_check_own_switch':!0x0,'timers_countdown_check_own_timed_task_ahead':0x2,'timers_countdown_check_friends_switch':!0x0,'timers_countdown_check_friends_timed_task_ahead':0x1,'timers_uninterrupted_check_switch':!0x0,'timers_uninterrupted_check_sections':[{'section':['06:30','00:00'],'interval':0x3c}],'timers_auto_task_sections':[],'timers_insurance_switch':!0x0,'timers_insurance_interval':0x5,'timers_insurance_max_continuous_times':0x3,'max_running_time_global':0x2d,'max_queue_time_global':0x3c,'min_bomb_interval_global':0x12c,'min_battery_percentage':0x14,'kill_when_done_switch':!0x1,'kill_when_done_intelligent':!0x0,'kill_when_done_keep_af_pages':!0x1,'phone_call_state_monitor_switch':!0x0,'phone_call_state_idle_value':void 0x0,'prompt_before_running_switch':!0x0,'prompt_before_running_countdown_seconds':0x5,'prompt_before_running_auto_skip':!0x0,'prompt_before_running_quit_confirm':!0x0,'prompt_before_running_postponed_minutes_choices':[0x1,0x2,0x3,0x5,0xa,0xf,0x14,0x1e,0x3c],'prompt_before_running_postponed_minutes':0x0,'prompt_before_running_postponed_minutes_user':0x3,'foreground_app_blacklist':[],'update_ignore_list':[],'update_auto_check_switch':!0x0,'update_show_on_af_settings':!0x0,'update_show_on_e_result':!0x0,'auto_task_show_on_e_result':!0x0,'stat_list_show_zero':0x1,'stat_list_date_range':0x2,'aj_global_log_switch':!0x0,'aj_global_log_cfg_path':'./log/','aj_global_log_cfg_file_pattern':'%d{yyyy-MM-dd/}%m%n','aj_global_log_cfg_max_backup_size':0x7,'aj_global_log_cfg_max_file_size':0x140,'e_dblclick_switch':!0x1,'e_rain_switch':!0x1,'stroll_btn_match_threshold':0xa,'stroll_btn_locate_main_color':'#FF7E00','root_access_functions':{'force_stop':!0x1,'screen_off':!0x0}},'unlock':{'unlock_code':null,'unlock_max_try_times':0x14,'unlock_pattern_strategy':'segmental','unlock_pattern_size':0x3,'unlock_pattern_swipe_time_segmental':0x78,'unlock_pattern_swipe_time_solid':0xc8,'unlock_dismiss_layer_strategy':'preferred','unlock_dismiss_layer_bottom':0.7,'unlock_dismiss_layer_top':0.2,'unlock_dismiss_layer_swipe_time':0x6e},'settings':{'item_area_width':0.78}};},753:U=>{U['exports']={'restore_all_settings':'此操作无法撤销\x0a如需保留此次会话内容建议先保存\x0a\x0a以下功能内部配置不会被还原:\x0a1.\x20自动解锁\x0a2.\x20黑名单管理\x0a','keep_internal_config':'包含内部配置的功能\x0a只还原此功能的开闭状态\x0a而不会清空内部保存的数据\x0a如解锁密码/黑名单列表等\x0a','about_account_function':'主账户:\x0a\x0a执行蚂蚁森林项目时\x0a用户往往希望只针对自己的账户操作\x0a而非他人的账户或小号账户等\x0a尤其是多账号或频繁切换账号的用户\x0a可能出现非预期账户自动执行了脚本\x0a\x0a此功能可在脚本执行时检测当前账户\x0a若非主账户或未登录任何账户\x0a则将自动切换或登陆主账户\x0a再执行后续操作\x0a\x0a*\x20主账户登录需设置账户名\x0a*\x20账户名必须设置\x0a--\x20否则账户功能将自动关闭\x0a*\x20密码可不做设置\x0a*\x20无密码时\x0a--\x20脚本将在需要时\x0a--\x20提示用户手动输入\x0a\x0a旧账户回切:\x0a\x0a若脚本运行时账户非主账户A\x0a记当前账户为账户B\x0a脚本切换或登录至A且任务完成后\x0a此功能可自动将账户回切至B\x0a否则将保持主账户A的登录状态\x0a\x0a关于连续回切:\x0a每次回切将导致计数器累加一次\x0a且将记录回切时的登录账户B\x0a只要新一次运行的账户不是B\x0a无论是主账户A还是另外的账户C\x0a均将导致连续回切计数器清零\x0a当连续回切达到阈值时\x0a自动回切失效且计数器清零','before_use_main_account':'此功能涉及到用户隐私数据\x0a需额外注意账户和密码安全\x0a建议稍后自行点击\x22帮助\x22按钮\x0a查看并了解相关信息及注意事项','account_info_hint':'信息录入方式:\x0a\x0aA.\x20支付宝录入\x0a自动打开支付宝应用\x0a获取当前登录的账户名\x0a获取成功后自动填入当前页面\x0aB.\x20账户库录入\x0a账户库功能暂未开发\x0aC.\x20手动录入\x0a1.\x20全部留空\x0a将跳过信息录入\x0a或清除已存储的录入数据\x0a2.\x20密码留空\x20只填写账户\x0a脚本将在需要账户密码的时候\x0a通过震动提示用户手动输入密码\x0a60秒内输入完成脚本将自动继续\x0a否则脚本终止\x0a3.\x20全部填写\x0a脚本将自动完成主账户的切换\x0a或自动登录操作\x0a\x0a注意:\x0a\x0a1.\x20密码非必填项\x0a且因安全等原因不建议填入\x0a关于密码存储方式相关内容\x0a可点击\x22密码存储方式\x22按钮查看\x0a2.\x20自动切换或登录在遇到问题时\x0a脚本将自动终止\x0a包括但不限于密码错误/网络不稳定/账号录入错误或不存在/账号状态异常/其他特殊情况\x0a3.\x20当密码已录入时\x0a密码输入框留空或不做修改\x0a均会保持原密码不变\x0a输入新内容可覆盖旧密码\x0a如若删除本地已存储的密码\x0a可将\x22账户\x22内容删除留空\x0a或使用\x22信息销毁\x22功能','how_password_stores':'用户输入的密码数据\x0a使用\x22ext-crypto\x22模块进行加密\x0a然后存储在本地相应文件中\x0a\x0a*\x20加密的原理是随机字符映射\x0a--\x20因此难以避免别有用心之人\x0a--\x20对本地数据进行解密\x0a--\x20或插入劫持代码语句等\x0a--\x20因此需要用户妥善保管设备\x0a--\x20避免遗失或随意借予他人\x0a*\x20解密过程与加密过程类似\x0a--\x20依然是多次随机字符映射','destroy_main_account_info':'此操作将从本地存储中\x0a移除已记录的主账户信息\x0a包括账户和密码\x0a\x0a确定要销毁主账户信息吗','get_account_name_from_alipay':'可从支付宝应用获取当前账户名\x0a并自动填入本页\x22账户\x22输入框\x0a\x0a若出现当前未登录任何账户\x0a或脚本运行错误等其他意外情况\x0a将可能导致获取账户名失败\x0a\x0a点击\x22开始获取\x22按钮开始操作','login_password_needed':'在支付宝密码输入框中\x0a手动填写密码\x0a然后点击\x22登录\x22按钮\x0a登陆成功后脚本将自动继续运行\x0a\x0a脚本不会记录或存储密码\x0a如有疑问或疑虑\x0a可按音量键强制停止脚本\x0a成功登陆后再重新运行脚本','account_log_back_in_max_continuous_times':'计数器达最大次数时将不再回切\x0a且计数器将自动清零\x0a\x0a*\x20设置\x200\x20值可不限制回切次数\x0a*\x20详细情况参阅\x27帮助与支持\x27\x0a--\x20位于\x22账户功能\x22主页','about_blacklist':'能量罩黑名单:\x0a\x0a仅用作显示与查看\x0a当检测到好友能量罩时\x0a脚本自动添加好友到此名单中\x0a获取并计算能量罩到期时间\x0a能量罩到期后好友将自动移除\x0a\x0a自定义黑名单:\x0a\x0a用户可自行管理此名单\x0a位于此名单中的好友\x0a脚本将跳过此人的能量球检查\x0a可指定自动解除时间\x0a\x0a前置应用黑名单:\x0a\x0a项目自动运行时\x0a如果检测到当前应用在此名单中\x0a例如名单里有数独游戏\x0a而此时用户正在运行此游戏\x0a则脚本将放弃执行定时任务\x0a将任务推迟数分钟再执行\x0a推迟分钟按以下方案逐次增量\x0a[\x201,\x201,\x202,\x203,\x205,\x208,\x2010\x20]\x0a达到\x2010\x20后将一直保持\x2010\x20分钟','forest_balls_click_duration':'此设置值影响能量球的点击时间\x0a点击方法采用press()\x0a\x0a注意:\x0a此设置值将同时影响以下操作环境:\x0a1.\x20主页森林能量球\x20(绿/橙/金)\x0a2.\x20好友森林能量球\x20(绿/橙/金)\x0a\x0a设置过小值可能造成点击不被响应\x0a设置过大值将影响快速收取体验','forest_balls_click_interval':'当可点击的能量球数量超过\x201\x20时\x0a此设置值影响能量球之间的点击间隔\x0a\x0a注意:\x0a此设置值将同时影响以下操作环境:\x0a1.\x20主页森林能量球\x20(绿/橙/金)\x0a2.\x20好友森林能量球\x20(绿/橙/金)\x0a\x0a设置过小值可能遗漏点击能量球\x0a设置过大值将影响快速收取体验','homepageWaterBallMaxHueNoBlue':'用以判断能量球是否为浇水能量球\x0a即金色能量球\x0a判断及计算方法:\x0a区域中心横向\x2070%\x20线性扫描\x0a每\x202\x20像素判断色值\x0a色值转换为\x20RGB\x20色值\x0a计算\x20120\x20-\x20(R\x20/\x20G)\x20×\x2060\x0a得到无蓝分量的色值\x20(Hue)\x0aHue\x20在所有像素值中存在极大值\x0a统计出可同时适配白天及黑夜场景\x0a且数值出现概率合适的极大值\x0a将此值作为参数值即可实现匹配','homepage_monitor_threshold':'当进入主页存在未成熟能量球\x0a且最小成熟倒计时达到阈值时\x0a将循环监测直到能量球成熟并收取\x0a收取后\x0a若剩余能量球最小倒计时达到阈值\x0a则继续重复循环监测操作\x0a直到没有未成熟能量球\x0a或最小倒计时未达到设定阈值为止','homepage_bg_monitor_threshold':'好友排行榜操作期间\x0a若主页能量最小成熟时间达到阈值\x0a则返回森林主页开始监控能量球\x0a收取完毕后\x0a将继续进入好友排行榜完成操作\x0a\x0a*\x20此功能不受\x27循环监测\x27开关影响\x0a--\x20除非\x22自收功能\x22关闭\x0a*\x20返检阈值不可大于监测阈值\x0a*\x20接受非整数数值--\x20如\x201.5,\x202.8\x20等','friend_collect_icon_color':'排行榜识别绿色手形图标的参照色值\x0a\x0a示例:\x0argb(67,160,71)\x0a#AEB0B3','friend_collect_icon_threshold':'排行榜识别绿色手形图标的\x0a参照色值检测阈值\x0a阈值越大\x20匹配越宽松\x20反之越严格\x0a0\x20表示完全相似','forestImagePoolLimit':'限制用于存放森林页面截图样本的\x0a采集池数量上限\x0a\x0a数量过多将导致采集时间过长\x0a影响收取体验\x0a数量过少将导致识别率受影响\x0a出现遗漏或误判','forestImagePoolItv':'森林页面样本采集池样本之间的存放间隔\x0a\x0a间隔的意义主要在于保证\x0a相邻两个样本之间的有效差异性\x0a间隔过大将导致采集时间过长\x0a影响收取体验\x0a间隔过小将导致样本差异过小\x0a影响识别率并出现遗漏或误判','energyBallsRecognitionRegion':'用于限制森林页面能量球的识别区域\x0a识别的能量球必须全部包含在此区域\x0a才被视为有效的能量球样本\x0a\x0a需填写\x204\x20个参数并以逗号分隔\x0a支持的参数:\x20百分数/数字/小数\x0a示例\x201\x20:\x20\x2010%,10%,90%,520\x0a示例\x202\x20:\x20\x200.1,120,0.9,53%\x0a\x0a也可使用可视化工具进行参数设置:\x0atools/Floaty_Rectangle_Region.js','ripeBallDetectColorVal':'森林页面识别成熟能量球的参照色值\x0a\x0a示例:\x0argb(67,160,71)\x0a#AEB0B3','ripeBallDetectThreshold':'森林页面识别成熟能量球的\x0a参照色值检测阈值\x0a阈值越大\x20匹配越宽松\x20反之越严格\x0a0\x20表示完全相似','unlock_code':'密码长度不小于\x203\x20位\x0a无密码可留空\x0a\x0a若采用图案解锁方式\x0a总点阵数大于\x209\x20需使用逗号分隔\x0a图案解锁密码将自动简化\x0a详情点击\x22查看示例\x22','unlock_code_demo':'滑动即可解锁:\x20(留空)\x0a\x0aPIN\x20解锁:\x201001\x0a\x0a密码解锁:\x2010btv69\x0a\x0a图案解锁:\x20(点阵序号从\x201\x20开始)\x0a3\x20×\x203\x20点阵\x20-\x201235789\x20或\x201,2,3,5,7,8,9\x0a4\x20×\x204\x20点阵\x20-\x201,2,3,4,8,12,16\x0a*\x20点阵密码将自动简化','about_pattern_simplification':'简化原理:\x0a共线的连续线段组只需保留首末两点\x0a途径点将自动激活\x0a\x0a3\x20×\x203\x20-\x201,2,3,5,7,8,9\x20->\x201,3,7,9\x0a4\x20×\x204\x20-\x201,2,3,4,8,12,16\x20->\x201,4,16\x0a5\x20×\x205\x20-\x201,2,3,4,5,6\x20->\x201,5,6\x0a\x0a因此以下一组设置对于图案解锁\x0a可视为相同设置\x20(3\x20×\x203\x20点阵):\x0a1,2,3,6,9\x0a1,1,2,2,3,3,3,6,9,9\x0a1,3,9','unlock_code_safe_confirm':'设备遗失或被盗时\x20自动解锁功能将严重降低设备的安全性\x20甚至导致隐私泄露或财产损失\x20需谨慎使用\x0a\x0a如欲了解设备遗失对策\x0a可点击\x22了解更多\x22\x0a\x0a确定要继续吗','about_lost_device_solution':'一旦设备遗失或被盗\x0a可通过以下方式\x0a将可能的损失降到最低\x0a\x0a*\x20利用\x27查找我的设备\x27功能\x0a\x0a如若遗失安卓手机/平板电脑/手表等\x0a可以寻找/锁定/清空该设备\x0a详情参阅:\x0ahttps://support.google.com/accounts/answer/6160491?hl=zh-Hans\x0a\x0a*\x20及时挂失/冻结卡号/账号\x0a\x0a优先冻结与财产安全相关的账号\x0a或及时修改登录密码或支付密码\x0a如\x20微博/微信/支付宝\x20以及\x20QQ\x20等\x0a详情参阅:\x0ahttps://www.zhihu.com/question/20206696','unlock_dismiss_layer_swipe_time':'设置整百值可保证匀速滑动\x0a十位小于5可实现不同程度惯性滑动\x0a\x0a*\x20通常无需自行设置\x0a*\x20脚本会自动尝试增量赋值\x0a--\x20以获得最佳值','unlock_dismiss_layer_bottom':'设置滑动起点的屏高百分比\x0a\x0a*\x20通常无需自行设置\x0a*\x20设置过大值可能激活非预期控件','unlock_dismiss_layer_top':'设置滑动终点的屏高百分比\x0a\x0a*\x20通常无需自行设置\x0a*\x20此配置值对滑动影响程度较小','about_unlock_pattern_strategy':'叠加路径:\x0a\x0a采用\x20gestures()\x20方法\x0a将每两个点组成直线路径\x0a所有路径利用微小时间差拼接\x0a最终组合形成完整路径\x0a优点:\x0a1.\x20可实现超高速滑动\x0a2.\x20滑动拐点定位精确\x0a缺点:\x0a1.\x20滑动路径可能会断开\x0a2.\x20滑动总时长=(拐点数+1)×给定参数\x0a\x0a连续路径:\x0a\x0a采用\x20gesture()\x20方法\x0a将所有坐标作为参数传入\x0a完成一次性不间断滑动\x0a优点:\x0a1.\x20滑动路径不会断开\x0a2.\x20滑动总时长=给定参数\x0a缺点:\x0a1.\x20极易发生拐点偏移现象\x0a2.\x20拐点数及分布极大影响成功率\x0a\x0a*\x20不同策略对应不同\x27滑动时长\x27参数\x0a*\x20推荐优先使用\x27叠加路径\x27策略\x0a--\x20当出现路径断开现象时\x0a--\x20可尝试\x22连续路径\x22策略','about_unlock_dismiss_layer_strategy':'解锁前通常需要上滑提示层页面\x0a然后再输入密码或进行图案解锁\x0a\x0a解锁模块执行逻辑默认会\x0a先判断并处理提示层页面\x0a再判断并处理解锁页面\x0a\x0a优先:\x20上述默认行为\x0a滞后:\x20先判断解锁页面\x0a禁用:\x20只判断解锁页面\x0a\x0a*\x20通常无需修改此项设置','unlock_pattern_swipe_time_segmental':'此参数表示两拐点间滑动时长\x0a并非表示滑动总时间\x0a总时间=(拐点数+1)×此参数\x0a如\x221379\x22包含两个拐点\x0a参数给定为120ms\x0a则总时长=(2+1)×120ms\x0a即360ms\x0a如\x2212369\x22有一个拐点\x0a因此结果为240ms\x0a\x0a*\x20通常无需自行设置\x0a--\x20脚本会自动尝试增量赋值\x0a--\x20以获得最佳值','unlock_pattern_swipe_time_solid':'此参数表示首末点间滑动时长\x0a亦即表示滑动总时间\x0a\x0a*\x20通常无需自行设置\x0a--\x20脚本会自动尝试增量赋值\x0a--\x20以获得最佳值','unlock_pattern_size':'图案解锁通常为\x20N\x20×\x20N\x20的点阵\x0a通常边长\x20N\x20为\x203\x0a\x0a若未使用图案解锁方式\x0a则保留默认值','about_message_showing_function':'控制台消息\x0a\x0a简略:\x20只显示最终收取能量总计数据\x0a详细:\x20显示每个好友收取数据\x0a开发者测试模式:\x20详细显示操作信息\x0a\x0a运行前提示对话框\x0a\x0a息屏或上锁启动时自动跳过:\x0a如果勾选\x20当项目启动时\x0a如果设备处于息屏或未解锁状态\x0a则不会显示对话框而直接运行项目\x0a\x0a运行结果展示\x0a\x0aFloaty:\x20彩色悬浮窗方式\x0aToast:\x20消息浮动框方式\x0a\x0a*\x20Floaty方式会伴随全屏遮罩层\x0a--\x20点击遮罩层可立即结束结果展示\x0a*\x20此方式额外支持显示时长参数配置\x0a*\x20若开启了定时任务信息展示\x0a--\x20点击相应区域可全屏展示\x0a*\x20若开启了版本更新提示展示\x0a--\x20点击相应区域可查看更新\x0a*\x20Toast方式仅仅展示信息\x0a--\x20不支持额外的操作或中断提示\x0a*\x20版本更新提示配置参数与\x0a--\x20自动检查更新页面的\x0a--\x20相关配置参数同步','timers_prefer_auto_unlock':'检测到\x22自动解锁\x22功能未开启\x0a\x0a多数情况下定时任务启动需配合\x0a\x22自动解锁\x22功能才能完成\x0a[\x20亮屏\x20-\x20解锁\x20-\x20执行脚本\x20]\x0a等一系列操作\x0a\x0a建议开启并设置\x22自动解锁\x22功能','timers_countdown_check_timed_task_ahead':'此设置值用于将下次定时任务\x0a运行时间提前\x20n\x20分钟\x0a\x0a设置\x200\x20可关闭提前运行','timers_ahead_prefer_monitor_own':'主页能量球监测未开启\x0a\x0a此情况下提前运行脚本\x0a主页能量球可能没有成熟\x0a因此可能无法收取\x0a\x0a*\x20开启主页能量球监测可在\x0a--\x20能量球成熟前不断检测能量球\x0a--\x20进而保证能量球及时收取\x0a\x0a确定要保留当前设置值吗','timers_ahead_prefer_rank_list_threshold_review':'排行榜样本复查未开启\x0a或最小倒计时阈值复查条件未激活\x0a\x0a此情况下提前运行脚本\x0a排行榜可能没有可收取目标\x0a因此可能无法按时完成收取\x0a\x0a*\x20排行榜样本复查能够在\x0a--\x20目标可收取前不断检测倒计时\x0a--\x20进而保证目标及时收取\x0a\x0a确定要保留当前设置值吗','timers_insurance_interval':'设置值用于当保险任务保留时\x0a下次定时任务启动的时间间隔\x0a\x0a*\x20保险任务在脚本运行时设置\x0a*\x20脚本运行中每10秒钟自动重置间隔\x0a*\x20脚本结束前自动移除所有保险任务','timers_insurance_max_continuous_times':'设置值用于当保险任务连续激活\x0a次数超过一定值时\x0a不再继续自动设置保险任务\x0a避免无人值守时的无限定时循环','about_timers_self_manage':'自动管理:\x0a\x0a脚本根据已设置的机制\x0a自动设置一个定时任务\x0a或自动更新已存在的定时任务\x0a以保证在无人值守条件下\x0a实现定期定时的脚本自启功能\x0a\x0a机制简介:\x0a\x0a1.\x20主页最小倒计时机制\x0a脚本计算出能量成熟最小倒计时\x0a并根据\x22定时任务提前运行\x22参数\x0a得到一个定时时间\x0a如果排行榜最小倒计时机制开启\x0a将会用同样的方法得到定时时间\x0a取两个定时时间的最小值\x0a作为最终的下次任务运行时间\x0a\x0a2.\x20排行榜最小倒计时机制\x0a如上所述\x0a另外若主页没有能量球\x0a而且排行榜也没有倒计时数据\x0a则将无法统计出定时时间\x0a此时将激活\x22延时接力机制\x22\x0a\x0a3.\x20延时接力机制\x0a如上所述\x0a此机制仅在倒计时机制全部关闭或倒计时机制未能统计定时时间时被激活\x0a延时接力机制数据格式为:\x0a[\x20开始时间,\x20结束时间,\x20间隔\x20]\x0a\x0a示例:\x20[\x20\x2206:30\x22,\x20\x2200:00\x22,\x2060\x20]\x0aa.\x20现在时刻\x2014:26\x0a下次运行延时\x2060\x20分钟间隔\x0a14:26\x20+\x2060\x20->\x2015:26\x0ab.\x20现在时刻\x2023:41\x0a下次运行延时至\x2000:00\x0ac.\x20现在时刻\x2002:19\x0a下次运行延时至\x2006:30\x0ad.\x20现在时刻\x2006:11\x0a下次运行延时至\x2006:30\x0a\x0a*\x20延时接力可设置多组数据\x0a--\x20最终取所有组数据的最小值\x0a*\x20脚本将自动处理区间边界数据\x0a--\x20设置数据时无需考虑间隔取整\x0a--\x20当右边界时间小于左边界时\x0a--\x20将视右边界时间为次日时间\x0a--\x20如\x20[\x20\x2219:50\x22,\x20\x2203:00\x22,\x208\x20]\x0a*\x20仅在没有最小倒计时数据时\x0a--\x20此机制才有存在意义\x0a--\x20若开启了最小倒计时机制\x0a--\x20通常无需在能量成熟密集时间\x0a--\x20设置延时接力数据\x0a--\x20如\x20[\x20\x2207:00\x22,\x20\x2207:30\x22,\x201\x20]\x0a--\x20这样的设置是没有必要的\x0a\x0a4.\x20意外保险机制\x0a假设\x22保险任务运行间隔\x22设置值为\x205\x0a脚本运行开始后\x0a将自动设置一个\x205\x20分钟定时任务\x0a当脚本异常停止或被终止时\x0a(包括音量键停止了脚本)\x0a则初期设定的保险定时任务\x0a将在\x205\x20分钟后定时执行\x0a确保脚本定时任务的连续性\x0a\x0a*\x20无论是最小倒计时机制\x0a--\x20还是延时接力机制\x0a--\x20均在脚本即将结束之前设定\x0a--\x20若在此之前脚本异常终止\x0a--\x20则会出现定时任务\x22断档\x22\x0a--\x20这正是此机制存在的主要意义\x0a*\x20若脚本长时间运行还未正常结束\x0a--\x205\x20分钟的定时任务将被激活\x0a--\x20并在任务列表排队等待执行\x0a--\x20此时定时任务依然出现\x22断档\x22\x0a--\x20因此脚本在后台每\x2010\x20秒钟\x0a--\x20会自动延期保险任务\x0a--\x20保证保险任务不会被\x22消耗\x22\x0a*\x20保险任务连续执行次数\x0a--\x20受到\x22最大连续保险次数\x22约束\x0a--\x20达到此限制时将不再设置保险任务\x0a--\x20避免保险任务导致脚本无限循环\x0a\x0a有效时段:\x0a\x0a可使项目在自动设置定时任务时\x0a仅会落在设置的有效时段内\x0a避免在某些时间对用户的干扰\x0a如设置时段\x20[\x2009:00,\x2014:00\x20]\x0a则脚本运行结束前设置定时任务时\x0a不会超出这个范围\x0a举三种情况的例子\x0a分别表示不同的定时任务运行时间\x0a1.\x2009:30\x0a正常制定任务\x0a因为\x2009:30\x20落在时段范围内\x0a2.\x2015:20\x0a制定第二天\x2009:00\x20的任务\x0a3.\x2007:10\x0a制定当天\x2009:00\x20的任务\x0a如果时段结束值大于等于起始值\x0a同延时接力机制一样\x0a则将结束值视为第二天的时间点\x0a例如设置\x20[\x2021:00,\x2007:45\x20]\x0a则表示晚\x209\x20点到次日\x2007:45\x0a晚\x2023\x20点和早\x206\x20点都在范围内\x0a而上午\x2011\x20点则不在上述范围\x0a注意区分\x20[\x2007:45,\x2021:00\x20]\x0a如有多个时段将做并集处理\x0a如果设置了一个\x2024\x20小时区间\x0a则时段管理将失去意义\x0a如\x20[\x2005:23,\x2005:23\x20]\x0a等同于\x22全天有效\x22的效果','max_running_time_global':'设置值用于脚本单次运行\x0a可消耗的最大时间\x0a避免无人值守时的无响应情况','max_queue_time_global':'当旧排他性任务运行或排队时\x0a新排他性任务将继续排队\x0a排队时间与排他性任务总数相关\x0a\x0a*\x20当排队时间达到阈值时将强制结束\x0a--\x20当前正在运行的排他性任务\x0a*\x20设置过小的值可能在脚本\x0a--\x20正常结束前被意外终止','min_bomb_interval_global':'若当前脚本与最近一个正在运行的蚂蚁森林脚本的运行时间差小于此阈值\x0a则视当前脚本为炸弹脚本\x0a炸弹脚本将自动强制停止\x0a此安全设置通常针对因某些原因短时间内运行大量相同脚本的意外情况','about_kill_when_done':'此设置用于决定脚本结束时\x0a保留或关闭支付宝应用\x0a\x0a关闭总开关后将在脚本结束时\x0a无条件关闭支付宝应用\x0a\x0a支付宝应用保留:\x0a智能保留:\x0a脚本运行时检测当前前置应用\x0a根据前置应用是否是支付宝\x0a决定保留或关闭操作\x0a总是保留:\x0a无条件保留支付宝应用\x0a\x0a蚂蚁森林页面保留:\x0a智能剔除:\x0a脚本将自动关闭与蚂蚁森林项目相关的全部页面\x0a如蚂蚁森林主页/排行榜页面等\x0a最终回归到脚本启动前的支付宝页面\x0a全部保留:\x0a无条件保留项目运行中的所有页面\x0a除非支付宝应用被触发关闭\x0a\x0a*\x20关闭应用优先使用杀死应用方式\x0a--\x20杀死应用需要\x20Root\x20权限\x0a--\x20无\x20Root\x20权限将尝试最小化应用\x0a--\x20最小化原理并非模拟\x20Home\x20键\x0a*\x20\x27智能保留\x27的智能化程度十分有限','backup_to_local':'此功能将项目相关文件打包保存在本地\x0a可在还原页面恢复或删除已存在的备份','restore_project_confirm':'确定还原此版本项目吗\x0a本地项目将被覆盖\x0a此操作无法撤销\x0a\x0a还原后建议重启配置工具','v1_6_25_restore_confirm':'此版本过于陈旧\x0a不建议还原此版本\x0a\x0a还原后将丢失以下全部功能:\x0a1.\x20项目更新功能\x0a2.\x20项目备份还原功能\x0a3.\x20解锁模块的高效稳定性\x0a4.\x20解锁模块的开发者测试模式\x0a5.\x20重要的工具函数\x0a\x0a缺少工具函数将导致项目无法运行','rank_list_swipe_time':'通常无需自行设置\x0a若出现滑动异常现象\x0a可尝试适当增大此设置值','rank_list_swipe_interval':'若出现遗漏目标的情况\x0a可尝试适当增大此设置值','rank_list_scroll_interval':'若出现遗漏目标的情况\x0a可尝试适当增大此设置值','rank_list_capt_pool_diff_check_threshold':'排行榜滑动前后截图样本相同时\x0a脚本认为滑动无效\x20并进行无效次数统计\x20当连续无效次数达到阈值时\x20将放弃滑动并结束好友能量检查\x0a\x0a达阈值时\x20脚本会判断\x22服务器打瞌睡\x22页面及\x22正在加载\x22按钮\x20根据实际情况点击\x22再试一次\x22或等待\x22正在加载\x22按钮消失\x20(最大等待2分钟)\x0a\x0a*\x20此参数主要避免因意外情况导致当前页面不在排行榜页面时的无限滑动\x0a*\x20截图样本相同指:\x20相似度极高','rank_list_max_not_targeted_times':'排行榜每滑动一次\x0a若当前页面没有好友\x0a则记录一次无目标命中次数\x0a当达到最大阈值时则停止排行榜检查\x0a*\x20此参数主要避免因意外情况导致在某一页面的无限滑动','about_rank_list_review':'样本复查:\x0a\x0a排行榜列表到达底部后\x0a由复查条件决定是否重新检查排行榜\x0a进而达到循环监测的目的\x0a\x0a列表到达底部后\x0a脚本会统计记录列表所有好友数据\x0a包括倒计时数据及对应好友昵称\x0a\x0a复查条件:\x0a\x0a1.\x20列表状态差异:\x0a比较上一次统计的昵称数据\x0a只要昵称数据不一致\x0a则触发复查条件\x0a脚本将复查列表并重新比较数据\x0a直到最近两次昵称数据完全一致\x0a\x0a*\x20因至少需要两组比较数据\x0a--\x20所以列表至少会复查一次\x0a*\x20即便这样会导致额外的操作\x0a--\x20此条件依然是循环检测的利器\x0a--\x20用户可自行斟酌保留与否\x0a\x0a2.\x20样本点击记录:\x0a在一次完整的列表滑动过程中\x0a只要出现了有效点击行为\x0a则触发复查条件\x0a\x0a3.\x20最小倒计时阈值:\x0a统计最小成熟倒计时\x0a如果达到设定阈值\x0a则触发复查条件\x0a\x0a*\x20有效点击指进入好友森林后\x0a--\x20点击过可收取的能量球','stroll_btn_locate_main_color':'参数用于配置多点取色方式\x0a定位逛一逛按钮时的基准色值','stroll_btn_match_threshold':'参数用于配置多点取色方式\x0a定位逛一逛按钮时的匹配阈值','max_continuous_not_targeted_stroll_cycle':'参数用于防止逛一逛策略\x0a在采集过程中遇到无操作好友\x0a可能引起的无限循环\x0a\x0a无操作情况举例:\x0a·\x20好友位于自定义黑名单\x0a·\x20好友使用能量保护罩\x0a·\x20好友能量球采集失败\x0a·\x20好友能量球点击失败\x0a·\x20好友能量球被他人收取\x0a·\x20用户关闭了相关功能\x0a','about_collectable_samples':'排行榜列表\x20(默认策略):\x0a从排行榜遍历可操作目标\x0a优点:\x0a1.\x20方案成熟且不易出现目标遗漏\x0a2.\x20获取倒计时数据无需额外耗时\x0a缺点:\x0a1.\x20采集效率受好友数量影响较大\x0a2.\x20差异样本池消耗较多硬件资源\x0a3.\x20需要频繁进出排行榜页面\x0a\x0a逛一逛按钮:\x0a直接使用官方提供的快捷按钮\x0a优点:\x0a1.\x20采集效率高/不受好友数量影响\x0a2.\x20避开排行榜的所有潜在问题\x0a3.\x20无需考虑循环遍历条件\x0a缺点:\x0a1.\x20按钮定位判断条件可信度低\x0a2.\x20结束页面判断条件可信度低\x0a3.\x20过程可操控性/可预见性低\x0a4.\x20获取倒计时数据依赖排行榜\x0a5.\x20一定概率出现可操作目标遗漏\x0a\x0a注意:\x0a当逛一逛按钮方案出现异常时\x0a脚本将自动在当前会话过程中\x0a切换至\x22排行榜列表\x22采集策略','restore_from_local':'确定还原此备份吗\x0a本地项目将被覆盖\x0a此操作无法撤销\x0a\x0a还原后建议重启配置工具','restore_original_list_data':'要恢复本次会话开始前的列表数据吗\x0a\x0a此操作不可撤销','add_friend_nickname_manually':'手动添加易出错\x0a且难以键入特殊字符\x0a建议使用列表导入功能','phone_call_state_idle_value':'当设备当前通话状态值\x0a与空闲状态值不一致时\x0a将触发通话状态事件\x0a脚本将持续等待\x0a直到通话状态变为空闲\x0a\x0a*\x20事件解除后\x0a--\x20脚本将执行一次支付宝前置操作\x0a*\x20不同设备的通话空闲状态值\x0a--\x20可能存在差异','phone_call_state_idle_value_warn':'输入值与当前通话空闲值不一致\x0a此配置将导致脚本无法正常运行\x0a\x0a确定要使用当前输入值吗','rank_list_bottom_template_hint_base':'排行榜\x22没有更多了\x22控件的图片模板\x0a此模板用于排行榜底部判断\x0a\x0a','rank_list_bottom_template_hint_exists':'正常模板应包含\x22没有更多了\x22字样\x0a查看模板后若发现图片模板存在异常\x0a可选择删除模板\x0a模板删除后\x0a脚本在下次运行时将自动生成新模板','rank_list_bottom_template_hint_not_exists':'当前暂未生成图片模板\x0a脚本在下次运行时将自动生成新模板','about_root_access_functions':'当Auto.js被授予Root权限时\x0a可通过Root权限实现功能升级\x0a如可以直接模拟按键实现快速关屏\x0a或通过adb命令直接杀死应用进程\x0a\x0a即便Auto.js未获取Root权限\x0a用户依然可以进行功能参数配置\x0a此时所有开启的功能均无法生效\x0a脚本在运行过程中将做平稳退化\x0a\x0a注意:\x0aRoot权限关闭应用时\x0a可能出现几秒钟的黑屏现象\x0a此时Toast及Floaty消息会出现阻塞\x0a因此可能影响运行结果展示的效果','about_auto_enable_a11y_svc':'通过修改系统无障碍服务的列表参数\x0a实现Auto.js无障碍服务的自动开启\x0a此过程需要授予Auto.js以下权限:\x0a\x0aWRITE_SECURE_SETTINGS\x0a\x0a如果设备已经获取Root权限\x0a脚本将自动完成上述所需权限的授权\x0a否则需要将手机连接到计算机\x0a然后在计算机使用ADB工具\x0a执行以下指令(无换行):\x0a\x0aadb\x20shell\x20pm\x20grant\x20org.autojs.autojs\x20android.permission.WRITE_SECURE_SETTINGS\x0a\x0a执行后Auto.js将获取上述权限\x0a如需撤销授权需将上述指令的\x0agrant替换为revoke\x0a\x0a注:\x20如果没有权限授权\x0a脚本则会在需要的时候\x0a提示用户手动开启无障碍服务\x0a\x0a*\x20参数默认值:\x20禁用自动启动','about_app_launch_springboard':'某些设备或应用无法直接调用\x20APP\x0a如\x20launch()\x20或\x20startActivity()\x20等\x0a需先调用\x20Auto.js\x20再调用指定\x20APP\x0a当脚本运行结束时\x0a可自动关闭调用过的\x20Auto.js\x20页面\x0a以实现跳板的无痕特性\x0a\x0a*\x20参数默认值:\x20关闭跳板\x0a*\x20无痕特性以跳板页面暴露为前提','about_timed_task_type':'一次性任务执行后将自动失效\x0a每日/每周任务将按日/按周循环执行\x0a\x0a注意:\x0a1.\x20定时任务自动管理功能往往可以\x0a--\x20完成绝大多数定时任务需求\x0a--\x20因此不建议设置过多或\x0a--\x20过于繁杂的手动定时任务\x0a2.\x20也可以使用\x20Auto.js\x20自带的\x0a--\x20定时任务管理功能\x0a--\x20但涉及月份设置或修改时很可能\x0a--\x20会出现\x201\x20个月的偏差问题','delete_min_countdown_task_warn':'正在删除最小倒计时任务\x0a\x0a最小倒计时任务是\x0a定时任务自动管理功能的精髓\x0a除非已确定此任务的异常性\x0a否则强烈不建议删除此任务\x0a\x0a确定要删除最小倒计时任务吗','prompt_before_running_countdown_seconds':'倒计时结束前\x0a用户可自主点击按钮执行相应操作\x0a否则倒计时超时后脚本将自动执行','about_aj_global_log_page':'本地日志功能将Auto.js生成的\x0a所有控制台日志写入文件\x0a包括蚂蚁森林项目及其他所有脚本\x0a同样当关闭此功能时\x0a将停止所有脚本日志的本地写入\x0a\x0aAuto.js因崩溃等原因重启时\x0a本地日志写入功能将失效\x0a但原有的本地日志依然保留\x0a仅仅是停止继续写入\x0a此时运行蚂蚁森林项目\x0a若本地日志写入功能开关开启\x0a将自动重新激活本地日志的写入功能\x0a\x0a功能核心代码:\x0aconsole.setGlobalLogConfig','about_eballs_recognition':'能量球的识别基于霍夫变换\x0a关键参数如下:\x0a\x20\x20\x20\x20image:\x20%img%\x0a\x20\x20\x20\x20dp:\x201\x0a\x20\x20\x20\x20minDst:\x20cX(0.09)\x20(可配置)\x0a\x20\x20\x20\x20minRadius:\x20cX(0.054)\x0a\x20\x20\x20\x20maxRadius:\x20cX(0.078)\x0a\x20\x20\x20\x20param1:\x2015\x0a\x20\x20\x20\x20param2:\x2015\x0a可参阅\x20__image__.js\x20封装模块\x0a内部的\x20images.findCircles()\x20方法\x0a\x0a上述的\x20%img%\x20传入参数有以下策略:\x0a1.\x20灰度化\x0a基本的图像处理策略\x0a霍夫变换必须传入\x208\x20位单通道灰度图像\x0a2.\x20自适应阈值\x0a根据像素的邻域块的像素值分布\x0a确定该像素位置上的二值化阈值\x0a3.\x20中值滤波\x20&\x204.\x20均值滤波\x0a均值滤波和中值滤波都可以平滑图像并虑去噪声\x0a均值滤波采用线性方法对目标像素及周边像素取平均值后再填充目标像素\x0a中值滤波采用非线性方法使用所有像素中值替代中心位置像素值\x0a5.\x20双边滤波\x0a双边滤波是一种非线性滤波方法\x0a结合图像的空间邻近度和像素值相似度的一种折衷处理\x0a同时考虑空域信息和灰度相似性达到保边去噪的目的\x0a\x0a由于双边滤波耗时相对较长\x0a且识别结果准确率也未见明显优势\x0a因此不建议开启双边滤波策略\x0a除非对识别率有极高的要求或用于测试或关闭了\x202,3,4\x20策略仅保留\x201,5\x20等情况\x0a但依然不建议\x201,5\x20这样的策略组合\x0a\x0a通过霍夫变换得到页面的圆形样本后\x0a样本会按照横坐标升序排序\x0a排序后可对样本数据做进一步处理:\x0a1.\x20覆盖检测\x0a如果相邻两个圆形的圆心间距过小\x0a则认为样本重复并将后一个样本去除\x0a2.\x20对称检测\x0a对于所有样本的最左和最右两个样本\x0a如果做中轴镜像后不满足最小球间距\x0a则认为对方位置能量球缺失\x20并会做能量球补算填充\x0a3.\x20线性插值\x0a计算所有球的最小间距作为参考值\x0a如果检测到有相邻两个能量球间距大于这个参考值的某个倍数\x20则会做插值处理\x20可能插入\x201\x20个或多个能量球\x0a\x0a数据处理示例:\x0a森林页面最多可展示\x206\x20个能量球\x0a将这些球大概位置记为\x201,\x202...\x206\x0a以下示例仅针对线性插值和对称检测\x0a示例\x201:\x0a能量球\x201\x20个\x20位于\x203\x20号位置偏右\x0a识别到的能量球位置\x203\x0a对称检测不生效\x0a线性插值不生效\x0a结果:\x203\x20(正确)\x0a示例\x202:\x0a能量球\x202\x20个\x20位于\x203,4\x0a识别到的能量球位置\x204\x0a即遗漏了\x203\x20号位置的球\x0a对称检测生效\x0a由\x204\x20做镜像后补充\x0a线性插值不生效\x0a结果:\x203,4\x20(正确)\x0a示例\x203:\x0a能量球\x206\x20个\x20位于\x201,2,3,4,5,6\x0a识别到的能量球位置\x201,5,6\x0a即遗漏了\x202,3,4\x20位置的球\x0a对称检测不生效\x0a因为\x201\x20和\x206\x20镜像后不需补充\x0a线性插值生效\x0a5\x20和\x206\x20的间距作为参考\x0a会将\x201\x20与\x204\x20之间插入\x202\x20个球\x0a结果:\x201,2,3,4,5,6\x20(正确)\x0a示例\x204:\x0a能量球\x205\x20个\x20位置如下:\x0a1,\x202偏右,\x20居中,\x205偏左,\x206\x0a为方便阅读\x20将位置记为\x20A,B,C,D,E\x0aA,E\x20对称\x20\x20B,D\x20对称\x20\x20C\x20居中\x0a识别到的能量球位置\x20A,C,E\x0a即遗漏了\x20B,D\x20位置的球\x0a对称检测不生效\x0a因为\x20A\x20和\x20E\x20镜像后不需补充\x0a线性插值不生效\x0aA,C\x20和\x20C,E\x20的间距几乎相同\x0a因此无需插值\x0a结果:\x20A,C,E\x20(错误)\x0a如果上述情况的识别结果为\x20A,D,E\x0a则与示例\x203\x20类似\x0a最终将识别到正确结果:\x20A,B,C,D,E','update_ignore_confirm':'确定要忽略当前版本吗\x0a\x0a*\x20忽略后脚本将不再提示当前版本更新\x0a*\x20忽略后可在配置工具中管理已忽略的所有版本','about_update_auto_check':'自动检查更新功能可在不同场景\x0a进行版本更新的提示\x0a\x0a*\x20注意:\x20此功能不会自动下载更新\x0a\x0a更新提示场景:\x0a\x0a1.\x20运行结果展示时\x0a当\x22运行结果展示\x22功能生效时\x0a可同时展示版本更新提示\x0a包括Floaty或Toast方式\x0a\x0a2.\x20配置工具启动时\x0a在配置工具启动后\x0a脚本会在后台检查项目更新\x0a发现更新后以SnackBar方式提示\x0a\x0a版本忽略管理:\x0a\x0a对于不希望提示更新的版本\x0a可添加至忽略列表中\x0a例1:\x20当前版本为v2.0.1\x0a服务器最新版本为v2.0.2\x0a将v2.0.2添加至忽略列表中\x0a则脚本将不会提示项目有更新\x0a例2:\x20当前版本为v2.0.1\x0a服务器最新版本为v2.0.4\x0a将v2.0.4添加至忽略列表中\x0a则脚本将会提示项目有更新\x0a且最新版本为v2.0.3\x0a此时如果再将v2.0.3添加至列表\x0a则脚本依然会提示项目有更新\x0a且最新版本为v2.0.2\x0a','about_rank_list_scan_strategy':'控件滚动:\x0a基于排行榜可滚动控件的\x0a无障碍行为实现列表滚动\x0a优点:\x0a1.\x20滚动效率非常高\x0a2.\x20无需关心滚动距离\x0a3.\x20全平台无惯性滚动\x0a缺点:\x0a1.\x20依赖控件\x0a2.\x20定位唯一性可能不够严谨\x0a\x0a模拟滑动:\x0a基于辅助服务的\x0a无障碍行为实现列表滑动\x0a优点:\x0a1.\x20可定义滑动距离及时长\x0a2.\x20不依赖排行榜控件\x0a缺点:\x0a1.\x20某些平台可能出现惯性滑动','about_rank_list_scroll_distance':'采用\x22控件滑动\x22策略时\x0a无法指定滑动距离\x0a由\x22无障碍行为\x22实现基于控件的滚动','about_rank_list_scroll_time':'采用\x22控件滑动\x22策略时\x0a无法指定滑动时长\x0a由\x22无障碍行为\x22决定控件的滚动时长','about_memory_info':'System\x20Memory:\x20系统内存\x0a剩余内存\x20|\x20总内存\x20|\x20使用率\x0a\x0aRuntime\x20Heap:\x20JVM堆内存\x0aJVM总内存-JVM空闲内存\x20|\x20JVM可用最大内存\x20|\x20使用率\x0a\x0aProcess\x20Heap:\x20进程堆内存\x0a\x27summary.java-heap\x27\x20|\x20JVM可用最大内存\x20|\x20使用率\x0a\x0aPSS\x20(Proportional\x20Set\x20Size):\x20实际使用的物理内存\x20(比例分配共享库占用的内存)\x0aUSS\x20(Unique\x20Set\x20Size):\x20进程独自占用的物理内存\x20(不包含共享库占用的内存)\x0a\x0a*\x20JVM堆内存会定期回收\x0a*\x20进程堆内存更新频率较慢\x0a*\x20当任意内存使用率超过90%时建议重启进程\x0a\x0a*\x20相关内存信息对应的伪代码\x0a\x0aActivityManager.MemoryInfo\x20>\x20totalMem\x20-\x20系统总内存\x0aActivityManager.MemoryInfo\x20>\x20availMem\x20-\x20系统剩余内存\x0a\x0aRuntime\x20>\x20totalMemory()\x20-\x20JVM总内存\x0aRuntime\x20>\x20freeMemory()\x20-\x20JVM空闲内存\x0aRuntime\x20>\x20maxMemory()\x20-\x20JVM可用最大内存\x0a\x0aDebug.MemoryInfo\x20>\x20getTotalSharedDirty()\x0a-\x20RSS\x20(Resident\x20Set\x20Size)\x20-\x20实际使用物理内存\x20(包含共享库占用的内存)\x0aDebug.MemoryInfo\x20>\x20getTotalPss()\x0a-\x20PSS\x20(Proportional\x20Set\x20Size)\x20-\x20实际使用的物理内存\x20(比例分配共享库占用的内存)\x0aDebug.MemoryInfo\x20>\x20getTotalPrivateDirty()\x0a-\x20USS\x20(Unique\x20Set\x20Size)\x20-\x20进程独自占用的物理内存\x20(不包含共享库占用的内存)','about_process_restart':'脚本调用如下代码片段杀死当前应用活动进程:\x0aProcess.killProcess(Process.myPid());\x0a\x0a此操作将清理进程内所有资源\x0a由于ActivityManager时刻监听进程\x0a一旦发现进程非正常结束\x0a它将试图重启此进程\x0a进而实现进程的自动重启'};},724:(V,Y,Z)=>{let {$$impeded:i,$$str:n,$$num:s,$$rex:o,isPlainObject:a,isNullish:l,isNonEmptyObject:c,sleep:u,requirex:p,$$toast:h}=Z(0x2c4),{consolex:_}=Z(0x2d5),a0=android['provider']['Settings'],a1=a0['Secure'],a2=android['graphics']['Rect'],a3=org['opencv']['core']['Point'],a4=android['content']['Intent'],a5=com['stardust']['automator']['UiObject'],a6=com['stardust']['autojs']['core']['accessibility']['UiSelector'],a7=com['stardust']['autojs']['core']['accessibility']['AccessibilityService'],a8=android['view']['accessibility']['AccessibilityWindowInfo'],a9={'ctx_reso':context['getContentResolver'](),'autojs_a11y_svc_name':context['getPackageName']()+'/'+new a7()['getClass']()['getName'](),get 'sel'(){return this['selector']=this['selector']||aa['selector']();},'parseArgs'(V){let Y=[this['autojs_a11y_svc_name']],Z=!0x1,ae=typeof V[0x0];return'undefined'!==ae&&(Array['isArray'](ae)?(Y=V[0x0],Z=!!V[0x1]):'string'===ae?(Y=[V[0x0]],Z=!!V[0x1]):'boolean'===ae&&(Z=V[0x0])),{'forcible':Z,'svc':Y};},'getString'(){return a1['getString'](this['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'])||'';},'tryEnableAndRestart'(){if(aa['enable'](!0x0)){let {enginesx:V}=p('ext-engines');_['$'](['已自动开启无障碍服务','尝试一次项目重启操作'],0x1,0x0,0x0,0x2),V['restart']({'isDebug':!0x0,'is_instant_running':!0x1,'max_restart_e_times':0x1}),sleep(0x1068),exit();}}},aa={'bridge':{'setWindowFilter'(V){auto['setWindowFilter'](function(Y){try{return V(Y);}catch(ai){return!0x1;}});},'setWindowBlacklist'(V){this['setWindowFilter'](Y=>!V['includes'](Y['getRoot']()['getPackageName']()));},'setWindowWhitelist'(V){this['setWindowFilter'](Y=>V['includes'](Y['getRoot']()['getPackageName']()));},'setWindowAllowAll'(){this['setWindowFilter'](()=>!0x0);},'resetWindowFilter'(){this['setWindowFilter'](V=>this['isWindowType'](V,'APPLICATION')||this['isWindowType'](V,'SYSTEM')&&V['isActive']());},'isWindowType'(V,Y){if('number'==typeof Y)return Y===V['getType']();let Z=String(Y)['toUpperCase']();if(!(Z in{'APPLICATION':0x1,'INPUT_METHOD':0x2,'SYSTEM':0x3,'ACCESSIBILITY_OVERLAY':0x4,'SPLIT_SCREEN_DIVIDER':0x5}))throw TypeError('Unknown\x20type\x20of\x20\x22type\x22\x20for\x20isWindowType()');return a8['TYPE_'+Z]===V['getType']();}},'service':{'refreshServiceInfo'(){auto['service']['setServiceInfo'](auto['service']['getServiceInfo']());}},'click$'(){return(this['_click$']=this['_click$']||i['detach'](this['click'],0x2))['apply'](this,arguments);},'wait$'(){return(this['_wait$']=this['_wait$']||i['detach'](this['wait'],0x3))['apply'](this,arguments);},'swipe$'(){return(this['_swipe$']=this['_swipe$']||i['detach'](this['swipe'],0x3))['apply'](this,arguments);},'enable'(){try{let V,{forcible:Y,svc:Z}=a9['parseArgs'](arguments);if(this['state'](Z)?Y&&(V=this['enabled_svc']):V=this['enabled_svc']['split'](':')['filter'](V=>!Z['includes'](V))['concat'](Z)['join'](':'),V){a1['putString'](a9['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'],V),a1['putInt'](a9['ctx_reso'],a1['ACCESSIBILITY_ENABLED'],0x1);let Y=Date['now']();for(;Date['now']()-Y<0x7d0;){if(this['state'](Z))return!0x0;sleep(0xb4);}_['$']('Operation\x20timed\x20out',0x4,0x1);}return!0x0;}catch(au){return!0x1;}},'disable'(){try{let V=arguments[0x0];if(n(V)&&'all'===V['toLowerCase']())return a1['putString'](a9['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'],''),a1['putInt'](a9['ctx_reso'],a1['ACCESSIBILITY_ENABLED'],0x1),!0x0;let Y,{forcible:Z,svc:i}=a9['parseArgs'](arguments),ax=a9['getString'](),ay=function(){for(let V=0x0,Y=i['length'];V!i['includes'](V))['join'](':'):Z&&(Y=ax),Y){a1['putString'](a9['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'],Y),a1['putInt'](a9['ctx_reso'],a1['ACCESSIBILITY_ENABLED'],0x1),ax=a9['getString']();let V=Date['now']();for(;Date['now']()-V<0x7d0;){if(!ay())return!0x0;sleep(0xb4);}_['$']('Operation\x20timed\x20out',0x4,0x1);}return!0x0;}catch(aD){return!0x1;}},'restart'(){return this['disable']['apply'](this,arguments)&&this['enable']['apply'](this,arguments);},'state'(V){let Y=this['enabled_svc']=a9['getString'](),Z=[];if(Array['isArray'](V))Z=V['slice']();else if(void 0x0===V)Z=[a9['autojs_a11y_svc_name']];else{if('string'!=typeof V)throw TypeError('Unknown\x20a11y\x20state\x20type');Z=[V];}return Z['every'](V=>Y['includes'](V));},'services':()=>a9['getString']()['split'](':')['filter'](V=>!!V),'test'(){let V='%rand%'+Date['now']()+Math['random']()['toFixed'](0x9);return this['enable'](V,!0x0),this['disable'](V,!0x0);},'selector'(){let V={'sel_body_pool':{},'cache_pool':{}},Y={'pickup'(V,Y,aO){let aP={'loc_keys_abbr':{'bi$':'boundsInside','c$':'clickable','cn$':'className'},'options':aO||{},get 'res_type'(){return this['_res_type']=this['_res_type']||this['getResultType'](Y);},get 'locator'(){return this['_locator']||null;},get 'widget'(){return this['_widget']||null;},get 'widget_collection'(){return this['_wc']||[];},get 'selector'(){return this['_selector']||null;},'tools':{'uiObject2Point':V=>V instanceof a5?new a3(V['bounds']()['centerX'](),V['bounds']()['centerY']()):null,'wrapStrByOptDef':V=>!V&&'default'in aP['options']?aP['options']['default']:V,'isArrResType':()=>/^(widgets|points)$/['test'](aP['res_type']),'isCompass':V=>'string'==typeof V&&/([pck]\d*)+/['test'](V)},'refreshSvcInfoIFN'(){this['options']['refresh']&&aa['service']['refreshServiceInfo']();},'parseRawLocator'(){let Y,Z,aO=V;if(Array['isArray'](aO)){let V=aO['slice']();this['tools']['isCompass'](V[V['length']-0x1])&&(Z=V['pop']()),[aO,Y]=V;}let aX=this['setUniqueLocator'](aO,Y);aX instanceof a6?(this['_selector']=aX,this['_widget']=this['getWidgetByCompass'](aX['findOnce'](),Z),this['tools']['isArrResType']()&&(this['_wc']=aX['find']()['toArray']())):aX instanceof a5&&(this['_selector']=null,this['_widget']=this['getWidgetByCompass'](aX,Z),this['tools']['isArrResType']()&&(this['_wc']=[aX]));},'setUniqueLocator'(V,Y){if(V instanceof a6)return this['_locator']=this['assembleSelectors'](V,Y);if(n(V)||s(V)||o(V)){let Z=this['parseTextSelector'](V);return this['_locator']=this['assembleSelectors'](Z,Y);}if(a(V)){let Z=global['selector'](),aO=Object['assign'](V,Y);return this['_locator']=this['assembleSelectors'](Z,aO);}return this['_locator']=V;},'extendLocator'(V,Y,aO){let b6,{$$disp:s}=Z(0x19f),b7={get 'W'(){return'object'==typeof s?s['W']:device['width'];},get 'H'(){return'object'==typeof s?s['H']:device['height'];},'isCenterX'(Y){let Z=Number(Y),aO=!0x0===Y||l(Y)||isNaN(Z)?0.01:!0x1===Y?Y:Z['clamp'](0x0,0.25),b6=V=>Math['abs'](V['bounds']()['centerX']()-this['W']/0x2)<=this['W']*aO;return!0x1!==aO?V['filter'](b6['toRegular']()):V['filter']((V=>!b6(V))['toRegular']());},'isFullScreen'(Y){let Z=Number(Y),aO=!0x0===Y||isNaN(Z)?0.15:!0x1===Y?Y:Z['clamp'](0x0,0.5),b6=V=>V['bounds']()['height']()/this['H']>=0x1-aO&&Math['abs'](V['bounds']()['width']()-this['W'])<=0x4;return!0x1!==aO?V['filter'](b6['toRegular']()):V['filter']((V=>!b6(V))['toRegular']());},'isAlipay'(Y){if(void 0x0===Y)return Y;let Z='.*(Alipay|alipay).*';return Y?V['packageNameMatches'](Z):V['filter']((V=>!V['packageName']()['match'](Z))['toRegular']());}};try{b6=b7[Y]['apply'](b7,aO);}catch(bn){throw console['warn'](bn['message']),Error('Cannot\x20apply\x20extended\x20locator:\x20'+Y);}if(b6 instanceof a6)return b6;throw Error('Extended\x20locator\x20('+Y+')\x20returns\x20non-UiSelector\x20type');},'assembleSelectors'(V,Y){return l(V)||!c(Y)||Object['keys'](Y)['forEach'](Z=>{let aO=Z in this['loc_keys_abbr']?this['loc_keys_abbr'][Z]:Z,bs=V=>'function'==typeof V?V['toRegular']():V,bt=Array['isArray'](Y[Z])?Y[Z]['map'](bs):[Y[Z]]['map'](bs),bu=V[aO];if('function'==typeof bu)try{return V=bu['apply'](V,bt);}catch(bw){throw console['warn'](bw['message']),Error('Cannot\x20apply\x20selector:\x20'+aO);}return V=this['extendLocator'](V,aO,bt);}),V;},'getTextSelector'(V,Y){let Z={'sel':Y['desc'](V),get 'txt'(){let V=this['sel']['findOnce']();return V&&V['desc']()||'';}},aO={'sel':Y['text'](V),get 'txt'(){let V=this['sel']['findOnce']();return V&&V['text']()||'';}},bB=Z['txt']['length'],bC=aO['txt']['length'];if(bB||bC)return bC>bB?aO['sel']:Z['sel'];let bF=Y['id'](V);return bF['exists']()?bF:null;},'parseTextSelector'(V){return V instanceof RegExp?this['getTextSelector'](V,{'desc':descMatches,'text':textMatches,'id':idMatches}):('number'==typeof V&&(V=V['toString']()),'string'==typeof V?this['getTextSelector'](V,{'desc':desc,'text':text,'id':id}):null);},'getWidgetByCompass'(V,Y){if(!(V instanceof a5))return null;if('string'!=typeof Y)return V;for(;Y['length']>0x0;){let Z,aO,bL,bM;if(Z=/^p[p\d]*/['exec'](Y)){let aO=Y['match'](/^p\d+|^p+(?!\d)/g)['reduce']((V,Y)=>V+(/\d/['test'](Y)?Number(Y['slice'](0x1)):Y['length']),0x0);for(;aO--;)if(!(V=V['parent']()))return null;Y=Y['slice'](Z[0x0]['length']);}else if(aO=/^c-?\d+([>c]?-?\d+)*/['exec'](Y)){let Z=aO[0x0]['split'](/[>c]/);for(let Y of Z)if(Y['length']){if(!(V instanceof a5))return null;let Z=V['childCount'](),aO=Number(Y);if(aO<0x0&&(aO+=Z),aO<0x0||aO>=Z)return null;V=V['child'](aO);}Y=Y['slice'](aO[0x0]['length']);}else if(bL=/^s[<>]?-?\d+/['exec'](Y)){let Z=V['parent']();if(!(Z instanceof a5))return null;let aO=V['indexInParent']();if(aO<0x0)return null;let bM=Z['childCount'](),bX=bL[0x0],bY=+bX['match'](/-?\d+/)[0x0];if(bX['includes']('>')?aO+=bY:bX['includes']('<')?aO-=bY:aO=bY<0x0?bY+bM:bY,aO<0x0||aO>=bM)return null;V=Z['child'](aO),Y=Y['slice'](bL[0x0]['length']);}else{if(!(bM=/^k[k\d]*/['exec'](Y)))throw Error('Invalid\x20rest\x20compass\x20for\x20$$sel.pickup():\x20'+Y);{let Z=Y['match'](/^k(\d*)/g)['map'](V=>{let Y=V['match'](/\d+/);return Y?Number(Y[0x0]):0x1;})['reduce']((V,Y)=>V+Y);V=function(){let Y=V;for(;;){if(!(Y instanceof a5))return null;if(Y['clickable']())return Y;if(!Z--)return V;Y=Y['parent']();}}(),Y=Y['slice'](bM[0x0]['length']);}}}return V||null;},'getResultType'(V){let Y=V?String(V):null;return null===Y||Y['match'](/^w(idget)?$/)?'widget':Y['match'](/^(w(idget)?_?c(ollection)?|wid(get)?s)$/)?'widgets':Y['match'](/^t(xt)?$/)?'txt':Y['match'](/^s(el(ector)?)?$/)?'selector':Y['match'](/^e(xist(s)?)?$/)?'exists':Y['match'](/^s(el(ector)?)?(_?s)(tr(ing)?)?$/)?'selector_name':Y['match'](/^p(oin)?ts?$/)?Y['includes']('s')?'points':'point':Y;},'getInternalResult'(){return{'selector':this['selector'],'widget':this['widget'],'widgets':this['widget_collection'],'exists':Boolean(this['widget']),get 'selector_name'(){if(!this['widget']||!this['selector'])return aP['tools']['wrapStrByOptDef']('');let V=this['selector']['toString']()['match'](/[a-z]+/);return aP['tools']['wrapStrByOptDef'](V?V[0x0]:'');},get 'txt'(){let V=this['widget']&&this['widget']['text']()||'',Y=this['widget']&&this['widget']['desc']()||'';return Y['length']>V['length']?aP['tools']['wrapStrByOptDef'](Y):aP['tools']['wrapStrByOptDef'](V);},get 'point'(){return aP['tools']['uiObject2Point'](this['widget']);},get 'points'(){return this['widgets']['map'](aP['tools']['uiObject2Point'])['filter'](V=>null!==V);}}[this['res_type']];},'getResult'(){this['refreshSvcInfoIFN'](),this['parseRawLocator']();let V=function(){let V=this['getInternalResult']();if(void 0x0!==V)return V;if(null===this['widget'])return null;let Y=this['widget'][this['res_type']];return'function'==typeof Y?Y['call'](this['widget']):Y;}['call'](this);return l(V)?'default'in this['options']?this['options']['default']:null:V;}};return aP['getResult']();},'traverse':(V,Z,cg)=>({'parseFilter'(){this['filter']='string'==typeof Z?V=>Y['pickup'](V,Z):'function'==typeof Z?Z:()=>!0x0;},'parseArgs'(){this['parseFilter'](),this['type']=cg||'widget',this['pickup']=Y['pickup']['bind'](Y),this['pickup_null_res']=this['pickup'](null,this['type']);},'traverse'(V){for(let Y of this['pickup'](V,'children',{'default':[]})){if(!(Y instanceof a5))continue;if(this['filter'](Y))return this['pickup'](Y,this['type']);let V=this['traverse'](Y);if(V!==this['pickup_null_res'])return V;}return this['pickup_null_res'];},'getResult'(){return this['parseArgs'](),this['filter'](V)?this['pickup'](V,this['type']):this['traverse'](V);}}['getResult']()),'traverseAll':(V,Z,cn)=>({'results':[],'type':cn||'widget','filter':'string'==typeof Z?V=>Y['pickup'](V,Z):'function'==typeof Z?Z:()=>!0x0,'pickup':Y['pickup']['bind'](Y),'traverse'(V){for(let Y of this['pickup'](V,'children',{'default':[]}))Y instanceof a5&&(this['filter'](Y)&&this['results']['push'](this['pickup'](Y,'widget')),this['traverse'](Y));return this['type']['match'](/^w(idget)?$/)?this['results']:this['results']['map'](V=>this['pickup'](V,this['type']));},'getResult'(){return this['filter'](V)&&this['results']['push'](this['pickup'](V,'widget')),this['traverse'](V);}}['getResult']()),'add'(Y,Z){return V['sel_body_pool'][Y]='function'==typeof Z?V=>Z(V):V=>this['pickup'](Z,V),this;},'get'(Y,Z){let cz=V['sel_body_pool'][Y];if(void 0x0!==cz)return cz?'cache'===Z?V['cache_pool'][Y]=cz('w'):cz(Z):null;throw Error('Key\x20\x22'+Y+'\x22\x20is\x20not\x20in\x20the\x20pool');},'getAndCache'(V){return this['get'](V,'cache');},'cache':{'save'(V){Y['getAndCache'](V);},'load'(Z,cD){let cE=V['cache_pool'][Z];return cE?Y['pickup'](cE,cD):null;},'refresh'(Y){let Z=V['cache_pool'][Y];Z&&Z['refresh'](),this['save'](Y);},'recycle'(Y){let Z=V['cache_pool'][Y];Z&&Z['recycle']();}}};return Object['assign'](Object['create'](global['selector']()),Y);},'enableByRoot'(){try{let V='enabled=$(settings\x20get\x20secure\x20enabled_accessibility_services)\x0apkg='+a9['autojs_a11y_svc_name']+'\x0aif\x20[[\x20$enabled\x20!=\x20*$pkg*\x20]]\x0athen\x0aenabled=$pkg:$enabled\x0asettings\x20put\x20secure\x20enabled_accessibility_services\x20$enabled\x0afi\x0asettings\x20put\x20secure\x20accessibility_enabled\x201';return 0x0===shell(V,!0x0)['code'];}catch(cK){return!0x1;}},'enableByRootAndWaitFor'(V){return this['enableByRoot']()&&a7['Companion']['waitForEnabled'](V||0x3e8);},'goToAccessibilitySetting'(){context['startActivity'](new a4(a0['ACTION_ACCESSIBILITY_SETTINGS'])['addFlags'](a4['FLAG_ACTIVITY_NEW_TASK']));},'waitForEnabled'(V){return threads['start'](function(){auto['waitFor']();})['join'](V||0xea60),this['state']()||_['$']('等待用户开启无障碍服务超时',0x8,0x2,0x0,0x2);},'isAutoEnableEnabled'(){try{let {storagesx:V}=p('ext-storages');return'ON'===V['create']('af_cfg')['get']('config',{'prop':'auto_enable_a11y_svc'});}catch(cN){return!0x1;}},'autoEnable'(V){if(this['state']())return!0x0;let Y=V||{},Z=Y['is_essential'],cR=Y['is_manual_disallowed'];if(!this['isAutoEnableEnabled']()){if(!Z)return _['_']('自动开启无障碍服务未启用',0x3),!0x1;_['$']('无障碍服务关闭且自动启用未开启',0x8,0x2,0x0,0x2);}let cS=context['getPackageName']()+'\x20android.permission.WRITE_SECURE_SETTINGS';return'undefined'!=typeof activity?(this['enable'](!0x0)?h('已自动启用无障碍服务\x0a需要重新运行当前脚本','long'):Z&&_['$']('自动启用无障碍服务失败',0x4,0x2,0x0,0x2),exit(),!0x1):(a9['tryEnableAndRestart'](),function(){try{return 0x0===shell('date',!0x0)['code'];}catch(cT){return!0x1;}}()&&(shell('pm\x20grant\x20'+cS,!0x0),a9['tryEnableAndRestart']()),function(){if(_['$']('自动启用无障碍服务失败',0x4,0x2,0x0,-0x1),context['checkCallingOrSelfPermission'](android['Manifest']['permission']['WRITE_SECURE_SETTINGS'])!==android['content']['pm']['PackageManager']['PERMISSION_GRANTED']){let V='adb\x20shell\x20pm\x20grant\x20'+cS;_['$']('Auto.js缺少以下权限:',0x4,0x0,0x0,-0x1),_['$']('WRITE_SECURE_SETTINGS',0x4,0x0,0x0,0x1),_['$']('可尝试使用ADB工具连接手机',0x3),_['$']('并执行以下Shell指令(无换行):\x0a\x0a'+V+'\x0a',0x3),_['$']('Shell指令已复制到剪切板',0x3),_['$']('重启设备后授权不会失效',0x3),setClip(V);}_['__']();}(),Z&&cR&&exit(),this['waitForEnabled']());},'ensureService'(){this['autoEnable']({'is_essential':!0x0});},'ensureFunctionality'(){if('undefined'==typeof activity){let V=0x18;for(;!press(0x5f5e100,0x0,0x1)&&V--;)sleep(0x32);V<0x0&&(_['$']('无障碍服务状态异常',0x4,0x0,0x0,-0x1),_['$']('或基于服务的方法无法使用',0x4,0x0,0x0,0x1),_['$']('可尝试以下解决方案',0x3),_['$']('卸载并重新安装\x22Auto.js\x22',0x3,0x0,0x1),_['$']('安装后重启设备',0x3,0x0,0x1),_['$']('运行\x22Auto.js\x22并拉出侧边栏',0x3,0x0,0x1),_['$']('开启无障碍服务',0x3,0x0,0x1),_['$']('再次尝试运行本项目',0x3,0x0,0x1),_['$']('无障碍服务功能异常',0x8,0x2,0x0,0x2));}},'ensureSvcAndFunc'(){this['ensureService'](),this['ensureFunctionality']();},'click'(V,Y,Z){return a(Y)?this['click'](V,'widget',Y):!l(V)&&{'container':[],'options':Z||{},'wait':aa['wait']['bind'](aa),'pickup':a9['sel']['pickup']['bind'](a9['sel']),'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('a11yx.click');},'parsePadding'(){let V=this['options']['padding'];if(!V)return this['padding']={'x':0x0,'y':0x0};if('number'==typeof V)V=[0x0,V];else if(!Array['isArray'](V))throw Error('Invalid\x20paddings\x20for\x20a11yx.click()');let Y=function(){if(0x1===V['length'])return[0x0,V[0x0]];if(0x2===V['length']){let [Y,Z]=V;return'x'===Y?[Z,0x0]:'y'===Y?[0x0,Z]:[Y,Z];}throw Error('Invalid\x20paddings\x20amount\x20for\x20a11yx.click()');}(),[Z,d4]=Y['map'](V=>Number(V));if(isNaN(Z)||isNaN(d4))throw Error('Invalid\x20paddings\x20calc\x20results\x20for\x20a11yx.click()');this['padding']={'x':Z,'y':d4};},'parseStrategy'(){let V=this['options']['strategy']||this['options']['click_strategy']||this['options']['cs$']||Y||'widget';this['strategy']='string'==typeof V?V:String(this['strategy']);},'parseCondition'(){this['condition']=function(){let Y=this['options']['condition'];if('function'==typeof Y)return Y;if('disappear'===Y)return()=>this['checkDisappearance'](V);if(l(Y))return()=>!0x0;throw Error('Invalid\x20condition\x20for\x20a11yx.click():\x20'+Y);}['call'](this);},'parseArgs'(){this['parsePadding'](),this['parseStrategy'](),this['parseCondition'](),this['times']=this['options']['max_check_times']||0x3,this['timeout']=this['options']['check_time_once']||0x1f4,this['press_time']=this['options']['press_time']||this['options']['pt$']||0x1,this['buffer_time']=this['options']['buffer_time']||this['options']['bt$']||0x0;},'checkDisappearance'(V){if(l(V))return!0x0;if(V instanceof a5){let Y=V['parent']();return!Y||!this['container']['includes'](Y['hashCode']());}if(V instanceof a6){let Y=V['findOnce']();return!Y||!this['container']['includes'](Y['hashCode']());}return this['checkDisappearance'](this['pickup'](V));},'clickOnce'(V){let Y=(V,Y)=>this['strategy']['match'](/^p(ress)?$/)?press(V+this['padding']['x'],Y+this['padding']['y'],this['press_time']):click(V+this['padding']['x'],Y+this['padding']['y']);if(V instanceof a6){let Z=V['findOnce']();if(!Z)return!0x1;if(this['container']['push'](Z['hashCode']()),this['strategy']['match'](/^w(idget)?$/)&&Z['clickable']())return Z['click']();let dk=Z['bounds']();return Y(dk['centerX'](),dk['centerY']());}if(V instanceof a5){let Z=V['parent']();if(null!==Z&&this['container']['push'](Z['hashCode']()),this['strategy']['match'](/^w(idget)?$/)&&V['clickable']())return V['click']();let dm=V['bounds']();return Y(dm['centerX'](),dm['centerY']());}if(V instanceof a2)return Y(V['centerX'](),V['centerY']());if(V instanceof a3)return Y(V['x'],V['y']);if(a(V)&&'number'==typeof V['x']&&'number'==typeof V['y'])return Y(V['x'],V['y']);if(Array['isArray'](V)&&0x2===V['length']&&V['every'](V=>'number'==typeof V))return Y['apply'](null,V);let Z=this['pickup'](V,'widget');return!!Z&&this['clickOnce'](Z);},'getResult'(){this['impededIFN'](),this['parseArgs']();do{if(this['clickOnce'](V)){if(this['wait'](this['condition'],this['timeout'],0x50))return u(this['buffer_time']),!0x0;}else u(this['timeout']);}while(this['times']--);return!0x1;}}['getResult']();},'pipeline'(V,Y,Z){return'string'!=typeof V?this['pipeline'](String(),V,Y):{'options':Z||{},get 'name'(){return this['_name']=this['_name']||String(this['options']['name']||'pipeline')['surround']('\x22');},'pickup':a9['sel']['pickup']['bind'](a9['sel']),'waitAndClick':aa['waitAndClick']['bind'](aa),'parseActions'(){return this['actions']=Y['map'](V=>a(V)?V:{'locator':V});},'getResult'(){return this['parseActions']()['every']((V,Y)=>this['waitAndClick'](V['locator'],Object['assign']({},this['options'],{'condition':function(){return V['condition']?V['condition']:Ythis['pickup'](this['actions'][Y+0x1]['locator']):void 0x0;}['call'](this),'strategy':V['strategy']}))||_['w']([this['name']+'管道破裂',V['locator']],0x2,0x0,-0x2));}}['getResult']();},'wait'(V,Y,Z,dz){return a(Y)?this['wait'](V,null,null,Y):a(Z)?this['wait'](V,Y,null,Z):{'result':!0x1,'start':Date['now'](),'pickup':a9['sel']['pickup']['bind'](a9['sel']),'options':dz||{},'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('a11yx.wait');},'parseArgs'(){let V='number'==typeof Y?Y:Number(Y)||0x2710;this['times']=V<=0x0||!isFinite(V)||isNaN(V)||V>=0x64?0x1/0x0:V,this['timeout']=V>=0x64?V:0x1/0x0,this['interval']=Z||0xc8,this['interval']>=this['timeout']&&(this['times']=0x1);},'check'(){return l(V)?V:'function'==typeof V?V():this['pickup'](V);},'wait'(){for(;this['times']--&&!(this['result']=this['check']())&&!(Date['now']()-this['start']>this['timeout']);)sleep(this['interval']);},'callbackIFN'(){if('function'==typeof this['options']['then']&&this['result']){let V=this['options']['then']['call'](this['options']['this'],this['result']);void 0x0!==V&&(this['result']=V);}'function'==typeof this['options']['else']&&(this['result']||this['options']['else']['call'](this['options']['this']));},'getResult'(){return this['impededIFN'](),this['parseArgs'](),this['wait'](),this['callbackIFN'](),this['result'];}}['getResult']();},'waitEvery'(V,Y,Z,dF){},'waitSome'(V,Y,Z,dJ){},'waitAndClick'(V,Y,Z,dN){if(a(Y))return this['waitAndClick'](V,null,null,Y);if(a(Z))return this['waitAndClick'](V,Y,null,Z);let dO=!0x0;return this['wait'](V,Y,Z,{'then':function(V){let Y=dN||{};sleep(Y['intermission']||0xf0),dO=this['click'](V,Y)&&dO;}['bind'](this)})&&dO;},'waitAndStable'(V,Y,Z,dU){if(a(Y))return this['waitAndStable'](V,null,null,Y);if(a(Z))return this['waitAndStable'](V,Y,null,Z);let dV={'parseArgs'(){let V=dU||{};this['reference']=V['reference'],this['timeout']=V['timeout']||0x5dc0,this['threshold']=V['threshold']||0x1a4;},'isTimedOut'(){return Date['now']()-this['condition_start']>this['timeout'];},'condition'(){return this['last_condition']=V();},'checkInitCondition'(){let V=void 0x0!==this['reference']?()=>this['condition']()!==this['reference']:()=>this['condition']();return aa['wait'](V,Y,Z,{'then':V=>dV['last_stable']=V});},'checkStableCondition'(){for(this['condition_start']=Date['now']();aa['wait'](()=>dV['last_stable']!==this['condition'](),this['threshold']);)if(dV['last_stable']=dV['last_condition'],this['isTimedOut']())throw Error('a11yx.waitAndStable()\x20timed\x20out\x20waiting\x20for\x20stable\x20condition');return dV['last_stable'];},'getResult'(){return this['parseArgs'](),this['checkInitCondition']()&&this['checkStableCondition']();}};return dV['getResult']();},'swipe':(V,Y,Z,e2)=>({'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('a11yx.swipe');},'parsePoint'(V){if('number'==typeof V)return{'x':halfW,'y':this['scale'](V,'y')};if(Array['isArray'](V)){if(0x2!==V['length']||!V['every'](V=>s(V)))throw Error('Invalid\x20array\x20point:\x20'+V['join'](',\x20'));return{'x':this['scale'](V[0x0],'x'),'y':this['scale'](V[0x1],'y')};}if(a(V)){if('number'!=typeof V['x']||'number'!=typeof V['y'])throw Error('Invalid\x20object\x20point:\x20'+V['x']+',\x20'+V['y']);return{'x':this['scale'](V['x'],'x'),'y':this['scale'](V['y'],'y')};}if(V instanceof a3)return{'x':this['scale'](V['x'],'x'),'y':this['scale'](V['y'],'y')};throw TypeError('Unknown\x20type\x20of\x20point\x20for\x20a11yx.swipe()');},'parseDuration'(){this['duration']=Z>=0xc8?Z:Math['max'](Math['dist'](this['start'],this['end'])/0x5,0xc8);},'parseArgs'(){this['options']=e2||{},this['start']=this['parsePoint'](V),this['end']=this['parsePoint'](Y),this['parseDuration']();},'scale'(V,Y){let Z=void 0x0===Y?'x':Y;return-0x1===V?'x'===Z?W:H:V<0x1?'x'===Z?cX(V):cY(V):V;},'swipe'(){return swipe(this['start']['x'],this['start']['y'],this['end']['x'],this['end']['y'],this['duration']);},'getResult'(){return this['parseArgs'](),this['impededIFN'](),this['swipe']();}}['getResult']()),'swipeInBounds'(){},'swipeInScreen'(){},'swipeAndClick'(){}};V['exports']={'a11yx':aa,'$$sel':aa['selector']()};},121:(e8,e9,ea)=>{let {$$impeded:i,$$toast:n,isNullish:s}=ea(0x2c4),{a11yx:o}=ea(0x2d4),{devicex:a}=ea(0x19f),{timersx:l}=ea(0x357),{consolex:c}=ea(0x2d5),{threadsx:u}=ea(0xef),eb=android['net']['Uri'],ec=java['lang']['Runtime'],ed=android['Manifest'],ee=android['os']['Process'],ef=android['content']['Intent'],eg=android['content']['Context'],eh=android['provider']['Settings']['System'],ei=android['content']['pm']['ApplicationInfo'],ej=android['content']['pm']['PackageManager'],ek=android['app']['ActivityManager'],el=org['autojs']['autojs']['model']['script']['ScriptFile'],em=android['content']['ActivityNotFoundException'],en=org['autojs']['autojs']['ui']['shortcut']['ShortcutCreateActivity'],eo={'alipay_pkg':'com.eg.android.AlipayGphone','autojs_pkg':context['getPackageName'](),get 'autojs_ver'(){let e8=app['autojs']['versionName'];return String(e8)['match'](/^\d/)?e8:ep['getVerName']('Auto.js');},'toPct'(e8,e9,ea){let eu='number'==typeof e9?e9:isNaN(e9)?0x2:Number(e9),ev=(0x64*e8)['toFixed'](eu);return(ea?ev:Number(ev))+'%';},'startActivity'(e8){let e9=ef['FLAG_ACTIVITY_NEW_TASK'];if(e8 instanceof ef)return context['startActivity'](ep['intent'](new ef(e8),{'flags':e9}));if('object'==typeof e8)return u['monitorIFN'](e8['monitor']),e8['root']?void shell('am\x20start\x20'+app['intentToShell'](e8),!0x0):context['startActivity'](ep['intent'](e8,{'flags':e9}));if('string'==typeof e8){let ea=runtime['getProperty']('class.'+e8);if(!ea)throw new Error('Class\x20'+e8+'\x20not\x20found');return context['startActivity'](ep['intent'](new ef(context,ea),{'flags':e9}));}throw Error('Unknown\x20param\x20for\x20appx.startActivity()');}},ep={'version':{'getHex'(e8,e9){if('object'==typeof e8&&(e8=e8['version_name']),!e8)throw Error('A\x20\x22version\x22\x20must\x20be\x20defined\x20for\x20appx.version.getHex()');let ea=e9||{},eC=e8=>('00'+Number(e8||0x0)['toString'](0x10))['slice'](-0x2),eD=e8['toString']()['trim']()['replace'](/^[a-z\s]*(\d+)(?:\.(\d+)(?:\.(\d+)(?:-\d+)?\s*(b(?:eta)?|a(?:lpha)?)?\s*(\d*))?)?$/i,(e8,e9,ea,eD,eE,eL)=>{let eM=[e9,ea,eD]['map'](e8=>eC(e8))['reduce']((e8,e9)=>e8+e9),eN=eL?Number(eL):0x1,eO=0xff;if(eE)if(eE['match'](/b(eta)?/i)){if(eN>=0x7f)throw Error('Beta\x20version\x20code\x20must\x20be\x20smaller\x20than\x20127');eO=0x80;}else if(eE['match'](/a(lpha)?/i)){if(eN>0x80)throw Error('Alpha\x20version\x20code\x20cannot\x20be\x20greater\x20than\x20128');eO=0x0;}return eM+eC(Math['min'](eO+eN,0xff));}),eE='0x'+eD;return'number'===ea['type']?Number(eE):'string_with_prefix'===ea['type']?eE:eD;},'parseHex'(e8,e9){if('number'==typeof e8&&(e8=('0'['repeat'](0x7)+e8['toString'](0x10))['slice'](-0x8)),!e8)throw Error('A\x20\x22version\x22\x20must\x20be\x20defined\x20for\x20appx.version.parseHex()');return e8['replace'](/^0x/,'')['replace'](/(..)(..)(..)(..)/g,(e8,ea,eW,eX,eY)=>{let eZ=[ea,eW,eX]['map'](e8=>Number('0x'+e8))['join']('.'),f0=Number('0x'+eY),f1='';return f0<=0x80?f1='\x20Alpha'+(0x1===f0?'':f0):f0<0xff&&(f0-=0x80,f1='\x20Beta'+(0x1===f0?'':f0)),(null===e9?'':e9||'v')+eZ+f1;});},'parseName'(e8){let e9=/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?\s*((a(lpha)?|b(eta)?)\s*\d*)?$/i,ea=String(e8);return ea['match'](e9)?this['parseHex'](this['getHex'](ea['replace'](e9,(e8,e9,ea,f9,fa)=>e9+'.'+(ea||0x0)+'.'+(f9||0x0)+(fa?'\x20'+fa:'')))):String();},'isNewer'(e8,e9){return this['getHex'](e8)>this['getHex'](e9);}},'getAppName':e8=>e8?app['getAppName'](e8)||app['getPackageName'](e8)&&e8:null,'getPkgName':e8=>e8?!String(e8)['includes']('.')&&app['getPackageName'](e8)||app['getAppName'](e8)&&e8:null,'getVerName':e8=>({'parsePkgName'(){if('string'==typeof e8)return e8['match'](/^auto\.?js$/i)?eo['autojs_pkg']:e8['match'](/^current$/i)?currentPackage():ep['getPkgName'](e8);},'getResult'(){let e8=this['parsePkgName']();if(e8)try{let e9=context['getPackageManager']()['getInstalledPackages'](0x0)['toArray']();for(let ea in e9)if(e8===e9[ea]['packageName'])return e9[ea]['versionName'];}catch(fj){}return null;}}['getResult']()),'checkAccessibility'(){o['ensureSvcAndFunc']();},'checkModules'(e8){let e9=()=>'-'['repeat'](0x21),fm=()=>'\x20-'['repeat'](0x11)['slice'](0x1);e8['filter'](e8=>{let fp='./'+e8+'.js';try{ea(0x206)(fp);}catch(fq){return console['log'](e9()),console['warn'](fp),console['log'](fm()),console['warn'](fq['message']),console['warn'](fq['stack']),!0x0;}})['some']((e8,ea,ft)=>{let fu='';fu+='脚本无法继续|以下模块缺失或加载失败:',fu+=fm()['surround']('|'),ft['forEach'](e8=>fu+='->\x20'+e8['surround']('\x22')),fu+=fm()['surround']('|'),fu+='需正确放置模块文件',console['log'](e9()),fu['split']('|')['forEach'](e8=>console['error'](e8)),console['log'](e9()),toast('模块缺失或加载失败'),exit();});},'checkAlipayPackage'(){let e8,e9,ea=context['getPackageManager']();try{e9=ea['getApplicationInfo'](eo['alipay_pkg'],0x0),e8=ea['getApplicationLabel'](e9);}catch(fA){c['w'](fA,0x0,0x0,0x2);}e8||c['$'](['脚本无法继续','此设备可能未安装\x22支付宝\x22应用'],0x8,0x4,0x0,0x2);},'checkScreenOffTimeout'(e8){let e9=e8||{},ea=a['screen_off_timeout']['get']();if(ea<(e9['min_timeout']||0x3a98)){if(void 0x0!==e9['is_auto_correction']&&!e9['is_auto_correction'])throw Error('Abnormal\x20screen\x20off\x20timeout:\x20'+ea);let e8=e9['default_timeout']||0x1d4c0,fF=(e8/0xea60)['toFixedNum'](0x2);c['d'](['修正异常的设备屏幕超时参数','修正值:\x20'+e8+'(\x20'+fF+'分钟)'],0x0,0x0,-0x2);try{a['screen_off_timeout']['put'](e8);}catch(fG){c['e'](['修正失败',fG],0x2,0x0,-0x2);}}},'checkActivity'(e8){let e9=context['getPackageManager']()['queryIntentActivities'](this['intent'](e8),0x0);return e9&&0x0!==e9['toArray']()['length'];},'resolveActivity'(e8){return this['intent'](e8)['resolveActivity'](context['getPackageManager']());},'startActivity'(e8,e9){try{if('string'==typeof e8||this['checkActivity'](e8))return eo['startActivity'](e8),!0x0;}catch(fM){let fN=e9||{};'function'==typeof fN['onActivityNotFoundException']?fM['javaException']instanceof em&&fN['onActivityNotFoundException']['call'](e8):'suppress'!==fN['onActivityNotFoundException']&&c['$'](fM,0x8,0x2,0x0,0x2);}return!0x1;},'intent'(e8,e9){let ea=e8 instanceof ef?e8:function(e8){let e9=new ef();if(e8['url']&&(e8['data']=function(e8){let e9=e8['url'];return'object'==typeof e9&&(e9=function e8(e9){let {src:ea,query:fR,exclude:g6}=e9;if(!ea||!fR)return ea;let fX=ea['match'](/\?/)?'&':'?';return ea+fX+function e9(ea){let fR=g6||[];return Array['isArray'](fR)||(fR=[fR]),Object['keys'](ea)['map'](g0=>{let fX=ea[g0];return'Object'===Object['prototype']['toString']['call'](fX)['slice'](0x8,-0x1)&&(fX='url'===g0?e8(fX):e9(fX),fX=('__webview_options__'===g0?'&':'')+fX),fR['includes'](g0)||(fX=encodeURI(fX)),g0+'='+fX;})['join']('&');}(fR);}(e9)),e9;}(e8)),e8['package']&&(e8['packageName']=e8['packageName']||e8['package'],delete e8['package']),e8['packageName']&&('alipay'===e8['packageName']['toString']()['toLowerCase']()&&(e8['packageName']=eo['alipay_pkg']),e8['className']?e9['setClassName'](e8['packageName'],e8['className']):e9['setPackage'](e8['packageName'])),e8['extras']&&Object['keys'](e8['extras'])['forEach'](ea=>{e9['putExtra'](ea,e8['extras'][ea]);}),e8['category'])if(Array['isArray'](e8['category']))for(let ea=0x0;e8(o['service']['refreshServiceInfo'](),ea['condition_ready']()),ei='function'!=typeof ea['condition_launch']?()=>currentPackage()===eb:()=>(o['service']['refreshServiceInfo'](),ea['condition_launch']()),ej=ea['disturbance'];ej&&(gb('已开启干扰排除线程'),eg=u['start'](function(){for(;;)sleep(0x4b0),ej();}));let ek=ea['global_retry_times']||0x2,el=ek;for(;ek--;){let e8=ea['launch_retry_times']||0x3,e9=e8,gq=ea['is_show_toast'];if(gq&&'none'!==gq){let e8=ed?'重新开始'+ed['surround']('\x22')+'任务':'重新启动'+ec['surround']('\x22')+'应用';ee?(!0x0===gq||String(gq)['match'](/^(all|greeting(_only)?)$/))&&c['d'](e8['replace'](/重新/g,''),0x1,0x0,0x2):String(gq)['match'](/^(greeting(_only)?)$/)||n(e8);}for(;e8--;){'object'==typeof gc?(gb('加载intent参数启动应用'),this['startActivity'](gc)):'string'==typeof gc?(gb('加载应用包名参数启动应用'),app['launchPackage'](eb)||(gb('加载应用名称参数启动应用'),app['launchApp'](ec))):(gb('使用触发器方法启动应用'),gc());let ea='(\x20'+(e9-e8)+'/'+e9+')';if(o['wait'](ei,0x1388,0x320)){gb('应用启动成功');break;}gb('应用启动超时'+ea),gb(currentPackage(),0x0,0x1);}if(e8<0x0&&c['$']('打开'+ec['surround']('\x22')+'失败',0x8,0x4,0x0,0x2),s(eh)){gb('未设置启动完成条件参数');break;}ee=!0x1,gb('开始监测启动完成条件');let gu=ea['ready_retry_times']||0x3,ef=gu;for(;!o['wait'](eh,0x1f40)&&gu--;){let e8=(ef-gu+'/'+ef)['surround']('()');'object'==typeof gc?(gb('重新启动Activity\x20'+e8),this['startActivity'](gc)):(gb('重新启动应用\x20'+e8),app['launchPackage'](gc));}if(gu>=0x0){gb('启动完成条件监测完毕');break;}gb('尝试关闭'+ec['surround']('\x22')+'应用:'),gb((el-ek+'/'+el)['surround']('()')),this['kill'](eb);}return eg&&(eg['interrupt'](),gb('干扰排除线程结束'),eg=null),ek<0x0&&c['$'](ef['surround']('\x22')+'初始状态准备失败',0x8,0x4,0x0,0x2),gb(ef['surround']('\x22')+'初始状态准备完毕'),!0x0;},'launchAndClearTop'(e8){this['startActivity'](this['intent'](this['getLaunchIntentForPackage'](e8),{'flags':ef['FLAG_ACTIVITY_CLEAR_TOP']}));},'getLaunchIntentForPackage':e8=>context['getPackageManager']()['getLaunchIntentForPackage'](e8||eo['autojs_pkg']),'kill'(e8,e9){let ea=e9||{};ea['no_impeded']||'function'==typeof i&&i(this['kill']['name']);let gC=e8||'';gC||(gC=currentPackage(),c['w'](['自动使用currentPackage()返回值','appx.kill()未指定name参数']));let gD=this['getAppName'](gC),gE=this['getPkgName'](gC);gD&&gE||c['$']('解析应用名称及包名失败',0x8,0x4,0x0,0x2);let gF=void 0x0===ea['shell_acceptable']||ea['shell_acceptable'],gG=void 0x0===ea['keycode_back_acceptable']||ea['keycode_back_acceptable'],eb=ea['keycode_back_twice']||!0x1,ec=ea['condition']||(()=>{let e8=()=>currentPackage()===gE;return o['wait'](()=>!e8(),0x2ee0)&&!o['wait'](e8,0x3,0x96);}),ed=!0x1,ee=Date['now'](),ef=ea['shell_max_wait_time']||0x2710;if(gF)try{ed=!shell('am\x20force-stop\x20'+gE,!0x0)['code'];}catch(gN){c['_']('shell()方法强制关闭'+gD['surround']('\x22')+'失败');}else c['_']('参数不接受shell()方法');if(!ed)return gG?function(){c['_']('尝试最小化当前应用');let e8=[idMatches(/.*nav.back|.*back.button/),descMatches(/关闭|返回/),textMatches(/关闭|返回/)],e9=0x14,ea=e9,gR=()=>{back(),back(),eb&&(sleep(0xc8),back());};for(;e9--;){let e9=!0x1;for(let ea=0x0,gR=e8['length'];eac['_'](['shell()关闭'+gD['surround']('\x22')+'成功','关闭用时:\x20'+eg+'毫秒']),'else':()=>c['e'](['关闭'+gD['surround']('\x22')+'失败','关闭时间已达最大超时'],0x1)});},'killProcess'(e8){let e9={'parseArgs'(){this['options']=e8||{},this['pid']=this['options']['pid']>0x0?this['options']['pid']:ee['myPid']();},'parseTask'(){let e8=this['pending_task'];if('object'==typeof e8)return e8;if('string'==typeof e8&&e8['match'](/^current(.*\d+s)?$/i)){let ea=e8['match'](/\d+/);return{'path':engines['myEngine']()['getSource'](),'date':Date['now']()+0x3e8*(ea?ea[0x0]:0x5),'is_async':e9['options']['is_async']};}throw Error('Cannot\x20parse\x20pending_task\x20for\x20appx.killProcess()');},'addTask'(){if(this['pending_task']=this['options']['pending_task'])return l['addDisposableTask'](Object['assign'](this['parseTask'](),{'callback'(){e9['killNow']();}})),!0x0;},'killNow'(){ee['killProcess'](this['pid']);},'kill'(){this['parseArgs'](),this['addTask']()||this['killNow']();}};e9['kill']();},'restart'(e8,e9){let ea=e8||currentPackage(),h4=e9||{};return this['kill'](ea,h4['kill'])&&this['launch'](ea,h4['launch']);},'hasRoot'(){try{return 0x0===shell('date',!0x0)['code'];}catch(h5){return!0x1;}},'hasSecure'(){return this['checkPermission']('WRITE_SECURE_SETTINGS');},'checkPermission'(e8){if(void 0x0===e8)throw Error('Argument\x20permission\x20must\x20be\x20specified');if('string'!=typeof e8)throw Error('Argument\x20permission\x20must\x20be\x20string\x20type');let e9=ed['permission'][e8['replace'](/[^A-Z_]+/g,'')];return context['checkCallingOrSelfPermission'](e9)===ej['PERMISSION_GRANTED'];},'canWriteSystem':()=>eh['canWrite'](context),'getInstalledApplications'(e8){let e9=e8||{},ea=e8=>{let hb=e8=>'string'==typeof e8?[e8]:e8||[],hc=hb(e9['include']),hd=hb(e9['exclude']);return(ea=hc['length']?e8=>(hc['includes'](e8['pkg_name'])||hc['includes'](e8['app_name']))&&!hd['includes'](e8['pkg_name'])&&!hd['includes'](e8['app_name']):e8=>!hd['includes'](e8['pkg_name'])&&!hd['includes'](e8['app_name']))(e8);},hb=e8=>'function'==typeof e9[e8]?e9[e8]():e9[e8],hc=context['getPackageManager'](),hd=hc['getInstalledApplications'](0x0)['toArray']()['map'](e8=>({'app_name':e8['loadLabel'](hc),'pkg_name':e8['packageName'],'is_enabled':e8['enabled'],'is_system':this['isSystemApp'](e8)}))['filter'](ea),he=hb('is_system');'boolean'==typeof he&&(hd=hd['filter'](e8=>e8['is_system']===he));let hq=hb('is_enabled');return'boolean'==typeof hq&&(hd=hd['filter'](e8=>e8['is_enabled']===hq)),Object['assign'](hd,{'getAppNames'(){return this['map'](e8=>e8['app_name']);},'getPkgNames'(){return this['map'](e8=>e8['pkg_name']);},'getJointStrArr'(e8,e9){return this['map'](ea=>e9?ea['pkg_name']+(e8||'\x0a')+ea['app_name']:ea['app_name']+(e8||'\x0a')+ea['pkg_name'])['sort']();}});},'createShortcut'(e8){if(!e8)throw Error('File\x20is\x20required\x20for\x20appx.createShortcut()');let e9=files['path'](e8);if(!files['isFile'](e9))throw Error('File\x20argument\x20must\x20be\x20a\x20file');if(!files['exists'](e9))throw Error('File\x20is\x20not\x20existed');let ea=new en()['getClass'](),hA=en['EXTRA_FILE'],hB=new el(e9),hC=new ef(context,ea)['putExtra'](hA,hB);this['startActivity'](hC);},'isSystemApp'(e8){if(!(e8 instanceof ei))throw Error('Source\x20must\x20be\x20the\x20instance\x20of\x20ApplicationInfo');return 0x0!=(e8['flags']&ei['FLAG_SYSTEM']);},'getMemoryInfo'(){let e8=context['getSystemService'](eg['ACTIVITY_SERVICE']),e9=new ek['MemoryInfo']();e8['getMemoryInfo'](e9);let {totalMem:ea,availMem:i,lowMemory:n}=e9,hG=ea-i,hH=hG/ea,hI=i/ea;return{'$memory_info':e9,'total':ea,'is_low':n,'avail':i,'avail_usage':hI,'avail_pct':eo['toPct'](hI),'used':hG,'used_usage':hH,'used_pct':eo['toPct'](hH)};},'getProcessMemoryInfo'(e8){let e9=ec['getRuntime']()['maxMemory'](),ea='number'==typeof e8?e8:ee['myPid'](),hM=context['getSystemService'](eg['ACTIVITY_SERVICE'])['getProcessMemoryInfo']([ea])[0x0],hN=hM['getTotalPrivateDirty']()<<0xa,hO=hM['getTotalPss']()<<0xa,hP=hM['getMemoryStat']('summary.java-heap')<<0xa,hQ=hP/e9;return{'$process_memory_info':hM,'uss':hN,'pss':hO,'heap':hP,'heap_usage':hQ,'heap_pct':eo['toPct'](hQ)};},'getRuntimeMemoryInfo'(){let e8=ec['getRuntime'](),e9=e8['maxMemory'](),ea=e8['totalMemory'](),hU=ea-e8['freeMemory'](),hV=hU/e9;return{'total':ea,'max':e9,'heap':hU,'heap_usage':hV,'heap_pct':eo['toPct'](hV)};}};e8['exports']={'appx':ep};},203:hW=>{let hX=android['content']['res']['ColorStateList'],hY={'toStr'(hW,hX){'string'==typeof hW&&Number(hW)['toString']()===hW&&(hW=Number(hW));let hY='number'==typeof hW?colors['toString'](hW):hW;if('string'!=typeof hY)throw TypeError('Unknown\x20type\x20of\x20color\x20for\x20colorsx.toStr()');let i2=colors['alpha'](hY),i3=colors['red'](hY),i4=colors['green'](hY),i5=colors['blue'](hY);if(void 0x0===hX||!0x0===hX||'keep'===hX||0x8===hX)return hY;if(!0x1===hX||'none'===hX||0x6===hX)return'#'+colors['toString'](colors['rgb'](i3,i4,i5))['slice'](-0x6);if('auto'===hX)return i2<0xff?hY:colors['toString'](colors['rgb'](i3,i4,i5));throw TypeError('Unknown\x20type\x20of\x20alpha\x20for\x20colorsx.toStr()');},'toInt'(hW){let hX;'string'==typeof hW&&Number(hW)['toString']()===hW&&(hW=Number(hW));try{hX='string'==typeof hW?colors['parseColor'](hW):hW;}catch(i8){throw console['error']('Passed\x20color:\x20'+hW),Error(i8+'\x0a'+i8['stack']);}if('number'!=typeof hX)throw TypeError('Unknown\x20type\x20of\x20color\x20for\x20colorsx.toInt()');return hX;},'hrgba'(hW){if('string'!=typeof hW)throw Error('Param\x20rgba_hex\x20must\x20be\x20a\x20string\x20type');if('#'!==hW[0x0])throw Error('Param\x20rgba_hex\x20must\x20started\x20with\x20hash\x20symbol');if(0x7===(hW=hW['trim']()['toUpperCase']())['length']&&(hW+='FF'),0x9!==hW['length'])throw Error('Length\x20of\x20param\x20rgba_hex\x20must\x20be\x207\x20or\x209');return this['toInt']('#'+hW['slice'](-0x2)+hW['slice'](0x1,-0x2));},'toColorStateList'(hW){return hX['valueOf'](this['toInt'](hW));}};hW['exports']={'colorsx':hY};},725:(ib,ic,ie)=>{let {isPlainObject:i,$$toast:n}=ie(0x2c4),ig={'StateManager':function(){let ib=function(ib){this['state']=ib,this['last_state']=ib;};return ib['prototype']={'switchOn'(){this['last_state']=this['state'],this['state']=!0x0;},'switchOff'(){this['last_state']=this['state'],this['state']=!0x1;},'switchGet'(){return this['state'];},'switchSet'(ib){this['last_state']=this['state'],this['state']=i(ib)?ib['isDebug']:ib;},'switchBack'(){let ib=this['state'];this['state']=this['last_state'],this['last_state']=ib;},'enable'(){this['switchOn']();},'disable'(){this['switchOff']();},'isEnabled'(){return!0x0===this['switchGet']();}},ib;}(),'DebugConstructor'(ib,ic){let ie=function(ib,ic,it,iu){return{'parseMsgLevel'(){this['message_level']=void 0x0===ic?0x0:ic,this['is_high_level']=0x3===ic||'w'===ic||'warn'===ic||0x4===ic||'e'===ic||'error'===ic||0x8===ic||'x'===ic||0x9===ic||'r'===ic;},'trigger':()=>ie['switchGet'](),'print'(){ig['print'](ib,this['message_level'],0x0,it,iu,{'msg_prefix':'»','indent_symbol':'-\x20','indent_repeat':'whole','indent_trailing_space':!0x1});},'getResult'(){return this['trigger']()&&(this['parseMsgLevel'](),this['print']()),!this['is_high_level'];}}['getResult']();};return ig['StateManager']['call'](ie,ib),Object['assign'](ie,ig['StateManager']['prototype'],{'switchGet'(){let ib=ie['state'];if('boolean'==typeof ib)return ib;if(void 0x0!==ie['depot']){let ib=ie['depot']['state'];if('boolean'==typeof ib)return ib;}return'boolean'==typeof ig['debug']['state']?ig['debug']['state']:'object'==typeof global['consolex']?global['consolex']['debug']['state']:void 0x0;}}),Object['assign'](ie,{'depot':ic,'fuel'(ib){let ic=i(ib)?ib['isDebug']:ib;return new ig['DebugConstructor'](ic,ie);},'border'(ib,ic,iB){ie['isEnabled']()&&ig['border'](ib,void 0x0===ic?0x0:ic,iB);},'__'(ib,ic,ie){this['border']['apply'](this,arguments);}}),ie;},'setGlobalLogConfig'(ib){context['getPackageName']()['match'](/Pro\b/i)&&delete ib['filePattern'],console['setGlobalLogConfig'](ib);},'printBorder'(ib,ic,ie){this['border']['apply'](this,arguments);},'debugBorder'(ib,ic,ie){this['debug']['border']['apply'](this,arguments);},'$print'(){let ib={'last_border':{'save'(ib,ic){this['style']=ib,this['level']=ic;},'clear'(){delete this['style'],delete this['level'];},'match'(ib,ic){return ib&&ib===this['style']&&ic===this['level'];}}};return this['$']=this['print']=function(ic,ie,iT,iU,iV,iW){if(ic instanceof Error)return this['print'](ic['message']+'\x0a\x0a'+ic['stack']['replace'](/\s+.+?\n/g,'->$&'),ie,iT,iU,iV,iW);let iX={'trigger':()=>ig['print']['isEnabled'](),'parseBorder'(){let ib=Number(iV)||0x0,ic=String(void 0x0===iV?'':iV),ie=ic['match'](/[_\d]n(\d*)$/);this['border_line_break']=null!==ie?Number(ie[0x1]||0x1):0x0,ic['match'](/dash\/|-0\.5/)||-0.5===ib?this['border_line_before']='dash':ic['match'](/^(\/?dash|0\.5)(_?n\d*)?$/)||0.5===ib?this['border_line_after']='dash':ic['match'](/solid\/|-1/)||-0x1===ib?this['border_line_before']='solid':ic['match'](/^(\/?solid|1)(_?n\d*)?$/)||0x1===ib?this['border_line_after']='solid':ic['match'](/^(solid\/dash|-1\.5)(_?n\d*)?$/)||-1.5===ib?(this['border_line_before']='solid',this['border_line_after']='dash'):ic['match'](/^(dash\/solid|1\.5)(_?n\d*)?$/)||1.5===ib?(this['border_line_before']='dash',this['border_line_after']='solid'):ic['match'](/^(dashes|dash\/dash|-2)(_?n\d*)?$/)||-0x2===ib?(this['border_line_before']='dash',this['border_line_after']='dash'):(ic['match'](/^(solids|solid\/solid|2)(_?n\d*)?$/)||0x2===ib)&&(this['border_line_before']='solid',this['border_line_after']='solid');},'parseMsgLevel'(){switch(ie){case null:this['no_msg_level']=!0x0;break;case 0x0:case'v':case'verbose':this['fn']=console['verbose']['bind'](console);break;case void 0x0:case 0x1:case'l':case'd':case'log':this['fn']=console['log']['bind'](console);break;case 0x2:case'i':case'info':this['fn']=console['info']['bind'](console);break;case 0x3:case'w':case'warn':this['fn']=console['warn']['bind'](console),this['is_high_level']=!0x0;break;case 0x4:case'e':case'error':this['fn']=console['error']['bind'](console),this['is_high_level']=!0x0;break;case 0x8:case'x':this['fn']=console['error']['bind'](console),this['should_exit']=!0x0,this['is_high_level']=!0x0;break;case 0x9:case'r':this['fn']=console['error']['bind'](console),this['show_ex_msg']=!0x0,this['should_exit']=!0x0,this['is_high_level']=!0x0;break;default:throw Error('Invalid\x20message\x20level\x20for\x20consolex.print():\x20'+ie);}},'parseIndent'(){this['indent']={'lv':Math['min'](Number(iU)||0x0,0xa),'trigger'(){return this['lv']>0x0&&!iX['no_msg_level'];},'getIndent'(){let ib=iX['options']['indent_symbol']||'->',ic=iX['options']['indent_repeat']||'first',ie=void 0x0===iX['options']['indent_trailing_space']||Boolean(iX['options']['indent_trailing_space'])?'\x20':'';switch(ic){case'first':return ib['slice'](0x0,0x1)['repeat'](this['lv'])+ib['slice'](0x1)+ie;case'last':return ib['slice'](0x0,-0x1)+ib['slice'](-0x1)['repeat'](this['lv'])+ie;default:return ib['repeat'](this['lv'])+ie;}},'getResult'(){return this['trigger']()?this['getIndent']():'';}}['getResult']();},'stringify':ib=>Array['isArray'](ib)?ib['join'](',\x20')['surround']('[\x20'):i(ib)?Object['keys'](ib)['map'](ic=>ic+':\x20'+ib[ic])['join'](',\x20')['surround']('{\x20'):ib&&'function'==typeof ib['toString']?ib['toString']():void 0x0===ib?String():String(ib),'parseArgs'(){this['options']=iW||{},this['parseBorder'](),this['parseMsgLevel'](),this['parseIndent'](),this['msg_body']=Array['isArray'](ic)?ic['map'](this['stringify']['bind'](this)):this['stringify'](ic),this['prefix']=void 0x0===this['options']['msg_prefix']?'':String(this['options']['msg_prefix']||'')+'\x20';},'toastIFN'(){let ib='function'==typeof n?n:toast,ic=Array['isArray'](this['msg_body'])?this['msg_body']['join']('\x0a'):this['msg_body'];switch(iT){case 0x2:case'l':case'long':return ib(ic,'l');case 0x3:case's/f':case'short/forcible':return ib(ic,'s','f');case 0x4:case'l/f':case'long/forcible':return ib(ic,'l','f');}iT&&ib(ic,'S');},'showBorderIFN'(){let {border_line_before:ic,border_line_after:i,border_line_break:n}=this,{border_prefix:iT}=this['options'],iU=(void 0x0===ie?0x1:Number(ie)||0x0)['clamp'](0x0,0x1),iV=[()=>{void 0x0===ic||this['no_msg_level']||ib['last_border']['match'](ic,iU)||ig['print']['border'](ic,iU,0x0,!0x1,iT);},()=>{void 0x0===i||this['no_msg_level']||(ig['print']['border'](i,iU,n,!0x0,iT),n&&ib['last_border']['clear']());}][Symbol['iterator']]();return(this['showBorderIFN']=()=>iV['next']()['value']())();},'showMessageIFN'(){this['no_msg_level']||(ib['last_border']['clear'](),Array['isArray'](this['msg_body'])?this['msg_body']['forEach'](this['showMsg']['bind'](this)):this['showMsg'](this['msg_body']));},'showMsg'(ib){this['fn'](this['prefix']+this['indent']+ib);},'getResult'(){return this['trigger']()&&(this['parseArgs'](),this['toastIFN'](),this['showBorderIFN'](),this['showMessageIFN'](),this['showBorderIFN'](),this['show_ex_msg']&&ig['print']('Forcibly\x20stopped',0x4,0x1),this['should_exit']&&exit()),!this['is_high_level'];}};return iX['getResult']();},Object['assign'](this['print'],new this['StateManager'](!0x0),this['StateManager']['prototype'],{'border'(ic,ie,jd,je,jf){let jg={'style':String(ic||'solid'),'level':(void 0x0===ie?0x1:Number(ie)||0x0)['clamp'](0x0,0x1),'break':'\x0a'['repeat'](Math['max'](Number(jd)||0x0,0x0)),'prefix':void 0x0===jf?'':String(jf)+'\x20','trigger'(){return ig['print']['isEnabled']()&&!ib['last_border']['match'](this['style'],this['level']);},'saveStateIFN'(){je&&!this['break']&&ib['last_border']['save'](this['style'],this['level']);},'printIFN'(){let ib=this['style']['match'](/dash/)?this['prefix']+'-\x20'['repeat'](0x11)['trim']():this['prefix']+'-'['repeat'](0x21);this['level']?console['log'](ib+this['break']):console['verbose'](ib+this['break']);}};jg['trigger']()&&(jg['saveStateIFN'](),jg['printIFN']());}}),this['__']=this['border']=function(ib,ic,ie){this['print']['border'](ib,ic,ie,!0x0);},this['v']=this['verbose']=(ib,ic,ie,jo)=>this['$'](ib,0x0,ic,ie,jo),this['d']=this['log']=(ib,ic,ie,js)=>this['$'](ib,0x1,ic,ie,js),this['i']=this['info']=(ib,ic,ie,jw)=>this['$'](ib,0x2,ic,ie,jw),this['w']=this['warn']=(ib,ic,ie,jA)=>this['$'](ib,0x3,ic,ie,jA),this['e']=this['error']=(ib,ic,ie,jE)=>this['$'](ib,0x4,ic,ie,jE),delete this['$print'],this;},'$debug'(){return this['_']=this['debug']=new this['DebugConstructor'](void 0x0),delete this['$debug'],this;},'$bind'(){return this['$print']()['$debug'](),delete this['$bind'],this;}};ig['$bind'](),ib['exports']={'consolex':ig};},190:(jF,jG,jH)=>{let {isNullish:i}=jH(0x2c4),{filesx:n}=jH(0x2fb),jI=java['io']['File'],jJ=java['util']['zip']['CRC32'],jK=android['util']['Base64'],jL=javax['crypto']['Cipher'],jM=javax['crypto']['spec']['SecretKeySpec'],jN=java['security']['KeyFactory'],jO=java['security']['MessageDigest'],jP=java['security']['KeyPairGenerator'],jQ=java['security']['spec']['X509EncodedKeySpec'],jR=java['security']['spec']['PKCS8EncodedKeySpec'],jS=javax['crypto']['CipherOutputStream'],jT=java['io']['FileInputStream'],jU=java['io']['FileOutputStream'],jV=java['io']['ByteArrayOutputStream'],jW=function(){let jF=function(jF,jG){let jH=jG||{};this['keyPair']=jH['keyPair'],delete jH['keyPair'];let k2=new java['io']['ByteArrayOutputStream']();jX['_input'](jF,jH,(jF,jG,jH)=>{k2['write'](jF,jG,jH);}),this['data']=k2['toByteArray']();};return jF['prototype']['toKeySpec']=function(jF){let jG=String(jF)['replace'](/^(.+?)(?=\/).*$/,'$1');if('RSA'===jG){if('public'===this['keyPair'])return jN['getInstance'](jG)['generatePublic'](new jQ(this['data']));if('private'===this['keyPair'])return jN['getInstance'](jG)['generatePrivate'](new jR(this['data']));throw Error('Property\x20keyPair\x20must\x20be\x20either\x20public\x20or\x20private');}return new jM(this['data'],jG);},jF['prototype']['toString']=function(){let jF=jK['encodeToString'](this['data'],jK['NO_WRAP']);return this['keyPair']?'Key['+this['keyPair']+']{data=\x27'+jF+'\x27}':'Key{data=\x27'+jF+'\x27}';},jF;}(),jX={'_pwmap':new Function('return\x20{_dec(e,l){let\x20i=e.split(/,\x20?/).map(e=>e.replace(/^\x22([^]+)\x22$/g,\x22$1\x22)),s=0,a=\x22\x22;for(var\x20r=\x22_.|._\x22;;){for(let\x20t=0;t0x0;)jH(kf,0x0,jG);}else{let jG=function(){return'base64'===kc['input']?jK['decode'](jF,jK['NO_WRAP']):'hex'===kc['input']?this['_fromHex'](jF):'string'==typeof jF?new java['lang']['String'](jF)['getBytes'](kc['encoding']||'utf-8'):jF;}['call'](this);jH(jG,0x0,jG['length']);}},'_output'(jF,jG,jH){let kk=jG['output']||jH;if('base64'===kk)return jK['encodeToString'](jF,jK['NO_WRAP']);if('bytes'===kk)return jF;let kl=jG['encoding']||'utf-8';return'string'===kk?new java['lang']['String'](jF,kl)['toString']():this['_toHex'](jF);},'_toHex':jF=>jF['map'](jF=>{let jG=java['lang']['Integer']['toHexString'](0xff&jF);return jG['length']%0x2?'0'+jG:jG;})['join']('')['toUpperCase'](),'_fromHex'(jF){let jG=util['java']['array']('byte',jF['length']/0x2);return String(jF)['match'](/\w{2}/g)['forEach']((jF,jH)=>{let kt=java['lang']['Integer']['valueOf'](jF,0x10);jG[jH]='number'==typeof kt?new java['lang']['Integer'](kt)['byteValue']():kt['byteValue']();}),jG;},'_cipher'(jF,jG,jH,kx,ky){let jI=ky||{},jJ=jL['getInstance'](kx);jJ['init'](jG,jH['toKeySpec'](kx));let jK=function(){if('file'===jI['output'])return delete jI['output'],void 0x0!==jI['dest'];}(),jM=jK?new jU(jI['dest']):new jV(),jN=new jS(jM,jJ),jO=null;try{this['_input'](jF,jI,(jF,jG,jH)=>{jN['write'](jF,jG,jH);});}catch(kI){jO=kI;}finally{try{jN['close']();}catch(kJ){}}if(!jK&&!jO)return this['_output'](jM['toByteArray'](),jI,'bytes');},'Key':jW,'KeyPair':function(jF,jG,jH){let kN=jH||{};this['publicKey']=new jW(jF,Object['assign'](kN,{'keyPair':'public'})),this['privateKey']=new jW(jG,Object['assign'](kN,{'keyPair':'private'}));},'digest'(jF,jG,jH){let kR=jH||{},kS='CRC32'===jG?new jJ():jO['getInstance'](jG);return this['_input'](jF,kR,(jF,jG,jH)=>{kS['update'](jF,jG,jH);}),'CRC32'===jG?kS['getValue']()['toString'](0x10)['toUpperCase']():this['_output'](kS['digest'](),kR,'hex');},'digestFile'(jF,jG,jH){let kZ=Object['assign'](jH||{},{'input':'file'});if('string'==typeof jF)return this['digest'](files['path'](jF),jG,kZ);if(jF instanceof jI)return this['digest'](jF,jG,kZ);throw TypeError('Invalid\x20type\x20of\x20path\x20for\x20cryptox.digestFile()');},'encrypt'(jF,jG,jH,l3){return this['_cipher'](jF,jL['ENCRYPT_MODE'],jG,jH,l3);},'decrypt'(jF,jG,jH,l7){return this['_cipher'](jF,jL['DECRYPT_MODE'],jG,jH,l7);},'generateKeyPair'(jF,jG){let jH=jP['getInstance'](jF);jH['initialize'](jG||0x100);let lb=jH['generateKeyPair']();return new this['KeyPair'](lb['getPublic']()['getEncoded'](),lb['getPrivate']()['getEncoded']());},'generateRandomKeyInput'(jF){let jG=jF||0x20;if(0x20!==jG&&0x10!==jG)throw Error('length\x20must\x20be\x20either\x2016\x20or\x2032');let jH='';for(let jF=0x0;jF<0x20;jF+=0x1)jH+=String['fromCharCode'](0x9fff*Math['random']());return String(this['digest'](jH,'MD5'))['slice'](-jF);},'_getKey'(jF){if(!jF)throw Error('Invalid\x20key\x20for\x20cryptox._getKey()');if(jF['length']%0x10==0x0&&jF['match'](/^[a-f0-9]+$/i))return new this['Key'](jF);let jG=n['.local']('key.nfex');files['exists'](jG)||files['createWithDirs'](jG);let jH=n['readJson'](jG);if(jH[jF])return new this['Key'](jH[jF]);let lj=jH[jF]=this['generateRandomKeyInput']();return n['writeJson'](jG,jH),new this['Key'](lj);},'enc'(jF,jG){return this['encrypt'](jF,this['_getKey'](jG),'AES/ECB/PKCS5Padding',{'output':'hex'});},'dec'(jF,jG){if(i(jF)||jF===String())return jF;let jH=null,lp=function(){try{return this['decrypt'](jF,this['_getKey'](jG),'AES/ECB/PKCS5Padding',{'output':'string','input':'hex'});}catch(lq){jH=lq;}}['call'](this);if(!i(lp))return lp;let jI=this['_pwmap']['decrypt'](jF);if(!i(jI))return jI;throw Error(null!==jH?jH:'Decrypted\x20failed');}};jF['exports']={'cryptox':jX};},415:(ls,lu,lw)=>{let {$$impeded:i,$$toast:n,$$cvt:s,$$link:o,isNullish:a,$$str:l,$$und:c,$$nul:u,$$arr:p,$$num:h,$$rex:_,$$func:d}=lw(0x2c4),{timersx:g}=lw(0x357),{consolex:f}=lw(0x2d5),{a11yx:m,$$sel:y}=lw(0x2d4),lx=android['provider']['Settings'],ly=lx['System'],lz=lx['Global'],lA=lx['Secure'],lB=java['io']['File'],lC=android['net']['Uri'],lD=android['view']['Surface'],lE=android['content']['Intent'],lF=android['content']['Context'],lG=android['content']['res']['Resources'],lH=android['content']['IntentFilter'],lI=android['os']['Environment'],lJ=android['os']['PowerManager'],lK=android['os']['BatteryManager'],lL=android['util']['DisplayMetrics'],lM=org['autojs']['autojs']['tool']['RootTool'],lN={'FLAGS_ON':lJ['SCREEN_BRIGHT_WAKE_LOCK']|lJ['ACQUIRE_CAUSES_WAKEUP'],'FLAGS_DIM':lJ['SCREEN_DIM_WAKE_LOCK']|lJ['ACQUIRE_CAUSES_WAKEUP'],get 'keycode$'(){return this['_keycode$']=this['_keycode$']||i['detach'](this['keycode'],0x1);},get 'power_service'(){return context['getSystemService'](lF['POWER_SERVICE']);},'screen_metrics':{'metrics':runtime['getScreenMetrics'](),'getInfo'(){return{'width':this['metrics']['rescaleX'](W),'height':this['metrics']['rescaleY'](H)};},'setRatio'(ls){this['setMetrics'](ls*W,ls*H);},'setMetrics'(ls,lu){let lw=ls<=0x0?W:ls<0x1?W*ls:ls,lS=lu<=0x0?H:lu<0x1?H*lu:lu;runtime['setScreenMetrics'](lw,lS);},'getRatio'(){return{'width':this['metrics']['rescaleX'](W)/W,'height':this['metrics']['rescaleY'](H)/H};},'reset'(){this['setRatio'](0x0);},'saveState'(){let ls=this['getInfo']();this['_screen_metrics_w']=ls['width'],this['_screen_metrics_h']=ls['height'];},'loadState'(){let ls=this['_screen_metrics_w'],lu=this['_screen_metrics_h'];if(void 0x0===ls||void 0x0===lu)throw Error('State\x20must\x20be\x20saved\x20before\x20loading');this['setMetrics'](ls,lu),delete this['_screen_metrics_w'],delete this['_screen_metrics_h'];}},'battery':{'_getStatusIntent':()=>context['registerReceiver'](null,new lH(lE['ACTION_BATTERY_CHANGED'])),'_getStatus'(ls,lu,lw){let lZ=ls=>void 0x0===lw?ls:lw,m0=this['_getStatusIntent'](),m1=lK['EXTRA_'+ls];switch(lu){case'Boolean':return m0['getBooleanExtra'](m1,lZ(!0x1));case'Byte':return m0['getByteExtra'](m1,lZ(-0x1));case'Char':return m0['getCharExtra'](m1,lZ(''));case'Double':return m0['getDoubleExtra'](m1,lZ(-0x1));case'Float':return m0['getFloatExtra'](m1,lZ(-0x1));case'Long':return m0['getLongExtra'](m1,lZ(-0x1));case'Short':return m0['getShortExtra'](m1,lZ(-0x1));case'String':return m0['getStringExtra'](m1);default:return m0['getIntExtra'](m1,lZ(-0x1));}},'_checkNumRange'(ls,lu,lw,m6,m7){let m8=(ls,lu)=>void 0x0===ls||isNaN(Number(ls))?lu:Number(ls);return ls>=m8(lu,lw||-0x1/0x0)&&ls<=m8(m6,m7||0x1/0x0);},'getPercentage'(){let ls=this['_getStatusIntent']();return 0x64*ls['getIntExtra'](lK['EXTRA_LEVEL'],-0x1)/ls['getIntExtra'](lK['EXTRA_SCALE'],-0x1);},'checkPercentage'(ls){return this['_checkNumRange'](this['getPercentage'](),ls,0xf);},'isBatteryLow'(){return device['sdkInt']<0x1c?!this['checkPercentage'](0xf):this['_getStatus']('BATTERY_LOW','Boolean',!0x1);},'getTemperature'(ls){let lu=this['_getStatus']('TEMPERATURE')/0xa,lw=ls||{};return{get 'C'(){let ls=mj(lw['unit'],'°C');return null===ls?lu:lu+ls;},get 'F'(){let ls=mj(lw['unit'],'°F'),mi=Number((0x9*lu/0x5+0x20)['toFixed'](0x1));return null===ls?mi:mi+ls;}}['C'===(lw['format']||'C')['toUpperCase']()['slice'](0x0,0x1)?'C':'F'];function mj(ls,lu){return!0x0===ls?lu:'string'==typeof ls?ls:null;}},'getTemperatureString'(){return this['getTemperature']()+'°C';},'checkTemperature'(ls,lu){return this['_checkNumRange'](this['getTemperature'](),ls,-0xf,lu,0x29);},'isOverheating'(){return this['getHealth']()===lK['BATTERY_HEALTH_OVERHEAT'];},'isOvercooling'(){return this['getHealth']()===lK['BATTERY_HEALTH_COLD'];},'getHealth'(){return this['_getStatus']('HEALTH',lK['BATTERY_HEALTH_UNKNOWN']);},'getHealthDescription'(ls){return'detailed'===ls||void 0x0===ls?{1:'状态未知',2:'状态良好',3:'温度过高',4:'已损坏',5:'电压过高',6:'状态未指明',7:'温度过低'}[this['getHealth']()]:{1:'未知',2:'良好',3:'过热',4:'损坏',5:'电压过高',6:'未指明',7:'过冷'}[this['getHealth']()];},'isHealthy'(){return this['getHealth']()===lK['BATTERY_HEALTH_GOOD'];},'isCharging'(){return this['_getStatus']('STATUS')===lK['BATTERY_STATUS_CHARGING']||this['isCharged']();},'isCharged'(){return this['_getStatus']('STATUS')===lK['BATTERY_STATUS_FULL'];},'isAcPlugged'(){return this['_getStatus']('PLUGGED')===lK['BATTERY_PLUGGED_AC'];},'isUsbPlugged'(){return this['_getStatus']('PLUGGED')===lK['BATTERY_PLUGGED_USB'];},'isWirelessPlugged'(){return this['_getStatus']('PLUGGED')===lK['BATTERY_PLUGGED_WIRELESS'];},'isPlugged'(){return this['isAcPlugged']()||this['isUsbPlugged']()||this['isWirelessPlugged']();},'isPluggedAndStayingOn'(){let ls=lN['stay_on_while_plugged_in']['get'](),lu=lu=>(lu&ls)===lu;return this['isAcPlugged']()&&lu(lK['BATTERY_PLUGGED_AC'])||this['isUsbPlugged']()&&lu(lK['BATTERY_PLUGGED_USB'])||this['isWirelessPlugged']()&&lu(lK['BATTERY_PLUGGED_WIRELESS']);},'isIgnoringOptimizations':ls=>lN['power_service']['isIgnoringBatteryOptimizations'](ls||context['getPackageName']()),'requestIgnoreOptimizations'(ls,lu){try{if(!lu&&this['isIgnoringOptimizations']())return!0x0;let lw=new lE()['setAction'](lx['ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS'])['setData'](lC['parse']('package:'+(ls||context['getPackageName']())));return app['startActivity'](lw),this['isIgnoringOptimizations']();}catch(mx){return console['warn'](mx['message']),!0x1;}}},'accelerometer_rotation':new tI('System','ACCELEROMETER_ROTATION','Int',[0x0,0x1]),'user_rotation':new tI('System','USER_ROTATION','Int',[lD['ROTATION_0'],lD['ROTATION_90'],lD['ROTATION_180'],lD['ROTATION_270']]),'screen_off_timeout':new tI('System','SCREEN_OFF_TIMEOUT','Int'),'stay_on_while_plugged_in':new tI('Global','STAY_ON_WHILE_PLUGGED_IN','Int',function(){let ls=lK['BATTERY_PLUGGED_AC'],lu=lK['BATTERY_PLUGGED_USB'],lw=lK['BATTERY_PLUGGED_WIRELESS'];return[0x0,ls,lu,lw,ls|lu,ls|lw,lu|lw,ls|lu|lw];}()),'development_settings_enabled':new tI('Global','DEVELOPMENT_SETTINGS_ENABLED','Int',[0x0,0x1]),'user_dir':new lB(lI['getDataDirectory'](),'user'),'wakeUp'(ls){let lu=context['getSystemService'](lF['POWER_SERVICE'])['newWakeLock'](lJ['FULL_WAKE_LOCK']|lJ['ACQUIRE_CAUSES_WAKEUP']|lJ['ON_AFTER_RELEASE'],'bright'),lw=ls||0x3a98;lu['acquire'](lw);let mE=Date['now'](),mF=setInterval(()=>{(this['isScreenOn']()||Date['now']()-mE-0xf0>lw)&&(clearInterval(mF),null!==lu&&lu['isHeld']()&&lu['release']());},0xc8);},'wakeUpWithBuffer'(ls){let lu=this['isScreenOn']['bind'](this);if(!lu()){let lw=0x2328,mJ=(ls||lw)/0x5dc;for(;this['wakeUp'](),!m['wait$'](lu,0x5dc,0x78);)if(--mJ<=0x0)return!0x1;}return!0x0;},'screenOn'(ls){return this['wakeUp'](ls);},'isScreenOn'(){let ls=this['power_service'];return(ls['isInteractive']||ls['isScreenOn'])['call'](ls);},'keepOn'(ls){let lu=ls||0x5;lu*=lu<0x64?0xea60:0x1,device['keepScreenOn'](lu),f['_']('已设置屏幕常亮显示'),f['_']('最大超时时间:\x20'+(lu/0xea60)['toFixedNum'](0x2)+'分钟');},'keepDim'(ls){let lu=ls||0x5;lu*=lu<0x64?0xea60:0x1,device['keepScreenDim'](lu),f['_']('已设置屏幕常暗显示'),f['_']('最大超时时间:\x20'+(lu/0xea60)['toFixedNum'](0x2)+'分钟');},'cancelOn'(){device['cancelKeepingAwake'](),f['_']('屏幕常亮显示已取消');},'cancelDim'(){device['cancelKeepingAwake'](),f['_']('屏幕常暗显示已取消');},'screenOff'(ls){if('boolean'==typeof ls)return this['screenOff']({'isDebug':ls});let lu=ls||{},lw=lu['key_code']||{},mT=lu['provider']||{},mU={},mV=this;f['debug']['switchSet'](lu['isDebug']);let mW={'key_code':{'failed':()=>f['w'](['关屏策略执行失败','按键模拟失败'],0x0,0x0,-0x2),'bugModel':()=>f['_'](['跳过当前策略','设备不支持KeyCode方法','设备型号:\x20'+device['brand']])},'successWithElapsedTime'(ls){f['_'](['策略执行成功','用时:\x20'+ls]);},'noWriteSettingsPermission'(){let ls=files['path']('./tools/auto.js-write-settings-permission-helper.js'),lu='需要\x22修改系统设置\x22权限';f['w'](['关屏策略执行失败',lu,'可使用以下工具获得帮助支持',ls],0x0,0x0,-0x2),n('关闭屏幕失败\x0a'+lu,'long');},'noWriteSecureSettingsPermission'(){let ls='WRITE_SECURE_SETTINGS';f['w'](['无法完成屏幕关闭操作','需要以下必要权限:',ls,'权限的详细信息及获取方式','可参阅项目配置工具','->\x20运行与安全','->\x20自动开启无障碍服务'],0x0,0x0,-0x2),n('关闭屏幕失败\x0a缺少以下必要权限:\x0a'+ls,'long');},'toastWithDebugInfo'(ls){let lu=[];[]['slice']['call'](arguments)['forEach'](ls=>{Array['isArray'](ls)?lu=lu['concat'](ls):'string'==typeof ls?lu['push'](ls):Object['prototype']['toString']['call'](ls)['match']('Arguments')&&(lu=lu['concat']([]['slice']['call'](ls)));}),f['v'](lu,0x4,0x0,-0x2);}};return f['_']('尝试关闭屏幕'),function(ls){try{mU['brake_is_triggered']?f['_']('关闭屏幕操作已被中断'):ls?f['_']('关闭屏幕成功'):f['_']('关闭屏幕失败',0x3);}catch(n5){if(!n5['message']['match'](/InterruptedException/))throw n5;}return f['debug']['switchBack'](),ls;}(function(){if(!lw['is_disabled']&&function(){try{return 0x0===shell('date',!0x0)['code'];}catch(n6){return!0x1;}}())if(f['_']('尝试策略:\x20模拟电源按键'),[/[Mm]eizu/]['some'](ls=>device['brand']['match'](ls)))mW['key_code']['bugModel']();else{if(function(){let ls=lw['hint'];'function'==typeof ls?ls['call'](null):!0x0!==ls&&'toast'!==ls||n('正在尝试关闭屏幕...\x0a此过程可能需要几秒钟...','long');}(),g['rec']['save']('scr_off_tt'),lN['keycode']('KEYCODE_POWER',{'no_failed_msg':!0x0})){let ls=s['time'](g['rec']('scr_off_tt'),'$zh');return mW['successWithElapsedTime'](ls),!0x0;}mW['key_code']['failed']();}}()||function(){if(mT['is_disabled'])return;f['_']('尝试策略:\x20修改系统设置参数');let ls=!0x1;return ly['canWrite'](context)?mV['battery']['isPluggedAndStayingOn']()&&!(context['checkCallingOrSelfPermission'](android['Manifest']['permission']['WRITE_SECURE_SETTINGS'])===android['content']['pm']['PackageManager']['PERMISSION_GRANTED']?mU['staying_on_state_matters']=!0x0:void 0x0)?(mW['noWriteSecureSettingsPermission'](),ls):(o(function(){g['rec']['save']('set_provider');let ls=mT['hint'];'function'==typeof ls?ls['call'](null):!0x0!==ls&&'toast'!==ls||n(['正在尝试关闭屏幕...','此过程可能需要几秒钟...\x0a','触摸屏幕任意区域','或按下任意按键可终止关屏']['join']('\x0a'),'Long');})['$'](ng)['$'](function(){'function'==typeof mT['listener']&&mT['listener'](ne);})['$'](function(){for(;!mU['brake_is_triggered'];){let lu=g['rec']('set_provider'),lw=s['time'](lu,'$zh');if(lu>0xd7be){f['w'](['关屏策略执行失败','屏幕关闭超时','耗时:\x20'+lw],0x2,0x0,-0x2);break;}if(!mV['isScreenOn']()){mW['successWithElapsedTime'](lw),ls=!0x0;break;}sleep(0xc8);}})['$'](nh),ls):(mW['noWriteSettingsPermission'](),ls);}());function ne(ls){mU['brake_is_triggered']=!0x0,nh(),mW['toastWithDebugInfo'](arguments);}function ng(){f['_']('备份并设置相关参数:'),mV['stay_on_while_plugged_in']['clearStorage'](),mV['screen_off_timeout']['saveIntoStorage'](),mV['screen_off_timeout']['put'](0x0),mU['staying_on_state_matters']&&(mV['stay_on_while_plugged_in']['saveIntoStorage'](),mV['stay_on_while_plugged_in']['put'](0x0));}function nh(){mU['is_settings_restored']||(f['_']('恢复修改前的设置参数:'),mV['screen_off_timeout']['loadFromStorageIFN'](),mV['stay_on_while_plugged_in']['loadFromStorageIFN'](),mU['is_settings_restored']=!0x0);}},'isScreenOff'(){return!this['isScreenOn']();},'isLocked':()=>context['getSystemService'](lF['KEYGUARD_SERVICE'])['isKeyguardLocked'](),'isUnlocked'(){return!this['isLocked']();},'unlock':ls=>function(){let ls='com\x5c.android\x5c.systemui:id/',lu='com\x5c.android\x5c.keyguard:id/',nl='com\x5c.smartisanos\x5c.keyguard:id/',{storagesx:n}=lw(0xdc),nm={},nn={'p_container':{'trigger'(){return lE(),[{'desc':'QQ锁屏消息弹框控件','trigger':()=>y['pickup']('按住录音')||y['pickup'](idMatches(/com.tencent.mobileqq:id.+/)),'handle'(){m['click$'](y['pickup']('关闭'),'w'),m['wait$'](this['trigger']['bind'](this),0xbb8)?f['_']('关闭弹框控件成功'):f['_']('关闭弹框控件超时',0x3);}},{'desc':'闹钟应用前置','trigger'(){let ls=currentPackage();return['com\x5c.android\x5c.deskclock','com\x5c.alarmclock\x5c.xtreme.*']['some'](lu=>new RegExp(lu)['test'](ls));},'handle'(){m['wait$'](()=>!this['trigger'](),0x1d4c0)?f['_']('闹钟应用解除前置成功'):f['_']('闹钟应用解除前置超时',0x3);}}]['forEach'](ls=>{ls['trigger']()&&(f['_'](['检测到提示层页面干扰:',ls['desc']]),ls['handle']());}),function(){let ls=np['unlock_dismiss_layer_strategy'];if('preferred'===ls)return!0x0;if('disabled'===ls)return nm['unlock_dismiss_layer_disabled_hinted']||(f['_']('解锁页面提示层检测已禁用'),nm['unlock_dismiss_layer_disabled_hinted']=!0x0),!0x1;if('deferred'===ls)return!!nm['unlock_dismiss_layer_deferred']||(f['_']('解锁页面提示层检测延迟一次'),nm['unlock_dismiss_layer_deferred']=!0x0,!0x1);throw Error('Unknown\x20unlock\x20dismiss\x20layer\x20strategy:\x20'+ls);}()&&[{'desc':'通用','sel':idMatches(ls+'preview_container')},{'desc':'EMUI','sel':idMatches(ls+'.*(keyguard|lock)_indication.*')},{'desc':'锤子科技','sel':idMatches(nl+'keyguard_(content|.*view)')},{'desc':'MIUI','sel':idMatches(lu+'(.*unlock_screen.*|.*notification_.*(container|view).*|dot_digital)')},{'desc':'MIUI10','sel':idMatches(ls+'(.*lock_screen_container|notification_(container|panel).*|keyguard_.*)')},{'sel':y['pickup'](/上滑.{0,4}解锁/,'selector')}]['some'](ls=>{let {desc:lu,sel:lw}=ls;if(lw instanceof com['stardust']['autojs']['core']['accessibility']['UiSelector']&&lw['exists']())return lu?f['_']('匹配到'+lu+'解锁提示层控件'):(f['_']('匹配到解锁提示层文字:'),f['_'](y['pickup'](lw,'txt'))),(this['trigger']=lw['exists']['bind'](lw))();});},'dismiss'(){let ls=this,lu=np['unlock_dismiss_layer_bottom'],lw=np['unlock_dismiss_layer_top'],nl=np['unlock_dismiss_layer_swipe_time'],nF=!!nl,nm=[lu,lw],nn=nl,nI=np['swipe_time_reliable']||[],nJ=0x3,nK=np['continuous_swipe']||{};return nI['includes'](nn)&&(nJ=0x1/0x0,f['_']('当前滑动时长参数可信')),nn in nK||(f['_']('连续成功滑动累积器清零'),nK={},nK[nn]=0x0),function(){let lu=[nn]['concat'](nm['map'](ls=>[halfW,cY(ls)])),lw=0x0;for(lN['keepOn'](0x3);!nl()&&(lC('消除解锁页面提示层',lw,0x1e),f['_']('滑动时长:\x20'+nn+'毫秒'),f['_']('参数来源:\x20'+(nF?'本地存储':'自动计算')),gesture['apply'](null,lu),!ls['succ']());)if(f['_']('单次消除解锁页面提示层超时'),lw+=0x1,nF)--nJ<0x0?(nF=!0x1,nn=np['unlock_dismiss_layer_swipe_time'],f['_']('放弃本地存储数据'),f['_']('从默认值模块获取默认值:\x20'+nn)):f['_']('继续使用本地存储数据');else{let ls=nn<0x78?0x5:0x32;nn+=ls,f['_']('参数增量:\x20'+ls);}function nl(){let ls=lw>0x1e;return ls&&(nK[nn]=0x0,no['put']('config',{'continuous_swipe':nK}),lD('消除解锁页面提示层失败')),ls;}lN['cancelOn'](),f['_']('解锁页面提示层消除成功'),ls['succ_fg']=!0x0;}(),function(){nn!==nl&&(no['put']('config',{'unlock_dismiss_layer_swipe_time':nn}),f['_']('存储滑动时长参数:\x20'+nn)),nn in nK||(nK[nn]=0x0);let ls=++nK[nn];no['put']('config',{'continuous_swipe':nK}),f['_']('存储连续成功滑动次数:\x20'+ls),ls>=0x6&&!nI['includes'](nn)&&(f['_']('当前滑动时长可信度已达标'),f['_']('存储可信滑动时长数据:\x20'+nn),no['put']('config',{'swipe_time_reliable':nI['concat'](nn)}));}(),this['succ_fg'];},'handle'(){return this['succ_fg']||!this['trigger']()||this['dismiss']();},'succ'(){return m['wait$'](function(){return!this['trigger']();}['bind'](this),0x5dc)||nn['unlock_view']['trigger']();}},'unlock_view':{'trigger'(){let lw=this;if(lN['isScreenOn']())return function(){return[{'desc':'通用','sel':idMatches(ls+'lockPatternView')},{'desc':'MIUI','sel':idMatches(lu+'lockPattern(View)?')}]['some'](ls=>{if(ls['sel']['exists']())return f['_']('匹配到'+ls['desc']+'图案解锁控件'),re(ls['sel'],nl);});function nl(){let ls=np['unlock_pattern_strategy'],lu={'segmental':'叠加路径','solid':'连续路径'},nl='unlock_pattern_swipe_time_'+ls,nY=np[nl],nm=!!nY,o0=0x3,o1=0x0,o2=Math['ceil'](0.6*lz);for(;!(o1>o2&&lD('图案解锁方案失败'));){lC('图案密码解锁',o1,o2),f['_']('滑动时长:\x20'+nY+'毫秒'),f['_']('滑动策略:\x20'+lu[ls]);let nn=of(),no={'segmental'(){let ls=[],lu=nn['length'];for(let lw=0x0;lw{let {left:lu,top:lw,right:nl,bottom:nY}=ls;return[lu,lw,nl,nY];},no=ls=>{[lu,lw,nl,nY]=nn(ls);};return m['wait$'](()=>{let ox=ls['findOnce']();if(ox)return nm=ox['bounds'](),c(lu)||c(lw)||c(nl)||c(nY)?no(nm):!!(ls=>{let [nm,no,ox,oC]=nn(ls);return lu===nm&&lw===no&&nl===ox&&nY===oC;})(nm)||void no(nm);},0x4b0,0x78),nm;}}(lw['sel']);if(!ls)return lD(['图案解锁方案失败','无法获取点阵布局']);let lu=lA,nl=Math['trunc'](ls['width']()/lu),nY=Math['trunc'](ls['height']()/lu),nm=ls['left']+Math['trunc'](nl/0x2),no=ls['top']+Math['trunc'](nY/0x2),o0=[];for(let ls=0x1;ls<=lu;ls+=0x1)for(let lw=0x1;lw<=lu;lw+=0x1)o0[(ls-0x1)*lu+lw]={'x':nm+(lw-0x1)*nl,'y':no+(ls-0x1)*nY};return l(lx)&&(lx=lx['match'](/[^1-9]+/)?lx['split'](/[^1-9]+/)['join']('|')['split']('|'):lx['split']('')),nn['unlock_pattern_pts']=function(ls,lu){let lw=ls['filter'](ls=>ls>0x0&&ls<=lu*lu),nl=[];for(;nl['length']!==lw['length'];)nl=lw['slice'](),nY(),nm();return lw;function nY(){let ls=function(){let ls={},lw=0x1;for(let nl=0x1;nl<=lu;nl+=0x1)for(let nY=0x1;nY<=lu;nY+=0x1)ls[lw++]=[nl,nY];return ls;}(),nl=NaN;for(let ls=0x0,lu=lw['length'];ls{if(!c(lu)&&!(lu in ls))return ls[lu]=!0x0;});}}(lx,lu)['filter'](ls=>+ls&&o0[ls])['map'](ls=>[o0[ls]['x'],o0[ls]['y']]);}}}()||function(){return!function(){let ls=ls=>l(ls)&&id(ls)['exists'](),lu=ls=>_(ls)&&idMatches(ls)['exists']();return['com.android.systemui:id/lockPattern']['some'](nl=>{if(ls(nl)||lu(nl))return lw['misjudge']=nl,f['_'](['匹配到误判干扰','转移至PIN解锁方案']),!0x0;});}()&&[{'desc':'通用','sel':idMatches('.*passwordEntry')},{'desc':'MIUI','sel':idMatches(lu+'miui_mixed_password_input_field')},{'desc':'锤子科技','sel':idMatches(nl+'passwordEntry(_.+)?')['className']('EditText')}]['some'](lu=>{if(lu['sel']['exists']())return f['_']('匹配到'+lu['desc']+'密码解锁控件'),re(lu['sel'],ls);});function ls(){let ls=lx;p(ls)&&(ls=ls['join'](''));let lu=ls=>y['pickup']([/确.|完成|[Cc]onfirm|[Ee]nter/,{'className':'Button','clickable':!0x0}],ls),nl=0x0,pp=Math['ceil'](0.6*lz);for(;!(nl>pp&&lD(['密码解锁方案失败','可能是密码错误','或无法点击密码确认按钮']));){lC('密码解锁',nl,pp),lw['sel']['setText'](ls),nm();let nn=lu('widget');if(nn){f['_']('点击\x22'+lu('txt')+'\x22按钮');try{m['click$'](nn,'w');}catch(ps){f['_']('按钮点击可能未成功',0x3);}}if(lw['succ'](0x2))break;try{if(0x0===shell('date',!0x0)['code']&&0x0===shell('input\x20keyevent\x2066',!0x0)['code']&&(f['_']('使用Root权限模拟回车键'),sleep(0x1e0),lw['succ']()))break;}catch(pt){}nl+=0x1,sleep(0xc8);}return f['_']('密码解锁成功'),!0x0;function nm(){let lu=ls[ls['length']-0x1],nl={'HUAWEI VOG-AL00 9':{'prefix':0x1,'keys':[[0x3f0,0x6aa]]},'HUAWEI ELE-AL00 10':{'keys':['DEL'],'keys_map':function(){let [ls,lu,lw,nl,pp]=[0x4a4,0x546,0x5e7,0x68a,0x72b],[nm,nn,no,pF,pG,pH,pI,pJ,pK,pL]=[0x38,0xa3,0x10f,0x17a,0x1e7,0x253,0x2bf,0x32a,0x396,0x403],[np,pN,pO,pP,lx,ly,lz,lA,lB]=[109.5,0xd9,324.5,432.5,0x21d,0x289,756.5,0x360,972.5];return{1:[nm,ls],2:[nn,ls],3:[no,ls],4:[pF,ls],5:[pG,ls],6:[pH,ls],7:[pI,ls],8:[pJ,ls],9:[pK,ls],0:[pL,ls],'q':[nm,lu],'w':[nn,lu],'e':[no,lu],'r':[pF,lu],'t':[pG,lu],'y':[pH,lu],'u':[pI,lu],'i':[pJ,lu],'o':[pK,lu],'p':[pL,lu],'a':[np,lw],'s':[pN,lw],'d':[pO,lw],'f':[pP,lw],'g':[lx,lw],'h':[ly,lw],'j':[lz,lw],'k':[lA,lw],'l':[lB,lw],'z':[pN,nl],'x':[pO,nl],'c':[pP,nl],'v':[lx,nl],'b':[ly,nl],'n':[lz,nl],'m':[lA,nl],',':[pN,pp],' ':[lx,pp],'.':[lA,pp],'del':[pL,nl]};}(),get 'suffix'(){return this['keys_map'][lu];}}};if(!(lB in nl))return;f['_']('此设备机型需要按键辅助');let pp=nl[lB],nm=pp['keys'],nn=pp['keys_map'],no=pp['prefix'],pZ=pp['suffix'];if(!c(no)&&!u(no)){let nl='';h(no)?nl+=lu['repeat'](no):nl=no['toString'](),lw['sel']['setText'](ls+nl),f['_']('辅助按键前置填充:\x20'+nl['length']+'项');}return nm['forEach']((ls,lu)=>{lu||sleep(0x12c),m['click$'](l(ls)?nn[ls]:ls),sleep(0x12c);}),pZ?pZ instanceof com['stardust']['automator']['UiObject']?(f['_']('辅助按键后置填充类型:\x20控件'),m['click$'](pZ)):pZ instanceof com['stardust']['autojs']['core']['accessibility']['UiSelector']?(f['_']('辅助按键后置填充类型:\x20选择器'),m['click$'](pZ)):p(pZ)?(f['_']('辅助按键后置填充类型:\x20坐标'),m['click$'](pZ)):h(pZ)||l(pZ)||_(pZ)?(f['_']('辅助按键后置填充类型:\x20文本'),m['click$'](y['pickup']('(key.?)?'+pZ))):lD(['密码解锁失败','无法判断末位字符类型']):void 0x0;}}}()||function(){return[{'desc':'通用','sel':idMatches(ls+'pinEntry')},{'desc':'MIUI','sel':idMatches(lu+'numeric_inputview')},{'desc':'EMUI10','sel':idMatches(ls+'fixedPinEntry')},{'desc':'EMUI','sel':descMatches('[Pp][Ii][Nn]\x20?(码区域|area)')},{'desc':'魅族','sel':idMatches(ls+'lockPattern')},{'desc':'OPPO','sel':idMatches(ls+'(coloros.)?keyguard.pin.(six.)?view')},{'desc':'OPPO','sel':idMatches(ls+'keyguard_security_container')},{'desc':'VIVO','sel':idMatches(ls+'vivo_pin_view')},{'desc':'拨号盘阵列',get 'sel'(){let ls={'_side':0x3,'_nums':[0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0x0],'_ft':cX(0.0125),'_checkPoints'(){return this['_points']=this['_points']||{},this['_nums']['every'](ls=>this['_points'][ls]=y['pickup'](ls,'point'));},'_checkOffset'(){let lu=ls=>ls['join']('|')['split']('|')['map'](()=>[]),lw=ls['_side'],nl=lu(Array(lw)),q8=lu(Array(lw)),nm=(lu,lw)=>ls['_points'][ls['_nums'][lu]][lw];for(let ls=0x0;lslu['every']((lw,nl)=>!nl||Math['abs'](lw-lu[nl-0x1])lu['every']((lw,nl)=>!nl||Math['abs'](lw-lu[nl-0x1])!!global['_$_dial_points']};}}]['some'](ls=>{let lu=ls['desc'];if(ls['sel']['exists']())return lu['match'](/\w$/)&&(lu+='/'),f['_']('匹配到'+lu+'PIN解锁控件'),re(ls['sel'],nl);});function nl(){let nl=0x0,qp=Math['ceil'](0.6*lz);for(;!(nl>qp&&lD(['PIN解锁方案失败','尝试次数已达上限'])||(lC('PIN解锁',nl,qp),d(lw['unlockPin'])?lw['unlockPin']():no(),lw['succ']()||nn()));)nl+=0x1,sleep(0xc8);return f['_']('PIN解锁成功'),!0x0;function nn(){let lu=idMatches(ls+'key_enter');if(lu['exists']())return f['_']('点击\x22key_enter\x22控件'),m['click$'](lu,'w'),lw['succ']();}function no(){let nl=[{'desc':'通用PIN/KEY','test'(){let lu=lu=>idMatches(ls+'key'+lu);if(r0(lu))return nn['call'](this),this['sel']=lu;},'click'(){let ls=this['sel'];return no(()=>ly['forEach'](lu=>m['click$'](ls(lu),'w')));}},{'desc':'通用PIN容器','test'(){let lu=idMatches(ls+'container')['findOnce']();if(lu)return nn['call'](this),this['widget']=lu;},'click'(){let ls=this['widget']['bounds'](),lu=[ls['left'],ls['top'],ls['right'],ls['bottom']];return no(()=>ly['forEach'](ls=>m['click$']((ls=>y['pickup']([ls,{'boundsInside':lu}]))(ls),'w')));}},{'desc':'MIUI/PIN','test'(){let ls=ls=>idMatches(lu+'numeric_inputview')['text'](ls);if(r0(ls))return nn['call'](this),this['sel']=ls;},'click'(){let ls=this['sel'];return no(()=>ly['forEach'](lu=>m['click$'](ls(lu),'w')));}},{'desc':'内容描述PIN','test'(){let ls=ls=>desc(ls);if(r0(ls))return nn['call'](this),this['sel']=ls;},'click'(){let ls=this['sel'],lu=lw=>{let nl=ls(lw)['findOnce']();if(lw>0x0||nl)return nl;let qp=ls=>{let lw=lu(ls)['bounds']();return{'x':lw['centerX'](),'y':lw['centerY']()};},nm=ls=>qp(0x8)[ls]+qp(0x5)[ls]-qp(0x2)[ls];return[nm('x'),nm('y')];};return no(()=>ly['forEach'](ls=>m['click$'](lu(ls),'w')));}},{'desc':'标记匹配PIN','test'(){if(lw['misjudge'])return nn['call'](this),f['_']('已匹配的字符串化标记:'),f['_'](lw['misjudge']),!0x0;},'click':()=>no(()=>{let ls=idMatches(lw['misjudge'])['findOnce']();ls&&nm(ly,ls['bounds']());})},{'desc':'拨号盘阵列PIN','test'(){if(global['_$_dial_points'])return nn['call'](this),!0x0;},'click':()=>no(()=>ly['forEach'](ls=>{m['click$'](global['_$_dial_points'][ls],'p',{'pt$':0x78});}))}],qp=0x8;for(;qp--;)for(let ls of nl)if(ls['test']())return ls['click']();return lD('预置的PIN解锁方案全部无效');function nn(){f['_']('采用'+this['desc']+'解锁方案');}function no(ls){return(lw['unlockPin']=ls['bind'](null))();}function r0(ls){let lu=0x0;for(let lw of'123456789')lu+=Number(ls(lw)['exists']());return lu>0x6;}}}}()||function(){return[{'desc':'\x22Gxzw\x22屏下指纹设备','sel':idMatches(/.*[Gg][Xx][Zz][Ww].*/),'pw_rect':[0.0875,0.47,0.9125,0.788]}]['some'](lu=>{if(lu['sel']['exists']())return f['_'](['匹配到特殊设备解锁方案:',lu['desc']]),re(lu['sel'],ls['bind'](null,lu['pw_rect']));});function ls(ls){let lu=ls['map']((ls,lu)=>lu%0x2?cY(ls):cX(ls)),[nl,r9,nn,no]=lu;if(f['_']('已构建密码区域边界:'),f['_']('Rect('+nl+',\x20'+r9+'\x20-\x20'+nn+',\x20'+no+')'),nm(ly,lu),lw['succ']())return!0x0;lD('尝试特殊解锁方案失败');}}()||void(lN['isUnlocked']()||f['_']('未匹配到可用的解锁控件'));function re(ls,lu){return lw['sel']=ls,lw['stg']=lu,(lw['trigger']=ls['exists']['bind'](ls))();}function nm(ls,lu){let lw,nl,re,nm;if(p(lu)){let [ls,nn,no,rr]=lu;lw=ls,nl=nn,re=no-ls,nm=rr-nn;}else lw=lu['left'],nl=lu['top'],re=lu['width'](),nm=lu['height']();let nn=Math['trunc'](re/0x3),no=Math['trunc'](nm/0x4),ru=lw+Math['trunc'](nn/0x2),rv=nl+Math['trunc'](no/0x2),rw=[];for(let ls=0x1;ls<=0x4;ls+=0x1)for(let lu=0x1;lu<=0x3;lu+=0x1)rw[0x3*(ls-0x1)+lu]={'x':ru+nn*(lu-0x1),'y':rv+no*(ls-0x1)};f['_']('已构建拨号盘数字坐标'),ls['forEach'](ls=>m['click$'](rw[Number(ls)||0xb]));}f['_'](['跳过解锁控件检测','屏幕未亮起']);},'dismiss'(){return lx?d(this['stg'])?(lN['keepOn'](0x5),this['stg'](),void lN['cancelOn']()):lD('没有可用的解锁方案'):lD('密码为空');},'handle'(){return this['trigger']()&&this['dismiss']();},'succ'(ls){let lw,nl=ls||0x780;return m['wait$'](()=>{if(function(){let ls=y['pickup'](/.*(重试|不正确|错误|[Ii]ncorrect|[Rr]etry|[Ww]rong).*/);return ls?lw||f['_'](y['pickup'](ls,'txt'),0x3):!idMatches(new RegExp(lu+'phone_locked_textview'))['exists']()||lw||f['_']('密码错误',0x3);}())return function(){let ls=()=>y['pickup'](/.*([Tt]ry again in.+|\d+.*后重试).*/);ls()&&(f['_']('正在等待重试超时'),m['wait$'](()=>!ls(),0xfde8,0x1f4));}(),function(){let ls=y['pickup'](/OK|确([认定])|好的?/);ls&&(f['_']('点击\x22'+y['pickup'](ls,'txt')+'\x22按钮'),m['click$'](ls,'w'),sleep(0x3e8));}(),lN['isUnlocked']();lw=!0x0;},nl,0xf0);}},'unlock':function(ls){f['debug']['switchSet'](ls),f['_']('尝试自动解锁',0x0,0x0,-0x2),no['put']('config',np),lE();for(let ls=0x0;!lN['isUnlocked']();ls+=0x1)ls>=lz&&lD('解锁尝试次数已达上限'),lC('解锁',ls,lz),nn['p_container']['handle'](),nn['unlock_view']['handle'](),sleep(0xf0);return f['_']('自动解锁完毕',0x0,0x0,-0x2),f['debug']['switchBack'](),!0x0;}},no=n['create']('unlock'),np=Object['assign']({'unlock_code':null,'unlock_max_try_times':0x14,'unlock_pattern_strategy':'segmental','unlock_pattern_size':0x3,'unlock_pattern_swipe_time_segmental':0x78,'unlock_pattern_swipe_time_solid':0xc8,'unlock_dismiss_layer_strategy':'preferred','unlock_dismiss_layer_bottom':0.7,'unlock_dismiss_layer_top':0.2,'unlock_dismiss_layer_swipe_time':0x6e},no['get']('config')),lx=String(no['get']('config',{'prop':'unlock_code','is_crypto':!0x0,'default':''})),ly=lx['split'](/\D+/)['join']('')['split'](''),lz=np['unlock_max_try_times'],lA=np['unlock_pattern_size'],lB=device['brand']+'\x20'+device['product']+'\x20'+device['release'],lC=(ls,lu,lw)=>lu?f['_']('重试'+ls+'(\x20'+lu+'/'+lw+')'):f['_']('尝试'+ls);return nn;function lD(ls){lN['cancelOn'](),f['e'](['解锁失败',ls,lB]['flat'](),0x4,0x0,0x2),lN['is_init_screen_on']||(f['d']('自动关闭屏幕'),lN['screenOff']()||f['w']('自动关闭屏幕失败')),f['__'](),exit(),sleep(0xe10);}function lE(){lN['isScreenOn']()||(lN['wakeUpWithBuffer']()?(f['_']('设备唤起成功'),device['keepScreenOn'](0x1d4c0)):lD('设备唤起失败'));}}()['unlock'](ls),'vibrate'(ls,lu,lw){let rR=lu||0x1,rS='number'==typeof ls?[ls]:ls;function rT(){let ls=ls=>ls<0xa?0x3e8*ls:ls;for(;rR--;)rS['forEach']((lu,lw)=>{let rR=ls(lu),rT=ls(rS[lw-0x1]||0x0);lw%0x2?sleep(rR+rT):device['vibrate'](rR);}),lu&&rS['length']%0x2&&sleep(0x3e8);}void 0x0===lw||lw?threads['start'](rT):rT();},'hasRoot':()=>'function'==typeof lM['isRootAvailable']?lM['isRootAvailable']():Object['keys'](Shell)['indexOf']('Companion')>-0x1?Shell['Companion']['isRootAvailable']():void 0x0,'keycode'(ls,lu){let lw={'options':lu||{},'relations':[{'str':'home','num':0x3},{'str':'back','num':0x4},{'str':'recents','num':0xbb},{'str':'quick_settings','num':-0x1},{'str':'power_dialog','num':-0x1},{'str':'notifications','num':-0x1},{'str':'split_screen','num':-0x1}],get 'autojs_keycode'(){return this['_aj_kc']=this['_aj_kc']||this['relations']['map'](ls=>ls['str']);},'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('devicex.keycode');},'parseKeycode'(){if('number'==typeof ls||this['autojs_keycode']['includes'](ls))return this['keycode']=ls;if('string'==typeof ls){let lu=ls['match'](/^KEYCODE_/i)?ls:'KEYCODE_'+ls,lw=android['view']['KeyEvent'][lu['toUpperCase']()];if('number'==typeof lw)return this['keycode']=lw;}throw Error('Invalid\x20keycode:\x20'+ls);},'parseStrategy'(){'adb_only'===this['options']['strategy']?this['is_adb_only']=!0x0:'adb_advanced'===this['options']['strategy']?this['is_adb_advanced']=!0x0:'a11y_only'===this['options']['strategy']?this['is_a11y_only']=!0x0:this['is_a11y_advanced']=!0x0;},'parseArgs'(){this['parseStrategy'](),this['parseKeycode']();},'hasRoot'(){return'boolean'==typeof this['options']['root']?this['options']['root']:function(){try{return 0x0===shell('date',!0x0)['code'];}catch(s6){return!0x1;}}();},'toNumIFP'(ls){for(let lu of this['relations'])if(ls===lu['str']){if(lu['num']>-0x1)return lu['num'];break;}return ls;},'toStrIFP'(ls){for(let lu of this['relations'])if(ls===lu['num'])return lu['str'];return ls;},'showFailedMsgIFN'(ls){this['options']['no_failed_msg']||f['w'](['按键模拟失败','键值:\x20'+ls],0x0,0x0,-0x2);},'simulateByAdb'(ls){try{return 0x0===shell('input\x20keyevent\x20'+ls,lw['hasRoot']())['code'];}catch(sd){return this['showFailedMsgIFN'](ls),!0x1;}},'simulateByA11y'(ls){switch(ls){case'home':return home();case'back':return back();case'recents':return recents();case'power_dialog':return powerDialog();case'notifications':return notifications();case'quick_settings':return quickSettings();case'split_screen':return splitScreen();default:return null;}},'simulate'(ls){return this['is_a11y_only']?this['simulateByA11y'](this['toStrIFP'](ls)):this['is_adb_only']?this['simulateByAdb'](this['toNumIFP'](ls)):this['is_a11y_advanced']?this['simulateByA11y'](this['toStrIFP'](ls))||this['simulateByAdb'](this['toNumIFP'](ls)):this['is_adb_advanced']?this['simulateByAdb'](this['toNumIFP'](ls))||this['simulateByA11y'](this['toStrIFP'](ls)):void 0x0;},'simulateOnce'(){return this['simulate'](this['keycode']);},'simulateTwice'(){let ls=0x2;for(;ls--;)if(!this['simulateOnce']())return!0x1;return!0x0;},'getResult'(){return this['impededIFN'](),this['parseArgs'](),this['options']['rush']?this['simulateTwice']():this['simulateOnce']();}};return lw['getResult']();},'getCallState':()=>context['getSystemService'](lF['TELEPHONY_SERVICE'])['getCallState'](),'getDisplay'(){let ls,lu,lw=new lL(),sk=this['getDefaultDisplay']();sk['getRealMetrics'](lw);let sl=sU(),sm={'cX':su,'cY':sy,'cYx':sC},sn={'refresh'(){let ls=sU(),lu=!0x1;return Object['keys'](ls)['forEach'](lw=>{sl[lw]!==ls[lw]&&(sl[lw]=ls[lw],lu=!0x0);}),lu&&(f['_']('屏幕显示数据已更新'),this['debug']()),this;},'debug'(ls){let lu=f['debug']['fuel'](ls);return lu('屏幕宽高:\x20'+sl['W']+'\x20×\x20'+sl['H']),sl['is_rotation_portrait']?lu('可用高度:\x20'+sl['USABLE_HEIGHT']):sl['is_rotation_landscape']&&lu('可用宽度:\x20'+sl['USABLE_WIDTH']),lu('屏幕旋转:\x20'+0x5a*sl['display_rotation']+'°'),this;}};return sl||m['wait$'](()=>sl=sU(),0xbb8,0x1f4)||console['error']('devicex.getDisplay()返回结果异常'),Object['assign'](sl,sm,sn);function su(ls,lu,lw){return'boolean'==typeof lu?sL(0x1,ls,-0x1,Object['assign']({'is_ratio':lu},lw)):sL(0x1,ls,lu,lw);}function sy(ls,lu,lw){return'boolean'==typeof lu?sL(-0x1,ls,-0x1,Object['assign']({'is_ratio':lu},lw)):sL(-0x1,ls,lu,lw);}function sC(lw,sk,sl){let sm=sl||{},sn=sm['is_ratio'];'boolean'==typeof sk&&(sn=void 0x0===sn?sk:sn,sk=-0x1);let su=Number(lw),sy=Math['abs'](su)<0x1||sn,sC=Number(sk);if(sC&&-0x1!==sC)if(-0x2===sC)sC=0x438,su*=sy?0x780:0x1;else if(-0x3===sC)sC=0x448,su*=sy?0xa00:0x1;else{if(sC<0x0)throw Error('Can\x20not\x20parse\x20base\x20param\x20for\x20cYx()');if(sy)su*=lu;else if(sC<0x5)throw Error('Base\x20and\x20num\x20options\x20should\x20be\x20both\x20pixels\x20for\x20cYx()');sC=(sC>0x1?0x1/sC:sC)*lu;}else sC=0x2d0,su*=sy?0x500:0x1;return sm['to_ratio']?Number((0x9*su/0x10/sC)['toFixed'](0x3)):Math['round'](su*ls/sC);}function sL(lw,sk,sl,sm){let sn=-0x1!==lw?ls:lu,su=Number(sk);if(isNaN(su))throw Error('Can\x20not\x20parse\x20num\x20param\x20for\x20cTrans():\x20'+sk);let sy=Number(sl);sl&&-0x1!==sl?-0x2===sl?sy=-0x1!==lw?0x438:0x780:-0x3===sl&&(sy=-0x1!==lw?0x448:0xa00):sy=-0x1!==lw?0x2d0:0x500;let sC=sm||{};return(Math['abs'](su)<0x1||sC['is_ratio'])&&(su*=sy),sC['to_ratio']?Number((su/sy)['toFixed'](0x3)):Math['min'](Math['round'](su*sn/sy),sn);}function sU(){try{if(ls=sk['getWidth'](),lu=sk['getHeight'](),!(ls*lu))return sl();let sm=sk['getRotation'](),sn=[0x0,0x2]['indexOf'](sm)>-0x1,su=Math['max'](lw['widthPixels'],lw['heightPixels']),[sy,sC]=[lu,ls],sL=ls=>{try{let lu=context['getResources'](),lw=lu['getIdentifier'](ls,'dimen','android');if(lw>0x0)return lu['getDimensionPixelSize'](lw);}catch(t4){}return NaN;};return sn?[sy,lu]=[lu,su]:[sC,ls]=[ls,su],t7(),{'W':ls,'WIDTH':ls,'width':ls,'halfW':ls/0x2,'HALF_WIDTH':ls/0x2,'half_width':ls/0x2,'uW':sC,'USABLE_WIDTH':sC,'usable_width':sC,'H':lu,'HEIGHT':lu,'height':lu,'halfH':lu/0x2,'HALF_HEIGHT':lu/0x2,'half_height':lu/0x2,'uH':sy,'USABLE_HEIGHT':sy,'usable_height':sy,'display_rotation':sm,'ROTATION':sm,'is_rotation_portrait':sm===lD['ROTATION_0']||sm===lD['ROTATION_180'],'is_rotation_landscape':sm===lD['ROTATION_90']||sm===lD['ROTATION_270'],'status_bar_height':sL('status_bar_height'),'navigation_bar_height':sL('navigation_bar_height'),'navigation_bar_height_computed':sn?lu-sy:ls-sC,'action_bar_default_height':sL('action_bar_stacked_max_height')||sL('action_bar_default_height')};}catch(t5){return sl();}function sl(){return f['_']('devicex\x20display\x20raw()\x20is\x20triggered',0x3),ls=device['width'],lu=device['height'],t7(),ls&&lu?{'WIDTH':ls,'HEIGHT':lu,'USABLE_HEIGHT':Math['trunc'](0.9*lu)}:(f['_']('devicex\x20display\x20raw()\x20returns\x20null',0x4),null);}}function t7(){Object['assign'](global,{'W':ls,'WIDTH':ls,'H':lu,'HEIGHT':lu,'halfW':ls/0x2,'halfH':lu/0x2,'uW':sl?sl['USABLE_WIDTH']:ls,'uH':sl?sl['USABLE_HEIGHT']:lu,'ROTATION':sl?sl['display_rotation']:0x0,'cX':su,'cY':sy,'cYx':sC});}},'getDefaultDisplay':()=>context['getSystemService'](lF['WINDOW_SERVICE'])['getDefaultDisplay'](),'getDisplayRotation'(){return this['getDefaultDisplay']()['getRotation']();},'setUserRotation'(ls,lu){this['setAutoRotationDisabled'](lu);let lw={0:lD['ROTATION_0'],1:lD['ROTATION_90'],2:lD['ROTATION_180'],3:lD['ROTATION_270'],90:lD['ROTATION_90'],180:lD['ROTATION_180'],270:lD['ROTATION_270']}[ls];if(void 0x0===lw)throw Error('Unknown\x20rotation\x20for\x20devicex.setUserRotation()');let tb=()=>this['getDisplayRotation']()===lw;tb()||(this['user_rotation']['saveState'](),this['user_rotation']['put'](lw),lu||(m['wait'](tb,0x7d0,0x50),sleep(0x168)));},'setUserRotationPortrait'(ls){this['setUserRotation'](lD['ROTATION_0'],ls);},'setUserRotationInverted'(ls){this['setUserRotation'](lD['ROTATION_180'],ls);},'setUserRotationLandscapeRight'(ls){this['setUserRotation'](lD['ROTATION_90'],ls);},'setUserRotationLandscapeLeft'(ls){this['setUserRotation'](lD['ROTATION_270'],ls);},'setAutoRotationEnabled'(ls){this['accelerometer_rotation']['verify'](0x1)||(this['accelerometer_rotation']['saveState'](),this['accelerometer_rotation']['put'](0x1),ls||(m['wait'](()=>this['accelerometer_rotation']['verify'](0x1),0x7d0,0x50),sleep(0x168)));},'setAutoRotationDisabled'(ls){this['accelerometer_rotation']['verify'](0x0)||(this['accelerometer_rotation']['saveState'](),this['accelerometer_rotation']['put'](0x0),ls||(m['wait'](()=>this['accelerometer_rotation']['verify'](0x0),0x7d0,0x50),sleep(0x168)));},'restoreUserRotationIFN'(){this['restoreAutoRotationIFN'](),this['user_rotation']['loadStateIFN']();},'restoreAutoRotationIFN'(){this['accelerometer_rotation']['loadStateIFN']();},'getNextAlarmClockTriggerTime'(){let ls=context['getSystemService'](lF['ALARM_SERVICE'])['getNextAlarmClock']();return null!==ls?ls['getTriggerTime']():Number['NaN'];},'getNextAlarmClockTriggerGap'(){let ls=this['getNextAlarmClockTriggerTime']()-Date['now']();return isNaN(ls)?0x1/0x0:Math['max'](0x0,ls);},'isNextAlarmClockTriggered'(ls){let lu=Number(ls);return lu=isNaN(lu)||lu<0x0?0x0:lu,this['getNextAlarmClockTriggerGap']()({'raw_info':{1:{'version':'1.0','release':'September\x2023,\x202008'},2:{'version':'1.1','release':'February\x209,\x202009'},3:{'version':'1.5','release':'April\x2027,\x202009'},4:{'version':'1.6','release':'September\x2015,\x202009'},5:{'version':'2.0','release':'October\x2027,\x202009'},6:{'version':'2.0.1','release':'December\x203,\x202009'},7:{'version':'2.1','release':'January\x2011,\x202010'},8:{'version':['2.2','2.2.3'],'release':'May\x2020,\x202010'},9:{'version':['2.3','2.3.2'],'release':'December\x206,\x202010'},10:{'version':['2.3.3','2.3.7'],'release':'February\x209,\x202011'},11:{'version':'3.0','release':'February\x2022,\x202011'},12:{'version':'3.1','release':'May\x2010,\x202011'},13:{'version':['3.2','3.2.6'],'release':'July\x2015,\x202011'},14:{'version':['4.0','4.0.2'],'release':'October\x2018,\x202011'},15:{'version':['4.0.3','4.0.4'],'release':'December\x2016,\x202011'},16:{'version':['4.1','4.1.2'],'release':'July\x209,\x202012'},17:{'version':['4.2','4.2.2'],'release':'November\x2013,\x202012'},18:{'version':['4.3','4.3.1'],'release':'July\x2024,\x202013'},19:{'version':['4.4','4.4.4'],'release':'October\x2031,\x202013'},20:{'version':['4.4W','4.4W.2'],'release':'June\x2025,\x202014'},21:{'version':['5.0','5.0.2'],'release':'November\x204,\x202014'},22:{'version':['5.1','5.1.1'],'release':'March\x202,\x202015'},23:{'version':['6.0','6.0.1'],'release':'October\x202,\x202015'},24:{'version':'7.0','release':'August\x2022,\x202016'},25:{'version':['7.1','7.1.2'],'release':'October\x204,\x202016'},26:{'version':'8.0','release':'August\x2021,\x202017'},27:{'version':'8.1','release':'December\x205,\x202017'},28:{'version':'9','release':'August\x206,\x202018'},29:{'version':'10','release':'September\x207,\x202019'},30:{'version':'11','release':'September\x208,\x202020'},31:{'version':'12','release':'October\x204,\x202021'}},'month_map':{'Jan':0x0,'Feb':0x1,'Mar':0x2,'Apr':0x3,'May':0x4,'Jun':0x5,'Jul':0x6,'Aug':0x7,'Sep':0x8,'Oct':0x9,'Nov':0xa,'Dec':0xb},'parseDate'(ls){let lu=ls['replace'](/([A-Z]..)\D*?\s(\d\d?), (\d{4})/,(ls,lu,lw,ty)=>[ty,this['month_map'][lu],lw]['join'](','))['split'](',')['map'](ls=>Number(ls));return lu['unshift'](null),new(Function['prototype']['bind']['apply'](Date,lu))();},'parseRawInfo'(){this['versions']={},Object['keys'](this['raw_info'])['forEach'](ls=>{let lu=this['raw_info'][ls],lw=lu['version'];Array['isArray'](lw)&&(lw={'min':lw[0x0],'max':lw[0x1]}),this['versions'][ls]={'version':lw,'release':this['parseDate'](lu['release'])};});},'parseArgs'(){this['sdk']=ls||device['sdkInt'],this['parseRawInfo']();},'getResult'(){return this['parseArgs'](),this['versions'][this['sdk']]||{};}}['getResult']()),'ensureSdkInt'(ls){let lu=ls||0x18;if(device['sdkInt']\x20'+ls),ls;},this['put']=function(ls){return f['_'](lu+'\x20<-\x20'+ls),function(){try{switch(lw){case'Int':return tN['putInt']['apply'](tN,arguments);case'Long':return tN['putLong']['apply'](tN,arguments);case'Float':return tN['putFloat']['apply'](tN,arguments);case'String':return tN['putString']['apply'](tN,arguments);default:throw f['_']('Unknown\x20data_type:\x20'+lw,0x3),Error('Local\x20Exception');}}catch(u2){return tT('put',arguments);}}(tO,tN[lu],ls);},this['verify']=function(ls){return this['get']()===ls;},this['toggle']=function(ls,lu){if(!Array['isArray'](this['state_set']))throw Error('A\x20\x22state_set\x22\x20must\x20be\x20defined\x20for\x20StateManager.[[instance]].toggle');let lw=this['state_set'];'function'==typeof lu&&(lw=this['state_set']['filter'](lu));let tM=tP['call'](this,lw,function(ls){return void 0x0===ls||'+'===ls||'clockwise'===ls||Object['is'](ls,0x0);}(ls));return this['put'](tM),tM;},this['saveState']=function(){this['_last_state']=this['get']();},this['loadState']=function(ls){if(a(this['_last_state']))throw Error('State\x20must\x20be\x20saved\x20before\x20loading');this['put'](this['_last_state']),ls||this['clearState']();},this['loadStateIFN']=function(ls){a(this['_last_state'])||this['put'](this['_last_state']),ls||this['clearState']();},this['clearState']=function(){delete this['_last_state'];},this['storage']=storages['create']('devicex_state_manager'),this['saveIntoStorage']=function(){this['storage']['put'](this['key'],this['get']());},this['loadFromStorage']=function(ls){let lu=this['storage']['get'](this['key']);if(a(lu))throw Error('Storage\x20must\x20be\x20saved\x20before\x20loading');f['_'](this['key']+'\x20->\x20'+lu),this['put'](lu),ls||this['clearStorage']();},this['loadFromStorageIFN']=function(ls){let lu=this['storage']['get'](this['key']);a(lu)||this['put'](lu),ls||this['clearStorage']();},this['clearStorage']=function(){this['storage']['remove'](this['key']);};}lN['$bind'](),ls['exports']={'devicex':lN,'$$disp':lN['getDisplay']()};},949:(uf,ug,uh)=>{let {$$und,$$func,$$F,isPlainObject,isNullish,isXMLType}=uh(0x2c4),{colorsx}=uh(0xcb),{consolex}=uh(0x2d5),uj=android['view']['WindowManager'],uk=uj['LayoutParams'],ul=android['os']['Looper'],um=android['text']['util']['Linkify'],un=android['content']['res']['ColorStateList'],uo=android['graphics']['drawable']['ColorDrawable'],up=com['stardust']['autojs']['core']['ui']['dialog']['JsDialog'],uq=com['afollestad']['materialdialogs']['DialogAction'],ur=com['afollestad']['materialdialogs']['MaterialDialog'],us={'contents':uh(0x2f1),'isUiThread':()=>ul['myLooper']()===ul['getMainLooper'](),'rtDialogs':()=>us['isUiThread']()?runtime['dialogs']:runtime['dialogs']['nonUiDialogs']},ut={'colors':{'wrap'(uu,uv){if(uv&&this[uv])for(let uw in this[uv])if(this[uv]['hasOwnProperty'](uw)&&uu===uw){let uu=this[uv][uw];return Array['isArray'](uu)?uu[0x0]:uu;}return uu;},'title':{'default':'#212121','caution':'#880E0E','warn':'#880E4F','alert':['#C51162','#FFEFFE']},'content':{'default':'#757575','caution':'#AD1414','warn':'#AD1457','alert':['#283593','#E1F5FE']},'progress':{'download':['#FF6F00','#FFECB3','#C43E00'],'files':['#F9A825','#FFF59D','#C17900'],'backup':['#455A64','#ECEFF1','#1C313A'],'restore':['#AB47BC','#F3E5F5','#790E8B'],'indeterminate':['#00897B','#B2DFDB','#005B4F'],'finish':['#00C853','#DCEDC8','#009624'],'success':['#00C853','#DCEDC8','#009624'],'error':['#1565C0','#BBDEFB','#003C8F'],'failure':['#1565C0','#BBDEFB','#003C8F']},'button':{'default_aj_4':'#01A9F3','default':'#03A9F4','caution':'#FF3D00','warn':'#F57C00','attraction':'#7B1FA2','hint':'#0DA798','reset':'#A1887F','unavailable':'#BDBDBD','finish':'#009624','success':'#009624','error':'#003C8F','failure':'#003C8F'}},'text':{'btn':{'F':'完成','B':'返回','Q':'放弃','X':'退出','I':'终止','K':'确定','S':'确认','C':'关闭','D':'删除','N':'继续','M':'确认修改','R':'使用默认值','T':'了解更多'},'no_more_prompt':'不再提示','user_interrupted':'用户终止'},'pool':{'_data':{},'add'(uy,uz){return isNullish(uy)?uy:this['_data'][(uz||'')+ut['getName'](uy)]=uy;},'get'(uA){return this['_data'][uA];},'clear'(){let uB=Object['keys'](this['_data'])['filter'](uB=>{if(this['_data'][uB]['isShowing']())return!0x0;delete this['_data'][uB];})['map'](uB=>{let uE=this['_data'][uB];return uE['dismiss'](),uB['match'](/@[a-f0-9]{5,}$/)?uB:uB+ut['getName'](uE);});uB['length']&&consolex['_'](['清理扩展对话框样本池:']['concat'](uB),0x0,0x0,-0x2);}},'getName':uF=>'@'+java['lang']['Integer']['toHexString'](uF['hashCode']()),'build'(uG){let uI=Object['create'](runtime['dialogs']['newBuilder']());return uI['thread']=threads['currentThread'](),Object['keys'](uG)['forEach'](uJ=>vl['call'](this,uI,uJ,uG[uJ])),function(uG,uI){if(void 0x0!==uI['inputHint']||void 0x0!==uI['inputPrefill']){let uM=vd(uI['inputHint']),uN=vd(uI['inputPrefill']),uO=function(uI,uQ){return uG['emit']('input_change',uG['dialog'],uQ['toString']());};uG['input'](uM,uN,uO)['alwaysCallInputCallback']();}if(void 0x0!==uI['items']){let uR=uI['itemsSelectMode'];if(void 0x0===uR||'select'===uR)uG['itemsCallback'](function(uI,uR,uU,uV){uG['emit']('item_select',uU,uV['toString'](),uG['dialog']);});else if('single'===uR)uG['itemsCallbackSingleChoice'](void 0x0===uI['itemsSelectedIndex']?-0x1:uI['itemsSelectedIndex'],function(uI,uR,uZ,v0){return uG['emit']('single_choice',uZ,v0['toString'](),uG['dialog']),!0x0;});else{if('multi'!==uR)throw new Error('Unknown\x20itemsSelectMode\x20'+uR);uG['itemsCallbackMultiChoice'](void 0x0===uI['itemsSelectedIndex']?null:uI['itemsSelectedIndex'],function(uI,uR,v3){return uG['emit']('multi_choice',vf(uR,(uG,uI)=>parseInt(uG[uI])),vf(v3,(uG,uI)=>uG[uI]['toString']()),uG['dialog']),!0x0;});}}if(void 0x0!==uI['progress']){let v8=uI['progress'];uG['progress'](-0x1===v8['max'],v8['max'],!!v8['showMinMax']),uG['progressIndeterminateStyle'](!!v8['horizontal']);}if(void 0x0===uI['checkBoxPrompt']&&void 0x0===uI['checkBoxChecked']||uG['checkBoxPrompt'](vd(uI['checkBoxPrompt']),!!uI['checkBoxChecked'],function(uI,va){return uG['getDialog']()['emit']('check',va,uG['getDialog']());}),void 0x0!==uI['customView']){let vb=uI['customView'];(isXMLType(vb)||'string'==typeof vb)&&(vb=ui['run'](()=>ui['inflate']('customView')));let vc=uI['wrapInScrollView'];uG['customView'](vb,void 0x0===vc||vc);}function vd(uG){return uG||'';}function vf(uG,uI){let vd=[],vf=uG['length'];for(let vk=0x0;vkthis['text']['btn'][uG]||uG},'positiveColor':{'adapter':colorsx['toInt']},'neutral':{'method':'neutralText','adapter':uG=>this['text']['btn'][uG]||uG},'neutralColor':{'adapter':colorsx['toInt']},'negative':{'method':'negativeText','adapter':uG=>this['text']['btn'][uG]||uG},'negativeColor':{'adapter':colorsx['toInt']},'cancelable':null,'canceledOnTouchOutside':null,'autoDismiss':null};if(vp['hasOwnProperty'](uI)){let vt=vp[uI]||{};void 0x0===vt['method']&&(vt['method']=uI),vt['adapter']&&(vl=vt['adapter'](vl)),uG[vt['method']]['call'](uG,vl);}}},'builds'(vu,vv){if(isPlainObject(vu))return this['builds']('',vu);let [vw,vx,vy,vz,vA,vB,vC]='string'==typeof vu?[vu]:vu,vD={'autoDismiss':!vB,'canceledOnTouchOutside':!vB,'checkBoxPrompt':vC?'string'==typeof vC?vC:this['text']['no_more_prompt']:void 0x0},vE=vv||{};[['title',vw,this['colors']['title']],['content',vx,this['colors']['content']],['neutral',vy,this['colors']['button'],this['text']['btn']],['negative',vz,this['colors']['button'],this['text']['btn']],['positive',vA,this['colors']['button'],this['text']['btn']]]['map'](vu=>{let [vv,vw]=vu;return $$und(vw)&&!$$und(vE[vv])&&vu['splice'](0x1,0x1,vE[vv]),vu;})['forEach'](vu=>vS['apply'](this,vu)),Object['assign'](vD,vE),['title','content']['forEach'](vu=>{vu in vD&&(vD[vu]=String(vD[vu]));});let vK=this['build'](vD);if(vE['linkify']&&this['linkify'](vK),void 0x0!==vE['keycode_back']){let vu=vE['keycode_back'];('disabled'===vu||$$func(vu)||$$F(vu))&&this['disableBack'](vK,vu);}return ui['post'](()=>{let vu=vK['getWindow'](),vv=vE['dim_amount'];if('number'==typeof vv){for(;vv>0x1;)vv/=0x64;vu['setDimAmount'](vv);}let vw=vE['background'];'string'==typeof vw?vw['match'](/^#/)?vu['setBackgroundDrawable'](new uo(colorsx['toInt'](vw))):vu['setBackgroundDrawableResource'](android['R']['color'][vw]):'number'==typeof vw&&vu['setBackgroundDrawable'](new uo(vw));let vx=vE['animation'];'string'==typeof vx&&(vx=vx['split']('_')['map'](vu=>vu['toTitleCase']())['join'](''),'Default'===vx?vu['setWindowAnimations'](android['R']['style']['Animation']):vu['setWindowAnimations'](android['R']['style']['Animation_'+vx]));let vy=vE['is_keep_screen_on'];void 0x0!==vy&&vy&&vu['addFlags'](uk['FLAG_KEEP_SCREEN_ON']);}),vK;function vS(vu,vv,vw,vx){if(!vE[vu]||Array['isArray'](vE[vu])){let [vy,vz]=Array['isArray'](vv)?vv:[vv];vy&&('content'!==vu||vx||(vx=us['contents']),vE[vu]=vx&&vx[vy]||vy);let vA=vu+'Color',vB=vE[vA]||vw[vz]||vz||vw['default'];vE[vA]=colorsx['toInt'](vB);}}},'rawInput':(w1,w2,w3)=>us['isUiThread']()&&!w3?new Promise(w3=>{us['rtDialogs']()['rawInput'](w1,w2||'',function(){w3['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['rawInput'](w1,w2||'',w3||null),'input'(w5,w6,w7){if(w7)return this['rawInput'](w5,w6||'',w8=>w7(eval(w8)));if(us['isUiThread']())return new Promise(w9=>{us['rtDialogs']()['rawInput'](w5,w6||'',wa=>w9(eval(wa)));});let wb=this['rawInput'](w5,w6||'',w7||null);return'string'==typeof wb?eval(wb):void 0x0;},'alert':(wc,wd,we)=>us['isUiThread']()&&!we?new Promise(we=>{us['rtDialogs']()['alert'](wc,wd||'',function(){we['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['alert'](wc,wd||'',we||null),'alertTitle'(wg,wh,wi){let wj=global['_$_alert_title_info']=global['_$_alert_title_info']||{};wj[wg]=wj[wg]||{},wj['message_showing']?++wj['message_showing']:wj['message_showing']=0x1;let wk=wj[wg]['ori_text']||'',wl=wj[wg]['ori_text_color']||'',wm=wj[wg]['ori_bg_color']||'',wn=wg['getTitleView']();function wo(wg,wh,wi){let wj=wg['getTitleView'](),[wk,wl]=wi;ui['run'](()=>{wj['setText'](wh),wj['setTextColor'](wk),wj['setBackgroundColor'](wl);});}wk||(wj[wg]['ori_text']=wk=wn['getText']()),wl||(wj[wg]['ori_text_color']=wl=wn['getTextColors']()['getColorForState'](util['java']['array']('int',0x0),colors['parseColor']('#de000000'))),wm||(wj[wg]['ori_bg_color']=-0x1),wo(wg,wh,this['colors']['title']['alert']['map'](colorsx['toInt'])),0x0===wi||setTimeout(function(){--wj['message_showing']||wo(wg,wk,[wl,wm]);},wi||0xbb8);},'alertContent'(wv,ww,wx){let wy=wv['getContentView'](),wz=wy['getText']()['toString'](),wA='append'===wx||!0x0===wx,[wB,wC]=this['colors']['content']['alert']['map'](wv=>colorsx['toInt'](wv));ui['post'](()=>{wy['setText']((wA?wz+'\x0a\x0a':'')+ww),wy['setTextColor'](wB),wy['setBackgroundColor'](wC);});},'prompt'(wE,wF,wG){return this['rawInput'](wE,wF,wG);},'confirm':(wH,wI,wJ)=>us['isUiThread']()&&!wJ?new Promise(wJ=>{us['rtDialogs']()['confirm'](wH,wI||'',function(){wJ['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['confirm'](wH,wI||'',wJ||null),'select'(wL,wM,wN){return wM instanceof Array?us['isUiThread']()&&!wN?new Promise(wN=>{us['rtDialogs']()['select'](wL,wM,function(){wN['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['select'](wL,wM,wN||null):us['rtDialogs']()['select'](wL,[]['slice']['call'](arguments,0x1),null);},'singleChoice':(wP,wQ,wR,wS)=>us['isUiThread']()&&!wS?new Promise(wS=>{us['rtDialogs']()['singleChoice'](wP,wR||0x0,wQ,function(){wS['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['singleChoice'](wP,wR||0x0,wQ,wS||null),'multiChoice'(wU,wV,wW,wX){let wY=wU=>{let wV=[];for(let wW=0x0,wX=wU['length'];wWwX(wY(wU)))):us['isUiThread']()?new Promise(wX=>{us['rtDialogs']()['multiChoice'](wU,wW||[],wV,wU=>wX(wY(wU)));}):wY(us['rtDialogs']()['multiChoice'](wU,wW||[],wV,null));},'dismiss'(x6){(Array['isArray'](x6)?x6:[]['slice']['call'](arguments))['forEach'](x6=>{'object'==typeof x6&&x6['dismiss']&&x6['dismiss']();});},'clearPool'(){this['pool']['clear']();},'disableBack':(x8,x9)=>(x8['setOnKeyListener']({'onKey':(xa,xb,xc)=>xc['getAction']()===KeyEvent['ACTION_UP']&&('function'==typeof x9&&x9(x8),xb===KeyEvent['KEYCODE_BACK'])}),x8),'getTitleText':xd=>xd?xd['getTitleView']()['getText']()['toString']():'','setTitleText'(xe,xf){ui['run'](()=>{xe&&xe['getTitleView']()['setText'](xf?xf['toString']():'');});},'setTitleTextColor'(xg,xh){ui['run'](()=>{xg&&xg['getTitleView']()['setTextColor'](colorsx['toInt'](this['colors']['wrap'](xh,'title')));});},'setTitleBackgroundColor'(xi,xj){ui['run'](()=>{xi&&xi['getTitleView']()['setBackgroundColor'](colorsx['toInt'](this['colors']['wrap'](xj,'title')));});},'getContentText':xk=>xk?xk['getContentView']()['getText']()['toString']():null,'setContentText'(xl,xm){ui['run'](()=>{xl&&xl['getContentView']()['setText'](xm?xm['toString']():'');});},'appendContentText'(xn,xo){ui['run'](()=>{xn&&xn['getContentView']()['setText'](this['getContentText'](xn)+(xo?xo['toString']():''));});},'setContentTextColor'(xp,xq){ui['run'](()=>{xp&&xp['getContentView']()['setTextColor'](colorsx['toInt'](this['colors']['wrap'](xq,'content')));});},'setContentBackgroundColor'(xr,xs){ui['run'](()=>{xr&&xr['getContentView']()['setBackgroundColor'](colorsx['toInt'](this['colors']['wrap'](xs,'content')));});},'getInputText':xt=>xt?xt['getInputEditText']()['getText']()['toString']():'','setInputText'(xu,xv){let xw='string'==typeof xv?xv:void 0x0!==xv?xv['toString']():'';ui['run'](()=>xu&&xu['getInputEditText']()['setText'](xw));},'setInputTextColor'(xx,xy){ui['run'](()=>{xx&&xx['getInputEditText']()['setTextColor'](colorsx['toInt'](xy));});},'setInputBackgroundColor'(xz,xA){ui['run'](()=>{xz&&xz['getInputEditText']()['setBackgroundColor'](colorsx['toInt'](xA));});},'linkify'(xB,xC){if(xB){let xD=xB['getContentView']();ui['run'](()=>{let xB=xD['getText']()['toString']();xD['setAutoLinkMask'](um[xC||'ALL']),xD['setText'](xB);});}},'getDialogAction'(xF){try{switch(xF['toLowerCase']()){case'positive':return uq['valueOf']('POSITIVE');case'negative':return uq['valueOf']('NEGATIVE');case'neutral':return uq['valueOf']('NEUTRAL');}}catch(xG){return null;}throw TypeError('unknown\x20action\x20of\x20dialogsx.getDialogAction');},'getActionButton'(xH,xI){let xJ=xI['toLowerCase']();if(xH instanceof ur){let xI=this['getDialogAction'](xJ);if(null!==xI)return xH['getActionButton'](xI)['getText']()['toString']();if('object'==typeof xH[xJ+'Button'])return xH[xJ+'Button']['getText']();}return xH instanceof up?xH['getActionButton'](xJ):'';},'setActionButton'(xL,xM,xN,xO){let xP=function(xM){let xP=xM['toLowerCase']();xL instanceof ur?ui['run'](()=>{let xM=this['getDialogAction'](xP);null!==xM?xL['setActionButton'](xM,xN):'object'==typeof xL[xP+'Button']&&xL[xP+'Button']['setText'](xN);}):ui['run'](()=>xL['setActionButton'](xP,xN)),xO&&this['setActionButtonColor'](xL,xP,xO);}['bind'](this);Array['isArray'](xM)?xM['forEach'](xP):xP(xM);},'setActionButtonColor'(xT,xU,xV){let xW=function(xU){let xW=xU['toLowerCase'](),xZ=colorsx['toInt'](this['colors']['wrap'](xV,'button')),y0=this['getDialogAction'](xW);ui['run'](()=>null!==y0?xT['getActionButton'](y0)['setTextColor'](xZ):xT instanceof ur&&'object'==typeof xT[xW+'Button']?xT[xW+'Button']['setTextColor'](xZ):void 0x0);}['bind'](this);Array['isArray'](xU)?xU['forEach'](xW):xW(xU);},'buildCountdown'(y1,y2){let y3=Object['assign']({'keycode_back':()=>yd['pause'](0x64)},y2),y4=y3['onNeutral']||(y1=>y1),y5=y3['onNegative']||(y1=>y1),y6=y3['onPositive']||(y1=>y1),y7=y3['onTimeout'];if('function'!=typeof y7&&'string'!=typeof y7)throw Error('onTimeout\x20for\x20dialogsx.buildCountdown()\x20must\x20be\x20specified');let yb=0x0,yc=y3['timeout']||0x5;yc>0x64&&(yc=Math['round'](yc/0x3e8));let yd={'neutral'(){this['pause'](0x12c),y4(ye);},'negative'(){this['pause'](0x12c),y5(ye);},'positive'(){yb=0x1,this['pause'](0x64),y6(ye);},'pause'(y1){us['interrupt'](),setTimeout(()=>{if('function'==typeof y3['onPause'])return y3['onPause'](ye);if('object'==typeof y3['onPause']){let y1=y3['onPause'];'function'==typeof y1['action']&&y1['action'](ye),[{'key':'title','get':y1=>ut['getTitleText'](y1),'set'(y1,y2,y3){ut['setTitleText'](y1,y3);}},{'key':'content','get':y1=>ut['getContentText'](y1),'set'(y1,y2,y3){ut['setContentText'](y1,y3);}},{'key':'neutral','get':(y1,y2)=>ut['getActionButton'](y1,y2),'set'(y1,y2,y3){ut['setActionButton'](y1,y2,y3);}},{'key':'negative','get':(y1,y2)=>ut['getActionButton'](y1,y2),'set'(y1,y2,y3){ut['setActionButton'](y1,y2,y3);}},{'key':'positive','get':(y1,y2)=>ut['getActionButton'](y1,y2),'set'(y1,y2,y3){ut['setActionButton'](y1,y2,y3);}}]['forEach'](y2=>{let y4=y2['key'];if(y1[y4])if(Array['isArray'](y1[y4])){let [y3,y5]=y1[y4];y2['set'](ye,y4,y2['get'](ye,y4)['replace'](y3,y5));}else y2['set'](ye,y4,y1[y4]);else y3[y4]&&y2['set'](ye,y4,y3[y4]);});}},y1||0x320);},'block'(y1){let y2=y1||{},y3=y2['onStart']||(y1=>y1),y4=y2['onTimeout']||(y1=>y1),y5=y2['onUnblock']||(y1=>y1),y6=Date['now'](),y7=y2['timeout']||0x1;for(y7<0x64&&(y7*=0xea60),y3(ye);!yb;)Date['now']()-y6>y7&&(this['pause'](0x64),y4(ye)),sleep(0x78);y5(ye);}},ye=Object['create'](ut['builds'](y1,y3)['on']('neutral',()=>yd['neutral']())['on']('negative',()=>yd['negative']())['on']('positive',()=>yd['positive']())),yf={'act':()=>(ye['isShowing']()||ye['show'](),yg),'block':y1=>(yd['block'](y1),yg)},yg=Object['assign'](ye,yf),us=threads['start'](function(){let y1=ut['getContentText'](ye),y2=/%timeout%/,y4=y1['match'](y2)?function(y3){ye['setContent'](y1['replace'](y2,y3['toString']()));}:y1=>y1,y5=y3['timeout_button'],y6=y5&&ye['getActionButton'](y5),yb=y5?function(y1){ye['setActionButton'](y5,y6+'\x20\x20[\x20'+y1+'\x20]');}:y1=>y1;for(;y4(yc),yb(yc),!(yc<=0x0);)yc-=0x1,sleep(0x3e8);let yf=y7;'function'==typeof yf&&(yf=y7(ye)),yd[yf]['call'](yd);});return yg;},'buildFlow'(z8){let z9=this,za=Object['create'](z9['builds']([z8['title']||'',z8['steps']['map']((z8,z9)=>'\u3000\x20'+ ++z9+'.\x20'+z8['desc'])['join']('\x0a'),0x0,0x0,'I',0x1],{'progress':{'max':0x64,'showMinMax':!!z8['show_min_max']}})),zb={'act'(){let zb=new Promise(z9=>{za['on']('positive',()=>{global['_$_dialog_flow_interrupted']=!0x0;}),'function'==typeof z8['onStart']&&z8['onStart'](z8['initial_value'],za),z9(z8['initial_value']);});return z8['steps']['forEach']((z8,zc)=>{zb=zb['then'](zb=>{if(global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);let zk=z9=>(za['setProgress'](0x64),zK(zc+0x1),z8['onSuccess']&&z8['onSuccess'](zb),z9);za['setProgress'](0x0),function(z8){let zb=z8['toString'](),zc=z9['getContentText'](za);z9['setContentText'](za,zc['replace'](/^(. )(\d)(?=\.)/gm,(z8,z9,za)=>(za===zb?'▶\x20':z9)+za));}(zc+0x1);let zs=z8['action'](zb,za);return zs instanceof Promise?(zs=zs['then'](zk),zs):zk(zs);},z8['onFailure']);}),zb=zb['then'](zb=>{if(global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);z9['setProgressColorTheme'](za,'finish'),zK('all'),za['removeAllListeners']('positive'),za['setActionButton']('positive',ut['text']['btn']['F']),za['on']('positive',z8=>z8['dismiss']());let zc=z8['success_title'];zc&&z9['setTitleText'](za,zc);let zw=z8['success_content'];zw&&z9['appendContentText'](za,'\x0a\x0a'+zw),delete global['_$_dialog_flow_interrupted'],'function'==typeof z8['onSuccess']&&z8['onSuccess'](zb,za);}),zb['catch'](z9=>{delete global['_$_dialog_flow_interrupted'],'function'==typeof z8['onFailure']&&z8['onFailure']({'message':z9,'btn_text':ut['text']['btn'][z8['on_interrupt_btn_text']||'B'],'onPositive'(){ut['clearPool'](),exit();}},za);}),za['isShowing']()||za['show'](),zc;},'setStepDesc'(z9,zb,zA){if(z9<0x1)throw Error('step_num\x20is\x20less\x20than\x201');if(z9>=z8['steps']['length'])throw Error('step_num\x20must\x20be\x20less\x20than\x20steps\x20length');let zB=z9['toString'](),zC=za['getContentView'](),zD=zC['getText']()['toString'](),zE=z8['steps'][zB-0x1]['desc'];if(zD['match'](zE)){let z8=(zA?zE:'')+(zb||'');zC['setText'](zD['replace'](zE,z8));}return zc;},'setProgressData'(z8){if('object'==typeof z8){let z9=z8['processed']/z8['total']*0x64||0x0;za['setProgress'](Math['min'](Math['max'](0x0,z9),0x64));}return zc;},'setFailureData':z8=>(za['setActionButton']('positive',z8['btn_text']||ut['text']['btn']['B']),za['removeAllListeners']('positive'),za['on']('positive',z8['onPositive']||(z8=>z8['dismiss']())),ut['alertContent'](za,z8['message'],'append'),zc)},zc=Object['assign'](za,zb);return zc;function zK(z8){let zb='all'!==z8&&z8?z8:0x1/0x0,zc=z9['getContentText'](za);z9['setContentText'](za,zc['replace'](/^(. )(\d)(?=\.)/gm,(z8,z9,za)=>(za<=zb?'✔\x20':z9)+za));}},'buildProgress'(zR){let zS=Object['create'](ut['builds']([zR['title']||'',zR['content']||zR['desc']||'',0x0,0x0,'I',0x1],{'progress':{'max':0x64,'showMinMax':!!zR['show_min_max']}})),zT={'act':()=>(Promise['resolve'](zR['initial_value'])['then'](zT=>('function'==typeof zR['onStart']&&zR['onStart'](zR['initial_value'],zS),zT))['then'](zT=>{if(zS['on']('positive',()=>{global['_$_dialog_flow_interrupted']=!0x0;}),global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);return zR['action'](zT,zS);})['then'](zT=>{if(global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);ut['setProgressColorTheme'](zS,'finish'),zS['setProgress'](0x64),zS['removeAllListeners']('positive'),zS['setActionButton']('positive',ut['text']['btn']['F']),zS['on']('positive',zR=>zR['dismiss']());let zU=zR['success_title'];zU&&ut['setTitleText'](zS,zU);let A0=zR['success_content'];A0&&ut['appendContentText'](zS,'\x0a\x0a'+A0),delete global['_$_dialog_flow_interrupted'],'function'==typeof zR['onSuccess']&&zR['onSuccess'](zT,zS);})['catch'](zT=>{ut['setProgressColorTheme'](zS,'error'),zS['removeAllListeners']('positive');let zU=ut['text']['btn'][zR['on_interrupt_btn_text']||'B'];zS['setActionButton']('positive',zU),zS['on']('positive',zR=>zR['dismiss']()),ut['alertContent'](zS,zT,'append'),delete global['_$_dialog_flow_interrupted'],'function'==typeof zR['onFailure']&&zR['onFailure'](zT,zS);}),zS['isShowing']()||zS['show'](),zU),'setStepDesc'(zT,A5){let A6=zS['getContentView'](),A7=A6['getText']()['toString'](),A8=zR['content']||'';if(A7['match'](A8)){let zR=(A5?A8:'')+(zT||'');A6['setText'](A7['replace'](A8,zR));}return zU;},'setProgressData':zR=>(zS['setProgress'](zR['processed']/zR['total']*0x64),zU)},zU=Object['assign'](zS,zT);return zU;},'setProgress'(Ab,Ac,Ad){let Ae='object'==typeof Ac?Ac['processed']/Ac['total']*0x64:Ac;ui['run'](()=>Ab['getProgressBar']()['setProgress'](Ae,!!Ad));},'setProgressTintList'(Af,Ag){let Ah=colorsx['toInt'](this['colors']['wrap'](Ag,'progress')),Ai=un['valueOf'](Ah);Af['getProgressBar']()['setProgressTintList'](Ai);},'setProgressTintLists'(Aj,Ak){let Al=Ak;if(!Array['isArray'](Al))if('string'==typeof Al)Al=this['colors']['progress'][Ak]||[Al];else{if('number'!=typeof Al)throw Error('Unknown\x20colors\x20type\x20for\x20dialogsx.setProgressTintLists()');Al=[Al];}let [Am,An]=Al;Am&&this['setProgressTintList'](Aj,Am),An&&this['setProgressBackgroundTintList'](Aj,An);},'setProgressColorTheme'(Ao,Ap){let Aq=Ap;if(!Array['isArray'](Aq))if('string'==typeof Aq)Aq=this['colors']['progress'][Ap]||[Aq];else{if('number'!=typeof Aq)throw Error('Unknown\x20colors\x20type\x20for\x20dialogsx.setProgressColorTheme()');Aq=[Aq];}let [Ar,As,At]=Aq;Ar&&this['setProgressTintList'](Ao,Ar),As&&this['setProgressBackgroundTintList'](Ao,As),At&&this['setActionButtonColor'](Ao,'positive',At);},'setProgressBackgroundTintList'(Au,Av){let Aw=colorsx['toInt'](Av),Ax=un['valueOf'](Aw);Au['getProgressBar']()['setProgressBackgroundTintList'](Ax);},'setProgressNumberFormat'(Ay,Az,AA){ui['run'](()=>Ay['setProgressNumberFormat'](java['lang']['String']['format'](Az,AA)));},'clearProgressNumberFormat'(AB){ui['run'](()=>AB['setProgressNumberFormat'](''));},'performClick'(AC,AD){let AE=String(AD)['toLowerCase'](),AF=this['getDialogAction'](AE);null!==AF&&AC['getActionButton'](AF)['performClick']();},'alerts'(AG,AH){let AI=AH||{},AJ=AG||'',AK=AI['text_color']||'#E5FFFF',AL=AI['text_font_family']||'sans-serif-condensed',AM=AI['text_gravity']||'center',AN=AI['text_line_spacing']||'5cx',AO=AI['text_size']||0x12,AP=AI['button_width']||0x64,AQ=AI['button_text']||'OK',AR=AI['button_text_color']||'#E5FFFF',AS=AI['button_text_size']||0xf,us=AI['button_bg_tint_color']||'#00251A',AU=AI['button_font_family']||'sans-serif',AV=AI['button_layout_gravity']||'center',AW=AI['dialog_bg_color']||colorsx['hrgba']('#005B4F91'),AX=AI['dialog_dim_amount']||0x5a,AY=ui['inflate']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20');AY['text']['attr']('text',AJ),AY['text']['attr']('text_color',AK),AY['text']['attr']('text_size',AO),AY['text']['attr']('font_family',AL),AY['text']['attr']('gravity',AM),AY['text']['attr']('line_spacing',AN),AY['btn']['attr']('width',AP),AY['btn']['attr']('text',AQ),AY['btn']['attr']('text_size',AS),AY['btn']['attr']('text_color',AR),AY['btn']['attr']('layout_gravity',AV),AY['btn']['attr']('background_tint',us),AY['btn']['attr']('font_family',AU),AY['btn']['on']('click',()=>AZ['dismiss']());let AZ=this['builds']({'customView':AY,'canceledOnTouchOutside':!0x1,'background':AW,'animation':'input_method','dim_amount':AX,'keycode_back':AG=>AG['dismiss']()})['show']();}};uf['exports']={'dialogsx':ut};},758:(B1,B2,B3)=>{B3(0x2c4);let {consolex:i}=B3(0x2d5),B4=com['stardust']['autojs']['project']['ScriptConfig'],B5=com['stardust']['autojs']['execution']['ExecutionConfig'],B6={get 'my_engine'(){return engines['myEngine']();},get 'my_engine_id'(){return this['my_engine']['getId']();},get 'my_engine_exec_argv'(){let B1=this['my_engine']['getExecArgv'](),B2={};for(let B3 in B1)if(B1['hasOwnProperty'](B3)){let Ba=B1[B3];Ba instanceof java['lang']['Boolean']?B2[B3]=Ba['booleanValue']():Ba instanceof java['lang']['Double']?B2[B3]=Ba['doubleValue']():B2[B3]=Ba;}return B2;},get 'my_engine_src_name'(){return'function'==typeof this['my_engine']['source']['getName']?this['my_engine']['source']['getName']():this['my_engine']['source']['toString']()['replace'](/(.+?)(.(js|auto))?$/,'$1');},get 'all_engines'(){return engines['all']();},get 'cwd'(){return this['my_engine']['cwd']();},get 'cwp'(){return this['isLocal']()?this['my_engine']['source']['toString']():'';},'isLocal'(){return!this['isRemote']();},'isRemote'(){return/^\[remote]/['test'](this['my_engine_src_name']);},'ensureLocal'(){if(!this['isLocal']())throw Error('Script\x20must\x20be\x20running\x20locally\x20rather\x20than\x20remotely');},'execScript':(B1,B2,B3)=>runtime['engines']['execScript'](B1,B2,Bv(B3)),'execScriptFile':(B1,B2)=>{try{return runtime['engines']['execScriptFile'](B1,Bv(B2));}catch(Bg){return engines['execScriptFile'](B1,B2);}},'execAutoFile':(B1,B2)=>runtime['engines']['execAutoFile'](B1,Bv(B2)),'setExecutePath'(B1){if('string'!=typeof B1)throw TypeError('path\x20of\x20enginesx.setExecutePath()\x20must\x20be\x20string\x20type');if(!files['isDir'](B1))throw Error('path\x20of\x20enginesx.setExecutePath()\x20must\x20be\x20a\x20directory');this['my_engine']['setTag']('execute_path',B1);},'restart'(B1){let B2=B1||{},B3=i['debug']['fuel'](B2),B4=this['my_engine_exec_argv'],B5=void 0x0!==B4['max_restart_e_times']?Number(B4['max_restart_e_times']):void 0x0!==B2['max_restart_e_times']?Number(B2['max_restart_e_times']):0x1;if(!B5)return i['$']('引擎重启次数已超限',0x3);let B6=Number(B4['max_restart_e_times_bak'])||B5;if(B3('重启当前引擎任务'),B3('当前次数:\x20'+(B6-B5+0x1),0x0,0x1),B3('最大次数:\x20'+B6,0x0,0x1),this['isRemote']())return i['$']('远程任务不支持重启引擎',0x8,0x4,0x0,0x1);let Bq=B2['new_file']||this['my_engine_src_name'],Br=files['path'](Bq+(Bq['match'](/\.js$/)?'':'.js'));B3('运行新引擎任务:\x0a'+Br),this['execScriptFile'](Br,{'arguments':Object['assign']({},B2,{'max_restart_e_times':B5-0x1,'max_restart_e_times_bak':B6,'is_instant_running':B2['is_instant_running']})}),B3('强制停止旧引擎任务');let Bs=this['my_engine_id'];return this['all_engines']['filter'](B1=>B1['getId']()===Bs)['forEach'](B1=>B1['forceStop']()),!0x0;}};function Bv(B1){let B2=new B5(),B3=B1||{};if(B2['workingDirectory']=B3['path']||files['cwd'](),B2['delay']=B3['delay']||0x0,B2['interval']=B3['interval']||0x0,B2['loopTimes']=void 0x0===B3['loopTimes']?0x1:B3['loopTimes'],Object['keys'](B3['arguments']||{})['forEach'](B1=>B2['setArgument'](B1,B3['arguments'][B1])),'object'==typeof B3['scriptConfig']){let B1=B3['scriptConfig']['useFeatures']||[],BB=void 0x0!==B3['scriptConfig']['uiMode']&&B3['scriptConfig']['uiMode'];B2['scriptConfig']=new B4(B1,BB);}return B2;}B1['exports']={'enginesx':B6};},763:(BC,BD,BE)=>{let {threadsx:i}=BE(0xef),{enginesx:n}=BE(0x2f6),BF=java['io']['File'],BG=java['io']['FileInputStream'],BH=java['io']['FileOutputStream'],BI=java['io']['BufferedInputStream'],BJ=java['io']['BufferedOutputStream'],BK=java['util']['zip']['CheckedOutputStream'],BL=java['util']['zip']['ZipOutputStream'],BM=java['util']['zip']['ZipEntry'],BN=java['util']['zip']['ZipFile'],BO=java['util']['zip']['CRC32'],BP=org['autojs']['autojs']['Pref'],BQ={'copy'(BC,BD,BE){let BV=files['path'](BC),BW=files['path'](BD),BI=BE||{},BJ=BI['onCopyStart']||BI['onStart']||(BC=>BC),BK=BI['onCopyProgress']||BI['onProgress']||(BC=>BC),BL=BI['onCopySuccess']||BI['onSuccess']||(BC=>BC),BM=BI['onCopyFailure']||BI['onFailure']||console['error'];try{return function(BC,BD){BJ(),files['createWithDirs'](BD);let BE=new BF(BD);try{return function(BC,BD,BE){let BW=util['java']['array']('byte',0x2000),BG=new BF(BV)['length'](),BH=0x0;try{for(;BC['available']()>0x0;){let BE=BC['read'](BW);BE>0x0&&(BD['write'](BW,0x0,BE),BK({'processed':BH+=BE,'total':BG}));}BE&&(BC['close'](),BD['close']()),BL();}catch(Cf){BM(Cf);}}(BC,new BH(BE),!0x0),!0x0;}catch(Cg){return BM(Cg),!0x1;}}(new BG(BV),BW);}catch(Ch){return BM(Ch),!0x1;}}},BR={'sep':BF['separator'],'json':{'replacer':(BC,BD)=>'number'!=typeof BD||!isNaN(BD)&&isFinite(BD)?BD:'\ufeff'+BD['toString']()+'\ufeff','reviver'(BC,BD){let BE=/^\ufeff(.+)\ufeff$/;return'string'==typeof BD&&BD['match'](BE)?Number(BD['replace'](BE,'$1')):BD;}},'.local'(BC){let BD=files['join'](files['getSdcardPath'](),'.local');files['isFile'](BD)&&files['remove'](BD);let BE=files['join']['apply'](files,[BD]['concat']([]['slice']['call'](arguments)));return files['createWithDirs'](BE['slice'](0x0,BE['lastIndexOf'](this['sep'])+0x1)),BE;},'run'(BC,BD){BC['match'](/^(launcher|settings)\$$/)&&(BC='ant-forest-'+BC['slice'](0x0,-0x1)+'.js');let BE=files['path'](BC['match'](/\.js$/)?BC:BC+'.js');return'object'==typeof BD?(BD['monitor']&&(i['monitor'](BD['monitor']),delete BD['monitor']),n['execScriptFile'](BE,{'arguments':BD})):n['execScriptFile'](BE,null);},'zip'(BC,BD,BE,Cw){let Cx,BJ,BN,BP,BQ,CC=function(){global['_$_dialog_flow_interrupted']=!0x1,[BQ,BP,BN,BJ,Cx]['forEach'](BC=>{try{BC&&BC['close']();}catch(CI){}});},CD=BE||{},CE=Cw||{},CF=BC=>{let BD=CD['onZipFailure']||CD['onFailure'];return'function'==typeof BD?BD(BC):toastLog(BC),!0x1;},CG=CD['onZipStart']||CD['onStart'];'function'==typeof CG&&CG();let CL=files['path'](BC);if(!files['exists'](CL))throw Error('无效的压缩源');let CM=new BF(CL);CL=CM['getAbsolutePath']();let CN=BD?files['path'](BD):CL+'.zip',CO=new BF(CN);CN=CO['getAbsolutePath'](),'zip'!==files['getExtension'](CN)&&(CO=new BF(CN+='.zip')),files['exists'](CN)&&files['remove'](CN);let CP=0x0,CQ=this['getDirSize'](CL);try{BN=new BH(CO),BP=new BK(BN,new BO()),BQ=new BL(BP),function(BC){return CE['is_exclude_root_folder']&&BC['isDirectory']()?BC['listFiles']()['filter'](BC=>BC['getAbsolutePath']()!==CO['getAbsolutePath']())['forEach'](BC=>BD(BC)):BD(BC);function BD(BC,BE){let Cw=(BE?BE+BR['sep']:'')+BC['getName']();if(BC['isFile']()){let BD,BE=0x400,BF=util['java']['array']('byte',BE);for(BQ['putNextEntry'](new BM(Cw)),Cx=new BG(BC),BJ=new BI(Cx);(BD=BJ['read'](BF,0x0,BE))>-0x1;){if(global['_$_dialog_flow_interrupted'])return CC(),CF('用户终止');BQ['write'](BF,0x0,BD);}BQ['closeEntry'](),BJ['close'](),Cx['close']();let BH=CD['onZipProgress']||CD['onProgress'];'function'==typeof BH&&BH({'processed':CP+=BC['length'](),'total':CQ});}else BC['listFiles']()['filter'](BC=>BC['getAbsolutePath']()!==CO['getAbsolutePath']())['forEach'](BC=>BD(BC,Cw));}}(CM),CC();let BC=CD['onZipSuccess']||CD['onSuccess'];return'function'==typeof BC&&BC({'zipped_path':CN}),CE['is_delete_source']&&this['removeWithDirs'](CL,{'is_async':!0x0}),!0x0;}catch(D5){return CF('压缩失败:\x0a'+D5);}},'unzip'(BC,BD,BE,D9){let Da,BG,BK,BL=function(){global['_$_dialog_flow_interrupted']=!0x1,[BG,Da,BK]['forEach'](BC=>{try{BC&&BC['close']();}catch(Di){}});},BM=BE||{},BO=BC=>{let BD=BM['onUnzipFailure']||BM['onFailure'];return'function'==typeof BD?BD(BC):toastLog(BC),!0x1;},BP=BM['onUnzipStart']||BM['onStart'];'function'==typeof BP&&BP();let BQ=D9||{},Dm=files['path'](BC);if(files['exists'](Dm)||(Dm+='.zip'),!files['exists'](Dm))throw Error('解压缩源不存在');let Dn=new BF(Dm),Do=Dn['length'](),Dp=Dn['getName'](),Dq=Dp['slice'](0x0,Dp['lastIndexOf']('.')),Dr=files['path'](BD);Dr&&files['exists'](Dr)||(Dr=Dm['slice'](0x0,Dm['lastIndexOf'](this['sep']))),BQ['to_archive_name_folder']&&(Dr=files['join'](Dr,Dq)),files['createWithDirs'](Dr+this['sep']);try{let BC=0x0,BD=0x400,BE=util['java']['array']('byte',BD),D9=new BN(Dn),BP=D9['entries']();for(;BP['hasMoreElements']();){let BN=BP['nextElement'](),BQ=BN['getCompressedSize'](),Dm=BN['getName'](),Dn=files['join'](Dr,Dm);files['createWithDirs'](Dn+(BN['isDirectory']()?BR['sep']:''));let Dp=new BF(Dn);if(Dp['isDirectory']())continue;let Dq=-0x1;for(Da=new BH(Dp),BG=new BJ(Da),BK=new BI(D9['getInputStream'](BN));(Dq=BK['read'](BE,0x0,BD))>-0x1;){if(global['_$_dialog_flow_interrupted'])return BL(),BO('用户终止');Da['write'](BE,0x0,Dq);}let DD=BM['onUnzipProgress']||BM['onProgress'];'function'==typeof DD&&DD({'processed':BC+=BQ,'total':Do});}BL();let Dp=BM['onUnzipSuccess']||BM['onSuccess'];return'function'==typeof Dp&&Dp({'unzipped_path':Dr}),BQ['is_delete_source']&&this['removeWithDirs'](Dm,{'is_async':!0x0}),!0x0;}catch(DF){return BO('解压失败:\x0a'+DF);}},'isValidZip'(BC){let BD=files['path'](BC);if(!BD||!files['exists'](BD))return!0x1;let BE=new BF(BD);if('zip'!==files['getExtension'](BE['getName']()))return!0x1;let DJ=null;try{return DJ=new BN(BE),!0x0;}catch(DK){return!0x1;}finally{try{null!==DJ&&(DJ['close'](),DJ=null);}catch(DL){}}},'copy'(BC,BD,BE,DP){let BG=DP||{},BH=BG['onCopyStart']||BG['onStart']||(BC=>BC),BI=BG['onCopyProgress']||BG['onProgress']||(BC=>BC),BJ=BG['onCopySuccess']||BG['onSuccess']||(BC=>BC),BK=BG['onCopyFailure']||BG['onFailure']||console['error'];BC&&BD||BK('Source\x20and\x20target\x20path\x20must\x20be\x20both\x20defined'),files['isDir'](BD)||BK('Target\x20path\x20must\x20be\x20a\x20directory');let BL=new BF(files['path'](BC))['getAbsolutePath'](),BM=new BF(files['path'](BD))['getAbsolutePath'](),BN=BE||{},BO=BN['is_unbundled'],BP=()=>{let BC=!0x0,BD=0x0,BE=0x1,E6=(DP,BF)=>{let BG=files['join'](BF,files['getName'](DP));files['isFile'](DP)?(BQ['copy'](DP,BG)||(BC=!0x1),BI({'processed':BD+=0x1,'total':BE})):files['listDir'](DP)['forEach'](BC=>{E6(files['join'](DP,BC),BG);});};if('function'==typeof BH&&BH(),files['isDir'](BL)){BO||(BM=files['join'](BM,files['getName'](BL)));let BC=files['listDir'](BL,function(BC){return'function'!=typeof BN['filter']||BN['filter'](BC);});BE=BC['length'],BC['forEach'](BC=>E6(files['join'](BL,BC),BM));}else E6(BL,BM);return BC&&BJ(),BC||BK('An\x20error\x20has\x20occurred\x20in\x20files.copy()'),BC;};if(!BN['is_async'])return BP();i['start'](BP);},'getScriptDirPath':()=>'function'==typeof BP['getScriptDirPath']?BP['getScriptDirPath']():com['stardust']['autojs']['core']['pref']['Pref']['INSTANCE']['getScriptDirPath'](),'isScriptDirPath'(BC){return new BF(files['path'](BC))['getAbsolutePath']()===this['getScriptDirPath']();},'getDirSize'(BC){let BD=files['path'](BC);if(!files['exists'](BD))throw Error('path\x20of\x20filesx.getDirSize()\x20is\x20not\x20exist');return files['isFile'](BD)?new BF(BD)['length']():new BF(BD)['listFiles']()['reduce']((BC,BD)=>BC+(BD['isDirectory']()?this['getDirSize'](BD):BD['length']()),0x0);},'removeWithDirs'(BC,BD,BE){let Em=BD||{},BF=BE||{},BG=BF['onRemoveStart']||BF['onStart']||(BC=>BC),BH=BF['onRemoveProgress']||BF['onProgress']||(BC=>BC),BI=BF['onRemoveSuccess']||BF['onSuccess']||(BC=>BC),BJ=BF['onRemoveFailure']||BF['onFailure']||console['error'],BK=0x0,BL=0x1,BM=()=>{let BD=!0x0;if(BG(),files['isFile'](BC))BD=BN(BC);else{if(!files['isDir'](BC))throw Error('Cannot\x20parse\x20path\x20for\x20filesx.removeWithDirs()');{let BE=files['listDir'](BC);BL=BE['length'],BE['forEach'](BE=>{BD=BN(files['join'](BC,BE))&&BD;}),files['remove'](BC);}}return BD&&BI(),BD||BJ('An\x20error\x20has\x20occurred\x20in\x20files.removeWithDirs()'),BD;},BN=BC=>{let BD=files['isDir'](BC)?files['removeDir'](BC):!!files['isFile'](BC)&&files['remove'](BC);return BH({'progress':BK+=0x1,'total':BL}),BD;};try{return Em['is_async']?i['start'](BM):BM();}catch(EE){BJ(EE);}},'listAllFiles'(BC){let BD=[];return'string'==typeof BC&&(BC=new BF(files['path'](BC))),function BC(BE){BE['isFile']()?BD['push'](BE):BE['isDirectory']()&&(BD['push'](BE),BE['listFiles']()['forEach'](BC));}(BC),BD;},'deleteRecursively'(BC){if('string'==typeof BC&&(BC=new BF(files['path'](BC))),BC['isDirectory']()){let BD=BC['listFiles']();if(null!==BD&&!BD['every'](BC=>this['deleteRecursively'](BC)))return!0x1;}return BC['delete']();},'deleteByList'(BC,BD,BE){let EO=this,BF=BD||{},BG=BE||{},BH=BG['onDeleteStart']||BG['onStart']||(BC=>BC),BI=BG['onDeleteProgress']||BG['onProgress']||(BC=>BC),BJ=BG['onDeleteSuccess']||BG['onSuccess']||(BC=>BC),BK=BG['onDeleteFailure']||BG['onFailure']||console['error'];if(BF['is_async'])return BL();function BL(){BH();let BD=!0x0,BE=EO['listAllFiles'](BC)['reverse'](),F1=0x0,BF=BE['length'];return BE['forEach'](BC=>{BD=BC['delete']()&&BD,BI({'processed':F1+=0x1,'total':BF});}),BD&&BJ(),BD||BK('An\x20error\x20has\x20occurred\x20in\x20files.deleteByList()'),BD;}i['start'](BL);},'read'(BC,BD){let BE=null;return files['exists'](BC)&&(BE=files['read'](BC)),BE||(void 0x0===BD?BE:BD);},'readJson'(BC,BD,BE){let Fa=void 0x0===BD?{}:BD;try{return JSON['parse'](this['read'](BC),BE||this['json']['reviver'])||Fa;}catch(Fb){return Fa;}},'write'(BC,BD){BC&&!files['exists'](BC)&&files['createWithDirs'](BC),files['write'](BC,BD);},'writeJson'(BC,BD,BE){this['write'](BC,JSON['stringify'](BD,BE||this['json']['replacer']));}};BC['exports']={'filesx':BR};},131:(Fh,Fi,Fj)=>{let {threadsx:i}=Fj(0xef),Fk=java['net']['URL'],Fl=java['io']['File'],Fm=java['lang']['StringBuilder'],Fn=java['io']['BufferedReader'],Fo=java['io']['FileOutputStream'],Fp=java['io']['InputStreamReader'],Fq=java['io']['BufferedInputStream'],Fr=java['io']['BufferedOutputStream'],Fs=java['lang']['reflect']['Array'],Ft=okhttp3['Request']['Builder'],Fu={'getContentLength'(Fh,Fi,Fj){if('string'!=typeof Fh)throw Error('url\x20for\x20httpx.getContentLength()\x20is\x20required');if('function'!=typeof Fi)throw Error('callback\x20for\x20httpx.getContentLength()\x20is\x20required');let Fl=Fj||{},Fm=Fl['timeout']||0x2710,Fn=Date['now']()+Fm,Fo=i['atomic'](-0x1),Fp=function(Fj){let Fl=i['start'](function(){try{let Fj=new Fk(Fh)['openConnection']();Fj['setRequestProperty']('Accept-Encoding','identity'),Fj['setConnectTimeout'](Fm);let FH=Fj['getContentLengthLong']();Fj['disconnect'](),-0x1!==FH&&Fo['compareAndSet'](-0x1,FH)&&Fi(Fo['get']());}catch(FI){}});i['start'](function(){try{for(;;){if(Fo['get']()>0x0)return Fl['interrupt']();if(Date['now']()>=Fn)return Fj(-0x1),Fl['interrupt']();sleep(0x78);}}catch(FJ){}});},Fq=Fl['concurrence']||0xc;for(let Fh=0x0;FhFh),FS=Fk['onResponse']||(Fh=>Fh),FT=Fk['onDownloadProgress']||(Fh=>Fh),FU=Fk['onDownloadSuccess']||(Fh=>Fh),FV=Fh=>{if('function'!=typeof Fk['onDownloadFailure'])throw Error(Fh+'\x0a'+Fh['stack']);Fk['onDownloadFailure'](Fh);};if(!Fh)return FV('url\x20for\x20httpx.okhttp3Request()\x20is\x20required');if(void 0x0!==Fu['is_async']&&!Fu['is_async'])return G1();function G1(){try{let Fi;FR();let Fj=new Ft();Object['keys'](Fu['headers']||{})['forEach'](Fh=>{Fj['addHeader'](Fh,Fu['headers'][Fh]);});let G5=new OkHttpClient()['newCall'](Fj['url'](Fh)['get']()['build']())['execute']();FS(G5);let Fk=0x1000,G1=Fs['newInstance'](java['lang']['Byte']['TYPE'],Fk),G8=0x0,G9=G5['code']();0xc8!==G9&&FV(G9+'\x20'+G5['message']());let Ga=G5['body']()['byteStream'](),Gb=G5['body']()['contentLength']();if('string'==typeof FQ){let Fh=-0x1,Fj=new Fq(Ga),G5=new Fo(new Fl(files['path'](FQ))),Fm=new Fr(G5);for(;-0x1!==(Fh=Fj['read'](G1,0x0,Fk));)global['_$_dialog_flow_interrupted']&&(Gl([Fm,G5,Fj,Ga]),FV('用户终止')),G5['write'](G1,0x0,Fh),G8+=Fh,FT({'processed':G8,'total':Gb});Gl([Fm,G5,Fj,Ga]),FU({'downloaded_path':Fi=FQ});}else{let Fh=new Fp(Ga),Fj=new Fn(Fh),G5=new Fm(),Fk=null;for(;null!==(Fk=Fj['readLine']());)global['_$_dialog_flow_interrupted']&&(Gl([Fj,Fh,Ga]),FV('用户终止')),G5['append'](Fk)['append']('\x0d\x0a'),G8+=Fk['length'],FT({'processed':G8,'total':Gb});Gl([Fj,Fh,Ga]),FU({'downloaded_string':Fi=G5['toString']()});}return Fi;}catch(Gk){FV('请求失败:\x0a'+Gk);}}function Gl(Fh){Fh['forEach'](Fh=>{try{Fh&&Fh['close']();}catch(Go){}}),global['_$_dialog_flow_interrupted']=!0x1;}i['start'](G1);}};Fh['exports']={'httpx':Fu};},220:(Gp,Gq,Gr)=>{let {isNullish:i,isPlainObject:n}=Gr(0x2c4),{filesx:s}=Gr(0x2fb),{cryptox:o}=Gr(0xbe),Gs=function(){let Gp={'parseFile'(Gp){let Gq=s['read'](Gp,'');try{return Gq?JSON['parse'](Gq,s['json']['reviver']):{};}catch(Gy){console['warn']('JSON.parse()解析配置文件异常');}try{return this['tryRepairEscChar'](Gp,Gq);}catch(Gz){console['warn']('转义字符修复失败');}try{return this['tryRepairMojibakeLines'](Gp,Gq);}catch(GA){console['warn']('乱码行修复失败');}this['failAndBackup'](Gp);},'tryRepairEscChar'(Gp,Gq){console['warn']('尝试查找并修复异常的转义字符');let Gr=/[ntrfb\\'"0xu]/,GE='';for(let Gp in Gq){let GG=+Gp,GH=Gq[GG];if('\x5c'===GH){let Gp=Gq[GG-0x1],GE=Gq[GG+0x1];Gp&&GE&&'\x5c'!==Gp&&!GE['match'](Gr)&&(GH+='\x5c');}GE+=GH;}return this['writeBackFileAndParse'](Gp,GE);},'tryRepairMojibakeLines'(Gp,Gq){console['warn']('尝试查找并修复异常的乱码行');let Gr=Gq['split']('\x0a');for(;Gr['length']>0x0;)try{return Gr['pop'](),this['writeBackFileAndParse'](Gp,Gr['join']('\x0a'));}catch(GN){}throw Error('Failed\x20to\x20repair\x20mojibake\x20lines');},'writeBackFileAndParse'(Gp,Gq){let Gr=JSON['parse'](Gq,s['json']['reviver']);return console['info']('修复成功'),s['write'](Gp,Gq),console['info']('已重新写入修复后的数据'),Gr;},'failAndBackup'(Gp){let Gq=files['getName'](Gp)+'.'+Date['now']()+'.bak';throw files['rename'](Gp,Gq),console['error']('修复失败'),console['warn']('已将损坏的配置文件备份至'),console['warn'](files['join'](s['.local'](),Gq)),console['warn']('以供手动排查配置文件中的问题'),Error('JSON.parse()\x20failed\x20in\x20ext-storages');},'getKeyInput'(){let Gp=files['join'](s['.local'](),'key.nfex'),Gq=s['readJson'](Gp,{});return Gq['af']||(Gq['af']=o['generateRandomKeyInput'](),s['writeJson'](Gp,Gq)),Gq['af'];},'encrypt'(Gp){if(i(Gp))throw TypeError('Nullish\x20typed\x20value\x20cannot\x20be\x20encrypted');return o['enc'](Gp['toString'](),this['getKeyInput']());},'decrypt'(Gp){if(i(Gp))throw TypeError('Non-string\x20typed\x20value\x20cannot\x20be\x20decrypted');return o['dec'](Gp['toString'](),this['getKeyInput']());},'reEncryptFromLegacyFile'(Gp){let Gq=this['parseFile'](Gp),Gr=Gp=>{if(n(Gp))return(Gp=>(Object['keys'](Gp)['forEach'](Gq=>Gp[Gq]=Gr(Gp[Gq])),Gp))(Gp);if('string'==typeof Gp&&Gp['startsWith']('[')&&Gp['endsWith'](']')){let Gq=o['_pwmap']['decrypt'](Gp);if(!i(Gq))return this['encrypt'](Gq);}return Gp;};s['writeJson'](Gp,Gr(Gq));}},Gq=function(Gq){this['name']=Gq,this['dir']=s['.local'](),this['path_legacy']=files['join'](this['dir'],this['name']+'.nfe'),this['path']=this['path_legacy']+'x',files['exists'](this['path'])||(files['exists'](this['path_legacy'])?(files['copy'](this['path_legacy'],this['path']),Gp['reEncryptFromLegacyFile'](this['path'])):files['createWithDirs'](this['path']));};return Gq['prototype']={'constructor':Gq,'contains'(Gq){return Gq in Gp['parseFile'](this['path']);},'put'(Gq,Gr,H8){if(void 0x0===Gr)throw new TypeError('\x22put\x22\x20value\x20can\x27t\x20be\x20undefined');let H9={},Gs={},Gt=H8||{},Hc=Gq=>Gp['encrypt'](JSON['stringify'](Gq,s['json']['replacer'])),Hd=Gp=>{if(!Gt['is_crypto'])return Gp;if(!n(Gp)||Gt['is_forcible'])return Hc(Gp);let Gq={};return Object['keys'](Gp)['forEach'](Gr=>Gq[Gr]=Hc(Gp[Gr])),Gq;};try{H9=Gp['parseFile'](this['path']);}catch(Hi){console['warn'](Hi['message']);}!Gt['is_forcible']&&n(Gr)&&n(H9[Gq])&&Object['keys'](Gr)['length']>0x0?Gs[Gq]=Object['assign'](H9[Gq],Hd(Gr)):Gs[Gq]=Hd(Gr),Object['assign'](H9,Gs),s['writeJson'](this['path'],H9);},'get'(Gq,Gr,Hl){if(void 0x0===Hl&&'object'==typeof Gr){let Gp=['default','prop','is_crypto'],Hn=Object['keys'](Gr);if(Gp['some'](Gp=>Hn['indexOf'](Gp)>-0x1))return this['get'](Gq,Gr['default'],Gr);}let Hp=Gp['parseFile'](this['path']),Gs=Hl||{};if(Hp&&Gq in Hp){let Gr=Hp[Gq];if(void 0x0!==Gs['prop']&&(Array['isArray'](Gs['prop'])?Gs['prop']['forEach'](Gp=>Gr=Gr[Gp]):Gr=Gr[Gs['prop']]),i(Gr))return Gr;if(Gs['is_crypto']){let Gq=Gp['decrypt'](Gr);try{return JSON['parse'](Gq,s['json']['reviver']);}catch(Hu){return Gq;}}return Gr;}return void 0x0!==Gs['default']?Gs['default']:Gr;},'remove'(Gq){let Gr=Gp['parseFile'](this['path']);Gq in Gr&&(delete Gr[Gq],s['writeJson'](this['path'],Gr));},'clear'(){files['remove'](this['path']);}},Gq;}(),Gt={'@default':Gr(0xd9),get 'af'(){return this['_af']=this['_af']||this['create']('af');},get 'af_auto'(){return this['_af_auto']=this['_af_auto']||this['create']('af_auto');},get 'af_bak'(){return this['_af_bak']=this['_af_bak']||this['create']('af_bak');},get 'af_blist'(){return this['_af_blist']=this['_af_blist']||this['create']('af_blist');},get 'af_cfg'(){return this['_af_cfg']=this['_af_cfg']||this['create']('af_cfg');},get 'af_flist'(){return this['_af_flist']=this['_af_flist']||this['create']('af_flist');},get 'af_ins'(){return this['_af_ins']=this['_af_ins']||this['create']('af_ins');},get 'unlock'(){return this['_unlock']=this['_unlock']||this['create']('unlock');},'create':Gp=>new Gs(Gp),'remove'(Gp){this['create'](Gp)['clear']();}};Gp['exports']={'storagesx':Gt};},239:(Hz,HA,HB)=>{let {isNormalFunction:i,isArrowFunction:n}=HB(0x2c4),{a11yx:s}=HB(0x2d4),HC=java['lang']['Runnable'],HD=java['lang']['Throwable'],HE=java['util']['concurrent']['atomic']['AtomicLong'],HF=com['stardust']['autojs']['core']['looper']['TimerThread'],HG=com['stardust']['autojs']['runtime']['exception']['ScriptInterruptedException'],HH={'_monitor_preset':{'ensure_open':Hz=>{let HA=void 0x0===Hz?0x1068:Hz||0x1/0x0;return s['waitAndClick'](/打开/,HA,0xf0,{'cs$':'w'});}},'_start'(Hz){let HA=threads['start'](Hz);return Object['create'](HA,{'join':{'value'(Hz){Hz===0x1/0x0||void 0x0===Hz?Hz=0x0:Hz<0x1&&(Hz=0x1),HA['join'](Hz);}}});},'monitor'(Hz,HA){let HB='string'==typeof Hz?this['_monitor_preset'][Hz]:Hz;if('function'==typeof HB)return this['start'](()=>HB['apply'](null,[]['slice']['call'](arguments)['slice'](0x1)));if(HB instanceof HC)return this['start'](HB);throw TypeError('Invalid\x20monitor:\x20'+Hz);},'monitorIFN'(Hz,HA){if(void 0x0!==Hz)return this['monitor']['apply'](this,arguments);},'start'(Hz,HA){let HB=HA||{},HV=!0x0;try{if(i(Hz)||Hz instanceof HC)return this['_start'](Hz);if(n(Hz))return this['_start'](new HC({'run':()=>Hz()}));HV=!0x1;}catch(HW){if(!HG['causedByInterrupted'](new HD(HW))&&!HW['message']['match'](/script exiting/)&&!0x1!==HB['is_show_error'])throw Error(HW+'\x0a'+HW['stack']);}if(!HV)throw TypeError('Unsupported\x20type\x20\x22'+typeof Hz+'\x22\x20for\x20threadsx.start()');},'atomic'(Hz){let HA=threads['atomic'](Hz);if(HA instanceof HE)return HA;let HB=Hz;return{'get':()=>HB,'incrementAndGet':()=>HB+=0x1,'compareAndSet':(Hz,HA)=>HB===Hz&&(HB=HA,!0x0)};},'interrupt'(Hz){Hz instanceof HF&&Hz['isAlive']()&&Hz['interrupt']();}};Hz['exports']={'threadsx':HH};},855:(I3,I4,I5)=>{let {isNullish:i}=I5(0x2c4),{threadsx:n}=I5(0xef),I6=context['getPackageName']()['match'](/Pro\b/i),I7=I6?com['stardust']['autojs']['core']['timing']:org['autojs']['autojs']['timing'],I8=I6?I7['TimedTask']['Companion']:I7['TimedTask'],I9=I7['TimedTaskManager'],Ia=I6?I9['Companion']['getInstance']():I9['getInstance'](),Ib=global['require']('__bridges__'),Ic=['monday','tuesday','wednesday','thursday','friday','saturday','sunday','mon','tue','wed','thu','fri','sat','sun','一','二','三','四','五','六','日',0x1,0x2,0x3,0x4,0x5,0x6,0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7]['map'](I3=>'string'==typeof I3?I3:I3['toString']()),Id={'_taskFulfilled'(I3,I4){if(!I3)return null;let I5=I4||{},Ii='function'==typeof I5['condition']?I5['condition']:()=>I3['id']>0x0,I6='function'==typeof I5['callback']?I5['callback']:null,I7=0xbb8,I8=()=>{for(;I7>0x0;){if(Ii())return I6?I6(I3):I3;sleep(0x78),I7-=0x78;}return null;};if(!I5['is_async'])return I8();n['start'](I8);},'addTask':I3=>(I3&&(I6?Ia['addTaskSync'](I3):Ia['addTask'](I3)),I3||null),'addDailyTask'(I3){let I4=I3||{},I5=JS('LocalTime',I4['time']||Date['now']()),Iq=files['path'](I4['path']),Ir=JP(I4),I6=this['addTask'](I8['dailyTask'](I5,Iq,Ir));return this['_taskFulfilled'](I6,I4);},'addWeeklyTask'(I3){let I4=I3||{},I5=0x0;for(let I3=0x0;I3Ia['getTimedTask'](I3),'getIntentTask':I3=>Ia['getIntentTask'](I3),'removeTask':I3=>I3?(I6?Ia['removeTaskSync'](I3):Ia['removeTask'](I3),I3):null,'removeIntentTask'(I3,I4){let I5=I4||{},IU=this['removeTask'](this['getIntentTask'](I3));return this['_taskFulfilled'](IU,Object['assign'](I5,{'condition':()=>!this['getIntentTask'](I3)}));},'removeTimedTask'(I3,I4){let I5=I4||{},IY=this['removeTask'](this['getTimedTask'](I3));return this['_taskFulfilled'](IY,Object['assign'](I5,{'condition':()=>!this['getTimedTask'](I3)}));},'updateTask':I3=>I3?(I3['setScheduled'](!0x1),Ia['updateTask'](I3),I3):null,'queryTimedTasks'(I3){let I4='',I5=[],J3=(I3||{})['path'];var J4;if(J3&&(J4='script_path\x20=\x20?',I4+=I4['length']?'\x20AND\x20'+J4:J4,I5['push'](J3)),I6){let I3=Ia['queryTimedTasks']['call'](Ia,I4||null,I5);return Ib['toArray'](I3);}let I7=Ia['getAllTasksAsList']()['toArray']();return J3?I7['filter'](I3=>I3['getScriptPath']()===J3):I7;},'queryIntentTasks'(I3){let I4=I3||{},I5='',Jb=[],Jc=I3=>I5+=I5['length']?'\x20AND\x20'+I3:I3,{path:I7,action:I8}=I4;if(I7&&(Jc('script_path\x20=\x20?'),Jb['push'](I7)),I8&&(Jc('action\x20=\x20?'),Jb['push'](I8)),I6){let I3=Ia['queryIntentTasks']['call'](Ia,I5||null,Jb);return Ib['toArray'](I3);}let I9=Ia['getAllIntentTasksAsList']()['toArray']();return I7||I8?I9['filter'](I3=>!(I7&&I3['getScriptPath']()!==I7||I8&&I3['getAction']()!==I8)):I9;},'timeFlagConverter'(I3){if(Array['isArray'](I3))return Array(0x7)['fill'](0x0)['reduce']((I4,I5,Jk)=>I4+(I3['includes'](Jk)?Math['pow'](0x2,Jk):0x0),0x0);let I4=[],I5=Number(I3)['toString'](0x2),Jn=I5['length']-0x1;for(let I3 of I5)I3>0x0&&I4['unshift'](Jn),Jn-=0x1;return I4;},'setInterval'(I3,I4,I5,Js){({'init_ts':Date['now'](),'interval':I4>0x0?I4:0xc8,'timeout':I5>0x0?I5:0x1/0x0,'isTimedOut'(){return'function'!=typeof this['_isTimedOut']&&(this['_isTimedOut']='function'==typeof I5?I5['bind'](this):()=>Date['now']()-this['init_ts']>this['timeout']),this['timeout_result']=this['_isTimedOut'](),!0x1!==this['timeout_result']&&!i(this['timeout_result']);},'relayIFN'(){this['isTimedOut']()?'function'==typeof Js&&Js['call'](this,this['timeout_result']):this['setTimeout']();},'run'(){I3(),this['relayIFN']();},'setTimeout'(){setTimeout(this['run']['bind'](this),this['interval']);}}['setTimeout']());},'$rec'(){let I3={'keys':{},'anonymity':[],'ts':I3=>'number'==typeof I3?I3:Date['now'](),'has'(I3){return I3 in this['keys'];},'add'(I3,I4){return void 0x0===I3?this['anonymity']['push'](this['ts'](I4)):this['keys'][I3]=this['ts'](I4),this['ts'](I4);},'get'(I3){return void 0x0===I3?this['anonymity']['pop']():this['keys'][I3];},'save'(I3,I4){return this['add'](I3,I4);},'load'(I3,I4){return this['ts'](I4)-this['get'](I3);},'shortcut'(I3,I4){return'function'==typeof I3?(this['save'](),I3['call'](I4),this['load']()):void 0x0!==I3?this['has'](I3)?this['load'](I3,I4):this['save'](I3,I4):this['anonymity']['length']?this['load']():this['save']();}};return this['rec']=function(I4,I5){return I3['shortcut'](I4,I5);},this['rec']['save']=(I4,I5)=>I3['save'](I4,I5),this['rec']['load']=(I4,I5)=>I3['load'](I4,I5),this['rec']['lt']=(I3,I4)=>this['rec']['load'](I3)this['rec']['load'](I3)>I4,this['rec']['clear']=()=>{I3['keys']={},I3['anonymity']['splice'](0x0);},delete this['$rec'],this;},'$bind'(){return this['$rec'](),delete this['$bind'],this;}};function JP(I3){let I4=new com['stardust']['autojs']['execution']['ExecutionConfig']();return I4['delay']=I3['delay']||0x0,I4['interval']=I3['interval']||0x0,I4['loopTimes']=void 0x0===I3['loopTimes']?0x1:I3['loopTimes'],I4;}function JS(I3,I4){let I5=I6?I3:org['joda']['time'][I3],JW=I4,JX=()=>JW['getTime']();if('string'==typeof I4)return I6?I8['parseDateTime']['call'](I8,I5,JW):I5['parse'](JW);if(I4 instanceof Date)return I6?I8['parseDateTime']['call'](I8,I5,JX()):new I5(JX());if('number'==typeof I4)return I6?I8['parseDateTime']['call'](I8,I5,JW):new I5(JW);throw new Error('Cannot\x20parse\x20date\x20time:\x20'+I4);}Id['$bind'](),I3['exports']={'timersx':Id};},708:JY=>{let JZ=android['os']['Looper'],K0=android['widget']['Toast'],K1=java['lang']['Runnable'],K2=java['util']['zip']['GZIPInputStream'],K3=java['io']['ByteArrayInputStream'],K4=java['io']['ByteArrayOutputStream'];global['de']=Packages['de'],global['okhttp3']=Packages['okhttp3'],global['androidx']=Packages['androidx'];let K5={'compare':{'<':(JY,JZ)=>JYJY<=JZ,'>':(JY,JZ)=>JY>JZ,'>=':(JY,JZ)=>JY>=JZ,'=':(JY,JZ)=>JY===JZ},'isNullish':JY=>null==JY,'isPlainObject':JY=>'Object'===Object['prototype']['toString']['call'](JY)['slice'](0x8,-0x1)},K6={'string'(){String['prototype']['toTitleCase']||Object['defineProperty'](String['prototype'],'toTitleCase',{'value'(){return this['replace'](/([A-Za-z])([A-Za-z]*)/g,(JY,JZ,K0)=>JZ['toUpperCase']()+K0['toLowerCase']());}}),String['prototype']['capitalize']||Object['defineProperty'](String['prototype'],'capitalize',{'value'(){return this['valueOf']()['replace'](/\b\w+\b/g,JY=>JY['charAt'](0x0)['toUpperCase']()+JY['slice'](0x1));}}),String['prototype']['surround']||Object['defineProperty'](String['prototype'],'surround',{'value'(JY,JZ){if(K5['isNullish'](JY))return this['valueOf']();let K0=JZ||{},K1=void 0x0===K0['no_intelli_brackets']||!K0['no_intelli_brackets'],K2=void 0x0===K0['no_symmetrical']||!K0['no_symmetrical'],K3=['()','[]','{}','<>','()','[]','{}','〈〉','《》','〔〕','【】','〖〗','‘’','“”'],K4=function(JY){let JZ={};return JY['forEach'](JY=>{JZ[JY[0x0]]=JY[0x1],JZ[JY[0x1]]=JY[0x0];}),JZ;}(K3),K6=JY['toString'](),Kv=K6['split'](''),Kw=K6['split']('');if(K1){let JY=[];!function(JY,JZ,K0){let K1=JZ||['()','[]','{}'],K2=function(JY){let JZ={};return JY['forEach'](JY=>JZ[JY[0x0]]=JY[0x1]),JZ;}(K1),K3=function(JY){let JZ={};return JY['forEach'](JY=>JZ[JY[0x1]]=JY[0x0]),JZ;}(K1),K4=[];(K0=K0||[])[0x0]=[],K0[0x1]=[];for(let JZ of JY)if(JZ in K2)K4['push'](JZ),K0[0x0]['push'](JZ);else{if(!(JZ in K3))return!0x1;if(K3[JZ]!==K4['pop']())return!0x1;K0[0x1]['push'](JZ);}return!K4['length'];}(K6,K3,JY)?Kv['forEach']((JY,JZ)=>{JY in K4&&(Kw[JZ]=K4[JY]);}):[Kv,Kw]=JY;}return K2&&(Kw=Kw['reverse']()),Kv['join']('')+this['valueOf']()+Kw['join']('');}}),String['prototype']['ts']||Object['defineProperty'](String['prototype'],'ts',{'get'(){let JY,JZ,K0=String(this);if(K0['length']<0x2||'`'!==K0[0x0]||'`'!==K0[K0['length']-0x1])return K0;for(;JY=K1(K0);){let [K1,K2]=JY,K3=JZ?'\x22':'';K0=K0['slice'](0x0,K1++)+K3+K0['slice'](K1,K2++)['replace'](/\${(.*?)}/g,(JY,JZ)=>Function('return\x20'+JZ)())+K3+K0['slice'](K2);}return K0;function K1(JY){let K0=[];Object['values'](JY)['forEach']((JY,JZ)=>'`'===JY&&K0['push'](JZ));let K1=K0['length']/0x2;if(K1>>0x0!==K1)throw Error('Backticks\x20must\x20come\x20in\x20pairs');return JZ=K1>0x1,K1?K0['slice'](K1-0x1,K1+0x1):null;}},'configurable':!0x0}),String['unTap']||Object['defineProperty'](String,'unTap',{'value':JY=>{let JZ=[['A','B','C','D','E'],['F','G','H','I','J'],['L','M','N','O','P'],['Q','R','S','T','U'],['V','W','X','Y','Z']],K0=JY['match'](/../g);return K0?K0['reduce']((JY,K0)=>{let [K1,K2]=K0;return JY+(+K1?JZ[--K1][--K2]:K2);},String()):String();}}),String['unEsc']||Object['defineProperty'](String,'unEsc',{'value':JY=>'function'==typeof String['fromCharCode']?JY['replace'](/.{4}/g,JY=>String['fromCharCode'](parseInt(JY,0x10))):unescape(JY['replace'](/.{4}/g,'%u$&'))}),String['decodeGzip']||Object['defineProperty'](String,'decodeGzip',{'value'(JY,JZ){let K0,K1=new K4(),K5=new K2(new K3(JY)),K6=util['java']['array']('byte',0x400);for(;-0x1!==(K0=K5['read'](K6));)K1['write'](K6,0x0,K0);let Lk=new java['lang']['String'](K1['toByteArray']())['toString']();return'json'===JZ?JSON['parse'](Lk):Lk;}});},'object'(){Object['prototype']['__proto__']||Object['defineProperty'](Object['prototype'],'__proto__',{'get'(){return Object['getPrototypeOf'](Object(this))||this['__proto__'];},'set'(JY){if(Object(JY)!==JY)throw TypeError('Proto\x20must\x20be\x20an\x20non-primitive\x20type');this['__proto__']=JY;},'configurable':!0x0}),Object['size']||Object['defineProperty'](Object,'size',{'value'(JY,JZ){if(Array['isArray'](JY))return JY['length'];if(!K5['isPlainObject'](JY))return-0x1;let K0=JY=>Array['isArray'](JY)?JY:void 0x0===JY?[]:[JY],K1=JZ||{},K2=K0(K1['include']),K3=K0(K1['exclude']);return Object['keys'](JY)['filter'](JY=>K2['length']?K2['includes'](JY):!K3['includes'](JY))['length'];}}),Object['getOwnNonEnumerableNames']||Object['defineProperty'](Object,'getOwnNonEnumerableNames',{'value':JY=>Object['getOwnPropertyNames'](JY)['filter'](JZ=>!Object['prototype']['propertyIsEnumerable']['call'](JY,JZ))}),Object['getNonEnumerableNames']||Object['defineProperty'](Object,'getNonEnumerableNames',{'value'(JY){let JZ=JY,K0={};for(;null!==JZ;)Object['getOwnNonEnumerableNames'](JZ)['forEach'](JY=>{K0[JY]=K0[JY]||!0x0;}),JZ=Object['getPrototypeOf'](JZ);return Object['keys'](K0);}}),Object['getAllPropertyNames']||Object['defineProperty'](Object,'getAllPropertyNames',{'value'(JY){let JZ=JY,K0={};for(;null!==JZ;)Object['getOwnPropertyNames'](JZ)['forEach'](JY=>{K0[JY]=K0[JY]||!0x0;}),JZ=Object['getPrototypeOf'](JZ);return Object['keys'](K0);}}),Object['assignDescriptors']||Object['defineProperty'](Object,'assignDescriptors',{'value'(JY,JZ){if(void 0x0!==JZ){let JZ=[]['slice']['call'](arguments),K0=JZ['length'];for(;K0-->0x1;){let K1=Object['getOwnPropertyDescriptors'](JZ[K0]);Object['defineProperties'](JY,K1);}}return JY;}}),Object['shallowClone']||(Object['shallowClone']=JY=>K5['isPlainObject'](JY)?Object['create'](Object['getPrototypeOf'](JY),Object['getOwnPropertyDescriptors'](JY)):Array['isArray'](JY)?JY['slice']():JY),Object['deepClone']||Object['defineProperty'](Object,'deepClone',{'value':function JY(JZ){if(K5['isPlainObject'](JZ)){let K0={};return Object['getOwnPropertyNames'](JZ)['forEach'](K1=>{let K2=Object['getOwnPropertyDescriptor'](JZ,K1);'object'==typeof K2['value']&&(K2['value']=JY(K2['value'])),Object['defineProperty'](K0,K1,K2);}),K0;}return Array['isArray'](JZ)?JZ['map'](JY):JZ;}}),Object['isDeepEqual']||Object['defineProperty'](Object,'isDeepEqual',{'value':function JY(JZ,K0){if(K5['isPlainObject'](JZ)&&K5['isPlainObject'](K0)){let K1=Object['getOwnPropertyNames'](JZ),K2=Object['getOwnPropertyNames'](K0);return K1['length']===K2['length']&&K1['every'](K1=>JY(JZ[K1],K0[K1]));}return Array['isArray'](JZ)&&Array['isArray'](K0)?JZ['length']===K0['length']&&JZ['every']((JZ,K1)=>JY(JZ,K0[K1])):JZ===K0;}});},'function'(){Function['prototype']['toRegular']||Object['defineProperty'](Function['prototype'],'toRegular',{'value'(){let JY=this;return'object'==typeof this['prototype']?this:function(){return JY['apply'](null,arguments);};}}),Function['prototype']['toRegularAndCall']||Object['defineProperty'](Function['prototype'],'toRegularAndCall',{'value'(JY){return this['toRegular']()['apply'](null,arguments);}}),Function['prototype']['toRegularAndApply']||Object['defineProperty'](Function['prototype'],'toRegularAndApply',{'value'(JY){if(!Array['isArray'](JY))throw Error('Param\x20args\x20must\x20be\x20an\x20Array');return this['toRegular']()['apply'](null,JY);}});},'number'(){Number['prototype']['ICU']||Object['defineProperty'](Number['prototype'],'ICU',{'value':function(){let JY='Hard\x20working\x20only'['split'](new RegExp('[your\x20health]'))['map'](JY=>JY?JY['charCodeAt'](0x0):97.6)['reduce']((JY,JZ)=>JY+JZ);return Math['round'](JY);}()}),Number['prototype']['clamp']||Object['defineProperty'](Number['prototype'],'clamp',{'value'(JY){let JZ=this['valueOf'](),K0=(Array['isArray'](JY)?JY:[]['slice']['call'](arguments))['map'](JY=>Number(JY))['filter'](JY=>!isNaN(JY))['sort']((JY,JZ)=>JY===JZ?0x0:JY>JZ?0x1:-0x1),K1=K0['length'];if(K1){let JY=K0[0x0],K2=K0[K1-0x1];if(JZK2)return K2;}return JZ;}}),Number['prototype']['toFixedNum']||Object['defineProperty'](Number['prototype'],'toFixedNum',{'value'(JY){return Number(this['toFixed'](JY));}}),Number['prototype']['padStart']||String['prototype']['padStart']&&Object['defineProperty'](Number['prototype'],'padStart',{'value'(JY,JZ){let K0=this['toString']();return K0['padStart']['call'](K0,JY,JZ||0x0);}}),Number['prototype']['padEnd']||String['prototype']['padEnd']&&Object['defineProperty'](Number['prototype'],'padEnd',{'value'(JY,JZ){let K0=this['toString']();return K0['padEnd']['call'](K0,JY,JZ||0x0);}}),Number['parsePercent']||Object['defineProperty'](Number,'parsePercent',{'value'(JY){if('string'==typeof JY){let JZ=JY['replace'](/\s*/g,'')['match'](/^(\d+(?:\.\d+)?)(%+)$/);if(JZ){let JY=Number(JZ[0x1]);for(let K0=0x0,K1=JZ[0x2]['length'];K0'number'!=typeof JY||isFinite(JY)||isNaN(JY)?+JY:Object['is'](0x0/JY,0x0)?Number['MAX_SAFE_INTEGER']:Number['MIN_SAFE_INTEGER'])['filter'](JY=>!isNaN(JY))['sort']((JY,JZ)=>JY===JZ?0x0:JY>JZ?0x1:-0x1))[0x0],K1=JY[JY['length']-0x1];let K2=Math['random']()*(K1-K0)+K0;return void 0x0===JZ?K2:Object['is'](JZ,-0x0)?Math['floor'](K2):+K2['toFixed'](+JZ||0x0);}}),Math['sum']||Object['defineProperty'](Math,'sum',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments);if(!K1['length'])return 0x0;let K3=K1['reduce']((JY,JZ)=>{let [K0,K1]=[+JY,+JZ]['map'](JY=>isNaN(JY)?0x0:JY);return K0+K1;}),K4=parseInt(K2);return isNaN(K4)?K3:+K3['toFixed'](K4);}}),Math['avg']||Object['defineProperty'](Math,'avg',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments),K3=K1['filter'](JY=>!isNaN(+JY));if(!K3['length'])return NaN;let K4=K3['reduce']((JY,JZ)=>+JY+ +JZ)/K3['length'],K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['median']||Object['defineProperty'](Math,'median',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments),K3=K1['filter'](JY=>!isNaN(+JY));if(!K3['length'])return NaN;K3['sort']((JY,JZ)=>{let K0=Number(JY);return K0===Number(JZ)?0x0:K0>JZ?0x1:-0x1;});let K4=K3['length'],K5=K4%0x2?K3[Math['floor'](K4/0x2)]:(K3[K4/0x2-0x1]+K3[K4/0x2])/0x2,K6=parseInt(K2);return isNaN(K6)?K5:+K5['toFixed'](K6);}}),Math['var']||Object['defineProperty'](Math,'var',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments);if(!K1['length'])return NaN;let K3=K1['filter'](JY=>!isNaN(+JY)),K4=Math['avg'](K3),K5=K3['length'],K6=0x0;for(let JY=0x0;JY!isNaN(+JY)),K4=Math['sqrt'](Math['var'](K3)),K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['cv']||Object['defineProperty'](Math,'cv',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments),K3=K1['filter'](JY=>!isNaN(+JY)),K4=K3['length'];if(K4<0x2)return NaN;let K5=Math['avg'](K3),K6=0x0;for(let JY=0x0;JY!isNaN(+JY)),K4=Math['max']['apply'](null,K3),K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['mini']||Object['defineProperty'](Math,'mini',{'value'(JZ,K0){let K1,K2;Array['isArray'](JZ)?(K1=JY['spreadArr'](JZ),K2=K0):K1=JY['spreadArr'](arguments);let K3=K1['filter'](JY=>!isNaN(+JY)),K4=Math['min']['apply'](null,K3),K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['dist']||Object['defineProperty'](Math,'dist',{'value'(JY,JZ){if(Array['isArray'](JY)&&Array['isArray'](JZ)){let K0=Math['pow'](JZ[0x0]-JY[0x0],0x2),K1=Math['pow'](JZ[0x1]-JY[0x1],0x2);return Math['sqrt'](K0+K1);}if(K5['isPlainObject'](JY)&&K5['isPlainObject'](JZ)){let K0=Math['pow'](JZ['x']-JY['x'],0x2),K1=Math['pow'](JZ['y']-JY['y'],0x2);return Math['sqrt'](K0+K1);}return NaN;}}),Math['logMn']||Object['defineProperty'](Math,'logMn',{'value'(JY,JZ,K0){let K1='number'==typeof K0?K0:0xd,K2=Math['log'](JZ)/Math['log'](JY);return isNaN(K2)||!isFinite(K2)||-0x1!==K1?K2:Number(K2['toFixed'](K1));}}),Math['floorLog']||Object['defineProperty'](Math,'floorLog',{'value'(JY,JZ){return Math['floor'](this['logMn'](JY,JZ));}}),Math['ceilLog']||Object['defineProperty'](Math,'ceilLog',{'value'(JY,JZ){return Math['ceil'](this['logMn'](JY,JZ));}}),Math['roundLog']||Object['defineProperty'](Math,'roundLog',{'value'(JY,JZ){return Math['round'](this['logMn'](JY,JZ));}}),Math['floorPow']||Object['defineProperty'](Math,'floorPow',{'value'(JY,JZ){return Math['pow'](JY,this['floorLog'](JY,JZ));}}),Math['ceilPow']||Object['defineProperty'](Math,'ceilPow',{'value'(JY,JZ){return Math['pow'](JY,this['ceilLog'](JY,JZ));}}),Math['roundPow']||Object['defineProperty'](Math,'roundPow',{'value'(JY,JZ){return Math['pow'](JY,this['roundLog'](JY,JZ));}});}};JY['exports']={'$$0':JY=>0x0===JY,'$$nul':JY=>null===JY,'$$und':JY=>void 0x0===JY,'$$bool':JY=>'boolean'==typeof JY,'$$symb':JY=>'symbol'==typeof JY,'$$bigint':JY=>'bigint'==typeof JY,'$$func':JY=>'function'==typeof JY,'$$arr':JY=>Array['isArray'](JY),'$$obj':JY=>K5['isPlainObject'](JY),'$$rex':JY=>JY instanceof RegExp,'$$xml':JY=>/^xml$/['test'](typeof JY),'$$T':JY=>!0x0===JY,'$$F':JY=>!0x1===JY,'$$num'(JY){let JZ=arguments,K0=JZ['length'];if(0x0===K0)return!0x1;if(0x1===K0)return'number'==typeof JY;if(0x2===K0)return JY===JZ[0x1];for(let JY=0x1;JYNumber['isInteger'](JY),'isNullish':JY=>null==JY,'isPrimitive':JY=>JY!==Object(JY),'isReference':JY=>JY===Object(JY),'isPlainObject':JY=>K5['isPlainObject'](JY),'isEmptyObject':JY=>K5['isPlainObject'](JY)&&0x0===Object['keys'](Object['getOwnPropertyDescriptors'](JY))['length'],'isNonEmptyObject':JY=>K5['isPlainObject'](JY)&&Object['keys'](Object['getOwnPropertyDescriptors'](JY))['length']>0x0,'isNormalFunction':JY=>'function'==typeof JY&&K5['isPlainObject'](JY['prototype']),'isArrowFunction':JY=>'function'==typeof JY&&!K5['isPlainObject'](JY['prototype']),'isXMLType':JY=>/^xml$/['test'](typeof JY),'requirex'(JY){let JZ=JY=>files['exists'](JY)&&global['require'](files['path'](JY)),K0=JY;K0['match'](/\.js$/)||(K0+='.js');let K1=JZ('modules/'+K0)||JZ(K0)||JZ('../modules/'+K0);if('object'==typeof K1)return K1;throw Error('Cannot\x20locate\x20module\x20\x22'+JY+'\x22\x20for\x20global.requirex()');},'sleep'(JY,JZ){if('string'==typeof JZ){let K0=JZ['match'](/[+-]?(\d+(\.\d+)?(e\d+)?)/);if(K0){let K1=Number(K0[0x0]);JZ=Math['min'](JY+K1,Number['MAX_SAFE_INTEGER']),JY=Math['max'](JY-K1,0x0);}}return'number'==typeof JZ?sleep(JY+Math['floor'](Math['random']()*(JZ-JY+0x1))):sleep(Math['max'](JY,0x0)||0x0);},'$$link':function(){let JY={'init'(){return delete this['is_break'],this;},'invoke'(JY){if('function'!=typeof JY)throw TypeError('$$link\x20invoked\x20with\x20a\x20non-function\x20argument');try{this['is_break']='__BREAK__'===JY();}catch(Pc){if(this['is_break']=!0x0,!Pc['message']['match'](/InterruptedException/))throw Error(Pc+'\x0a'+Pc['stack']);sleep(0x1a4);}}};return function JZ(K0){return JY['init']()['invoke'](K0),JZ=function(K0){return JY['is_break']||JY['invoke'](K0),JZ['$']=JZ;},JZ['$']=JZ;};}(),'$$cvt':function(){let JY={'parse'(JY,K0,K1,K2){let K3=K5['isNullish'](K0)?{}:{'init_unit':K0};return JZ(JY,Object['assign'](K2,K3,K1));}},JZ=function(JY,JZ){return{'options':JZ||{},'parseArgs'(){this['step']=this['options']['step'],this['pot_step']=this['options']['potential_step'],this['ori_units']=this['options']['units'],this['init_unit']=this['options']['init_unit'],this['fixed']=this['options']['fixed'],this['parseSrc'](),this['parseSpace'](),this['parseUnits']();},'parseSrc'(){this['src']=Number('string'==typeof JY?JY['split'](/,\s*/)['join'](''):JY);},'parseSpace'(){this['space']=this['options']['space'],K5['isNullish'](this['space'])&&(this['space']=String()),!0x0===this['space']&&(this['space']='\x20');},'parseUnits'(){this['units']=[],this['ori_units']['forEach'](JY=>{'string'==typeof JY&&JY['match'](/\w+\|\w+/)?JY['split']('|')['reverse']()['forEach']((JY,JZ)=>{JZ?this['units']['push'](0x1,JY):this['units']['push'](JY);}):this['units']['push'](JY);}),this['init_unit']=this['init_unit']||this['units'][0x0];},'generateUnitMap'(){this['unit_map']={},this['unit_map'][this['units'][0x0]]=[0x1,0x1];let JY=0x1,JZ=this['units']['length'];for(let K0=0x1;K0JY>0x0!=0x3e8*JZ)return Number(JZ['toFixed'](0x2));return JZ;},'getResult'(){return this['parseArgs'](),this['generateUnitMap'](),this['units']['includes'](this['init_unit'])&&(this['src']*=this['unit_map'][this['init_unit']][0x0]),this['units']['filter'](JY=>JY in this['unit_map'])['reverse']()['some']((JY,JZ,K0)=>{let [K1,K2]=this['unit_map'][JY];if(this['src']>=K2||JZ===K0['length']-0x1)return this['result']=this['calc'](K1)+this['space']+JY;})?this['result']:String();}}['getResult']();};return JZ['bytes']=function(JZ,K0,K1){return JY['parse'](JZ,K0,K1,{'step':0x400,'potential_step':0x3e8,'units':['B','KB','MB','GB','TB','PB','EB','ZB','YB']});},JZ['time']=function(JZ,K0,K1,K2){return'object'==typeof K0?this['time'](JZ,'','$en',K0):'string'==typeof K0&&K0['startsWith']('$')?this['time'](JZ,'',K0,K1):'object'==typeof K1?this['time'](JZ,K0,'$en',K1):JY['parse'](JZ,K0,K2,{'step':0x3c,'units':'$zh'===K1?['毫秒',0x3e8,'秒','分钟','小时',0x18,'天']:['ms',0x3e8,'s','m','h',0x18,'d']});},JZ['linear']=function(JZ,K0,K1){return JY['parse'](JZ,K0,K1,{'step':0x3e8,'init_unit':'mm','units':['am','fm','pm','nm','μm|um','mm',0xa,'cm',0xa,'dm',0xa,'m','km']});},JZ['number']=function(JZ,K0,K1){return JY['parse'](JZ,K0,K1,{'step':0x3e8,'space':!0x0,'units':['one',0x64,'hundred',0xa,'thousand','million','billion','trillion','quadrillion','quintillion','sextillion','septillion','octillion','nonillion','decillion','undecillion','duodecillion','tredecillion','quattuordecillion','quindecillion']});},JZ['date']=function(JY,JZ){let K0=function(JY){if(JY instanceof Date)return JY;if('number'==typeof JY)return new Date(JY);if('string'==typeof JY){JY['match'](/^\d+$/)&&(0x8===JY['length']?JY=JY['replace'](/\d{2}/g,'$&%')['split']('%')['slice'](0x0,-0x1)['map']((JY,JZ)=>JZ>0x1?'/'+JY:JY)['join'](''):0xc===JY['length']?JY=JY['replace'](/\d{2}/g,'$&%')['split']('%')['slice'](0x0,-0x1)['map']((JY,JZ)=>0x0===JZ?new Date()['getFullYear']()['toString']()['slice'](0x0,0x2)+JY:JZ<0x3?'/'+JY:0x3===JZ?'\x20'+JY:JZ<0x6?':'+JY:JY)['join'](''):0xe===JY['length']&&(JY=JY['replace'](/\d{2}/g,'$&%')['split']('%')['slice'](0x0,-0x1)['map']((JY,JZ)=>JZ>0x1&&JZ<0x4?'/'+JY:0x4===JZ?'\x20'+JY:JZ>0x4&&JZ<0x7?':'+JY:JY)['join']('')));let JZ=new Date(JY);if('Invalid\x20Date'===JZ['toString']())throw Error('Invalid\x20Date');return JZ;}return new Date();}(JY||new Date()),K1=(JZ||'yyyy/MM/dd\x20hh:mm:ss')['toString']();if('ISO'===K1['toUpperCase']()){let JY=new Date(K0),JZ=JY['getTime']()+0xea60*JY['getTimezoneOffset'](),K1='yyyy-MM-ddThh:mm:ss.SSSZ';return this['date'](JZ,K1);}let K2=K0['getFullYear'](),K3=K2['toString']()['slice'](-0x2),K4=K0['getMonth']()+0x1,K5=K4['toString']()['padStart'](0x2,'0'),K6=K0['getDate'](),Qe=K6['toString']()['padStart'](0x2,'0'),Qf=K0['getHours'](),Qg=Qf['toString']()['padStart'](0x2,'0'),Qh=K0['getMinutes'](),Qi=Qh['toString']()['padStart'](0x2,'0'),Qj=K0['getSeconds'](),Qk=Qj['toString']()['padStart'](0x2,'0'),Ql=K0['getMilliseconds']()%0x3e8,Qm=Ql['toString']()['padEnd'](0x3,'0')['slice'](0x0,0x1),Qn=Ql['toString']()['padEnd'](0x3,'0')['slice'](0x0,0x2),Qo=Ql['toString']()['padEnd'](0x3,'0')['slice'](0x0,0x3),Qp={'yyyy':K2,'yy':K3,'MM':K5,'M':K4,'dd':Qe,'d':K6,'hh':Qg,'h':Qf,'mm':Qi,'m':Qh,'ss':Qk,'s':Qj},Qq=function(JY){let JZ=this;return{'get':()=>(delete JZ['S'],delete JZ['SS'],delete JZ['SSS'],JY),'configurable':!0x0};};return Object['defineProperties'](Qp,{'S':Qq['call'](Qp,Qm),'SS':Qq['call'](Qp,Qn),'SSS':Qq['call'](Qp,Qo)}),function(JY){let JZ='';for(;JY['length'];){let K0=0x4;for(;K0;){let K1=JY['slice'](0x0,K0);if(K1 in Qp){JZ+=Qp[K1],JY=JY['slice'](K0);break;}K0-=0x1;}K0||(JZ+=JY[0x0],JY=JY['slice'](0x1));}return JZ;}(K1);},JZ['url']=function(JY,JZ,K0){if(!JY)throw Error('Source\x20url\x20is\x20required\x20for\x20$$cvt.url()');if(!JZ)return JY;let K1=JY['match'](/\?/)?'&':'?';return JY+K1+function JY(JZ){let K1=K0||[];return Array['isArray'](K1)||(K1=[K1]),Object['keys'](JZ)['map'](K0=>{let K2=JZ[K0];return'object'==typeof K2&&(K2='&'+JY(K2)),K1['includes'](K0)||(K2=encodeURI(K2)),K0+'='+K2;})['join']('&');}(JZ);},JZ;}(),'$$toast':function(){let JY={'toast':null,'parseIsLong':JY=>'number'==typeof JY?Number(!!JY):'string'==typeof JY?Number(/^l(ong)?$/i['test'](JY)):'boolean'==typeof JY?Number(JY):0x0,'init'(JY){let [JZ,K0,K1]=JY;this['message']=K5['isNullish'](JZ)?'':JZ['toString'](),this['is_long']=this['parseIsLong'](K0),this['is_forcible']=K1;},'post'(){ui['post'](()=>{new android['os']['Handler'](JZ['getMainLooper']())['post'](new K1({'run':()=>{this['is_forcible']&&this['dismiss'](),this['toast']=K0['makeText'](context,this['message'],this['is_long']),this['show']();}}));});},'dismiss'(){this['toast']instanceof K0&&(this['toast']['cancel'](),this['toast']=null);},'show'(){this['toast']['show']();}},K2=function(JZ,K0,K1){JY['init'](arguments),JY['post']();};return K2['dismiss']=()=>JY['dismiss'](),K2;}(),'$$impeded':function(){let JY={'events_counter':0x0,'border'(){console['log']('-\x20'['repeat'](0x11)['trim']());},'msg'(JY){this['border'](),[]['slice']['call'](arguments)['forEach'](JY=>console['log'](JY)),this['border']();},'trigger'(){return this['events_counter']>0x0;},'increase'(){this['events_counter']+=0x1;},'decrease'(){this['events_counter']-=0x1;},'reset'(){this['events_counter']=0x0;},'onTrigger'(JY){this['msg']('检测到全局事件触发信号',JY+'被迫阻塞');},'onRelease'(JY){this['msg']('全局事件触发信号全部解除',JY+'解除阻塞');}},JZ=function(JZ){let K0=JZ||'%method%';if(JY['trigger']()){for(JY['onTrigger'](K0);JY['trigger']();)sleep(0xc8);JY['onRelease'](K0);}};return Object['assign'](JZ,{'increase':()=>JY['increase'](),'decrease':()=>JY['decrease'](),'reset':()=>JY['reset'](),'detach'(JY,JZ){if('function'!=typeof JY)throw TypeError('Param\x20\x22fn\x22\x20for\x20$$impeded.detach\x20must\x20be\x20defined\x20as\x20a\x20function');if('number'!=typeof JZ)throw TypeError('Param\x20\x22options_idx\x22\x20for\x20$$impeded.detach\x20must\x20be\x20defined\x20as\x20a\x20number');return function(){let K0=[]['slice']['call'](arguments);return K0[JZ]='object'==typeof K0[JZ]?Object['assign'](K0[JZ],{'no_impeded':!0x0}):{'no_impeded':!0x0},JY['apply'](null,K0);};}}),JZ;}(),'$polyfill'(){let JY={'getPadStr'(JY,JZ){return{'tar_len':Number(JY),'str_len':this['length'],'trigger'(){return this['tar_len']>this['str_len'];},'getPad'(){let JY=void 0x0===JZ?'\x20':String(JZ),K0=this['tar_len']-this['str_len'],K1=Math['ceil'](K0/JY['length']);return JY['repeat'](K1)['slice'](0x0,K0);},'getResult'(){return this['trigger']()?this['getPad']():String();}}['getResult']();}};return String['prototype']['padStart']||Object['defineProperty'](String['prototype'],'padStart',{'value'(JZ,K0){return JY['getPadStr']['apply'](this,arguments)+this['valueOf']();}}),String['prototype']['padEnd']||Object['defineProperty'](String['prototype'],'padEnd',{'value'(JZ,K0){return this['valueOf']()+JY['getPadStr']['apply'](this,arguments);}}),String['prototype']['trimStart']||Object['defineProperty'](String['prototype'],'trimStart',{'value'(){return String['prototype']['trimLeft']['apply'](this,arguments);}}),String['prototype']['trimEnd']||Object['defineProperty'](String['prototype'],'trimEnd',{'value'(){return String['prototype']['trimRight']['apply'](this,arguments);}}),Object['values']||(Object['values']=function(JY){if(void 0x0!==JY[Symbol['iterator']]){let JZ=[];for(let K0 of JY)JZ['push'](K0);return JZ;}return Object['keys'](JY)['map'](JZ=>JY[JZ]);}),Object['getOwnPropertyDescriptors']||(Object['getOwnPropertyDescriptors']=function(JY){let JZ={};return Object['getOwnPropertyNames'](JY)['forEach'](K0=>{JZ[K0]=Object['getOwnPropertyDescriptor'](JY,K0);}),JZ;}),Array['from']||(Array['from']=function(JY,JZ,K0){let K1=JY=>'function'==typeof JY,K2=Object(JY);if(K5['isNullish'](JY))throw TypeError('arrayLike\x20of\x20Array.from\x20must\x20be\x20an\x20array-like\x20object');if(void 0x0!==JZ&&!K1(JZ))throw TypeError('mapFn\x20of\x20Array.from\x20must\x20be\x20a\x20function\x20or\x20undefined');let K3=Math['min'](Math['max']((K4=K2['length'],isNaN(Number(K4))?0x0:Math['trunc'](K4)),0x0),Number['MAX_SAFE_INTEGER']);var K4;let K6=K1(this)?Object(new this(K3)):new Array(K3),Rq=void 0x0===K0?this:K0;for(let JY=0x0;JY{if(void 0x0!==JY)return Number['isNaN'](JY)?Number['isNaN'](JZ):JY===JZ;});}}),Array['prototype']['fill']||Object['defineProperty'](Array['prototype'],'fill',{'value'(JY,JZ,K0){let K1=this['length'],K2=JZ>>0x0;K2=K2<0x0?K2+K1:K2>K1?K1:K2;let K3=void 0x0===K0?K1:K0>>0x0;K3=K3<0x0?K3+K1:K3>K1?K1:K3;for(let JZ=K2;JZJZ['concat'](Array['isArray'](K1)?JY(K1,K0-0x1):K1),[]);}(this['slice'](),JY||0x1);}}),Array['prototype']['keys']||(Array['prototype']['keys']=function(){return(0x0,this['map']((JY,JZ)=>JZ)[Symbol['iterator']])();}),Array['prototype']['values']||(Array['prototype']['values']=function(){return this[Symbol['iterator']]();}),Array['prototype']['entries']||(Array['prototype']['entries']=function(){return(0x0,this['map']((JY,JZ)=>[JZ,JY])[Symbol['iterator']])();}),Number['isInteger']||(Number['isInteger']=function(JY){return'number'==typeof JY&&isFinite(JY)&&(0x0|JY)===JY;}),Number['EPSILON']||(Number['EPSILON']=Math['pow'](0x2,-0x34)),delete this['$polyfill'],this;},'$bind'(){return this['$polyfill'](),Object['keys'](K6)['forEach'](JY=>K6[JY]()),delete this['$bind'],this;}},JY['exports']['$bind']();},453:(RN,RO,RP)=>{let {$$cvt:i,isNullish:n}=RP(0x2c4),{appx:s}=RP(0x79),{httpx:o}=RP(0x83),{filesx:a}=RP(0x2fb),{threadsx:l}=RP(0xef),{dialogsx:c}=RP(0x3b5),{storagesx:u}=RP(0xdc),RQ=java['io']['File'],RR={'step':{'download':'下载数据包','decompress':'解压缩','backup':'备份本地项目','files_check':'检查文件','files_update':'项目文件替换','files_ready':'项目文件就绪','finish_deploy':'清理并完成部署','finish_restore':'清理并完成项目恢复'},'structure':[{'name':'/assets'},{'name':'/modules','necessary':!0x0},{'name':'/tools'},{'name':'ant-forest-launcher.js','necessary':!0x0},{'name':'ant-forest-settings.js'},{'name':'.gitignore'},{'name':'jsconfig.json'},{'name':'project.json','necessary':!0x0},{'name':'LICENSE'},{'name':'README.md'}],get 'ignore_list'(){return this['_ignore_list']=this['_ignore_list']||u['af']['get']('update_ignore_list')||u['@default']['af']['update_ignore_list'];}},RS={'version':{'isIgnored'(RN,RO){let RP=RO||RR['ignore_list'];if(!RP)throw Error('No\x20available\x20list\x20for\x20project.version.isIgnored()');return'string'==typeof RN?RP['includes'](RN):RP['includes'](RN['version_name']);},'isCared'(RN,RO){let RP=RO||RR['ignore_list'];if(!RP)throw Error('No\x20available\x20list\x20for\x20project.version.isCared()');return!this['isIgnored'](RN,RP);}},'.local'(RN){return a['.local']['apply'](a,arguments);},'getLocal'(){let RN=this['getLocalPath']();if(!RN)throw Error('Cannot\x20locate\x20project\x20path\x20for\x20project.getLocal()');let RO=files['join'](RN,'project.json'),RP='ant-forest-launcher.js',S3=files['join'](RN,RP),S4={'version_name':'','version_code':-0x1,'main':{'name':RP,'path':S3},'path':RN};if(files['exists'](RO))try{let RP=JSON['parse'](a['read'](RO,'{}'));return Object['assign'](S4,{'version_name':'v'+RP['versionName'],'version_code':Number(RP['versionCode']),'main':{'name':RP['main'],'path':files['join'](RN,RP['main'])}});}catch(S6){console['warn'](S6['message']),console['warn'](S6['stack']);}if(files['exists'](S3))try{return Object['assign'](S4,{'version_name':'v'+a['read'](S3)['match'](/version (\d+\.?)+( ?(Alpha|Beta)(\d+)?)?/)[0x0]['slice'](0x8)});}catch(S7){console['warn'](S7['message']),console['warn'](S7['stack']);}return console['warn']('Both\x20project.json\x20and\x20'+RP+'\x20do\x20not\x20exist'),S4;},'getLocalPath'(RN){return RR['local_path']||(RR['local_path']=(()=>{let RO=files['cwd']();if(this['isAlike'](RO))return RO;if(RO=new RQ(RO)['getParent'](),this['isAlike'](RO))return RO;let RP=files['join'](a['getScriptDirPath'](),'Ant-Forest-003');return files['isDir'](RP)?RP:RN?(files['createWithDirs'](RP+a['sep']),RP):String();})());},'getLocalVerName'(){return this['getLocal']()['version_name'];},'getAssetPath'(RN){return files['join']['apply'](files,[this['getLocalPath'](),'assets']['concat']([]['slice']['call'](arguments)));},'getReleases'(RN,RO){if('function'!=typeof RO)return RP();function RP(){let RO=[],RP=RN||{},Sh=null;delete global['_$_get_proj_releases_interrupted'],RP['show_progress_dialog']&&c['setProgressColorTheme'](Sh=c['builds']([null,'正在获取版本信息...',0x0,0x0,'I',0x1],{'progress':{'max':-0x1,'showMinMax':!0x1,'horizontal':!0x0},'keycode_back':'disabled'})['on']('positive',RN=>{RN['dismiss'](),global['_$_get_proj_releases_interrupted']=!0x0;})['show'](),'indeterminate');let Sj=RP['max_items']||0x1/0x0,Sk=0x1,Sl=RP['per_page']||0x1e,Sm=RP['min_version_name']||'v0.0.0',Sn=0x3;for(;Sn--;)try{let RN=http['get']('https://api.github.com/repos/SuperMonster003/Ant-Forest/releases?per_page='+Sl+'&page='+Sk++)['body']['json']()['filter'](RN=>RN['tag_name']>=Sm);if(global['_$_get_proj_releases_interrupted'])return[];if(RO=RO['concat'](RN),RN['length']=Sj)break;}catch(Sq){sleep(0x78+0xf0*Math['random']());}return Sn<0x0?(Sh&&(Sh['dismiss'](),c['builds'](['失败','版本信息获取失败',0x0,0x0,'X',0x1])['on']('positive',RN=>RN['dismiss']())['show']()),[]):(RO['splice'](Sj),Sh&&(Sh['dismiss'](),Sh=null),RP['no_extend']?RO:RO['map'](function(RN){return RN['version_name']=RN['tag_name'],RN['brief_info_str']=[{'key':'name','desc':'标题'},{'key':'tag_name','desc':'标签'},{'key':'published_at','desc':'发布','cvt':void 0x0!==i&&i['date']},{'key':'body','desc':'内容描述'}]['map'](RO=>{let RP=RO['key'],Sv=RN[RP];if(Sv)return'body'===RP&&(Sv='\x0a'+Sv),'function'==typeof RO['cvt']&&(Sv=RO['cvt']['call'](null,Sv)),RO['desc']+':\x20'+Sv;})['filter'](RN=>!!RN)['join']('\x0a\x0a'),RN;}));}l['start'](()=>RO(RP()));},'getNewestRelease'(RN,RO){let RP=()=>this['getReleases'](Object['assign'](RN||{},{'max_items':0x1,'per_page':0x1}))[0x0];if('function'!=typeof RO)return RP();l['start'](()=>RO(RP()));},'getNewestReleaseCared'(RN,RO){let RP=RN||{},SD=()=>this['getReleases'](Object['assign'](RP,{'max_items':0x64,'per_page':0x64}))['filter'](RN=>this['version']['isCared'](RN,RP['ignore_list']))[0x0];if('function'!=typeof RO)return SD();l['start'](()=>RO(SD()));},'getChangelog'(RN,RO,RP){let SI=Math['trunc'](Number(RN['toString']()['match'](/\d+/)[0x0])),SJ=RO||{},SK=RP||{},SL=SK['onStart']||(RN=>RN),SM=SK['onSuccess']||(RN=>RN),RQ=SK['onFailure']||console['error'],RR=null;if(!SJ['is_show_dialog'])return SV();let SR=null,ST=RN=>RN;function SV(){SL();let RN=function(){let RN=0x5,RO='https://cdn.jsdelivr.net/gh/SuperMonster003/Ant-Forest@master/assets/docs/CHANGELOG-'+SI+'.md';for(;RN--;)try{return o['okhttp3Request'](RO,{'onDownloadFailure'(RO){RN||RQ('请求失败:\x20'+RO);}},{'is_async':!0x1});}catch(T0){RQ(T0['message']);}}();if(!RN){let RN='获取历史更新信息失败';return RR?RR['setContent'](RN):RQ(RN),SJ['is_joint']?'':[];}let RO=/# v\d+\.\d+\.\d+.*/g,RP=new RegExp(/^(\s*\n\s*)+/['source']+'|'+/(# *){3,}/['source']+'|'+/ +(?=\s+)/['source']+'|'+/.*~~.*/['source']+'|'+/.*`灵感`.*/['source']+'|'+/\(http.+?\)/['source']+'|'+/\[\/\/]:.+\(\n*.+?\n*\)/['source']+'|'+/\s*
/['source'],'g'),SK=RN['match'](RO),T5=RN['split'](RO),T6=SK['map']((RN,RO)=>({'ver':'v'+RN['split']('v')[0x1],'log':T5[RO+0x1]['replace'](/ ?_\[`(issue |pr )?#(\d+)`](\(http.+?\))?_ ?/g,'[$2]')['replace'](RP,'')['replace'](/(\[\d+])+/g,RN=>'\x20'+RN['split'](/\[]/)['join'](',')['replace'](/\d+/g,'#$&'))['replace'](/(\s*\n\s*){2,}/g,'\x0a')}));if(SM(T6),!RR&&!SJ['is_joint'])return T6;let RS=T6['map'](RN=>RN['ver']+'\x0a'+RN['log'])['join']('\x0a')['slice'](0x0,-0x1);return RR&&RR['setContent'](RS),SJ['is_joint']?RS:void 0x0;}!SJ['no_earlier']&&SI>0x1&&(SR='更早期的历史',ST=function(){c['builds'](['选择一个历史版本记录','',0x0,0x0,'B',0x1],{'items':function(){let RN=[];for(let RO=0x1;RO{RS['getChangelog'](RN+0x1,{'is_show_dialog':!0x0,'no_earlier':!0x0});})['show']();}),RR=c['builds'](['历史更新','处理中...',[SR,'hint'],'\u00a0','B',0x1])['on']('neutral',ST)['on']('positive',c['dismiss'])['show'](),l['start'](SV);},'isAlike'(RN,RO){let RP=files['path'](RN);if(!files['exists'](RP)){if(RO)throw Error('Passed\x20\x22dir\x22\x20is\x20not\x20exist');return!0x1;}if(!files['isDir'](RP)){if(RO)throw Error('Passed\x20\x22dir\x22\x20is\x20not\x20a\x20directory');return!0x1;}let Ti=files['listDir'](RP=new RQ(RP)['getAbsolutePath']());return RR['structure']['filter'](RN=>RN['necessary'])['map'](RN=>RN['name'][0x0]===a['sep']?{'name':RN['name']['slice'](0x1),'is_dir':!0x0}:{'name':RN['name']})['every'](RN=>{if(Ti['indexOf'](RN['name'])>-0x1){let RO=RN['is_dir'],Ti=files['isDir'](files['join'](RP,RN['name']));return RO&&Ti||!RO&&!Ti;}});},'deploy'(RN,RO,RP){let Tr=RP||{},Ts=RO||{},Tt=Ts['onDeployStart']||Ts['onStart']||(RN=>RN),RQ=Ts['onDeploySuccess']||Ts['onSuccess']||(RN=>RN),Tv=Ts['onDeployFailure']||Ts['onFailure']||console['error'];if(n(RN))throw Error('A\x20version\x20for\x20project.deploy()\x20must\x20be\x20defined');if('string'==typeof RN&&!(RN=(RN=>{if(RN['match'](/^(newest|latest)$/))return this['getNewestRelease']({'show_progress_dialog':!0x0});if(RN['match'](/^(newest|latest)_cared$/))return this['getNewestReleaseCared']({'show_progress_dialog':!0x0,'ignore_list':Tr['ignore_list']});let RO=null;return this['getReleases']({'per_page':0x64,'show_progress_dialog':!0x0})['some'](RP=>(RO=RP)['version_name']===RN),RO;})(RN))){if(global['_$_get_proj_releases_interrupted'])return void delete global['_$_get_proj_releases_interrupted'];throw Error('Cannot\x20parse\x20version\x20tag\x20for\x20project.deploy()');}if('object'!=typeof RN)throw Error('Cannot\x20parse\x20version\x20for\x20project.deploy()');let TB=RN['zipball_url'],TC=TB['slice'](TB['lastIndexOf'](a['sep'])+0x1)+'.zip',TD=files['join'](a['.local']('bak','ant-forest',TC)),TE=-0x1,TF=Tr['is_hide_title_version']?'':'\x20'+RN['version_name'],TG=RR['step'],TH=c['buildFlow']({'title':'正在部署项目'+TF,'success_title':Tr['success_title']||'部署完成','on_interrupt_btn_text':Tr['on_interrupt_btn_text']||'B','show_min_max':!0x0,'onStart'(RN,RO){Tt(),c['setProgressColorTheme'](RO,'download');},'onSuccess'(RN,RO){RQ(RN,RO);},'onFailure'(RN,RO){Tv(RN,RO),RO['setFailureData'](RN);},'steps':[{'desc':TG['download'],'action':(RN,RO)=>new Promise((RN,RP)=>{o['okhttp3Request'](TB,{'onStart'(){let RN=TE/0x400,RP=RN<0x0?'':'0KB/'+RN['toFixed'](0x1)+'KB';c['setProgressNumberFormat'](RO,RP);},'onDownloadProgress'(RN){RN['total']=Math['max'](RN['total'],TE);let RP=RN['total']/0x400,TW=RN['processed']/0x400;c['setProgressNumberFormat'](RO,'%.1fKB/%.1fKB',[TW,RP]),RO['setProgressData'](RN);},'onDownloadSuccess'(RP){RN(RP),c['clearProgressNumberFormat'](RO);},'onDownloadFailure'(RN){RP(RN);}},{'is_async':!0x0,'path':TD});})},{'desc':TG['decompress'],'action':(RN,RO)=>new Promise((RP,U2)=>{a['unzip'](RN['downloaded_path'],null,{'onUnzipProgress':RN=>RO['setProgressData'](RN),'onUnzipSuccess'(RO){let U5=RO['unzipped_path'];RS['isAlike'](U5)||(U5=files['join'](U5,files['listDir'](U5)[0x0])),RS['isAlike'](U5)||U2('Cannot\x20locate\x20project\x20path\x20in\x20unzipped\x20files'),RP(Object['assign'](RN,{'unzipped_files_path':RO['unzipped_path'],'unzipped_proj_path':U5}));},'onUnzipFailure':RN=>U2(RN)},{'to_archive_name_folder':!0x0,'is_delete_source':!0x0});})},{'desc':TG['backup'],'action':(RN,RO)=>new Promise((RP,Ua)=>{if(!this['getLocalPath']()||!this['getLocalVerName']())return RO['setStepDesc'](0x3,'\x20\x20[\x20跳过\x20]',!0x0),RP(RN);this['backup']({'onBackupProgress':RN=>RO['setProgressData'](RN),'onBackupSuccess':RO=>RP(Object['assign'](RN,{'backup':RO})),'onBackupFailure':RN=>Ua(RN)},{'remark':'版本升级前的自动备份','is_save_storage':!0x0});})},{'desc':TG['files_update'],'action':(RN,RO)=>new Promise((RP,Uh)=>{let Ui=this['getLocalPath'](!0x0);a['copy'](RN['unzipped_proj_path'],Ui,{'is_unbundled':!0x0},{'onCopyProgress':RN=>RO['setProgressData'](RN),'onCopySuccess':()=>RP(Object['assign'](RN,{'tar_proj_path':Ui})),'onCopyFailure':RN=>Uh(RN)});})},{'desc':TG['finish_deploy'],'action':(RN,RO)=>new Promise((RP,Uo)=>{a['deleteByList'](RN['unzipped_files_path'],{'is_async':!0x0},{'onDeleteProgress':RN=>RO['setProgressData'](RN),'onDeleteSuccess':()=>RP({'target_path':RN['tar_proj_path']}),'onDeleteFailure':RN=>Uo(RN)});})}]})['act']();o['getContentLength'](TB,function(RN){TH['setStepDesc'](0x1,'\x20\x20[\x20'+i['bytes'](TE=RN,'B',{'fixed':0x1,'space':!0x0})+'\x20]',!0x0);},{'timeout':0x3a98,'concurrence':0xf});},'backup'(RN,RO){let RP=RN||{},Uv=RO||{},Uw=Date['now'](),Ux=this['getLocalVerName'](),RS=s['version']['getHex'](Ux),Uz=a['.local']('bak','ant-forest'),UA=i['date'](Uw,'yyMMddhhmmss')+'-'+RS+'.zip',UB=files['join'](Uz,UA),UC=()=>{let RN=Uv['source_path'];if(RN&&'cwd'!==RN&&'current'!==RN||(RN=files['cwd']()),!files['isDir'](RN))throw Error('source_path\x20for\x20project.backup\x20must\x20be\x20a\x20directory');if(this['isAlike'](RN))return RN;if(RN=new RQ(RN)['getParent'](),this['isAlike'](RN))return RN;let RO=a['getScriptDirPath']();if(RN=files['join'](RO,'Ant-Forest-003'),this['isAlike'](RN))return RN;throw Error('Unable\x20to\x20locate\x20Ant-Forest\x20project\x20folder');},UD=RN=>{let RO=RN||{};return a['zip']((()=>{let RN=files['join'](Uz,'.'+Uw)+a['sep'];files['createWithDirs'](RN);let RO=UC();return a['copy'](RO,RN,{'is_unbundled':!0x0,'filter':RN=>RR['structure']['map'](RN=>RN['name']['replace'](/^\//,''))['includes'](RN)}),RN;})(),UB,{'onZipStart'(){'function'==typeof RO['onStart']&&RO['onStart']();let RN=RP['onBackupStart']||RP['onStart'];'function'==typeof RN&&RN['call'](RP);},'onZipProgress'(RN){'function'==typeof RO['onProgress']&&RO['onProgress'](RN);let UO=RP['onBackupProgress']||RP['onProgress'];'function'==typeof UO&&UO['call'](RP,RN);},'onZipSuccess'(){let RN={'path':UB,'timestamp':Uw,'version_name':Ux,'remark':Uv['remark']||'手动备份'};'function'==typeof RO['onSuccess']&&RO['onSuccess'](RN);let UQ=RP['onBackupSuccess']||RP['onSuccess'];if('function'==typeof UQ&&UQ['call'](RP,RN),Uv['is_save_storage']){let RO=u['af_bak'],RP=RO['get']('project',[]);RO['put']('project',RP['concat'](RN));}},'onZipFailure'(RN){'function'==typeof RO['onFailure']&&RO['onFailure'](RN);let UU=RP['onBackupFailure']||RP['onFailure'];'function'==typeof UU&&UU['call'](RP,RN);}},{'is_exclude_root_folder':!0x0,'is_delete_source':!0x0});};return Uv['is_show_dialog']?c['buildProgress']({'show_min_max':!0x0,'title':'正在备份','content':'此过程可能需要一些时间','success_title':'备份完成','onStart':(RN,RO)=>c['setProgressColorTheme'](RO,'backup'),'action':(RN,RO)=>UD({'onProgress'(RN){let RP=RN['processed']/0x400,V1=RN['total']/0x400;c['setProgressNumberFormat'](RO,'%.1fKB/%.1fKB',[RP,V1]),RO['setProgressData'](RN);},'onSuccess'(RN){c['setContentText'](RO,'版本:\x20'+RN['version_name']+'\x0a路径:\x20'+RN['path']+'\x0a备注:\x20'+RN['remark']);}})})['act']():UD();},'restore'(RN,RO){let RP=RR['step'],V6=RO||{},V7=V6['onRestoreStart']||V6['onStart']||(RN=>RN),V8={'local':{'title':'正在从本地恢复','success_title':'本地恢复完成','1st_step':{'desc':RP['files_check'],'action':()=>{let RO=files['path'](RN);if(!files['exists'](RO))throw Error('Source\x20file\x20of\x20project.restore()\x20doesn\x27t\x20exist');if(!a['isValidZip'](RO))throw Error('Source\x20file\x20of\x20project.restore()\x20is\x20corrupted');return{'zip_src_file':RO};}}},'server':{'title':'正在从服务器恢复','success_title':'服务器恢复完成','1st_step':{'desc':RP['download'],'action':(RO,RP)=>new Promise((RO,V6)=>{let V7=-0x1;o['getContentLength'](RN,function(RN){RP['setStepDesc'](0x1,'\x20\x20[\x20'+i['bytes'](V7=RN,'B',{'fixed':0x1,'space':!0x0})+'\x20]',!0x0);},{'timeout':0x3a98,'concurrence':0xf});let V8=RN['slice'](RN['lastIndexOf'](a['sep'])+0x1),V9=a['.local']('bak','ant-forest'),RQ=files['join'](V9,V8+'.zip');o['okhttp3Request'](RN,{'onStart'(){let RN=V7/0x400,RO=RN<0x0?'':'0KB/'+RN['toFixed'](0x1)+'KB';c['setProgressNumberFormat'](RP,RO);},'onDownloadProgress'(RN){let RO=RN['processed']/0x400;RN['total']=Math['max'](RN['total'],V7);let Vp=RN['total']/0x400;c['setProgressNumberFormat'](RP,'%.1fKB/%.1fKB',[RO,Vp]),RP['setProgressData'](RN);},'onDownloadSuccess'(RN){RO({'zip_src_file':RN['downloaded_path']}),c['clearProgressNumberFormat'](RP);},'onDownloadFailure'(RN){V6(RN);}},{'is_async':!0x0,'path':RQ});})}}},V9='local';files['exists'](RN)||(V9='server',RN['match'](/^https?:\/\//)||(RN='http://'+RN));let RQ=V8[V9];c['buildFlow']({'title':RQ['title'],'success_title':RQ['success_title'],'show_min_max':!0x0,'onStart'(RN,RO){V7(),c['setProgressColorTheme'](RO,'restore'),c['clearProgressNumberFormat'](RO);},'onSuccess':V6['onRestoreSuccess']||V6['onSuccess'],'onFailure':V6['onRestoreFailure']||V6['onFailure'],'steps':[RQ['1st_step'],{'desc':RP['decompress'],'action':(RN,RO)=>new Promise((RP,Vy)=>{a['unzip'](RN['zip_src_file'],null,{'onProgress':RN=>RO['setProgressData'](RN),'onSuccess'(RO){let V6=RO['unzipped_path'];RS['isAlike'](V6)||(V6=files['join'](V6,files['listDir'](V6)[0x0])),RS['isAlike'](V6)?RP(Object['assign'](RN,{'unzipped_files_path':RO['unzipped_path'],'unzipped_proj_path':V6})):Vy('Cannot\x20locate\x20project\x20path\x20in\x20unzipped\x20files');},'onFailure':RN=>Vy(RN)},{'to_archive_name_folder':!0x0,'is_delete_source':!0x1});})},{'desc':RP['files_update'],'action':(RN,RO)=>new Promise((RP,VG)=>{let V6=this['getLocalPath'](!0x0);a['copy'](RN['unzipped_proj_path'],V6,{'is_unbundled':!0x0},{'onProgress':RN=>RO['setProgressData'](RN),'onSuccess':()=>RP(Object['assign'](RN,{'tar_proj_path':V6})),'onFailure':RN=>VG(RN)});})},{'desc':RP['finish_restore'],'action':(RN,RO)=>new Promise((RP,VN)=>{a['deleteByList'](RN['unzipped_files_path'],{'is_async':!0x0},{'onStart':()=>'server'===V9&&files['remove'](RN['zip_src_file']),'onProgress':RN=>RO['setProgressData'](RN),'onSuccess':()=>RP({'target_path':RN['tar_proj_path']}),'onFailure':RN=>VN(RN)});})}]})['act']();}};RN['exports']={'project':RS};},883:(VQ,VR,VS)=>{VS(0x2c4);let {project:i}=VS(0x1c5),{threadsx:n}=VS(0xef),{dialogsx:s}=VS(0x3b5),VT={'dialog':s['builds'](['项目部署','欢迎使用蚂蚁森林项目部署工具\x0a此工具用于\x20v2.0.0\x20以上版本的项目部署',['了解项目','hint'],['退出','caution'],['开始部署','attraction'],0x1])['on']('neutral',function(){s['builds'](['关于项目','-\x20功能简介\x20-\x0a'+['自动收取好友能量','自动收取/监测自己能量','收取结果统计/展示','控制台消息提示','自动解锁屏幕','定时任务与循环监测','多任务自动排队','脚本运行安全','事件监测与处理','黑名单机制','项目管理','账户功能','统计功能','图形化配置工具']['map'](VQ=>'·\x20'+VQ)['join']('\x0a')+'\x0a\x0a-\x20项目作者\x20-\x0a·\x20SuperMonster003\x0a\x0a-\x20项目链接\x20-\x0a·\x20https://github.com/SuperMonster003/Ant-Forest',0x0,0x0,'返回',0x1],{'linkify':'WEB_URLS'})['on']('positive',VQ=>VQ['dismiss']())['show']();})['on']('negative',VQ=>{VQ['dismiss'](),exit();})['on']('positive',VQ=>{VQ['dismiss'](),i['getReleases']({'min_version_name':'v2.0.1','show_progress_dialog':!0x0},VY);}),'view':null,'run'(){this['dialog']['show']();},'config'(){s['alerts']('CUI\x20(Configuration\x20User\x20Interface)\x20for\x20current\x20plugin\x20hasn\x27t\x20been\x20accomplished');},'getView'(){return this['view'];},'getDialog'(){return this['dialog'];}};function VY(VQ){if(!VQ['length'])return exit();let VR=VQ[0x0],VS=VR['version_name'];s['builds'](['选择项目版本','选择希望部署的项目版本',['版本历史','hint'],['X','warn'],'下一步',0x1],{'items':['最新版本\x20('+VS+')','其他版本'],'itemsSelectMode':'single','itemsSelectedIndex':0x0})['on']('neutral',()=>{i['getChangelog'](VS['match'](/v(\d+)/)[0x1],{'is_show_dialog':!0x0});})['on']('negative',VQ=>{s['builds'](['提示','项目部署尚未完成\x0a确定要退出吗',0x0,'B',['确定退出','caution'],0x1])['on']('negative',VQ=>{VQ['dismiss']();})['on']('positive',VR=>{s['dismiss']([VR,VQ]),exit();})['show']();})['on']('positive',VS=>{VS['dismiss'](),0x0===VS['getSelectedIndex']()?n['start'](()=>Wa(VR)):s['builds'](['选择其他项目版本','',0x0,'上一步','下一步',0x1],{'items':VQ['slice'](0x1)['map'](VQ=>VQ['version_name']),'itemsSelectMode':'single','itemsSelectedIndex':0x0})['on']('negative',VQ=>{VQ['dismiss'](),VS['show']();})['on']('positive',VR=>{VR['dismiss']();let VS=VR['getSelectedIndex']()+0x1;n['start'](()=>Wa(VQ[VS]));})['show']();})['show']();}function Wa(VQ){i['deploy'](VQ,{'onSuccess'(VQ,VR){let VS=VQ['target_path'];VR['removeAllListeners']('positive'),VR['setActionButton']('positive','下一步'),s['appendContentText'](VR,'\x0a\x0a项目部署路径:\x0a'+files['path'](VS)['replace'](files['getSdcardPath'](),'/内部存储')),VR['on']('positive',VQ=>{function VR(){let VQ=function(){s['clearPool']();let VQ=context['getPackageName'](),VR=VR=>{let Wm=VR||VQ;app['startActivity']({'packageName':VQ,'className':Wm+'.external.open.RunIntentActivity','data':'file://'+VS+'/ant-forest-launcher.js'});};try{VR('org.autojs.autojs');}catch(Wn){VR(VQ);}},VR=function(){s['clearPool'](),exit();};s['builds'](['项目使用声明',['代码完全公开','杜绝恶意代码','项目永久免费','欢迎提议反馈','','如需获知项目启动方式','可点击\x22了解更多\x22按钮']['map'](VQ=>VQ&&'·\x20'+VQ)['join']('\x0a'),['T','hint'],0x0,['完成部署','finish'],0x1])['on']('neutral',()=>s['builds'](['项目启动方式','以下方式可用于启动项目:\x0a'+['ant-forest-launcher运行按钮','目录顶部的项目运行按钮\x20(如有)','创建并使用桌面快捷方式']['map'](VQ=>VQ&&'·\x20'+VQ)['join']('\x0a'),['立即运行项目','attraction'],['B','default_aj_4'],['完成部署','finish'],0x1])['on']('neutral',VQ)['on']('negative',VQ=>VQ['dismiss']())['on']('positive',VR)['show']())['on']('positive',VR)['show']();}VQ['dismiss'](),engines['myEngine']()['source']['toString']()['match'](/^Ant.Forest.+er/)?dialogs['build']({'title':'新项目使用提示','content':'可能需要在Auto.js程序主页下拉刷新才能看到新项目\x0a新项目默认是以\x22Ant-Forest-003\x22命名的蓝色目录\x20进入目录可运行新项目\x0a对于当前目录下的旧项目文件\x20若无保留需要\x20可全部移除\x0a移除时需谨慎\x20避免误删可能存在的项目以外的重要文件','positive':'下一步','autoDismiss':!0x1,'canceledOnTouchOutside':!0x1})['on']('positive',VQ=>{VQ['dismiss'](),VR();})['show']():VR();});}},{'on_interrupt_btn_text':'X','success_title':'项目部署完成'});}VQ['exports']=VT;}},E={};function Ws(Wt){var Wu=E[Wt];if(void 0x0!==Wu)return Wu['exports'];var Wv=E[Wt]={'exports':{}};return A[Wt](Wv,Wv['exports'],Ws),Wv['exports'];}Ws['o']=(Ww,Wx)=>Object['prototype']['hasOwnProperty']['call'](Ww,Wx);var Wy={};Ws(0x373)['run']();})(); \ No newline at end of file +(()=>{var A={518:G=>{function J(G){var J=new Error('Cannot\x20find\x20module\x20\x27'+G+'\x27');throw J['code']='MODULE_NOT_FOUND',J;}J['keys']=()=>[],J['resolve']=J,J['id']=0x206,G['exports']=J;},217:P=>{P['exports']={'af':{'projectDesc':'蚂蚁森林','selfCollectSwitch':!0x0,'appLaunchSpringboard':'OFF','autoEnableA11yService':'OFF','accountSwitch':!0x1,'accountLogBackInSwitch':!0x1,'accountLogBackInMaxContinuousTimes':0x3,'mainAccountInfo':{},'forestBallsClickDuration':0x36,'forestBallsClickInterval':0x6c,'homepageMonitorSwitch':!0x0,'homepageMonitorThreshold':0x2,'homepageBackgroundMonitorSwitch':!0x1,'homepageBackgroundMonitorThreshold':0x1,'homepageWaterBallSwitch':!0x0,'homepageWaterBallCheckLimit':0x78,'homepageWaterBallMaxHueNoBlue':0x2f,'friendCollectSwitch':!0x0,'friendCollectIconColor':'#1DA06D','friendCollectIconThreshold':0xa,'getTargetsByStrollButton':!0x1,'strollNotTargetedLimit':0x3,'forestImagePoolLimit':0x3,'forestImagePoolInterval':0x3c,'energyBallsRecognitionRegion':[0.1,0.15,0.9,0.45],'houghSrcImageStrategy':{'grayscale':!0x0,'adaptiveThreshold':!0x0,'medianBlur':!0x0,'blur':!0x0,'bilateralFilter':!0x1},'houghResultsStrategy':{'antiOverlap':!0x0,'symmetrical':!0x0,'linearInterpolate':!0x0},'ripeBallDetectThreshold':0xd,'ripeBallDetectColorValue':'#DEFF00','minBallsDistance':0.09,'shieldDetectColorValue':'#BEF658','shieldDetectThreshold':0x5,'autoUnlockSwitch':!0x1,'messageShowingSwitch':!0x0,'consoleLogSwitch':!0x0,'debugInfoSwitch':!0x1,'resultShowingSwitch':!0x0,'floatyResultSwitch':!0x0,'floatyResultCountdownSeconds':0x6,'rankListReviewSwitch':!0x0,'rankListReviewThresholdSwitch':!0x0,'rankListReviewThreshold':0x1,'rankListReviewSamplesClickedSwitch':!0x0,'rankListReviewDifferenceSwitch':!0x0,'rankListScanStrategy':'scroll','rankListSwipeDistance':0.75,'rankListSwipeDuration':0x96,'rankListSwipeInterval':0x12c,'rankListScrollInterval':0xf0,'rankListNotTargetedLimit':0xc8,'rankListCaptPoolDiffCheckThreshold':0x14,'timersSwitch':!0x1,'timersSelfManageSwitch':!0x0,'timersCountdownCheckOwnSwitch':!0x0,'timersCountdownCheckOwnTimedTaskAhead':0x2,'timersCountdownCheckFriendsSwitch':!0x0,'timersCountdownCheckFriendsTimedTaskAhead':0x1,'timersUninterruptedCheckSwitch':!0x0,'timersUninterruptedCheckSections':[{'section':['06:30','00:00'],'interval':0x3c}],'timersAutoTaskSections':[],'timersInsuranceSwitch':!0x0,'timersInsuranceInterval':0x5,'timersInsuranceMaxContinuousTimes':0x3,'maxRunningTimeGlobal':0x2d,'maxQueueTimeGlobal':0x3c,'minBombIntervalGlobal':0x12c,'minBatteryPercentage':0x14,'killWhenDoneSwitch':!0x1,'killWhenDoneIntelligent':!0x0,'killWhenDoneKeepRelatedPages':!0x1,'phoneCallStateMonitorSwitch':!0x0,'phoneCallStateIdleValue':void 0x0,'promptBeforeRunningSwitch':!0x0,'promptBeforeRunningCountdownSeconds':0x5,'promptBeforeRunningAutoSkip':!0x0,'promptBeforeRunningQuitConfirm':!0x0,'promptBeforeRunningPostponedMinutes':[0x1,0x2,0x3,0x5,0xa,0xf,0x14,0x1e,0x3c],'promptBeforeRunningPostponedMinute':0x0,'promptBeforeRunningPostponedMinuteUser':0x3,'foregroundAppBlacklist':[],'updateIgnoreList':[],'updateAutoCheckSwitch':!0x0,'updateShowOnAfSettings':!0x0,'updateShowOnShowingResult':!0x0,'autoTaskShowOnShowingResult':!0x0,'statListShowZero':0x1,'statListDateRange':0x2,'autojsGlobalLogSwitch':!0x0,'autojsGlobalLogConfigPath':'./log/','autojsGlobalLogConfigFilePattern':'%d{yyyy-MM-dd/}%m%n','autojsGlobalLogConfigMaxBackupSize':0x7,'autojsGlobalLogConfigMaxFileSize':0x140,'energyDoubleCollectSwitch':!0x1,'energyRainCollectSwitch':!0x1,'strollButtonMatchThreshold':0xa,'strollButtonLocateMainColor':'#FF7E00','rootAccessPrivileges':{'forceStopApp':!0x1,'screenOffByKeyEvent':!0x0}},'unlock':{'unlockCode':null,'unlockTryLimit':0x14,'unlockPatternStrategy':'segmental','unlockPatternSize':0x3,'unlockPatternSwipeDurationSegmental':0x78,'unlockPatternSwipeDurationSolid':0xc8,'unlockDismissLayerStrategy':'preferred','unlockDismissLayerBottom':0.7,'unlockDismissLayerTop':0.3,'unlockDismissLayerSwipeDuration':0x6e},'settings':{'itemAreaWidth':0.78}};},753:U=>{U['exports']={'restore_all_settings':'此操作无法撤销\x0a如需保留此次会话内容建议先保存\x0a\x0a以下功能内部配置不会被还原:\x0a1.\x20自动解锁\x0a2.\x20黑名单管理\x0a','keep_internal_config':'包含内部配置的功能\x0a只还原此功能的开闭状态\x0a而不会清空内部保存的数据\x0a如解锁密码/黑名单列表等\x0a','about_account_function':'主账户:\x0a\x0a执行蚂蚁森林项目时\x0a用户往往希望只针对自己的账户操作\x0a而非他人的账户或小号账户等\x0a尤其是多账号或频繁切换账号的用户\x0a可能出现非预期账户自动执行了脚本\x0a\x0a此功能可在脚本执行时检测当前账户\x0a若非主账户或未登录任何账户\x0a则将自动切换或登陆主账户\x0a再执行后续操作\x0a\x0a*\x20主账户登录需设置账户名\x0a*\x20账户名必须设置\x0a--\x20否则账户功能将自动关闭\x0a*\x20密码可不做设置\x0a*\x20无密码时\x0a--\x20脚本将在需要时\x0a--\x20提示用户手动输入\x0a\x0a旧账户回切:\x0a\x0a若脚本运行时账户非主账户A\x0a记当前账户为账户B\x0a脚本切换或登录至A且任务完成后\x0a此功能可自动将账户回切至B\x0a否则将保持主账户A的登录状态\x0a\x0a关于连续回切:\x0a每次回切将导致计数器累加一次\x0a且将记录回切时的登录账户B\x0a只要新一次运行的账户不是B\x0a无论是主账户A还是另外的账户C\x0a均将导致连续回切计数器清零\x0a当连续回切达到阈值时\x0a自动回切失效且计数器清零','before_use_main_account':'此功能涉及到用户隐私数据\x0a需额外注意账户和密码安全\x0a建议稍后自行点击\x22帮助\x22按钮\x0a查看并了解相关信息及注意事项','account_info_hint':'信息录入方式:\x0a\x0aA.\x20支付宝录入\x0a自动打开支付宝应用\x0a获取当前登录的账户名\x0a获取成功后自动填入当前页面\x0aB.\x20账户库录入\x0a账户库功能暂未开发\x0aC.\x20手动录入\x0a1.\x20全部留空\x0a将跳过信息录入\x0a或清除已存储的录入数据\x0a2.\x20密码留空\x20只填写账户\x0a脚本将在需要账户密码的时候\x0a通过震动提示用户手动输入密码\x0a60秒内输入完成脚本将自动继续\x0a否则脚本终止\x0a3.\x20全部填写\x0a脚本将自动完成主账户的切换\x0a或自动登录操作\x0a\x0a注意:\x0a\x0a1.\x20密码非必填项\x0a且因安全等原因不建议填入\x0a关于密码存储方式相关内容\x0a可点击\x22密码存储方式\x22按钮查看\x0a2.\x20自动切换或登录在遇到问题时\x0a脚本将自动终止\x0a包括但不限于密码错误/网络不稳定/账号录入错误或不存在/账号状态异常/其他特殊情况\x0a3.\x20当密码已录入时\x0a密码输入框留空或不做修改\x0a均会保持原密码不变\x0a输入新内容可覆盖旧密码\x0a如若删除本地已存储的密码\x0a可将\x22账户\x22内容删除留空\x0a或使用\x22信息销毁\x22功能','how_password_stores':'用户输入的密码数据\x0a使用\x22ext-crypto\x22模块进行加密\x0a然后存储在本地相应文件中\x0a\x0a*\x20加密的原理是随机字符映射\x0a--\x20因此难以避免别有用心之人\x0a--\x20对本地数据进行解密\x0a--\x20或插入劫持代码语句等\x0a--\x20因此需要用户妥善保管设备\x0a--\x20避免遗失或随意借予他人\x0a*\x20解密过程与加密过程类似\x0a--\x20依然是多次随机字符映射','destroy_main_account_info':'此操作将从本地存储中\x0a移除已记录的主账户信息\x0a包括账户和密码\x0a\x0a确定要销毁主账户信息吗','get_account_name_from_alipay':'可从支付宝应用获取当前账户名\x0a并自动填入本页\x22账户\x22输入框\x0a\x0a若出现当前未登录任何账户\x0a或脚本运行错误等其他意外情况\x0a将可能导致获取账户名失败\x0a\x0a点击\x22开始获取\x22按钮开始操作','login_password_needed':'在支付宝密码输入框中\x0a手动填写密码\x0a然后点击\x22登录\x22按钮\x0a登陆成功后脚本将自动继续运行\x0a\x0a脚本不会记录或存储密码\x0a如有疑问或疑虑\x0a可按音量键强制停止脚本\x0a成功登陆后再重新运行脚本','accountLogBackInMaxContinuousTimes':'计数器达最大次数时将不再回切\x0a且计数器将自动清零\x0a\x0a*\x20设置\x200\x20值可不限制回切次数\x0a*\x20详细情况参阅\x27帮助与支持\x27\x0a--\x20位于\x22账户功能\x22主页','about_blacklist':'能量罩黑名单:\x0a\x0a仅用作显示与查看\x0a当检测到好友能量罩时\x0a脚本自动添加好友到此名单中\x0a获取并计算能量罩到期时间\x0a能量罩到期后好友将自动移除\x0a\x0a自定义黑名单:\x0a\x0a用户可自行管理此名单\x0a位于此名单中的好友\x0a脚本将跳过此人的能量球检查\x0a可指定自动解除时间\x0a\x0a前置应用黑名单:\x0a\x0a项目自动运行时\x0a如果检测到当前应用在此名单中\x0a例如名单里有数独游戏\x0a而此时用户正在运行此游戏\x0a则脚本将放弃执行定时任务\x0a将任务推迟数分钟再执行\x0a推迟分钟按以下方案逐次增量\x0a[\x201,\x201,\x202,\x203,\x205,\x208,\x2010\x20]\x0a达到\x2010\x20后将一直保持\x2010\x20分钟','forestBallsClickDuration':'此设置值影响能量球的点击时间\x0a点击方法采用press()\x0a\x0a注意:\x0a此设置值将同时影响以下操作环境:\x0a1.\x20主页森林能量球\x20(绿/橙/金)\x0a2.\x20好友森林能量球\x20(绿/橙/金)\x0a\x0a设置过小值可能造成点击不被响应\x0a设置过大值将影响快速收取体验','forestBallsClickInterval':'当可点击的能量球数量超过\x201\x20时\x0a此设置值影响能量球之间的点击间隔\x0a\x0a注意:\x0a此设置值将同时影响以下操作环境:\x0a1.\x20主页森林能量球\x20(绿/橙/金)\x0a2.\x20好友森林能量球\x20(绿/橙/金)\x0a\x0a设置过小值可能遗漏点击能量球\x0a设置过大值将影响快速收取体验','homepageWaterBallMaxHueNoBlue':'用以判断能量球是否为浇水能量球\x0a即金色能量球\x0a判断及计算方法:\x0a区域中心横向\x2070%\x20线性扫描\x0a每\x202\x20像素判断色值\x0a色值转换为\x20RGB\x20色值\x0a计算\x20120\x20-\x20(R\x20/\x20G)\x20×\x2060\x0a得到无蓝分量的色值\x20(Hue)\x0aHue\x20在所有像素值中存在极大值\x0a统计出可同时适配白天及黑夜场景\x0a且数值出现概率合适的极大值\x0a将此值作为参数值即可实现匹配','homepageMonitorThreshold':'当进入主页存在未成熟能量球\x0a且最小成熟倒计时达到阈值时\x0a将循环监测直到能量球成熟并收取\x0a收取后\x0a若剩余能量球最小倒计时达到阈值\x0a则继续重复循环监测操作\x0a直到没有未成熟能量球\x0a或最小倒计时未达到设定阈值为止','homepageBackgroundMonitorThreshold':'好友排行榜操作期间\x0a若主页能量最小成熟时间达到阈值\x0a则返回森林主页开始监控能量球\x0a收取完毕后\x0a将继续进入好友排行榜完成操作\x0a\x0a*\x20此功能不受\x27循环监测\x27开关影响\x0a--\x20除非\x22自收功能\x22关闭\x0a*\x20返检阈值不可大于监测阈值\x0a*\x20接受非整数数值--\x20如\x201.5,\x202.8\x20等','friendCollectIconColor':'排行榜识别绿色手形图标的参照色值\x0a\x0a示例:\x0argb(67,160,71)\x0a#AEB0B3','friendCollectIconThreshold':'排行榜识别绿色手形图标的\x0a参照色值检测阈值\x0a阈值越大\x20匹配越宽松\x20反之越严格\x0a0\x20表示完全相似','forestImagePoolLimit':'限制用于存放森林页面截图样本的\x0a采集池数量上限\x0a\x0a数量过多将导致采集时间过长\x0a影响收取体验\x0a数量过少将导致识别率受影响\x0a出现遗漏或误判','forestImagePoolInterval':'森林页面样本采集池样本之间的存放间隔\x0a\x0a间隔的意义主要在于保证\x0a相邻两个样本之间的有效差异性\x0a间隔过大将导致采集时间过长\x0a影响收取体验\x0a间隔过小将导致样本差异过小\x0a影响识别率并出现遗漏或误判','energyBallsRecognitionRegion':'用于限制森林页面能量球的识别区域\x0a识别的能量球必须全部包含在此区域\x0a才被视为有效的能量球样本\x0a\x0a需填写\x204\x20个参数并以逗号分隔\x0a支持的参数:\x20百分数/数字/小数\x0a示例\x201\x20:\x20\x2010%,10%,90%,520\x0a示例\x202\x20:\x20\x200.1,120,0.9,53%\x0a\x0a也可使用可视化工具进行参数设置:\x0atools/Floaty_Rectangle_Region.js','ripeBallDetectColorValue':'森林页面识别成熟能量球的参照色值\x0a\x0a示例:\x0argb(67,160,71)\x0a#AEB0B3','ripeBallDetectThreshold':'森林页面识别成熟能量球的\x0a参照色值检测阈值\x0a阈值越大\x20匹配越宽松\x20反之越严格\x0a0\x20表示完全相似','unlockCode':'密码长度不小于\x203\x20位\x0a无密码可留空\x0a\x0a若采用图案解锁方式\x0a总点阵数大于\x209\x20需使用逗号分隔\x0a图案解锁密码将自动简化\x0a详情点击\x22查看示例\x22','unlock_code_demo':'滑动即可解锁:\x20(留空)\x0a\x0aPIN\x20解锁:\x201001\x0a\x0a密码解锁:\x2010btv69\x0a\x0a图案解锁:\x20(点阵序号从\x201\x20开始)\x0a3\x20×\x203\x20点阵\x20-\x201235789\x20或\x201,2,3,5,7,8,9\x0a4\x20×\x204\x20点阵\x20-\x201,2,3,4,8,12,16\x0a*\x20点阵密码将自动简化','about_pattern_simplification':'简化原理:\x0a共线的连续线段组只需保留首末两点\x0a途径点将自动激活\x0a\x0a3\x20×\x203\x20-\x201,2,3,5,7,8,9\x20->\x201,3,7,9\x0a4\x20×\x204\x20-\x201,2,3,4,8,12,16\x20->\x201,4,16\x0a5\x20×\x205\x20-\x201,2,3,4,5,6\x20->\x201,5,6\x0a\x0a因此以下一组设置对于图案解锁\x0a可视为相同设置\x20(3\x20×\x203\x20点阵):\x0a1,2,3,6,9\x0a1,1,2,2,3,3,3,6,9,9\x0a1,3,9','unlock_code_safe_confirm':'设备遗失或被盗时\x20自动解锁功能将严重降低设备的安全性\x20甚至导致隐私泄露或财产损失\x20需谨慎使用\x0a\x0a如欲了解设备遗失对策\x0a可点击\x22了解更多\x22\x0a\x0a确定要继续吗','about_lost_device_solution':'一旦设备遗失或被盗\x0a可通过以下方式\x0a将可能的损失降到最低\x0a\x0a*\x20利用\x27查找我的设备\x27功能\x0a\x0a如若遗失安卓手机/平板电脑/手表等\x0a可以寻找/锁定/清空该设备\x0a详情参阅:\x0ahttps://support.google.com/accounts/answer/6160491?hl=zh-Hans\x0a\x0a*\x20及时挂失/冻结卡号/账号\x0a\x0a优先冻结与财产安全相关的账号\x0a或及时修改登录密码或支付密码\x0a如\x20微博/微信/支付宝\x20以及\x20QQ\x20等\x0a详情参阅:\x0ahttps://www.zhihu.com/question/20206696','unlockDismissLayerSwipeDuration':'设置整百值可保证匀速滑动\x0a十位小于5可实现不同程度惯性滑动\x0a\x0a*\x20通常无需自行设置\x0a*\x20脚本会自动尝试增量赋值\x0a--\x20以获得最佳值','unlockDismissLayerBottom':'设置滑动起点的屏高百分比\x0a\x0a*\x20通常无需自行设置\x0a*\x20设置过大值可能激活非预期控件','unlockDismissLayerTop':'设置滑动终点的屏高百分比\x0a\x0a*\x20通常无需自行设置\x0a*\x20此配置值对滑动影响程度较小','about_unlockPatternStrategy':'叠加路径:\x0a\x0a采用\x20gestures()\x20方法\x0a将每两个点组成直线路径\x0a所有路径利用微小时间差拼接\x0a最终组合形成完整路径\x0a优点:\x0a1.\x20可实现超高速滑动\x0a2.\x20滑动拐点定位精确\x0a缺点:\x0a1.\x20滑动路径可能会断开\x0a2.\x20滑动总时长=(拐点数+1)×给定参数\x0a\x0a连续路径:\x0a\x0a采用\x20gesture()\x20方法\x0a将所有坐标作为参数传入\x0a完成一次性不间断滑动\x0a优点:\x0a1.\x20滑动路径不会断开\x0a2.\x20滑动总时长=给定参数\x0a缺点:\x0a1.\x20极易发生拐点偏移现象\x0a2.\x20拐点数及分布极大影响成功率\x0a\x0a*\x20不同策略对应不同\x27滑动时长\x27参数\x0a*\x20推荐优先使用\x27叠加路径\x27策略\x0a--\x20当出现路径断开现象时\x0a--\x20可尝试\x22连续路径\x22策略','about_unlockDismissLayerStrategy':'解锁前通常需要上滑提示层页面\x0a然后再输入密码或进行图案解锁\x0a\x0a解锁模块执行逻辑默认会\x0a先判断并处理提示层页面\x0a再判断并处理解锁页面\x0a\x0a优先:\x20上述默认行为\x0a滞后:\x20先判断解锁页面\x0a禁用:\x20只判断解锁页面\x0a\x0a*\x20通常无需修改此项设置','unlockPatternSwipeDurationSegmental':'此参数表示两拐点间滑动时长\x0a并非表示滑动总时间\x0a总时间=(拐点数+1)×此参数\x0a如\x221379\x22包含两个拐点\x0a参数给定为120ms\x0a则总时长=(2+1)×120ms\x0a即360ms\x0a如\x2212369\x22有一个拐点\x0a因此结果为240ms\x0a\x0a*\x20通常无需自行设置\x0a--\x20脚本会自动尝试增量赋值\x0a--\x20以获得最佳值','unlockPatternSwipeDurationSolid':'此参数表示首末点间滑动时长\x0a亦即表示滑动总时间\x0a\x0a*\x20通常无需自行设置\x0a--\x20脚本会自动尝试增量赋值\x0a--\x20以获得最佳值','unlockPatternSize':'图案解锁通常为\x20N\x20×\x20N\x20的点阵\x0a通常边长\x20N\x20为\x203\x0a\x0a若未使用图案解锁方式\x0a则保留默认值','about_message_showing_function':'控制台消息\x0a\x0a简略:\x20只显示最终收取能量总计数据\x0a详细:\x20显示每个好友收取数据\x0a开发者测试模式:\x20详细显示操作信息\x0a\x0a运行前提示对话框\x0a\x0a息屏或上锁启动时自动跳过:\x0a如果勾选\x20当项目启动时\x0a如果设备处于息屏或未解锁状态\x0a则不会显示对话框而直接运行项目\x0a\x0a运行结果展示\x0a\x0aFloaty:\x20彩色悬浮窗方式\x0aToast:\x20消息浮动框方式\x0a\x0a*\x20Floaty方式会伴随全屏遮罩层\x0a--\x20点击遮罩层可立即结束结果展示\x0a*\x20此方式额外支持显示时长参数配置\x0a*\x20若开启了定时任务信息展示\x0a--\x20点击相应区域可全屏展示\x0a*\x20若开启了版本更新提示展示\x0a--\x20点击相应区域可查看更新\x0a*\x20Toast方式仅仅展示信息\x0a--\x20不支持额外的操作或中断提示\x0a*\x20版本更新提示配置参数与\x0a--\x20自动检查更新页面的\x0a--\x20相关配置参数同步','timers_prefer_auto_unlock':'检测到\x22自动解锁\x22功能未开启\x0a\x0a多数情况下定时任务启动需配合\x0a\x22自动解锁\x22功能才能完成\x0a[\x20亮屏\x20-\x20解锁\x20-\x20执行脚本\x20]\x0a等一系列操作\x0a\x0a建议开启并设置\x22自动解锁\x22功能','timers_countdown_check_timed_task_ahead':'此设置值用于将下次定时任务\x0a运行时间提前\x20n\x20分钟\x0a\x0a设置\x200\x20可关闭提前运行','timers_ahead_prefer_monitor_own':'主页能量球监测未开启\x0a\x0a此情况下提前运行脚本\x0a主页能量球可能没有成熟\x0a因此可能无法收取\x0a\x0a*\x20开启主页能量球监测可在\x0a--\x20能量球成熟前不断检测能量球\x0a--\x20进而保证能量球及时收取\x0a\x0a确定要保留当前设置值吗','timers_ahead_prefer_rank_list_threshold_review':'排行榜样本复查未开启\x0a或最小倒计时阈值复查条件未激活\x0a\x0a此情况下提前运行脚本\x0a排行榜可能没有可收取目标\x0a因此可能无法按时完成收取\x0a\x0a*\x20排行榜样本复查能够在\x0a--\x20目标可收取前不断检测倒计时\x0a--\x20进而保证目标及时收取\x0a\x0a确定要保留当前设置值吗','timersInsuranceInterval':'设置值用于当保险任务保留时\x0a下次定时任务启动的时间间隔\x0a\x0a*\x20保险任务在脚本运行时设置\x0a*\x20脚本运行中每10秒钟自动重置间隔\x0a*\x20脚本结束前自动移除所有保险任务','timersInsuranceMaxContinuousTimes':'设置值用于当保险任务连续激活\x0a次数超过一定值时\x0a不再继续自动设置保险任务\x0a避免无人值守时的无限定时循环','about_timers_self_manage':'自动管理:\x0a\x0a脚本根据已设置的机制\x0a自动设置一个定时任务\x0a或自动更新已存在的定时任务\x0a以保证在无人值守条件下\x0a实现定期定时的脚本自启功能\x0a\x0a机制简介:\x0a\x0a1.\x20主页最小倒计时机制\x0a脚本计算出能量成熟最小倒计时\x0a并根据\x22定时任务提前运行\x22参数\x0a得到一个定时时间\x0a如果排行榜最小倒计时机制开启\x0a将会用同样的方法得到定时时间\x0a取两个定时时间的最小值\x0a作为最终的下次任务运行时间\x0a\x0a2.\x20排行榜最小倒计时机制\x0a如上所述\x0a另外若主页没有能量球\x0a而且排行榜也没有倒计时数据\x0a则将无法统计出定时时间\x0a此时将激活\x22延时接力机制\x22\x0a\x0a3.\x20延时接力机制\x0a如上所述\x0a此机制仅在倒计时机制全部关闭或倒计时机制未能统计定时时间时被激活\x0a延时接力机制数据格式为:\x0a[\x20开始时间,\x20结束时间,\x20间隔\x20]\x0a\x0a示例:\x20[\x20\x2206:30\x22,\x20\x2200:00\x22,\x2060\x20]\x0aa.\x20现在时刻\x2014:26\x0a下次运行延时\x2060\x20分钟间隔\x0a14:26\x20+\x2060\x20->\x2015:26\x0ab.\x20现在时刻\x2023:41\x0a下次运行延时至\x2000:00\x0ac.\x20现在时刻\x2002:19\x0a下次运行延时至\x2006:30\x0ad.\x20现在时刻\x2006:11\x0a下次运行延时至\x2006:30\x0a\x0a*\x20延时接力可设置多组数据\x0a--\x20最终取所有组数据的最小值\x0a*\x20脚本将自动处理区间边界数据\x0a--\x20设置数据时无需考虑间隔取整\x0a--\x20当右边界时间小于左边界时\x0a--\x20将视右边界时间为次日时间\x0a--\x20如\x20[\x20\x2219:50\x22,\x20\x2203:00\x22,\x208\x20]\x0a*\x20仅在没有最小倒计时数据时\x0a--\x20此机制才有存在意义\x0a--\x20若开启了最小倒计时机制\x0a--\x20通常无需在能量成熟密集时间\x0a--\x20设置延时接力数据\x0a--\x20如\x20[\x20\x2207:00\x22,\x20\x2207:30\x22,\x201\x20]\x0a--\x20这样的设置是没有必要的\x0a\x0a4.\x20意外保险机制\x0a假设\x22保险任务运行间隔\x22设置值为\x205\x0a脚本运行开始后\x0a将自动设置一个\x205\x20分钟定时任务\x0a当脚本异常停止或被终止时\x0a(包括音量键停止了脚本)\x0a则初期设定的保险定时任务\x0a将在\x205\x20分钟后定时执行\x0a确保脚本定时任务的连续性\x0a\x0a*\x20无论是最小倒计时机制\x0a--\x20还是延时接力机制\x0a--\x20均在脚本即将结束之前设定\x0a--\x20若在此之前脚本异常终止\x0a--\x20则会出现定时任务\x22断档\x22\x0a--\x20这正是此机制存在的主要意义\x0a*\x20若脚本长时间运行还未正常结束\x0a--\x205\x20分钟的定时任务将被激活\x0a--\x20并在任务列表排队等待执行\x0a--\x20此时定时任务依然出现\x22断档\x22\x0a--\x20因此脚本在后台每\x2010\x20秒钟\x0a--\x20会自动延期保险任务\x0a--\x20保证保险任务不会被\x22消耗\x22\x0a*\x20保险任务连续执行次数\x0a--\x20受到\x22最大连续保险次数\x22约束\x0a--\x20达到此限制时将不再设置保险任务\x0a--\x20避免保险任务导致脚本无限循环\x0a\x0a有效时段:\x0a\x0a可使项目在自动设置定时任务时\x0a仅会落在设置的有效时段内\x0a避免在某些时间对用户的干扰\x0a如设置时段\x20[\x2009:00,\x2014:00\x20]\x0a则脚本运行结束前设置定时任务时\x0a不会超出这个范围\x0a举三种情况的例子\x0a分别表示不同的定时任务运行时间\x0a1.\x2009:30\x0a正常制定任务\x0a因为\x2009:30\x20落在时段范围内\x0a2.\x2015:20\x0a制定第二天\x2009:00\x20的任务\x0a3.\x2007:10\x0a制定当天\x2009:00\x20的任务\x0a如果时段结束值大于等于起始值\x0a同延时接力机制一样\x0a则将结束值视为第二天的时间点\x0a例如设置\x20[\x2021:00,\x2007:45\x20]\x0a则表示晚\x209\x20点到次日\x2007:45\x0a晚\x2023\x20点和早\x206\x20点都在范围内\x0a而上午\x2011\x20点则不在上述范围\x0a注意区分\x20[\x2007:45,\x2021:00\x20]\x0a如有多个时段将做并集处理\x0a如果设置了一个\x2024\x20小时区间\x0a则时段管理将失去意义\x0a如\x20[\x2005:23,\x2005:23\x20]\x0a等同于\x22全天有效\x22的效果','maxRunningTimeGlobal':'设置值用于脚本单次运行\x0a可消耗的最大时间\x0a避免无人值守时的无响应情况','maxQueueTimeGlobal':'当旧排他性任务运行或排队时\x0a新排他性任务将继续排队\x0a排队时间与排他性任务总数相关\x0a\x0a*\x20当排队时间达到阈值时将强制结束\x0a--\x20当前正在运行的排他性任务\x0a*\x20设置过小的值可能在脚本\x0a--\x20正常结束前被意外终止','minBombIntervalGlobal':'若当前脚本与最近一个正在运行的蚂蚁森林脚本的运行时间差小于此阈值\x0a则视当前脚本为炸弹脚本\x0a炸弹脚本将自动强制停止\x0a此安全设置通常针对因某些原因短时间内运行大量相同脚本的意外情况','about_kill_when_done':'此设置用于决定脚本结束时\x0a保留或关闭支付宝应用\x0a\x0a关闭总开关后将在脚本结束时\x0a无条件关闭支付宝应用\x0a\x0a支付宝应用保留:\x0a智能保留:\x0a脚本运行时检测当前前置应用\x0a根据前置应用是否是支付宝\x0a决定保留或关闭操作\x0a总是保留:\x0a无条件保留支付宝应用\x0a\x0a蚂蚁森林页面保留:\x0a智能剔除:\x0a脚本将自动关闭与蚂蚁森林项目相关的全部页面\x0a如蚂蚁森林主页/排行榜页面等\x0a最终回归到脚本启动前的支付宝页面\x0a全部保留:\x0a无条件保留项目运行中的所有页面\x0a除非支付宝应用被触发关闭\x0a\x0a*\x20关闭应用优先使用杀死应用方式\x0a--\x20杀死应用需要\x20Root\x20权限\x0a--\x20无\x20Root\x20权限将尝试最小化应用\x0a--\x20最小化原理并非模拟\x20Home\x20键\x0a*\x20\x27智能保留\x27的智能化程度十分有限','backup_to_local':'此功能将项目相关文件打包保存在本地\x0a可在还原页面恢复或删除已存在的备份','restore_project_confirm':'确定还原此版本项目吗\x0a本地项目将被覆盖\x0a此操作无法撤销\x0a\x0a还原后建议重启配置工具','v1_6_25_restore_confirm':'此版本过于陈旧\x0a不建议还原此版本\x0a\x0a还原后将丢失以下全部功能:\x0a1.\x20项目更新功能\x0a2.\x20项目备份还原功能\x0a3.\x20解锁模块的高效稳定性\x0a4.\x20解锁模块的开发者测试模式\x0a5.\x20重要的工具函数\x0a\x0a缺少工具函数将导致项目无法运行','rankListSwipeDuration':'通常无需自行设置\x0a若出现滑动异常现象\x0a可尝试适当增大此设置值','rankListSwipeInterval':'若出现遗漏目标的情况\x0a可尝试适当增大此设置值','rankListScrollInterval':'若出现遗漏目标的情况\x0a可尝试适当增大此设置值','rankListCaptPoolDiffCheckThreshold':'排行榜滑动前后截图样本相同时\x0a脚本认为滑动无效\x20并进行无效次数统计\x20当连续无效次数达到阈值时\x20将放弃滑动并结束好友能量检查\x0a\x0a达阈值时\x20脚本会判断\x22服务器打瞌睡\x22页面及\x22正在加载\x22按钮\x20根据实际情况点击\x22再试一次\x22或等待\x22正在加载\x22按钮消失\x20(最大等待2分钟)\x0a\x0a*\x20此参数主要避免因意外情况导致当前页面不在排行榜页面时的无限滑动\x0a*\x20截图样本相同指:\x20相似度极高','rankListNotTargetedLimit':'排行榜每滑动一次\x0a若当前页面没有好友\x0a则记录一次无目标命中次数\x0a当达到最大阈值时则停止排行榜检查\x0a*\x20此参数主要避免因意外情况导致在某一页面的无限滑动','about_rank_list_review':'样本复查:\x0a\x0a排行榜列表到达底部后\x0a由复查条件决定是否重新检查排行榜\x0a进而达到循环监测的目的\x0a\x0a列表到达底部后\x0a脚本会统计记录列表所有好友数据\x0a包括倒计时数据及对应好友昵称\x0a\x0a复查条件:\x0a\x0a1.\x20列表状态差异:\x0a比较上一次统计的昵称数据\x0a只要昵称数据不一致\x0a则触发复查条件\x0a脚本将复查列表并重新比较数据\x0a直到最近两次昵称数据完全一致\x0a\x0a*\x20因至少需要两组比较数据\x0a--\x20所以列表至少会复查一次\x0a*\x20即便这样会导致额外的操作\x0a--\x20此条件依然是循环检测的利器\x0a--\x20用户可自行斟酌保留与否\x0a\x0a2.\x20样本点击记录:\x0a在一次完整的列表滑动过程中\x0a只要出现了有效点击行为\x0a则触发复查条件\x0a\x0a3.\x20最小倒计时阈值:\x0a统计最小成熟倒计时\x0a如果达到设定阈值\x0a则触发复查条件\x0a\x0a*\x20有效点击指进入好友森林后\x0a--\x20点击过可收取的能量球','strollButtonLocateMainColor':'参数用于配置多点取色方式\x0a定位逛一逛按钮时的基准色值','strollButtonMatchThreshold':'参数用于配置多点取色方式\x0a定位逛一逛按钮时的匹配阈值','strollNotTargetedLimit':'参数用于防止逛一逛策略\x0a在采集过程中遇到无操作好友\x0a可能引起的无限循环\x0a\x0a无操作情况举例:\x0a·\x20好友位于自定义黑名单\x0a·\x20好友使用能量保护罩\x0a·\x20好友能量球采集失败\x0a·\x20好友能量球点击失败\x0a·\x20好友能量球被他人收取\x0a·\x20用户关闭了相关功能\x0a','about_collectable_samples':'排行榜列表\x20(默认策略):\x0a从排行榜遍历可操作目标\x0a优点:\x0a1.\x20方案成熟且不易出现目标遗漏\x0a2.\x20获取倒计时数据无需额外耗时\x0a缺点:\x0a1.\x20采集效率受好友数量影响较大\x0a2.\x20差异样本池消耗较多硬件资源\x0a3.\x20需要频繁进出排行榜页面\x0a\x0a逛一逛按钮:\x0a直接使用官方提供的快捷按钮\x0a优点:\x0a1.\x20采集效率高/不受好友数量影响\x0a2.\x20避开排行榜的所有潜在问题\x0a3.\x20无需考虑循环遍历条件\x0a缺点:\x0a1.\x20按钮定位判断条件可信度低\x0a2.\x20结束页面判断条件可信度低\x0a3.\x20过程可操控性/可预见性低\x0a4.\x20获取倒计时数据依赖排行榜\x0a5.\x20一定概率出现可操作目标遗漏\x0a\x0a注意:\x0a当逛一逛按钮方案出现异常时\x0a脚本将自动在当前会话过程中\x0a切换至\x22排行榜列表\x22采集策略','restore_from_local':'确定还原此备份吗\x0a本地项目将被覆盖\x0a此操作无法撤销\x0a\x0a还原后建议重启配置工具','restore_original_list_data':'要恢复本次会话开始前的列表数据吗\x0a\x0a此操作不可撤销','add_friend_nickname_manually':'手动添加易出错\x0a且难以键入特殊字符\x0a建议使用列表导入功能','phoneCallStateIdleValue':'当设备当前通话状态值\x0a与空闲状态值不一致时\x0a将触发通话状态事件\x0a脚本将持续等待\x0a直到通话状态变为空闲\x0a\x0a*\x20事件解除后\x0a--\x20脚本将执行一次支付宝前置操作\x0a*\x20不同设备的通话空闲状态值\x0a--\x20可能存在差异','phoneCallStateIdleValueWarn':'输入值与当前通话空闲值不一致\x0a此配置将导致脚本无法正常运行\x0a\x0a确定要使用当前输入值吗','rank_list_bottom_template_hint_base':'排行榜\x22没有更多了\x22控件的图片模板\x0a此模板用于排行榜底部判断\x0a\x0a','rank_list_bottom_template_hint_exists':'正常模板应包含\x22没有更多了\x22字样\x0a查看模板后若发现图片模板存在异常\x0a可选择删除模板\x0a模板删除后\x0a脚本在下次运行时将自动生成新模板','rank_list_bottom_template_hint_not_exists':'当前暂未生成图片模板\x0a脚本在下次运行时将自动生成新模板','about_rootAccessPrivileges':'当Auto.js被授予Root权限时\x0a可通过Root权限实现功能升级\x0a如可以直接模拟按键实现快速关屏\x0a或通过adb命令直接杀死应用进程\x0a\x0a即便Auto.js未获取Root权限\x0a用户依然可以进行功能参数配置\x0a此时所有开启的功能均无法生效\x0a脚本在运行过程中将做平稳退化\x0a\x0a注意:\x0aRoot权限关闭应用时\x0a可能出现几秒钟的黑屏现象\x0a此时Toast及Floaty消息会出现阻塞\x0a因此可能影响运行结果展示的效果','about_auto_enable_a11y_svc':'通过修改系统无障碍服务的列表参数\x0a实现Auto.js无障碍服务的自动开启\x0a此过程需要授予Auto.js以下权限:\x0a\x0aWRITE_SECURE_SETTINGS\x0a\x0a如果设备已经获取Root权限\x0a脚本将自动完成上述所需权限的授权\x0a否则需要将手机连接到计算机\x0a然后在计算机使用ADB工具\x0a执行以下指令(无换行):\x0a\x0aadb\x20shell\x20pm\x20grant\x20org.autojs.autojs\x20android.permission.WRITE_SECURE_SETTINGS\x0a\x0a执行后Auto.js将获取上述权限\x0a如需撤销授权需将上述指令的\x0agrant替换为revoke\x0a\x0a注:\x20如果没有权限授权\x0a脚本则会在需要的时候\x0a提示用户手动开启无障碍服务\x0a\x0a*\x20参数默认值:\x20禁用自动启动','about_app_launch_springboard':'某些设备或应用无法直接调用\x20APP\x0a如\x20launch()\x20或\x20startActivity()\x20等\x0a需先调用\x20Auto.js\x20再调用指定\x20APP\x0a当脚本运行结束时\x0a可自动关闭调用过的\x20Auto.js\x20页面\x0a以实现跳板的无痕特性\x0a\x0a*\x20参数默认值:\x20关闭跳板\x0a*\x20无痕特性以跳板页面暴露为前提','about_timed_task_type':'一次性任务执行后将自动失效\x0a每日/每周任务将按日/按周循环执行\x0a\x0a注意:\x0a1.\x20定时任务自动管理功能往往可以\x0a--\x20完成绝大多数定时任务需求\x0a--\x20因此不建议设置过多或\x0a--\x20过于繁杂的手动定时任务\x0a2.\x20也可以使用\x20Auto.js\x20自带的\x0a--\x20定时任务管理功能\x0a--\x20但涉及月份设置或修改时很可能\x0a--\x20会出现\x201\x20个月的偏差问题','delete_min_countdown_task_warn':'正在删除最小倒计时任务\x0a\x0a最小倒计时任务是\x0a定时任务自动管理功能的精髓\x0a除非已确定此任务的异常性\x0a否则强烈不建议删除此任务\x0a\x0a确定要删除最小倒计时任务吗','promptBeforeRunningCountdownSeconds':'倒计时结束前\x0a用户可自主点击按钮执行相应操作\x0a否则倒计时超时后脚本将自动执行','about_aj_global_log_page':'本地日志功能将Auto.js生成的\x0a所有控制台日志写入文件\x0a包括蚂蚁森林项目及其他所有脚本\x0a同样当关闭此功能时\x0a将停止所有脚本日志的本地写入\x0a\x0aAuto.js因崩溃等原因重启时\x0a本地日志写入功能将失效\x0a但原有的本地日志依然保留\x0a仅仅是停止继续写入\x0a此时运行蚂蚁森林项目\x0a若本地日志写入功能开关开启\x0a将自动重新激活本地日志的写入功能\x0a\x0a功能核心代码:\x0aconsole.setGlobalLogConfig','about_eballs_recognition':'能量球的识别基于霍夫变换\x0a关键参数如下:\x0a\x20\x20\x20\x20image:\x20%img%\x0a\x20\x20\x20\x20dp:\x201\x0a\x20\x20\x20\x20minDst:\x20cX(0.09)\x20(可配置)\x0a\x20\x20\x20\x20minRadius:\x20cX(0.054)\x0a\x20\x20\x20\x20maxRadius:\x20cX(0.078)\x0a\x20\x20\x20\x20param1:\x2015\x0a\x20\x20\x20\x20param2:\x2015\x0a可参阅\x20__image__.js\x20封装模块\x0a内部的\x20images.findCircles()\x20方法\x0a\x0a上述的\x20%img%\x20传入参数有以下策略:\x0a1.\x20灰度化\x0a基本的图像处理策略\x0a霍夫变换必须传入\x208\x20位单通道灰度图像\x0a2.\x20自适应阈值\x0a根据像素的邻域块的像素值分布\x0a确定该像素位置上的二值化阈值\x0a3.\x20中值滤波\x20&\x204.\x20均值滤波\x0a均值滤波和中值滤波都可以平滑图像并虑去噪声\x0a均值滤波采用线性方法对目标像素及周边像素取平均值后再填充目标像素\x0a中值滤波采用非线性方法使用所有像素中值替代中心位置像素值\x0a5.\x20双边滤波\x0a双边滤波是一种非线性滤波方法\x0a结合图像的空间邻近度和像素值相似度的一种折衷处理\x0a同时考虑空域信息和灰度相似性达到保边去噪的目的\x0a\x0a由于双边滤波耗时相对较长\x0a且识别结果准确率也未见明显优势\x0a因此不建议开启双边滤波策略\x0a除非对识别率有极高的要求或用于测试或关闭了\x202,3,4\x20策略仅保留\x201,5\x20等情况\x0a但依然不建议\x201,5\x20这样的策略组合\x0a\x0a通过霍夫变换得到页面的圆形样本后\x0a样本会按照横坐标升序排序\x0a排序后可对样本数据做进一步处理:\x0a1.\x20覆盖检测\x0a如果相邻两个圆形的圆心间距过小\x0a则认为样本重复并将后一个样本去除\x0a2.\x20对称检测\x0a对于所有样本的最左和最右两个样本\x0a如果做中轴镜像后不满足最小球间距\x0a则认为对方位置能量球缺失\x20并会做能量球补算填充\x0a3.\x20线性插值\x0a计算所有球的最小间距作为参考值\x0a如果检测到有相邻两个能量球间距大于这个参考值的某个倍数\x20则会做插值处理\x20可能插入\x201\x20个或多个能量球\x0a\x0a数据处理示例:\x0a森林页面最多可展示\x206\x20个能量球\x0a将这些球大概位置记为\x201,\x202...\x206\x0a以下示例仅针对线性插值和对称检测\x0a示例\x201:\x0a能量球\x201\x20个\x20位于\x203\x20号位置偏右\x0a识别到的能量球位置\x203\x0a对称检测不生效\x0a线性插值不生效\x0a结果:\x203\x20(正确)\x0a示例\x202:\x0a能量球\x202\x20个\x20位于\x203,4\x0a识别到的能量球位置\x204\x0a即遗漏了\x203\x20号位置的球\x0a对称检测生效\x0a由\x204\x20做镜像后补充\x0a线性插值不生效\x0a结果:\x203,4\x20(正确)\x0a示例\x203:\x0a能量球\x206\x20个\x20位于\x201,2,3,4,5,6\x0a识别到的能量球位置\x201,5,6\x0a即遗漏了\x202,3,4\x20位置的球\x0a对称检测不生效\x0a因为\x201\x20和\x206\x20镜像后不需补充\x0a线性插值生效\x0a5\x20和\x206\x20的间距作为参考\x0a会将\x201\x20与\x204\x20之间插入\x202\x20个球\x0a结果:\x201,2,3,4,5,6\x20(正确)\x0a示例\x204:\x0a能量球\x205\x20个\x20位置如下:\x0a1,\x202偏右,\x20居中,\x205偏左,\x206\x0a为方便阅读\x20将位置记为\x20A,B,C,D,E\x0aA,E\x20对称\x20\x20B,D\x20对称\x20\x20C\x20居中\x0a识别到的能量球位置\x20A,C,E\x0a即遗漏了\x20B,D\x20位置的球\x0a对称检测不生效\x0a因为\x20A\x20和\x20E\x20镜像后不需补充\x0a线性插值不生效\x0aA,C\x20和\x20C,E\x20的间距几乎相同\x0a因此无需插值\x0a结果:\x20A,C,E\x20(错误)\x0a如果上述情况的识别结果为\x20A,D,E\x0a则与示例\x203\x20类似\x0a最终将识别到正确结果:\x20A,B,C,D,E','update_ignore_confirm':'确定要忽略当前版本吗\x0a\x0a*\x20忽略后脚本将不再提示当前版本更新\x0a*\x20忽略后可在配置工具中管理已忽略的所有版本','about_update_auto_check':'自动检查更新功能可在不同场景\x0a进行版本更新的提示\x0a\x0a*\x20注意:\x20此功能不会自动下载更新\x0a\x0a更新提示场景:\x0a\x0a1.\x20运行结果展示时\x0a当\x22运行结果展示\x22功能生效时\x0a可同时展示版本更新提示\x0a包括Floaty或Toast方式\x0a\x0a2.\x20配置工具启动时\x0a在配置工具启动后\x0a脚本会在后台检查项目更新\x0a发现更新后以SnackBar方式提示\x0a\x0a版本忽略管理:\x0a\x0a对于不希望提示更新的版本\x0a可添加至忽略列表中\x0a例1:\x20当前版本为v2.0.1\x0a服务器最新版本为v2.0.2\x0a将v2.0.2添加至忽略列表中\x0a则脚本将不会提示项目有更新\x0a例2:\x20当前版本为v2.0.1\x0a服务器最新版本为v2.0.4\x0a将v2.0.4添加至忽略列表中\x0a则脚本将会提示项目有更新\x0a且最新版本为v2.0.3\x0a此时如果再将v2.0.3添加至列表\x0a则脚本依然会提示项目有更新\x0a且最新版本为v2.0.2\x0a','about_rankListScanStrategy':'控件滚动:\x0a基于排行榜可滚动控件的\x0a无障碍行为实现列表滚动\x0a优点:\x0a1.\x20滚动效率非常高\x0a2.\x20无需关心滚动距离\x0a3.\x20全平台无惯性滚动\x0a缺点:\x0a1.\x20依赖控件\x0a2.\x20定位唯一性可能不够严谨\x0a\x0a模拟滑动:\x0a基于辅助服务的\x0a无障碍行为实现列表滑动\x0a优点:\x0a1.\x20可定义滑动距离及时长\x0a2.\x20不依赖排行榜控件\x0a缺点:\x0a1.\x20某些平台可能出现惯性滑动','about_rank_list_scroll_distance':'采用\x22控件滑动\x22策略时\x0a无法指定滑动距离\x0a由\x22无障碍行为\x22实现基于控件的滚动','about_rank_list_scroll_time':'采用\x22控件滑动\x22策略时\x0a无法指定滑动时长\x0a由\x22无障碍行为\x22决定控件的滚动时长','about_memory_info':'System\x20Memory:\x20系统内存\x0a剩余内存\x20|\x20总内存\x20|\x20使用率\x0a\x0aRuntime\x20Heap:\x20JVM堆内存\x0aJVM总内存-JVM空闲内存\x20|\x20JVM可用最大内存\x20|\x20使用率\x0a\x0aProcess\x20Heap:\x20进程堆内存\x0a\x27summary.java-heap\x27\x20|\x20JVM可用最大内存\x20|\x20使用率\x0a\x0aPSS\x20(Proportional\x20Set\x20Size):\x20实际使用的物理内存\x20(比例分配共享库占用的内存)\x0aUSS\x20(Unique\x20Set\x20Size):\x20进程独自占用的物理内存\x20(不包含共享库占用的内存)\x0a\x0a*\x20JVM堆内存会定期回收\x0a*\x20进程堆内存更新频率较慢\x0a*\x20当任意内存使用率超过90%时建议重启进程\x0a\x0a*\x20相关内存信息对应的伪代码\x0a\x0aActivityManager.MemoryInfo\x20>\x20totalMem\x20-\x20系统总内存\x0aActivityManager.MemoryInfo\x20>\x20availMem\x20-\x20系统剩余内存\x0a\x0aRuntime\x20>\x20totalMemory()\x20-\x20JVM总内存\x0aRuntime\x20>\x20freeMemory()\x20-\x20JVM空闲内存\x0aRuntime\x20>\x20maxMemory()\x20-\x20JVM可用最大内存\x0a\x0aDebug.MemoryInfo\x20>\x20getTotalSharedDirty()\x0a-\x20RSS\x20(Resident\x20Set\x20Size)\x20-\x20实际使用物理内存\x20(包含共享库占用的内存)\x0aDebug.MemoryInfo\x20>\x20getTotalPss()\x0a-\x20PSS\x20(Proportional\x20Set\x20Size)\x20-\x20实际使用的物理内存\x20(比例分配共享库占用的内存)\x0aDebug.MemoryInfo\x20>\x20getTotalPrivateDirty()\x0a-\x20USS\x20(Unique\x20Set\x20Size)\x20-\x20进程独自占用的物理内存\x20(不包含共享库占用的内存)','about_process_restart':'脚本调用如下代码片段杀死当前应用活动进程:\x0aProcess.killProcess(Process.myPid());\x0a\x0a此操作将清理进程内所有资源\x0a由于ActivityManager时刻监听进程\x0a一旦发现进程非正常结束\x0a它将试图重启此进程\x0a进而实现进程的自动重启'};},724:(V,Y,Z)=>{let {$$impeded:i,$$str:n,$$num:s,$$rex:o,isObjectSpecies:a,isNullish:l,isNonEmptyObject:c,sleep:u,requirex:p,$$toast:h}=Z(0x2c4),{consolex:_}=Z(0x2d5),a0=android['provider']['Settings'],a1=a0['Secure'],a2=android['graphics']['Rect'],a3=org['opencv']['core']['Point'],a4=android['content']['Intent'],a5=com['stardust']['automator']['UiObject'],a6=com['stardust']['autojs']['core']['accessibility']['UiSelector'],a7=com['stardust']['autojs']['core']['accessibility']['AccessibilityService'],a8=android['view']['accessibility']['AccessibilityWindowInfo'],a9={'ctx_reso':context['getContentResolver'](),'autojs_a11y_svc_name':context['getPackageName']()+'/'+new a7()['getClass']()['getName'](),get 'sel'(){return this['selector']=this['selector']||aa['selector']();},'parseArgs'(V){let Y=[this['autojs_a11y_svc_name']],Z=!0x1,ae=typeof V[0x0];return'undefined'!==ae&&(Array['isArray'](ae)?(Y=V[0x0],Z=!!V[0x1]):'string'===ae?(Y=[V[0x0]],Z=!!V[0x1]):'boolean'===ae&&(Z=V[0x0])),{'forcible':Z,'svc':Y};},'getString'(){return a1['getString'](this['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'])||'';},'tryEnableAndRestart'(){if(aa['enable'](!0x0)){let {enginesx:V}=p('ext-engines');_['$'](['已自动开启无障碍服务','尝试一次项目重启操作'],0x1,0x0,0x0,0x2),V['restart']({'isDebug':!0x0,'is_instant_running':!0x1,'max_restart_e_times':0x1}),sleep(0x1068),exit();}}},aa={'bridge':{'setWindowFilter'(V){auto['setWindowFilter'](function(Y){try{return V(Y);}catch(ai){return!0x1;}});},'setWindowBlacklist'(V){this['setWindowFilter'](Y=>!V['includes'](Y['getRoot']()['getPackageName']()));},'setWindowWhitelist'(V){this['setWindowFilter'](Y=>V['includes'](Y['getRoot']()['getPackageName']()));},'setWindowAllowAll'(){this['setWindowFilter'](()=>!0x0);},'resetWindowFilter'(){this['setWindowFilter'](V=>this['isWindowType'](V,'APPLICATION')||this['isWindowType'](V,'SYSTEM')&&V['isActive']());},'isWindowType'(V,Y){if('number'==typeof Y)return Y===V['getType']();let Z=String(Y)['toUpperCase']();if(!(Z in{'APPLICATION':0x1,'INPUT_METHOD':0x2,'SYSTEM':0x3,'ACCESSIBILITY_OVERLAY':0x4,'SPLIT_SCREEN_DIVIDER':0x5}))throw TypeError('Unknown\x20type\x20of\x20\x22type\x22\x20for\x20isWindowType()');return a8['TYPE_'+Z]===V['getType']();}},'service':{'refreshServiceInfo'(){auto['service']['setServiceInfo'](auto['service']['getServiceInfo']());}},'click$'(){return(this['_click$']=this['_click$']||i['detach'](this['click'],0x2))['apply'](this,arguments);},'wait$'(){return(this['_wait$']=this['_wait$']||i['detach'](this['wait'],0x3))['apply'](this,arguments);},'swipe$'(){return(this['_swipe$']=this['_swipe$']||i['detach'](this['swipe'],0x3))['apply'](this,arguments);},'enable'(){try{let V,{forcible:Y,svc:Z}=a9['parseArgs'](arguments);if(this['state'](Z)?Y&&(V=this['enabled_svc']):V=this['enabled_svc']['split'](':')['filter'](V=>!Z['includes'](V))['concat'](Z)['join'](':'),V){a1['putString'](a9['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'],V),a1['putInt'](a9['ctx_reso'],a1['ACCESSIBILITY_ENABLED'],0x1);let Y=Date['now']();for(;Date['now']()-Y<0x7d0;){if(this['state'](Z))return!0x0;sleep(0xb4);}_['$']('Operation\x20timed\x20out',0x4,0x1);}return!0x0;}catch(au){return!0x1;}},'disable'(){try{let V=arguments[0x0];if(n(V)&&'all'===V['toLowerCase']())return a1['putString'](a9['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'],''),a1['putInt'](a9['ctx_reso'],a1['ACCESSIBILITY_ENABLED'],0x1),!0x0;let Y,{forcible:Z,svc:i}=a9['parseArgs'](arguments),ax=a9['getString'](),ay=function(){for(let V=0x0,Y=i['length'];V!i['includes'](V))['join'](':'):Z&&(Y=ax),Y){a1['putString'](a9['ctx_reso'],a1['ENABLED_ACCESSIBILITY_SERVICES'],Y),a1['putInt'](a9['ctx_reso'],a1['ACCESSIBILITY_ENABLED'],0x1),ax=a9['getString']();let V=Date['now']();for(;Date['now']()-V<0x7d0;){if(!ay())return!0x0;sleep(0xb4);}_['$']('Operation\x20timed\x20out',0x4,0x1);}return!0x0;}catch(aD){return!0x1;}},'restart'(){return this['disable']['apply'](this,arguments)&&this['enable']['apply'](this,arguments);},'state'(V){let Y=this['enabled_svc']=a9['getString'](),Z=[];if(Array['isArray'](V))Z=V['slice']();else if(void 0x0===V)Z=[a9['autojs_a11y_svc_name']];else{if('string'!=typeof V)throw TypeError('Unknown\x20a11y\x20state\x20type');Z=[V];}return Z['every'](V=>Y['includes'](V));},'services':()=>a9['getString']()['split'](':')['filter'](V=>!!V),'test'(){let V='%rand%'+Date['now']()+Math['random']()['toFixed'](0x9);return this['enable'](V,!0x0),this['disable'](V,!0x0);},'selector'(){let V={'sel_body_pool':{},'cache_pool':{}},Y={'pickup'(V,Y,aO){let aP={'loc_keys_abbr':{'bi$':'boundsInside','c$':'clickable','cn$':'className'},'options':aO||{},get 'res_type'(){return this['_res_type']=this['_res_type']||this['getResultType'](Y);},get 'locator'(){return this['_locator']||null;},get 'widget'(){return this['_widget']||null;},get 'widget_collection'(){return this['_wc']||[];},get 'selector'(){return this['_selector']||null;},'tools':{'uiObject2Point':V=>V instanceof a5?new a3(V['bounds']()['centerX'](),V['bounds']()['centerY']()):null,'wrapStrByOptDef':V=>!V&&'default'in aP['options']?aP['options']['default']:V,'isArrResType':()=>/^(widgets|points)$/['test'](aP['res_type']),'isCompass':V=>'string'==typeof V&&/([pck]\d*)+/['test'](V)},'refreshSvcInfoIFN'(){this['options']['refresh']&&aa['service']['refreshServiceInfo']();},'parseRawLocator'(){let Y,Z,aO=V;if(Array['isArray'](aO)){let V=aO['slice']();this['tools']['isCompass'](V[V['length']-0x1])&&(Z=V['pop']()),[aO,Y]=V;}let aX=this['setUniqueLocator'](aO,Y);aX instanceof a6?(this['_selector']=aX,this['_widget']=this['getWidgetByCompass'](aX['findOnce'](),Z),this['tools']['isArrResType']()&&(this['_wc']=aX['find']()['toArray']())):aX instanceof a5&&(this['_selector']=null,this['_widget']=this['getWidgetByCompass'](aX,Z),this['tools']['isArrResType']()&&(this['_wc']=[aX]));},'setUniqueLocator'(V,Y){if(V instanceof a6)return this['_locator']=this['assembleSelectors'](V,Y);if(n(V)||s(V)||o(V)){let Z=this['parseTextSelector'](V);return this['_locator']=this['assembleSelectors'](Z,Y);}if(a(V)){let Z=global['selector'](),aO=Object['assign'](V,Y);return this['_locator']=this['assembleSelectors'](Z,aO);}return this['_locator']=V;},'extendLocator'(V,Y,aO){let b6,{$$disp:s}=Z(0x19f),b7={get 'W'(){return'object'==typeof s?s['W']:device['width'];},get 'H'(){return'object'==typeof s?s['H']:device['height'];},'screenCenterX'(Y){let Z=Number(Y),aO=!0x0===Y||l(Y)||isNaN(Z)?0.01:!0x1===Y?Y:Z['clamp'](0x0,0.25),b6=V=>Math['abs'](V['bounds']()['centerX']()-this['W']/0x2)<=this['W']*aO;return!0x1!==aO?V['filter'](b6['toRegular']()):V['filter']((V=>!b6(V))['toRegular']());},'isFullScreen'(Y){let Z=Number(Y),aO=!0x0===Y||isNaN(Z)?0.15:!0x1===Y?Y:Z['clamp'](0x0,0.5),b6=V=>V['bounds']()['height']()/this['H']>=0x1-aO&&Math['abs'](V['bounds']()['width']()-this['W'])<=0x4;return!0x1!==aO?V['filter'](b6['toRegular']()):V['filter']((V=>!b6(V))['toRegular']());},'isAlipay'(Y){if(void 0x0===Y)return Y;let Z='.*(Alipay|alipay).*';return Y?V['packageNameMatches'](Z):V['filter']((V=>!V['packageName']()['match'](Z))['toRegular']());}};try{b6=b7[Y]['apply'](b7,aO);}catch(bn){throw console['warn'](bn['message']),Error('Cannot\x20apply\x20extended\x20locator:\x20'+Y);}if(b6 instanceof a6)return b6;throw Error('Extended\x20locator\x20('+Y+')\x20returns\x20non-UiSelector\x20type');},'assembleSelectors'(V,Y){return l(V)||!c(Y)||Object['keys'](Y)['forEach'](Z=>{let aO=Z in this['loc_keys_abbr']?this['loc_keys_abbr'][Z]:Z,bs=V=>'function'==typeof V?V['toRegular']():V,bt=Array['isArray'](Y[Z])?Y[Z]['map'](bs):[Y[Z]]['map'](bs),bu=V[aO];if('function'==typeof bu)try{return V=bu['apply'](V,bt);}catch(bw){throw console['warn'](bw['message']),Error('Cannot\x20apply\x20selector:\x20'+aO);}return V=this['extendLocator'](V,aO,bt);}),V;},'getTextSelector'(V,Y){let Z={'sel':Y['desc'](V),get 'txt'(){let V=this['sel']['findOnce']();return V&&V['desc']()||'';}},aO={'sel':Y['text'](V),get 'txt'(){let V=this['sel']['findOnce']();return V&&V['text']()||'';}},bB=Z['txt']['length'],bC=aO['txt']['length'];if(bB||bC)return bC>bB?aO['sel']:Z['sel'];let bF=Y['id'](V);return bF['exists']()?bF:null;},'parseTextSelector'(V){return V instanceof RegExp?this['getTextSelector'](V,{'desc':descMatches,'text':textMatches,'id':idMatches}):('number'==typeof V&&(V=V['toString']()),'string'==typeof V?this['getTextSelector'](V,{'desc':desc,'text':text,'id':id}):null);},'getWidgetByCompass'(V,Y){if(!(V instanceof a5))return null;if('string'!=typeof Y)return V;for(;Y['length']>0x0;){let Z,aO,bL,bM;if(Z=/^p[p\d]*/['exec'](Y)){let aO=Y['match'](/^p\d+|^p+(?!\d)/g)['reduce']((V,Y)=>V+(/\d/['test'](Y)?Number(Y['slice'](0x1)):Y['length']),0x0);for(;aO--;)if(!(V=V['parent']()))return null;Y=Y['slice'](Z[0x0]['length']);}else if(aO=/^c-?\d+([>c]?-?\d+)*/['exec'](Y)){let Z=aO[0x0]['split'](/[>c]/);for(let Y of Z)if(Y['length']){if(!(V instanceof a5))return null;let Z=V['childCount'](),aO=Number(Y);if(aO<0x0&&(aO+=Z),aO<0x0||aO>=Z)return null;V=V['child'](aO);}Y=Y['slice'](aO[0x0]['length']);}else if(bL=/^s[<>]?-?\d+/['exec'](Y)){let Z=V['parent']();if(!(Z instanceof a5))return null;let aO=V['indexInParent']();if(aO<0x0)return null;let bM=Z['childCount'](),bX=bL[0x0],bY=+bX['match'](/-?\d+/)[0x0];if(bX['includes']('>')?aO+=bY:bX['includes']('<')?aO-=bY:aO=bY<0x0?bY+bM:bY,aO<0x0||aO>=bM)return null;V=Z['child'](aO),Y=Y['slice'](bL[0x0]['length']);}else{if(!(bM=/^k[k\d]*/['exec'](Y)))throw Error('Invalid\x20rest\x20compass\x20for\x20$$sel.pickup():\x20'+Y);{let Z=Y['match'](/^k(\d*)/g)['map'](V=>{let Y=V['match'](/\d+/);return Y?Number(Y[0x0]):0x1;})['reduce']((V,Y)=>V+Y);V=function(){let Y=V;for(;;){if(!(Y instanceof a5))return null;if(Y['clickable']())return Y;if(!Z--)return V;Y=Y['parent']();}}(),Y=Y['slice'](bM[0x0]['length']);}}}return V||null;},'getResultType'(V){let Y=V?String(V):null;return null===Y||Y['match'](/^w(idget)?$/)?'widget':Y['match'](/^(w(idget)?_?c(ollection)?|wid(get)?s)$/)?'widgets':Y['match'](/^t(xt)?$/)?'txt':Y['match'](/^s(el(ector)?)?$/)?'selector':Y['match'](/^e(xist(s)?)?$/)?'exists':Y['match'](/^s(el(ector)?)?(_?s)(tr(ing)?)?$/)?'selector_name':Y['match'](/^p(oin)?ts?$/)?Y['includes']('s')?'points':'point':Y;},'getInternalResult'(){return{'selector':this['selector'],'widget':this['widget'],'widgets':this['widget_collection'],'exists':Boolean(this['widget']),get 'selector_name'(){if(!this['widget']||!this['selector'])return aP['tools']['wrapStrByOptDef']('');let V=this['selector']['toString']()['match'](/[a-z]+/);return aP['tools']['wrapStrByOptDef'](V?V[0x0]:'');},get 'txt'(){let V=this['widget']&&this['widget']['text']()||'',Y=this['widget']&&this['widget']['desc']()||'';return Y['length']>V['length']?aP['tools']['wrapStrByOptDef'](Y):aP['tools']['wrapStrByOptDef'](V);},get 'point'(){return aP['tools']['uiObject2Point'](this['widget']);},get 'points'(){return this['widgets']['map'](aP['tools']['uiObject2Point'])['filter'](V=>null!==V);}}[this['res_type']];},'getResult'(){this['refreshSvcInfoIFN'](),this['parseRawLocator']();let V=function(){let V=this['getInternalResult']();if(void 0x0!==V)return V;if(null===this['widget'])return null;let Y=this['widget'][this['res_type']];return'function'==typeof Y?Y['call'](this['widget']):Y;}['call'](this);return l(V)?'default'in this['options']?this['options']['default']:null:V;}};return aP['getResult']();},'traverse':(V,Z,cg)=>({'parseFilter'(){this['filter']='string'==typeof Z?V=>Y['pickup'](V,Z):'function'==typeof Z?Z:()=>!0x0;},'parseArgs'(){this['parseFilter'](),this['type']=cg||'widget',this['pickup']=Y['pickup']['bind'](Y),this['pickup_null_res']=this['pickup'](null,this['type']);},'traverse'(V){for(let Y of this['pickup'](V,'children',{'default':[]})){if(!(Y instanceof a5))continue;if(this['filter'](Y))return this['pickup'](Y,this['type']);let V=this['traverse'](Y);if(V!==this['pickup_null_res'])return V;}return this['pickup_null_res'];},'getResult'(){return this['parseArgs'](),this['filter'](V)?this['pickup'](V,this['type']):this['traverse'](V);}}['getResult']()),'traverseAll':(V,Z,cn)=>({'results':[],'type':cn||'widget','filter':'string'==typeof Z?V=>Y['pickup'](V,Z):'function'==typeof Z?Z:()=>!0x0,'pickup':Y['pickup']['bind'](Y),'traverse'(V){for(let Y of this['pickup'](V,'children',{'default':[]}))Y instanceof a5&&(this['filter'](Y)&&this['results']['push'](this['pickup'](Y,'widget')),this['traverse'](Y));return this['type']['match'](/^w(idget)?$/)?this['results']:this['results']['map'](V=>this['pickup'](V,this['type']));},'getResult'(){return this['filter'](V)&&this['results']['push'](this['pickup'](V,'widget')),this['traverse'](V);}}['getResult']()),'add'(Y,Z){return V['sel_body_pool'][Y]='function'==typeof Z?V=>Z(V):V=>this['pickup'](Z,V),this;},'get'(Y,Z){let cz=V['sel_body_pool'][Y];if(void 0x0!==cz)return cz?'cache'===Z?V['cache_pool'][Y]=cz('w'):cz(Z):null;throw Error('Key\x20\x22'+Y+'\x22\x20is\x20not\x20in\x20the\x20pool');},'getAndCache'(V){return this['get'](V,'cache');},'cache':{'save'(V){Y['getAndCache'](V);},'load'(Z,cD){let cE=V['cache_pool'][Z];return cE?Y['pickup'](cE,cD):null;},'refresh'(Y){let Z=V['cache_pool'][Y];Z&&Z['refresh'](),this['save'](Y);},'recycle'(Y){let Z=V['cache_pool'][Y];Z&&Z['recycle']();}}};return Object['assign'](Object['create'](global['selector']()),Y);},'enableByRoot'(){try{let V='enabled=$(settings\x20get\x20secure\x20enabled_accessibility_services)\x0apkg='+a9['autojs_a11y_svc_name']+'\x0aif\x20[[\x20$enabled\x20!=\x20*$pkg*\x20]]\x0athen\x0aenabled=$pkg:$enabled\x0asettings\x20put\x20secure\x20enabled_accessibility_services\x20$enabled\x0afi\x0asettings\x20put\x20secure\x20accessibility_enabled\x201';return 0x0===shell(V,!0x0)['code'];}catch(cK){return!0x1;}},'enableByRootAndWaitFor'(V){return this['enableByRoot']()&&a7['Companion']['waitForEnabled'](V||0x3e8);},'goToAccessibilitySetting'(){context['startActivity'](new a4(a0['ACTION_ACCESSIBILITY_SETTINGS'])['addFlags'](a4['FLAG_ACTIVITY_NEW_TASK']));},'waitForEnabled'(V){return threads['start'](function(){auto['waitFor']();})['join'](V||0xea60),this['state']()||_['$']('等待用户开启无障碍服务超时',0x8,0x2,0x0,0x2);},'isAutoEnableEnabled'(){try{let {storagesx:V}=p('ext-storages');return'ON'===V['create']('af_cfg')['get']('config',{'prop':'autoEnableA11yService'});}catch(cN){return!0x1;}},'autoEnable'(V){if(this['state']())return!0x0;let Y=V||{},Z=Y['is_essential'],cR=Y['is_manual_disallowed'];if(!this['isAutoEnableEnabled']()){if(!Z)return _['_']('自动开启无障碍服务未启用',0x3),!0x1;_['$']('无障碍服务关闭且自动启用未开启',0x8,0x2,0x0,0x2);}let cS=context['getPackageName']()+'\x20android.permission.WRITE_SECURE_SETTINGS';return'undefined'!=typeof activity?(this['enable'](!0x0)?h('已自动启用无障碍服务\x0a需要重新运行当前脚本','long'):Z&&_['$']('自动启用无障碍服务失败',0x4,0x2,0x0,0x2),exit(),!0x1):(a9['tryEnableAndRestart'](),function(){try{return 0x0===shell('date',!0x0)['code'];}catch(cT){return!0x1;}}()&&(shell('pm\x20grant\x20'+cS,!0x0),a9['tryEnableAndRestart']()),function(){if(_['$']('自动启用无障碍服务失败',0x4,0x2,0x0,-0x1),context['checkCallingOrSelfPermission'](android['Manifest']['permission']['WRITE_SECURE_SETTINGS'])!==android['content']['pm']['PackageManager']['PERMISSION_GRANTED']){let V='adb\x20shell\x20pm\x20grant\x20'+cS;_['$']('Auto.js缺少以下权限:',0x4,0x0,0x0,-0x1),_['$']('WRITE_SECURE_SETTINGS',0x4,0x0,0x0,0x1),_['$']('可尝试使用ADB工具连接手机',0x3),_['$']('并执行以下Shell指令(无换行):\x0a\x0a'+V+'\x0a',0x3),_['$']('Shell指令已复制到剪切板',0x3),_['$']('重启设备后授权不会失效',0x3),setClip(V);}_['__']();}(),Z&&cR&&exit(),this['waitForEnabled']());},'ensureService'(){this['autoEnable']({'is_essential':!0x0});},'ensureFunctionality'(){if('undefined'==typeof activity){let V=0x18;for(;!press(0x5f5e100,0x0,0x1)&&V--;)sleep(0x32);V<0x0&&(_['$']('无障碍服务状态异常',0x4,0x0,0x0,-0x1),_['$']('或基于服务的方法无法使用',0x4,0x0,0x0,0x1),_['$']('可尝试以下解决方案',0x3),_['$']('卸载并重新安装\x22Auto.js\x22',0x3,0x0,0x1),_['$']('安装后重启设备',0x3,0x0,0x1),_['$']('运行\x22Auto.js\x22并拉出侧边栏',0x3,0x0,0x1),_['$']('开启无障碍服务',0x3,0x0,0x1),_['$']('再次尝试运行本项目',0x3,0x0,0x1),_['$']('无障碍服务功能异常',0x8,0x2,0x0,0x2));}},'ensureSvcAndFunc'(){this['ensureService'](),this['ensureFunctionality']();},'click'(V,Y,Z){return a(Y)?this['click'](V,'widget',Y):!l(V)&&{'container':[],'options':Z||{},'wait':aa['wait']['bind'](aa),'pickup':a9['sel']['pickup']['bind'](a9['sel']),'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('a11yx.click');},'parsePadding'(){let V=this['options']['padding'];if(!V)return this['padding']={'x':0x0,'y':0x0};if('number'==typeof V)V=[0x0,V];else if(!Array['isArray'](V))throw Error('Invalid\x20paddings\x20for\x20a11yx.click()');let Y=function(){if(0x1===V['length'])return[0x0,V[0x0]];if(0x2===V['length']){let [Y,Z]=V;return'x'===Y?[Z,0x0]:'y'===Y?[0x0,Z]:[Y,Z];}throw Error('Invalid\x20paddings\x20amount\x20for\x20a11yx.click()');}(),[Z,d4]=Y['map'](V=>Number(V));if(isNaN(Z)||isNaN(d4))throw Error('Invalid\x20paddings\x20calc\x20results\x20for\x20a11yx.click()');this['padding']={'x':Z,'y':d4};},'parseStrategy'(){let V=this['options']['strategy']||this['options']['click_strategy']||this['options']['cs$']||Y||'widget';this['strategy']='string'==typeof V?V:String(this['strategy']);},'parseCondition'(){this['condition']=function(){let Y=this['options']['condition'];if('function'==typeof Y)return Y;if('disappear'===Y)return()=>this['checkDisappearance'](V);if(l(Y))return()=>!0x0;throw Error('Invalid\x20condition\x20for\x20a11yx.click():\x20'+Y);}['call'](this);},'parseArgs'(){this['parsePadding'](),this['parseStrategy'](),this['parseCondition'](),this['times']=this['options']['max_check_times']||0x3,this['timeout']=this['options']['check_time_once']||0x1f4,this['press_time']=this['options']['press_time']||this['options']['pt$']||0x1,this['buffer_time']=this['options']['buffer_time']||this['options']['bt$']||0x0;},'checkDisappearance'(V){if(l(V))return!0x0;if(V instanceof a5){let Y=V['parent']();return!Y||!this['container']['includes'](Y['hashCode']());}if(V instanceof a6){let Y=V['findOnce']();return!Y||!this['container']['includes'](Y['hashCode']());}return this['checkDisappearance'](this['pickup'](V));},'clickOnce'(V){let Y=(V,Y)=>this['strategy']['match'](/^p(ress)?$/)?press(V+this['padding']['x'],Y+this['padding']['y'],this['press_time']):click(V+this['padding']['x'],Y+this['padding']['y']);if(V instanceof a6){let Z=V['findOnce']();if(!Z)return!0x1;if(this['container']['push'](Z['hashCode']()),this['strategy']['match'](/^w(idget)?$/)&&Z['clickable']())return Z['click']();let dk=Z['bounds']();return Y(dk['centerX'](),dk['centerY']());}if(V instanceof a5){let Z=V['parent']();if(null!==Z&&this['container']['push'](Z['hashCode']()),this['strategy']['match'](/^w(idget)?$/)&&V['clickable']())return V['click']();let dm=V['bounds']();return Y(dm['centerX'](),dm['centerY']());}if(V instanceof a2)return Y(V['centerX'](),V['centerY']());if(V instanceof a3)return Y(V['x'],V['y']);if(a(V)&&'number'==typeof V['x']&&'number'==typeof V['y'])return Y(V['x'],V['y']);if(Array['isArray'](V)&&0x2===V['length']&&V['every'](V=>'number'==typeof V))return Y['apply'](null,V);let Z=this['pickup'](V,'widget');return!!Z&&this['clickOnce'](Z);},'getResult'(){this['impededIFN'](),this['parseArgs']();do{if(this['clickOnce'](V)){if(this['wait'](this['condition'],this['timeout'],0x50))return u(this['buffer_time']),!0x0;}else u(this['timeout']);}while(this['times']--);return!0x1;}}['getResult']();},'pipeline'(V,Y,Z){return'string'!=typeof V?this['pipeline'](String(),V,Y):{'options':Z||{},get 'name'(){return this['_name']=this['_name']||String(this['options']['name']||'pipeline')['surround']('\x22');},'pickup':a9['sel']['pickup']['bind'](a9['sel']),'waitAndClick':aa['waitAndClick']['bind'](aa),'parseActions'(){return this['actions']=Y['map'](V=>a(V)?V:{'locator':V});},'getResult'(){return this['parseActions']()['every']((V,Y)=>this['waitAndClick'](V['locator'],Object['assign']({},this['options'],{'condition':function(){return V['condition']?V['condition']:Ythis['pickup'](this['actions'][Y+0x1]['locator']):void 0x0;}['call'](this),'strategy':V['strategy']}))||_['w']([this['name']+'管道破裂',V['locator']],0x2,0x0,-0x2));}}['getResult']();},'wait'(V,Y,Z,dz){return a(Y)?this['wait'](V,null,null,Y):a(Z)?this['wait'](V,Y,null,Z):{'result':!0x1,'start':Date['now'](),'pickup':a9['sel']['pickup']['bind'](a9['sel']),'options':dz||{},'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('a11yx.wait');},'parseArgs'(){let V='number'==typeof Y?Y:Number(Y)||0x2710;this['times']=V<=0x0||!isFinite(V)||isNaN(V)||V>=0x64?0x1/0x0:V,this['timeout']=V>=0x64?V:0x1/0x0,this['interval']=Z||0xc8,this['interval']>=this['timeout']&&(this['times']=0x1);},'check'(){return l(V)?V:'function'==typeof V?V():this['pickup'](V);},'wait'(){for(;this['times']--&&!(this['result']=this['check']())&&!(Date['now']()-this['start']>this['timeout']);)sleep(this['interval']);},'callbackIFN'(){if('function'==typeof this['options']['then']&&this['result']){let V=this['options']['then']['call'](this['options']['this'],this['result']);void 0x0!==V&&(this['result']=V);}'function'==typeof this['options']['else']&&(this['result']||this['options']['else']['call'](this['options']['this']));},'getResult'(){return this['impededIFN'](),this['parseArgs'](),this['wait'](),this['callbackIFN'](),this['result'];}}['getResult']();},'waitEvery'(V,Y,Z,dF){},'waitSome'(V,Y,Z,dJ){},'waitAndClick'(V,Y,Z,dN){if(a(Y))return this['waitAndClick'](V,null,null,Y);if(a(Z))return this['waitAndClick'](V,Y,null,Z);let dO=!0x0;return this['wait'](V,Y,Z,{'then':function(V){let Y=dN||{};sleep(Y['intermission']||0xf0),dO=this['click'](V,Y)&&dO;}['bind'](this)})&&dO;},'waitAndStable'(V,Y,Z,dU){if(a(Y))return this['waitAndStable'](V,null,null,Y);if(a(Z))return this['waitAndStable'](V,Y,null,Z);let dV={'parseArgs'(){let V=dU||{};this['reference']=V['reference'],this['timeout']=V['timeout']||0x5dc0,this['threshold']=V['threshold']||0x1a4;},'isTimedOut'(){return Date['now']()-this['condition_start']>this['timeout'];},'condition'(){return this['last_condition']=V();},'checkInitCondition'(){let V=void 0x0!==this['reference']?()=>this['condition']()!==this['reference']:()=>this['condition']();return aa['wait'](V,Y,Z,{'then':V=>dV['last_stable']=V});},'checkStableCondition'(){for(this['condition_start']=Date['now']();aa['wait'](()=>dV['last_stable']!==this['condition'](),this['threshold']);)if(dV['last_stable']=dV['last_condition'],this['isTimedOut']())throw Error('a11yx.waitAndStable()\x20timed\x20out\x20waiting\x20for\x20stable\x20condition');return dV['last_stable'];},'getResult'(){return this['parseArgs'](),this['checkInitCondition']()&&this['checkStableCondition']();}};return dV['getResult']();},'swipe':(V,Y,Z,e2)=>({'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('a11yx.swipe');},'parsePoint'(V){if('number'==typeof V)return{'x':halfW,'y':this['scale'](V,'y')};if(Array['isArray'](V)){if(0x2!==V['length']||!V['every'](V=>s(V)))throw Error('Invalid\x20array\x20point:\x20'+V['join'](',\x20'));return{'x':this['scale'](V[0x0],'x'),'y':this['scale'](V[0x1],'y')};}if(a(V)){if('number'!=typeof V['x']||'number'!=typeof V['y'])throw Error('Invalid\x20object\x20point:\x20'+V['x']+',\x20'+V['y']);return{'x':this['scale'](V['x'],'x'),'y':this['scale'](V['y'],'y')};}if(V instanceof a3)return{'x':this['scale'](V['x'],'x'),'y':this['scale'](V['y'],'y')};throw TypeError('Unknown\x20type\x20of\x20point\x20for\x20a11yx.swipe()');},'parseDuration'(){this['duration']=Z>=0xc8?Z:Math['max'](Math['dist'](this['start'],this['end'])/0x5,0xc8);},'parseArgs'(){this['options']=e2||{},this['start']=this['parsePoint'](V),this['end']=this['parsePoint'](Y),this['parseDuration']();},'scale'(V,Y){let Z=void 0x0===Y?'x':Y;return-0x1===V?'x'===Z?W:H:V<0x1?'x'===Z?cX(V):cY(V):V;},'swipe'(){return swipe(this['start']['x'],this['start']['y'],this['end']['x'],this['end']['y'],this['duration']);},'getResult'(){return this['parseArgs'](),this['impededIFN'](),this['swipe']();}}['getResult']()),'swipeInBounds'(){},'swipeInScreen'(){},'swipeAndClick'(){}};V['exports']={'a11yx':aa,'$$sel':aa['selector']()};},121:(e8,e9,ea)=>{let {$$impeded:i,$$toast:n,isNullish:s}=ea(0x2c4),{a11yx:o}=ea(0x2d4),{devicex:a}=ea(0x19f),{timersx:l}=ea(0x357),{consolex:c}=ea(0x2d5),{threadsx:u}=ea(0xef),eb=android['net']['Uri'],ec=java['lang']['Runtime'],ed=android['Manifest'],ee=android['os']['Process'],ef=android['content']['Intent'],eg=android['content']['Context'],eh=android['provider']['Settings']['System'],ei=android['content']['pm']['ApplicationInfo'],ej=android['content']['pm']['PackageManager'],ek=android['app']['ActivityManager'],el=org['autojs']['autojs']['model']['script']['ScriptFile'],em=android['content']['ActivityNotFoundException'],en=org['autojs']['autojs']['ui']['shortcut']['ShortcutCreateActivity'],eo={'alipay_pkg':'com.eg.android.AlipayGphone','autojsPackageName':context['getPackageName'](),get 'autojs_ver'(){let e8=app['autojs']['versionName'];return String(e8)['match'](/^\d/)?e8:ep['getVerName']('Auto.js');},'toPct'(e8,e9,ea){let eu='number'==typeof e9?e9:isNaN(e9)?0x2:Number(e9),ev=(0x64*e8)['toFixed'](eu);return(ea?ev:Number(ev))+'%';},'startActivity'(e8){let e9=ef['FLAG_ACTIVITY_NEW_TASK'];if(e8 instanceof ef)return context['startActivity'](ep['intent'](new ef(e8),{'flags':e9}));if('object'==typeof e8)return u['monitorIFN'](e8['monitor']),e8['root']?void shell('am\x20start\x20'+app['intentToShell'](e8),!0x0):context['startActivity'](ep['intent'](e8,{'flags':e9}));if('string'==typeof e8){let ea=runtime['getProperty']('class.'+e8);if(!ea)throw new Error('Class\x20'+e8+'\x20not\x20found');return context['startActivity'](ep['intent'](new ef(context,ea),{'flags':e9}));}throw Error('Unknown\x20param\x20for\x20appx.startActivity()');}},ep={'version':{'getHex'(e8,e9){if('object'==typeof e8&&(e8=e8['version_name']),!e8)throw Error('A\x20\x22version\x22\x20must\x20be\x20defined\x20for\x20appx.version.getHex()');let ea=e9||{},eC=e8=>('00'+Number(e8||0x0)['toString'](0x10))['slice'](-0x2),eD=e8['toString']()['trim']()['replace'](/^[a-z\s]*(\d+)(?:\.(\d+)(?:\.(\d+)(?:-\d+)?\s*(b(?:eta)?|a(?:lpha)?)?\s*(\d*))?)?$/i,(e8,e9,ea,eD,eE,eL)=>{let eM=[e9,ea,eD]['map'](e8=>eC(e8))['reduce']((e8,e9)=>e8+e9),eN=eL?Number(eL):0x1,eO=0xff;if(eE)if(eE['match'](/b(eta)?/i)){if(eN>=0x7f)throw Error('Beta\x20version\x20code\x20must\x20be\x20smaller\x20than\x20127');eO=0x80;}else if(eE['match'](/a(lpha)?/i)){if(eN>0x80)throw Error('Alpha\x20version\x20code\x20cannot\x20be\x20greater\x20than\x20128');eO=0x0;}return eM+eC(Math['min'](eO+eN,0xff));}),eE='0x'+eD;return'number'===ea['type']?Number(eE):'string_with_prefix'===ea['type']?eE:eD;},'parseHex'(e8,e9){if('number'==typeof e8&&(e8=('0'['repeat'](0x7)+e8['toString'](0x10))['slice'](-0x8)),!e8)throw Error('A\x20\x22version\x22\x20must\x20be\x20defined\x20for\x20appx.version.parseHex()');return e8['replace'](/^0x/,'')['replace'](/(..)(..)(..)(..)/g,(e8,ea,eW,eX,eY)=>{let eZ=[ea,eW,eX]['map'](e8=>Number('0x'+e8))['join']('.'),f0=Number('0x'+eY),f1='';return f0<=0x80?f1='\x20Alpha'+(0x1===f0?'':f0):f0<0xff&&(f0-=0x80,f1='\x20Beta'+(0x1===f0?'':f0)),(null===e9?'':e9||'v')+eZ+f1;});},'parseName'(e8){let e9=/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?\s*((a(lpha)?|b(eta)?)\s*\d*)?$/i,ea=String(e8);return ea['match'](e9)?this['parseHex'](this['getHex'](ea['replace'](e9,(e8,e9,ea,f9,fa)=>e9+'.'+(ea||0x0)+'.'+(f9||0x0)+(fa?'\x20'+fa:'')))):String();},'isNewer'(e8,e9){return this['getHex'](e8)>this['getHex'](e9);}},'getAppName':e8=>e8?app['getAppName'](e8)||app['getPackageName'](e8)&&e8:null,'getPkgName':e8=>e8?!String(e8)['includes']('.')&&app['getPackageName'](e8)||app['getAppName'](e8)&&e8:null,'getVerName':e8=>({'parsePkgName'(){if('string'==typeof e8)return e8['match'](/^auto\.?js$/i)?eo['autojsPackageName']:e8['match'](/^current$/i)?currentPackage():ep['getPkgName'](e8);},'getResult'(){let e8=this['parsePkgName']();if(e8)try{let e9=context['getPackageManager']()['getInstalledPackages'](0x0)['toArray']();for(let ea in e9)if(e8===e9[ea]['packageName'])return e9[ea]['versionName'];}catch(fj){}return null;}}['getResult']()),'checkAccessibility'(){o['ensureSvcAndFunc']();},'checkModules'(e8){let e9=()=>'-'['repeat'](0x21),fm=()=>'\x20-'['repeat'](0x11)['slice'](0x1);e8['filter'](e8=>{let fp='./'+e8+'.js';try{ea(0x206)(fp);}catch(fq){return console['log'](e9()),console['warn'](fp),console['log'](fm()),console['warn'](fq['message']),console['warn'](fq['stack']),!0x0;}})['some']((e8,ea,ft)=>{let fu='';fu+='脚本无法继续|以下模块缺失或加载失败:',fu+=fm()['surround']('|'),ft['forEach'](e8=>fu+='->\x20'+e8['surround']('\x22')),fu+=fm()['surround']('|'),fu+='需正确放置模块文件',console['log'](e9()),fu['split']('|')['forEach'](e8=>console['error'](e8)),console['log'](e9()),toast('模块缺失或加载失败'),exit();});},'checkAlipayPackage'(){let e8,e9,ea=context['getPackageManager']();try{e9=ea['getApplicationInfo'](eo['alipay_pkg'],0x0),e8=ea['getApplicationLabel'](e9);}catch(fA){c['w'](fA,0x0,0x0,0x2);}e8||c['$'](['脚本无法继续','此设备可能未安装\x22支付宝\x22应用'],0x8,0x4,0x0,0x2);},'checkScreenOffTimeout'(e8){let e9=e8||{},ea=a['screen_off_timeout']['get']();if(ea<(e9['min_timeout']||0x3a98)){if(void 0x0!==e9['is_auto_correction']&&!e9['is_auto_correction'])throw Error('Abnormal\x20screen\x20off\x20timeout:\x20'+ea);let e8=e9['default_timeout']||0x1d4c0,fF=(e8/0xea60)['toFixedNum'](0x2);c['d'](['修正异常的设备屏幕超时参数','修正值:\x20'+e8+'(\x20'+fF+'分钟)'],0x0,0x0,-0x2);try{a['screen_off_timeout']['put'](e8);}catch(fG){c['e'](['修正失败',fG],0x2,0x0,-0x2);}}},'checkActivity'(e8){let e9=context['getPackageManager']()['queryIntentActivities'](this['intent'](e8),0x0);return e9&&0x0!==e9['toArray']()['length'];},'resolveActivity'(e8){return this['intent'](e8)['resolveActivity'](context['getPackageManager']());},'startActivity'(e8,e9){try{if('string'==typeof e8||this['checkActivity'](e8))return eo['startActivity'](e8),!0x0;}catch(fM){let fN=e9||{};'function'==typeof fN['onActivityNotFoundException']?fM['javaException']instanceof em&&fN['onActivityNotFoundException']['call'](e8):'suppress'!==fN['onActivityNotFoundException']&&c['$'](fM,0x8,0x2,0x0,0x2);}return!0x1;},'intent'(e8,e9){let ea=e8 instanceof ef?e8:function(e8){let e9=new ef();if(e8['url']&&(e8['data']=function(e8){let e9=e8['url'];return'object'==typeof e9&&(e9=function e8(e9){let {src:ea,query:fR,exclude:g6}=e9;if(!ea||!fR)return ea;let fX=ea['match'](/\?/)?'&':'?';return ea+fX+function e9(ea){let fR=g6||[];return Array['isArray'](fR)||(fR=[fR]),Object['keys'](ea)['map'](g0=>{let fX=ea[g0];return'Object'===Object['prototype']['toString']['call'](fX)['slice'](0x8,-0x1)&&(fX='url'===g0?e8(fX):e9(fX),fX=('__webview_options__'===g0?'&':'')+fX),fR['includes'](g0)||(fX=encodeURI(fX)),g0+'='+fX;})['join']('&');}(fR);}(e9)),e9;}(e8)),e8['package']&&(e8['packageName']=e8['packageName']||e8['package'],delete e8['package']),e8['packageName']&&('alipay'===e8['packageName']['toString']()['toLowerCase']()&&(e8['packageName']=eo['alipay_pkg']),e8['className']?e9['setClassName'](e8['packageName'],e8['className']):e9['setPackage'](e8['packageName'])),e8['extras']&&Object['keys'](e8['extras'])['forEach'](ea=>{e9['putExtra'](ea,e8['extras'][ea]);}),e8['category'])if(Array['isArray'](e8['category']))for(let ea=0x0;e8(o['service']['refreshServiceInfo'](),ea['condition_ready']()),ei='function'!=typeof ea['condition_launch']?()=>currentPackage()===eb:()=>(o['service']['refreshServiceInfo'](),ea['condition_launch']()),ej=ea['disturbance'];ej&&(gb('已开启干扰排除线程'),eg=u['start'](function(){for(;;)sleep(0x4b0),ej();}));let ek=ea['global_retry_times']||0x2,el=ek;for(;ek--;){let e8=ea['launch_retry_times']||0x3,e9=e8,gq=ea['is_show_toast'];if(gq&&'none'!==gq){let e8=ed?'重新开始'+ed['surround']('\x22')+'任务':'重新启动'+ec['surround']('\x22')+'应用';ee?(!0x0===gq||String(gq)['match'](/^(all|greeting(_only)?)$/))&&c['d'](e8['replace'](/重新/g,''),0x1,0x0,0x2):String(gq)['match'](/^(greeting(_only)?)$/)||n(e8);}for(;e8--;){'object'==typeof gc?(gb('加载intent参数启动应用'),this['startActivity'](gc)):'string'==typeof gc?(gb('加载应用包名参数启动应用'),app['launchPackage'](eb)||(gb('加载应用名称参数启动应用'),app['launchApp'](ec))):(gb('使用触发器方法启动应用'),gc());let ea='(\x20'+(e9-e8)+'/'+e9+')';if(o['wait'](ei,0x1388,0x320)){gb('应用启动成功');break;}gb('应用启动超时'+ea),gb(currentPackage(),0x0,0x1);}if(e8<0x0&&c['$']('打开'+ec['surround']('\x22')+'失败',0x8,0x4,0x0,0x2),s(eh)){gb('未设置启动完成条件参数');break;}ee=!0x1,gb('开始监测启动完成条件');let gu=ea['ready_retry_times']||0x3,ef=gu;for(;!o['wait'](eh,0x1f40)&&gu--;){let e8=(ef-gu+'/'+ef)['surround']('()');'object'==typeof gc?(gb('重新启动Activity\x20'+e8),this['startActivity'](gc)):(gb('重新启动应用\x20'+e8),app['launchPackage'](gc));}if(gu>=0x0){gb('启动完成条件监测完毕');break;}gb('尝试关闭'+ec['surround']('\x22')+'应用:'),gb((el-ek+'/'+el)['surround']('()')),this['kill'](eb);}return eg&&(eg['interrupt'](),gb('干扰排除线程结束'),eg=null),ek<0x0&&c['$'](ef['surround']('\x22')+'初始状态准备失败',0x8,0x4,0x0,0x2),gb(ef['surround']('\x22')+'初始状态准备完毕'),!0x0;},'launchAndClearTop'(e8){this['startActivity'](this['intent'](this['getLaunchIntentForPackage'](e8),{'flags':ef['FLAG_ACTIVITY_CLEAR_TOP']}));},'getLaunchIntentForPackage':e8=>context['getPackageManager']()['getLaunchIntentForPackage'](e8||eo['autojsPackageName']),'kill'(e8,e9){let ea=e9||{};ea['no_impeded']||'function'==typeof i&&i(this['kill']['name']);let gC=e8||'';gC||(gC=currentPackage(),c['w'](['自动使用currentPackage()返回值','appx.kill()未指定name参数']));let gD=this['getAppName'](gC),gE=this['getPkgName'](gC);gD&&gE||c['$']('解析应用名称及包名失败',0x8,0x4,0x0,0x2);let gF=void 0x0===ea['shell_acceptable']||ea['shell_acceptable'],gG=void 0x0===ea['keycode_back_acceptable']||ea['keycode_back_acceptable'],eb=ea['keycode_back_twice']||!0x1,ec=ea['condition']||(()=>{let e8=()=>currentPackage()===gE;return o['wait'](()=>!e8(),0x2ee0)&&!o['wait'](e8,0x3,0x96);}),ed=!0x1,ee=Date['now'](),ef=ea['shell_max_wait_time']||0x2710;if(gF)try{ed=!shell('am\x20force-stop\x20'+gE,!0x0)['code'];}catch(gN){c['_']('shell()方法强制关闭'+gD['surround']('\x22')+'失败');}else c['_']('参数不接受shell()方法');if(!ed)return gG?function(){c['_']('尝试最小化当前应用');let e8=[idMatches(/.*nav.back|.*back.button/),descMatches(/关闭|返回/),textMatches(/关闭|返回/)],e9=0x14,ea=e9,gR=()=>{back(),back(),eb&&(sleep(0xc8),back());};for(;e9--;){let e9=!0x1;for(let ea=0x0,gR=e8['length'];eac['_'](['shell()关闭'+gD['surround']('\x22')+'成功','关闭用时:\x20'+eg+'毫秒']),'else':()=>c['e'](['关闭'+gD['surround']('\x22')+'失败','关闭时间已达最大超时'],0x1)});},'killProcess'(e8){let e9={'parseArgs'(){this['options']=e8||{},this['pid']=this['options']['pid']>0x0?this['options']['pid']:ee['myPid']();},'parseTask'(){let e8=this['pending_task'];if('object'==typeof e8)return e8;if('string'==typeof e8&&e8['match'](/^current(.*\d+s)?$/i)){let ea=e8['match'](/\d+/);return{'path':engines['myEngine']()['getSource'](),'date':Date['now']()+0x3e8*(ea?ea[0x0]:0x5),'isAsync':e9['options']['isAsync']};}throw Error('Cannot\x20parse\x20pending_task\x20for\x20appx.killProcess()');},'addTask'(){if(this['pending_task']=this['options']['pending_task'])return l['addDisposableTask'](Object['assign'](this['parseTask'](),{'callback'(){e9['killNow']();}})),!0x0;},'killNow'(){ee['killProcess'](this['pid']);},'kill'(){this['parseArgs'](),this['addTask']()||this['killNow']();}};e9['kill']();},'restart'(e8,e9){let ea=e8||currentPackage(),h4=e9||{};return this['kill'](ea,h4['kill'])&&this['launch'](ea,h4['launch']);},'hasRoot'(){try{return 0x0===shell('date',!0x0)['code'];}catch(h5){return!0x1;}},'hasSecure'(){return this['checkPermission']('WRITE_SECURE_SETTINGS');},'checkPermission'(e8){if(void 0x0===e8)throw Error('Argument\x20permission\x20must\x20be\x20specified');if('string'!=typeof e8)throw Error('Argument\x20permission\x20must\x20be\x20string\x20type');let e9=ed['permission'][e8['replace'](/[^A-Z_]+/g,'')];return context['checkCallingOrSelfPermission'](e9)===ej['PERMISSION_GRANTED'];},'canWriteSystem':()=>eh['canWrite'](context),'getInstalledApplications'(e8){let e9=e8||{},ea=e8=>{let hb=e8=>'string'==typeof e8?[e8]:e8||[],hc=hb(e9['include']),hd=hb(e9['exclude']);return(ea=hc['length']?e8=>(hc['includes'](e8['pkg_name'])||hc['includes'](e8['app_name']))&&!hd['includes'](e8['pkg_name'])&&!hd['includes'](e8['app_name']):e8=>!hd['includes'](e8['pkg_name'])&&!hd['includes'](e8['app_name']))(e8);},hb=e8=>'function'==typeof e9[e8]?e9[e8]():e9[e8],hc=context['getPackageManager'](),hd=hc['getInstalledApplications'](0x0)['toArray']()['map'](e8=>({'app_name':e8['loadLabel'](hc),'pkg_name':e8['packageName'],'is_enabled':e8['enabled'],'is_system':this['isSystemApp'](e8)}))['filter'](ea),he=hb('is_system');'boolean'==typeof he&&(hd=hd['filter'](e8=>e8['is_system']===he));let hq=hb('is_enabled');return'boolean'==typeof hq&&(hd=hd['filter'](e8=>e8['is_enabled']===hq)),Object['assign'](hd,{'getAppNames'(){return this['map'](e8=>e8['app_name']);},'getPkgNames'(){return this['map'](e8=>e8['pkg_name']);},'getJointStrArr'(e8,e9){return this['map'](ea=>e9?ea['pkg_name']+(e8||'\x0a')+ea['app_name']:ea['app_name']+(e8||'\x0a')+ea['pkg_name'])['sort']();}});},'createShortcut'(e8){if(!e8)throw Error('File\x20is\x20required\x20for\x20appx.createShortcut()');let e9=files['path'](e8);if(!files['isFile'](e9))throw Error('File\x20argument\x20must\x20be\x20a\x20file');if(!files['exists'](e9))throw Error('File\x20is\x20not\x20existed');let ea=new en()['getClass'](),hA=en['EXTRA_FILE'],hB=new el(e9),hC=new ef(context,ea)['putExtra'](hA,hB);this['startActivity'](hC);},'isSystemApp'(e8){if(!(e8 instanceof ei))throw Error('Source\x20must\x20be\x20the\x20instance\x20of\x20ApplicationInfo');return 0x0!=(e8['flags']&ei['FLAG_SYSTEM']);},'getMemoryInfo'(){let e8=context['getSystemService'](eg['ACTIVITY_SERVICE']),e9=new ek['MemoryInfo']();e8['getMemoryInfo'](e9);let {totalMem:ea,availMem:i,lowMemory:n}=e9,hG=ea-i,hH=hG/ea,hI=i/ea;return{'$memory_info':e9,'total':ea,'is_low':n,'avail':i,'avail_usage':hI,'avail_pct':eo['toPct'](hI),'used':hG,'used_usage':hH,'used_pct':eo['toPct'](hH)};},'getProcessMemoryInfo'(e8){let e9=ec['getRuntime']()['maxMemory'](),ea='number'==typeof e8?e8:ee['myPid'](),hM=context['getSystemService'](eg['ACTIVITY_SERVICE'])['getProcessMemoryInfo']([ea])[0x0],hN=hM['getTotalPrivateDirty']()<<0xa,hO=hM['getTotalPss']()<<0xa,hP=hM['getMemoryStat']('summary.java-heap')<<0xa,hQ=hP/e9;return{'$process_memory_info':hM,'uss':hN,'pss':hO,'heap':hP,'heap_usage':hQ,'heap_pct':eo['toPct'](hQ)};},'getRuntimeMemoryInfo'(){let e8=ec['getRuntime'](),e9=e8['maxMemory'](),ea=e8['totalMemory'](),hU=ea-e8['freeMemory'](),hV=hU/e9;return{'total':ea,'max':e9,'heap':hU,'heap_usage':hV,'heap_pct':eo['toPct'](hV)};}};e8['exports']={'appx':ep};},203:hW=>{let hX=android['content']['res']['ColorStateList'],hY={'toStr'(hW,hX){'string'==typeof hW&&Number(hW)['toString']()===hW&&(hW=Number(hW));let hY='number'==typeof hW?colors['toString'](hW):hW;if('string'!=typeof hY)throw TypeError('Unknown\x20type\x20of\x20color\x20for\x20colorsx.toStr()');let i2=colors['alpha'](hY),i3=colors['red'](hY),i4=colors['green'](hY),i5=colors['blue'](hY);if(void 0x0===hX||!0x0===hX||'keep'===hX||0x8===hX)return hY;if(!0x1===hX||'none'===hX||0x6===hX)return'#'+colors['toString'](colors['rgb'](i3,i4,i5))['slice'](-0x6);if('auto'===hX)return i2<0xff?hY:colors['toString'](colors['rgb'](i3,i4,i5));throw TypeError('Unknown\x20type\x20of\x20alpha\x20for\x20colorsx.toStr()');},'toInt'(hW){let hX;'string'==typeof hW&&Number(hW)['toString']()===hW&&(hW=Number(hW));try{hX='string'==typeof hW?colors['parseColor'](hW):hW;}catch(i8){throw console['error']('Passed\x20color:\x20'+hW),Error(i8+'\x0a'+i8['stack']);}if('number'!=typeof hX)throw TypeError('Unknown\x20type\x20of\x20color\x20for\x20colorsx.toInt()');return hX;},'rgba'(hW){if('string'!=typeof hW)throw Error('Param\x20rgba_hex\x20must\x20be\x20a\x20string\x20type');if('#'!==hW[0x0])throw Error('Param\x20rgba_hex\x20must\x20started\x20with\x20hash\x20symbol');if(0x7===(hW=hW['trim']()['toUpperCase']())['length']&&(hW+='FF'),0x9!==hW['length'])throw Error('Length\x20of\x20param\x20rgba_hex\x20must\x20be\x207\x20or\x209');return this['toInt']('#'+hW['slice'](-0x2)+hW['slice'](0x1,-0x2));},'toColorStateList'(hW){return hX['valueOf'](this['toInt'](hW));}};hW['exports']={'colorsx':hY};},725:(ib,ic,ie)=>{let {isObjectSpecies:i,$$toast:n}=ie(0x2c4),ig={'StateManager':function(){let ib=function(ib){this['state']=ib,this['last_state']=ib;};return ib['prototype']={'switchOn'(){this['last_state']=this['state'],this['state']=!0x0;},'switchOff'(){this['last_state']=this['state'],this['state']=!0x1;},'switchGet'(){return this['state'];},'switchSet'(ib){this['last_state']=this['state'],this['state']=i(ib)?ib['isDebug']:ib;},'switchBack'(){let ib=this['state'];this['state']=this['last_state'],this['last_state']=ib;},'enable'(){this['switchOn']();},'disable'(){this['switchOff']();},'isEnabled'(){return!0x0===this['switchGet']();}},ib;}(),'DebugConstructor'(ib,ic){let ie=function(ib,ic,it,iu){return{'parseMsgLevel'(){this['message_level']=void 0x0===ic?0x0:ic,this['is_high_level']=0x3===ic||'w'===ic||'warn'===ic||0x4===ic||'e'===ic||'error'===ic||0x8===ic||'x'===ic||0x9===ic||'r'===ic;},'trigger':()=>ie['switchGet'](),'print'(){ig['print'](ib,this['message_level'],0x0,it,iu,{'msg_prefix':'»','indent_symbol':'-\x20','indent_repeat':'whole','indent_trailing_space':!0x1});},'getResult'(){return this['trigger']()&&(this['parseMsgLevel'](),this['print']()),!this['is_high_level'];}}['getResult']();};return ig['StateManager']['call'](ie,ib),Object['assign'](ie,ig['StateManager']['prototype'],{'switchGet'(){let ib=ie['state'];if('boolean'==typeof ib)return ib;if(void 0x0!==ie['depot']){let ib=ie['depot']['state'];if('boolean'==typeof ib)return ib;}return'boolean'==typeof ig['debug']['state']?ig['debug']['state']:'object'==typeof global['consolex']?global['consolex']['debug']['state']:void 0x0;}}),Object['assign'](ie,{'depot':ic,'fuel'(ib){let ic=i(ib)?ib['isDebug']:ib;return new ig['DebugConstructor'](ic,ie);},'border'(ib,ic,iB){ie['isEnabled']()&&ig['border'](ib,void 0x0===ic?0x0:ic,iB);},'__'(ib,ic,ie){this['border']['apply'](this,arguments);}}),ie;},'setGlobalLogConfig'(ib){context['getPackageName']()['match'](/Pro\b/i)&&delete ib['filePattern'],console['setGlobalLogConfig'](ib);},'printBorder'(ib,ic,ie){this['border']['apply'](this,arguments);},'debugBorder'(ib,ic,ie){this['debug']['border']['apply'](this,arguments);},'$print'(){let ib={'last_border':{'save'(ib,ic){this['style']=ib,this['level']=ic;},'clear'(){delete this['style'],delete this['level'];},'match'(ib,ic){return ib&&ib===this['style']&&ic===this['level'];}}};return this['$']=this['print']=function(ic,ie,iT,iU,iV,iW){if(ic instanceof Error)return this['print'](ic['message']+'\x0a\x0a'+ic['stack']['replace'](/\s+.+?\n/g,'->$&'),ie,iT,iU,iV,iW);let iX={'trigger':()=>ig['print']['isEnabled'](),'parseBorder'(){let ib=Number(iV)||0x0,ic=String(void 0x0===iV?'':iV),ie=ic['match'](/[_\d]n(\d*)$/);this['border_line_break']=null!==ie?Number(ie[0x1]||0x1):0x0,ic['match'](/dash\/|-0\.5/)||-0.5===ib?this['border_line_before']='dash':ic['match'](/^(\/?dash|0\.5)(_?n\d*)?$/)||0.5===ib?this['border_line_after']='dash':ic['match'](/solid\/|-1/)||-0x1===ib?this['border_line_before']='solid':ic['match'](/^(\/?solid|1)(_?n\d*)?$/)||0x1===ib?this['border_line_after']='solid':ic['match'](/^(solid\/dash|-1\.5)(_?n\d*)?$/)||-1.5===ib?(this['border_line_before']='solid',this['border_line_after']='dash'):ic['match'](/^(dash\/solid|1\.5)(_?n\d*)?$/)||1.5===ib?(this['border_line_before']='dash',this['border_line_after']='solid'):ic['match'](/^(dashes|dash\/dash|-2)(_?n\d*)?$/)||-0x2===ib?(this['border_line_before']='dash',this['border_line_after']='dash'):(ic['match'](/^(solids|solid\/solid|2)(_?n\d*)?$/)||0x2===ib)&&(this['border_line_before']='solid',this['border_line_after']='solid');},'parseMsgLevel'(){switch(ie){case null:this['no_msg_level']=!0x0;break;case 0x0:case'v':case'verbose':this['fn']=console['verbose']['bind'](console);break;case void 0x0:case 0x1:case'l':case'd':case'log':this['fn']=console['log']['bind'](console);break;case 0x2:case'i':case'info':this['fn']=console['info']['bind'](console);break;case 0x3:case'w':case'warn':this['fn']=console['warn']['bind'](console),this['is_high_level']=!0x0;break;case 0x4:case'e':case'error':this['fn']=console['error']['bind'](console),this['is_high_level']=!0x0;break;case 0x8:case'x':this['fn']=console['error']['bind'](console),this['should_exit']=!0x0,this['is_high_level']=!0x0;break;case 0x9:case'r':this['fn']=console['error']['bind'](console),this['show_ex_msg']=!0x0,this['should_exit']=!0x0,this['is_high_level']=!0x0;break;default:throw Error('Invalid\x20message\x20level\x20for\x20consolex.print():\x20'+ie);}},'parseIndent'(){this['indent']={'lv':Math['min'](Number(iU)||0x0,0xa),'trigger'(){return this['lv']>0x0&&!iX['no_msg_level'];},'getIndent'(){let ib=iX['options']['indent_symbol']||'->',ic=iX['options']['indent_repeat']||'first',ie=void 0x0===iX['options']['indent_trailing_space']||Boolean(iX['options']['indent_trailing_space'])?'\x20':'';switch(ic){case'first':return ib['slice'](0x0,0x1)['repeat'](this['lv'])+ib['slice'](0x1)+ie;case'last':return ib['slice'](0x0,-0x1)+ib['slice'](-0x1)['repeat'](this['lv'])+ie;default:return ib['repeat'](this['lv'])+ie;}},'getResult'(){return this['trigger']()?this['getIndent']():'';}}['getResult']();},'stringify':ib=>Array['isArray'](ib)?ib['join'](',\x20')['surround']('[\x20'):i(ib)?Object['keys'](ib)['map'](ic=>ic+':\x20'+ib[ic])['join'](',\x20')['surround']('{\x20'):ib&&'function'==typeof ib['toString']?ib['toString']():void 0x0===ib?String():String(ib),'parseArgs'(){this['options']=iW||{},this['parseBorder'](),this['parseMsgLevel'](),this['parseIndent'](),this['msg_body']=Array['isArray'](ic)?ic['map'](this['stringify']['bind'](this)):this['stringify'](ic),this['prefix']=void 0x0===this['options']['msg_prefix']?'':String(this['options']['msg_prefix']||'')+'\x20';},'toastIFN'(){let ib='function'==typeof n?n:toast,ic=Array['isArray'](this['msg_body'])?this['msg_body']['join']('\x0a'):this['msg_body'];switch(iT){case 0x2:case'l':case'long':return ib(ic,'l');case 0x3:case's/f':case'short/forcible':return ib(ic,'s','f');case 0x4:case'l/f':case'long/forcible':return ib(ic,'l','f');}iT&&ib(ic,'S');},'showBorderIFN'(){let {border_line_before:ic,border_line_after:i,border_line_break:n}=this,{border_prefix:iT}=this['options'],iU=(void 0x0===ie?0x1:Number(ie)||0x0)['clamp'](0x0,0x1),iV=[()=>{void 0x0===ic||this['no_msg_level']||ib['last_border']['match'](ic,iU)||ig['print']['border'](ic,iU,0x0,!0x1,iT);},()=>{void 0x0===i||this['no_msg_level']||(ig['print']['border'](i,iU,n,!0x0,iT),n&&ib['last_border']['clear']());}][Symbol['iterator']]();return(this['showBorderIFN']=()=>iV['next']()['value']())();},'showMessageIFN'(){this['no_msg_level']||(ib['last_border']['clear'](),Array['isArray'](this['msg_body'])?this['msg_body']['forEach'](this['showMsg']['bind'](this)):this['showMsg'](this['msg_body']));},'showMsg'(ib){this['fn'](this['prefix']+this['indent']+ib);},'getResult'(){return this['trigger']()&&(this['parseArgs'](),this['toastIFN'](),this['showBorderIFN'](),this['showMessageIFN'](),this['showBorderIFN'](),this['show_ex_msg']&&ig['print']('Forcibly\x20stopped',0x4,0x1),this['should_exit']&&exit()),!this['is_high_level'];}};return iX['getResult']();},Object['assign'](this['print'],new this['StateManager'](!0x0),this['StateManager']['prototype'],{'border'(ic,ie,jd,je,jf){let jg={'style':String(ic||'solid'),'level':(void 0x0===ie?0x1:Number(ie)||0x0)['clamp'](0x0,0x1),'break':'\x0a'['repeat'](Math['max'](Number(jd)||0x0,0x0)),'prefix':void 0x0===jf?'':String(jf)+'\x20','trigger'(){return ig['print']['isEnabled']()&&!ib['last_border']['match'](this['style'],this['level']);},'saveStateIFN'(){je&&!this['break']&&ib['last_border']['save'](this['style'],this['level']);},'printIFN'(){let ib=this['style']['match'](/dash/)?this['prefix']+'-\x20'['repeat'](0x11)['trim']():this['prefix']+'-'['repeat'](0x21);this['level']?console['log'](ib+this['break']):console['verbose'](ib+this['break']);}};jg['trigger']()&&(jg['saveStateIFN'](),jg['printIFN']());}}),this['__']=this['border']=function(ib,ic,ie){this['print']['border'](ib,ic,ie,!0x0);},this['v']=this['verbose']=(ib,ic,ie,jo)=>this['$'](ib,0x0,ic,ie,jo),this['d']=this['log']=(ib,ic,ie,js)=>this['$'](ib,0x1,ic,ie,js),this['i']=this['info']=(ib,ic,ie,jw)=>this['$'](ib,0x2,ic,ie,jw),this['w']=this['warn']=(ib,ic,ie,jA)=>this['$'](ib,0x3,ic,ie,jA),this['e']=this['error']=(ib,ic,ie,jE)=>this['$'](ib,0x4,ic,ie,jE),delete this['$print'],this;},'$debug'(){return this['_']=this['debug']=new this['DebugConstructor'](void 0x0),delete this['$debug'],this;},'$bind'(){return this['$print']()['$debug'](),delete this['$bind'],this;}};ig['$bind'](),ib['exports']={'consolex':ig};},190:(jF,jG,jH)=>{let {isNullish:i}=jH(0x2c4),{filesx:n}=jH(0x2fb),jI=java['io']['File'],jJ=java['util']['zip']['CRC32'],jK=android['util']['Base64'],jL=javax['crypto']['Cipher'],jM=javax['crypto']['spec']['SecretKeySpec'],jN=java['security']['KeyFactory'],jO=java['security']['MessageDigest'],jP=java['security']['KeyPairGenerator'],jQ=java['security']['spec']['X509EncodedKeySpec'],jR=java['security']['spec']['PKCS8EncodedKeySpec'],jS=javax['crypto']['CipherOutputStream'],jT=java['io']['FileInputStream'],jU=java['io']['FileOutputStream'],jV=java['io']['ByteArrayOutputStream'],jW=function(){let jF=function(jF,jG){let jH=jG||{};this['keyPair']=jH['keyPair'],delete jH['keyPair'];let k2=new java['io']['ByteArrayOutputStream']();jX['_input'](jF,jH,(jF,jG,jH)=>{k2['write'](jF,jG,jH);}),this['data']=k2['toByteArray']();};return jF['prototype']['toKeySpec']=function(jF){let jG=String(jF)['replace'](/^(.+?)(?=\/).*$/,'$1');if('RSA'===jG){if('public'===this['keyPair'])return jN['getInstance'](jG)['generatePublic'](new jQ(this['data']));if('private'===this['keyPair'])return jN['getInstance'](jG)['generatePrivate'](new jR(this['data']));throw Error('Property\x20keyPair\x20must\x20be\x20either\x20public\x20or\x20private');}return new jM(this['data'],jG);},jF['prototype']['toString']=function(){let jF=jK['encodeToString'](this['data'],jK['NO_WRAP']);return this['keyPair']?'Key['+this['keyPair']+']{data=\x27'+jF+'\x27}':'Key{data=\x27'+jF+'\x27}';},jF;}(),jX={'_pwmap':new Function('return\x20{_dec(e,l){let\x20i=e.split(/,\x20?/).map(e=>e.replace(/^\x22([^]+)\x22$/g,\x22$1\x22)),s=0,a=\x22\x22;for(var\x20r=\x22_.|._\x22;;){for(let\x20t=0;t0x0;)jH(kf,0x0,jG);}else{let jG=function(){return'base64'===kc['input']?jK['decode'](jF,jK['NO_WRAP']):'hex'===kc['input']?this['_fromHex'](jF):'string'==typeof jF?new java['lang']['String'](jF)['getBytes'](kc['encoding']||'utf-8'):jF;}['call'](this);jH(jG,0x0,jG['length']);}},'_output'(jF,jG,jH){let kk=jG['output']||jH;if('base64'===kk)return jK['encodeToString'](jF,jK['NO_WRAP']);if('bytes'===kk)return jF;let kl=jG['encoding']||'utf-8';return'string'===kk?new java['lang']['String'](jF,kl)['toString']():this['_toHex'](jF);},'_toHex':jF=>jF['map'](jF=>{let jG=java['lang']['Integer']['toHexString'](0xff&jF);return jG['length']%0x2?'0'+jG:jG;})['join']('')['toUpperCase'](),'_fromHex'(jF){let jG=util['java']['array']('byte',jF['length']/0x2);return String(jF)['match'](/\w{2}/g)['forEach']((jF,jH)=>{let kt=java['lang']['Integer']['valueOf'](jF,0x10);jG[jH]='number'==typeof kt?new java['lang']['Integer'](kt)['byteValue']():kt['byteValue']();}),jG;},'_cipher'(jF,jG,jH,kx,ky){let jI=ky||{},jJ=jL['getInstance'](kx);jJ['init'](jG,jH['toKeySpec'](kx));let jK=function(){if('file'===jI['output'])return delete jI['output'],void 0x0!==jI['dest'];}(),jM=jK?new jU(jI['dest']):new jV(),jN=new jS(jM,jJ),jO=null;try{this['_input'](jF,jI,(jF,jG,jH)=>{jN['write'](jF,jG,jH);});}catch(kI){jO=kI;}finally{try{jN['close']();}catch(kJ){}}if(!jK&&!jO)return this['_output'](jM['toByteArray'](),jI,'bytes');},'Key':jW,'KeyPair':function(jF,jG,jH){let kN=jH||{};this['publicKey']=new jW(jF,Object['assign'](kN,{'keyPair':'public'})),this['privateKey']=new jW(jG,Object['assign'](kN,{'keyPair':'private'}));},'digest'(jF,jG,jH){let kR=jH||{},kS='CRC32'===jG?new jJ():jO['getInstance'](jG);return this['_input'](jF,kR,(jF,jG,jH)=>{kS['update'](jF,jG,jH);}),'CRC32'===jG?kS['getValue']()['toString'](0x10)['toUpperCase']():this['_output'](kS['digest'](),kR,'hex');},'digestFile'(jF,jG,jH){let kZ=Object['assign'](jH||{},{'input':'file'});if('string'==typeof jF)return this['digest'](files['path'](jF),jG,kZ);if(jF instanceof jI)return this['digest'](jF,jG,kZ);throw TypeError('Invalid\x20type\x20of\x20path\x20for\x20cryptox.digestFile()');},'encrypt'(jF,jG,jH,l3){return this['_cipher'](jF,jL['ENCRYPT_MODE'],jG,jH,l3);},'decrypt'(jF,jG,jH,l7){return this['_cipher'](jF,jL['DECRYPT_MODE'],jG,jH,l7);},'generateKeyPair'(jF,jG){let jH=jP['getInstance'](jF);jH['initialize'](jG||0x100);let lb=jH['generateKeyPair']();return new this['KeyPair'](lb['getPublic']()['getEncoded'](),lb['getPrivate']()['getEncoded']());},'generateRandomKeyInput'(jF){let jG=jF||0x20;if(0x20!==jG&&0x10!==jG)throw Error('length\x20must\x20be\x20either\x2016\x20or\x2032');let jH='';for(let jF=0x0;jF<0x20;jF+=0x1)jH+=String['fromCharCode'](0x9fff*Math['random']());return String(this['digest'](jH,'MD5'))['slice'](-jF);},'_getKey'(jF){if(!jF)throw Error('Invalid\x20key\x20for\x20cryptox._getKey()');if(jF['length']%0x10==0x0&&jF['match'](/^[a-f0-9]+$/i))return new this['Key'](jF);let jG=n['.local']('key.nfex');files['exists'](jG)||files['createWithDirs'](jG);let jH=n['readJson'](jG);if(jH[jF])return new this['Key'](jH[jF]);let lj=jH[jF]=this['generateRandomKeyInput']();return n['writeJson'](jG,jH),new this['Key'](lj);},'enc'(jF,jG){return this['encrypt'](jF,this['_getKey'](jG),'AES/ECB/PKCS5Padding',{'output':'hex'});},'dec'(jF,jG){if(i(jF)||jF===String())return jF;let jH=null,lp=function(){try{return this['decrypt'](jF,this['_getKey'](jG),'AES/ECB/PKCS5Padding',{'output':'string','input':'hex'});}catch(lq){jH=lq;}}['call'](this);if(!i(lp))return lp;let jI=this['_pwmap']['decrypt'](jF);if(!i(jI))return jI;throw Error(null!==jH?jH:'Decrypted\x20failed');}};jF['exports']={'cryptox':jX};},415:(ls,lu,lw)=>{let {$$impeded:i,$$toast:n,$$cvt:s,$$link:o,isNullish:a,$$str:l,$$und:c,$$nul:u,$$arr:p,$$num:h,$$rex:_,$$func:d}=lw(0x2c4),{timersx:g}=lw(0x357),{consolex:f}=lw(0x2d5),{a11yx:m,$$sel:y}=lw(0x2d4),lx=android['provider']['Settings'],ly=lx['System'],lz=lx['Global'],lA=lx['Secure'],lB=java['io']['File'],lC=android['net']['Uri'],lD=android['view']['Surface'],lE=android['content']['Intent'],lF=android['content']['Context'],lG=android['content']['res']['Resources'],lH=android['content']['IntentFilter'],lI=android['os']['Environment'],lJ=android['os']['PowerManager'],lK=android['os']['BatteryManager'],lL=android['util']['DisplayMetrics'],lM=org['autojs']['autojs']['tool']['RootTool'],lN={'FLAGS_ON':lJ['SCREEN_BRIGHT_WAKE_LOCK']|lJ['ACQUIRE_CAUSES_WAKEUP'],'FLAGS_DIM':lJ['SCREEN_DIM_WAKE_LOCK']|lJ['ACQUIRE_CAUSES_WAKEUP'],get 'keycode$'(){return this['_keycode$']=this['_keycode$']||i['detach'](this['keycode'],0x1);},get 'power_service'(){return context['getSystemService'](lF['POWER_SERVICE']);},'screen_metrics':{'metrics':runtime['getScreenMetrics'](),'getInfo'(){return{'width':this['metrics']['rescaleX'](W),'height':this['metrics']['rescaleY'](H)};},'setRatio'(ls){this['setMetrics'](ls*W,ls*H);},'setMetrics'(ls,lu){let lw=ls<=0x0?W:ls<0x1?W*ls:ls,lS=lu<=0x0?H:lu<0x1?H*lu:lu;runtime['setScreenMetrics'](lw,lS);},'getRatio'(){return{'width':this['metrics']['rescaleX'](W)/W,'height':this['metrics']['rescaleY'](H)/H};},'reset'(){this['setRatio'](0x0);},'saveState'(){let ls=this['getInfo']();this['_screen_metrics_w']=ls['width'],this['_screen_metrics_h']=ls['height'];},'loadState'(){let ls=this['_screen_metrics_w'],lu=this['_screen_metrics_h'];if(void 0x0===ls||void 0x0===lu)throw Error('State\x20must\x20be\x20saved\x20before\x20loading');this['setMetrics'](ls,lu),delete this['_screen_metrics_w'],delete this['_screen_metrics_h'];}},'battery':{'_getStatusIntent':()=>context['registerReceiver'](null,new lH(lE['ACTION_BATTERY_CHANGED'])),'_getStatus'(ls,lu,lw){let lZ=ls=>void 0x0===lw?ls:lw,m0=this['_getStatusIntent'](),m1=lK['EXTRA_'+ls];switch(lu){case'Boolean':return m0['getBooleanExtra'](m1,lZ(!0x1));case'Byte':return m0['getByteExtra'](m1,lZ(-0x1));case'Char':return m0['getCharExtra'](m1,lZ(''));case'Double':return m0['getDoubleExtra'](m1,lZ(-0x1));case'Float':return m0['getFloatExtra'](m1,lZ(-0x1));case'Long':return m0['getLongExtra'](m1,lZ(-0x1));case'Short':return m0['getShortExtra'](m1,lZ(-0x1));case'String':return m0['getStringExtra'](m1);default:return m0['getIntExtra'](m1,lZ(-0x1));}},'_checkNumRange'(ls,lu,lw,m6,m7){let m8=(ls,lu)=>void 0x0===ls||isNaN(Number(ls))?lu:Number(ls);return ls>=m8(lu,lw||-0x1/0x0)&&ls<=m8(m6,m7||0x1/0x0);},'getPercentage'(){let ls=this['_getStatusIntent']();return 0x64*ls['getIntExtra'](lK['EXTRA_LEVEL'],-0x1)/ls['getIntExtra'](lK['EXTRA_SCALE'],-0x1);},'checkPercentage'(ls){return this['_checkNumRange'](this['getPercentage'](),ls,0xf);},'isBatteryLow'(){return device['sdkInt']<0x1c?!this['checkPercentage'](0xf):this['_getStatus']('BATTERY_LOW','Boolean',!0x1);},'getTemperature'(ls){let lu=this['_getStatus']('TEMPERATURE')/0xa,lw=ls||{};return{get 'C'(){let ls=mj(lw['unit'],'°C');return null===ls?lu:lu+ls;},get 'F'(){let ls=mj(lw['unit'],'°F'),mi=Number((0x9*lu/0x5+0x20)['toFixed'](0x1));return null===ls?mi:mi+ls;}}['C'===(lw['format']||'C')['toUpperCase']()['slice'](0x0,0x1)?'C':'F'];function mj(ls,lu){return!0x0===ls?lu:'string'==typeof ls?ls:null;}},'getTemperatureString'(){return this['getTemperature']()+'°C';},'checkTemperature'(ls,lu){return this['_checkNumRange'](this['getTemperature'](),ls,-0xf,lu,0x29);},'isOverheating'(){return this['getHealth']()===lK['BATTERY_HEALTH_OVERHEAT'];},'isOvercooling'(){return this['getHealth']()===lK['BATTERY_HEALTH_COLD'];},'getHealth'(){return this['_getStatus']('HEALTH',lK['BATTERY_HEALTH_UNKNOWN']);},'getHealthDescription'(ls){return'detailed'===ls||void 0x0===ls?{1:'状态未知',2:'状态良好',3:'温度过高',4:'已损坏',5:'电压过高',6:'状态未指明',7:'温度过低'}[this['getHealth']()]:{1:'未知',2:'良好',3:'过热',4:'损坏',5:'电压过高',6:'未指明',7:'过冷'}[this['getHealth']()];},'isHealthy'(){return this['getHealth']()===lK['BATTERY_HEALTH_GOOD'];},'isCharging'(){return this['_getStatus']('STATUS')===lK['BATTERY_STATUS_CHARGING']||this['isCharged']();},'isCharged'(){return this['_getStatus']('STATUS')===lK['BATTERY_STATUS_FULL'];},'isAcPlugged'(){return this['_getStatus']('PLUGGED')===lK['BATTERY_PLUGGED_AC'];},'isUsbPlugged'(){return this['_getStatus']('PLUGGED')===lK['BATTERY_PLUGGED_USB'];},'isWirelessPlugged'(){return this['_getStatus']('PLUGGED')===lK['BATTERY_PLUGGED_WIRELESS'];},'isPlugged'(){return this['isAcPlugged']()||this['isUsbPlugged']()||this['isWirelessPlugged']();},'isPluggedAndStayingOn'(){let ls=lN['stay_on_while_plugged_in']['get'](),lu=lu=>(lu&ls)===lu;return this['isAcPlugged']()&&lu(lK['BATTERY_PLUGGED_AC'])||this['isUsbPlugged']()&&lu(lK['BATTERY_PLUGGED_USB'])||this['isWirelessPlugged']()&&lu(lK['BATTERY_PLUGGED_WIRELESS']);},'isIgnoringOptimizations':ls=>lN['power_service']['isIgnoringBatteryOptimizations'](ls||context['getPackageName']()),'requestIgnoreOptimizations'(ls,lu){try{if(!lu&&this['isIgnoringOptimizations']())return!0x0;let lw=new lE()['setAction'](lx['ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS'])['setData'](lC['parse']('package:'+(ls||context['getPackageName']())));return app['startActivity'](lw),this['isIgnoringOptimizations']();}catch(mx){return console['warn'](mx['message']),!0x1;}}},'accelerometer_rotation':new tI('System','ACCELEROMETER_ROTATION','Int',[0x0,0x1]),'user_rotation':new tI('System','USER_ROTATION','Int',[lD['ROTATION_0'],lD['ROTATION_90'],lD['ROTATION_180'],lD['ROTATION_270']]),'screen_off_timeout':new tI('System','SCREEN_OFF_TIMEOUT','Int'),'stay_on_while_plugged_in':new tI('Global','STAY_ON_WHILE_PLUGGED_IN','Int',function(){let ls=lK['BATTERY_PLUGGED_AC'],lu=lK['BATTERY_PLUGGED_USB'],lw=lK['BATTERY_PLUGGED_WIRELESS'];return[0x0,ls,lu,lw,ls|lu,ls|lw,lu|lw,ls|lu|lw];}()),'development_settings_enabled':new tI('Global','DEVELOPMENT_SETTINGS_ENABLED','Int',[0x0,0x1]),'user_dir':new lB(lI['getDataDirectory'](),'user'),'wakeUp'(ls){let lu=context['getSystemService'](lF['POWER_SERVICE'])['newWakeLock'](lJ['FULL_WAKE_LOCK']|lJ['ACQUIRE_CAUSES_WAKEUP']|lJ['ON_AFTER_RELEASE'],'bright'),lw=ls||0x3a98;lu['acquire'](lw);let mE=Date['now'](),mF=setInterval(()=>{(this['isScreenOn']()||Date['now']()-mE-0xf0>lw)&&(clearInterval(mF),null!==lu&&lu['isHeld']()&&lu['release']());},0xc8);},'wakeUpWithBuffer'(ls){let lu=this['isScreenOn']['bind'](this);if(!lu()){let lw=0x2328,mJ=(ls||lw)/0x5dc;for(;this['wakeUp'](),!m['wait$'](lu,0x5dc,0x78);)if(--mJ<=0x0)return!0x1;}return!0x0;},'screenOn'(ls){return this['wakeUp'](ls);},'isScreenOn'(){let ls=this['power_service'];return(ls['isInteractive']||ls['isScreenOn'])['call'](ls);},'keepOn'(ls){let lu=ls||0x5;lu*=lu<0x64?0xea60:0x1,device['keepScreenOn'](lu),f['_']('已设置屏幕常亮显示'),f['_']('最大超时时间:\x20'+(lu/0xea60)['toFixedNum'](0x2)+'分钟');},'keepDim'(ls){let lu=ls||0x5;lu*=lu<0x64?0xea60:0x1,device['keepScreenDim'](lu),f['_']('已设置屏幕常暗显示'),f['_']('最大超时时间:\x20'+(lu/0xea60)['toFixedNum'](0x2)+'分钟');},'cancelOn'(){device['cancelKeepingAwake'](),f['_']('屏幕常亮显示已取消');},'cancelDim'(){device['cancelKeepingAwake'](),f['_']('屏幕常暗显示已取消');},'screenOff'(ls){if('boolean'==typeof ls)return this['screenOff']({'isDebug':ls});let lu=ls||{},lw=lu['key_code']||{},mT=lu['provider']||{},mU={},mV=this;f['debug']['switchSet'](lu['isDebug']);let mW={'key_code':{'failed':()=>f['w'](['关屏策略执行失败','按键模拟失败'],0x0,0x0,-0x2),'bugModel':()=>f['_'](['跳过当前策略','设备不支持KeyCode方法','设备型号:\x20'+device['brand']])},'successWithElapsedTime'(ls){f['_'](['策略执行成功','用时:\x20'+ls]);},'noWriteSettingsPermission'(){let ls=files['path']('./tools/auto.js-write-settings-permission-helper.js'),lu='需要\x22修改系统设置\x22权限';f['w'](['关屏策略执行失败',lu,'可使用以下工具获得帮助支持',ls],0x0,0x0,-0x2),n('关闭屏幕失败\x0a'+lu,'long');},'noWriteSecureSettingsPermission'(){let ls='WRITE_SECURE_SETTINGS';f['w'](['无法完成屏幕关闭操作','需要以下必要权限:',ls,'权限的详细信息及获取方式','可参阅项目配置工具','->\x20运行与安全','->\x20自动开启无障碍服务'],0x0,0x0,-0x2),n('关闭屏幕失败\x0a缺少以下必要权限:\x0a'+ls,'long');},'toastWithDebugInfo'(ls){let lu=[];[]['slice']['call'](arguments)['forEach'](ls=>{Array['isArray'](ls)?lu=lu['concat'](ls):'string'==typeof ls?lu['push'](ls):Object['prototype']['toString']['call'](ls)['match']('Arguments')&&(lu=lu['concat']([]['slice']['call'](ls)));}),f['v'](lu,0x4,0x0,-0x2);}};return f['_']('尝试关闭屏幕'),function(ls){try{mU['brake_is_triggered']?f['_']('关闭屏幕操作已被中断'):ls?f['_']('关闭屏幕成功'):f['_']('关闭屏幕失败',0x3);}catch(n5){if(!n5['message']['match'](/InterruptedException/))throw n5;}return f['debug']['switchBack'](),ls;}(function(){if(!lw['is_disabled']&&function(){try{return 0x0===shell('date',!0x0)['code'];}catch(n6){return!0x1;}}())if(f['_']('尝试策略:\x20模拟电源按键'),[/[Mm]eizu/]['some'](ls=>device['brand']['match'](ls)))mW['key_code']['bugModel']();else{if(function(){let ls=lw['hint'];'function'==typeof ls?ls['call'](null):!0x0!==ls&&'toast'!==ls||n('正在尝试关闭屏幕...\x0a此过程可能需要几秒钟...','long');}(),g['rec']['save']('scr_off_tt'),lN['keycode']('KEYCODE_POWER',{'no_failed_msg':!0x0})){let ls=s['time'](g['rec']('scr_off_tt'),'$zh');return mW['successWithElapsedTime'](ls),!0x0;}mW['key_code']['failed']();}}()||function(){if(mT['is_disabled'])return;f['_']('尝试策略:\x20修改系统设置参数');let ls=!0x1;return ly['canWrite'](context)?mV['battery']['isPluggedAndStayingOn']()&&!(context['checkCallingOrSelfPermission'](android['Manifest']['permission']['WRITE_SECURE_SETTINGS'])===android['content']['pm']['PackageManager']['PERMISSION_GRANTED']?mU['staying_on_state_matters']=!0x0:void 0x0)?(mW['noWriteSecureSettingsPermission'](),ls):(o(function(){g['rec']['save']('set_provider');let ls=mT['hint'];'function'==typeof ls?ls['call'](null):!0x0!==ls&&'toast'!==ls||n(['正在尝试关闭屏幕...','此过程可能需要几秒钟...\x0a','触摸屏幕任意区域','或按下任意按键可终止关屏']['join']('\x0a'),'Long');})['$'](ng)['$'](function(){'function'==typeof mT['listener']&&mT['listener'](ne);})['$'](function(){for(;!mU['brake_is_triggered'];){let lu=g['rec']('set_provider'),lw=s['time'](lu,'$zh');if(lu>0xd7be){f['w'](['关屏策略执行失败','屏幕关闭超时','耗时:\x20'+lw],0x2,0x0,-0x2);break;}if(!mV['isScreenOn']()){mW['successWithElapsedTime'](lw),ls=!0x0;break;}sleep(0xc8);}})['$'](nh),ls):(mW['noWriteSettingsPermission'](),ls);}());function ne(ls){mU['brake_is_triggered']=!0x0,nh(),mW['toastWithDebugInfo'](arguments);}function ng(){f['_']('备份并设置相关参数:'),mV['stay_on_while_plugged_in']['clearStorage'](),mV['screen_off_timeout']['saveIntoStorage'](),mV['screen_off_timeout']['put'](0x0),mU['staying_on_state_matters']&&(mV['stay_on_while_plugged_in']['saveIntoStorage'](),mV['stay_on_while_plugged_in']['put'](0x0));}function nh(){mU['is_settings_restored']||(f['_']('恢复修改前的设置参数:'),mV['screen_off_timeout']['loadFromStorageIFN'](),mV['stay_on_while_plugged_in']['loadFromStorageIFN'](),mU['is_settings_restored']=!0x0);}},'isScreenOff'(){return!this['isScreenOn']();},'isLocked':()=>context['getSystemService'](lF['KEYGUARD_SERVICE'])['isKeyguardLocked'](),'isUnlocked'(){return!this['isLocked']();},'unlock':ls=>function(){let ls='com\x5c.android\x5c.systemui:id/',lu='com\x5c.android\x5c.keyguard:id/',nl='com\x5c.smartisanos\x5c.keyguard:id/',{storagesx:n}=lw(0xdc),nm={},nn={'p_container':{'trigger'(){return lE(),[{'desc':'QQ锁屏消息弹框控件','trigger':()=>y['pickup']('按住录音')||y['pickup'](idMatches(/com.tencent.mobileqq:id.+/)),'handle'(){m['click$'](y['pickup']('关闭'),'w'),m['wait$'](this['trigger']['bind'](this),0xbb8)?f['_']('关闭弹框控件成功'):f['_']('关闭弹框控件超时',0x3);}},{'desc':'闹钟应用前置','trigger'(){let ls=currentPackage();return['com\x5c.android\x5c.deskclock','com\x5c.alarmclock\x5c.xtreme.*']['some'](lu=>new RegExp(lu)['test'](ls));},'handle'(){m['wait$'](()=>!this['trigger'](),0x1d4c0)?f['_']('闹钟应用解除前置成功'):f['_']('闹钟应用解除前置超时',0x3);}}]['forEach'](ls=>{ls['trigger']()&&(f['_'](['检测到提示层页面干扰:',ls['desc']]),ls['handle']());}),function(){let ls=np['unlockDismissLayerStrategy'];if('preferred'===ls)return!0x0;if('disabled'===ls)return nm['unlock_dismiss_layer_disabled_hinted']||(f['_']('解锁页面提示层检测已禁用'),nm['unlock_dismiss_layer_disabled_hinted']=!0x0),!0x1;if('deferred'===ls)return!!nm['unlock_dismiss_layer_deferred']||(f['_']('解锁页面提示层检测延迟一次'),nm['unlock_dismiss_layer_deferred']=!0x0,!0x1);throw Error('Unknown\x20unlock\x20dismiss\x20layer\x20strategy:\x20'+ls);}()&&[{'desc':'通用','sel':idMatches(ls+'preview_container')},{'desc':'EMUI','sel':idMatches(ls+'.*(keyguard|lock)_indication.*')},{'desc':'锤子科技','sel':idMatches(nl+'keyguard_(content|.*view)')},{'desc':'MIUI','sel':idMatches(lu+'(.*unlock_screen.*|.*notification_.*(container|view).*|dot_digital)')},{'desc':'MIUI10','sel':idMatches(ls+'(.*lock_screen_container|notification_(container|panel).*|keyguard_.*)')},{'sel':y['pickup'](/上滑.{0,4}解锁/,'selector')}]['some'](ls=>{let {desc:lu,sel:lw}=ls;if(lw instanceof com['stardust']['autojs']['core']['accessibility']['UiSelector']&&lw['exists']())return lu?f['_']('匹配到'+lu+'解锁提示层控件'):(f['_']('匹配到解锁提示层文字:'),f['_'](y['pickup'](lw,'txt'))),(this['trigger']=lw['exists']['bind'](lw))();});},'dismiss'(){let ls=this,lu=np['unlockDismissLayerBottom'],lw=np['unlockDismissLayerTop'],nl=np['unlockDismissLayerSwipeDuration'],nF=!!nl,nm=[lu,lw],nn=nl,nI=np['swipe_time_reliable']||[],nJ=0x3,nK=np['continuous_swipe']||{};return nI['includes'](nn)&&(nJ=0x1/0x0,f['_']('当前滑动时长参数可信')),nn in nK||(f['_']('连续成功滑动累积器清零'),nK={},nK[nn]=0x0),function(){let lu=[nn]['concat'](nm['map'](ls=>[halfW,cY(ls)])),lw=0x0;for(lN['keepOn'](0x3);!nl()&&(lC('消除解锁页面提示层',lw,0x1e),f['_']('滑动时长:\x20'+nn+'毫秒'),f['_']('参数来源:\x20'+(nF?'本地存储':'自动计算')),gesture['apply'](null,lu),!ls['succ']());)if(f['_']('单次消除解锁页面提示层超时'),lw+=0x1,nF)--nJ<0x0?(nF=!0x1,nn=np['unlockDismissLayerSwipeDuration'],f['_']('放弃本地存储数据'),f['_']('从默认值模块获取默认值:\x20'+nn)):f['_']('继续使用本地存储数据');else{let ls=nn<0x78?0x5:0x32;nn+=ls,f['_']('参数增量:\x20'+ls);}function nl(){let ls=lw>0x1e;return ls&&(nK[nn]=0x0,no['put']('config',{'continuous_swipe':nK}),lD('消除解锁页面提示层失败')),ls;}lN['cancelOn'](),f['_']('解锁页面提示层消除成功'),ls['succ_fg']=!0x0;}(),function(){nn!==nl&&(no['put']('config',{'unlockDismissLayerSwipeDuration':nn}),f['_']('存储滑动时长参数:\x20'+nn)),nn in nK||(nK[nn]=0x0);let ls=++nK[nn];no['put']('config',{'continuous_swipe':nK}),f['_']('存储连续成功滑动次数:\x20'+ls),ls>=0x6&&!nI['includes'](nn)&&(f['_']('当前滑动时长可信度已达标'),f['_']('存储可信滑动时长数据:\x20'+nn),no['put']('config',{'swipe_time_reliable':nI['concat'](nn)}));}(),this['succ_fg'];},'handle'(){return this['succ_fg']||!this['trigger']()||this['dismiss']();},'succ'(){return m['wait$'](function(){return!this['trigger']();}['bind'](this),0x5dc)||nn['unlock_view']['trigger']();}},'unlock_view':{'trigger'(){let lw=this;if(lN['isScreenOn']())return function(){return[{'desc':'通用','sel':idMatches(ls+'lockPatternView')},{'desc':'MIUI','sel':idMatches(lu+'lockPattern(View)?')}]['some'](ls=>{if(ls['sel']['exists']())return f['_']('匹配到'+ls['desc']+'图案解锁控件'),re(ls['sel'],nl);});function nl(){let ls=np['unlockPatternStrategy'],lu={'segmental':'叠加路径','solid':'连续路径'},nl='unlock_pattern_swipe_time_'+ls,nY=np[nl],nm=!!nY,o0=0x3,o1=0x0,o2=Math['ceil'](0.6*lz);for(;!(o1>o2&&lD('图案解锁方案失败'));){lC('图案密码解锁',o1,o2),f['_']('滑动时长:\x20'+nY+'毫秒'),f['_']('滑动策略:\x20'+lu[ls]);let nn=of(),no={'segmental'(){let ls=[],lu=nn['length'];for(let lw=0x0;lw{let {left:lu,top:lw,right:nl,bottom:nY}=ls;return[lu,lw,nl,nY];},no=ls=>{[lu,lw,nl,nY]=nn(ls);};return m['wait$'](()=>{let ox=ls['findOnce']();if(ox)return nm=ox['bounds'](),c(lu)||c(lw)||c(nl)||c(nY)?no(nm):!!(ls=>{let [nm,no,ox,oC]=nn(ls);return lu===nm&&lw===no&&nl===ox&&nY===oC;})(nm)||void no(nm);},0x4b0,0x78),nm;}}(lw['sel']);if(!ls)return lD(['图案解锁方案失败','无法获取点阵布局']);let lu=lA,nl=Math['trunc'](ls['width']()/lu),nY=Math['trunc'](ls['height']()/lu),nm=ls['left']+Math['trunc'](nl/0x2),no=ls['top']+Math['trunc'](nY/0x2),o0=[];for(let ls=0x1;ls<=lu;ls+=0x1)for(let lw=0x1;lw<=lu;lw+=0x1)o0[(ls-0x1)*lu+lw]={'x':nm+(lw-0x1)*nl,'y':no+(ls-0x1)*nY};return l(lx)&&(lx=lx['match'](/[^1-9]+/)?lx['split'](/[^1-9]+/)['join']('|')['split']('|'):lx['split']('')),nn['unlock_pattern_pts']=function(ls,lu){let lw=ls['filter'](ls=>ls>0x0&&ls<=lu*lu),nl=[];for(;nl['length']!==lw['length'];)nl=lw['slice'](),nY(),nm();return lw;function nY(){let ls=function(){let ls={},lw=0x1;for(let nl=0x1;nl<=lu;nl+=0x1)for(let nY=0x1;nY<=lu;nY+=0x1)ls[lw++]=[nl,nY];return ls;}(),nl=NaN;for(let ls=0x0,lu=lw['length'];ls{if(!c(lu)&&!(lu in ls))return ls[lu]=!0x0;});}}(lx,lu)['filter'](ls=>+ls&&o0[ls])['map'](ls=>[o0[ls]['x'],o0[ls]['y']]);}}}()||function(){return!function(){let ls=ls=>l(ls)&&id(ls)['exists'](),lu=ls=>_(ls)&&idMatches(ls)['exists']();return['com.android.systemui:id/lockPattern']['some'](nl=>{if(ls(nl)||lu(nl))return lw['misjudge']=nl,f['_'](['匹配到误判干扰','转移至PIN解锁方案']),!0x0;});}()&&[{'desc':'通用','sel':idMatches('.*passwordEntry')},{'desc':'MIUI','sel':idMatches(lu+'miui_mixed_password_input_field')},{'desc':'锤子科技','sel':idMatches(nl+'passwordEntry(_.+)?')['className']('EditText')}]['some'](lu=>{if(lu['sel']['exists']())return f['_']('匹配到'+lu['desc']+'密码解锁控件'),re(lu['sel'],ls);});function ls(){let ls=lx;p(ls)&&(ls=ls['join'](''));let lu=ls=>y['pickup']([/确.|完成|[Cc]onfirm|[Ee]nter/,{'className':'Button','clickable':!0x0}],ls),nl=0x0,pp=Math['ceil'](0.6*lz);for(;!(nl>pp&&lD(['密码解锁方案失败','可能是密码错误','或无法点击密码确认按钮']));){lC('密码解锁',nl,pp),lw['sel']['setText'](ls),nm();let nn=lu('widget');if(nn){f['_']('点击\x22'+lu('txt')+'\x22按钮');try{m['click$'](nn,'w');}catch(ps){f['_']('按钮点击可能未成功',0x3);}}if(lw['succ'](0x2))break;try{if(0x0===shell('date',!0x0)['code']&&0x0===shell('input\x20keyevent\x2066',!0x0)['code']&&(f['_']('使用Root权限模拟回车键'),sleep(0x1e0),lw['succ']()))break;}catch(pt){}nl+=0x1,sleep(0xc8);}return f['_']('密码解锁成功'),!0x0;function nm(){let lu=ls[ls['length']-0x1],nl={'HUAWEI VOG-AL00 9':{'prefix':0x1,'keys':[[0x3f0,0x6aa]]},'HUAWEI ELE-AL00 10':{'keys':['DEL'],'keys_map':function(){let [ls,lu,lw,nl,pp]=[0x4a4,0x546,0x5e7,0x68a,0x72b],[nm,nn,no,pF,pG,pH,pI,pJ,pK,pL]=[0x38,0xa3,0x10f,0x17a,0x1e7,0x253,0x2bf,0x32a,0x396,0x403],[np,pN,pO,pP,lx,ly,lz,lA,lB]=[109.5,0xd9,324.5,432.5,0x21d,0x289,756.5,0x360,972.5];return{1:[nm,ls],2:[nn,ls],3:[no,ls],4:[pF,ls],5:[pG,ls],6:[pH,ls],7:[pI,ls],8:[pJ,ls],9:[pK,ls],0:[pL,ls],'q':[nm,lu],'w':[nn,lu],'e':[no,lu],'r':[pF,lu],'t':[pG,lu],'y':[pH,lu],'u':[pI,lu],'i':[pJ,lu],'o':[pK,lu],'p':[pL,lu],'a':[np,lw],'s':[pN,lw],'d':[pO,lw],'f':[pP,lw],'g':[lx,lw],'h':[ly,lw],'j':[lz,lw],'k':[lA,lw],'l':[lB,lw],'z':[pN,nl],'x':[pO,nl],'c':[pP,nl],'v':[lx,nl],'b':[ly,nl],'n':[lz,nl],'m':[lA,nl],',':[pN,pp],' ':[lx,pp],'.':[lA,pp],'del':[pL,nl]};}(),get 'suffix'(){return this['keys_map'][lu];}}};if(!(lB in nl))return;f['_']('此设备机型需要按键辅助');let pp=nl[lB],nm=pp['keys'],nn=pp['keys_map'],no=pp['prefix'],pZ=pp['suffix'];if(!c(no)&&!u(no)){let nl='';h(no)?nl+=lu['repeat'](no):nl=no['toString'](),lw['sel']['setText'](ls+nl),f['_']('辅助按键前置填充:\x20'+nl['length']+'项');}return nm['forEach']((ls,lu)=>{lu||sleep(0x12c),m['click$'](l(ls)?nn[ls]:ls),sleep(0x12c);}),pZ?pZ instanceof com['stardust']['automator']['UiObject']?(f['_']('辅助按键后置填充类型:\x20控件'),m['click$'](pZ)):pZ instanceof com['stardust']['autojs']['core']['accessibility']['UiSelector']?(f['_']('辅助按键后置填充类型:\x20选择器'),m['click$'](pZ)):p(pZ)?(f['_']('辅助按键后置填充类型:\x20坐标'),m['click$'](pZ)):h(pZ)||l(pZ)||_(pZ)?(f['_']('辅助按键后置填充类型:\x20文本'),m['click$'](y['pickup']('(key.?)?'+pZ))):lD(['密码解锁失败','无法判断末位字符类型']):void 0x0;}}}()||function(){return[{'desc':'通用','sel':idMatches(ls+'pinEntry')},{'desc':'MIUI','sel':idMatches(lu+'numeric_inputview')},{'desc':'EMUI10','sel':idMatches(ls+'fixedPinEntry')},{'desc':'EMUI','sel':descMatches('[Pp][Ii][Nn]\x20?(码区域|area)')},{'desc':'魅族','sel':idMatches(ls+'lockPattern')},{'desc':'OPPO','sel':idMatches(ls+'(coloros.)?keyguard.pin.(six.)?view')},{'desc':'OPPO','sel':idMatches(ls+'keyguard_security_container')},{'desc':'VIVO','sel':idMatches(ls+'vivo_pin_view')},{'desc':'拨号盘阵列',get 'sel'(){let ls={'_side':0x3,'_nums':[0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0x0],'_ft':cX(0.0125),'_checkPoints'(){return this['_points']=this['_points']||{},this['_nums']['every'](ls=>this['_points'][ls]=y['pickup'](ls,'point'));},'_checkOffset'(){let lu=ls=>ls['join']('|')['split']('|')['map'](()=>[]),lw=ls['_side'],nl=lu(Array(lw)),q8=lu(Array(lw)),nm=(lu,lw)=>ls['_points'][ls['_nums'][lu]][lw];for(let ls=0x0;lslu['every']((lw,nl)=>!nl||Math['abs'](lw-lu[nl-0x1])lu['every']((lw,nl)=>!nl||Math['abs'](lw-lu[nl-0x1])!!global['_$_dial_points']};}}]['some'](ls=>{let lu=ls['desc'];if(ls['sel']['exists']())return lu['match'](/\w$/)&&(lu+='/'),f['_']('匹配到'+lu+'PIN解锁控件'),re(ls['sel'],nl);});function nl(){let nl=0x0,qp=Math['ceil'](0.6*lz);for(;!(nl>qp&&lD(['PIN解锁方案失败','尝试次数已达上限'])||(lC('PIN解锁',nl,qp),d(lw['unlockPin'])?lw['unlockPin']():no(),lw['succ']()||nn()));)nl+=0x1,sleep(0xc8);return f['_']('PIN解锁成功'),!0x0;function nn(){let lu=idMatches(ls+'key_enter');if(lu['exists']())return f['_']('点击\x22key_enter\x22控件'),m['click$'](lu,'w'),lw['succ']();}function no(){let nl=[{'desc':'通用PIN/KEY','test'(){let lu=lu=>idMatches(ls+'key'+lu);if(r0(lu))return nn['call'](this),this['sel']=lu;},'click'(){let ls=this['sel'];return no(()=>ly['forEach'](lu=>m['click$'](ls(lu),'w')));}},{'desc':'通用PIN容器','test'(){let lu=idMatches(ls+'container')['findOnce']();if(lu)return nn['call'](this),this['widget']=lu;},'click'(){let ls=this['widget']['bounds'](),lu=[ls['left'],ls['top'],ls['right'],ls['bottom']];return no(()=>ly['forEach'](ls=>m['click$']((ls=>y['pickup']([ls,{'boundsInside':lu}]))(ls),'w')));}},{'desc':'MIUI/PIN','test'(){let ls=ls=>idMatches(lu+'numeric_inputview')['text'](ls);if(r0(ls))return nn['call'](this),this['sel']=ls;},'click'(){let ls=this['sel'];return no(()=>ly['forEach'](lu=>m['click$'](ls(lu),'w')));}},{'desc':'内容描述PIN','test'(){let ls=ls=>desc(ls);if(r0(ls))return nn['call'](this),this['sel']=ls;},'click'(){let ls=this['sel'],lu=lw=>{let nl=ls(lw)['findOnce']();if(lw>0x0||nl)return nl;let qp=ls=>{let lw=lu(ls)['bounds']();return{'x':lw['centerX'](),'y':lw['centerY']()};},nm=ls=>qp(0x8)[ls]+qp(0x5)[ls]-qp(0x2)[ls];return[nm('x'),nm('y')];};return no(()=>ly['forEach'](ls=>m['click$'](lu(ls),'w')));}},{'desc':'标记匹配PIN','test'(){if(lw['misjudge'])return nn['call'](this),f['_']('已匹配的字符串化标记:'),f['_'](lw['misjudge']),!0x0;},'click':()=>no(()=>{let ls=idMatches(lw['misjudge'])['findOnce']();ls&&nm(ly,ls['bounds']());})},{'desc':'拨号盘阵列PIN','test'(){if(global['_$_dial_points'])return nn['call'](this),!0x0;},'click':()=>no(()=>ly['forEach'](ls=>{m['click$'](global['_$_dial_points'][ls],'p',{'pt$':0x78});}))}],qp=0x8;for(;qp--;)for(let ls of nl)if(ls['test']())return ls['click']();return lD('预置的PIN解锁方案全部无效');function nn(){f['_']('采用'+this['desc']+'解锁方案');}function no(ls){return(lw['unlockPin']=ls['bind'](null))();}function r0(ls){let lu=0x0;for(let lw of'123456789')lu+=Number(ls(lw)['exists']());return lu>0x6;}}}}()||function(){return[{'desc':'\x22Gxzw\x22屏下指纹设备','sel':idMatches(/.*[Gg][Xx][Zz][Ww].*/),'pw_rect':[0.0875,0.47,0.9125,0.788]}]['some'](lu=>{if(lu['sel']['exists']())return f['_'](['匹配到特殊设备解锁方案:',lu['desc']]),re(lu['sel'],ls['bind'](null,lu['pw_rect']));});function ls(ls){let lu=ls['map']((ls,lu)=>lu%0x2?cY(ls):cX(ls)),[nl,r9,nn,no]=lu;if(f['_']('已构建密码区域边界:'),f['_']('Rect('+nl+',\x20'+r9+'\x20-\x20'+nn+',\x20'+no+')'),nm(ly,lu),lw['succ']())return!0x0;lD('尝试特殊解锁方案失败');}}()||void(lN['isUnlocked']()||f['_']('未匹配到可用的解锁控件'));function re(ls,lu){return lw['sel']=ls,lw['stg']=lu,(lw['trigger']=ls['exists']['bind'](ls))();}function nm(ls,lu){let lw,nl,re,nm;if(p(lu)){let [ls,nn,no,rr]=lu;lw=ls,nl=nn,re=no-ls,nm=rr-nn;}else lw=lu['left'],nl=lu['top'],re=lu['width'](),nm=lu['height']();let nn=Math['trunc'](re/0x3),no=Math['trunc'](nm/0x4),ru=lw+Math['trunc'](nn/0x2),rv=nl+Math['trunc'](no/0x2),rw=[];for(let ls=0x1;ls<=0x4;ls+=0x1)for(let lu=0x1;lu<=0x3;lu+=0x1)rw[0x3*(ls-0x1)+lu]={'x':ru+nn*(lu-0x1),'y':rv+no*(ls-0x1)};f['_']('已构建拨号盘数字坐标'),ls['forEach'](ls=>m['click$'](rw[Number(ls)||0xb]));}f['_'](['跳过解锁控件检测','屏幕未亮起']);},'dismiss'(){return lx?d(this['stg'])?(lN['keepOn'](0x5),this['stg'](),void lN['cancelOn']()):lD('没有可用的解锁方案'):lD('密码为空');},'handle'(){return this['trigger']()&&this['dismiss']();},'succ'(ls){let lw,nl=ls||0x780;return m['wait$'](()=>{if(function(){let ls=y['pickup'](/.*(重试|不正确|错误|[Ii]ncorrect|[Rr]etry|[Ww]rong).*/);return ls?lw||f['_'](y['pickup'](ls,'txt'),0x3):!idMatches(new RegExp(lu+'phone_locked_textview'))['exists']()||lw||f['_']('密码错误',0x3);}())return function(){let ls=()=>y['pickup'](/.*([Tt]ry again in.+|\d+.*后重试).*/);ls()&&(f['_']('正在等待重试超时'),m['wait$'](()=>!ls(),0xfde8,0x1f4));}(),function(){let ls=y['pickup'](/OK|确([认定])|好的?/);ls&&(f['_']('点击\x22'+y['pickup'](ls,'txt')+'\x22按钮'),m['click$'](ls,'w'),sleep(0x3e8));}(),lN['isUnlocked']();lw=!0x0;},nl,0xf0);}},'unlock':function(ls){f['debug']['switchSet'](ls),f['_']('尝试自动解锁',0x0,0x0,-0x2),no['put']('config',np),lE();for(let ls=0x0;!lN['isUnlocked']();ls+=0x1)ls>=lz&&lD('解锁尝试次数已达上限'),lC('解锁',ls,lz),nn['p_container']['handle'](),nn['unlock_view']['handle'](),sleep(0xf0);return f['_']('自动解锁完毕',0x0,0x0,-0x2),f['debug']['switchBack'](),!0x0;}},no=n['create']('unlock'),np=Object['assign']({'unlockCode':null,'unlockTryLimit':0x14,'unlockPatternStrategy':'segmental','unlockPatternSize':0x3,'unlockPatternSwipeDurationSegmental':0x78,'unlockPatternSwipeDurationSolid':0xc8,'unlockDismissLayerStrategy':'preferred','unlockDismissLayerBottom':0.7,'unlockDismissLayerTop':0.3,'unlockDismissLayerSwipeDuration':0x6e},no['get']('config')),lx=String(no['get']('config',{'prop':'unlockCode','is_crypto':!0x0,'default':''})),ly=lx['split'](/\D+/)['join']('')['split'](''),lz=np['unlockTryLimit'],lA=np['unlockPatternSize'],lB=device['brand']+'\x20'+device['product']+'\x20'+device['release'],lC=(ls,lu,lw)=>lu?f['_']('重试'+ls+'(\x20'+lu+'/'+lw+')'):f['_']('尝试'+ls);return nn;function lD(ls){lN['cancelOn'](),f['e'](['解锁失败',ls,lB]['flat'](),0x4,0x0,0x2),lN['isInitScreenOn']||(f['d']('自动关闭屏幕'),lN['screenOff']()||f['w']('自动关闭屏幕失败')),f['__'](),exit(),sleep(0xe10);}function lE(){lN['isScreenOn']()||(lN['wakeUpWithBuffer']()?(f['_']('设备唤起成功'),device['keepScreenOn'](0x1d4c0)):lD('设备唤起失败'));}}()['unlock'](ls),'vibrate'(ls,lu,lw){let rR=lu||0x1,rS='number'==typeof ls?[ls]:ls;function rT(){let ls=ls=>ls<0xa?0x3e8*ls:ls;for(;rR--;)rS['forEach']((lu,lw)=>{let rR=ls(lu),rT=ls(rS[lw-0x1]||0x0);lw%0x2?sleep(rR+rT):device['vibrate'](rR);}),lu&&rS['length']%0x2&&sleep(0x3e8);}void 0x0===lw||lw?threads['start'](rT):rT();},'hasRoot':()=>'function'==typeof lM['isRootAvailable']?lM['isRootAvailable']():Object['keys'](Shell)['indexOf']('Companion')>-0x1?Shell['Companion']['isRootAvailable']():void 0x0,'keycode'(ls,lu){let lw={'options':lu||{},'relations':[{'str':'home','num':0x3},{'str':'back','num':0x4},{'str':'recents','num':0xbb},{'str':'quick_settings','num':-0x1},{'str':'power_dialog','num':-0x1},{'str':'notifications','num':-0x1},{'str':'split_screen','num':-0x1}],get 'autojs_keycode'(){return this['_aj_kc']=this['_aj_kc']||this['relations']['map'](ls=>ls['str']);},'impededIFN'(){this['options']['no_impeded']||'function'==typeof i&&i('devicex.keycode');},'parseKeycode'(){if('number'==typeof ls||this['autojs_keycode']['includes'](ls))return this['keycode']=ls;if('string'==typeof ls){let lu=ls['match'](/^KEYCODE_/i)?ls:'KEYCODE_'+ls,lw=android['view']['KeyEvent'][lu['toUpperCase']()];if('number'==typeof lw)return this['keycode']=lw;}throw Error('Invalid\x20keycode:\x20'+ls);},'parseStrategy'(){'adb_only'===this['options']['strategy']?this['is_adb_only']=!0x0:'adb_advanced'===this['options']['strategy']?this['is_adb_advanced']=!0x0:'a11y_only'===this['options']['strategy']?this['is_a11y_only']=!0x0:this['is_a11y_advanced']=!0x0;},'parseArgs'(){this['parseStrategy'](),this['parseKeycode']();},'hasRoot'(){return'boolean'==typeof this['options']['root']?this['options']['root']:function(){try{return 0x0===shell('date',!0x0)['code'];}catch(s6){return!0x1;}}();},'toNumIFP'(ls){for(let lu of this['relations'])if(ls===lu['str']){if(lu['num']>-0x1)return lu['num'];break;}return ls;},'toStrIFP'(ls){for(let lu of this['relations'])if(ls===lu['num'])return lu['str'];return ls;},'showFailedMsgIFN'(ls){this['options']['no_failed_msg']||f['w'](['按键模拟失败','键值:\x20'+ls],0x0,0x0,-0x2);},'simulateByAdb'(ls){try{return 0x0===shell('input\x20keyevent\x20'+ls,lw['hasRoot']())['code'];}catch(sd){return this['showFailedMsgIFN'](ls),!0x1;}},'simulateByA11y'(ls){switch(ls){case'home':return home();case'back':return back();case'recents':return recents();case'power_dialog':return powerDialog();case'notifications':return notifications();case'quick_settings':return quickSettings();case'split_screen':return splitScreen();default:return null;}},'simulate'(ls){return this['is_a11y_only']?this['simulateByA11y'](this['toStrIFP'](ls)):this['is_adb_only']?this['simulateByAdb'](this['toNumIFP'](ls)):this['is_a11y_advanced']?this['simulateByA11y'](this['toStrIFP'](ls))||this['simulateByAdb'](this['toNumIFP'](ls)):this['is_adb_advanced']?this['simulateByAdb'](this['toNumIFP'](ls))||this['simulateByA11y'](this['toStrIFP'](ls)):void 0x0;},'simulateOnce'(){return this['simulate'](this['keycode']);},'simulateTwice'(){let ls=0x2;for(;ls--;)if(!this['simulateOnce']())return!0x1;return!0x0;},'getResult'(){return this['impededIFN'](),this['parseArgs'](),this['options']['rush']?this['simulateTwice']():this['simulateOnce']();}};return lw['getResult']();},'getCallState':()=>context['getSystemService'](lF['TELEPHONY_SERVICE'])['getCallState'](),'getDisplay'(){let ls,lu,lw=new lL(),sk=this['getDefaultDisplay']();sk['getRealMetrics'](lw);let sl=sU(),sm={'cX':su,'cY':sy,'cYx':sC},sn={'refresh'(){let ls=sU(),lu=!0x1;return Object['keys'](ls)['forEach'](lw=>{sl[lw]!==ls[lw]&&(sl[lw]=ls[lw],lu=!0x0);}),lu&&(f['_']('屏幕显示数据已更新'),this['debug']()),this;},'debug'(ls){let lu=f['debug']['fuel'](ls);return lu('屏幕宽高:\x20'+sl['W']+'\x20×\x20'+sl['H']),sl['is_rotation_portrait']?lu('可用高度:\x20'+sl['USABLE_HEIGHT']):sl['is_rotation_landscape']&&lu('可用宽度:\x20'+sl['USABLE_WIDTH']),lu('屏幕旋转:\x20'+0x5a*sl['display_rotation']+'°'),this;}};return sl||m['wait$'](()=>sl=sU(),0xbb8,0x1f4)||console['error']('devicex.getDisplay()返回结果异常'),Object['assign'](sl,sm,sn);function su(ls,lu,lw){return'boolean'==typeof lu?sL(0x1,ls,-0x1,Object['assign']({'is_ratio':lu},lw)):sL(0x1,ls,lu,lw);}function sy(ls,lu,lw){return'boolean'==typeof lu?sL(-0x1,ls,-0x1,Object['assign']({'is_ratio':lu},lw)):sL(-0x1,ls,lu,lw);}function sC(lw,sk,sl){let sm=sl||{},sn=sm['is_ratio'];'boolean'==typeof sk&&(sn=void 0x0===sn?sk:sn,sk=-0x1);let su=Number(lw),sy=Math['abs'](su)<0x1||sn,sC=Number(sk);if(sC&&-0x1!==sC)if(-0x2===sC)sC=0x438,su*=sy?0x780:0x1;else if(-0x3===sC)sC=0x448,su*=sy?0xa00:0x1;else{if(sC<0x0)throw Error('Can\x20not\x20parse\x20base\x20param\x20for\x20cYx()');if(sy)su*=lu;else if(sC<0x5)throw Error('Base\x20and\x20num\x20options\x20should\x20be\x20both\x20pixels\x20for\x20cYx()');sC=(sC>0x1?0x1/sC:sC)*lu;}else sC=0x2d0,su*=sy?0x500:0x1;return sm['to_ratio']?Number((0x9*su/0x10/sC)['toFixed'](0x3)):Math['round'](su*ls/sC);}function sL(lw,sk,sl,sm){let sn=-0x1!==lw?ls:lu,su=Number(sk);if(isNaN(su))throw Error('Can\x20not\x20parse\x20num\x20param\x20for\x20cTrans():\x20'+sk);let sy=Number(sl);sl&&-0x1!==sl?-0x2===sl?sy=-0x1!==lw?0x438:0x780:-0x3===sl&&(sy=-0x1!==lw?0x448:0xa00):sy=-0x1!==lw?0x2d0:0x500;let sC=sm||{};return(Math['abs'](su)<0x1||sC['is_ratio'])&&(su*=sy),sC['to_ratio']?Number((su/sy)['toFixed'](0x3)):Math['min'](Math['round'](su*sn/sy),sn);}function sU(){try{if(ls=sk['getWidth'](),lu=sk['getHeight'](),!(ls*lu))return sl();let sm=sk['getRotation'](),sn=[0x0,0x2]['indexOf'](sm)>-0x1,su=Math['max'](lw['widthPixels'],lw['heightPixels']),[sy,sC]=[lu,ls],sL=ls=>{try{let lu=context['getResources'](),lw=lu['getIdentifier'](ls,'dimen','android');if(lw>0x0)return lu['getDimensionPixelSize'](lw);}catch(t4){}return NaN;};return sn?[sy,lu]=[lu,su]:[sC,ls]=[ls,su],t7(),{'W':ls,'WIDTH':ls,'width':ls,'halfW':ls/0x2,'HALF_WIDTH':ls/0x2,'half_width':ls/0x2,'uW':sC,'USABLE_WIDTH':sC,'usable_width':sC,'H':lu,'HEIGHT':lu,'height':lu,'halfH':lu/0x2,'HALF_HEIGHT':lu/0x2,'half_height':lu/0x2,'uH':sy,'USABLE_HEIGHT':sy,'usable_height':sy,'display_rotation':sm,'ROTATION':sm,'is_rotation_portrait':sm===lD['ROTATION_0']||sm===lD['ROTATION_180'],'is_rotation_landscape':sm===lD['ROTATION_90']||sm===lD['ROTATION_270'],'status_bar_height':sL('status_bar_height'),'navigation_bar_height':sL('navigation_bar_height'),'navigation_bar_height_computed':sn?lu-sy:ls-sC,'action_bar_default_height':sL('action_bar_stacked_max_height')||sL('action_bar_default_height')};}catch(t5){return sl();}function sl(){return f['_']('devicex\x20display\x20raw()\x20is\x20triggered',0x3),ls=device['width'],lu=device['height'],t7(),ls&&lu?{'WIDTH':ls,'HEIGHT':lu,'USABLE_HEIGHT':Math['trunc'](0.9*lu)}:(f['_']('devicex\x20display\x20raw()\x20returns\x20null',0x4),null);}}function t7(){Object['assign'](global,{'W':ls,'WIDTH':ls,'H':lu,'HEIGHT':lu,'halfW':ls/0x2,'halfH':lu/0x2,'uW':sl?sl['USABLE_WIDTH']:ls,'uH':sl?sl['USABLE_HEIGHT']:lu,'ROTATION':sl?sl['display_rotation']:0x0,'cX':su,'cY':sy,'cYx':sC});}},'getDefaultDisplay':()=>context['getSystemService'](lF['WINDOW_SERVICE'])['getDefaultDisplay'](),'getDisplayRotation'(){return this['getDefaultDisplay']()['getRotation']();},'setUserRotation'(ls,lu){this['setAutoRotationDisabled'](lu);let lw={0:lD['ROTATION_0'],1:lD['ROTATION_90'],2:lD['ROTATION_180'],3:lD['ROTATION_270'],90:lD['ROTATION_90'],180:lD['ROTATION_180'],270:lD['ROTATION_270']}[ls];if(void 0x0===lw)throw Error('Unknown\x20rotation\x20for\x20devicex.setUserRotation()');let tb=()=>this['getDisplayRotation']()===lw;tb()||(this['user_rotation']['saveState'](),this['user_rotation']['put'](lw),lu||(m['wait'](tb,0x7d0,0x50),sleep(0x168)));},'setUserRotationPortrait'(ls){this['setUserRotation'](lD['ROTATION_0'],ls);},'setUserRotationInverted'(ls){this['setUserRotation'](lD['ROTATION_180'],ls);},'setUserRotationLandscapeRight'(ls){this['setUserRotation'](lD['ROTATION_90'],ls);},'setUserRotationLandscapeLeft'(ls){this['setUserRotation'](lD['ROTATION_270'],ls);},'setAutoRotationEnabled'(ls){this['accelerometer_rotation']['verify'](0x1)||(this['accelerometer_rotation']['saveState'](),this['accelerometer_rotation']['put'](0x1),ls||(m['wait'](()=>this['accelerometer_rotation']['verify'](0x1),0x7d0,0x50),sleep(0x168)));},'setAutoRotationDisabled'(ls){this['accelerometer_rotation']['verify'](0x0)||(this['accelerometer_rotation']['saveState'](),this['accelerometer_rotation']['put'](0x0),ls||(m['wait'](()=>this['accelerometer_rotation']['verify'](0x0),0x7d0,0x50),sleep(0x168)));},'restoreUserRotationIFN'(){this['restoreAutoRotationIFN'](),this['user_rotation']['loadStateIFN']();},'restoreAutoRotationIFN'(){this['accelerometer_rotation']['loadStateIFN']();},'getNextAlarmClockTriggerTime'(){let ls=context['getSystemService'](lF['ALARM_SERVICE'])['getNextAlarmClock']();return null!==ls?ls['getTriggerTime']():Number['NaN'];},'getNextAlarmClockTriggerGap'(){let ls=this['getNextAlarmClockTriggerTime']()-Date['now']();return isNaN(ls)?0x1/0x0:Math['max'](0x0,ls);},'isNextAlarmClockTriggered'(ls){let lu=Number(ls);return lu=isNaN(lu)||lu<0x0?0x0:lu,this['getNextAlarmClockTriggerGap']()({'raw_info':{1:{'version':'1.0','release':'September\x2023,\x202008'},2:{'version':'1.1','release':'February\x209,\x202009'},3:{'version':'1.5','release':'April\x2027,\x202009'},4:{'version':'1.6','release':'September\x2015,\x202009'},5:{'version':'2.0','release':'October\x2027,\x202009'},6:{'version':'2.0.1','release':'December\x203,\x202009'},7:{'version':'2.1','release':'January\x2011,\x202010'},8:{'version':['2.2','2.2.3'],'release':'May\x2020,\x202010'},9:{'version':['2.3','2.3.2'],'release':'December\x206,\x202010'},10:{'version':['2.3.3','2.3.7'],'release':'February\x209,\x202011'},11:{'version':'3.0','release':'February\x2022,\x202011'},12:{'version':'3.1','release':'May\x2010,\x202011'},13:{'version':['3.2','3.2.6'],'release':'July\x2015,\x202011'},14:{'version':['4.0','4.0.2'],'release':'October\x2018,\x202011'},15:{'version':['4.0.3','4.0.4'],'release':'December\x2016,\x202011'},16:{'version':['4.1','4.1.2'],'release':'July\x209,\x202012'},17:{'version':['4.2','4.2.2'],'release':'November\x2013,\x202012'},18:{'version':['4.3','4.3.1'],'release':'July\x2024,\x202013'},19:{'version':['4.4','4.4.4'],'release':'October\x2031,\x202013'},20:{'version':['4.4W','4.4W.2'],'release':'June\x2025,\x202014'},21:{'version':['5.0','5.0.2'],'release':'November\x204,\x202014'},22:{'version':['5.1','5.1.1'],'release':'March\x202,\x202015'},23:{'version':['6.0','6.0.1'],'release':'October\x202,\x202015'},24:{'version':'7.0','release':'August\x2022,\x202016'},25:{'version':['7.1','7.1.2'],'release':'October\x204,\x202016'},26:{'version':'8.0','release':'August\x2021,\x202017'},27:{'version':'8.1','release':'December\x205,\x202017'},28:{'version':'9','release':'August\x206,\x202018'},29:{'version':'10','release':'September\x207,\x202019'},30:{'version':'11','release':'September\x208,\x202020'},31:{'version':'12','release':'October\x204,\x202021'}},'month_map':{'Jan':0x0,'Feb':0x1,'Mar':0x2,'Apr':0x3,'May':0x4,'Jun':0x5,'Jul':0x6,'Aug':0x7,'Sep':0x8,'Oct':0x9,'Nov':0xa,'Dec':0xb},'parseDate'(ls){let lu=ls['replace'](/([A-Z]..)\D*?\s(\d\d?), (\d{4})/,(ls,lu,lw,ty)=>[ty,this['month_map'][lu],lw]['join'](','))['split'](',')['map'](ls=>Number(ls));return lu['unshift'](null),new(Function['prototype']['bind']['apply'](Date,lu))();},'parseRawInfo'(){this['versions']={},Object['keys'](this['raw_info'])['forEach'](ls=>{let lu=this['raw_info'][ls],lw=lu['version'];Array['isArray'](lw)&&(lw={'min':lw[0x0],'max':lw[0x1]}),this['versions'][ls]={'version':lw,'release':this['parseDate'](lu['release'])};});},'parseArgs'(){this['sdk']=ls||device['sdkInt'],this['parseRawInfo']();},'getResult'(){return this['parseArgs'](),this['versions'][this['sdk']]||{};}}['getResult']()),'ensureSdkInt'(ls){let lu=ls||0x18;if(device['sdkInt']\x20'+ls),ls;},this['put']=function(ls){return f['_'](lu+'\x20<-\x20'+ls),function(){try{switch(lw){case'Int':return tN['putInt']['apply'](tN,arguments);case'Long':return tN['putLong']['apply'](tN,arguments);case'Float':return tN['putFloat']['apply'](tN,arguments);case'String':return tN['putString']['apply'](tN,arguments);default:throw f['_']('Unknown\x20data_type:\x20'+lw,0x3),Error('Local\x20Exception');}}catch(u2){return tT('put',arguments);}}(tO,tN[lu],ls);},this['verify']=function(ls){return this['get']()===ls;},this['toggle']=function(ls,lu){if(!Array['isArray'](this['state_set']))throw Error('A\x20\x22state_set\x22\x20must\x20be\x20defined\x20for\x20StateManager.[[instance]].toggle');let lw=this['state_set'];'function'==typeof lu&&(lw=this['state_set']['filter'](lu));let tM=tP['call'](this,lw,function(ls){return void 0x0===ls||'+'===ls||'clockwise'===ls||Object['is'](ls,0x0);}(ls));return this['put'](tM),tM;},this['saveState']=function(){this['_last_state']=this['get']();},this['loadState']=function(ls){if(a(this['_last_state']))throw Error('State\x20must\x20be\x20saved\x20before\x20loading');this['put'](this['_last_state']),ls||this['clearState']();},this['loadStateIFN']=function(ls){a(this['_last_state'])||this['put'](this['_last_state']),ls||this['clearState']();},this['clearState']=function(){delete this['_last_state'];},this['storage']=storages['create']('devicex_state_manager'),this['saveIntoStorage']=function(){this['storage']['put'](this['key'],this['get']());},this['loadFromStorage']=function(ls){let lu=this['storage']['get'](this['key']);if(a(lu))throw Error('Storage\x20must\x20be\x20saved\x20before\x20loading');f['_'](this['key']+'\x20->\x20'+lu),this['put'](lu),ls||this['clearStorage']();},this['loadFromStorageIFN']=function(ls){let lu=this['storage']['get'](this['key']);a(lu)||this['put'](lu),ls||this['clearStorage']();},this['clearStorage']=function(){this['storage']['remove'](this['key']);};}lN['$bind'](),ls['exports']={'devicex':lN,'$$disp':lN['getDisplay']()};},949:(uf,ug,uh)=>{let {$$und,$$func,$$F,isObjectSpecies,isNullish,isXMLType}=uh(0x2c4),{colorsx}=uh(0xcb),{consolex}=uh(0x2d5),uj=android['view']['WindowManager'],uk=uj['LayoutParams'],ul=android['os']['Looper'],um=android['text']['util']['Linkify'],un=android['content']['res']['ColorStateList'],uo=android['graphics']['drawable']['ColorDrawable'],up=com['stardust']['autojs']['core']['ui']['dialog']['JsDialog'],uq=com['afollestad']['materialdialogs']['DialogAction'],ur=com['afollestad']['materialdialogs']['MaterialDialog'],us={'contents':uh(0x2f1),'isUiThread':()=>ul['myLooper']()===ul['getMainLooper'](),'rtDialogs':()=>us['isUiThread']()?runtime['dialogs']:runtime['dialogs']['nonUiDialogs']},ut={'colors':{'wrap'(uu,uv){if(uv&&this[uv])for(let uw in this[uv])if(this[uv]['hasOwnProperty'](uw)&&uu===uw){let uu=this[uv][uw];return Array['isArray'](uu)?uu[0x0]:uu;}return uu;},'title':{'default':'#212121','caution':'#880E0E','warn':'#880E4F','alert':['#C51162','#FFEFFE']},'content':{'default':'#757575','caution':'#AD1414','warn':'#AD1457','alert':['#283593','#E1F5FE']},'progress':{'download':['#FF6F00','#FFECB3','#C43E00'],'files':['#F9A825','#FFF59D','#C17900'],'backup':['#455A64','#ECEFF1','#1C313A'],'restore':['#AB47BC','#F3E5F5','#790E8B'],'indeterminate':['#00897B','#B2DFDB','#005B4F'],'finish':['#00C853','#DCEDC8','#009624'],'success':['#00C853','#DCEDC8','#009624'],'error':['#1565C0','#BBDEFB','#003C8F'],'failure':['#1565C0','#BBDEFB','#003C8F']},'button':{'default_aj_4':'#01A9F3','default':'#03A9F4','caution':'#FF3D00','warn':'#F57C00','attraction':'#7B1FA2','hint':'#0DA798','reset':'#A1887F','unavailable':'#BDBDBD','finish':'#009624','success':'#009624','error':'#003C8F','failure':'#003C8F'}},'text':{'btn':{'F':'完成','B':'返回','Q':'放弃','X':'退出','I':'终止','K':'确定','S':'确认','C':'关闭','D':'删除','N':'继续','M':'确认修改','R':'使用默认值','T':'了解更多'},'no_more_prompt':'不再提示','user_interrupted':'用户终止'},'pool':{'_data':{},'add'(uy,uz){return isNullish(uy)?uy:this['_data'][(uz||'')+ut['getName'](uy)]=uy;},'get'(uA){return this['_data'][uA];},'clear'(){let uB=Object['keys'](this['_data'])['filter'](uB=>{if(this['_data'][uB]['isShowing']())return!0x0;delete this['_data'][uB];})['map'](uB=>{let uE=this['_data'][uB];return uE['dismiss'](),uB['match'](/@[a-f0-9]{5,}$/)?uB:uB+ut['getName'](uE);});uB['length']&&consolex['_'](['清理扩展对话框样本池:']['concat'](uB),0x0,0x0,-0x2);}},'getName':uF=>'@'+java['lang']['Integer']['toHexString'](uF['hashCode']()),'build'(uG){let uI=Object['create'](runtime['dialogs']['newBuilder']());return uI['thread']=threads['currentThread'](),Object['keys'](uG)['forEach'](uJ=>vl['call'](this,uI,uJ,uG[uJ])),function(uG,uI){if(void 0x0!==uI['inputHint']||void 0x0!==uI['inputPrefill']){let uM=vd(uI['inputHint']),uN=vd(uI['inputPrefill']),uO=function(uI,uQ){return uG['emit']('input_change',uG['dialog'],uQ['toString']());};uG['input'](uM,uN,uO)['alwaysCallInputCallback']();}if(void 0x0!==uI['items']){let uR=uI['itemsSelectMode'];if(void 0x0===uR||'select'===uR)uG['itemsCallback'](function(uI,uR,uU,uV){uG['emit']('item_select',uU,uV['toString'](),uG['dialog']);});else if('single'===uR)uG['itemsCallbackSingleChoice'](void 0x0===uI['itemsSelectedIndex']?-0x1:uI['itemsSelectedIndex'],function(uI,uR,uZ,v0){return uG['emit']('single_choice',uZ,v0['toString'](),uG['dialog']),!0x0;});else{if('multi'!==uR)throw new Error('Unknown\x20itemsSelectMode\x20'+uR);uG['itemsCallbackMultiChoice'](void 0x0===uI['itemsSelectedIndex']?null:uI['itemsSelectedIndex'],function(uI,uR,v3){return uG['emit']('multi_choice',vf(uR,(uG,uI)=>parseInt(uG[uI])),vf(v3,(uG,uI)=>uG[uI]['toString']()),uG['dialog']),!0x0;});}}if(void 0x0!==uI['progress']){let v8=uI['progress'];uG['progress'](-0x1===v8['max'],v8['max'],!!v8['showMinMax']),uG['progressIndeterminateStyle'](!!v8['horizontal']);}if(void 0x0===uI['checkBoxPrompt']&&void 0x0===uI['checkBoxChecked']||uG['checkBoxPrompt'](vd(uI['checkBoxPrompt']),!!uI['checkBoxChecked'],function(uI,va){return uG['getDialog']()['emit']('check',va,uG['getDialog']());}),void 0x0!==uI['customView']){let vb=uI['customView'];(isXMLType(vb)||'string'==typeof vb)&&(vb=ui['run'](()=>ui['inflate']('customView')));let vc=uI['wrapInScrollView'];uG['customView'](vb,void 0x0===vc||vc);}function vd(uG){return uG||'';}function vf(uG,uI){let vd=[],vf=uG['length'];for(let vk=0x0;vkthis['text']['btn'][uG]||uG},'positiveColor':{'adapter':colorsx['toInt']},'neutral':{'method':'neutralText','adapter':uG=>this['text']['btn'][uG]||uG},'neutralColor':{'adapter':colorsx['toInt']},'negative':{'method':'negativeText','adapter':uG=>this['text']['btn'][uG]||uG},'negativeColor':{'adapter':colorsx['toInt']},'cancelable':null,'canceledOnTouchOutside':null,'autoDismiss':null};if(vp['hasOwnProperty'](uI)){let vt=vp[uI]||{};void 0x0===vt['method']&&(vt['method']=uI),vt['adapter']&&(vl=vt['adapter'](vl)),uG[vt['method']]['call'](uG,vl);}}},'builds'(vu,vv){if(isObjectSpecies(vu))return this['builds']('',vu);let [vw,vx,vy,vz,vA,vB,vC]='string'==typeof vu?[vu]:vu,vD={'autoDismiss':!vB,'canceledOnTouchOutside':!vB,'checkBoxPrompt':vC?'string'==typeof vC?vC:this['text']['no_more_prompt']:void 0x0},vE=vv||{};[['title',vw,this['colors']['title']],['content',vx,this['colors']['content']],['neutral',vy,this['colors']['button'],this['text']['btn']],['negative',vz,this['colors']['button'],this['text']['btn']],['positive',vA,this['colors']['button'],this['text']['btn']]]['map'](vu=>{let [vv,vw]=vu;return $$und(vw)&&!$$und(vE[vv])&&vu['splice'](0x1,0x1,vE[vv]),vu;})['forEach'](vu=>vS['apply'](this,vu)),Object['assign'](vD,vE),['title','content']['forEach'](vu=>{vu in vD&&(vD[vu]=String(vD[vu]));});let vK=this['build'](vD);if(vE['linkify']&&this['linkify'](vK),void 0x0!==vE['keycode_back']){let vu=vE['keycode_back'];('disabled'===vu||$$func(vu)||$$F(vu))&&this['disableBack'](vK,vu);}return ui['post'](()=>{let vu=vK['getWindow'](),vv=vE['dim_amount'];if('number'==typeof vv){for(;vv>0x1;)vv/=0x64;vu['setDimAmount'](vv);}let vw=vE['background'];'string'==typeof vw?vw['match'](/^#/)?vu['setBackgroundDrawable'](new uo(colorsx['toInt'](vw))):vu['setBackgroundDrawableResource'](android['R']['color'][vw]):'number'==typeof vw&&vu['setBackgroundDrawable'](new uo(vw));let vx=vE['animation'];'string'==typeof vx&&(vx=vx['split']('_')['map'](vu=>vu['toTitleCase']())['join'](''),'Default'===vx?vu['setWindowAnimations'](android['R']['style']['Animation']):vu['setWindowAnimations'](android['R']['style']['Animation_'+vx]));let vy=vE['is_keep_screen_on'];void 0x0!==vy&&vy&&vu['addFlags'](uk['FLAG_KEEP_SCREEN_ON']);}),vK;function vS(vu,vv,vw,vx){if(!vE[vu]||Array['isArray'](vE[vu])){let [vy,vz]=Array['isArray'](vv)?vv:[vv];vy&&('content'!==vu||vx||(vx=us['contents']),vE[vu]=vx&&vx[vy]||vy);let vA=vu+'Color',vB=vE[vA]||vw[vz]||vz||vw['default'];vE[vA]=colorsx['toInt'](vB);}}},'rawInput':(w1,w2,w3)=>us['isUiThread']()&&!w3?new Promise(w3=>{us['rtDialogs']()['rawInput'](w1,w2||'',function(){w3['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['rawInput'](w1,w2||'',w3||null),'input'(w5,w6,w7){if(w7)return this['rawInput'](w5,w6||'',w8=>w7(eval(w8)));if(us['isUiThread']())return new Promise(w9=>{us['rtDialogs']()['rawInput'](w5,w6||'',wa=>w9(eval(wa)));});let wb=this['rawInput'](w5,w6||'',w7||null);return'string'==typeof wb?eval(wb):void 0x0;},'alert':(wc,wd,we)=>us['isUiThread']()&&!we?new Promise(we=>{us['rtDialogs']()['alert'](wc,wd||'',function(){we['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['alert'](wc,wd||'',we||null),'alertTitle'(wg,wh,wi){let wj=global['_$_alert_title_info']=global['_$_alert_title_info']||{};wj[wg]=wj[wg]||{},wj['message_showing']?++wj['message_showing']:wj['message_showing']=0x1;let wk=wj[wg]['ori_text']||'',wl=wj[wg]['ori_text_color']||'',wm=wj[wg]['ori_bg_color']||'',wn=wg['getTitleView']();function wo(wg,wh,wi){let wj=wg['getTitleView'](),[wk,wl]=wi;ui['run'](()=>{wj['setText'](wh),wj['setTextColor'](wk),wj['setBackgroundColor'](wl);});}wk||(wj[wg]['ori_text']=wk=wn['getText']()),wl||(wj[wg]['ori_text_color']=wl=wn['getTextColors']()['getColorForState'](util['java']['array']('int',0x0),colors['parseColor']('#de000000'))),wm||(wj[wg]['ori_bg_color']=-0x1),wo(wg,wh,this['colors']['title']['alert']['map'](colorsx['toInt'])),0x0===wi||setTimeout(function(){--wj['message_showing']||wo(wg,wk,[wl,wm]);},wi||0xbb8);},'alertContent'(wv,ww,wx){let wy=wv['getContentView'](),wz=wy['getText']()['toString'](),wA='append'===wx||!0x0===wx,[wB,wC]=this['colors']['content']['alert']['map'](wv=>colorsx['toInt'](wv));ui['post'](()=>{wy['setText']((wA?wz+'\x0a\x0a':'')+ww),wy['setTextColor'](wB),wy['setBackgroundColor'](wC);});},'prompt'(wE,wF,wG){return this['rawInput'](wE,wF,wG);},'confirm':(wH,wI,wJ)=>us['isUiThread']()&&!wJ?new Promise(wJ=>{us['rtDialogs']()['confirm'](wH,wI||'',function(){wJ['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['confirm'](wH,wI||'',wJ||null),'select'(wL,wM,wN){return wM instanceof Array?us['isUiThread']()&&!wN?new Promise(wN=>{us['rtDialogs']()['select'](wL,wM,function(){wN['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['select'](wL,wM,wN||null):us['rtDialogs']()['select'](wL,[]['slice']['call'](arguments,0x1),null);},'singleChoice':(wP,wQ,wR,wS)=>us['isUiThread']()&&!wS?new Promise(wS=>{us['rtDialogs']()['singleChoice'](wP,wR||0x0,wQ,function(){wS['apply'](null,[]['slice']['call'](arguments));});}):us['rtDialogs']()['singleChoice'](wP,wR||0x0,wQ,wS||null),'multiChoice'(wU,wV,wW,wX){let wY=wU=>{let wV=[];for(let wW=0x0,wX=wU['length'];wWwX(wY(wU)))):us['isUiThread']()?new Promise(wX=>{us['rtDialogs']()['multiChoice'](wU,wW||[],wV,wU=>wX(wY(wU)));}):wY(us['rtDialogs']()['multiChoice'](wU,wW||[],wV,null));},'dismiss'(x6){(Array['isArray'](x6)?x6:[]['slice']['call'](arguments))['forEach'](x6=>{'object'==typeof x6&&x6['dismiss']&&x6['dismiss']();});},'clearPool'(){this['pool']['clear']();},'disableBack':(x8,x9)=>(x8['setOnKeyListener']({'onKey':(xa,xb,xc)=>xc['getAction']()===KeyEvent['ACTION_UP']&&('function'==typeof x9&&x9(x8),xb===KeyEvent['KEYCODE_BACK'])}),x8),'getTitleText':xd=>xd?xd['getTitleView']()['getText']()['toString']():'','setTitleText'(xe,xf){ui['run'](()=>{xe&&xe['getTitleView']()['setText'](xf?xf['toString']():'');});},'setTitleTextColor'(xg,xh){ui['run'](()=>{xg&&xg['getTitleView']()['setTextColor'](colorsx['toInt'](this['colors']['wrap'](xh,'title')));});},'setTitleBackgroundColor'(xi,xj){ui['run'](()=>{xi&&xi['getTitleView']()['setBackgroundColor'](colorsx['toInt'](this['colors']['wrap'](xj,'title')));});},'getContentText':xk=>xk?xk['getContentView']()['getText']()['toString']():null,'setContentText'(xl,xm){ui['run'](()=>{xl&&xl['getContentView']()['setText'](xm?xm['toString']():'');});},'appendContentText'(xn,xo){ui['run'](()=>{xn&&xn['getContentView']()['setText'](this['getContentText'](xn)+(xo?xo['toString']():''));});},'setContentTextColor'(xp,xq){ui['run'](()=>{xp&&xp['getContentView']()['setTextColor'](colorsx['toInt'](this['colors']['wrap'](xq,'content')));});},'setContentBackgroundColor'(xr,xs){ui['run'](()=>{xr&&xr['getContentView']()['setBackgroundColor'](colorsx['toInt'](this['colors']['wrap'](xs,'content')));});},'getInputText':xt=>xt?xt['getInputEditText']()['getText']()['toString']():'','setInputText'(xu,xv){let xw='string'==typeof xv?xv:void 0x0!==xv?xv['toString']():'';ui['run'](()=>xu&&xu['getInputEditText']()['setText'](xw));},'setInputTextColor'(xx,xy){ui['run'](()=>{xx&&xx['getInputEditText']()['setTextColor'](colorsx['toInt'](xy));});},'setInputBackgroundColor'(xz,xA){ui['run'](()=>{xz&&xz['getInputEditText']()['setBackgroundColor'](colorsx['toInt'](xA));});},'linkify'(xB,xC){if(xB){let xD=xB['getContentView']();ui['run'](()=>{let xB=xD['getText']()['toString']();xD['setAutoLinkMask'](um[xC||'ALL']),xD['setText'](xB);});}},'getDialogAction'(xF){try{switch(xF['toLowerCase']()){case'positive':return uq['valueOf']('POSITIVE');case'negative':return uq['valueOf']('NEGATIVE');case'neutral':return uq['valueOf']('NEUTRAL');}}catch(xG){return null;}throw TypeError('unknown\x20action\x20of\x20dialogsx.getDialogAction');},'getActionButton'(xH,xI){let xJ=xI['toLowerCase']();if(xH instanceof ur){let xI=this['getDialogAction'](xJ);if(null!==xI)return xH['getActionButton'](xI)['getText']()['toString']();if('object'==typeof xH[xJ+'Button'])return xH[xJ+'Button']['getText']();}return xH instanceof up?xH['getActionButton'](xJ):'';},'setActionButton'(xL,xM,xN,xO){let xP=function(xM){let xP=xM['toLowerCase']();xL instanceof ur?ui['run'](()=>{let xM=this['getDialogAction'](xP);null!==xM?xL['setActionButton'](xM,xN):'object'==typeof xL[xP+'Button']&&xL[xP+'Button']['setText'](xN);}):ui['run'](()=>xL['setActionButton'](xP,xN)),xO&&this['setActionButtonColor'](xL,xP,xO);}['bind'](this);Array['isArray'](xM)?xM['forEach'](xP):xP(xM);},'setActionButtonColor'(xT,xU,xV){let xW=function(xU){let xW=xU['toLowerCase'](),xZ=colorsx['toInt'](this['colors']['wrap'](xV,'button')),y0=this['getDialogAction'](xW);ui['run'](()=>null!==y0?xT['getActionButton'](y0)['setTextColor'](xZ):xT instanceof ur&&'object'==typeof xT[xW+'Button']?xT[xW+'Button']['setTextColor'](xZ):void 0x0);}['bind'](this);Array['isArray'](xU)?xU['forEach'](xW):xW(xU);},'buildCountdown'(y1,y2){let y3=Object['assign']({'keycode_back':()=>yd['pause'](0x64)},y2),y4=y3['onNeutral']||(y1=>y1),y5=y3['onNegative']||(y1=>y1),y6=y3['onPositive']||(y1=>y1),y7=y3['onTimeout'];if('function'!=typeof y7&&'string'!=typeof y7)throw Error('onTimeout\x20for\x20dialogsx.buildCountdown()\x20must\x20be\x20specified');let yb=0x0,yc=y3['timeout']||0x5;yc>0x64&&(yc=Math['round'](yc/0x3e8));let yd={'neutral'(){this['pause'](0x12c),y4(ye);},'negative'(){this['pause'](0x12c),y5(ye);},'positive'(){yb=0x1,this['pause'](0x64),y6(ye);},'pause'(y1){us['interrupt'](),setTimeout(()=>{if('function'==typeof y3['onPause'])return y3['onPause'](ye);if('object'==typeof y3['onPause']){let y1=y3['onPause'];'function'==typeof y1['action']&&y1['action'](ye),[{'key':'title','get':y1=>ut['getTitleText'](y1),'set'(y1,y2,y3){ut['setTitleText'](y1,y3);}},{'key':'content','get':y1=>ut['getContentText'](y1),'set'(y1,y2,y3){ut['setContentText'](y1,y3);}},{'key':'neutral','get':(y1,y2)=>ut['getActionButton'](y1,y2),'set'(y1,y2,y3){ut['setActionButton'](y1,y2,y3);}},{'key':'negative','get':(y1,y2)=>ut['getActionButton'](y1,y2),'set'(y1,y2,y3){ut['setActionButton'](y1,y2,y3);}},{'key':'positive','get':(y1,y2)=>ut['getActionButton'](y1,y2),'set'(y1,y2,y3){ut['setActionButton'](y1,y2,y3);}}]['forEach'](y2=>{let y4=y2['key'];if(y1[y4])if(Array['isArray'](y1[y4])){let [y3,y5]=y1[y4];y2['set'](ye,y4,y2['get'](ye,y4)['replace'](y3,y5));}else y2['set'](ye,y4,y1[y4]);else y3[y4]&&y2['set'](ye,y4,y3[y4]);});}},y1||0x320);},'block'(y1){let y2=y1||{},y3=y2['onStart']||(y1=>y1),y4=y2['onTimeout']||(y1=>y1),y5=y2['onUnblock']||(y1=>y1),y6=Date['now'](),y7=y2['timeout']||0x1;for(y7<0x64&&(y7*=0xea60),y3(ye);!yb;)Date['now']()-y6>y7&&(this['pause'](0x64),y4(ye)),sleep(0x78);y5(ye);}},ye=Object['create'](ut['builds'](y1,y3)['on']('neutral',()=>yd['neutral']())['on']('negative',()=>yd['negative']())['on']('positive',()=>yd['positive']())),yf={'act':()=>(ye['isShowing']()||ye['show'](),yg),'block':y1=>(yd['block'](y1),yg)},yg=Object['assign'](ye,yf),us=threads['start'](function(){let y1=ut['getContentText'](ye),y2=/%timeout%/,y4=y1['match'](y2)?function(y3){ye['setContent'](y1['replace'](y2,y3['toString']()));}:y1=>y1,y5=y3['timeout_button'],y6=y5&&ye['getActionButton'](y5),yb=y5?function(y1){ye['setActionButton'](y5,y6+'\x20\x20[\x20'+y1+'\x20]');}:y1=>y1;for(;y4(yc),yb(yc),!(yc<=0x0);)yc-=0x1,sleep(0x3e8);let yf=y7;'function'==typeof yf&&(yf=y7(ye)),yd[yf]['call'](yd);});return yg;},'buildFlow'(z8){let z9=this,za=Object['create'](z9['builds']([z8['title']||'',z8['steps']['map']((z8,z9)=>'\u3000\x20'+ ++z9+'.\x20'+z8['desc'])['join']('\x0a'),0x0,0x0,'I',0x1],{'progress':{'max':0x64,'showMinMax':!!z8['show_min_max']}})),zb={'act'(){let zb=new Promise(z9=>{za['on']('positive',()=>{global['_$_dialog_flow_interrupted']=!0x0;}),'function'==typeof z8['onStart']&&z8['onStart'](z8['initial_value'],za),z9(z8['initial_value']);});return z8['steps']['forEach']((z8,zc)=>{zb=zb['then'](zb=>{if(global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);let zk=z9=>(za['setProgress'](0x64),zK(zc+0x1),z8['onSuccess']&&z8['onSuccess'](zb),z9);za['setProgress'](0x0),function(z8){let zb=z8['toString'](),zc=z9['getContentText'](za);z9['setContentText'](za,zc['replace'](/^(. )(\d)(?=\.)/gm,(z8,z9,za)=>(za===zb?'▶\x20':z9)+za));}(zc+0x1);let zs=z8['action'](zb,za);return zs instanceof Promise?(zs=zs['then'](zk),zs):zk(zs);},z8['onFailure']);}),zb=zb['then'](zb=>{if(global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);z9['setProgressColorTheme'](za,'finish'),zK('all'),za['removeAllListeners']('positive'),za['setActionButton']('positive',ut['text']['btn']['F']),za['on']('positive',z8=>z8['dismiss']());let zc=z8['success_title'];zc&&z9['setTitleText'](za,zc);let zw=z8['success_content'];zw&&z9['appendContentText'](za,'\x0a\x0a'+zw),delete global['_$_dialog_flow_interrupted'],'function'==typeof z8['onSuccess']&&z8['onSuccess'](zb,za);}),zb['catch'](z9=>{delete global['_$_dialog_flow_interrupted'],'function'==typeof z8['onFailure']&&z8['onFailure']({'message':z9,'btn_text':ut['text']['btn'][z8['on_interrupt_btn_text']||'B'],'onPositive'(){ut['clearPool'](),exit();}},za);}),za['isShowing']()||za['show'](),zc;},'setStepDesc'(z9,zb,zA){if(z9<0x1)throw Error('step_num\x20is\x20less\x20than\x201');if(z9>=z8['steps']['length'])throw Error('step_num\x20must\x20be\x20less\x20than\x20steps\x20length');let zB=z9['toString'](),zC=za['getContentView'](),zD=zC['getText']()['toString'](),zE=z8['steps'][zB-0x1]['desc'];if(zD['match'](zE)){let z8=(zA?zE:'')+(zb||'');zC['setText'](zD['replace'](zE,z8));}return zc;},'setProgressData'(z8){if('object'==typeof z8){let z9=z8['processed']/z8['total']*0x64||0x0;za['setProgress'](Math['min'](Math['max'](0x0,z9),0x64));}return zc;},'setFailureData':z8=>(za['setActionButton']('positive',z8['btn_text']||ut['text']['btn']['B']),za['removeAllListeners']('positive'),za['on']('positive',z8['onPositive']||(z8=>z8['dismiss']())),ut['alertContent'](za,z8['message'],'append'),zc)},zc=Object['assign'](za,zb);return zc;function zK(z8){let zb='all'!==z8&&z8?z8:0x1/0x0,zc=z9['getContentText'](za);z9['setContentText'](za,zc['replace'](/^(. )(\d)(?=\.)/gm,(z8,z9,za)=>(za<=zb?'✔\x20':z9)+za));}},'buildProgress'(zR){let zS=Object['create'](ut['builds']([zR['title']||'',zR['content']||zR['desc']||'',0x0,0x0,'I',0x1],{'progress':{'max':0x64,'showMinMax':!!zR['show_min_max']}})),zT={'act':()=>(Promise['resolve'](zR['initial_value'])['then'](zT=>('function'==typeof zR['onStart']&&zR['onStart'](zR['initial_value'],zS),zT))['then'](zT=>{if(zS['on']('positive',()=>{global['_$_dialog_flow_interrupted']=!0x0;}),global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);return zR['action'](zT,zS);})['then'](zT=>{if(global['_$_dialog_flow_interrupted'])throw Error(ut['text']['user_interrupted']);ut['setProgressColorTheme'](zS,'finish'),zS['setProgress'](0x64),zS['removeAllListeners']('positive'),zS['setActionButton']('positive',ut['text']['btn']['F']),zS['on']('positive',zR=>zR['dismiss']());let zU=zR['success_title'];zU&&ut['setTitleText'](zS,zU);let A0=zR['success_content'];A0&&ut['appendContentText'](zS,'\x0a\x0a'+A0),delete global['_$_dialog_flow_interrupted'],'function'==typeof zR['onSuccess']&&zR['onSuccess'](zT,zS);})['catch'](zT=>{ut['setProgressColorTheme'](zS,'error'),zS['removeAllListeners']('positive');let zU=ut['text']['btn'][zR['on_interrupt_btn_text']||'B'];zS['setActionButton']('positive',zU),zS['on']('positive',zR=>zR['dismiss']()),ut['alertContent'](zS,zT,'append'),delete global['_$_dialog_flow_interrupted'],'function'==typeof zR['onFailure']&&zR['onFailure'](zT,zS);}),zS['isShowing']()||zS['show'](),zU),'setStepDesc'(zT,A5){let A6=zS['getContentView'](),A7=A6['getText']()['toString'](),A8=zR['content']||'';if(A7['match'](A8)){let zR=(A5?A8:'')+(zT||'');A6['setText'](A7['replace'](A8,zR));}return zU;},'setProgressData':zR=>(zS['setProgress'](zR['processed']/zR['total']*0x64),zU)},zU=Object['assign'](zS,zT);return zU;},'setProgress'(Ab,Ac,Ad){let Ae='object'==typeof Ac?Ac['processed']/Ac['total']*0x64:Ac;ui['run'](()=>Ab['getProgressBar']()['setProgress'](Ae,!!Ad));},'setProgressTintList'(Af,Ag){let Ah=colorsx['toInt'](this['colors']['wrap'](Ag,'progress')),Ai=un['valueOf'](Ah);Af['getProgressBar']()['setProgressTintList'](Ai);},'setProgressTintLists'(Aj,Ak){let Al=Ak;if(!Array['isArray'](Al))if('string'==typeof Al)Al=this['colors']['progress'][Ak]||[Al];else{if('number'!=typeof Al)throw Error('Unknown\x20colors\x20type\x20for\x20dialogsx.setProgressTintLists()');Al=[Al];}let [Am,An]=Al;Am&&this['setProgressTintList'](Aj,Am),An&&this['setProgressBackgroundTintList'](Aj,An);},'setProgressColorTheme'(Ao,Ap){let Aq=Ap;if(!Array['isArray'](Aq))if('string'==typeof Aq)Aq=this['colors']['progress'][Ap]||[Aq];else{if('number'!=typeof Aq)throw Error('Unknown\x20colors\x20type\x20for\x20dialogsx.setProgressColorTheme()');Aq=[Aq];}let [Ar,As,At]=Aq;Ar&&this['setProgressTintList'](Ao,Ar),As&&this['setProgressBackgroundTintList'](Ao,As),At&&this['setActionButtonColor'](Ao,'positive',At);},'setProgressBackgroundTintList'(Au,Av){let Aw=colorsx['toInt'](Av),Ax=un['valueOf'](Aw);Au['getProgressBar']()['setProgressBackgroundTintList'](Ax);},'setProgressNumberFormat'(Ay,Az,AA){ui['run'](()=>Ay['setProgressNumberFormat'](java['lang']['String']['format'](Az,AA)));},'clearProgressNumberFormat'(AB){ui['run'](()=>AB['setProgressNumberFormat'](''));},'performClick'(AC,AD){let AE=String(AD)['toLowerCase'](),AF=this['getDialogAction'](AE);null!==AF&&AC['getActionButton'](AF)['performClick']();},'alerts'(AG,AH){let AI=AH||{},AJ=AG||'',AK=AI['text_color']||'#E5FFFF',AL=AI['text_font_family']||'sans-serif-condensed',AM=AI['text_gravity']||'center',AN=AI['text_line_spacing']||'5cx',AO=AI['text_size']||0x12,AP=AI['button_width']||0x64,AQ=AI['button_text']||'OK',AR=AI['button_text_color']||'#E5FFFF',AS=AI['button_text_size']||0xf,us=AI['button_bg_tint_color']||'#00251A',AU=AI['button_font_family']||'sans-serif',AV=AI['button_layout_gravity']||'center',AW=AI['dialog_bg_color']||colorsx['rgba']('#005B4F91'),AX=AI['dialog_dim_amount']||0x5a,AY=ui['inflate']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20');AY['text']['attr']('text',AJ),AY['text']['attr']('text_color',AK),AY['text']['attr']('text_size',AO),AY['text']['attr']('font_family',AL),AY['text']['attr']('gravity',AM),AY['text']['attr']('line_spacing',AN),AY['btn']['attr']('width',AP),AY['btn']['attr']('text',AQ),AY['btn']['attr']('text_size',AS),AY['btn']['attr']('text_color',AR),AY['btn']['attr']('layout_gravity',AV),AY['btn']['attr']('background_tint',us),AY['btn']['attr']('font_family',AU),AY['btn']['on']('click',()=>AZ['dismiss']());let AZ=this['builds']({'customView':AY,'canceledOnTouchOutside':!0x1,'background':AW,'animation':'input_method','dim_amount':AX,'keycode_back':AG=>AG['dismiss']()})['show']();}};uf['exports']={'dialogsx':ut};},758:(B1,B2,B3)=>{B3(0x2c4);let {consolex:i}=B3(0x2d5),B4=com['stardust']['autojs']['project']['ScriptConfig'],B5=com['stardust']['autojs']['execution']['ExecutionConfig'],B6={get 'my_engine'(){return engines['myEngine']();},get 'my_engine_id'(){return this['my_engine']['getId']();},get 'my_engine_exec_argv'(){let B1=this['my_engine']['getExecArgv'](),B2={};for(let B3 in B1)if(B1['hasOwnProperty'](B3)){let Ba=B1[B3];Ba instanceof java['lang']['Boolean']?B2[B3]=Ba['booleanValue']():Ba instanceof java['lang']['Double']?B2[B3]=Ba['doubleValue']():B2[B3]=Ba;}return B2;},get 'my_engine_src_name'(){return'function'==typeof this['my_engine']['source']['getName']?this['my_engine']['source']['getName']():this['my_engine']['source']['toString']()['replace'](/(.+?)(.(js|auto))?$/,'$1');},get 'all_engines'(){return engines['all']();},get 'cwd'(){return this['my_engine']['cwd']();},get 'cwp'(){return this['isLocal']()?this['my_engine']['source']['toString']():'';},'isLocal'(){return!this['isRemote']();},'isRemote'(){return/^\[remote]/['test'](this['my_engine_src_name']);},'ensureLocal'(){if(!this['isLocal']())throw Error('Script\x20must\x20be\x20running\x20locally\x20rather\x20than\x20remotely');},'execScript':(B1,B2,B3)=>runtime['engines']['execScript'](B1,B2,Bv(B3)),'execScriptFile':(B1,B2)=>{try{return runtime['engines']['execScriptFile'](B1,Bv(B2));}catch(Bg){return engines['execScriptFile'](B1,B2);}},'execAutoFile':(B1,B2)=>runtime['engines']['execAutoFile'](B1,Bv(B2)),'setExecutePath'(B1){if('string'!=typeof B1)throw TypeError('path\x20of\x20enginesx.setExecutePath()\x20must\x20be\x20string\x20type');if(!files['isDir'](B1))throw Error('path\x20of\x20enginesx.setExecutePath()\x20must\x20be\x20a\x20directory');this['my_engine']['setTag']('execute_path',B1);},'restart'(B1){let B2=B1||{},B3=i['debug']['fuel'](B2),B4=this['my_engine_exec_argv'],B5=void 0x0!==B4['max_restart_e_times']?Number(B4['max_restart_e_times']):void 0x0!==B2['max_restart_e_times']?Number(B2['max_restart_e_times']):0x1;if(!B5)return i['$']('引擎重启次数已超限',0x3);let B6=Number(B4['max_restart_e_times_bak'])||B5;if(B3('重启当前引擎任务'),B3('当前次数:\x20'+(B6-B5+0x1),0x0,0x1),B3('最大次数:\x20'+B6,0x0,0x1),this['isRemote']())return i['$']('远程任务不支持重启引擎',0x8,0x4,0x0,0x1);let Bq=B2['new_file']||this['my_engine_src_name'],Br=files['path'](Bq+(Bq['match'](/\.js$/)?'':'.js'));B3('运行新引擎任务:\x0a'+Br),this['execScriptFile'](Br,{'arguments':Object['assign']({},B2,{'max_restart_e_times':B5-0x1,'max_restart_e_times_bak':B6,'is_instant_running':B2['is_instant_running']})}),B3('强制停止旧引擎任务');let Bs=this['my_engine_id'];return this['all_engines']['filter'](B1=>B1['getId']()===Bs)['forEach'](B1=>B1['forceStop']()),!0x0;}};function Bv(B1){let B2=new B5(),B3=B1||{};if(B2['workingDirectory']=B3['path']||files['cwd'](),B2['delay']=B3['delay']||0x0,B2['interval']=B3['interval']||0x0,B2['loopTimes']=void 0x0===B3['loopTimes']?0x1:B3['loopTimes'],Object['keys'](B3['arguments']||{})['forEach'](B1=>B2['setArgument'](B1,B3['arguments'][B1])),'object'==typeof B3['scriptConfig']){let B1=B3['scriptConfig']['useFeatures']||[],BB=void 0x0!==B3['scriptConfig']['uiMode']&&B3['scriptConfig']['uiMode'];B2['scriptConfig']=new B4(B1,BB);}return B2;}B1['exports']={'enginesx':B6};},763:(BC,BD,BE)=>{let {threadsx:i}=BE(0xef),{enginesx:n}=BE(0x2f6),BF=java['io']['File'],BG=java['io']['FileInputStream'],BH=java['io']['FileOutputStream'],BI=java['io']['BufferedInputStream'],BJ=java['io']['BufferedOutputStream'],BK=java['util']['zip']['CheckedOutputStream'],BL=java['util']['zip']['ZipOutputStream'],BM=java['util']['zip']['ZipEntry'],BN=java['util']['zip']['ZipFile'],BO=java['util']['zip']['CRC32'],BP=org['autojs']['autojs']['Pref'],BQ={'copy'(BC,BD,BE){let BV=files['path'](BC),BW=files['path'](BD),BI=BE||{},BJ=BI['onCopyStart']||BI['onStart']||(BC=>BC),BK=BI['onCopyProgress']||BI['onProgress']||(BC=>BC),BL=BI['onCopySuccess']||BI['onSuccess']||(BC=>BC),BM=BI['onCopyFailure']||BI['onFailure']||console['error'];try{return function(BC,BD){BJ(),files['createWithDirs'](BD);let BE=new BF(BD);try{return function(BC,BD,BE){let BW=util['java']['array']('byte',0x2000),BG=new BF(BV)['length'](),BH=0x0;try{for(;BC['available']()>0x0;){let BE=BC['read'](BW);BE>0x0&&(BD['write'](BW,0x0,BE),BK({'processed':BH+=BE,'total':BG}));}BE&&(BC['close'](),BD['close']()),BL();}catch(Cf){BM(Cf);}}(BC,new BH(BE),!0x0),!0x0;}catch(Cg){return BM(Cg),!0x1;}}(new BG(BV),BW);}catch(Ch){return BM(Ch),!0x1;}}},BR={'sep':BF['separator'],'json':{'replacer':(BC,BD)=>'number'!=typeof BD||!isNaN(BD)&&isFinite(BD)?BD:'\ufeff'+BD['toString']()+'\ufeff','reviver'(BC,BD){let BE=/^\ufeff(.+)\ufeff$/;return'string'==typeof BD&&BD['match'](BE)?Number(BD['replace'](BE,'$1')):BD;}},'.local'(BC){let BD=files['join'](files['getSdcardPath'](),'.local');files['isFile'](BD)&&files['remove'](BD);let BE=files['join']['apply'](files,[BD]['concat']([]['slice']['call'](arguments)));return files['createWithDirs'](BE['slice'](0x0,BE['lastIndexOf'](this['sep'])+0x1)),BE;},'run'(BC,BD){BC['match'](/^(launcher|settings)\$$/)&&(BC='ant-forest-'+BC['slice'](0x0,-0x1)+'.js');let BE=files['path'](BC['match'](/\.js$/)?BC:BC+'.js');return'object'==typeof BD?(BD['monitor']&&(i['monitor'](BD['monitor']),delete BD['monitor']),n['execScriptFile'](BE,{'arguments':BD})):n['execScriptFile'](BE,null);},'zip'(BC,BD,BE,Cw){let Cx,BJ,BN,BP,BQ,CC=function(){global['_$_dialog_flow_interrupted']=!0x1,[BQ,BP,BN,BJ,Cx]['forEach'](BC=>{try{BC&&BC['close']();}catch(CI){}});},CD=BE||{},CE=Cw||{},CF=BC=>{let BD=CD['onZipFailure']||CD['onFailure'];return'function'==typeof BD?BD(BC):toastLog(BC),!0x1;},CG=CD['onZipStart']||CD['onStart'];'function'==typeof CG&&CG();let CL=files['path'](BC);if(!files['exists'](CL))throw Error('无效的压缩源');let CM=new BF(CL);CL=CM['getAbsolutePath']();let CN=BD?files['path'](BD):CL+'.zip',CO=new BF(CN);CN=CO['getAbsolutePath'](),'zip'!==files['getExtension'](CN)&&(CO=new BF(CN+='.zip')),files['exists'](CN)&&files['remove'](CN);let CP=0x0,CQ=this['getDirSize'](CL);try{BN=new BH(CO),BP=new BK(BN,new BO()),BQ=new BL(BP),function(BC){return CE['is_exclude_root_folder']&&BC['isDirectory']()?BC['listFiles']()['filter'](BC=>BC['getAbsolutePath']()!==CO['getAbsolutePath']())['forEach'](BC=>BD(BC)):BD(BC);function BD(BC,BE){let Cw=(BE?BE+BR['sep']:'')+BC['getName']();if(BC['isFile']()){let BD,BE=0x400,BF=util['java']['array']('byte',BE);for(BQ['putNextEntry'](new BM(Cw)),Cx=new BG(BC),BJ=new BI(Cx);(BD=BJ['read'](BF,0x0,BE))>-0x1;){if(global['_$_dialog_flow_interrupted'])return CC(),CF('用户终止');BQ['write'](BF,0x0,BD);}BQ['closeEntry'](),BJ['close'](),Cx['close']();let BH=CD['onZipProgress']||CD['onProgress'];'function'==typeof BH&&BH({'processed':CP+=BC['length'](),'total':CQ});}else BC['listFiles']()['filter'](BC=>BC['getAbsolutePath']()!==CO['getAbsolutePath']())['forEach'](BC=>BD(BC,Cw));}}(CM),CC();let BC=CD['onZipSuccess']||CD['onSuccess'];return'function'==typeof BC&&BC({'zipped_path':CN}),CE['is_delete_source']&&this['removeWithDirs'](CL,{'isAsync':!0x0}),!0x0;}catch(D5){return CF('压缩失败:\x0a'+D5);}},'unzip'(BC,BD,BE,D9){let Da,BG,BK,BL=function(){global['_$_dialog_flow_interrupted']=!0x1,[BG,Da,BK]['forEach'](BC=>{try{BC&&BC['close']();}catch(Di){}});},BM=BE||{},BO=BC=>{let BD=BM['onUnzipFailure']||BM['onFailure'];return'function'==typeof BD?BD(BC):toastLog(BC),!0x1;},BP=BM['onUnzipStart']||BM['onStart'];'function'==typeof BP&&BP();let BQ=D9||{},Dm=files['path'](BC);if(files['exists'](Dm)||(Dm+='.zip'),!files['exists'](Dm))throw Error('解压缩源不存在');let Dn=new BF(Dm),Do=Dn['length'](),Dp=Dn['getName'](),Dq=Dp['slice'](0x0,Dp['lastIndexOf']('.')),Dr=files['path'](BD);Dr&&files['exists'](Dr)||(Dr=Dm['slice'](0x0,Dm['lastIndexOf'](this['sep']))),BQ['to_archive_name_folder']&&(Dr=files['join'](Dr,Dq)),files['createWithDirs'](Dr+this['sep']);try{let BC=0x0,BD=0x400,BE=util['java']['array']('byte',BD),D9=new BN(Dn),BP=D9['entries']();for(;BP['hasMoreElements']();){let BN=BP['nextElement'](),BQ=BN['getCompressedSize'](),Dm=BN['getName'](),Dn=files['join'](Dr,Dm);files['createWithDirs'](Dn+(BN['isDirectory']()?BR['sep']:''));let Dp=new BF(Dn);if(Dp['isDirectory']())continue;let Dq=-0x1;for(Da=new BH(Dp),BG=new BJ(Da),BK=new BI(D9['getInputStream'](BN));(Dq=BK['read'](BE,0x0,BD))>-0x1;){if(global['_$_dialog_flow_interrupted'])return BL(),BO('用户终止');Da['write'](BE,0x0,Dq);}let DD=BM['onUnzipProgress']||BM['onProgress'];'function'==typeof DD&&DD({'processed':BC+=BQ,'total':Do});}BL();let Dp=BM['onUnzipSuccess']||BM['onSuccess'];return'function'==typeof Dp&&Dp({'unzipped_path':Dr}),BQ['is_delete_source']&&this['removeWithDirs'](Dm,{'isAsync':!0x0}),!0x0;}catch(DF){return BO('解压失败:\x0a'+DF);}},'isValidZip'(BC){let BD=files['path'](BC);if(!BD||!files['exists'](BD))return!0x1;let BE=new BF(BD);if('zip'!==files['getExtension'](BE['getName']()))return!0x1;let DJ=null;try{return DJ=new BN(BE),!0x0;}catch(DK){return!0x1;}finally{try{null!==DJ&&(DJ['close'](),DJ=null);}catch(DL){}}},'copy'(BC,BD,BE,DP){let BG=DP||{},BH=BG['onCopyStart']||BG['onStart']||(BC=>BC),BI=BG['onCopyProgress']||BG['onProgress']||(BC=>BC),BJ=BG['onCopySuccess']||BG['onSuccess']||(BC=>BC),BK=BG['onCopyFailure']||BG['onFailure']||console['error'];BC&&BD||BK('Source\x20and\x20target\x20path\x20must\x20be\x20both\x20defined'),files['isDir'](BD)||BK('Target\x20path\x20must\x20be\x20a\x20directory');let BL=new BF(files['path'](BC))['getAbsolutePath'](),BM=new BF(files['path'](BD))['getAbsolutePath'](),BN=BE||{},BO=BN['is_unbundled'],BP=()=>{let BC=!0x0,BD=0x0,BE=0x1,E6=(DP,BF)=>{let BG=files['join'](BF,files['getName'](DP));files['isFile'](DP)?(BQ['copy'](DP,BG)||(BC=!0x1),BI({'processed':BD+=0x1,'total':BE})):files['listDir'](DP)['forEach'](BC=>{E6(files['join'](DP,BC),BG);});};if('function'==typeof BH&&BH(),files['isDir'](BL)){BO||(BM=files['join'](BM,files['getName'](BL)));let BC=files['listDir'](BL,function(BC){return'function'!=typeof BN['filter']||BN['filter'](BC);});BE=BC['length'],BC['forEach'](BC=>E6(files['join'](BL,BC),BM));}else E6(BL,BM);return BC&&BJ(),BC||BK('An\x20error\x20has\x20occurred\x20in\x20files.copy()'),BC;};if(!BN['isAsync'])return BP();i['start'](BP);},'getScriptDirPath':()=>'function'==typeof BP['getScriptDirPath']?BP['getScriptDirPath']():com['stardust']['autojs']['core']['pref']['Pref']['INSTANCE']['getScriptDirPath'](),'isScriptDirPath'(BC){return new BF(files['path'](BC))['getAbsolutePath']()===this['getScriptDirPath']();},'getDirSize'(BC){let BD=files['path'](BC);if(!files['exists'](BD))throw Error('path\x20of\x20filesx.getDirSize()\x20is\x20not\x20exist');return files['isFile'](BD)?new BF(BD)['length']():new BF(BD)['listFiles']()['reduce']((BC,BD)=>BC+(BD['isDirectory']()?this['getDirSize'](BD):BD['length']()),0x0);},'removeWithDirs'(BC,BD,BE){let Em=BD||{},BF=BE||{},BG=BF['onRemoveStart']||BF['onStart']||(BC=>BC),BH=BF['onRemoveProgress']||BF['onProgress']||(BC=>BC),BI=BF['onRemoveSuccess']||BF['onSuccess']||(BC=>BC),BJ=BF['onRemoveFailure']||BF['onFailure']||console['error'],BK=0x0,BL=0x1,BM=()=>{let BD=!0x0;if(BG(),files['isFile'](BC))BD=BN(BC);else{if(!files['isDir'](BC))throw Error('Cannot\x20parse\x20path\x20for\x20filesx.removeWithDirs()');{let BE=files['listDir'](BC);BL=BE['length'],BE['forEach'](BE=>{BD=BN(files['join'](BC,BE))&&BD;}),files['remove'](BC);}}return BD&&BI(),BD||BJ('An\x20error\x20has\x20occurred\x20in\x20files.removeWithDirs()'),BD;},BN=BC=>{let BD=files['isDir'](BC)?files['removeDir'](BC):!!files['isFile'](BC)&&files['remove'](BC);return BH({'progress':BK+=0x1,'total':BL}),BD;};try{return Em['isAsync']?i['start'](BM):BM();}catch(EE){BJ(EE);}},'listAllFiles'(BC){let BD=[];return'string'==typeof BC&&(BC=new BF(files['path'](BC))),function BC(BE){BE['isFile']()?BD['push'](BE):BE['isDirectory']()&&(BD['push'](BE),BE['listFiles']()['forEach'](BC));}(BC),BD;},'deleteRecursively'(BC){if('string'==typeof BC&&(BC=new BF(files['path'](BC))),BC['isDirectory']()){let BD=BC['listFiles']();if(null!==BD&&!BD['every'](BC=>this['deleteRecursively'](BC)))return!0x1;}return BC['delete']();},'deleteByList'(BC,BD,BE){let EO=this,BF=BD||{},BG=BE||{},BH=BG['onDeleteStart']||BG['onStart']||(BC=>BC),BI=BG['onDeleteProgress']||BG['onProgress']||(BC=>BC),BJ=BG['onDeleteSuccess']||BG['onSuccess']||(BC=>BC),BK=BG['onDeleteFailure']||BG['onFailure']||console['error'];if(BF['isAsync'])return BL();function BL(){BH();let BD=!0x0,BE=EO['listAllFiles'](BC)['reverse'](),F1=0x0,BF=BE['length'];return BE['forEach'](BC=>{BD=BC['delete']()&&BD,BI({'processed':F1+=0x1,'total':BF});}),BD&&BJ(),BD||BK('An\x20error\x20has\x20occurred\x20in\x20files.deleteByList()'),BD;}i['start'](BL);},'read'(BC,BD){let BE=null;return files['exists'](BC)&&(BE=files['read'](BC)),BE||(void 0x0===BD?BE:BD);},'readJson'(BC,BD,BE){let Fa=void 0x0===BD?{}:BD;try{return JSON['parse'](this['read'](BC),BE||this['json']['reviver'])||Fa;}catch(Fb){return Fa;}},'write'(BC,BD){BC&&!files['exists'](BC)&&files['createWithDirs'](BC),files['write'](BC,BD);},'writeJson'(BC,BD,BE){this['write'](BC,JSON['stringify'](BD,BE||this['json']['replacer']));}};BC['exports']={'filesx':BR};},131:(Fh,Fi,Fj)=>{let {threadsx:i}=Fj(0xef),Fk=java['net']['URL'],Fl=java['io']['File'],Fm=java['lang']['StringBuilder'],Fn=java['io']['BufferedReader'],Fo=java['io']['FileOutputStream'],Fp=java['io']['InputStreamReader'],Fq=java['io']['BufferedInputStream'],Fr=java['io']['BufferedOutputStream'],Fs=java['lang']['reflect']['Array'],Ft=okhttp3['Request']['Builder'],Fu={'getContentLength'(Fh,Fi,Fj){if('string'!=typeof Fh)throw Error('url\x20for\x20httpx.getContentLength()\x20is\x20required');if('function'!=typeof Fi)throw Error('callback\x20for\x20httpx.getContentLength()\x20is\x20required');let Fl=Fj||{},Fm=Fl['timeout']||0x2710,Fn=Date['now']()+Fm,Fo=i['atomic'](-0x1),Fp=function(Fj){let Fl=i['start'](function(){try{let Fj=new Fk(Fh)['openConnection']();Fj['setRequestProperty']('Accept-Encoding','identity'),Fj['setConnectTimeout'](Fm);let FH=Fj['getContentLengthLong']();Fj['disconnect'](),-0x1!==FH&&Fo['compareAndSet'](-0x1,FH)&&Fi(Fo['get']());}catch(FI){}});i['start'](function(){try{for(;;){if(Fo['get']()>0x0)return Fl['interrupt']();if(Date['now']()>=Fn)return Fj(-0x1),Fl['interrupt']();sleep(0x78);}}catch(FJ){}});},Fq=Fl['concurrence']||0xc;for(let Fh=0x0;FhFh),FS=Fk['onResponse']||(Fh=>Fh),FT=Fk['onDownloadProgress']||(Fh=>Fh),FU=Fk['onDownloadSuccess']||(Fh=>Fh),FV=Fh=>{if('function'!=typeof Fk['onDownloadFailure'])throw Error(Fh+'\x0a'+Fh['stack']);Fk['onDownloadFailure'](Fh);};if(!Fh)return FV('url\x20for\x20httpx.okhttp3Request()\x20is\x20required');if(void 0x0!==Fu['isAsync']&&!Fu['isAsync'])return G1();function G1(){try{let Fi;FR();let Fj=new Ft();Object['keys'](Fu['headers']||{})['forEach'](Fh=>{Fj['addHeader'](Fh,Fu['headers'][Fh]);});let G5=new OkHttpClient()['newCall'](Fj['url'](Fh)['get']()['build']())['execute']();FS(G5);let Fk=0x1000,G1=Fs['newInstance'](java['lang']['Byte']['TYPE'],Fk),G8=0x0,G9=G5['code']();0xc8!==G9&&FV(G9+'\x20'+G5['message']());let Ga=G5['body']()['byteStream'](),Gb=G5['body']()['contentLength']();if('string'==typeof FQ){let Fh=-0x1,Fj=new Fq(Ga),G5=new Fo(new Fl(files['path'](FQ))),Fm=new Fr(G5);for(;-0x1!==(Fh=Fj['read'](G1,0x0,Fk));)global['_$_dialog_flow_interrupted']&&(Gl([Fm,G5,Fj,Ga]),FV('用户终止')),G5['write'](G1,0x0,Fh),G8+=Fh,FT({'processed':G8,'total':Gb});Gl([Fm,G5,Fj,Ga]),FU({'downloaded_path':Fi=FQ});}else{let Fh=new Fp(Ga),Fj=new Fn(Fh),G5=new Fm(),Fk=null;for(;null!==(Fk=Fj['readLine']());)global['_$_dialog_flow_interrupted']&&(Gl([Fj,Fh,Ga]),FV('用户终止')),G5['append'](Fk)['append']('\x0d\x0a'),G8+=Fk['length'],FT({'processed':G8,'total':Gb});Gl([Fj,Fh,Ga]),FU({'downloaded_string':Fi=G5['toString']()});}return Fi;}catch(Gk){FV('请求失败:\x0a'+Gk);}}function Gl(Fh){Fh['forEach'](Fh=>{try{Fh&&Fh['close']();}catch(Go){}}),global['_$_dialog_flow_interrupted']=!0x1;}i['start'](G1);}};Fh['exports']={'httpx':Fu};},220:(Gp,Gq,Gr)=>{let {isNullish:i,isObjectSpecies:n}=Gr(0x2c4),{filesx:s}=Gr(0x2fb),{cryptox:o}=Gr(0xbe),Gs=function(){let Gp={'parseFile'(Gp){let Gq=s['read'](Gp,'');try{return Gq?JSON['parse'](Gq,s['json']['reviver']):{};}catch(Gy){console['warn']('JSON.parse()解析配置文件异常');}try{return this['tryRepairEscChar'](Gp,Gq);}catch(Gz){console['warn']('转义字符修复失败');}try{return this['tryRepairMojibakeLines'](Gp,Gq);}catch(GA){console['warn']('乱码行修复失败');}this['failAndBackup'](Gp);},'tryRepairEscChar'(Gp,Gq){console['warn']('尝试查找并修复异常的转义字符');let Gr=/[ntrfb\\'"0xu]/,GE='';for(let Gp in Gq){let GG=+Gp,GH=Gq[GG];if('\x5c'===GH){let Gp=Gq[GG-0x1],GE=Gq[GG+0x1];Gp&&GE&&'\x5c'!==Gp&&!GE['match'](Gr)&&(GH+='\x5c');}GE+=GH;}return this['writeBackFileAndParse'](Gp,GE);},'tryRepairMojibakeLines'(Gp,Gq){console['warn']('尝试查找并修复异常的乱码行');let Gr=Gq['split']('\x0a');for(;Gr['length']>0x0;)try{return Gr['pop'](),this['writeBackFileAndParse'](Gp,Gr['join']('\x0a'));}catch(GN){}throw Error('Failed\x20to\x20repair\x20mojibake\x20lines');},'writeBackFileAndParse'(Gp,Gq){let Gr=JSON['parse'](Gq,s['json']['reviver']);return console['info']('修复成功'),s['write'](Gp,Gq),console['info']('已重新写入修复后的数据'),Gr;},'failAndBackup'(Gp){let Gq=files['getName'](Gp)+'.'+Date['now']()+'.bak';throw files['rename'](Gp,Gq),console['error']('修复失败'),console['warn']('已将损坏的配置文件备份至'),console['warn'](files['join'](s['.local'](),Gq)),console['warn']('以供手动排查配置文件中的问题'),Error('JSON.parse()\x20failed\x20in\x20ext-storages');},'getKeyInput'(){let Gp=files['join'](s['.local'](),'key.nfex'),Gq=s['readJson'](Gp,{});return Gq['af']||(Gq['af']=o['generateRandomKeyInput'](),s['writeJson'](Gp,Gq)),Gq['af'];},'encrypt'(Gp){if(i(Gp))throw TypeError('Nullish\x20typed\x20value\x20cannot\x20be\x20encrypted');return o['enc'](Gp['toString'](),this['getKeyInput']());},'decrypt'(Gp){if(i(Gp))throw TypeError('Non-string\x20typed\x20value\x20cannot\x20be\x20decrypted');return o['dec'](Gp['toString'](),this['getKeyInput']());},'reEncryptFromLegacyFile'(Gp){let Gq=this['parseFile'](Gp),Gr=Gp=>{if(n(Gp))return(Gp=>(Object['keys'](Gp)['forEach'](Gq=>Gp[Gq]=Gr(Gp[Gq])),Gp))(Gp);if('string'==typeof Gp&&Gp['startsWith']('[')&&Gp['endsWith'](']')){let Gq=o['_pwmap']['decrypt'](Gp);if(!i(Gq))return this['encrypt'](Gq);}return Gp;};s['writeJson'](Gp,Gr(Gq));}},Gq=function(Gq){this['name']=Gq,this['dir']=s['.local'](),this['path_legacy']=files['join'](this['dir'],this['name']+'.nfe'),this['path']=this['path_legacy']+'x',files['exists'](this['path'])||(files['exists'](this['path_legacy'])?(files['copy'](this['path_legacy'],this['path']),Gp['reEncryptFromLegacyFile'](this['path'])):files['createWithDirs'](this['path']));};return Gq['prototype']={'constructor':Gq,'contains'(Gq){return Gq in Gp['parseFile'](this['path']);},'put'(Gq,Gr,H8){if(void 0x0===Gr)throw new TypeError('\x22put\x22\x20value\x20can\x27t\x20be\x20undefined');let H9={},Gs={},Gt=H8||{},Hc=Gq=>Gp['encrypt'](JSON['stringify'](Gq,s['json']['replacer'])),Hd=Gp=>{if(!Gt['is_crypto'])return Gp;if(!n(Gp)||Gt['is_forcible'])return Hc(Gp);let Gq={};return Object['keys'](Gp)['forEach'](Gr=>Gq[Gr]=Hc(Gp[Gr])),Gq;};try{H9=Gp['parseFile'](this['path']);}catch(Hi){console['warn'](Hi['message']);}!Gt['is_forcible']&&n(Gr)&&n(H9[Gq])&&Object['keys'](Gr)['length']>0x0?Gs[Gq]=Object['assign'](H9[Gq],Hd(Gr)):Gs[Gq]=Hd(Gr),Object['assign'](H9,Gs),s['writeJson'](this['path'],H9);},'get'(Gq,Gr,Hl){if(void 0x0===Hl&&'object'==typeof Gr){let Gp=['default','prop','is_crypto'],Hn=Object['keys'](Gr);if(Gp['some'](Gp=>Hn['indexOf'](Gp)>-0x1))return this['get'](Gq,Gr['default'],Gr);}let Hp=Gp['parseFile'](this['path']),Gs=Hl||{};if(Hp&&Gq in Hp){let Gr=Hp[Gq];if(void 0x0!==Gs['prop']&&(Array['isArray'](Gs['prop'])?Gs['prop']['forEach'](Gp=>Gr=Gr[Gp]):Gr=Gr[Gs['prop']]),i(Gr))return Gr;if(Gs['is_crypto']){let Gq=Gp['decrypt'](Gr);try{return JSON['parse'](Gq,s['json']['reviver']);}catch(Hu){return Gq;}}return Gr;}return void 0x0!==Gs['default']?Gs['default']:Gr;},'remove'(Gq){let Gr=Gp['parseFile'](this['path']);Gq in Gr&&(delete Gr[Gq],s['writeJson'](this['path'],Gr));},'clear'(){files['remove'](this['path']);}},Gq;}(),Gt={'@default':Gr(0xd9),get 'af'(){return this['_af']=this['_af']||this['create']('af');},get 'af_auto'(){return this['_af_auto']=this['_af_auto']||this['create']('af_auto');},get 'af_bak'(){return this['_af_bak']=this['_af_bak']||this['create']('af_bak');},get 'af_blist'(){return this['_af_blist']=this['_af_blist']||this['create']('af_blist');},get 'af_cfg'(){return this['_af_cfg']=this['_af_cfg']||this['create']('af_cfg');},get 'af_flist'(){return this['_af_flist']=this['_af_flist']||this['create']('af_flist');},get 'af_ins'(){return this['_af_ins']=this['_af_ins']||this['create']('af_ins');},get 'unlock'(){return this['_unlock']=this['_unlock']||this['create']('unlock');},'create':Gp=>new Gs(Gp),'remove'(Gp){this['create'](Gp)['clear']();}};Gp['exports']={'storagesx':Gt};},239:(Hz,HA,HB)=>{let {isNormalFunction:i,isArrowFunction:n}=HB(0x2c4),{a11yx:s}=HB(0x2d4),HC=java['lang']['Runnable'],HD=java['lang']['Throwable'],HE=java['util']['concurrent']['atomic']['AtomicLong'],HF=com['stardust']['autojs']['core']['looper']['TimerThread'],HG=com['stardust']['autojs']['runtime']['exception']['ScriptInterruptedException'],HH={'_monitor_preset':{'ensure_open':Hz=>{let HA=void 0x0===Hz?0x1068:Hz||0x1/0x0;return s['waitAndClick'](/打开/,HA,0xf0,{'cs$':'w'});}},'_start'(Hz){let HA=threads['start'](Hz);return Object['create'](HA,{'join':{'value'(Hz){Hz===0x1/0x0||void 0x0===Hz?Hz=0x0:Hz<0x1&&(Hz=0x1),HA['join'](Hz);}}});},'monitor'(Hz,HA){let HB='string'==typeof Hz?this['_monitor_preset'][Hz]:Hz;if('function'==typeof HB)return this['start'](()=>HB['apply'](null,[]['slice']['call'](arguments)['slice'](0x1)));if(HB instanceof HC)return this['start'](HB);throw TypeError('Invalid\x20monitor:\x20'+Hz);},'monitorIFN'(Hz,HA){if(void 0x0!==Hz)return this['monitor']['apply'](this,arguments);},'start'(Hz,HA){let HB=HA||{},HV=!0x0;try{if(i(Hz)||Hz instanceof HC)return this['_start'](Hz);if(n(Hz))return this['_start'](new HC({'run':()=>Hz()}));HV=!0x1;}catch(HW){if(!HG['causedByInterrupted'](new HD(HW))&&!HW['message']['match'](/script exiting/)&&!0x1!==HB['isErrorEnabled'])throw Error(HW+'\x0a'+HW['stack']);}if(!HV)throw TypeError('Unsupported\x20type\x20\x22'+typeof Hz+'\x22\x20for\x20threads.start()');},'atomic'(Hz){let HA=threads['atomic'](Hz);if(HA instanceof HE)return HA;let HB=Hz;return{'get':()=>HB,'incrementAndGet':()=>HB+=0x1,'compareAndSet':(Hz,HA)=>HB===Hz&&(HB=HA,!0x0)};},'interrupt'(Hz){Hz instanceof HF&&Hz['isAlive']()&&Hz['interrupt']();}};Hz['exports']={'threadsx':HH};},855:(I3,I4,I5)=>{let {isNullish:i}=I5(0x2c4),{threadsx:n}=I5(0xef),I6=context['getPackageName']()['match'](/Pro\b/i),I7=I6?com['stardust']['autojs']['core']['timing']:org['autojs']['autojs']['timing'],I8=I6?I7['TimedTask']['Companion']:I7['TimedTask'],I9=I7['TimedTaskManager'],Ia=I6?I9['Companion']['getInstance']():I9['getInstance'](),Ib=global['require']('__bridges__'),Ic=['monday','tuesday','wednesday','thursday','friday','saturday','sunday','mon','tue','wed','thu','fri','sat','sun','一','二','三','四','五','六','日',0x1,0x2,0x3,0x4,0x5,0x6,0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7]['map'](I3=>'string'==typeof I3?I3:I3['toString']()),Id={'_taskFulfilled'(I3,I4){if(!I3)return null;let I5=I4||{},Ii='function'==typeof I5['condition']?I5['condition']:()=>I3['id']>0x0,I6='function'==typeof I5['callback']?I5['callback']:null,I7=0xbb8,I8=()=>{for(;I7>0x0;){if(Ii())return I6?I6(I3):I3;sleep(0x78),I7-=0x78;}return null;};if(!I5['isAsync'])return I8();n['start'](I8);},'addTask':I3=>(I3&&(I6?Ia['addTaskSync'](I3):Ia['addTask'](I3)),I3||null),'addDailyTask'(I3){let I4=I3||{},I5=JS('LocalTime',I4['time']||Date['now']()),Iq=files['path'](I4['path']),Ir=JP(I4),I6=this['addTask'](I8['dailyTask'](I5,Iq,Ir));return this['_taskFulfilled'](I6,I4);},'addWeeklyTask'(I3){let I4=I3||{},I5=0x0;for(let I3=0x0;I3Ia['getTimedTask'](I3),'getIntentTask':I3=>Ia['getIntentTask'](I3),'removeTask':I3=>I3?(I6?Ia['removeTaskSync'](I3):Ia['removeTask'](I3),I3):null,'removeIntentTask'(I3,I4){let I5=I4||{},IU=this['removeTask'](this['getIntentTask'](I3));return this['_taskFulfilled'](IU,Object['assign'](I5,{'condition':()=>!this['getIntentTask'](I3)}));},'removeTimedTask'(I3,I4){let I5=I4||{},IY=this['removeTask'](this['getTimedTask'](I3));return this['_taskFulfilled'](IY,Object['assign'](I5,{'condition':()=>!this['getTimedTask'](I3)}));},'updateTask':I3=>I3?(I3['setScheduled'](!0x1),Ia['updateTask'](I3),I3):null,'queryTimedTasks'(I3){let I4='',I5=[],J3=(I3||{})['path'];var J4;if(J3&&(J4='script_path\x20=\x20?',I4+=I4['length']?'\x20AND\x20'+J4:J4,I5['push'](J3)),I6){let I3=Ia['queryTimedTasks']['call'](Ia,I4||null,I5);return Ib['toArray'](I3);}let I7=Ia['getAllTasksAsList']()['toArray']();return J3?I7['filter'](I3=>I3['getScriptPath']()===J3):I7;},'queryIntentTasks'(I3){let I4=I3||{},I5='',Jb=[],Jc=I3=>I5+=I5['length']?'\x20AND\x20'+I3:I3,{path:I7,action:I8}=I4;if(I7&&(Jc('script_path\x20=\x20?'),Jb['push'](I7)),I8&&(Jc('action\x20=\x20?'),Jb['push'](I8)),I6){let I3=Ia['queryIntentTasks']['call'](Ia,I5||null,Jb);return Ib['toArray'](I3);}let I9=Ia['getAllIntentTasksAsList']()['toArray']();return I7||I8?I9['filter'](I3=>!(I7&&I3['getScriptPath']()!==I7||I8&&I3['getAction']()!==I8)):I9;},'timeFlagConverter'(I3){if(Array['isArray'](I3))return Array(0x7)['fill'](0x0)['reduce']((I4,I5,Jk)=>I4+(I3['includes'](Jk)?Math['pow'](0x2,Jk):0x0),0x0);let I4=[],I5=Number(I3)['toString'](0x2),Jn=I5['length']-0x1;for(let I3 of I5)I3>0x0&&I4['unshift'](Jn),Jn-=0x1;return I4;},'setInterval'(I3,I4,I5,Js){({'init_ts':Date['now'](),'interval':I4>0x0?I4:0xc8,'timeout':I5>0x0?I5:0x1/0x0,'isTimedOut'(){return'function'!=typeof this['_isTimedOut']&&(this['_isTimedOut']='function'==typeof I5?I5['bind'](this):()=>Date['now']()-this['init_ts']>this['timeout']),this['timeout_result']=this['_isTimedOut'](),!0x1!==this['timeout_result']&&!i(this['timeout_result']);},'relayIFN'(){this['isTimedOut']()?'function'==typeof Js&&Js['call'](this,this['timeout_result']):this['setTimeout']();},'run'(){I3(),this['relayIFN']();},'setTimeout'(){setTimeout(this['run']['bind'](this),this['interval']);}}['setTimeout']());},'$rec'(){let I3={'keys':{},'anonymity':[],'ts':I3=>'number'==typeof I3?I3:Date['now'](),'has'(I3){return I3 in this['keys'];},'add'(I3,I4){return void 0x0===I3?this['anonymity']['push'](this['ts'](I4)):this['keys'][I3]=this['ts'](I4),this['ts'](I4);},'get'(I3){return void 0x0===I3?this['anonymity']['pop']():this['keys'][I3];},'save'(I3,I4){return this['add'](I3,I4);},'load'(I3,I4){return this['ts'](I4)-this['get'](I3);},'shortcut'(I3,I4){return'function'==typeof I3?(this['save'](),I3['call'](I4),this['load']()):void 0x0!==I3?this['has'](I3)?this['load'](I3,I4):this['save'](I3,I4):this['anonymity']['length']?this['load']():this['save']();}};return this['rec']=function(I4,I5){return I3['shortcut'](I4,I5);},this['rec']['save']=(I4,I5)=>I3['save'](I4,I5),this['rec']['load']=(I4,I5)=>I3['load'](I4,I5),this['rec']['lt']=(I3,I4)=>this['rec']['load'](I3)this['rec']['load'](I3)>I4,this['rec']['clear']=()=>{I3['keys']={},I3['anonymity']['splice'](0x0);},delete this['$rec'],this;},'$bind'(){return this['$rec'](),delete this['$bind'],this;}};function JP(I3){let I4=new com['stardust']['autojs']['execution']['ExecutionConfig']();return I4['delay']=I3['delay']||0x0,I4['interval']=I3['interval']||0x0,I4['loopTimes']=void 0x0===I3['loopTimes']?0x1:I3['loopTimes'],I4;}function JS(I3,I4){let I5=I6?I3:org['joda']['time'][I3],JW=I4,JX=()=>JW['getTime']();if('string'==typeof I4)return I6?I8['parseDateTime']['call'](I8,I5,JW):I5['parse'](JW);if(I4 instanceof Date)return I6?I8['parseDateTime']['call'](I8,I5,JX()):new I5(JX());if('number'==typeof I4)return I6?I8['parseDateTime']['call'](I8,I5,JW):new I5(JW);throw new Error('Cannot\x20parse\x20date\x20time:\x20'+I4);}Id['$bind'](),I3['exports']={'timersx':Id};},708:JY=>{let JZ=android['os']['Looper'],K0=android['widget']['Toast'],K1=java['lang']['Runnable'],K2=java['util']['zip']['GZIPInputStream'],K3=java['io']['ByteArrayInputStream'],K4=java['io']['ByteArrayOutputStream'];global['de']=Packages['de'],global['okhttp3']=Packages['okhttp3'],global['androidx']=Packages['androidx'];let K5={'compare':{'<':(JY,JZ)=>JYJY<=JZ,'>':(JY,JZ)=>JY>JZ,'>=':(JY,JZ)=>JY>=JZ,'=':(JY,JZ)=>JY===JZ},'isNullish':JY=>null==JY,'isObjectSpecies':JY=>'Object'===Object['prototype']['toString']['call'](JY)['slice'](0x8,-0x1)},K6={'string'(){String['prototype']['toTitleCase']||Object['defineProperty'](String['prototype'],'toTitleCase',{'value'(){return this['replace'](/([A-Za-z])([A-Za-z]*)/g,(JY,JZ,K0)=>JZ['toUpperCase']()+K0['toLowerCase']());}}),String['prototype']['capitalize']||Object['defineProperty'](String['prototype'],'capitalize',{'value'(){return this['valueOf']()['replace'](/\b\w+\b/g,JY=>JY['charAt'](0x0)['toUpperCase']()+JY['slice'](0x1));}}),String['prototype']['surround']||Object['defineProperty'](String['prototype'],'surround',{'value'(JY,JZ){if(K5['isNullish'](JY))return this['valueOf']();let K0=JZ||{},K1=void 0x0===K0['no_intelli_brackets']||!K0['no_intelli_brackets'],K2=void 0x0===K0['no_symmetrical']||!K0['no_symmetrical'],K3=['()','[]','{}','<>','()','[]','{}','〈〉','《》','〔〕','【】','〖〗','‘’','“”'],K4=function(JY){let JZ={};return JY['forEach'](JY=>{JZ[JY[0x0]]=JY[0x1],JZ[JY[0x1]]=JY[0x0];}),JZ;}(K3),K6=JY['toString'](),Kv=K6['split'](''),Kw=K6['split']('');if(K1){let JY=[];!function(JY,JZ,K0){let K1=JZ||['()','[]','{}'],K2=function(JY){let JZ={};return JY['forEach'](JY=>JZ[JY[0x0]]=JY[0x1]),JZ;}(K1),K3=function(JY){let JZ={};return JY['forEach'](JY=>JZ[JY[0x1]]=JY[0x0]),JZ;}(K1),K4=[];(K0=K0||[])[0x0]=[],K0[0x1]=[];for(let JZ of JY)if(JZ in K2)K4['push'](JZ),K0[0x0]['push'](JZ);else{if(!(JZ in K3))return!0x1;if(K3[JZ]!==K4['pop']())return!0x1;K0[0x1]['push'](JZ);}return!K4['length'];}(K6,K3,JY)?Kv['forEach']((JY,JZ)=>{JY in K4&&(Kw[JZ]=K4[JY]);}):[Kv,Kw]=JY;}return K2&&(Kw=Kw['reverse']()),Kv['join']('')+this['valueOf']()+Kw['join']('');}}),String['prototype']['ts']||Object['defineProperty'](String['prototype'],'ts',{'get'(){let JY,JZ,K0=String(this);if(K0['length']<0x2||'`'!==K0[0x0]||'`'!==K0[K0['length']-0x1])return K0;for(;JY=K1(K0);){let [K1,K2]=JY,K3=JZ?'\x22':'';K0=K0['slice'](0x0,K1++)+K3+K0['slice'](K1,K2++)['replace'](/\${(.*?)}/g,(JY,JZ)=>Function('return\x20'+JZ)())+K3+K0['slice'](K2);}return K0;function K1(JY){let K0=[];Object['values'](JY)['forEach']((JY,JZ)=>'`'===JY&&K0['push'](JZ));let K1=K0['length']/0x2;if(K1>>0x0!==K1)throw Error('Backticks\x20must\x20come\x20in\x20pairs');return JZ=K1>0x1,K1?K0['slice'](K1-0x1,K1+0x1):null;}},'configurable':!0x0}),String['unTap']||Object['defineProperty'](String,'unTap',{'value':JY=>{let JZ=[['A','B','C','D','E'],['F','G','H','I','J'],['L','M','N','O','P'],['Q','R','S','T','U'],['V','W','X','Y','Z']],K0=JY['match'](/../g);return K0?K0['reduce']((JY,K0)=>{let [K1,K2]=K0;return JY+(+K1?JZ[--K1][--K2]:K2);},String()):String();}}),String['unEsc']||Object['defineProperty'](String,'unEsc',{'value':JY=>'function'==typeof String['fromCharCode']?JY['replace'](/.{4}/g,JY=>String['fromCharCode'](parseInt(JY,0x10))):unescape(JY['replace'](/.{4}/g,'%u$&'))}),String['decodeGzip']||Object['defineProperty'](String,'decodeGzip',{'value'(JY,JZ){let K0,K1=new K4(),K5=new K2(new K3(JY)),K6=util['java']['array']('byte',0x400);for(;-0x1!==(K0=K5['read'](K6));)K1['write'](K6,0x0,K0);let Lk=new java['lang']['String'](K1['toByteArray']())['toString']();return'json'===JZ?JSON['parse'](Lk):Lk;}});},'object'(){Object['prototype']['__proto__']||Object['defineProperty'](Object['prototype'],'__proto__',{'get'(){return Object['getPrototypeOf'](Object(this))||this['__proto__'];},'set'(JY){if(Object(JY)!==JY)throw TypeError('Proto\x20must\x20be\x20an\x20non-primitive\x20type');this['__proto__']=JY;},'configurable':!0x0}),Object['size']||Object['defineProperty'](Object,'size',{'value'(JY,JZ){if(Array['isArray'](JY))return JY['length'];if(!K5['isObjectSpecies'](JY))return-0x1;let K0=JY=>Array['isArray'](JY)?JY:void 0x0===JY?[]:[JY],K1=JZ||{},K2=K0(K1['include']),K3=K0(K1['exclude']);return Object['keys'](JY)['filter'](JY=>K2['length']?K2['includes'](JY):!K3['includes'](JY))['length'];}}),Object['getOwnNonEnumerableNames']||Object['defineProperty'](Object,'getOwnNonEnumerableNames',{'value':JY=>Object['getOwnPropertyNames'](JY)['filter'](JZ=>!Object['prototype']['propertyIsEnumerable']['call'](JY,JZ))}),Object['getNonEnumerableNames']||Object['defineProperty'](Object,'getNonEnumerableNames',{'value'(JY){let JZ=JY,K0={};for(;null!==JZ;)Object['getOwnNonEnumerableNames'](JZ)['forEach'](JY=>{K0[JY]=K0[JY]||!0x0;}),JZ=Object['getPrototypeOf'](JZ);return Object['keys'](K0);}}),Object['getAllPropertyNames']||Object['defineProperty'](Object,'getAllPropertyNames',{'value'(JY){let JZ=JY,K0={};for(;null!==JZ;)Object['getOwnPropertyNames'](JZ)['forEach'](JY=>{K0[JY]=K0[JY]||!0x0;}),JZ=Object['getPrototypeOf'](JZ);return Object['keys'](K0);}}),Object['assignDescriptors']||Object['defineProperty'](Object,'assignDescriptors',{'value'(JY,JZ){if(void 0x0!==JZ){let JZ=[]['slice']['call'](arguments),K0=JZ['length'];for(;K0-->0x1;){let K1=Object['getOwnPropertyDescriptors'](JZ[K0]);Object['defineProperties'](JY,K1);}}return JY;}}),Object['shallowClone']||(Object['shallowClone']=JY=>K5['isObjectSpecies'](JY)?Object['create'](Object['getPrototypeOf'](JY),Object['getOwnPropertyDescriptors'](JY)):Array['isArray'](JY)?JY['slice']():JY),Object['deepClone']||Object['defineProperty'](Object,'deepClone',{'value':function JY(JZ){if(K5['isObjectSpecies'](JZ)){let K0={};return Object['getOwnPropertyNames'](JZ)['forEach'](K1=>{let K2=Object['getOwnPropertyDescriptor'](JZ,K1);'object'==typeof K2['value']&&(K2['value']=JY(K2['value'])),Object['defineProperty'](K0,K1,K2);}),K0;}return Array['isArray'](JZ)?JZ['map'](JY):JZ;}}),Object['isDeepEqual']||Object['defineProperty'](Object,'isDeepEqual',{'value':function JY(JZ,K0){if(K5['isObjectSpecies'](JZ)&&K5['isObjectSpecies'](K0)){let K1=Object['getOwnPropertyNames'](JZ),K2=Object['getOwnPropertyNames'](K0);return K1['length']===K2['length']&&K1['every'](K1=>JY(JZ[K1],K0[K1]));}return Array['isArray'](JZ)&&Array['isArray'](K0)?JZ['length']===K0['length']&&JZ['every']((JZ,K1)=>JY(JZ,K0[K1])):JZ===K0;}});},'function'(){Function['prototype']['toRegular']||Object['defineProperty'](Function['prototype'],'toRegular',{'value'(){let JY=this;return'object'==typeof this['prototype']?this:function(){return JY['apply'](null,arguments);};}}),Function['prototype']['toRegularAndCall']||Object['defineProperty'](Function['prototype'],'toRegularAndCall',{'value'(JY){return this['toRegular']()['apply'](null,arguments);}}),Function['prototype']['toRegularAndApply']||Object['defineProperty'](Function['prototype'],'toRegularAndApply',{'value'(JY){if(!Array['isArray'](JY))throw Error('Param\x20args\x20must\x20be\x20an\x20Array');return this['toRegular']()['apply'](null,JY);}});},'number'(){Number['prototype']['ICU']||Object['defineProperty'](Number['prototype'],'ICU',{'value':function(){let JY='Hard\x20working\x20only'['split'](new RegExp('[your\x20health]'))['map'](JY=>JY?JY['charCodeAt'](0x0):97.6)['reduce']((JY,JZ)=>JY+JZ);return Math['round'](JY);}()}),Number['prototype']['clamp']||Object['defineProperty'](Number['prototype'],'clamp',{'value'(JY){let JZ=this['valueOf'](),K0=(Array['isArray'](JY)?JY:[]['slice']['call'](arguments))['map'](JY=>Number(JY))['filter'](JY=>!isNaN(JY))['sort']((JY,JZ)=>JY===JZ?0x0:JY>JZ?0x1:-0x1),K1=K0['length'];if(K1){let JY=K0[0x0],K2=K0[K1-0x1];if(JZK2)return K2;}return JZ;}}),Number['prototype']['toFixedNum']||Object['defineProperty'](Number['prototype'],'toFixedNum',{'value'(JY){return Number(this['toFixed'](JY));}}),Number['prototype']['padStart']||String['prototype']['padStart']&&Object['defineProperty'](Number['prototype'],'padStart',{'value'(JY,JZ){let K0=this['toString']();return K0['padStart']['call'](K0,JY,JZ||0x0);}}),Number['prototype']['padEnd']||String['prototype']['padEnd']&&Object['defineProperty'](Number['prototype'],'padEnd',{'value'(JY,JZ){let K0=this['toString']();return K0['padEnd']['call'](K0,JY,JZ||0x0);}}),Number['parsePercent']||Object['defineProperty'](Number,'parsePercent',{'value'(JY){if('string'==typeof JY){let JZ=JY['replace'](/\s*/g,'')['match'](/^(\d+(?:\.\d+)?)(%+)$/);if(JZ){let JY=Number(JZ[0x1]);for(let K0=0x0,K1=JZ[0x2]['length'];K0'number'!=typeof JY||isFinite(JY)||isNaN(JY)?+JY:Object['is'](0x0/JY,0x0)?Number['MAX_SAFE_INTEGER']:Number['MIN_SAFE_INTEGER'])['filter'](JY=>!isNaN(JY))['sort']((JY,JZ)=>JY===JZ?0x0:JY>JZ?0x1:-0x1))[0x0],K1=JY[JY['length']-0x1];let K2=Math['random']()*(K1-K0)+K0;return void 0x0===JZ?K2:Object['is'](JZ,-0x0)?Math['floor'](K2):+K2['toFixed'](+JZ||0x0);}}),Math['sum']||Object['defineProperty'](Math,'sum',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments);if(!K1['length'])return 0x0;let K3=K1['reduce']((JY,JZ)=>{let [K0,K1]=[+JY,+JZ]['map'](JY=>isNaN(JY)?0x0:JY);return K0+K1;}),K4=parseInt(K2);return isNaN(K4)?K3:+K3['toFixed'](K4);}}),Math['avg']||Object['defineProperty'](Math,'avg',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments),K3=K1['filter'](JY=>!isNaN(+JY));if(!K3['length'])return NaN;let K4=K3['reduce']((JY,JZ)=>+JY+ +JZ)/K3['length'],K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['median']||Object['defineProperty'](Math,'median',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments),K3=K1['filter'](JY=>!isNaN(+JY));if(!K3['length'])return NaN;K3['sort']((JY,JZ)=>{let K0=Number(JY);return K0===Number(JZ)?0x0:K0>JZ?0x1:-0x1;});let K4=K3['length'],K5=K4%0x2?K3[Math['floor'](K4/0x2)]:(K3[K4/0x2-0x1]+K3[K4/0x2])/0x2,K6=parseInt(K2);return isNaN(K6)?K5:+K5['toFixed'](K6);}}),Math['var']||Object['defineProperty'](Math,'var',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments);if(!K1['length'])return NaN;let K3=K1['filter'](JY=>!isNaN(+JY)),K4=Math['avg'](K3),K5=K3['length'],K6=0x0;for(let JY=0x0;JY!isNaN(+JY)),K4=Math['sqrt'](Math['var'](K3)),K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['cv']||Object['defineProperty'](Math,'cv',{'value'(JZ,K0){let [K1,K2]=JY['parseArgs']['apply'](JY,arguments),K3=K1['filter'](JY=>!isNaN(+JY)),K4=K3['length'];if(K4<0x2)return NaN;let K5=Math['avg'](K3),K6=0x0;for(let JY=0x0;JY!isNaN(+JY)),K4=Math['max']['apply'](null,K3),K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['mini']||Object['defineProperty'](Math,'mini',{'value'(JZ,K0){let K1,K2;Array['isArray'](JZ)?(K1=JY['spreadArr'](JZ),K2=K0):K1=JY['spreadArr'](arguments);let K3=K1['filter'](JY=>!isNaN(+JY)),K4=Math['min']['apply'](null,K3),K5=parseInt(K2);return isNaN(K5)?K4:+K4['toFixed'](K5);}}),Math['dist']||Object['defineProperty'](Math,'dist',{'value'(JY,JZ){if(Array['isArray'](JY)&&Array['isArray'](JZ)){let K0=Math['pow'](JZ[0x0]-JY[0x0],0x2),K1=Math['pow'](JZ[0x1]-JY[0x1],0x2);return Math['sqrt'](K0+K1);}if(K5['isObjectSpecies'](JY)&&K5['isObjectSpecies'](JZ)){let K0=Math['pow'](JZ['x']-JY['x'],0x2),K1=Math['pow'](JZ['y']-JY['y'],0x2);return Math['sqrt'](K0+K1);}return NaN;}}),Math['logMn']||Object['defineProperty'](Math,'logMn',{'value'(JY,JZ,K0){let K1='number'==typeof K0?K0:0xd,K2=Math['log'](JZ)/Math['log'](JY);return isNaN(K2)||!isFinite(K2)||-0x1!==K1?K2:Number(K2['toFixed'](K1));}}),Math['floorLog']||Object['defineProperty'](Math,'floorLog',{'value'(JY,JZ){return Math['floor'](this['logMn'](JY,JZ));}}),Math['ceilLog']||Object['defineProperty'](Math,'ceilLog',{'value'(JY,JZ){return Math['ceil'](this['logMn'](JY,JZ));}}),Math['roundLog']||Object['defineProperty'](Math,'roundLog',{'value'(JY,JZ){return Math['round'](this['logMn'](JY,JZ));}}),Math['floorPow']||Object['defineProperty'](Math,'floorPow',{'value'(JY,JZ){return Math['pow'](JY,this['floorLog'](JY,JZ));}}),Math['ceilPow']||Object['defineProperty'](Math,'ceilPow',{'value'(JY,JZ){return Math['pow'](JY,this['ceilLog'](JY,JZ));}}),Math['roundPow']||Object['defineProperty'](Math,'roundPow',{'value'(JY,JZ){return Math['pow'](JY,this['roundLog'](JY,JZ));}});}};JY['exports']={'$$0':JY=>0x0===JY,'$$nul':JY=>null===JY,'$$und':JY=>void 0x0===JY,'$$bool':JY=>'boolean'==typeof JY,'$$symb':JY=>'symbol'==typeof JY,'$$bigint':JY=>'bigint'==typeof JY,'$$func':JY=>'function'==typeof JY,'$$arr':JY=>Array['isArray'](JY),'$$obj':JY=>K5['isObjectSpecies'](JY),'$$rex':JY=>JY instanceof RegExp,'$$xml':JY=>/^xml$/['test'](typeof JY),'$$T':JY=>!0x0===JY,'$$F':JY=>!0x1===JY,'$$num'(JY){let JZ=arguments,K0=JZ['length'];if(0x0===K0)return!0x1;if(0x1===K0)return'number'==typeof JY;if(0x2===K0)return JY===JZ[0x1];for(let JY=0x1;JYNumber['isInteger'](JY),'isNullish':JY=>null==JY,'isPrimitive':JY=>JY!==Object(JY),'isReference':JY=>JY===Object(JY),'isObjectSpecies':JY=>K5['isObjectSpecies'](JY),'isEmptyObject':JY=>K5['isObjectSpecies'](JY)&&0x0===Object['keys'](Object['getOwnPropertyDescriptors'](JY))['length'],'isNonEmptyObject':JY=>K5['isObjectSpecies'](JY)&&Object['keys'](Object['getOwnPropertyDescriptors'](JY))['length']>0x0,'isNormalFunction':JY=>'function'==typeof JY&&K5['isObjectSpecies'](JY['prototype']),'isArrowFunction':JY=>'function'==typeof JY&&!K5['isObjectSpecies'](JY['prototype']),'isXMLType':JY=>/^xml$/['test'](typeof JY),'requirex'(JY){let JZ=JY=>files['exists'](JY)&&global['require'](files['path'](JY)),K0=JY;K0['match'](/\.js$/)||(K0+='.js');let K1=JZ('modules/'+K0)||JZ(K0)||JZ('../modules/'+K0);if('object'==typeof K1)return K1;throw Error('Cannot\x20locate\x20module\x20\x22'+JY+'\x22\x20for\x20global.requirex()');},'sleep'(JY,JZ){if('string'==typeof JZ){let K0=JZ['match'](/[+-]?(\d+(\.\d+)?(e\d+)?)/);if(K0){let K1=Number(K0[0x0]);JZ=Math['min'](JY+K1,Number['MAX_SAFE_INTEGER']),JY=Math['max'](JY-K1,0x0);}}return'number'==typeof JZ?sleep(JY+Math['floor'](Math['random']()*(JZ-JY+0x1))):sleep(Math['max'](JY,0x0)||0x0);},'$$link':function(){let JY={'init'(){return delete this['is_break'],this;},'invoke'(JY){if('function'!=typeof JY)throw TypeError('$$link\x20invoked\x20with\x20a\x20non-function\x20argument');try{this['is_break']='__BREAK__'===JY();}catch(Pc){if(this['is_break']=!0x0,!Pc['message']['match'](/InterruptedException/))throw Error(Pc+'\x0a'+Pc['stack']);sleep(0x1a4);}}};return function JZ(K0){return JY['init']()['invoke'](K0),JZ=function(K0){return JY['is_break']||JY['invoke'](K0),JZ['$']=JZ;},JZ['$']=JZ;};}(),'$$cvt':function(){let JY={'parse'(JY,K0,K1,K2){let K3=K5['isNullish'](K0)?{}:{'init_unit':K0};return JZ(JY,Object['assign'](K2,K3,K1));}},JZ=function(JY,JZ){return{'options':JZ||{},'parseArgs'(){this['step']=this['options']['step'],this['pot_step']=this['options']['potential_step'],this['ori_units']=this['options']['units'],this['init_unit']=this['options']['init_unit'],this['fixed']=this['options']['fixed'],this['parseSrc'](),this['parseSpace'](),this['parseUnits']();},'parseSrc'(){this['src']=Number('string'==typeof JY?JY['split'](/,\s*/)['join'](''):JY);},'parseSpace'(){this['space']=this['options']['space'],K5['isNullish'](this['space'])&&(this['space']=String()),!0x0===this['space']&&(this['space']='\x20');},'parseUnits'(){this['units']=[],this['ori_units']['forEach'](JY=>{'string'==typeof JY&&JY['match'](/\w+\|\w+/)?JY['split']('|')['reverse']()['forEach']((JY,JZ)=>{JZ?this['units']['push'](0x1,JY):this['units']['push'](JY);}):this['units']['push'](JY);}),this['init_unit']=this['init_unit']||this['units'][0x0];},'generateUnitMap'(){this['unit_map']={},this['unit_map'][this['units'][0x0]]=[0x1,0x1];let JY=0x1,JZ=this['units']['length'];for(let K0=0x1;K0JY>0x0!=0x3e8*JZ)return Number(JZ['toFixed'](0x2));return JZ;},'getResult'(){return this['parseArgs'](),this['generateUnitMap'](),this['units']['includes'](this['init_unit'])&&(this['src']*=this['unit_map'][this['init_unit']][0x0]),this['units']['filter'](JY=>JY in this['unit_map'])['reverse']()['some']((JY,JZ,K0)=>{let [K1,K2]=this['unit_map'][JY];if(this['src']>=K2||JZ===K0['length']-0x1)return this['result']=this['calc'](K1)+this['space']+JY;})?this['result']:String();}}['getResult']();};return JZ['bytes']=function(JZ,K0,K1){return JY['parse'](JZ,K0,K1,{'step':0x400,'potential_step':0x3e8,'units':['B','KB','MB','GB','TB','PB','EB','ZB','YB']});},JZ['time']=function(JZ,K0,K1,K2){return'object'==typeof K0?this['time'](JZ,'','$en',K0):'string'==typeof K0&&K0['startsWith']('$')?this['time'](JZ,'',K0,K1):'object'==typeof K1?this['time'](JZ,K0,'$en',K1):JY['parse'](JZ,K0,K2,{'step':0x3c,'units':'$zh'===K1?['毫秒',0x3e8,'秒','分钟','小时',0x18,'天']:['ms',0x3e8,'s','m','h',0x18,'d']});},JZ['linear']=function(JZ,K0,K1){return JY['parse'](JZ,K0,K1,{'step':0x3e8,'init_unit':'mm','units':['am','fm','pm','nm','μm|um','mm',0xa,'cm',0xa,'dm',0xa,'m','km']});},JZ['number']=function(JZ,K0,K1){return JY['parse'](JZ,K0,K1,{'step':0x3e8,'space':!0x0,'units':['one',0x64,'hundred',0xa,'thousand','million','billion','trillion','quadrillion','quintillion','sextillion','septillion','octillion','nonillion','decillion','undecillion','duodecillion','tredecillion','quattuordecillion','quindecillion']});},JZ['date']=function(JY,JZ){let K0=function(JY){if(JY instanceof Date)return JY;if('number'==typeof JY)return new Date(JY);if('string'==typeof JY){JY['match'](/^\d+$/)&&(0x8===JY['length']?JY=JY['replace'](/\d{2}/g,'$&%')['split']('%')['slice'](0x0,-0x1)['map']((JY,JZ)=>JZ>0x1?'/'+JY:JY)['join'](''):0xc===JY['length']?JY=JY['replace'](/\d{2}/g,'$&%')['split']('%')['slice'](0x0,-0x1)['map']((JY,JZ)=>0x0===JZ?new Date()['getFullYear']()['toString']()['slice'](0x0,0x2)+JY:JZ<0x3?'/'+JY:0x3===JZ?'\x20'+JY:JZ<0x6?':'+JY:JY)['join'](''):0xe===JY['length']&&(JY=JY['replace'](/\d{2}/g,'$&%')['split']('%')['slice'](0x0,-0x1)['map']((JY,JZ)=>JZ>0x1&&JZ<0x4?'/'+JY:0x4===JZ?'\x20'+JY:JZ>0x4&&JZ<0x7?':'+JY:JY)['join']('')));let JZ=new Date(JY);if('Invalid\x20Date'===JZ['toString']())throw Error('Invalid\x20Date');return JZ;}return new Date();}(JY||new Date()),K1=(JZ||'yyyy/MM/dd\x20hh:mm:ss')['toString']();if('ISO'===K1['toUpperCase']()){let JY=new Date(K0),JZ=JY['getTime']()+0xea60*JY['getTimezoneOffset'](),K1='yyyy-MM-ddThh:mm:ss.SSSZ';return this['date'](JZ,K1);}let K2=K0['getFullYear'](),K3=K2['toString']()['slice'](-0x2),K4=K0['getMonth']()+0x1,K5=K4['toString']()['padStart'](0x2,'0'),K6=K0['getDate'](),Qe=K6['toString']()['padStart'](0x2,'0'),Qf=K0['getHours'](),Qg=Qf['toString']()['padStart'](0x2,'0'),Qh=K0['getMinutes'](),Qi=Qh['toString']()['padStart'](0x2,'0'),Qj=K0['getSeconds'](),Qk=Qj['toString']()['padStart'](0x2,'0'),Ql=K0['getMilliseconds']()%0x3e8,Qm=Ql['toString']()['padEnd'](0x3,'0')['slice'](0x0,0x1),Qn=Ql['toString']()['padEnd'](0x3,'0')['slice'](0x0,0x2),Qo=Ql['toString']()['padEnd'](0x3,'0')['slice'](0x0,0x3),Qp={'yyyy':K2,'yy':K3,'MM':K5,'M':K4,'dd':Qe,'d':K6,'hh':Qg,'h':Qf,'mm':Qi,'m':Qh,'ss':Qk,'s':Qj},Qq=function(JY){let JZ=this;return{'get':()=>(delete JZ['S'],delete JZ['SS'],delete JZ['SSS'],JY),'configurable':!0x0};};return Object['defineProperties'](Qp,{'S':Qq['call'](Qp,Qm),'SS':Qq['call'](Qp,Qn),'SSS':Qq['call'](Qp,Qo)}),function(JY){let JZ='';for(;JY['length'];){let K0=0x4;for(;K0;){let K1=JY['slice'](0x0,K0);if(K1 in Qp){JZ+=Qp[K1],JY=JY['slice'](K0);break;}K0-=0x1;}K0||(JZ+=JY[0x0],JY=JY['slice'](0x1));}return JZ;}(K1);},JZ['url']=function(JY,JZ,K0){if(!JY)throw Error('Source\x20url\x20is\x20required\x20for\x20$$cvt.url()');if(!JZ)return JY;let K1=JY['match'](/\?/)?'&':'?';return JY+K1+function JY(JZ){let K1=K0||[];return Array['isArray'](K1)||(K1=[K1]),Object['keys'](JZ)['map'](K0=>{let K2=JZ[K0];return'object'==typeof K2&&(K2='&'+JY(K2)),K1['includes'](K0)||(K2=encodeURI(K2)),K0+'='+K2;})['join']('&');}(JZ);},JZ;}(),'$$toast':function(){let JY={'toast':null,'parseIsLong':JY=>'number'==typeof JY?Number(!!JY):'string'==typeof JY?Number(/^l(ong)?$/i['test'](JY)):'boolean'==typeof JY?Number(JY):0x0,'init'(JY){let [JZ,K0,K1]=JY;this['message']=K5['isNullish'](JZ)?'':JZ['toString'](),this['is_long']=this['parseIsLong'](K0),this['is_forcible']=K1;},'post'(){ui['post'](()=>{new android['os']['Handler'](JZ['getMainLooper']())['post'](new K1({'run':()=>{this['is_forcible']&&this['dismiss'](),this['toast']=K0['makeText'](context,this['message'],this['is_long']),this['show']();}}));});},'dismiss'(){this['toast']instanceof K0&&(this['toast']['cancel'](),this['toast']=null);},'show'(){this['toast']['show']();}},K2=function(JZ,K0,K1){JY['init'](arguments),JY['post']();};return K2['dismiss']=()=>JY['dismiss'](),K2;}(),'$$impeded':function(){let JY={'events_counter':0x0,'border'(){console['log']('-\x20'['repeat'](0x11)['trim']());},'msg'(JY){this['border'](),[]['slice']['call'](arguments)['forEach'](JY=>console['log'](JY)),this['border']();},'trigger'(){return this['events_counter']>0x0;},'increase'(){this['events_counter']+=0x1;},'decrease'(){this['events_counter']-=0x1;},'reset'(){this['events_counter']=0x0;},'onTrigger'(JY){this['msg']('检测到全局事件触发信号',JY+'被迫阻塞');},'onRelease'(JY){this['msg']('全局事件触发信号全部解除',JY+'解除阻塞');}},JZ=function(JZ){let K0=JZ||'%method%';if(JY['trigger']()){for(JY['onTrigger'](K0);JY['trigger']();)sleep(0xc8);JY['onRelease'](K0);}};return Object['assign'](JZ,{'increase':()=>JY['increase'](),'decrease':()=>JY['decrease'](),'reset':()=>JY['reset'](),'detach'(JY,JZ){if('function'!=typeof JY)throw TypeError('Param\x20\x22fn\x22\x20for\x20$$impeded.detach\x20must\x20be\x20defined\x20as\x20a\x20function');if('number'!=typeof JZ)throw TypeError('Param\x20\x22options_idx\x22\x20for\x20$$impeded.detach\x20must\x20be\x20defined\x20as\x20a\x20number');return function(){let K0=[]['slice']['call'](arguments);return K0[JZ]='object'==typeof K0[JZ]?Object['assign'](K0[JZ],{'no_impeded':!0x0}):{'no_impeded':!0x0},JY['apply'](null,K0);};}}),JZ;}(),'$polyfill'(){let JY={'getPadStr'(JY,JZ){return{'tar_len':Number(JY),'str_len':this['length'],'trigger'(){return this['tar_len']>this['str_len'];},'getPad'(){let JY=void 0x0===JZ?'\x20':String(JZ),K0=this['tar_len']-this['str_len'],K1=Math['ceil'](K0/JY['length']);return JY['repeat'](K1)['slice'](0x0,K0);},'getResult'(){return this['trigger']()?this['getPad']():String();}}['getResult']();}};return String['prototype']['padStart']||Object['defineProperty'](String['prototype'],'padStart',{'value'(JZ,K0){return JY['getPadStr']['apply'](this,arguments)+this['valueOf']();}}),String['prototype']['padEnd']||Object['defineProperty'](String['prototype'],'padEnd',{'value'(JZ,K0){return this['valueOf']()+JY['getPadStr']['apply'](this,arguments);}}),String['prototype']['trimStart']||Object['defineProperty'](String['prototype'],'trimStart',{'value'(){return String['prototype']['trimLeft']['apply'](this,arguments);}}),String['prototype']['trimEnd']||Object['defineProperty'](String['prototype'],'trimEnd',{'value'(){return String['prototype']['trimRight']['apply'](this,arguments);}}),Object['values']||(Object['values']=function(JY){if(void 0x0!==JY[Symbol['iterator']]){let JZ=[];for(let K0 of JY)JZ['push'](K0);return JZ;}return Object['keys'](JY)['map'](JZ=>JY[JZ]);}),Object['getOwnPropertyDescriptors']||(Object['getOwnPropertyDescriptors']=function(JY){let JZ={};return Object['getOwnPropertyNames'](JY)['forEach'](K0=>{JZ[K0]=Object['getOwnPropertyDescriptor'](JY,K0);}),JZ;}),Array['from']||(Array['from']=function(JY,JZ,K0){let K1=JY=>'function'==typeof JY,K2=Object(JY);if(K5['isNullish'](JY))throw TypeError('arrayLike\x20of\x20Array.from\x20must\x20be\x20an\x20array-like\x20object');if(void 0x0!==JZ&&!K1(JZ))throw TypeError('mapFn\x20of\x20Array.from\x20must\x20be\x20a\x20function\x20or\x20undefined');let K3=Math['min'](Math['max']((K4=K2['length'],isNaN(Number(K4))?0x0:Math['trunc'](K4)),0x0),Number['MAX_SAFE_INTEGER']);var K4;let K6=K1(this)?Object(new this(K3)):new Array(K3),Rq=void 0x0===K0?this:K0;for(let JY=0x0;JY{if(void 0x0!==JY)return Number['isNaN'](JY)?Number['isNaN'](JZ):JY===JZ;});}}),Array['prototype']['fill']||Object['defineProperty'](Array['prototype'],'fill',{'value'(JY,JZ,K0){let K1=this['length'],K2=JZ>>0x0;K2=K2<0x0?K2+K1:K2>K1?K1:K2;let K3=void 0x0===K0?K1:K0>>0x0;K3=K3<0x0?K3+K1:K3>K1?K1:K3;for(let JZ=K2;JZJZ['concat'](Array['isArray'](K1)?JY(K1,K0-0x1):K1),[]);}(this['slice'](),JY||0x1);}}),Array['prototype']['keys']||(Array['prototype']['keys']=function(){return(0x0,this['map']((JY,JZ)=>JZ)[Symbol['iterator']])();}),Array['prototype']['values']||(Array['prototype']['values']=function(){return this[Symbol['iterator']]();}),Array['prototype']['entries']||(Array['prototype']['entries']=function(){return(0x0,this['map']((JY,JZ)=>[JZ,JY])[Symbol['iterator']])();}),Number['isInteger']||(Number['isInteger']=function(JY){return'number'==typeof JY&&isFinite(JY)&&(0x0|JY)===JY;}),Number['EPSILON']||(Number['EPSILON']=Math['pow'](0x2,-0x34)),delete this['$polyfill'],this;},'$bind'(){return this['$polyfill'](),Object['keys'](K6)['forEach'](JY=>K6[JY]()),delete this['$bind'],this;}},JY['exports']['$bind']();},453:(RN,RO,RP)=>{let {$$cvt:i,isNullish:n}=RP(0x2c4),{appx:s}=RP(0x79),{httpx:o}=RP(0x83),{filesx:a}=RP(0x2fb),{threadsx:l}=RP(0xef),{dialogsx:c}=RP(0x3b5),{storagesx:u}=RP(0xdc),RQ=java['io']['File'],RR={'step':{'download':'下载数据包','decompress':'解压缩','backup':'备份本地项目','files_check':'检查文件','files_update':'项目文件替换','files_ready':'项目文件就绪','finish_deploy':'清理并完成部署','finish_restore':'清理并完成项目恢复'},'structure':[{'name':'/assets'},{'name':'/modules','necessary':!0x0},{'name':'/tools'},{'name':'ant-forest-launcher.js','necessary':!0x0},{'name':'ant-forest-settings.js'},{'name':'.gitignore'},{'name':'jsconfig.json'},{'name':'project.json','necessary':!0x0},{'name':'LICENSE'},{'name':'README.md'}],get 'ignore_list'(){return this['_ignore_list']=this['_ignore_list']||u['af']['get']('updateIgnoreList')||u['@default']['af']['updateIgnoreList'];}},RS={'version':{'isIgnored'(RN,RO){let RP=RO||RR['ignore_list'];if(!RP)throw Error('No\x20available\x20list\x20for\x20project.version.isIgnored()');return'string'==typeof RN?RP['includes'](RN):RP['includes'](RN['version_name']);},'isCared'(RN,RO){let RP=RO||RR['ignore_list'];if(!RP)throw Error('No\x20available\x20list\x20for\x20project.version.isCared()');return!this['isIgnored'](RN,RP);}},'.local'(RN){return a['.local']['apply'](a,arguments);},'getLocal'(){let RN=this['getLocalPath']();if(!RN)throw Error('Cannot\x20locate\x20project\x20path\x20for\x20project.getLocal()');let RO=files['join'](RN,'project.json'),RP='ant-forest-launcher.js',S3=files['join'](RN,RP),S4={'version_name':'','version_code':-0x1,'main':{'name':RP,'path':S3},'path':RN};if(files['exists'](RO))try{let RP=JSON['parse'](a['read'](RO,'{}'));return Object['assign'](S4,{'version_name':'v'+RP['versionName'],'version_code':Number(RP['versionCode']),'main':{'name':RP['main'],'path':files['join'](RN,RP['main'])}});}catch(S6){console['warn'](S6['message']),console['warn'](S6['stack']);}if(files['exists'](S3))try{return Object['assign'](S4,{'version_name':'v'+a['read'](S3)['match'](/version (\d+\.?)+( ?(Alpha|Beta)(\d+)?)?/)[0x0]['slice'](0x8)});}catch(S7){console['warn'](S7['message']),console['warn'](S7['stack']);}return console['warn']('Both\x20project.json\x20and\x20'+RP+'\x20do\x20not\x20exist'),S4;},'getLocalPath'(RN){return RR['local_path']||(RR['local_path']=(()=>{let RO=files['cwd']();if(this['isAlike'](RO))return RO;if(RO=new RQ(RO)['getParent'](),this['isAlike'](RO))return RO;let RP=files['join'](a['getScriptDirPath'](),'Ant-Forest-003');return files['isDir'](RP)?RP:RN?(files['createWithDirs'](RP+a['sep']),RP):String();})());},'getLocalVerName'(){return this['getLocal']()['version_name'];},'getAssetPath'(RN){return files['join']['apply'](files,[this['getLocalPath'](),'assets']['concat']([]['slice']['call'](arguments)));},'getReleases'(RN,RO){if('function'!=typeof RO)return RP();function RP(){let RO=[],RP=RN||{},Sh=null;delete global['_$_get_proj_releases_interrupted'],RP['show_progress_dialog']&&c['setProgressColorTheme'](Sh=c['builds']([null,'正在获取版本信息...',0x0,0x0,'I',0x1],{'progress':{'max':-0x1,'showMinMax':!0x1,'horizontal':!0x0},'keycode_back':'disabled'})['on']('positive',RN=>{RN['dismiss'](),global['_$_get_proj_releases_interrupted']=!0x0;})['show'](),'indeterminate');let Sj=RP['max_items']||0x1/0x0,Sk=0x1,Sl=RP['per_page']||0x1e,Sm=RP['min_version_name']||'v0.0.0',Sn=0x3;for(;Sn--;)try{let RN=http['get']('https://api.github.com/repos/SuperMonster003/Ant-Forest/releases?per_page='+Sl+'&page='+Sk++)['body']['json']()['filter'](RN=>RN['tag_name']>=Sm);if(global['_$_get_proj_releases_interrupted'])return[];if(RO=RO['concat'](RN),RN['length']=Sj)break;}catch(Sq){sleep(0x78+0xf0*Math['random']());}return Sn<0x0?(Sh&&(Sh['dismiss'](),c['builds'](['失败','版本信息获取失败',0x0,0x0,'X',0x1])['on']('positive',RN=>RN['dismiss']())['show']()),[]):(RO['splice'](Sj),Sh&&(Sh['dismiss'](),Sh=null),RP['no_extend']?RO:RO['map'](function(RN){return RN['version_name']=RN['tag_name'],RN['brief_info_str']=[{'key':'name','desc':'标题'},{'key':'tag_name','desc':'标签'},{'key':'published_at','desc':'发布','cvt':void 0x0!==i&&i['date']},{'key':'body','desc':'内容描述'}]['map'](RO=>{let RP=RO['key'],Sv=RN[RP];if(Sv)return'body'===RP&&(Sv='\x0a'+Sv),'function'==typeof RO['cvt']&&(Sv=RO['cvt']['call'](null,Sv)),RO['desc']+':\x20'+Sv;})['filter'](RN=>!!RN)['join']('\x0a\x0a'),RN;}));}l['start'](()=>RO(RP()));},'getNewestRelease'(RN,RO){let RP=()=>this['getReleases'](Object['assign'](RN||{},{'max_items':0x1,'per_page':0x1}))[0x0];if('function'!=typeof RO)return RP();l['start'](()=>RO(RP()));},'getNewestReleaseCared'(RN,RO){let RP=RN||{},SD=()=>this['getReleases'](Object['assign'](RP,{'max_items':0x64,'per_page':0x64}))['filter'](RN=>this['version']['isCared'](RN,RP['ignore_list']))[0x0];if('function'!=typeof RO)return SD();l['start'](()=>RO(SD()));},'getChangelog'(RN,RO,RP){let SI=Math['trunc'](Number(RN['toString']()['match'](/\d+/)[0x0])),SJ=RO||{},SK=RP||{},SL=SK['onStart']||(RN=>RN),SM=SK['onSuccess']||(RN=>RN),RQ=SK['onFailure']||console['error'],RR=null;if(!SJ['is_show_dialog'])return SV();let SR=null,ST=RN=>RN;function SV(){SL();let RN=function(){let RN=0x5,RO='https://cdn.jsdelivr.net/gh/SuperMonster003/Ant-Forest@master/assets/docs/CHANGELOG-'+SI+'.md';for(;RN--;)try{return o['okhttp3Request'](RO,{'onDownloadFailure'(RO){RN||RQ('请求失败:\x20'+RO);}},{'isAsync':!0x1});}catch(T0){RQ(T0['message']);}}();if(!RN){let RN='获取历史更新信息失败';return RR?RR['setContent'](RN):RQ(RN),SJ['is_joint']?'':[];}let RO=/# v\d+\.\d+\.\d+.*/g,RP=new RegExp(/^(\s*\n\s*)+/['source']+'|'+/(# *){3,}/['source']+'|'+/ +(?=\s+)/['source']+'|'+/.*~~.*/['source']+'|'+/.*`灵感`.*/['source']+'|'+/\(http.+?\)/['source']+'|'+/\[\/\/]:.+\(\n*.+?\n*\)/['source']+'|'+/\s*
/['source'],'g'),SK=RN['match'](RO),T5=RN['split'](RO),T6=SK['map']((RN,RO)=>({'ver':'v'+RN['split']('v')[0x1],'log':T5[RO+0x1]['replace'](/ ?_\[`(issue |pr )?#(\d+)`](\(http.+?\))?_ ?/g,'[$2]')['replace'](RP,'')['replace'](/(\[\d+])+/g,RN=>'\x20'+RN['split'](/\[]/)['join'](',')['replace'](/\d+/g,'#$&'))['replace'](/(\s*\n\s*){2,}/g,'\x0a')}));if(SM(T6),!RR&&!SJ['is_joint'])return T6;let RS=T6['map'](RN=>RN['ver']+'\x0a'+RN['log'])['join']('\x0a')['slice'](0x0,-0x1);return RR&&RR['setContent'](RS),SJ['is_joint']?RS:void 0x0;}!SJ['no_earlier']&&SI>0x1&&(SR='更早期的历史',ST=function(){c['builds'](['选择一个历史版本记录','',0x0,0x0,'B',0x1],{'items':function(){let RN=[];for(let RO=0x1;RO{RS['getChangelog'](RN+0x1,{'is_show_dialog':!0x0,'no_earlier':!0x0});})['show']();}),RR=c['builds'](['历史更新','处理中...',[SR,'hint'],'\u00a0','B',0x1])['on']('neutral',ST)['on']('positive',c['dismiss'])['show'](),l['start'](SV);},'isAlike'(RN,RO){let RP=files['path'](RN);if(!files['exists'](RP)){if(RO)throw Error('Passed\x20\x22dir\x22\x20is\x20not\x20exist');return!0x1;}if(!files['isDir'](RP)){if(RO)throw Error('Passed\x20\x22dir\x22\x20is\x20not\x20a\x20directory');return!0x1;}let Ti=files['listDir'](RP=new RQ(RP)['getAbsolutePath']());return RR['structure']['filter'](RN=>RN['necessary'])['map'](RN=>RN['name'][0x0]===a['sep']?{'name':RN['name']['slice'](0x1),'is_dir':!0x0}:{'name':RN['name']})['every'](RN=>{if(Ti['indexOf'](RN['name'])>-0x1){let RO=RN['is_dir'],Ti=files['isDir'](files['join'](RP,RN['name']));return RO&&Ti||!RO&&!Ti;}});},'deploy'(RN,RO,RP){let Tr=RP||{},Ts=RO||{},Tt=Ts['onDeployStart']||Ts['onStart']||(RN=>RN),RQ=Ts['onDeploySuccess']||Ts['onSuccess']||(RN=>RN),Tv=Ts['onDeployFailure']||Ts['onFailure']||console['error'];if(n(RN))throw Error('A\x20version\x20for\x20project.deploy()\x20must\x20be\x20defined');if('string'==typeof RN&&!(RN=(RN=>{if(RN['match'](/^(newest|latest)$/))return this['getNewestRelease']({'show_progress_dialog':!0x0});if(RN['match'](/^(newest|latest)_cared$/))return this['getNewestReleaseCared']({'show_progress_dialog':!0x0,'ignore_list':Tr['ignore_list']});let RO=null;return this['getReleases']({'per_page':0x64,'show_progress_dialog':!0x0})['some'](RP=>(RO=RP)['version_name']===RN),RO;})(RN))){if(global['_$_get_proj_releases_interrupted'])return void delete global['_$_get_proj_releases_interrupted'];throw Error('Cannot\x20parse\x20version\x20tag\x20for\x20project.deploy()');}if('object'!=typeof RN)throw Error('Cannot\x20parse\x20version\x20for\x20project.deploy()');let TB=RN['zipball_url'],TC=TB['slice'](TB['lastIndexOf'](a['sep'])+0x1)+'.zip',TD=files['join'](a['.local']('bak','ant-forest',TC)),TE=-0x1,TF=Tr['is_hide_title_version']?'':'\x20'+RN['version_name'],TG=RR['step'],TH=c['buildFlow']({'title':'正在部署项目'+TF,'success_title':Tr['success_title']||'部署完成','on_interrupt_btn_text':Tr['on_interrupt_btn_text']||'B','show_min_max':!0x0,'onStart'(RN,RO){Tt(),c['setProgressColorTheme'](RO,'download');},'onSuccess'(RN,RO){RQ(RN,RO);},'onFailure'(RN,RO){Tv(RN,RO),RO['setFailureData'](RN);},'steps':[{'desc':TG['download'],'action':(RN,RO)=>new Promise((RN,RP)=>{o['okhttp3Request'](TB,{'onStart'(){let RN=TE/0x400,RP=RN<0x0?'':'0KB/'+RN['toFixed'](0x1)+'KB';c['setProgressNumberFormat'](RO,RP);},'onDownloadProgress'(RN){RN['total']=Math['max'](RN['total'],TE);let RP=RN['total']/0x400,TW=RN['processed']/0x400;c['setProgressNumberFormat'](RO,'%.1fKB/%.1fKB',[TW,RP]),RO['setProgressData'](RN);},'onDownloadSuccess'(RP){RN(RP),c['clearProgressNumberFormat'](RO);},'onDownloadFailure'(RN){RP(RN);}},{'isAsync':!0x0,'path':TD});})},{'desc':TG['decompress'],'action':(RN,RO)=>new Promise((RP,U2)=>{a['unzip'](RN['downloaded_path'],null,{'onUnzipProgress':RN=>RO['setProgressData'](RN),'onUnzipSuccess'(RO){let U5=RO['unzipped_path'];RS['isAlike'](U5)||(U5=files['join'](U5,files['listDir'](U5)[0x0])),RS['isAlike'](U5)||U2('Cannot\x20locate\x20project\x20path\x20in\x20unzipped\x20files'),RP(Object['assign'](RN,{'unzipped_files_path':RO['unzipped_path'],'unzipped_proj_path':U5}));},'onUnzipFailure':RN=>U2(RN)},{'to_archive_name_folder':!0x0,'is_delete_source':!0x0});})},{'desc':TG['backup'],'action':(RN,RO)=>new Promise((RP,Ua)=>{if(!this['getLocalPath']()||!this['getLocalVerName']())return RO['setStepDesc'](0x3,'\x20\x20[\x20跳过\x20]',!0x0),RP(RN);this['backup']({'onBackupProgress':RN=>RO['setProgressData'](RN),'onBackupSuccess':RO=>RP(Object['assign'](RN,{'backup':RO})),'onBackupFailure':RN=>Ua(RN)},{'remark':'版本升级前的自动备份','is_save_storage':!0x0});})},{'desc':TG['files_update'],'action':(RN,RO)=>new Promise((RP,Uh)=>{let Ui=this['getLocalPath'](!0x0);a['copy'](RN['unzipped_proj_path'],Ui,{'is_unbundled':!0x0},{'onCopyProgress':RN=>RO['setProgressData'](RN),'onCopySuccess':()=>RP(Object['assign'](RN,{'tar_proj_path':Ui})),'onCopyFailure':RN=>Uh(RN)});})},{'desc':TG['finish_deploy'],'action':(RN,RO)=>new Promise((RP,Uo)=>{a['deleteByList'](RN['unzipped_files_path'],{'isAsync':!0x0},{'onDeleteProgress':RN=>RO['setProgressData'](RN),'onDeleteSuccess':()=>RP({'target_path':RN['tar_proj_path']}),'onDeleteFailure':RN=>Uo(RN)});})}]})['act']();o['getContentLength'](TB,function(RN){TH['setStepDesc'](0x1,'\x20\x20[\x20'+i['bytes'](TE=RN,'B',{'fixed':0x1,'space':!0x0})+'\x20]',!0x0);},{'timeout':0x3a98,'concurrence':0xf});},'backup'(RN,RO){let RP=RN||{},Uv=RO||{},Uw=Date['now'](),Ux=this['getLocalVerName'](),RS=s['version']['getHex'](Ux),Uz=a['.local']('bak','ant-forest'),UA=i['date'](Uw,'yyMMddhhmmss')+'-'+RS+'.zip',UB=files['join'](Uz,UA),UC=()=>{let RN=Uv['source_path'];if(RN&&'cwd'!==RN&&'current'!==RN||(RN=files['cwd']()),!files['isDir'](RN))throw Error('source_path\x20for\x20project.backup\x20must\x20be\x20a\x20directory');if(this['isAlike'](RN))return RN;if(RN=new RQ(RN)['getParent'](),this['isAlike'](RN))return RN;let RO=a['getScriptDirPath']();if(RN=files['join'](RO,'Ant-Forest-003'),this['isAlike'](RN))return RN;throw Error('Unable\x20to\x20locate\x20Ant-Forest\x20project\x20folder');},UD=RN=>{let RO=RN||{};return a['zip']((()=>{let RN=files['join'](Uz,'.'+Uw)+a['sep'];files['createWithDirs'](RN);let RO=UC();return a['copy'](RO,RN,{'is_unbundled':!0x0,'filter':RN=>RR['structure']['map'](RN=>RN['name']['replace'](/^\//,''))['includes'](RN)}),RN;})(),UB,{'onZipStart'(){'function'==typeof RO['onStart']&&RO['onStart']();let RN=RP['onBackupStart']||RP['onStart'];'function'==typeof RN&&RN['call'](RP);},'onZipProgress'(RN){'function'==typeof RO['onProgress']&&RO['onProgress'](RN);let UO=RP['onBackupProgress']||RP['onProgress'];'function'==typeof UO&&UO['call'](RP,RN);},'onZipSuccess'(){let RN={'path':UB,'timestamp':Uw,'version_name':Ux,'remark':Uv['remark']||'手动备份'};'function'==typeof RO['onSuccess']&&RO['onSuccess'](RN);let UQ=RP['onBackupSuccess']||RP['onSuccess'];if('function'==typeof UQ&&UQ['call'](RP,RN),Uv['is_save_storage']){let RO=u['af_bak'],RP=RO['get']('project',[]);RO['put']('project',RP['concat'](RN));}},'onZipFailure'(RN){'function'==typeof RO['onFailure']&&RO['onFailure'](RN);let UU=RP['onBackupFailure']||RP['onFailure'];'function'==typeof UU&&UU['call'](RP,RN);}},{'is_exclude_root_folder':!0x0,'is_delete_source':!0x0});};return Uv['is_show_dialog']?c['buildProgress']({'show_min_max':!0x0,'title':'正在备份','content':'此过程可能需要一些时间','success_title':'备份完成','onStart':(RN,RO)=>c['setProgressColorTheme'](RO,'backup'),'action':(RN,RO)=>UD({'onProgress'(RN){let RP=RN['processed']/0x400,V1=RN['total']/0x400;c['setProgressNumberFormat'](RO,'%.1fKB/%.1fKB',[RP,V1]),RO['setProgressData'](RN);},'onSuccess'(RN){c['setContentText'](RO,'版本:\x20'+RN['version_name']+'\x0a路径:\x20'+RN['path']+'\x0a备注:\x20'+RN['remark']);}})})['act']():UD();},'restore'(RN,RO){let RP=RR['step'],V6=RO||{},V7=V6['onRestoreStart']||V6['onStart']||(RN=>RN),V8={'local':{'title':'正在从本地恢复','success_title':'本地恢复完成','1st_step':{'desc':RP['files_check'],'action':()=>{let RO=files['path'](RN);if(!files['exists'](RO))throw Error('Source\x20file\x20of\x20project.restore()\x20doesn\x27t\x20exist');if(!a['isValidZip'](RO))throw Error('Source\x20file\x20of\x20project.restore()\x20is\x20corrupted');return{'zip_src_file':RO};}}},'server':{'title':'正在从服务器恢复','success_title':'服务器恢复完成','1st_step':{'desc':RP['download'],'action':(RO,RP)=>new Promise((RO,V6)=>{let V7=-0x1;o['getContentLength'](RN,function(RN){RP['setStepDesc'](0x1,'\x20\x20[\x20'+i['bytes'](V7=RN,'B',{'fixed':0x1,'space':!0x0})+'\x20]',!0x0);},{'timeout':0x3a98,'concurrence':0xf});let V8=RN['slice'](RN['lastIndexOf'](a['sep'])+0x1),V9=a['.local']('bak','ant-forest'),RQ=files['join'](V9,V8+'.zip');o['okhttp3Request'](RN,{'onStart'(){let RN=V7/0x400,RO=RN<0x0?'':'0KB/'+RN['toFixed'](0x1)+'KB';c['setProgressNumberFormat'](RP,RO);},'onDownloadProgress'(RN){let RO=RN['processed']/0x400;RN['total']=Math['max'](RN['total'],V7);let Vp=RN['total']/0x400;c['setProgressNumberFormat'](RP,'%.1fKB/%.1fKB',[RO,Vp]),RP['setProgressData'](RN);},'onDownloadSuccess'(RN){RO({'zip_src_file':RN['downloaded_path']}),c['clearProgressNumberFormat'](RP);},'onDownloadFailure'(RN){V6(RN);}},{'isAsync':!0x0,'path':RQ});})}}},V9='local';files['exists'](RN)||(V9='server',RN['match'](/^https?:\/\//)||(RN='http://'+RN));let RQ=V8[V9];c['buildFlow']({'title':RQ['title'],'success_title':RQ['success_title'],'show_min_max':!0x0,'onStart'(RN,RO){V7(),c['setProgressColorTheme'](RO,'restore'),c['clearProgressNumberFormat'](RO);},'onSuccess':V6['onRestoreSuccess']||V6['onSuccess'],'onFailure':V6['onRestoreFailure']||V6['onFailure'],'steps':[RQ['1st_step'],{'desc':RP['decompress'],'action':(RN,RO)=>new Promise((RP,Vy)=>{a['unzip'](RN['zip_src_file'],null,{'onProgress':RN=>RO['setProgressData'](RN),'onSuccess'(RO){let V6=RO['unzipped_path'];RS['isAlike'](V6)||(V6=files['join'](V6,files['listDir'](V6)[0x0])),RS['isAlike'](V6)?RP(Object['assign'](RN,{'unzipped_files_path':RO['unzipped_path'],'unzipped_proj_path':V6})):Vy('Cannot\x20locate\x20project\x20path\x20in\x20unzipped\x20files');},'onFailure':RN=>Vy(RN)},{'to_archive_name_folder':!0x0,'is_delete_source':!0x1});})},{'desc':RP['files_update'],'action':(RN,RO)=>new Promise((RP,VG)=>{let V6=this['getLocalPath'](!0x0);a['copy'](RN['unzipped_proj_path'],V6,{'is_unbundled':!0x0},{'onProgress':RN=>RO['setProgressData'](RN),'onSuccess':()=>RP(Object['assign'](RN,{'tar_proj_path':V6})),'onFailure':RN=>VG(RN)});})},{'desc':RP['finish_restore'],'action':(RN,RO)=>new Promise((RP,VN)=>{a['deleteByList'](RN['unzipped_files_path'],{'isAsync':!0x0},{'onStart':()=>'server'===V9&&files['remove'](RN['zip_src_file']),'onProgress':RN=>RO['setProgressData'](RN),'onSuccess':()=>RP({'target_path':RN['tar_proj_path']}),'onFailure':RN=>VN(RN)});})}]})['act']();}};RN['exports']={'project':RS};},883:(VQ,VR,VS)=>{VS(0x2c4);let {project:i}=VS(0x1c5),{threadsx:n}=VS(0xef),{dialogsx:s}=VS(0x3b5),VT={'dialog':s['builds'](['项目部署','欢迎使用蚂蚁森林项目部署工具\x0a此工具用于\x20v2.0.0\x20以上版本的项目部署',['了解项目','hint'],['退出','caution'],['开始部署','attraction'],0x1])['on']('neutral',function(){s['builds'](['关于项目','-\x20功能简介\x20-\x0a'+['自动收取好友能量','自动收取/监测自己能量','收取结果统计/展示','控制台消息提示','自动解锁屏幕','定时任务与循环监测','多任务自动排队','脚本运行安全','事件监测与处理','黑名单机制','项目管理','账户功能','统计功能','图形化配置工具']['map'](VQ=>'·\x20'+VQ)['join']('\x0a')+'\x0a\x0a-\x20项目作者\x20-\x0a·\x20SuperMonster003\x0a\x0a-\x20项目链接\x20-\x0a·\x20https://github.com/SuperMonster003/Ant-Forest',0x0,0x0,'返回',0x1],{'linkify':'WEB_URLS'})['on']('positive',VQ=>VQ['dismiss']())['show']();})['on']('negative',VQ=>{VQ['dismiss'](),exit();})['on']('positive',VQ=>{VQ['dismiss'](),i['getReleases']({'min_version_name':'v2.0.1','show_progress_dialog':!0x0},VY);}),'view':null,'run'(){this['dialog']['show']();},'config'(){s['alerts']('CUI\x20(Configuration\x20User\x20Interface)\x20for\x20current\x20plugin\x20hasn\x27t\x20been\x20accomplished');},'getView'(){return this['view'];},'getDialog'(){return this['dialog'];}};function VY(VQ){if(!VQ['length'])return exit();let VR=VQ[0x0],VS=VR['version_name'];s['builds'](['选择项目版本','选择希望部署的项目版本',['版本历史','hint'],['X','warn'],'下一步',0x1],{'items':['最新版本\x20('+VS+')','其他版本'],'itemsSelectMode':'single','itemsSelectedIndex':0x0})['on']('neutral',()=>{i['getChangelog'](VS['match'](/v(\d+)/)[0x1],{'is_show_dialog':!0x0});})['on']('negative',VQ=>{s['builds'](['提示','项目部署尚未完成\x0a确定要退出吗',0x0,'B',['确定退出','caution'],0x1])['on']('negative',VQ=>{VQ['dismiss']();})['on']('positive',VR=>{s['dismiss']([VR,VQ]),exit();})['show']();})['on']('positive',VS=>{VS['dismiss'](),0x0===VS['getSelectedIndex']()?n['start'](()=>Wa(VR)):s['builds'](['选择其他项目版本','',0x0,'上一步','下一步',0x1],{'items':VQ['slice'](0x1)['map'](VQ=>VQ['version_name']),'itemsSelectMode':'single','itemsSelectedIndex':0x0})['on']('negative',VQ=>{VQ['dismiss'](),VS['show']();})['on']('positive',VR=>{VR['dismiss']();let VS=VR['getSelectedIndex']()+0x1;n['start'](()=>Wa(VQ[VS]));})['show']();})['show']();}function Wa(VQ){i['deploy'](VQ,{'onSuccess'(VQ,VR){let VS=VQ['target_path'];VR['removeAllListeners']('positive'),VR['setActionButton']('positive','下一步'),s['appendContentText'](VR,'\x0a\x0a项目部署路径:\x0a'+files['path'](VS)['replace'](files['getSdcardPath'](),'/内部存储')),VR['on']('positive',VQ=>{function VR(){let VQ=function(){s['clearPool']();let VQ=context['getPackageName'](),VR=VR=>{let Wm=VR||VQ;app['startActivity']({'packageName':VQ,'className':Wm+'.external.open.RunIntentActivity','data':'file://'+VS+'/ant-forest-launcher.js'});};try{VR('org.autojs.autojs');}catch(Wn){VR(VQ);}},VR=function(){s['clearPool'](),exit();};s['builds'](['项目使用声明',['代码完全公开','杜绝恶意代码','项目永久免费','欢迎提议反馈','','如需获知项目启动方式','可点击\x22了解更多\x22按钮']['map'](VQ=>VQ&&'·\x20'+VQ)['join']('\x0a'),['T','hint'],0x0,['完成部署','finish'],0x1])['on']('neutral',()=>s['builds'](['项目启动方式','以下方式可用于启动项目:\x0a'+['ant-forest-launcher运行按钮','目录顶部的项目运行按钮\x20(如有)','创建并使用桌面快捷方式']['map'](VQ=>VQ&&'·\x20'+VQ)['join']('\x0a'),['立即运行项目','attraction'],['B','default_aj_4'],['完成部署','finish'],0x1])['on']('neutral',VQ)['on']('negative',VQ=>VQ['dismiss']())['on']('positive',VR)['show']())['on']('positive',VR)['show']();}VQ['dismiss'](),engines['myEngine']()['source']['toString']()['match'](/^Ant.Forest.+er/)?dialogs['build']({'title':'新项目使用提示','content':'可能需要在Auto.js程序主页下拉刷新才能看到新项目\x0a新项目默认是以\x22Ant-Forest-003\x22命名的蓝色目录\x20进入目录可运行新项目\x0a对于当前目录下的旧项目文件\x20若无保留需要\x20可全部移除\x0a移除时需谨慎\x20避免误删可能存在的项目以外的重要文件','positive':'下一步','autoDismiss':!0x1,'canceledOnTouchOutside':!0x1})['on']('positive',VQ=>{VQ['dismiss'](),VR();})['show']():VR();});}},{'on_interrupt_btn_text':'X','success_title':'项目部署完成'});}VQ['exports']=VT;}},E={};function Ws(Wt){var Wu=E[Wt];if(void 0x0!==Wu)return Wu['exports'];var Wv=E[Wt]={'exports':{}};return A[Wt](Wv,Wv['exports'],Ws),Wv['exports'];}Ws['o']=(Ww,Wx)=>Object['prototype']['hasOwnProperty']['call'](Ww,Wx);var Wy={};Ws(0x373)['run']();})(); \ No newline at end of file diff --git a/tools/inspect-lock-screen-layout.js b/tools/inspect-lock-screen-layout.js index 80cce1f..f08842a 100644 --- a/tools/inspect-lock-screen-layout.js +++ b/tools/inspect-lock-screen-layout.js @@ -213,12 +213,12 @@ function dismissLayer() { let max_try_times_dismiss_layer = 20; let data_from_storage_flag = false; let chances_for_storage_data = 3; - let gesture_time = _cfg_sto.unlock_dismiss_layer_swipe_time; + let gesture_time = _cfg_sto.unlockDismissLayerSwipeDuration; if (gesture_time) { data_from_storage_flag = true; } else { - gesture_time = _cfg_def.unlock_dismiss_layer_swipe_time; + gesture_time = _cfg_def.unlockDismissLayerSwipeDuration; } let half_width = cX(0.5); @@ -235,7 +235,7 @@ function dismissLayer() { if (data_from_storage_flag) { if (--chances_for_storage_data < 0) { data_from_storage_flag = false; - gesture_time = _cfg_def.unlock_dismiss_layer_swipe_time; + gesture_time = _cfg_def.unlockDismissLayerSwipeDuration; } else { max_try_times_dismiss_layer += 1; } diff --git a/tools/inspect-specified-screen-layout.js b/tools/inspect-specified-screen-layout.js index c00c644..c12aa4c 100644 --- a/tools/inspect-specified-screen-layout.js +++ b/tools/inspect-specified-screen-layout.js @@ -1,8 +1,6 @@ -require('../modules/mod-global'); -let {threadsx} = require('../modules/ext-threads'); let {consolex} = require('../modules/ext-console'); -threadsx.start(() => { +threads.start(() => { toast('目标页面按"音量减"键捕获布局信息', 'L'); events.observeKey(); events.onceKeyDown('volume_down', function () { diff --git a/tools/show-next-auto-task-countdown.js b/tools/show-next-auto-task-countdown.js index 2c2c55d..dda705d 100644 --- a/tools/show-next-auto-task-countdown.js +++ b/tools/show-next-auto-task-countdown.js @@ -1,6 +1,5 @@ require('../modules/mod-global'); let {uix} = require('../modules/ext-ui'); -let {timersx} = require('../modules/ext-timers'); let _ts = _getTsFromArgv() || _getTsFromAutoTask() || _getTsFromDiag(); @@ -56,7 +55,7 @@ function _getTsFromArgv() { } function _getTsFromAutoTask() { - return timersx.queryTimedTasks({ + return tasks.queryTimedTasks({ path: files.path('../ant-forest-launcher.js'), }).map(task => task.getNextTime()).sort()[0]; } @@ -91,9 +90,9 @@ function _setCtdText(t) { ts += new Date(new Date().toLocaleDateString()).getTime(); } let _d = new Date(ts); - return _d.getHours().padStart(2, 0) + ':' + - _d.getMinutes().padStart(2, 0) + ':' + - _d.getSeconds().padStart(2, 0); + return Numberx.padStart(_d.getHours(), 2) + ':' + + Numberx.padStart(_d.getMinutes(), 2) + ':' + + Numberx.padStart(_d.getSeconds(), 2); }; let _aim = (function $iiFe() {