From 4c7ba32646074151f717dab56d82a63aa2d48447 Mon Sep 17 00:00:00 2001 From: SuperMonster003 Date: Sun, 18 May 2025 20:23:16 +0800 Subject: [PATCH] =?UTF-8?q?6.6.3=20-=20Alpha5=20-=20=E4=BF=AE=E5=A4=8D=20G?= =?UTF-8?q?radle=20=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=9B=A0=E8=8E=B7=E5=8F=96=E5=88=B0=E6=97=A0=E6=95=88=E5=BA=93?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=96=87=E4=BB=B6=E9=95=BF=E5=BA=A6=E8=80=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=9E=84=E5=BB=BA=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(issue=20#389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changelog/lang_zh-Hans.json | 3 ++- libs/utils.build.gradle | 35 ++++++++++++++++++++++++++--------- settings.gradle.kts | 4 ++-- version.properties | 6 +++--- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.changelog/lang_zh-Hans.json b/.changelog/lang_zh-Hans.json index cd4cad9c..2e2ff768 100644 --- a/.changelog/lang_zh-Hans.json +++ b/.changelog/lang_zh-Hans.json @@ -21,7 +21,8 @@ "使用 JavaAdapter 时导致 ClassLoader 调用栈溢出的问题 _[`issue #376`](http://issues.autojs6.com/376)_", "console.setContentTextColor 方法导致日志字体颜色丢失默认值的问题 _[`issue #346`](http://issues.autojs6.com/346)_", "console.setContentBackgroundColor 方法无法接受颜色名称参数的问题 _[`issue #384`](http://issues.autojs6.com/384)_", - "README.md 中部分语言日期格式不正确的问题" + "README.md 中部分语言日期格式不正确的问题", + "Gradle 构建脚本可能因获取到无效库档案文件长度而导致构建失败的问题 _[`issue #389`](http://issues.autojs6.com/389)_" ], "improvement": [ "布局分析支持控件隐藏 (by [TonyJiangWJ](https://github.com/TonyJiangWJ)) _[`pr #371`](http://pr.autojs6.com/371)_ _[`issue #355`](http://issues.autojs6.com/355)_", diff --git a/libs/utils.build.gradle b/libs/utils.build.gradle index 345e2dac..6630d681 100644 --- a/libs/utils.build.gradle +++ b/libs/utils.build.gradle @@ -393,6 +393,7 @@ class Utils { final int MAX_RETRIES = 3 int attempt = 0 boolean success = false + boolean shouldPrintProgress = project.ext["platform"]["shouldPrintProgress"] == true while (attempt < MAX_RETRIES && !success) { try { @@ -411,22 +412,34 @@ class Utils { long downloadedSize = 0 int bytesRead + if (shouldPrintProgress && fileSize <= 0) { + println "\rDownloading..." + } + while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead) downloadedSize += bytesRead - if (project.ext["platform"]["shouldPrintProgress"] == true) { - double progress = (downloadedSize * 100.0 / fileSize) - String progressBar = generateProgressBar(progress) - print String.format("\rDownloading... [ %s ] %.2f%%", progressBar, progress) - System.out.flush() + if (shouldPrintProgress && fileSize > 0) { + try { + double progress = (downloadedSize * 100.0 / fileSize) + String progressBar = generateProgressBar(progress) + print String.format("\rDownloading... [ %s ] %.2f%%", progressBar, progress) + System.out.flush() + } catch (Exception ignored) { + /* Ignored. */ + } } } } } String downloadPath = cacheFile.absolutePath - String formattedFileSize = formatFileSize(fileSize) - print String.format("\rDownload complete [ %s | %s ]\n", downloadPath, formattedFileSize) + if (fileSize > 0) { + String formattedFileSize = formatFileSize(fileSize) + print String.format("\rDownload complete [ %s | %s ]\n", downloadPath, formattedFileSize) + } else { + print String.format("\rDownload complete [ %s ]\n", downloadPath) + } System.out.flush() println() @@ -445,6 +458,8 @@ class Utils { } private void handleZip() { + def shouldPrintProgress = project.ext["platform"]["shouldPrintProgress"] == true + def zipFileForTotalSize = new ZipFile(cacheFile) def zipEntriesForTotalSize = zipFileForTotalSize.entries() def entries = [] @@ -490,7 +505,7 @@ class Utils { } } - if (project.ext["platform"]["shouldPrintProgress"] == true) { + if (shouldPrintProgress) { double progress = (processedEntries * 100.0 / totalEntries) String progressBar = generateProgressBar(progress) print String.format("\rExtracting... [ %s ] %.2f%%", progressBar, progress) @@ -515,6 +530,8 @@ class Utils { } private void handleSevenZip() { + def shouldPrintProgress = project.ext["platform"]["shouldPrintProgress"] == true + def sevenZFileForTotalSize = new SevenZFile.Builder().setFile(cacheFile).get() def entry def entries = [] @@ -557,7 +574,7 @@ class Utils { } } - if (project.ext["platform"]["shouldPrintProgress"] == true) { + if (shouldPrintProgress) { double progress = (processedEntries * 100.0 / totalEntries) String progressBar = generateProgressBar(progress) print String.format("\rExtracting... [ %s ] %.2f%%", progressBar, progress) diff --git a/settings.gradle.kts b/settings.gradle.kts index 32e968e7..6c779eb7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -204,8 +204,8 @@ pluginManagement { /* Print concerned info by `System.getProperties()`. */ val isShowConcernedSystemProperties = true - val isCleanupPaddleOcr = false - val isCleanupRapidOcr = false + val isCleanupPaddleOcr = true + val isCleanupRapidOcr = true val fallbackAgpVersion = "7.4.2" val fallbackKotlinVersion = "1.7.10" diff --git a/version.properties b/version.properties index 93eb8cba..6a3098b1 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ -#Sun May 18 11:47:57 CST 2025 -BUILD_TIME=1747540077602 +#Sun May 18 20:20:48 CST 2025 +BUILD_TIME=1747570848298 COMPILE_SDK_VERSION=35 IMAGE_QUANT_CMAKE_VERSION=3.22.1 IMAGE_QUANT_NDK_VERSION=26.1.10909125 @@ -19,6 +19,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13 RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3 TARGET_SDK_VERSION=35 TARGET_SDK_VERSION_INRT=29 -VERSION_BUILD=3233 +VERSION_BUILD=3234 VERSION_NAME=6.6.3 Alpha5 VSCODE_EXT_REQUIRED_VERSION=1.0.8