From 5572f2cb6081ec71366b3bcdd8412b31c45ddfab Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 19 May 2026 18:04:33 +0400 Subject: [PATCH] v2.0.1: APK verification, stay awake fix, configurable auto-fix retries --- README.md | 5 ++ android/app/build.gradle | 4 +- .../src/main/java/ai/z/chat/WakePlugin.java | 34 ++++++++--- package-lock.json | 4 +- package.json | 2 +- www/index.html | 16 +++++- www/js/app.js | 56 +++++++++++++------ 7 files changed, 88 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 4db4bef..3dbfd2f 100644 --- a/README.md +++ b/README.md @@ -631,6 +631,11 @@ data: [DONE] ## Changelog +### v2.0.1 (2026-05-19) +- **APK Build Verification** — confirms APK file exists after build, shows file size +- **Stay Awake Fix** — dual wake locks (screen bright + CPU partial) with 24h timeout keep device fully awake +- **Configurable Auto-Fix Retries** — max retries adjustable from 1–30 in Settings (default 10, was hardcoded 3) + ### v2.0.0 (2026-05-19) - **Built-in Termux** — full Linux environment inside the app, no external Termux install needed - One-time ~30MB download of Termux bootstrap (bash, coreutils, apt, 25+ packages) diff --git a/android/app/build.gradle b/android/app/build.gradle index 3339d3b..30e385f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "ai.z.chat" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 10 - versionName "2.0.0" + versionCode 11 + versionName "2.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' diff --git a/android/app/src/main/java/ai/z/chat/WakePlugin.java b/android/app/src/main/java/ai/z/chat/WakePlugin.java index 0a26bde..9aacbd8 100644 --- a/android/app/src/main/java/ai/z/chat/WakePlugin.java +++ b/android/app/src/main/java/ai/z/chat/WakePlugin.java @@ -12,7 +12,8 @@ import com.getcapacitor.annotation.CapacitorPlugin; @CapacitorPlugin(name = "Wake") public class WakePlugin extends Plugin { - private PowerManager.WakeLock wakeLock; + private PowerManager.WakeLock screenWakeLock; + private PowerManager.WakeLock cpuWakeLock; private boolean isHeld = false; @Override @@ -22,7 +23,7 @@ public class WakePlugin extends Plugin { @PluginMethod public void acquire(PluginCall call) { - if (isHeld && wakeLock != null) { + if (isHeld) { call.resolve(new JSObject().put("held", true)); return; } @@ -33,10 +34,20 @@ public class WakePlugin extends Plugin { }); PowerManager pm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); - wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "zai-chat:wakelock"); - wakeLock.acquire(12 * 60 * 60 * 1000L); - isHeld = true; + screenWakeLock = pm.newWakeLock( + PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, + "zai-chat:screen" + ); + screenWakeLock.acquire(24 * 60 * 60 * 1000L); + + cpuWakeLock = pm.newWakeLock( + PowerManager.PARTIAL_WAKE_LOCK, + "zai-chat:cpu" + ); + cpuWakeLock.acquire(24 * 60 * 60 * 1000L); + + isHeld = true; call.resolve(new JSObject().put("held", true)); } catch (Exception e) { call.reject("Wake lock failed: " + e.getMessage()); @@ -50,12 +61,17 @@ public class WakePlugin extends Plugin { getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); }); - if (wakeLock != null && wakeLock.isHeld()) { - wakeLock.release(); + if (screenWakeLock != null && screenWakeLock.isHeld()) { + screenWakeLock.release(); } - wakeLock = null; - isHeld = false; + screenWakeLock = null; + if (cpuWakeLock != null && cpuWakeLock.isHeld()) { + cpuWakeLock.release(); + } + cpuWakeLock = null; + + isHeld = false; call.resolve(new JSObject().put("held", false)); } catch (Exception e) { call.reject("Wake release failed: " + e.getMessage()); diff --git a/package-lock.json b/package-lock.json index b1c8300..7e14a5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "zai-chat", - "version": "1.3.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "zai-chat", - "version": "1.3.0", + "version": "2.0.1", "license": "MIT", "dependencies": { "@capacitor/android": "^8.3.4", diff --git a/package.json b/package.json index 5140706..1cb9b21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zai-chat", - "version": "2.0.0", + "version": "2.0.1", "description": "Z.AI Chat - Full stack AI chat powered by GLM Coding Plan", "main": "index.js", "scripts": { diff --git a/www/index.html b/www/index.html index e0f5e30..11e01dd 100644 --- a/www/index.html +++ b/www/index.html @@ -256,6 +256,11 @@ Prevents screen sleep while agent is working +
+ + +
+ How many times AI will auto-retry after build failures

Appearance

@@ -274,13 +279,22 @@

About

-

Z.AI Chat v2.0.0

+

Z.AI Chat v2.0.1

Built with Z.AI SDK & GLM-5.1

Compatible with Android 15/16

Changelog