diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 029480d11..a29b851dc 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -11,39 +11,44 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: set up JDK 20 - uses: actions/setup-java@v3 - with: - java-version: '20' - distribution: 'temurin' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew assembleRelease - - - name: Upload arm64 artifacts - id: upload-arm64-apk - uses: actions/upload-artifact@v3 - with: - name: release-arm64-apk - path: app/build/outputs/apk/app/release/*arm64-v8a.apk - continue-on-error: true - - - name: Upload armv7 artifacts - id: upload-armv7-apk - uses: actions/upload-artifact@v3 - with: - name: release-armv7-apk - path: app/build/outputs/apk/app/release/*-v7a.apk - continue-on-error: true - - - name: Upload universl artifacts - id: upload-universal-apk - uses: actions/upload-artifact@v3 - with: - name: release-universal-apk - path: app/build/outputs/apk/app/release/*universal.apk - continue-on-error: true + - uses: actions/checkout@v3 + + - name: Set up JDK 20 + uses: actions/setup-java@v3 + with: + java-version: '20' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle (assembleInrtRelease) + run: ./gradlew assembleInrtRelease + + - name: Build with Gradle (assembleAppRelease) + run: ./gradlew assembleAppRelease + + - name: Upload arm64 artifacts + id: upload-arm64-apk + uses: actions/upload-artifact@v3 + with: + name: release-arm64-apk + path: app/build/outputs/apk/app/release/*-arm64-v8a.apk + continue-on-error: true + + - name: Upload armv7 artifacts + id: upload-armv7-apk + uses: actions/upload-artifact@v3 + with: + name: release-armv7-apk + path: app/build/outputs/apk/app/release/*-v7a.apk + continue-on-error: true + + - name: Upload universal artifacts + id: upload-universal-apk + uses: actions/upload-artifact@v3 + with: + name: release-universal-apk + path: app/build/outputs/apk/app/release/*-universal.apk + continue-on-error: true diff --git a/README.md b/README.md index 5c7abe11d..c3b529fe6 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,26 @@ AutoJs6 在 Auto.js 最终项目的基础上, 于 `2021/12/01` 进行二次开 [comment]: <> "Version history only shows last 3 versions" +# v6.4.1 + +###### 2023/11/02 + +* `修复` 构建工具无法自适应未知平台的问题 (by [TonyJiangWJ](https://github.com/TonyJiangWJ)) _[`pr #158`](http://pr.autojs6.com/158)_ +* `修复` 脚本退出时可能导致应用崩溃的问题 _[`issue #159`](http://issues.autojs6.com/159)_ +* `修复` http 模块获取响应对象的 body.contentType 返回值类型错误 _[`issue #142`](http://issues.autojs6.com/142)_ +* `修复` device.width 及 device.height 返回数据不正确的问题 _[`issue #160`](http://issues.autojs6.com/160)_ +* `修复` 代码编辑器长按删除时可能导致应用崩溃的问题 (试修) _[`issue #156`](http://issues.autojs6.com/156)_ +* `修复` 代码编辑器反向选择文本后进行常规操作可能导致应用崩溃的问题 +* `修复` 部分设备长按 AutoJs6 应用图标无法显示快捷方式菜单的问题 +* `修复` 部分设备打包项目时点击确认按钮无响应的问题 +* `修复` app.sendBroadcast 及 app.startActivity 无法使用简称参数的问题 +* `修复` floaty 模块 JsWindow#setPosition 等方法首次调用时的功能异常 +* `优化` 增加 Termux 相关权限以支持 Intent 调用 Termux 执行 ADB 命令 _[`issue #136`](http://issues.autojs6.com/136)_ +* `优化` http 模块获取的响应对象可重复使用 body.string() 及 body.bytes() 方法 +* `优化` 增加 GitHub Actions 自动打包支持 (by [TonyJiangWJ](https://github.com/TonyJiangWJ)) _[`pr #158`](http://pr.autojs6.com/158)_ +* `优化` 构建工具自适应 Temurin 平台 +* `优化` 部分依赖或本地库版本调整 _[`CHANGELOG.md`](http://project.autojs6.com/blob/master/app/src/main/assets/doc/CHANGELOG.md#v641)_ + # v6.4.0 ###### 2023/10/30 @@ -193,40 +213,6 @@ AutoJs6 在 Auto.js 最终项目的基础上, 于 `2021/12/01` 进行二次开 * `优化` 适配 VSCode 插件 1.0.6 * `优化` UiObject#parent 方法增加级数参数支持 (参阅 项目文档 > [控件节点](https://docs.autojs6.com/#/uiObjectType)) -# v6.3.2 - -###### 2023/07/06 - -* `新增` crypto 模块 (参阅 项目文档 > [密文](https://docs.autojs6.com/#/crypto)) _[`issue #70`](http://issues.autojs6.com/70)_ -* `新增` UI 模式增加 textswitcher / viewswitcher / viewflipper / numberpicker / video / search 等控件 -* `新增` 日志活动页面增加复制及导出日志等功能 _[`issue #76`](http://issues.autojs6.com/76)_ -* `新增` 客户端模式增加 IP 地址历史记录功能 -* `修复` 客户端模式自动连接或服务端模式自动开启后可能无法显示 IP 地址信息的问题 -* `修复` 客户端模式及服务端模式连接后在切换语言或夜间模式时连接断开且无法再次连接的问题 -* `修复` 客户端模式输入目标地址时无法使用自定义端口的问题 -* `修复` 客户端模式输入目标地址时某些字符将导致 AutoJs6 崩溃的问题 -* `修复` VSCode 插件远程命令可能出现解析失败造成命令无法响应的问题 (试修) -* `修复` Android 7.x 发现新版本时无法获取版本详情的问题 -* `修复` images.pixel 无法获取无障碍服务截图的像素色值的问题 _[`issue #73`](http://issues.autojs6.com/73)_ -* `修复` UI 模式 Android 原生控件 (大写字母开头) 无法使用预置控件属性的问题 -* `修复` runtime.loadDex/loadJar 加载多个文件时仅第一个文件生效的问题 _[`issue #88`](http://issues.autojs6.com/88)_ -* `修复` 部分设备安装应用后启动器仅显示文档图标的问题 (试修) _[`issue #85`](http://issues.autojs6.com/85)_ -* `优化` 适配 VSCode 插件 1.0.5 -* `优化` 支持 cheerio 模块 (Ref to [aiselp](https://github.com/aiselp/AutoX/commit/7176f5ad52d6904383024fb700bf19af75e22903)) _[`issue #65`](http://issues.autojs6.com/65)_ -* `优化` JsWebSocket 实例支持使用 rebuild 方法重新重建实例并建立连接 _[`issue #69`](http://issues.autojs6.com/69)_ -* `优化` base64 模块支持 number 数组及 Java 字节数组作为主要参数的编解码 -* `优化` 增加对 JavaMail for Android 的支持 _[`issue #71`](http://issues.autojs6.com/71)_ -* `优化` 获取版本更新信息时使用 Blob 数据类型以增强无代理网络环境适应性 -* `优化` 客户端模式连接过程中在主页抽屉副标题显示目标 IP 地址 -* `优化` 客户端模式输入目标地址时支持对不合法的输入进行提示 -* `优化` 客户端模式支持使用软键盘回车键建立连接 -* `优化` 服务端模式开启后保持常开状态 (除非手动关闭或应用进程结束) _[`issue #64`](http://issues.autojs6.com/64#issuecomment-1596990158)_ -* `优化` 实现 AutoJs6 与 VSCode 插件的双向版本检测并提示异常检测结果 _[`issue #89`](http://issues.autojs6.com/89)_ -* `优化` 增加短信数据读取权限 (android.permission.READ_SMS) (默认关闭) -* `优化` findMultiColors 方法内部实现 (by [LYS86](https://github.com/LYS86)) _[`pr #72`](http://pr.autojs6.com/72)_ -* `优化` runtime.loadDex/loadJar/load 支持按目录级别加载或同时加载多个文件 -* `优化` 部分依赖或本地库版本调整 _[`CHANGELOG.md`](http://project.autojs6.com/blob/master/app/src/main/assets/doc/CHANGELOG.md#v632)_ - ##### 更多版本历史可参阅 * [CHANGELOG.md](http://changelog.autojs6.com) @@ -243,12 +229,12 @@ AutoJs6 在 Auto.js 最终项目的基础上, 于 `2021/12/01` 进行二次开 #### Android Studio 准备 -下载 `Android Studio Hedgehog | 2023.1.1 RC 1` 版本 (按需选择其一): +下载 `Android Studio Hedgehog | 2023.1.1 RC 2` 版本 (按需选择其一): -- [android-studio-2023.1.1.23-windows.exe](https://redirector.gvt1.com/edgedl/android/studio/install/2023.1.1.23/android-studio-2023.1.1.23-windows.exe) (1.1 GB) -- [android-studio-2023.1.1.23-windows.zip](https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2023.1.1.23/android-studio-2023.1.1.23-windows.zip) (1.1 GB) +- [android-studio-2023.1.1.24-windows.exe](https://redirector.gvt1.com/edgedl/android/studio/install/2023.1.1.24/android-studio-2023.1.1.24-windows.exe) (1.1 GB) +- [android-studio-2023.1.1.24-windows.zip](https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2023.1.1.24/android-studio-2023.1.1.24-windows.zip) (1.1 GB) -> 注: 上述版本发布时间为 2023 年 10 月 17 日. 如需下载其他版本, 或上述链接已失效, 可访问 [Android Studio 发行版本归档](https://developer.android.com/studio/archive?hl=en) 页面. +> 注: 上述版本发布时间为 2023 年 10 月 30 日. 如需下载其他版本, 或上述链接已失效, 可访问 [Android Studio 发行版本归档](https://developer.android.com/studio/archive?hl=en) 页面. 安装或解压上述文件, 运行 Android Studio 软件 (如 `"D:\android-studio\bin\studio64.exe"`). @@ -385,13 +371,13 @@ Gradle | 贡献人员 | 提交数 | 最近提交 | |:-----------------------------------------------------:|:-------------------------------------------------------------------------------:|:------------:| +| [TonyJiangWJ](https://github.com/TonyJiangWJ) | [4](https://github.com/SuperMonster003/AutoJs6/commits?author=TonyJiangWJ) | `2023/10/31` | | [LZX284](https://github.com/LZX284) (Ai) | [13](https://github.com/SuperMonster003/AutoJs6/commits?author=LZX284) | `2023/10/09` | -| [TonyJiangWJ](https://github.com/TonyJiangWJ) | [3](https://github.com/SuperMonster003/AutoJs6/commits?author=TonyJiangWJ) | `2023/08/29` | | [little-alei](https://github.com/little-alei) (抠脚本人) | [12](https://github.com/SuperMonster003/AutoJs6/commits?author=little-alei) | `2023/07/12` | | [aiselp](https://github.com/aiselp) | [6](https://github.com/SuperMonster003/AutoJs6/pulls?q=is%3Apr+author%3Aaiselp) | `2023/06/14` | | [LYS86](https://github.com/LYS86) (LYS) | [2](https://github.com/SuperMonster003/AutoJs6/commits?author=LYS86) | `2023/06/03` | -数据更新于 `2023/10/25`. +数据更新于 `2023/10/31`. 数据条目按 `最近提交` 降序排序. @@ -411,7 +397,7 @@ Gradle - README.md - Latest changelog was synchronized by which in CHANGELOG.md - Changelog entries are not more than three - - The summary of the latest changelog for committing to Git + - The summary of the latest changelog for committing to Git [ DO NOT commit or push ] - Update badges like [ android studio / rhino / ... ] - Update android studio download links and version names - Remove the part like [ alpha / beta / ... ] of VERSION_NAME in version.properties @@ -421,4 +407,5 @@ Gradle - Check the two-way versions for AutoJs6 and VSCode ext, then publish the ext to Microsoft - Run Gradle task "app:assembleInrtRelease" - Build APK to determine the final VERSION_BUILD field + - Commit and push to GitHub ) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dc203c7d1..2b446eb2b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -113,7 +113,7 @@ dependencies /* Unclassified */ { implementation(project(":libs:jackpal.androidterm-1.0.70")) // Dex - implementation(files("$rootDir/libs/com.android.dx-1.7.0.jar")) + implementation(files("$rootDir/libs/com.android.dx-1.14.jar")) // OpenCV implementation(project(":libs:org.opencv-4.8.0")) @@ -649,17 +649,11 @@ class Versions(filePath: String) { private val javaVersionRaw = properties["JAVA_VERSION"] as String private var javaVersionInfoSuffix = "" private val javaVersionCeilMap = mapOf( - "as" to mapOf( - /* Empty so far. */ - ), "idea" to mapOf( "2023.2" to javaVersionMinSuggested, /* Aug 17, 2023. */ "2023.1" to javaVersionMinSuggested, /* Aug 17, 2023. */ "2022.3" to javaVersionMinSuggested, /* Aug 17, 2023. */ ), - "unknown" to mapOf( - /* Empty for unknown. */ - ) ) val javaVersion: JavaVersion by lazy { @@ -681,7 +675,7 @@ class Versions(filePath: String) { val platformVersion = gradle.extra["platformVersion"] as String val platformType = gradle.extra["platformType"] as String - javaVersionCeilMap[platformType]!![platformVersion]?.let { ceil: Int -> + javaVersionCeilMap[platformType]?.get(platformVersion)?.let { ceil: Int -> if (niceVersionInt > ceil) { niceVersionInt = ceil javaVersionInfoSuffix += " [coerced]" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 84ff26f58..7c364f7e8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -109,6 +109,8 @@ + + @@ -230,8 +232,6 @@ diff --git a/app/src/main/assets/doc/CHANGELOG.md b/app/src/main/assets/doc/CHANGELOG.md index 7c42ced94..3767563bc 100644 --- a/app/src/main/assets/doc/CHANGELOG.md +++ b/app/src/main/assets/doc/CHANGELOG.md @@ -4,11 +4,31 @@ ****** +# v6.4.1 + +###### 2023/11/02 + +* `修复` 构建工具无法自适应未知平台的问题 (by [TonyJiangWJ](https://github.com/TonyJiangWJ)) _[`pr #158`](http://pr.autojs6.com/158)_ +* `修复` 脚本退出时可能导致应用崩溃的问题 _[`issue #159`](http://issues.autojs6.com/159)_ +* `修复` http 模块获取响应对象的 body.contentType 返回值类型错误 _[`issue #142`](http://issues.autojs6.com/142)_ +* `修复` device.width 及 device.height 返回数据不正确的问题 _[`issue #160`](http://issues.autojs6.com/160)_ +* `修复` 代码编辑器长按删除时可能导致应用崩溃的问题 (试修) _[`issue #156`](http://issues.autojs6.com/156)_ +* `修复` 代码编辑器反向选择文本后进行常规操作可能导致应用崩溃的问题 +* `修复` 部分设备长按 AutoJs6 应用图标无法显示快捷方式菜单的问题 +* `修复` 部分设备打包项目时点击确认按钮无响应的问题 +* `修复` app.sendBroadcast 及 app.startActivity 无法使用简称参数的问题 +* `修复` floaty 模块 JsWindow#setPosition 等方法首次调用时的功能异常 +* `优化` 增加 Termux 相关权限以支持 Intent 调用 Termux 执行 ADB 命令 _[`issue #136`](http://issues.autojs6.com/136)_ +* `优化` http 模块获取的响应对象可重复使用 body.string() 及 body.bytes() 方法 +* `优化` 增加 GitHub Actions 自动打包支持 (by [TonyJiangWJ](https://github.com/TonyJiangWJ)) _[`pr #158`](http://pr.autojs6.com/158)_ +* `优化` 构建工具自适应 Temurin 平台 +* `依赖` 升级 Android dx 版本 1.11 -> 1.14 + # v6.4.0 ###### 2023/10/30 -* `新增` ocr 模块支持 Paddle Lite 引擎 (by [TonyJiangWJ](https://github.com/TonyJiangWJ)) _[`pr #120`](http://pr.autojs6.com/120)_ +* `新增` ocr 模块支持 Paddle Lite 引擎 (by [TonyJiangWJ](https://github.com/TonyJiangWJ)) _[`pr #120`](http://pr.autojs6.com/120)_ * `新增` 打包功能支持内置插件与外部插件两种打包方式 (by [LZX284](https://github.com/LZX284)) _[`pr #151`](http://pr.autojs6.com/151)_ * `新增` WebSocket 模块 (参阅 项目文档 > [WebSocket](https://docs.autojs6.com/#/webSocketType)) * `新增` barcode / qrcode 模块 (参阅 项目文档 > [条码](https://docs.autojs6.com/#/barcode) / [二维码](https://docs.autojs6.com/#/qrcode)) @@ -18,7 +38,7 @@ * `新增` 支持在安卓系统设置页面选择并切换应用语言 (安卓 13 及以上) * `新增` 支持设置页面添加或长按应用图标激活 [应用快捷方式](https://developer.android.com/guide/topics/ui/shortcuts?hl=zh-cn) , 可启动文档和设置等页面 * `修复` 重新合并部分 PR (by [aiselp](https://github.com/aiselp)) 以解决部分脚本无法正常结束运行的问题 _[`pr #75`](http://pr.autojs6.com/75)_ _[`pr #78`](http://pr.autojs6.com/78)_ -* `修复` 打包应用无法使用 AutoJs6 新增 API 的问题 (by [LZX284](https://github.com/LZX284)) _[`pr #151`](http://pr.autojs6.com/151)_ +* `修复` 打包应用无法使用 AutoJs6 新增 API 的问题 (by [LZX284](https://github.com/LZX284)) _[`pr #151`](http://pr.autojs6.com/151)_ _[`issue #149`](http://issues.autojs6.com/149)_ * `修复` 打包应用在系统夜间模式下的样式异常 * `修复` VSCode 插件保存文件到本地时文件扩展名信息丢失的问题 * `修复` 使用协程特性运行项目产生未捕获异常致使应用崩溃的问题 diff --git a/app/src/main/assets/docs/404.html b/app/src/main/assets/docs/404.html index 525edf4f6..5906a8298 100644 --- a/app/src/main/assets/docs/404.html +++ b/app/src/main/assets/docs/404.html @@ -2,7 +2,7 @@ - 页面不存在 | AutoJs6 文档 - 6.4.0 + 页面不存在 | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/activity.html b/app/src/main/assets/docs/activity.html index ea937ce56..aeb686398 100644 --- a/app/src/main/assets/docs/activity.html +++ b/app/src/main/assets/docs/activity.html @@ -2,7 +2,7 @@ - 活动 (Activity) | AutoJs6 文档 - 6.4.0 + 活动 (Activity) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/all.html b/app/src/main/assets/docs/all.html index 5c17a785a..188d441d2 100644 --- a/app/src/main/assets/docs/all.html +++ b/app/src/main/assets/docs/all.html @@ -2,7 +2,7 @@ - 综述 (Overview) | AutoJs6 文档 - 6.4.0 + 综述 (Overview) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | @@ -7891,6 +7891,9 @@

[p] mode#

当使用不同的工作模式名称时, ocr 全局方法及其相关方法 (如 ocr.detect) 将使用不同的引擎, 进而可能获得不同的识别速度和结果.

+
+

注: 使用 Paddle 工作模式时, 建议开启 AutoJs6 的 "忽略电池优化" 开关, 并降低对 AutoJs6 节电及后台运行等方面的限制, 否则可能导致应用崩溃.

+

[m] recognizeText#

用于识别图像中的全部文本.

recognizeText 方法与工作模式有关, 例如当工作模式为 paddle 时, ocr.recognizeText(...)ocr.paddle.recognizeText(...) 等价.

@@ -10497,7 +10500,7 @@

verbose(data, ...args)#

log(data, ...args)#

@@ -10520,7 +10523,7 @@

log(data, ...args)#

info(data, ...args)#

@@ -10538,7 +10541,7 @@

info(data, ...args) ] - #43A047
-

注: 此方法将自动添加末尾换行符

+

注: 此方法将自动添加末尾换行符.

[m] warn#

warn(data, ...args)#

@@ -10557,7 +10560,7 @@

warn(data, ...args) ] - #1976D2
-

注: 此方法将自动添加末尾换行符

+

注: 此方法将自动添加末尾换行符.

[m] error#

error(data, ...args)#

@@ -10575,7 +10578,7 @@

error(data, ...args)Activity 活动窗口 - [ ] - #C62828
-

注: 此方法将自动添加末尾换行符

+

注: 此方法将自动添加末尾换行符.

[m] assert#

assert(bool, message?)#

@@ -10597,7 +10600,7 @@

assert(bool, message?)console.assert(new Date().getSeconds() < 30, '断言失败, 当前时间秒数不小于 30');
-

注: 此方法将自动在控制台消息中添加末尾换行符

+

注: 此方法将自动在控制台消息中添加末尾换行符.

assert(func, message?)#

6.3.0 Overload [3-4]/4

@@ -10620,7 +10623,7 @@

assert(func, message?)#

clear()#

diff --git a/app/src/main/assets/docs/androidBundleType.html b/app/src/main/assets/docs/androidBundleType.html index fee95efca..08a39f495 100644 --- a/app/src/main/assets/docs/androidBundleType.html +++ b/app/src/main/assets/docs/androidBundleType.html @@ -2,7 +2,7 @@ - AndroidBundle | AutoJs6 文档 - 6.4.0 + AndroidBundle | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/androidRectType.html b/app/src/main/assets/docs/androidRectType.html index 861891fff..054403c2f 100644 --- a/app/src/main/assets/docs/androidRectType.html +++ b/app/src/main/assets/docs/androidRectType.html @@ -2,7 +2,7 @@ - AndroidRect | AutoJs6 文档 - 6.4.0 + AndroidRect | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/apiLevel.html b/app/src/main/assets/docs/apiLevel.html index 19eebd0f4..a59dc4d63 100644 --- a/app/src/main/assets/docs/apiLevel.html +++ b/app/src/main/assets/docs/apiLevel.html @@ -2,7 +2,7 @@ - 安卓 API 级别 (Android API Level) | AutoJs6 文档 - 6.4.0 + 安卓 API 级别 (Android API Level) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/app.html b/app/src/main/assets/docs/app.html index 02ffb2187..9a94afdf6 100644 --- a/app/src/main/assets/docs/app.html +++ b/app/src/main/assets/docs/app.html @@ -2,7 +2,7 @@ - 通用应用 (App) | AutoJs6 文档 - 6.4.0 + 通用应用 (App) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/appType.html b/app/src/main/assets/docs/appType.html index 725a0f3c2..408640fe9 100644 --- a/app/src/main/assets/docs/appType.html +++ b/app/src/main/assets/docs/appType.html @@ -2,7 +2,7 @@ - 应用枚举类 (App) | AutoJs6 文档 - 6.4.0 + 应用枚举类 (App) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/arrayx.html b/app/src/main/assets/docs/arrayx.html index f9ed9cddd..1d9986cfd 100644 --- a/app/src/main/assets/docs/arrayx.html +++ b/app/src/main/assets/docs/arrayx.html @@ -2,7 +2,7 @@ - Arrayx (Array 扩展) | AutoJs6 文档 - 6.4.0 + Arrayx (Array 扩展) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/autojs.html b/app/src/main/assets/docs/autojs.html index 8561c8f8c..c2752c13e 100644 --- a/app/src/main/assets/docs/autojs.html +++ b/app/src/main/assets/docs/autojs.html @@ -2,7 +2,7 @@ - AutoJs6 本体应用 | AutoJs6 文档 - 6.4.0 + AutoJs6 本体应用 | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/automator.html b/app/src/main/assets/docs/automator.html index 8501b9067..93a02f054 100644 --- a/app/src/main/assets/docs/automator.html +++ b/app/src/main/assets/docs/automator.html @@ -2,7 +2,7 @@ - 自动化 (Automator) | AutoJs6 文档 - 6.4.0 + 自动化 (Automator) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/barcode.html b/app/src/main/assets/docs/barcode.html index 89e0403f0..1a152c2c1 100644 --- a/app/src/main/assets/docs/barcode.html +++ b/app/src/main/assets/docs/barcode.html @@ -2,7 +2,7 @@ - 条码 (Barcode) | AutoJs6 文档 - 6.4.0 + 条码 (Barcode) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/base64.html b/app/src/main/assets/docs/base64.html index 711e716cd..a3c78e81b 100644 --- a/app/src/main/assets/docs/base64.html +++ b/app/src/main/assets/docs/base64.html @@ -2,7 +2,7 @@ - Base64 | AutoJs6 文档 - 6.4.0 + Base64 | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/canvas.html b/app/src/main/assets/docs/canvas.html index f5405055b..d3b402646 100644 --- a/app/src/main/assets/docs/canvas.html +++ b/app/src/main/assets/docs/canvas.html @@ -2,7 +2,7 @@ - 画布 (Canvas) | AutoJs6 文档 - 6.4.0 + 画布 (Canvas) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/changelog.html b/app/src/main/assets/docs/changelog.html index 3c0309a01..d19554df0 100644 --- a/app/src/main/assets/docs/changelog.html +++ b/app/src/main/assets/docs/changelog.html @@ -2,7 +2,7 @@ - 文档更新日志 (Changelog) | AutoJs6 文档 - 6.4.0 + 文档更新日志 (Changelog) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/color.html b/app/src/main/assets/docs/color.html index 63b1dd86b..f04b8c051 100644 --- a/app/src/main/assets/docs/color.html +++ b/app/src/main/assets/docs/color.html @@ -2,7 +2,7 @@ - 颜色 (Color) | AutoJs6 文档 - 6.4.0 + 颜色 (Color) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/colorTable.html b/app/src/main/assets/docs/colorTable.html index df9e42d92..a7c6cde91 100644 --- a/app/src/main/assets/docs/colorTable.html +++ b/app/src/main/assets/docs/colorTable.html @@ -2,7 +2,7 @@ - 颜色列表 (Color Table) | AutoJs6 文档 - 6.4.0 + 颜色列表 (Color Table) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/colorType.html b/app/src/main/assets/docs/colorType.html index 95b2b0c42..dd1f0e73c 100644 --- a/app/src/main/assets/docs/colorType.html +++ b/app/src/main/assets/docs/colorType.html @@ -2,7 +2,7 @@ - Color (颜色类) | AutoJs6 文档 - 6.4.0 + Color (颜色类) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/console.html b/app/src/main/assets/docs/console.html index 328bf9094..664a1508c 100644 --- a/app/src/main/assets/docs/console.html +++ b/app/src/main/assets/docs/console.html @@ -2,7 +2,7 @@ - 控制台 (Console) | AutoJs6 文档 - 6.4.0 + 控制台 (Console) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | @@ -903,7 +903,7 @@

verbose(data, ...args)#

log(data, ...args)#

@@ -926,7 +926,7 @@

log(data, ...args)#

info(data, ...args)#

@@ -944,7 +944,7 @@

info(data, ...args) ] - #43A047
-

注: 此方法将自动添加末尾换行符

+

注: 此方法将自动添加末尾换行符.

[m] warn#

warn(data, ...args)#

@@ -963,7 +963,7 @@

warn(data, ...args) ] - #1976D2
-

注: 此方法将自动添加末尾换行符

+

注: 此方法将自动添加末尾换行符.

[m] error#

error(data, ...args)#

@@ -981,7 +981,7 @@

error(data, ...args)Activity 活动窗口 - [ ] - #C62828
-

注: 此方法将自动添加末尾换行符

+

注: 此方法将自动添加末尾换行符.

[m] assert#

assert(bool, message?)#

@@ -1003,7 +1003,7 @@

assert(bool, message?)console.assert(new Date().getSeconds() < 30, '断言失败, 当前时间秒数不小于 30');
-

注: 此方法将自动在控制台消息中添加末尾换行符

+

注: 此方法将自动在控制台消息中添加末尾换行符.

assert(func, message?)#

6.3.0 Overload [3-4]/4

@@ -1026,7 +1026,7 @@

assert(func, message?)#

clear()#

diff --git a/app/src/main/assets/docs/consoleBuildOptionsType.html b/app/src/main/assets/docs/consoleBuildOptionsType.html index 4537c5d5f..3b8561b87 100644 --- a/app/src/main/assets/docs/consoleBuildOptionsType.html +++ b/app/src/main/assets/docs/consoleBuildOptionsType.html @@ -2,7 +2,7 @@ - ConsoleBuildOptions | AutoJs6 文档 - 6.4.0 + ConsoleBuildOptions | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/context.html b/app/src/main/assets/docs/context.html index 56aa2be3c..948db5364 100644 --- a/app/src/main/assets/docs/context.html +++ b/app/src/main/assets/docs/context.html @@ -2,7 +2,7 @@ - 上下文 (Context) | AutoJs6 文档 - 6.4.0 + 上下文 (Context) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/continuation.html b/app/src/main/assets/docs/continuation.html index 56b081869..6a04dfd9c 100644 --- a/app/src/main/assets/docs/continuation.html +++ b/app/src/main/assets/docs/continuation.html @@ -2,7 +2,7 @@ - 协程 (Continuation) | AutoJs6 文档 - 6.4.0 + 协程 (Continuation) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/coverpage.html b/app/src/main/assets/docs/coverpage.html index 431d83d98..2af4a5366 100644 --- a/app/src/main/assets/docs/coverpage.html +++ b/app/src/main/assets/docs/coverpage.html @@ -2,7 +2,7 @@ - [AutoJs6](http://project.autojs6.com) | AutoJs6 文档 - 6.4.0 + [AutoJs6](http://project.autojs6.com) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/crypto.html b/app/src/main/assets/docs/crypto.html index 64bbf7623..141a1cb20 100644 --- a/app/src/main/assets/docs/crypto.html +++ b/app/src/main/assets/docs/crypto.html @@ -2,7 +2,7 @@ - 密文 (Crypto) | AutoJs6 文档 - 6.4.0 + 密文 (Crypto) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/cryptoCipherOptionsType.html b/app/src/main/assets/docs/cryptoCipherOptionsType.html index 9ff99e268..7689082cd 100644 --- a/app/src/main/assets/docs/cryptoCipherOptionsType.html +++ b/app/src/main/assets/docs/cryptoCipherOptionsType.html @@ -2,7 +2,7 @@ - CryptoCipherOptions | AutoJs6 文档 - 6.4.0 + CryptoCipherOptions | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/cryptoKeyPairType.html b/app/src/main/assets/docs/cryptoKeyPairType.html index c621fa5c6..a0bf7d05f 100644 --- a/app/src/main/assets/docs/cryptoKeyPairType.html +++ b/app/src/main/assets/docs/cryptoKeyPairType.html @@ -2,7 +2,7 @@ - CryptoKeyPair | AutoJs6 文档 - 6.4.0 + CryptoKeyPair | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/cryptoKeyType.html b/app/src/main/assets/docs/cryptoKeyType.html index 8c9362202..d7d3a565f 100644 --- a/app/src/main/assets/docs/cryptoKeyType.html +++ b/app/src/main/assets/docs/cryptoKeyType.html @@ -2,7 +2,7 @@ - CryptoKey | AutoJs6 文档 - 6.4.0 + CryptoKey | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/dataTypes.html b/app/src/main/assets/docs/dataTypes.html index e0024a6fe..89a848338 100644 --- a/app/src/main/assets/docs/dataTypes.html +++ b/app/src/main/assets/docs/dataTypes.html @@ -2,7 +2,7 @@ - 数据类型 (Data Types) | AutoJs6 文档 - 6.4.0 + 数据类型 (Data Types) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/device.html b/app/src/main/assets/docs/device.html index e35ff6822..a0a98412b 100644 --- a/app/src/main/assets/docs/device.html +++ b/app/src/main/assets/docs/device.html @@ -2,7 +2,7 @@ - 设备 (Device) | AutoJs6 文档 - 6.4.0 + 设备 (Device) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/dialogs.html b/app/src/main/assets/docs/dialogs.html index 95636faa5..1908acf85 100644 --- a/app/src/main/assets/docs/dialogs.html +++ b/app/src/main/assets/docs/dialogs.html @@ -2,7 +2,7 @@ - 对话框 (Dialogs) | AutoJs6 文档 - 6.4.0 + 对话框 (Dialogs) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/documentation.html b/app/src/main/assets/docs/documentation.html index 3c06d22f8..897dc5f9b 100644 --- a/app/src/main/assets/docs/documentation.html +++ b/app/src/main/assets/docs/documentation.html @@ -2,7 +2,7 @@ - 关于文档 (About) | AutoJs6 文档 - 6.4.0 + 关于文档 (About) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/e4x.html b/app/src/main/assets/docs/e4x.html index e175a9b6d..ea98c34ae 100644 --- a/app/src/main/assets/docs/e4x.html +++ b/app/src/main/assets/docs/e4x.html @@ -2,7 +2,7 @@ - E4X | AutoJs6 文档 - 6.4.0 + E4X | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/engines.html b/app/src/main/assets/docs/engines.html index 6472e9b70..bb45b2eab 100644 --- a/app/src/main/assets/docs/engines.html +++ b/app/src/main/assets/docs/engines.html @@ -2,7 +2,7 @@ - 引擎 (Engines) | AutoJs6 文档 - 6.4.0 + 引擎 (Engines) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/eventEmitterType.html b/app/src/main/assets/docs/eventEmitterType.html index 1a0e351bc..a780d8bba 100644 --- a/app/src/main/assets/docs/eventEmitterType.html +++ b/app/src/main/assets/docs/eventEmitterType.html @@ -2,7 +2,7 @@ - 事件发射器 (EventEmitter) | AutoJs6 文档 - 6.4.0 + 事件发射器 (EventEmitter) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/events.html b/app/src/main/assets/docs/events.html index 8894ac243..b29db545d 100644 --- a/app/src/main/assets/docs/events.html +++ b/app/src/main/assets/docs/events.html @@ -2,7 +2,7 @@ - 事件监听 (Events) | AutoJs6 文档 - 6.4.0 + 事件监听 (Events) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/exceptions.html b/app/src/main/assets/docs/exceptions.html index cfae0690b..dae68a01e 100644 --- a/app/src/main/assets/docs/exceptions.html +++ b/app/src/main/assets/docs/exceptions.html @@ -2,7 +2,7 @@ - 异常 (Exceptions) | AutoJs6 文档 - 6.4.0 + 异常 (Exceptions) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/files.html b/app/src/main/assets/docs/files.html index 424b14ce7..2fd2ffc70 100644 --- a/app/src/main/assets/docs/files.html +++ b/app/src/main/assets/docs/files.html @@ -2,7 +2,7 @@ - 文件 (Files) | AutoJs6 文档 - 6.4.0 + 文件 (Files) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/floaty.html b/app/src/main/assets/docs/floaty.html index 45bb40afa..a8d34b41f 100644 --- a/app/src/main/assets/docs/floaty.html +++ b/app/src/main/assets/docs/floaty.html @@ -2,7 +2,7 @@ - 悬浮窗 (Floaty) | AutoJs6 文档 - 6.4.0 + 悬浮窗 (Floaty) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/global.html b/app/src/main/assets/docs/global.html index a65fef0e1..24e9dadc4 100644 --- a/app/src/main/assets/docs/global.html +++ b/app/src/main/assets/docs/global.html @@ -2,7 +2,7 @@ - 全局对象 (Global) | AutoJs6 文档 - 6.4.0 + 全局对象 (Global) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/glossaries.html b/app/src/main/assets/docs/glossaries.html index 36630b59b..e195abe5a 100644 --- a/app/src/main/assets/docs/glossaries.html +++ b/app/src/main/assets/docs/glossaries.html @@ -2,7 +2,7 @@ - 术语 (Glossaries) | AutoJs6 文档 - 6.4.0 + 术语 (Glossaries) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | @@ -641,7 +641,7 @@

控件矩形外展#

控件矩形 边界为非整数时, 外展将对各个边界做如下取整操作:

@@ -654,7 +654,7 @@

控件矩形内收#

阈值, 英文 threshold, 也称 "临界值".
阈值是令对象发生某种变化所需某种条件的值.

diff --git a/app/src/main/assets/docs/http.html b/app/src/main/assets/docs/http.html index 95d0a0a87..dacbd63d4 100644 --- a/app/src/main/assets/docs/http.html +++ b/app/src/main/assets/docs/http.html @@ -2,7 +2,7 @@ - HTTP | AutoJs6 文档 - 6.4.0 + HTTP | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/httpHeaderGlossary.html b/app/src/main/assets/docs/httpHeaderGlossary.html index 38e8aefc5..778664f18 100644 --- a/app/src/main/assets/docs/httpHeaderGlossary.html +++ b/app/src/main/assets/docs/httpHeaderGlossary.html @@ -2,7 +2,7 @@ - HTTP Header (HTTP 标头) | AutoJs6 文档 - 6.4.0 + HTTP Header (HTTP 标头) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/httpRequestBuilderOptionsType.html b/app/src/main/assets/docs/httpRequestBuilderOptionsType.html index 997e4d667..3c348b054 100644 --- a/app/src/main/assets/docs/httpRequestBuilderOptionsType.html +++ b/app/src/main/assets/docs/httpRequestBuilderOptionsType.html @@ -2,7 +2,7 @@ - HttpRequestBuilderOptions | AutoJs6 文档 - 6.4.0 + HttpRequestBuilderOptions | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/httpRequestHeadersType.html b/app/src/main/assets/docs/httpRequestHeadersType.html index 59fc0e5ca..9cdf20d8a 100644 --- a/app/src/main/assets/docs/httpRequestHeadersType.html +++ b/app/src/main/assets/docs/httpRequestHeadersType.html @@ -2,7 +2,7 @@ - HttpRequestHeaders | AutoJs6 文档 - 6.4.0 + HttpRequestHeaders | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/httpRequestMethodsGlossary.html b/app/src/main/assets/docs/httpRequestMethodsGlossary.html index 9d808df71..03daefec0 100644 --- a/app/src/main/assets/docs/httpRequestMethodsGlossary.html +++ b/app/src/main/assets/docs/httpRequestMethodsGlossary.html @@ -2,7 +2,7 @@ - HTTP Request Methods (HTTP 请求方法) | AutoJs6 文档 - 6.4.0 + HTTP Request Methods (HTTP 请求方法) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/httpResponseBodyType.html b/app/src/main/assets/docs/httpResponseBodyType.html index 6e347c991..cf9ac10c6 100644 --- a/app/src/main/assets/docs/httpResponseBodyType.html +++ b/app/src/main/assets/docs/httpResponseBodyType.html @@ -2,7 +2,7 @@ - HttpResponseBodyType | AutoJs6 文档 - 6.4.0 + HttpResponseBodyType | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/httpResponseHeadersType.html b/app/src/main/assets/docs/httpResponseHeadersType.html index 6fd57e9ab..793344dfe 100644 --- a/app/src/main/assets/docs/httpResponseHeadersType.html +++ b/app/src/main/assets/docs/httpResponseHeadersType.html @@ -2,7 +2,7 @@ - HttpResponseHeaders | AutoJs6 文档 - 6.4.0 + HttpResponseHeaders | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/httpResponseType.html b/app/src/main/assets/docs/httpResponseType.html index 39f643452..a5da573b6 100644 --- a/app/src/main/assets/docs/httpResponseType.html +++ b/app/src/main/assets/docs/httpResponseType.html @@ -2,7 +2,7 @@ - HttpResponse | AutoJs6 文档 - 6.4.0 + HttpResponse | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/i18n.html b/app/src/main/assets/docs/i18n.html index a00e91ea3..5c8adf528 100644 --- a/app/src/main/assets/docs/i18n.html +++ b/app/src/main/assets/docs/i18n.html @@ -2,7 +2,7 @@ - 国际化 (Internationalization) | AutoJs6 文档 - 6.4.0 + 国际化 (Internationalization) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/image.html b/app/src/main/assets/docs/image.html index 77510f3b6..71ce4a08a 100644 --- a/app/src/main/assets/docs/image.html +++ b/app/src/main/assets/docs/image.html @@ -2,7 +2,7 @@ - 图像 (Images) | AutoJs6 文档 - 6.4.0 + 图像 (Images) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/imageWrapperType.html b/app/src/main/assets/docs/imageWrapperType.html index 7fb7d0f65..de35c439c 100644 --- a/app/src/main/assets/docs/imageWrapperType.html +++ b/app/src/main/assets/docs/imageWrapperType.html @@ -2,7 +2,7 @@ - 包装图像类 (ImageWrapper) | AutoJs6 文档 - 6.4.0 + 包装图像类 (ImageWrapper) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/index.html b/app/src/main/assets/docs/index.html index 836270565..b1cb7a2a7 100644 --- a/app/src/main/assets/docs/index.html +++ b/app/src/main/assets/docs/index.html @@ -2,7 +2,7 @@ - Index | AutoJs6 文档 - 6.4.0 + Index | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/injectableWebClientType.html b/app/src/main/assets/docs/injectableWebClientType.html index e954cee8c..b594facd2 100644 --- a/app/src/main/assets/docs/injectableWebClientType.html +++ b/app/src/main/assets/docs/injectableWebClientType.html @@ -2,7 +2,7 @@ - InjectableWebClient | AutoJs6 文档 - 6.4.0 + InjectableWebClient | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/injectableWebViewType.html b/app/src/main/assets/docs/injectableWebViewType.html index 7a3e80d8f..389af7c17 100644 --- a/app/src/main/assets/docs/injectableWebViewType.html +++ b/app/src/main/assets/docs/injectableWebViewType.html @@ -2,7 +2,7 @@ - InjectableWebView | AutoJs6 文档 - 6.4.0 + InjectableWebView | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/intentType.html b/app/src/main/assets/docs/intentType.html index d31c2ee2c..31fd8fb6e 100644 --- a/app/src/main/assets/docs/intentType.html +++ b/app/src/main/assets/docs/intentType.html @@ -2,7 +2,7 @@ - 意图 (Intent) | AutoJs6 文档 - 6.4.0 + 意图 (Intent) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/keys.html b/app/src/main/assets/docs/keys.html index 3c7e38db6..810823289 100644 --- a/app/src/main/assets/docs/keys.html +++ b/app/src/main/assets/docs/keys.html @@ -2,7 +2,7 @@ - 按键 (Keys) | AutoJs6 文档 - 6.4.0 + 按键 (Keys) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/manual.html b/app/src/main/assets/docs/manual.html index 8a00f4c2e..690596eae 100644 --- a/app/src/main/assets/docs/manual.html +++ b/app/src/main/assets/docs/manual.html @@ -2,7 +2,7 @@ - AutoJs6 使用手册 (Manual) | AutoJs6 文档 - 6.4.0 + AutoJs6 使用手册 (Manual) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/mathx.html b/app/src/main/assets/docs/mathx.html index a50f26fdd..33f28fd46 100644 --- a/app/src/main/assets/docs/mathx.html +++ b/app/src/main/assets/docs/mathx.html @@ -2,7 +2,7 @@ - Mathx (Math 扩展) | AutoJs6 文档 - 6.4.0 + Mathx (Math 扩展) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/media.html b/app/src/main/assets/docs/media.html index 22da3b465..5e8a1a492 100644 --- a/app/src/main/assets/docs/media.html +++ b/app/src/main/assets/docs/media.html @@ -2,7 +2,7 @@ - 多媒体 (Media) | AutoJs6 文档 - 6.4.0 + 多媒体 (Media) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/mimeTypeGlossary.html b/app/src/main/assets/docs/mimeTypeGlossary.html index 71a44cd56..8e171960c 100644 --- a/app/src/main/assets/docs/mimeTypeGlossary.html +++ b/app/src/main/assets/docs/mimeTypeGlossary.html @@ -2,7 +2,7 @@ - MIME Type (MIME 类型) | AutoJs6 文档 - 6.4.0 + MIME Type (MIME 类型) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/modules.html b/app/src/main/assets/docs/modules.html index 86f5f6c1f..7fb74ece3 100644 --- a/app/src/main/assets/docs/modules.html +++ b/app/src/main/assets/docs/modules.html @@ -2,7 +2,7 @@ - 模块 (Module) | AutoJs6 文档 - 6.4.0 + 模块 (Module) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/notice.html b/app/src/main/assets/docs/notice.html index 9bdf681a8..5640459bb 100644 --- a/app/src/main/assets/docs/notice.html +++ b/app/src/main/assets/docs/notice.html @@ -2,7 +2,7 @@ - 消息通知 (Notice) | AutoJs6 文档 - 6.4.0 + 消息通知 (Notice) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/noticeBuilderType.html b/app/src/main/assets/docs/noticeBuilderType.html index 8feb7ef67..a56dca1bb 100644 --- a/app/src/main/assets/docs/noticeBuilderType.html +++ b/app/src/main/assets/docs/noticeBuilderType.html @@ -2,7 +2,7 @@ - NoticeBuilder | AutoJs6 文档 - 6.4.0 + NoticeBuilder | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | @@ -547,7 +547,7 @@

setUsesChronometer(b)#

setChronometerCountDown(countDown)#

@@ -566,7 +566,7 @@

setChronometerCountDown(countDown)#

setWhen(when)#

diff --git a/app/src/main/assets/docs/noticeChannelOptionsType.html b/app/src/main/assets/docs/noticeChannelOptionsType.html index a6981ce6c..9312c4d4f 100644 --- a/app/src/main/assets/docs/noticeChannelOptionsType.html +++ b/app/src/main/assets/docs/noticeChannelOptionsType.html @@ -2,7 +2,7 @@ - NoticeChannelOptions | AutoJs6 文档 - 6.4.0 + NoticeChannelOptions | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/noticeOptionsType.html b/app/src/main/assets/docs/noticeOptionsType.html index 3bca2b091..17d6dbc6a 100644 --- a/app/src/main/assets/docs/noticeOptionsType.html +++ b/app/src/main/assets/docs/noticeOptionsType.html @@ -2,7 +2,7 @@ - NoticeOptions | AutoJs6 文档 - 6.4.0 + NoticeOptions | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/noticePresetConfigurationType.html b/app/src/main/assets/docs/noticePresetConfigurationType.html index 814f3ee2f..86ec7a4ba 100644 --- a/app/src/main/assets/docs/noticePresetConfigurationType.html +++ b/app/src/main/assets/docs/noticePresetConfigurationType.html @@ -2,7 +2,7 @@ - NoticePresetConfiguration | AutoJs6 文档 - 6.4.0 + NoticePresetConfiguration | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/notificationChannelGlossary.html b/app/src/main/assets/docs/notificationChannelGlossary.html index dd98d670b..f6a1d94cb 100644 --- a/app/src/main/assets/docs/notificationChannelGlossary.html +++ b/app/src/main/assets/docs/notificationChannelGlossary.html @@ -2,7 +2,7 @@ - Notification Channel (通知渠道) | AutoJs6 文档 - 6.4.0 + Notification Channel (通知渠道) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/numberx.html b/app/src/main/assets/docs/numberx.html index e9acb490d..e8ce86f63 100644 --- a/app/src/main/assets/docs/numberx.html +++ b/app/src/main/assets/docs/numberx.html @@ -2,7 +2,7 @@ - Numberx (Number 扩展) | AutoJs6 文档 - 6.4.0 + Numberx (Number 扩展) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/ocr.html b/app/src/main/assets/docs/ocr.html index 6b90583e3..e59ee025b 100644 --- a/app/src/main/assets/docs/ocr.html +++ b/app/src/main/assets/docs/ocr.html @@ -2,7 +2,7 @@ - 光学字符识别 (OCR) | AutoJs6 文档 - 6.4.0 + 光学字符识别 (OCR) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | @@ -347,6 +347,9 @@

[p] mode#

当使用不同的工作模式名称时, ocr 全局方法及其相关方法 (如 ocr.detect) 将使用不同的引擎, 进而可能获得不同的识别速度和结果.

+
+

注: 使用 Paddle 工作模式时, 建议开启 AutoJs6 的 "忽略电池优化" 开关, 并降低对 AutoJs6 节电及后台运行等方面的限制, 否则可能导致应用崩溃.

+

[m] recognizeText#

用于识别图像中的全部文本.

recognizeText 方法与工作模式有关, 例如当工作模式为 paddle 时, ocr.recognizeText(...)ocr.paddle.recognizeText(...) 等价.

diff --git a/app/src/main/assets/docs/ocrOptionsType.html b/app/src/main/assets/docs/ocrOptionsType.html index acb16be93..1788a8f74 100644 --- a/app/src/main/assets/docs/ocrOptionsType.html +++ b/app/src/main/assets/docs/ocrOptionsType.html @@ -2,7 +2,7 @@ - OcrOptions | AutoJs6 文档 - 6.4.0 + OcrOptions | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/okhttp3HttpUrlType.html b/app/src/main/assets/docs/okhttp3HttpUrlType.html index fe72f8bd7..eecf739df 100644 --- a/app/src/main/assets/docs/okhttp3HttpUrlType.html +++ b/app/src/main/assets/docs/okhttp3HttpUrlType.html @@ -2,7 +2,7 @@ - Okhttp3HttpUrlType | AutoJs6 文档 - 6.4.0 + Okhttp3HttpUrlType | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/okhttp3RequestType.html b/app/src/main/assets/docs/okhttp3RequestType.html index e86b57e2e..a81761391 100644 --- a/app/src/main/assets/docs/okhttp3RequestType.html +++ b/app/src/main/assets/docs/okhttp3RequestType.html @@ -2,7 +2,7 @@ - Okhttp3Request | AutoJs6 文档 - 6.4.0 + Okhttp3Request | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/omniTypes.html b/app/src/main/assets/docs/omniTypes.html index 7b1c3066d..9de2debf9 100644 --- a/app/src/main/assets/docs/omniTypes.html +++ b/app/src/main/assets/docs/omniTypes.html @@ -2,7 +2,7 @@ - 全能类型 (Omnipotent Types) | AutoJs6 文档 - 6.4.0 + 全能类型 (Omnipotent Types) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/opencvPointType.html b/app/src/main/assets/docs/opencvPointType.html index 011ab28a8..933a62e4b 100644 --- a/app/src/main/assets/docs/opencvPointType.html +++ b/app/src/main/assets/docs/opencvPointType.html @@ -2,7 +2,7 @@ - OpencvPoint | AutoJs6 文档 - 6.4.0 + OpencvPoint | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/opencvRectType.html b/app/src/main/assets/docs/opencvRectType.html index 4f41db680..f0e592fa8 100644 --- a/app/src/main/assets/docs/opencvRectType.html +++ b/app/src/main/assets/docs/opencvRectType.html @@ -2,7 +2,7 @@ - OpencvRect | AutoJs6 文档 - 6.4.0 + OpencvRect | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/opencvSizeType.html b/app/src/main/assets/docs/opencvSizeType.html index 8e88058e6..8977f20ba 100644 --- a/app/src/main/assets/docs/opencvSizeType.html +++ b/app/src/main/assets/docs/opencvSizeType.html @@ -2,7 +2,7 @@ - OpencvSize | AutoJs6 文档 - 6.4.0 + OpencvSize | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/overview.html b/app/src/main/assets/docs/overview.html index eef563aa5..10c4539f7 100644 --- a/app/src/main/assets/docs/overview.html +++ b/app/src/main/assets/docs/overview.html @@ -2,7 +2,7 @@ - 综述 (Overview) | AutoJs6 文档 - 6.4.0 + 综述 (Overview) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/plugins.html b/app/src/main/assets/docs/plugins.html index 5905306be..044066156 100644 --- a/app/src/main/assets/docs/plugins.html +++ b/app/src/main/assets/docs/plugins.html @@ -2,7 +2,7 @@ - 插件 (Plugins) | AutoJs6 文档 - 6.4.0 + 插件 (Plugins) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/polyfill.html b/app/src/main/assets/docs/polyfill.html index 9790f7581..cba815d0e 100644 --- a/app/src/main/assets/docs/polyfill.html +++ b/app/src/main/assets/docs/polyfill.html @@ -2,7 +2,7 @@ - 代码填泥 (Polyfill) | AutoJs6 文档 - 6.4.0 + 代码填泥 (Polyfill) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/progress.html b/app/src/main/assets/docs/progress.html index c01f2b983..e2b05f79c 100644 --- a/app/src/main/assets/docs/progress.html +++ b/app/src/main/assets/docs/progress.html @@ -2,7 +2,7 @@ - 文档部署进度 (Progress) | AutoJs6 文档 - 6.4.0 + 文档部署进度 (Progress) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/qa.html b/app/src/main/assets/docs/qa.html index 0f8354473..50e20a595 100644 --- a/app/src/main/assets/docs/qa.html +++ b/app/src/main/assets/docs/qa.html @@ -2,7 +2,7 @@ - 疑难解答 (Q & A) | AutoJs6 文档 - 6.4.0 + 疑难解答 (Q & A) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/qrcode.html b/app/src/main/assets/docs/qrcode.html index 0b0073a97..a6889a972 100644 --- a/app/src/main/assets/docs/qrcode.html +++ b/app/src/main/assets/docs/qrcode.html @@ -2,7 +2,7 @@ - 二维码 (QR Code) | AutoJs6 文档 - 6.4.0 + 二维码 (QR Code) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/recorder.html b/app/src/main/assets/docs/recorder.html index c57eb4c32..32b02da95 100644 --- a/app/src/main/assets/docs/recorder.html +++ b/app/src/main/assets/docs/recorder.html @@ -2,7 +2,7 @@ - 记录器 (Recorder) | AutoJs6 文档 - 6.4.0 + 记录器 (Recorder) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/runtime.html b/app/src/main/assets/docs/runtime.html index 23c9ee0ad..390a083e4 100644 --- a/app/src/main/assets/docs/runtime.html +++ b/app/src/main/assets/docs/runtime.html @@ -2,7 +2,7 @@ - 运行时 (Runtime) | AutoJs6 文档 - 6.4.0 + 运行时 (Runtime) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/s13n.html b/app/src/main/assets/docs/s13n.html index 39bd1c43a..f9bbd230e 100644 --- a/app/src/main/assets/docs/s13n.html +++ b/app/src/main/assets/docs/s13n.html @@ -2,7 +2,7 @@ - 标准化 (Standardization) | AutoJs6 文档 - 6.4.0 + 标准化 (Standardization) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/scriptingJava.html b/app/src/main/assets/docs/scriptingJava.html index c7ec99b86..5fed10743 100644 --- a/app/src/main/assets/docs/scriptingJava.html +++ b/app/src/main/assets/docs/scriptingJava.html @@ -2,7 +2,7 @@ - 脚本化 Java | AutoJs6 文档 - 6.4.0 + 脚本化 Java | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/sensors.html b/app/src/main/assets/docs/sensors.html index fca314720..b6cad7779 100644 --- a/app/src/main/assets/docs/sensors.html +++ b/app/src/main/assets/docs/sensors.html @@ -2,7 +2,7 @@ - 传感器 (Sensors) | AutoJs6 文档 - 6.4.0 + 传感器 (Sensors) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/shell.html b/app/src/main/assets/docs/shell.html index 27e0233b7..76c6677e7 100644 --- a/app/src/main/assets/docs/shell.html +++ b/app/src/main/assets/docs/shell.html @@ -2,7 +2,7 @@ - Shell | AutoJs6 文档 - 6.4.0 + Shell | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/shizuku.html b/app/src/main/assets/docs/shizuku.html index fa0f8bc80..26c324557 100644 --- a/app/src/main/assets/docs/shizuku.html +++ b/app/src/main/assets/docs/shizuku.html @@ -2,7 +2,7 @@ - Shizuku | AutoJs6 文档 - 6.4.0 + Shizuku | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/sidebar.html b/app/src/main/assets/docs/sidebar.html index ec8778fa8..d5fdf41ff 100644 --- a/app/src/main/assets/docs/sidebar.html +++ b/app/src/main/assets/docs/sidebar.html @@ -2,7 +2,7 @@ - Index | AutoJs6 文档 - 6.4.0 + Index | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/storageType.html b/app/src/main/assets/docs/storageType.html index e7f4c6e25..1644a40a5 100644 --- a/app/src/main/assets/docs/storageType.html +++ b/app/src/main/assets/docs/storageType.html @@ -2,7 +2,7 @@ - Storage (存储类) | AutoJs6 文档 - 6.4.0 + Storage (存储类) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/storages.html b/app/src/main/assets/docs/storages.html index 2ed764b46..18331f70e 100644 --- a/app/src/main/assets/docs/storages.html +++ b/app/src/main/assets/docs/storages.html @@ -2,7 +2,7 @@ - 存储 (Storages) | AutoJs6 文档 - 6.4.0 + 存储 (Storages) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/tasks.html b/app/src/main/assets/docs/tasks.html index 884e780fd..dbe5b13c3 100644 --- a/app/src/main/assets/docs/tasks.html +++ b/app/src/main/assets/docs/tasks.html @@ -2,7 +2,7 @@ - 任务 (Tasks) | AutoJs6 文档 - 6.4.0 + 任务 (Tasks) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/threads.html b/app/src/main/assets/docs/threads.html index 79dcfdf59..f4db39590 100644 --- a/app/src/main/assets/docs/threads.html +++ b/app/src/main/assets/docs/threads.html @@ -2,7 +2,7 @@ - 线程 (Threads) | AutoJs6 文档 - 6.4.0 + 线程 (Threads) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/timers.html b/app/src/main/assets/docs/timers.html index f4aacd86a..95d2faa10 100644 --- a/app/src/main/assets/docs/timers.html +++ b/app/src/main/assets/docs/timers.html @@ -2,7 +2,7 @@ - 定时器 (Timers) | AutoJs6 文档 - 6.4.0 + 定时器 (Timers) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/toast.html b/app/src/main/assets/docs/toast.html index d66bed358..28d43363b 100644 --- a/app/src/main/assets/docs/toast.html +++ b/app/src/main/assets/docs/toast.html @@ -2,7 +2,7 @@ - 消息浮动框 (Toast) | AutoJs6 文档 - 6.4.0 + 消息浮动框 (Toast) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/ui.html b/app/src/main/assets/docs/ui.html index 8e58b1881..5bba7602f 100644 --- a/app/src/main/assets/docs/ui.html +++ b/app/src/main/assets/docs/ui.html @@ -2,7 +2,7 @@ - 用户界面 (UI) | AutoJs6 文档 - 6.4.0 + 用户界面 (UI) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/uiObjectActionsType.html b/app/src/main/assets/docs/uiObjectActionsType.html index 1c6905820..c828e9890 100644 --- a/app/src/main/assets/docs/uiObjectActionsType.html +++ b/app/src/main/assets/docs/uiObjectActionsType.html @@ -2,7 +2,7 @@ - 控件节点行为 (UiObjectActions) | AutoJs6 文档 - 6.4.0 + 控件节点行为 (UiObjectActions) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/uiObjectCollectionType.html b/app/src/main/assets/docs/uiObjectCollectionType.html index 4164877cf..89a559b51 100644 --- a/app/src/main/assets/docs/uiObjectCollectionType.html +++ b/app/src/main/assets/docs/uiObjectCollectionType.html @@ -2,7 +2,7 @@ - 控件集合 (UiObjectCollection) | AutoJs6 文档 - 6.4.0 + 控件集合 (UiObjectCollection) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/uiObjectType.html b/app/src/main/assets/docs/uiObjectType.html index 2a3162164..ba1ee75f2 100644 --- a/app/src/main/assets/docs/uiObjectType.html +++ b/app/src/main/assets/docs/uiObjectType.html @@ -2,7 +2,7 @@ - 控件节点 (UiObject) | AutoJs6 文档 - 6.4.0 + 控件节点 (UiObject) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/uiSelectorType.html b/app/src/main/assets/docs/uiSelectorType.html index a85f9f963..6f040ee3c 100644 --- a/app/src/main/assets/docs/uiSelectorType.html +++ b/app/src/main/assets/docs/uiSelectorType.html @@ -2,7 +2,7 @@ - 选择器 (UiSelector) | AutoJs6 文档 - 6.4.0 + 选择器 (UiSelector) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | @@ -4608,7 +4608,7 @@

click()untilFind 筛选得到控件集合, 对集合执行 [ 点击 ] 行为.

选择器行为 存在潜在的永久阻塞风险, 因此此方法不建议使用.

-

注: 此方法不是全局的, 它被 automator.click 替代

+

注: 此方法不是全局的, 它被 automator.click 替代.

[m#] longClick#

longClick()#

@@ -4619,7 +4619,7 @@

longClick()untilFind 筛选得到控件集合, 对集合执行 [ 长按 ] 行为.

选择器行为 存在潜在的永久阻塞风险, 因此此方法不建议使用.

-

注: 此方法不是全局的, 它被 automator.longClick 替代

+

注: 此方法不是全局的, 它被 automator.longClick 替代.

[m#] accessibilityFocus#

accessibilityFocus()#

@@ -4899,7 +4899,7 @@

scrollUp()untilFind 筛选得到控件集合, 对集合执行 [ 使视窗上移的滚动 ] 行为.

选择器行为 存在潜在的永久阻塞风险, 因此此方法不建议使用.

-

注: 此方法不是全局的, 它被 automator.scrollUp 替代

+

注: 此方法不是全局的, 它被 automator.scrollUp 替代.

[m#] scrollRight#

scrollRight()#

@@ -4918,7 +4918,7 @@

scrollDown()untilFind 筛选得到控件集合, 对集合执行 [ 使视窗下移的滚动 ] 行为.

选择器行为 存在潜在的永久阻塞风险, 因此此方法不建议使用.

-

注: 此方法不是全局的, 它被 automator.scrollDown 替代

+

注: 此方法不是全局的, 它被 automator.scrollDown 替代.

[m#] scrollForward#

scrollForward()#

@@ -4964,7 +4964,7 @@

setText(text)untilFind 筛选得到控件集合, 对集合执行 [ 设置文本 ] 行为.

选择器行为 存在潜在的永久阻塞风险, 因此此方法不建议使用.

-

注: 此方法不是全局的, 它被 automator.setText 替代

+

注: 此方法不是全局的, 它被 automator.setText 替代.

[m#] setSelection#

setSelection(start, end)#

diff --git a/app/src/main/assets/docs/util.html b/app/src/main/assets/docs/util.html index 89867c008..be7c63447 100644 --- a/app/src/main/assets/docs/util.html +++ b/app/src/main/assets/docs/util.html @@ -2,7 +2,7 @@ - Util | AutoJs6 文档 - 6.4.0 + Util | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/versionType.html b/app/src/main/assets/docs/versionType.html index 589b99ead..8347d473c 100644 --- a/app/src/main/assets/docs/versionType.html +++ b/app/src/main/assets/docs/versionType.html @@ -2,7 +2,7 @@ - 版本工具类 (Version) | AutoJs6 文档 - 6.4.0 + 版本工具类 (Version) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | @@ -252,7 +252,7 @@

版本工具类 (Version)
-

注: 此工具类源于 GitHub 开源项目 G00fY2/version-compare

+

注: 此工具类源于 GitHub 开源项目 G00fY2/version-compare.


Version

diff --git a/app/src/main/assets/docs/web.html b/app/src/main/assets/docs/web.html index c0428ea26..9c09d8413 100644 --- a/app/src/main/assets/docs/web.html +++ b/app/src/main/assets/docs/web.html @@ -2,7 +2,7 @@ - 万维网 (Web) | AutoJs6 文档 - 6.4.0 + 万维网 (Web) | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@
-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/docs/webSocketType.html b/app/src/main/assets/docs/webSocketType.html index df83ec22c..326fa80e3 100644 --- a/app/src/main/assets/docs/webSocketType.html +++ b/app/src/main/assets/docs/webSocketType.html @@ -2,7 +2,7 @@ - WebSocket | AutoJs6 文档 - 6.4.0 + WebSocket | AutoJs6 文档 - 6.4.1 @@ -160,7 +160,7 @@

-

AutoJs6 文档 - 6.4.0

+

AutoJs6 文档 - 6.4.1

索引 | diff --git a/app/src/main/assets/modules/__app__.js b/app/src/main/assets/modules/__app__.js index b427c78bc..9f82a10db 100644 --- a/app/src/main/assets/modules/__app__.js +++ b/app/src/main/assets/modules/__app__.js @@ -274,7 +274,7 @@ module.exports = function (scriptRuntime, scope) { if (rexWebSiteWithoutProtocol.test(o)) { return this.openUrl(`http://${o}`); } - let prop = runtime.getProperty(`${AppUtils.Companion.getActivityShortFormPrefix()}${o}`); + let prop = runtime.getProperty(`${AppUtils.activityShortFormPrefix()}${o}`); if (!prop) { throw Error(`Activity short form ${o} not found`); } @@ -326,7 +326,7 @@ module.exports = function (scriptRuntime, scope) { }, sendBroadcast(i) { if (typeof i === 'string') { - let property = runtime.getProperty(`${AppUtils.Companion.getBroadcastShortFormPrefix()}${i}`); + let property = runtime.getProperty(`${AppUtils.broadcastShortFormPrefix}${i}`); if (!property) { throw Error(`Broadcast short form ${i} not found`); } diff --git a/app/src/main/assets/modules/__http__.js b/app/src/main/assets/modules/__http__.js index d7a2394ff..d3ca82892 100644 --- a/app/src/main/assets/modules/__http__.js +++ b/app/src/main/assets/modules/__http__.js @@ -281,7 +281,22 @@ module.exports = function (scriptRuntime, scope) { return result; }, getBody() { + let resBody = res.body(); + let resBodyString; + let resBodyBytes; return Object.setPrototypeOf({ + string() { + if (typeof resBodyString !== 'undefined') { + return resBodyString; + } + return resBodyString = resBody.string(); + }, + bytes() { + if (typeof resBodyBytes !== 'undefined') { + return resBodyBytes; + } + return resBodyBytes = resBody.bytes(); + }, json() { /* "java.lang.IllegalStateException: closed" may happen. */ let str = this.string(); @@ -291,7 +306,10 @@ module.exports = function (scriptRuntime, scope) { throw Error('Failed to parse JSON. Body string may be not in JSON format'); } }, - }, res.body()); + get contentType() { + return resBody.contentType(); + }, + }, resBody); }, }.getResponse()), /** diff --git a/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt b/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt index 53952f3c7..bdbbe6c2d 100644 --- a/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt +++ b/app/src/main/java/org/autojs/autojs/core/automator/UiObject.kt @@ -415,6 +415,7 @@ open class UiObject( ?: super.findAccessibilityNodeInfosByViewId(viewId) } + @Deprecated("Deprecated in Java") override fun recycle() { try { super.recycle() diff --git a/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollAction.kt b/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollAction.kt index 2fc0eb456..8010012c1 100644 --- a/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollAction.kt +++ b/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollAction.kt @@ -16,6 +16,7 @@ class ScrollAction(private val mAction: Int, private val mIndex: Int) : SimpleAc return result } + @Suppress("DEPRECATION") private fun recycle(list: List, root: UiObject) { for (nodeInfo in list) { if (nodeInfo !== root) @@ -34,6 +35,7 @@ class ScrollAction(private val mAction: Int, private val mIndex: Int) : SimpleAc return list } + @Suppress("DEPRECATION") private fun findScrollableNodes(node: UiObject?, list: MutableList) { if (node == null) { return diff --git a/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollMaxAction.kt b/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollMaxAction.kt index fb6abaaee..720d55062 100644 --- a/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollMaxAction.kt +++ b/app/src/main/java/org/autojs/autojs/core/automator/action/ScrollMaxAction.kt @@ -24,6 +24,7 @@ class ScrollMaxAction(private val mScrollAction: Int) : SimpleAction() { return result } + @Suppress("DEPRECATION") private fun reset() { mMaxScrollableNode?.let { if(it != mRootNode){ diff --git a/app/src/main/java/org/autojs/autojs/core/automator/search/BFS.kt b/app/src/main/java/org/autojs/autojs/core/automator/search/BFS.kt index 3ca816e93..c429055ac 100644 --- a/app/src/main/java/org/autojs/autojs/core/automator/search/BFS.kt +++ b/app/src/main/java/org/autojs/autojs/core/automator/search/BFS.kt @@ -7,6 +7,7 @@ import kotlin.collections.ArrayList object BFS : SearchAlgorithm { + @Suppress("DEPRECATION") override fun search(root: UiObject, filter: Filter, limit: Int): ArrayList { val result = ArrayList() val queue = ArrayDeque() diff --git a/app/src/main/java/org/autojs/autojs/core/automator/search/DFS.kt b/app/src/main/java/org/autojs/autojs/core/automator/search/DFS.kt index 3e832a730..e839c66c9 100644 --- a/app/src/main/java/org/autojs/autojs/core/automator/search/DFS.kt +++ b/app/src/main/java/org/autojs/autojs/core/automator/search/DFS.kt @@ -11,6 +11,7 @@ import kotlin.collections.ArrayList */ object DFS : SearchAlgorithm { + @Suppress("DEPRECATION") override fun search(root: UiObject, filter: Filter, limit: Int): ArrayList { val result = ArrayList() val stack = LinkedList() diff --git a/app/src/main/java/org/autojs/autojs/core/automator/test/TestUiObject.kt b/app/src/main/java/org/autojs/autojs/core/automator/test/TestUiObject.kt index 53b4ccae7..3134f9941 100644 --- a/app/src/main/java/org/autojs/autojs/core/automator/test/TestUiObject.kt +++ b/app/src/main/java/org/autojs/autojs/core/automator/test/TestUiObject.kt @@ -55,6 +55,7 @@ class TestUiObject @JvmOverloads constructor(private val mChildCount: Int = max( return random.nextBoolean() } + @Deprecated("Deprecated in Java") override fun recycle() { if (mRecycled) { throw IllegalStateException() diff --git a/app/src/main/java/org/autojs/autojs/execution/ScriptExecuteActivity.java b/app/src/main/java/org/autojs/autojs/execution/ScriptExecuteActivity.java index 587e81f8b..143160021 100644 --- a/app/src/main/java/org/autojs/autojs/execution/ScriptExecuteActivity.java +++ b/app/src/main/java/org/autojs/autojs/execution/ScriptExecuteActivity.java @@ -15,6 +15,7 @@ import org.autojs.autojs.core.eventloop.EventEmitter; import org.autojs.autojs.core.eventloop.SimpleEvent; +import org.autojs.autojs.core.looper.Loopers; import org.autojs.autojs.engine.JavaScriptEngine; import org.autojs.autojs.engine.LoopBasedJavaScriptEngine; import org.autojs.autojs.engine.ScriptEngine; @@ -37,8 +38,6 @@ public class ScriptExecuteActivity extends AppCompatActivity { private ScriptSource mScriptSource; private ActivityScriptExecution mScriptExecution; private ScriptRuntime mRuntime; - - private EventEmitter mEventEmitter; public static ActivityScriptExecution execute(Context context, ScriptEngineManager manager, ScriptExecutionTask task) { @@ -137,14 +136,22 @@ public void finish() { @Override protected void onDestroy() { super.onDestroy(); + Log.d(LOG_TAG, "onDestroy"); + if (mScriptEngine != null) { mScriptEngine.put("activity", null); mScriptEngine.setTag("activity", null); mScriptEngine.destroy(); } mScriptExecution = null; - mRuntime.loopers.waitWhenIdle(false); + + if (mRuntime != null) { + Loopers loopers = mRuntime.loopers; + if (loopers != null) { + loopers.waitWhenIdle(false); + } + } } @Override diff --git a/app/src/main/java/org/autojs/autojs/permission/ShizukuPermission.kt b/app/src/main/java/org/autojs/autojs/permission/ShizukuPermission.kt index fd068b692..6af0e7838 100644 --- a/app/src/main/java/org/autojs/autojs/permission/ShizukuPermission.kt +++ b/app/src/main/java/org/autojs/autojs/permission/ShizukuPermission.kt @@ -9,7 +9,7 @@ import rikka.shizuku.Shizuku class ShizukuPermission(override val context: Context) : PermissionItemHelper { - override fun has() = WrappedShizuku.hasPermission() + override fun has() = WrappedShizuku.hasPermission() && WrappedShizuku.isRunning() override fun request() { when { @@ -24,7 +24,7 @@ class ShizukuPermission(override val context: Context) : PermissionItemHelper { } catch (e: Throwable) { e.printStackTrace() } - WrappedShizuku.config(true) ?: ViewUtils.showToast(context, R.string.error_failed_to_grant_shizuku_access) + WrappedShizuku.config(context, true) ?: ViewUtils.showToast(context, R.string.error_failed_to_grant_shizuku_access) } } } @@ -33,10 +33,8 @@ class ShizukuPermission(override val context: Context) : PermissionItemHelper { when { !WrappedShizuku.isInstalled() -> ViewUtils.showToast(context, R.string.error_shizuku_is_not_installed) Shizuku.isPreV11() -> ViewUtils.showToast(context, R.string.error_shizuku_version_is_not_supported) - else -> WrappedShizuku.config(false) ?: ViewUtils.showToast(context, R.string.error_failed_to_revoke_shizuku_access) + else -> WrappedShizuku.config(context, false) ?: ViewUtils.showToast(context, R.string.error_failed_to_revoke_shizuku_access) } } - - } \ No newline at end of file diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/AppUtils.kt b/app/src/main/java/org/autojs/autojs/runtime/api/AppUtils.kt index 33c8c55fa..2a48457c7 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/AppUtils.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/AppUtils.kt @@ -1,7 +1,6 @@ package org.autojs.autojs.runtime.api import android.app.Activity -import android.content.ComponentName import android.content.Context import android.content.Intent import android.content.pm.ApplicationInfo @@ -85,7 +84,6 @@ class AppUtils { null } - @Suppress("DEPRECATION") private fun getApplicationInfoCompat(packageManager: PackageManager, packageName: String, flags: Int) = when { Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> { packageManager.getApplicationInfo(packageName, ApplicationInfoFlags.of(flags.toLong())) @@ -115,7 +113,6 @@ class AppUtils { false } - @Suppress("DEPRECATION") private fun getPackageInfoCompat(packageManager: PackageManager, packageName: String, flags: Int) = when { Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> { packageManager.getPackageInfo(packageName, PackageInfoFlags.of(flags.toLong())) @@ -230,10 +227,10 @@ class AppUtils { } @JvmStatic - fun isBroadcastShortForm(s: String) = BroadcastShortForm.values().any { it.shortName.contentEquals(s) } + fun isBroadcastShortForm(s: String) = BroadcastShortForm.entries.any { it.shortName.contentEquals(s) } @JvmStatic - fun isActivityShortForm(s: String) = ActivityShortForm.values().any { it.shortName.contentEquals(s) } + fun isActivityShortForm(s: String) = ActivityShortForm.entries.any { it.shortName.contentEquals(s) } fun getInstalledApplications(context: Context): List = context.packageManager.let { when { diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/Events.java b/app/src/main/java/org/autojs/autojs/runtime/api/Events.java index d1dff4a6d..4a8f0e373 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/Events.java +++ b/app/src/main/java/org/autojs/autojs/runtime/api/Events.java @@ -250,7 +250,9 @@ public void removeNotificationObserver() { NotificationListenerService.getInstance().removeListener(this); } mListeningNotification = false; - mLoopers.waitWhenIdle(mListeningToast); + if (!mListeningToast) { + mLoopers.waitWhenIdle(false); + } } public void observeToast() { @@ -266,11 +268,10 @@ public void observeToast() { public void removeToastObserver() { mAccessibilityBridge.getNotificationObserver().removeToastListener(this); - if (NotificationListenerService.getInstance() != null) { - NotificationListenerService.getInstance().removeListener(this); - } mListeningToast = false; - mLoopers.waitWhenIdle(mListeningNotification); + if (!mListeningNotification) { + mLoopers.waitWhenIdle(false); + } } public Events onNotification(Object listener) { @@ -283,7 +284,6 @@ public Events onToast(Object listener) { return this; } - public void recycle() { broadcast.unregister(); if (mListeningKey) { diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/Floaty.kt b/app/src/main/java/org/autojs/autojs/runtime/api/Floaty.kt index 2ca9a3106..baca880ce 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/Floaty.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/Floaty.kt @@ -7,7 +7,6 @@ import android.view.ContextThemeWrapper import android.view.View import android.view.ViewGroup import org.autojs.autojs.annotation.ScriptInterface -import org.autojs.autojs.ui.enhancedfloaty.FloatyService import org.autojs.autojs.core.floaty.BaseResizableFloatyWindow import org.autojs.autojs.core.floaty.RawWindow import org.autojs.autojs.core.floaty.RawWindow.RawFloaty @@ -16,10 +15,11 @@ import org.autojs.autojs.permission.DisplayOverOtherAppsPermission import org.autojs.autojs.runtime.ScriptRuntime import org.autojs.autojs.runtime.exception.ScriptInterruptedException import org.autojs.autojs.tool.UiHandler +import org.autojs.autojs.ui.enhancedfloaty.FloatyService import org.autojs.autojs.util.ViewUtils.setViewMeasure import org.autojs.autojs6.R -import java.lang.Exception import java.util.concurrent.CopyOnWriteArraySet +import kotlin.concurrent.Volatile /** * Created by Stardust on 2017/12/5. @@ -97,62 +97,65 @@ class Floaty(private val mUiHandler: UiHandler, private val mRuntime: ScriptRunt inner class JsRawWindow(floaty: RawFloaty) : JsWindow { - private var mWindow = RawWindow(floaty, mUiHandler.context) + private var mWindow: RawWindow? = null private var mExitOnClose = false init { + mWindow = RawWindow(floaty, mUiHandler.context) mUiHandler.context.startService(Intent(mUiHandler.context, FloatyService::class.java)) - runWithWindow { FloatyService.addWindow(mWindow) } + + val r = Runnable { FloatyService.addWindow(mWindow) } + + /* 如果是 UI 线程则直接创建, 否则放入 UI 线程. */ + if (isUiThread()) r.run() else mUiHandler.post(r) } fun findView(id: String?): View? { - return JsViewHelper.findViewByStringId(mWindow.contentView, id) + return mWindow?.let { JsViewHelper.findViewByStringId(it.contentView, id) } } val x: Int - get() = mWindow.windowBridge.x + get() = mWindow?.windowBridge?.x ?: -1 val y: Int - get() = mWindow.windowBridge.y + get() = mWindow?.windowBridge?.y ?: -1 val width: Int - get() = mWindow.windowView.width + get() = mWindow?.windowView?.width ?: 0 val height: Int - get() = mWindow.windowView.height + get() = mWindow?.windowView?.height ?: 0 fun setSize(w: Int, h: Int) = runWithWindow { - mWindow.windowBridge.updateMeasure(w, h) - setViewMeasure(mWindow.windowView, w, h) + mWindow!!.windowBridge.updateMeasure(w, h) + setViewMeasure(mWindow!!.windowView, w, h) } fun setTouchable(touchable: Boolean) = runWithWindow { - mWindow.setTouchable(touchable) + mWindow!!.setTouchable(touchable) } private fun runWithWindow(r: Runnable) { - if (isUiThread()) { - r.run() - } else { - mUiHandler.post(r) - } + mWindow ?: return + mUiHandler.post(r) } fun setPosition(x: Int, y: Int) = runWithWindow { - mWindow.windowBridge.updatePosition(x, y) + mWindow!!.windowBridge.updatePosition(x, y) } fun exitOnClose() { mExitOnClose = true } - fun requestFocus() = mWindow.requestWindowFocus() + fun requestFocus() = mWindow?.requestWindowFocus() - fun disableFocus() = mWindow.disableWindowFocus() + fun disableFocus() = mWindow?.disableWindowFocus() fun close() = close(true) override fun close(removeFromWindows: Boolean) { if (!removeFromWindows || removeWindow(this)) { runWithWindow { - mWindow.close() + mWindow!!.close() + mWindow = null if (mExitOnClose) { mRuntime.exit() } @@ -163,71 +166,76 @@ class Floaty(private val mUiHandler: UiHandler, private val mRuntime: ScriptRunt inner class JsResizableWindow(supplier: BaseResizableFloatyWindow.ViewSupplier) : JsWindow { - private lateinit var mView: View + private var mView: View? = null @Volatile - private var mWindow = BaseResizableFloatyWindow(mUiHandler.context, object : BaseResizableFloatyWindow.ViewSupplier { - override fun inflate(context: Context?, parent: ViewGroup?): View { - return supplier.inflate(context, parent).also { mView = it } - } - }) + private var mWindow: BaseResizableFloatyWindow? = null + private var mExitOnClose = false init { + mWindow = BaseResizableFloatyWindow(mContext, object : BaseResizableFloatyWindow.ViewSupplier { + override fun inflate(context: Context?, parent: ViewGroup?): View { + return supplier.inflate(context, parent).also { mView = it } + } + }) mUiHandler.context.startService(Intent(mUiHandler.context, FloatyService::class.java)) - runWithWindow { FloatyService.addWindow(mWindow) } - mWindow.setOnCloseButtonClickListener { _ -> close() } + + val r = Runnable { FloatyService.addWindow(mWindow!!) } + + /* 如果是 UI 线程则直接创建, 否则放入 UI 线程. */ + if (Looper.myLooper() == Looper.getMainLooper()) r.run() else mUiHandler.post(r) + + mWindow!!.setOnCloseButtonClickListener { _ -> close() } // setSize(mWindow.getWindowBridge().getScreenWidth() / 2, mWindow.getWindowBridge().getScreenHeight() / 2); } - fun findView(id: String?) = JsViewHelper.findViewByStringId(mView, id) + fun findView(id: String?) = mView?.let { JsViewHelper.findViewByStringId(it, id) } val x: Int - get() = mWindow.windowBridge.x + get() = mWindow?.windowBridge?.x ?: -1 val y: Int - get() = mWindow.windowBridge.y + get() = mWindow?.windowBridge?.y ?: -1 val width: Int - get() = mWindow.rootView.width + get() = mWindow?.rootView?.width ?: 0 val height: Int - get() = mWindow.rootView.height + get() = mWindow?.rootView?.height ?: 0 fun setSize(w: Int, h: Int) = runWithWindow { - mWindow.windowBridge.updateMeasure(w, h) - setViewMeasure(mWindow.rootView, w, h) + mWindow!!.windowBridge.updateMeasure(w, h) + setViewMeasure(mWindow!!.rootView, w, h) } private fun runWithWindow(r: Runnable) { - if (isUiThread()) { - r.run() - } else { - mUiHandler.post(r) - } + mWindow ?: return + mUiHandler.post(r) } fun setPosition(x: Int, y: Int) = runWithWindow { - mWindow.windowBridge.updatePosition(x, y) + mWindow!!.windowBridge.updatePosition(x, y) } var isAdjustEnabled: Boolean - get() = mWindow.isAdjustEnabled + get() = mWindow?.isAdjustEnabled ?: false set(enabled) { - runWithWindow { mWindow.isAdjustEnabled = enabled } + runWithWindow { mWindow!!.isAdjustEnabled = enabled } } fun exitOnClose() { mExitOnClose = true } - fun requestFocus() = mWindow.requestWindowFocus() + fun requestFocus() = mWindow?.requestWindowFocus() - fun disableFocus() = mWindow.disableWindowFocus() + fun disableFocus() = mWindow?.disableWindowFocus() fun close() = close(true) override fun close(removeFromWindows: Boolean) { if (!removeFromWindows || removeWindow(this)) { runWithWindow { - mWindow.close() + mWindow!!.close() + mWindow = null if (mExitOnClose) { mRuntime.exit() } diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/ScreenMetrics.kt b/app/src/main/java/org/autojs/autojs/runtime/api/ScreenMetrics.kt index b4f1278c3..b220c181f 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/ScreenMetrics.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/ScreenMetrics.kt @@ -1,6 +1,7 @@ package org.autojs.autojs.runtime.api import android.app.Activity +import android.content.Context import android.content.res.Configuration.ORIENTATION_LANDSCAPE import android.content.res.Configuration.ORIENTATION_PORTRAIT import android.content.res.Resources @@ -8,6 +9,7 @@ import android.graphics.Point import android.util.DisplayMetrics import android.view.Surface.ROTATION_0 import android.view.WindowManager +import org.autojs.autojs.app.GlobalAppContext /** * Created by Stardust on 2017/4/26. @@ -50,13 +52,19 @@ class ScreenMetrics(private var designWidth: Int, private var designHeight: Int) var resources: Resources? = null - private var mWindowManager: WindowManager? = null private var mIsInitialized = false + private var mPrivateWindowManager: WindowManager? = null + private var windowManager: WindowManager + get() = mPrivateWindowManager ?: GlobalAppContext.get().getSystemService(Context.WINDOW_SERVICE) as WindowManager + set(value) { + mPrivateWindowManager = value + } + @Suppress("DEPRECATION") @JvmStatic val rotation: Int - get() = mWindowManager?.defaultDisplay?.rotation ?: ROTATION_0 + get() = windowManager.defaultDisplay?.rotation ?: ROTATION_0 @JvmStatic val orientation: Int @@ -74,30 +82,24 @@ class ScreenMetrics(private var designWidth: Int, private var designHeight: Int) @Suppress("DEPRECATION") val deviceScreenWidth: Int get() { - resources?.displayMetrics?.widthPixels?.takeIf { it > 0 }?.let { return it } + // resources?.displayMetrics?.widthPixels?.takeIf { it > 0 }?.let { return it } val metricsLegacy = DisplayMetrics() - val display = mWindowManager?.defaultDisplay?.apply { getRealMetrics(metricsLegacy) } - metricsLegacy.widthPixels.takeIf { it > 0 }?.let { return it } - - display?.width?.takeIf { it > 0 }?.let { return it } - - return 0 + return windowManager.defaultDisplay.apply { getRealMetrics(metricsLegacy) }.let { display -> + maxOf(metricsLegacy.widthPixels, display.width, 0) + } } @JvmStatic @Suppress("DEPRECATION") val deviceScreenHeight: Int get() { - resources?.displayMetrics?.heightPixels?.takeIf { it > 0 }?.let { return it } + // resources?.displayMetrics?.heightPixels?.takeIf { it > 0 }?.let { return it } val metricsLegacy = DisplayMetrics() - val display = mWindowManager?.defaultDisplay?.apply { getRealMetrics(metricsLegacy) } - metricsLegacy.heightPixels.takeIf { it > 0 }?.let { return it } - - display?.height?.takeIf { it > 0 }?.let { return it } - - return 0 + return windowManager.defaultDisplay.apply { getRealMetrics(metricsLegacy) }.let { display -> + maxOf(metricsLegacy.heightPixels, display.height, 0) + } } @JvmStatic @@ -105,14 +107,14 @@ class ScreenMetrics(private var designWidth: Int, private var designHeight: Int) val deviceScreenDensity: Int get() { val metricsLegacy = DisplayMetrics() - mWindowManager?.defaultDisplay?.apply { getRealMetrics(metricsLegacy) } + windowManager.defaultDisplay?.apply { getRealMetrics(metricsLegacy) } return metricsLegacy.densityDpi } @JvmStatic fun init(activity: Activity) { resources = activity.resources - mWindowManager = activity.windowManager + windowManager = activity.windowManager mIsInitialized = true } diff --git a/app/src/main/java/org/autojs/autojs/runtime/api/WrappedShizuku.kt b/app/src/main/java/org/autojs/autojs/runtime/api/WrappedShizuku.kt index 45d578b79..3f104f84c 100644 --- a/app/src/main/java/org/autojs/autojs/runtime/api/WrappedShizuku.kt +++ b/app/src/main/java/org/autojs/autojs/runtime/api/WrappedShizuku.kt @@ -1,6 +1,7 @@ package org.autojs.autojs.runtime.api import android.content.ComponentName +import android.content.Context import android.content.Intent import android.content.ServiceConnection import android.content.pm.PackageManager @@ -11,6 +12,7 @@ import org.autojs.autojs.annotation.ScriptInterface import org.autojs.autojs.app.GlobalAppContext import org.autojs.autojs.core.shizuku.IUserService import org.autojs.autojs.core.shizuku.UserService +import org.autojs.autojs.util.App.* import org.autojs.autojs.util.ViewUtils import org.autojs.autojs6.BuildConfig import org.autojs.autojs6.R @@ -27,10 +29,8 @@ object WrappedShizuku { private val TAG: String = WrappedShizuku::class.java.simpleName - private val context - get() = GlobalAppContext.get() - private val mRequestCode = "shizuku-request-code".hashCode() + private var mHasBinder = false private val mUserServiceConnection: ServiceConnection = object : ServiceConnection { override fun onServiceConnected(componentName: ComponentName, binder: IBinder?) { @@ -58,11 +58,13 @@ object WrappedShizuku { Log.d(TAG, "Shizuku pre-v11 is not supported") } else { Log.d(TAG, "Binder received") + mHasBinder = true } } private val mBinderDeadListener = Shizuku.OnBinderDeadListener { Log.d(TAG, "Binder dead") + mHasBinder = false } private val mRequestPermissionResultListener: (requestCode: Int, grantResult: Int) -> Unit = { requestCode: Int, grantResult: Int -> @@ -114,12 +116,15 @@ object WrappedShizuku { false.also { e.printStackTrace() } } + @ScriptInterface + fun isRunning() = mHasBinder + @ScriptInterface fun requestPermission() = Shizuku.requestPermission(mRequestCode) @ScriptInterface @JvmOverloads - fun config(isRequest: Boolean? = null): Intent? { + fun config(context: Context = GlobalAppContext.get(), isRequest: Boolean? = null): Intent? { return getLaunchIntent()?.also { context.startActivity(it) val message = when (isRequest) { @@ -131,6 +136,9 @@ object WrappedShizuku { } } + @ScriptInterface + fun config(isRequest: Boolean) = config(GlobalAppContext.get(), isRequest) + @ScriptInterface fun execCommand(cmd: String): ShellResult { ensureService() @@ -139,7 +147,11 @@ object WrappedShizuku { } catch (e: Throwable) { ShellResult().apply { code = 1 - error = e.message ?: "" + error = e.message ?: when { + !hasPermission() -> "No permission to access Shizuku" + !isRunning() -> "Shizuku service may be not running" + else -> "" + } result = "" }.also { e.printStackTrace() } } @@ -151,7 +163,8 @@ object WrappedShizuku { } @ScriptInterface - fun ensureService() { + @JvmOverloads + fun ensureService(context: Context = GlobalAppContext.get()) { service ?: throw IllegalStateException(context.getString(R.string.error_unable_to_use_shizuku_service)) } @@ -163,7 +176,7 @@ object WrappedShizuku { } private fun getLaunchIntent(): Intent? { - return context.packageManager.getLaunchIntentForPackage(org.autojs.autojs.util.App.SHIZUKU.packageName)?.apply { + return GlobalAppContext.get().packageManager.getLaunchIntentForPackage(SHIZUKU.packageName)?.apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) } } diff --git a/app/src/main/java/org/autojs/autojs/ui/doc/DocumentationActivity.kt b/app/src/main/java/org/autojs/autojs/ui/doc/DocumentationActivity.kt index 7c986717b..41598455c 100644 --- a/app/src/main/java/org/autojs/autojs/ui/doc/DocumentationActivity.kt +++ b/app/src/main/java/org/autojs/autojs/ui/doc/DocumentationActivity.kt @@ -1,5 +1,6 @@ package org.autojs.autojs.ui.doc +import android.annotation.SuppressLint import android.os.Bundle import android.webkit.WebView import org.autojs.autojs.ui.BaseActivity @@ -28,6 +29,7 @@ class DocumentationActivity : BaseActivity() { } } + @SuppressLint("MissingSuperCall") @Suppress("OVERRIDE_DEPRECATION") override fun onBackPressed() { if (mWebView.canGoBack()) { diff --git a/app/src/main/java/org/autojs/autojs/ui/edit/EditActivity.kt b/app/src/main/java/org/autojs/autojs/ui/edit/EditActivity.kt index 3d5ef1ebf..f83e0751b 100644 --- a/app/src/main/java/org/autojs/autojs/ui/edit/EditActivity.kt +++ b/app/src/main/java/org/autojs/autojs/ui/edit/EditActivity.kt @@ -184,6 +184,7 @@ open class EditActivity : BaseActivity(), DelegateHost, PermissionRequestProxyAc return mMediator } + @Deprecated("Deprecated in Java") @SuppressLint("MissingSuperCall") override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { mMediator.onActivityResult(requestCode, resultCode, data) diff --git a/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.kt b/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.kt index c6ff26254..0cea6940b 100644 --- a/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.kt +++ b/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditText.kt @@ -207,7 +207,7 @@ class CodeEditText : AppCompatEditText { mMatchingBrackets[0], mMatchingBrackets[1] -> mTheme.getColorForToken(TokenMapping.TOKEN_MATCHED_BRACKET) else -> highlightTokens.colors[previousColorPos] } - var i = visibleCharStart + var i = previousColorPos while (i < visibleCharEnd) { val color = when (i) { mUnmatchedBracket -> mTheme.getColorForToken(Token.ERROR) diff --git a/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditor.kt b/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditor.kt index 3994c5a8b..6148fd41e 100644 --- a/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditor.kt +++ b/app/src/main/java/org/autojs/autojs/ui/edit/editor/CodeEditor.kt @@ -117,8 +117,10 @@ class CodeEditor : HVScrollView { private val selectionText: String get() { - val s = codeEditText.selectionStart - val e = codeEditText.selectionEnd + val sRaw = codeEditText.selectionStart + val eRaw = codeEditText.selectionEnd + val s = minOf(sRaw, eRaw) + val e = maxOf(sRaw, eRaw) return if (s == e) "" else codeEditText.text?.substring(s, e) ?: "" } @@ -181,7 +183,7 @@ class CodeEditor : HVScrollView { fun copyLine() { val layout = codeEditText.layout - val line = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) + val line = LayoutHelper.getLineOfChar(layout, minOf(codeEditText.selectionStart, codeEditText.selectionEnd)) if (line >= 0 && line < layout.lineCount) { val text = codeEditText.text var lineText: CharSequence? = null @@ -195,8 +197,10 @@ class CodeEditor : HVScrollView { private fun getCoveredLinesText(): CharSequence { val layout = codeEditText.layout - val lineStart = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) - val lineEnd = LayoutHelper.getLineOfChar(layout, codeEditText.selectionEnd) + val lineStartRaw = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) + val lineEndRaw = LayoutHelper.getLineOfChar(layout, codeEditText.selectionEnd) + val lineStart = minOf(lineStartRaw, lineEndRaw) + val lineEnd = maxOf(lineStartRaw, lineEndRaw) if (lineStart >= 0 && lineStart < layout.lineCount) { if (lineEnd >= 0 && lineEnd < layout.lineCount) { return text.subSequence(layout.getLineStart(lineStart), layout.getLineEnd(lineEnd)) @@ -208,8 +212,10 @@ class CodeEditor : HVScrollView { private fun replaceSelectedLines(feature: Regex, transform: (MatchResult) -> CharSequence) { val text = codeEditText.text ?: return val layout = codeEditText.layout - val lineStart = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) - val lineEnd = LayoutHelper.getLineOfChar(layout, codeEditText.selectionEnd) + val lineStartRaw = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) + val lineEndRaw = LayoutHelper.getLineOfChar(layout, codeEditText.selectionEnd) + val lineStart = minOf(lineStartRaw, lineEndRaw) + val lineEnd = maxOf(lineStartRaw, lineEndRaw) val newText = getCoveredLinesText().split("\n").joinToString("\n") { it.replace(feature, transform) } text.replace(layout.getLineStart(lineStart), layout.getLineEnd(lineEnd), newText) } @@ -217,7 +223,7 @@ class CodeEditor : HVScrollView { fun deleteLine() { val text = codeEditText.text ?: return val layout = codeEditText.layout - val line = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) + val line = LayoutHelper.getLineOfChar(layout, minOf(codeEditText.selectionStart, codeEditText.selectionEnd)) if (line >= 0 && line < layout.lineCount) { text.replace(layout.getLineStart(line), layout.getLineEnd(line), "") } @@ -236,7 +242,7 @@ class CodeEditor : HVScrollView { fun jumpToLineStart() { val layout = codeEditText.layout - val line = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) + val line = LayoutHelper.getLineOfChar(layout, minOf(codeEditText.selectionStart, codeEditText.selectionEnd)) if (line >= 0 && line < layout.lineCount) { codeEditText.setSelection(layout.getLineStart(line)) } @@ -244,7 +250,7 @@ class CodeEditor : HVScrollView { fun jumpToLineEnd() { val layout = codeEditText.layout - val line = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) + val line = LayoutHelper.getLineOfChar(layout, minOf(codeEditText.selectionStart, codeEditText.selectionEnd)) if (line >= 0 && line < layout.lineCount) { codeEditText.setSelection(layout.getLineEnd(line) - 1) } @@ -414,12 +420,16 @@ class CodeEditor : HVScrollView { } fun replaceSelection() { - codeEditText.text?.replace(codeEditText.selectionStart, codeEditText.selectionEnd, mReplacement) + val selectionStartRaw = codeEditText.selectionStart + val selectionEndRaw = codeEditText.selectionEnd + val selectionStart = minOf(selectionStartRaw, selectionEndRaw) + val selectionEnd = maxOf(selectionStartRaw, selectionEndRaw) + codeEditText.text?.replace(selectionStart, selectionEnd, mReplacement) } fun beautifyCode() { setProgress(true) - val pos = codeEditText.selectionStart + val pos = minOf(codeEditText.selectionStart, codeEditText.selectionEnd) mJsBeautifier.beautify(codeEditText.text.toString(), object : JsBeautifier.Callback { override fun onSuccess(beautifiedCode: String) { codeEditText.setText(beautifiedCode) @@ -439,7 +449,7 @@ class CodeEditor : HVScrollView { } fun insert(insertText: String?) { - val selection = codeEditText.selectionStart.coerceAtLeast(0) + val selection = minOf(codeEditText.selectionStart, codeEditText.selectionEnd).coerceAtLeast(0) codeEditText.text!!.insert(selection, insertText) } @@ -449,7 +459,7 @@ class CodeEditor : HVScrollView { } fun moveCursor(dCh: Int) { - codeEditText.setSelection(codeEditText.selectionStart + dCh) + codeEditText.setSelection(minOf(codeEditText.selectionStart, codeEditText.selectionEnd) + dCh) } fun markTextAsSaved() { @@ -472,7 +482,7 @@ class CodeEditor : HVScrollView { fun addOrRemoveBreakpointAtCurrentLine() { val layout = codeEditText.layout - val line = LayoutHelper.getLineOfChar(layout, codeEditText.selectionStart) + val line = LayoutHelper.getLineOfChar(layout, minOf(codeEditText.selectionStart, codeEditText.selectionEnd)) if (line >= 0 && line < layout.lineCount) { addOrRemoveBreakpoint(line) } diff --git a/app/src/main/java/org/autojs/autojs/ui/edit/editor/HVScrollView.java b/app/src/main/java/org/autojs/autojs/ui/edit/editor/HVScrollView.java index 4d21ee411..f0a69e730 100644 --- a/app/src/main/java/org/autojs/autojs/ui/edit/editor/HVScrollView.java +++ b/app/src/main/java/org/autojs/autojs/ui/edit/editor/HVScrollView.java @@ -318,8 +318,13 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { @Override public boolean dispatchKeyEvent(KeyEvent event) { - // Let the focused view and/or our descendants get the key first - return super.dispatchKeyEvent(event) || executeKeyEvent(event); + try { + // Let the focused view and/or our descendants get the key first + return super.dispatchKeyEvent(event) || executeKeyEvent(event); + } catch (Exception e) { + e.printStackTrace(); + return false; + } } /** @@ -395,15 +400,15 @@ private boolean inChild(int x, int y) { public boolean onInterceptTouchEvent(MotionEvent ev) { /* * This method JUST determines whether we want to intercept the motion. - * If we return true, onMotionEvent will be called and we do the actual - * scrolling there. - */ - - /* - * Shortcut the most recurring case: the user is in the dragging - * state and he is moving his finger. We want to intercept this - * motion. - */ + * If we return true, onMotionEvent will be called and we do the actual + * scrolling there. + */ + + /* + * Shortcut the most recurring case: the user is in the dragging + * state and he is moving his finger. We want to intercept this + * motion. + */ final int action = ev.getAction(); if ((action == MotionEvent.ACTION_MOVE) && (mIsBeingDragged)) { return true; @@ -471,10 +476,10 @@ public boolean onInterceptTouchEvent(MotionEvent ev) { case MotionEvent.ACTION_POINTER_UP -> onSecondaryPointerUp(ev); } - /* - * The only time we want to intercept motion events is if we are in the - * drag mode. - */ + /* + * The only time we want to intercept motion events is if we are in the + * drag mode. + */ return mIsBeingDragged; } @@ -502,10 +507,10 @@ public boolean onTouchEvent(MotionEvent ev) { return false; } - /* - * If being flinged and user touches, stop the fling. isFinished - * will be false if being flinged. - */ + /* + * If being flinged and user touches, stop the fling. isFinished + * will be false if being flinged. + */ if (!mScroller.isFinished()) { mScroller.abortAnimation(); } @@ -612,13 +617,13 @@ private View findFocusableViewInBoundsV(boolean topFocus, int top, int bottom) { List focusables = getFocusables(View.FOCUS_FORWARD); View focusCandidate = null; - /* - * A fully contained focusable is one where its top is below the bound's - * top, and its bottom is above the bound's bottom. A partially - * contained focusable is one where some part of it is within the - * bounds, but it also has some part that is not within bounds. A fully contained - * focusable is preferred to a partially contained focusable. - */ + /* + * A fully contained focusable is one where its top is below the bound's + * top, and its bottom is above the bound's bottom. A partially + * contained focusable is one where some part of it is within the + * bounds, but it also has some part that is not within bounds. A fully contained + * focusable is preferred to a partially contained focusable. + */ boolean foundFullyContainedFocusable = false; int count = focusables.size(); @@ -628,16 +633,16 @@ private View findFocusableViewInBoundsV(boolean topFocus, int top, int bottom) { int viewBottom = view.getBottom(); if (top < viewBottom && viewTop < bottom) { - /* - * the focusable is in the target area, it is a candidate for - * focusing - */ + /* + * the focusable is in the target area, it is a candidate for + * focusing + */ final boolean viewIsFullyContained = (top < viewTop) && (viewBottom < bottom); if (focusCandidate == null) { - /* No candidate, take this one */ + /* No candidate, take this one */ focusCandidate = view; foundFullyContainedFocusable = viewIsFullyContained; } else { @@ -648,23 +653,23 @@ private View findFocusableViewInBoundsV(boolean topFocus, int top, int bottom) { if (foundFullyContainedFocusable) { if (viewIsFullyContained && viewIsCloserToBoundary) { - /* - * We're dealing with only fully contained views, so - * it has to be closer to the boundary to beat our - * candidate - */ + /* + * We're dealing with only fully contained views, so + * it has to be closer to the boundary to beat our + * candidate + */ focusCandidate = view; } } else { if (viewIsFullyContained) { - /* Any fully contained view beats a partially contained view */ + /* Any fully contained view beats a partially contained view */ focusCandidate = view; foundFullyContainedFocusable = true; } else if (viewIsCloserToBoundary) { - /* - * Partially contained view beats another partially - * contained view if it's closer - */ + /* + * Partially contained view beats another partially + * contained view if it's closer + */ focusCandidate = view; } } @@ -680,13 +685,13 @@ private View findFocusableViewInBoundsH(boolean leftFocus, int left, int right) List focusables = getFocusables(View.FOCUS_FORWARD); View focusCandidate = null; - /* - * A fully contained focusable is one where its left is below the bound's - * left, and its right is above the bound's right. A partially - * contained focusable is one where some part of it is within the - * bounds, but it also has some part that is not within bounds. A fully contained - * focusable is preferred to a partially contained focusable. - */ + /* + * A fully contained focusable is one where its left is below the bound's + * left, and its right is above the bound's right. A partially + * contained focusable is one where some part of it is within the + * bounds, but it also has some part that is not within bounds. A fully contained + * focusable is preferred to a partially contained focusable. + */ boolean foundFullyContainedFocusable = false; int count = focusables.size(); @@ -696,16 +701,16 @@ private View findFocusableViewInBoundsH(boolean leftFocus, int left, int right) int viewRight = view.getRight(); if (left < viewRight && viewLeft < right) { - /* - * the focusable is in the target area, it is a candidate for - * focusing - */ + /* + * the focusable is in the target area, it is a candidate for + * focusing + */ final boolean viewIsFullyContained = (left < viewLeft) && (viewRight < right); if (focusCandidate == null) { - /* No candidate, take this one */ + /* No candidate, take this one */ focusCandidate = view; foundFullyContainedFocusable = viewIsFullyContained; } else { @@ -715,23 +720,23 @@ private View findFocusableViewInBoundsH(boolean leftFocus, int left, int right) if (foundFullyContainedFocusable) { if (viewIsFullyContained && viewIsCloserToBoundary) { - /* - * We're dealing with only fully contained views, so - * it has to be closer to the boundary to beat our - * candidate - */ + /* + * We're dealing with only fully contained views, so + * it has to be closer to the boundary to beat our + * candidate + */ focusCandidate = view; } } else { if (viewIsFullyContained) { - /* Any fully contained view beats a partially contained view */ + /* Any fully contained view beats a partially contained view */ focusCandidate = view; foundFullyContainedFocusable = true; } else if (viewIsCloserToBoundary) { - /* - * Partially contained view beats another partially - * contained view if it's closer - */ + /* + * Partially contained view beats another partially + * contained view if it's closer + */ focusCandidate = view; } } @@ -1180,7 +1185,7 @@ public void computeScroll() { private void scrollToChild(View child) { child.getDrawingRect(mTempRect); - /* Offset from child's local coordinates to ScrollView coordinates */ + /* Offset from child's local coordinates to ScrollView coordinates */ offsetDescendantRectToMyCoords(child, mTempRect); int scrollDeltaV = computeScrollDeltaToGetChildRectOnScreenV(mTempRect); @@ -1513,29 +1518,29 @@ public void scrollTo(int x, int y) { private int clamp(int n, int my, int child) { if (my >= child || n < 0) { - /* my >= child is this case: - * |--------------- me ---------------| - * |------ child ------| - * or - * |--------------- me ---------------| - * |------ child ------| - * or - * |--------------- me ---------------| - * |------ child ------| - * - * n < 0 is this case: - * |------ me ------| - * |-------- child --------| - * |-- mScrollX --| - */ + /* my >= child is this case: + * |--------------- me ---------------| + * |------ child ------| + * or + * |--------------- me ---------------| + * |------ child ------| + * or + * |--------------- me ---------------| + * |------ child ------| + * + * n < 0 is this case: + * |------ me ------| + * |-------- child --------| + * |-- mScrollX --| + */ return 0; } if ((my + n) > child) { - /* this case: - * |------ me ------| - * |------ child ------| - * |-- mScrollX --| - */ + /* this case: + * |------ me ------| + * |------ child ------| + * |-- mScrollX --| + */ return child - my; } return n; diff --git a/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyService.java b/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyService.java index 1cc82cb02..b7356dcb9 100644 --- a/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyService.java +++ b/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyService.java @@ -19,11 +19,19 @@ public class FloatyService extends Service { private static final CopyOnWriteArraySet windows = new CopyOnWriteArraySet<>(); + private static FloatyService instance; + + private WindowManager windowManager; + public Size initialSize; + public FloatyService() { + /* Empty constructor. */ + } + public static void addWindow(FloatyWindow window) { if (windows.add(window) && instance != null) { - window.onCreate(instance, instance.mWindowManager); + window.onCreate(instance, instance.windowManager); } } @@ -31,15 +39,12 @@ public static void removeWindow(FloatyWindow window) { windows.remove(window); } - private static FloatyService instance; - private WindowManager mWindowManager; - @Override public void onCreate() { super.onCreate(); - mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE); + windowManager = (WindowManager) getSystemService(WINDOW_SERVICE); for (FloatyWindow delegate : windows) { - delegate.onCreate(this, mWindowManager); + delegate.onCreate(this, windowManager); } instance = this; } diff --git a/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyWindow.java b/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyWindow.java index b8d5f7e6e..0b0990bd9 100644 --- a/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyWindow.java +++ b/app/src/main/java/org/autojs/autojs/ui/enhancedfloaty/FloatyWindow.java @@ -39,7 +39,7 @@ protected void onCreateWindow(FloatyService service, WindowManager manager) { onViewCreated(getWindowView()); //attach to window - attachToWindow(getWindowView(), getWindowManager()); + attachToWindow(getWindowView(), manager); } protected void onViewCreated(View view) { diff --git a/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/NodeInfoView.kt b/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/NodeInfoView.kt index 9c45df775..8df45a482 100644 --- a/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/NodeInfoView.kt +++ b/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/NodeInfoView.kt @@ -6,7 +6,6 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.CheckBox import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -152,7 +151,8 @@ class NodeInfoView : RecyclerView { "indexInParent", "childCount", "depth", // Regular - "checked", "enabled", "editable", "focusable", "selected", "dismissable", + "checked", "enabled", "editable", "focusable", + "selected", "dismissable", "visibleToUser", // Rare "contextClickable", "accessibilityFocused", diff --git a/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java b/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java index 93e18a9bc..b00617669 100644 --- a/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java +++ b/app/src/main/java/org/autojs/autojs/ui/project/BuildActivity.java @@ -27,6 +27,7 @@ import org.autojs.autojs.model.script.ScriptFile; import org.autojs.autojs.pref.Language; import org.autojs.autojs.project.ProjectConfig; +import org.autojs.autojs.runtime.ScriptRuntime; import org.autojs.autojs.ui.BaseActivity; import org.autojs.autojs.ui.filechooser.FileChooserDialogBuilder; import org.autojs.autojs.ui.shortcut.AppsIconSelectActivity; @@ -77,6 +78,7 @@ public class BuildActivity extends BaseActivity implements ApkBuilder.ProgressCa private MaterialDialog mProgressDialog; private String mSource; private boolean mIsDefaultIcon = true; + private boolean mIsProjectLevelBuilding; @SuppressLint("SetTextI18n") @Override @@ -214,6 +216,7 @@ private void setSource(File file) { if (mProjectConfig == null) { return; } + mIsProjectLevelBuilding = true; mOutputPath.setText(new File(mSource, mProjectConfig.getBuildDir()).getPath()); mAppConfig.setVisibility(View.GONE); mSourcePathContainer.setVisibility(View.GONE); @@ -242,16 +245,19 @@ void buildApk() { return; } if (!checkInputs()) { + ViewUtils.showToast(this, getString(R.string.error_input_fields_check_failed)); return; } doBuildingApk(); } private boolean checkInputs() { + if (mIsProjectLevelBuilding) { + return checkNotEmpty(mOutputPath); + } return checkNotEmpty(mSourcePath) & checkNotEmpty(mOutputPath) & checkNotEmpty(mAppName) - & checkNotEmpty(mSourcePath) & checkNotEmpty(mVersionCode) & checkNotEmpty(mVersionName) & checkPackageNameValid(mPackageName); @@ -269,7 +275,6 @@ private boolean checkPackageNameValid(EditText editText) { return false; } return true; - } private boolean checkNotEmpty(EditText editText) { @@ -344,6 +349,7 @@ private void onBuildFailed(Throwable error) { } String message = getString(R.string.text_failed_to_build) + "\n" + error.getMessage(); ViewUtils.showToast(this, message, true); + ScriptRuntime.popException(message); Log.e(LOG_TAG, "Failed to build", error); } @@ -357,7 +363,6 @@ private void onBuildSuccessful(File outApk) { .negativeText(R.string.text_cancel) .onPositive((dialog, which) -> IntentUtils.installApkOrToast(BuildActivity.this, outApk.getPath(), AppFileProvider.AUTHORITY)) .show(); - } @Override diff --git a/app/src/main/java/org/autojs/autojs/ui/project/ProjectConfigActivity.kt b/app/src/main/java/org/autojs/autojs/ui/project/ProjectConfigActivity.kt index 5d735d513..99cdffc8a 100644 --- a/app/src/main/java/org/autojs/autojs/ui/project/ProjectConfigActivity.kt +++ b/app/src/main/java/org/autojs/autojs/ui/project/ProjectConfigActivity.kt @@ -214,6 +214,7 @@ class ProjectConfigActivity : BaseActivity() { return false } + @Deprecated("Deprecated in Java") @SuppressLint("CheckResult", "MissingSuperCall") override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { if (resultCode != RESULT_OK) { diff --git a/app/src/main/java/org/autojs/autojs/ui/timing/TimedTaskSettingActivity.kt b/app/src/main/java/org/autojs/autojs/ui/timing/TimedTaskSettingActivity.kt index 3eaf80111..2bb0c8cbb 100644 --- a/app/src/main/java/org/autojs/autojs/ui/timing/TimedTaskSettingActivity.kt +++ b/app/src/main/java/org/autojs/autojs/ui/timing/TimedTaskSettingActivity.kt @@ -311,7 +311,6 @@ class TimedTaskSettingActivity : BaseActivity() { Log.d(LOG_TAG, "result code = $requestCode") createOrUpdateTask() } - @Suppress("DEPRECATION") super.onActivityResult(requestCode, resultCode, data) } diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 7b615c2d8..00d399f56 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -709,6 +709,7 @@ فشل في إلغاء وصول Shizuku فشل منح Shizuku حق الوصول غير قادر على استخدام خدمة Shizuku + فشل فحص حقول الإدخال المجموع: عنصر واحد diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 871275459..fa231918d 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -707,6 +707,7 @@ Failed to revoke Shizuku access Failed to grant Shizuku access Unable to use Shizuku service + Input fields check failed Total: %d item diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 8cb2167b2..0792d1235 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -709,6 +709,7 @@ Fallo en la revocación de permisos Shizuku Fallo en la concesión de permisos Shizuku No se puede utilizar el servicio Shizuku + Error en la comprobación del campo de entrada Total: %d artículo diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 7ec6f03f4..ae59240d3 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -709,6 +709,7 @@ La révocation des droits de Shizuku a échoué Échec de l\'octroi de la permission de Shizuku Impossible d\'utiliser le service Shizuku + Échec de la vérification du champ de saisie Total: %d article diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 8e83f339a..980d323cc 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -709,6 +709,7 @@ Shizuku 権限の取り消しに失敗しました Shizuku の権限付与に失敗しました Shizuku サービスが使用できない + 入力フィールドのチェックに失敗 合計: %d 件 diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 2c41073f3..f8345e7e9 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -710,6 +710,7 @@ Shizuku 권한 해지에 실패했습니다 Shizuku 권한을 부여하지 못했습니다 Shizuku 서비스를 사용할 수 없음 + 입력 필드 확인 실패 총: %d 개 항목 diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 0d66c0824..3d2c9073a 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -709,6 +709,7 @@ Не удалось отозвать права на Shizuku Не удалось предоставить права на использование Shizuku Невозможно использовать службу Shizuku + Не удалось выполнить проверку поля ввода Всего: %d элемент diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index b2c1ba214..72d3ab09d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -709,6 +709,7 @@ Shizuku 權限撤銷失敗 Shizuku 權限授予失敗 無法使用 Shizuku 服務 + 輸入字段檢查未通過 共計: %d 項 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index ad565b08b..60ae66b5d 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -709,6 +709,7 @@ Shizuku 許可權撤銷失敗 Shizuku 許可權授予失敗 無法使用 Shizuku 服務 + 輸入欄位檢查未透過 共計: %d 項 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index dfaa37fe2..0aec5cfed 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -705,6 +705,7 @@ Shizuku 权限撤销失败 Shizuku 权限授予失败 无法使用 Shizuku 服务 + 输入字段检查未通过 共计: %d 项 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d3f9ec974..6eeb3c9de 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -919,6 +919,7 @@ Failed to revoke Shizuku access Failed to grant Shizuku access Unable to use Shizuku service + Input fields check failed Total: %d item diff --git a/app/src/main/res/xml-v25/app_shortcuts.xml b/app/src/main/res/xml-v25/app_shortcuts.xml index 3d2fb796c..fc0c634cd 100644 --- a/app/src/main/res/xml-v25/app_shortcuts.xml +++ b/app/src/main/res/xml-v25/app_shortcuts.xml @@ -1,8 +1,14 @@ - - + - + - + - + "" + else -> s[0].uppercase() + s.substring(1) + } - val unknownIdentifier = "unknown" val unknownIdentifier1Up = uppercaseFirstChar(unknownIdentifier) + val unexpectedIdentifier = "unexpected" + val unexpectedIdentifier1Up = uppercaseFirstChar(unexpectedIdentifier) val predictedIdentifier = "predicted" val unfocusedIdentifier = "unfocused" val unfocusedSuffix = " [$unfocusedIdentifier]" val predictedSuffix = " [$predictedIdentifier]" val fallbackSuffix = " [$fallbackIdentifier]" - /* Nullable. */ - val platform = System.getProperty("idea.paths.selector") ?: System.getProperty("idea.platform.prefix") ?: unknownIdentifier - - val isPlatformAS = platform?.startsWith(platformIdentifierForAS) == true - || System.getProperty("idea.vendor.name").equals(vendorNameForAS, true) - val isPlatformIdea = platform?.startsWith(platformIdentifierForIdea) == true - || System.getProperty("idea.vendor.name").equals(vendorNameForIdea, true) + // @TestCases + // ! Android Studio: AndroidStudio2023.1 (from idea.paths.selector); AndroidStudio (from idea.platform.prefix) + // ! Android Studio Preview: AndroidStudioPreview2023.2 (from idea.paths.selector); AndroidStudio (from idea.platform.prefix) + // ! IntelliJ Idea: IntelliJIdea2023.2 (from idea.paths.selector); JBR-17.0.8.1+7-1000.32-jcef (from java.vendor.version) + // ! IntelliJ Idea Preview: null + // ! Temurin: Temurin-20.0.2+9 (from java.vendor.version) + // ! Others: null + val platform: String? = System.getProperty("idea.paths.selector") + ?: System.getProperty("idea.platform.prefix") + ?: System.getProperty("java.vendor.version") + + // @TestCases + // ! Android Studio: Google (from idea.vendor.name) + // ! Android Studio Preview: Google (from idea.vendor.name) + // ! IntelliJ Idea: JetBrains (from idea.vendor.name) + // ! IntelliJ Idea Preview: JetBrains (from idea.vendor.name) + // ! Temurin: Eclipse Adoptium (from java.vendor); Eclipse Adoptium (from java.vm.vendor) + // ! Others: null + val vendorName: String? = System.getProperty("idea.vendor.name") + ?: System.getProperty("java.vendor") + ?: System.getProperty("java.vm.vendor") + + // @TestCases + // ! Android Studio: 2023.1 + // ! Android Studio Preview: 2023.1 + // ! IntelliJ Idea: 2023.2.4 + // ! IntelliJ Idea Preview: 2023.3 + // ! Temurin: null + // ! Others: null + val versionFromProperty: String? = System.getProperty("idea.version") + + val isPlatformAS = platform?.startsWith(platformIdentifierForAS) ?: false + || vendorName?.contains(vendorNameForAS, true) ?: false + val isPlatformIdea = platform?.startsWith(platformIdentifierForIdea) ?: false + || vendorName?.contains(vendorNameForIdea, true) ?: false + val isPlatformTemurin = platform?.startsWith(platformIdentifierForTemurin) ?: false + || vendorName?.contains(vendorNameForTemurin, true) ?: false val platformType = when { isPlatformAS -> "as" isPlatformIdea -> "idea" - else -> unknownIdentifier + isPlatformTemurin -> "temurin" + else -> unknownIdentifier.also { + when (platform) { + null -> { + val concernedKeyWords = arrayOf("name", "vendor", "version", "platform", "paths") + val unconcernedKeyWords = arrayOf("url", "user", "runtime", "specification", "os", "date") + val unconcernedKeys = arrayOf( + "java.class.version", + "java.vm.name", + "java.vm.version", + "java.version", + ) + var concernedValues = emptyArray() + System.getProperties().forEach { entry -> + val (key) = entry + when { + key !is String -> return@forEach + unconcernedKeys.any { s -> key.equals(s, true) } -> return@forEach + unconcernedKeyWords.any { s -> key.split(Regex("\\W")).contains(s) } -> return@forEach + !concernedKeyWords.any { s -> key.split(Regex("\\W")).contains(s) } -> return@forEach + else -> concernedValues += "[ $key: ${entry.value} ]" + } + } + val title = "Current platform is $unknownIdentifier" + val subtitle = "However, here are some props may be useful for determining platform info" + val maxLength = concernedValues.plus(title).plus(subtitle).maxOf { it.length } + + when { + concernedValues.isNotEmpty() -> arrayOf( + "=".repeat(maxLength), + title, + subtitle, + "-".repeat(maxLength), + *concernedValues, + "=".repeat(maxLength), + "", + ) + else -> arrayOf( + "=".repeat(maxLength), + title, + "=".repeat(maxLength), + "", + ) + }.forEach { println(it) } + } + else -> println("$unexpectedIdentifier1Up platform: $platform") + } + } } val previewIdentifier = when { - isPlatformAS -> "preview" isPlatformIdea -> "eap" - else -> "" + else -> "preview" } - val previewIdentifier1Up = previewIdentifier ?: uppercaseFirstChar(previewIdentifier) - - val platformVersion = (System.getProperty("idea.version") ?: when { - isPlatformAS -> platform?.substring(platformIdentifierForAS.length) - isPlatformIdea -> platform?.substring(platformIdentifierForIdea.length) - else -> unknownIdentifier - } ?: throw Exception("$unknownIdentifier1Up platform version")) - .let { rawVersion -> - platform?.let { rawVersion } - ?: when (rawVersion.contains(previewIdentifier, true)) { - true -> rawVersion - else -> "$previewIdentifier1Up$rawVersion" - } + val previewIdentifier1Up = uppercaseFirstChar(previewIdentifier) + + val platformVersion = when (versionFromProperty != null) { + true -> when (platform != null) { + true -> when (platform.contains(previewIdentifier, true)) { + true -> "$previewIdentifier1Up$versionFromProperty" + else -> versionFromProperty + } + else -> when (isPlatformIdea) { + true -> "$previewIdentifier1Up$versionFromProperty" + else -> versionFromProperty + } } + else -> when (platform != null) { + true -> when { + isPlatformAS -> platform.substring(platformIdentifierForAS.length) + isPlatformIdea -> platform.substring(platformIdentifierForIdea.length) + isPlatformTemurin -> platform.substring(platformIdentifierForTemurin.length) + else -> defaultVersion + } + else -> defaultVersion + }.replace(Regex("^\\W*"), "") + } val platformVersionUnfocused = platformVersion.replace(Regex("(.+)(\\.\\d+)(\\.\\d+$)"), "$1$2") @@ -224,6 +327,10 @@ pluginManagement { } dependencies /* Gather platform information. */ { + val isPreview = platformVersion.contains(previewIdentifier1Up, true) + val previewSuffix = if (isPreview) " ($previewIdentifier)" else "" + val niceVersion = if (isPreview) platformVersion.substring(previewIdentifier1Up.length) else platformVersion + val versionSuffix = if (niceVersion.isNotEmpty() && niceVersion != defaultVersion) " | $niceVersion" else "" when { isPlatformAS -> { var isPredicted = false @@ -238,17 +345,11 @@ pluginManagement { } } } ?: "" - - val isPreview = platformVersion.contains(previewIdentifier1Up, true) - val previewSuffix = if (isPreview) " ($previewIdentifier)" else "" - val niceVersion = if (isPreview) platformVersion.substring(previewIdentifier1Up.length) else platformVersion - - "Android Studio$platformCodeName$previewSuffix${if (niceVersion.isNotEmpty()) " | $niceVersion" else ""}" + "Android Studio$platformCodeName$previewSuffix$versionSuffix" } isPlatformIdea -> { - val isEap = platformVersion.contains(previewIdentifier1Up, true) val isPredicted = platform == null - val suffix = when (isEap) { + val previewSuffixOverride = when (isPreview) { true -> when (isPredicted) { true -> " [ ${previewIdentifier.uppercase()} ($predictedIdentifier) ]" else -> " ${previewIdentifier.uppercase()}" @@ -258,9 +359,10 @@ pluginManagement { else -> "" } } - val niceVersion = if (isEap) platformVersion.substring(previewIdentifier1Up.length) else platformVersion - - "IntelliJ IDEA$suffix${if (niceVersion.isNotEmpty()) " | $niceVersion" else ""}" + "IntelliJ IDEA$previewSuffixOverride$versionSuffix" + } + isPlatformTemurin -> { + "Temurin$previewSuffix$versionSuffix" } else -> unknownIdentifier1Up }.let { infoList += "Platform: $it" } diff --git a/version.properties b/version.properties index fcd7eaaec..40d9b9b83 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ -#Mon Oct 30 17:13:29 CST 2023 -BUILD_TIME=1698657209970 +#Thu Nov 02 10:32:53 CST 2023 +BUILD_TIME=1698892373807 CMAKE_VERSION=3.10.2 COMPILE_SDK_VERSION=34 JAVA_VERSION=22 @@ -11,6 +11,6 @@ NDK_VERSION=21.1.6352462 OPENCV_VERSION=4.8.0 TARGET_SDK_VERSION=34 TARGET_SDK_VERSION_INRT=29 -VERSION_BUILD=2148 -VERSION_NAME=6.4.0 -VSCODE_EXT_REQUIRED_VERSION=1.0.7 +VERSION_BUILD=2158 +VERSION_NAME=6.4.1 +VSCODE_EXT_REQUIRED_VERSION=1.0.8