6.6.3 - Alpha - 修复无障碍服务关闭时音量加键停止所有脚本功能失效的问题
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$data": {
|
"$data": {
|
||||||
"v6.6.3": {
|
"v6.6.3": {
|
||||||
"released_date": "2025/04/26",
|
"released_date": "2025/04/29",
|
||||||
"feature": [
|
"feature": [
|
||||||
"timers.keepAlive 方法 (已全局化), 用于保持脚本活跃状态",
|
"timers.keepAlive 方法 (已全局化), 用于保持脚本活跃状态",
|
||||||
"engines.on('start/stop/error', callback) 等事件监听方法, 用于监听脚本引擎全局事件"
|
"engines.on('start/stop/error', callback) 等事件监听方法, 用于监听脚本引擎全局事件"
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
"主页文档标签显示在线文档时部分内容被系统导航栏遮挡的问题",
|
"主页文档标签显示在线文档时部分内容被系统导航栏遮挡的问题",
|
||||||
"部分设备代码编辑器空行显示方框字符的问题",
|
"部分设备代码编辑器空行显示方框字符的问题",
|
||||||
"主题色设置页面调色盘对话框可能无限叠加的问题",
|
"主题色设置页面调色盘对话框可能无限叠加的问题",
|
||||||
|
"无障碍服务关闭时音量加键停止所有脚本功能失效的问题",
|
||||||
"APK 文件类型信息对话框可能无法获取应用名称及 SDK 信息的问题",
|
"APK 文件类型信息对话框可能无法获取应用名称及 SDK 信息的问题",
|
||||||
"dialogs 模块无法正常使用 customView 属性的问题 _[`issue #364`](http://issues.autojs6.com/364)_",
|
"dialogs 模块无法正常使用 customView 属性的问题 _[`issue #364`](http://issues.autojs6.com/364)_",
|
||||||
"console.setContentTextColor 方法导致日志字体颜色丢失默认值的问题 _[`issue #346`](http://issues.autojs6.com/346)_",
|
"console.setContentTextColor 方法导致日志字体颜色丢失默认值的问题 _[`issue #346`](http://issues.autojs6.com/346)_",
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package org.autojs.autojs.event;
|
package org.autojs.autojs.event;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import org.autojs.autojs.AutoJs;
|
import org.autojs.autojs.AutoJs;
|
||||||
import org.autojs.autojs.core.accessibility.AccessibilityService;
|
import org.autojs.autojs.core.accessibility.AccessibilityService;
|
||||||
import org.autojs.autojs.core.accessibility.OnKeyListener;
|
import org.autojs.autojs.core.accessibility.OnKeyListener;
|
||||||
|
import org.autojs.autojs.core.inputevent.InputEventObserver;
|
||||||
import org.autojs.autojs.core.inputevent.ShellKeyObserver;
|
import org.autojs.autojs.core.inputevent.ShellKeyObserver;
|
||||||
import org.autojs.autojs.core.pref.Pref;
|
import org.autojs.autojs.core.pref.Pref;
|
||||||
|
|
||||||
@@ -24,30 +26,30 @@ public class GlobalKeyObserver implements OnKeyListener, ShellKeyObserver.KeyLis
|
|||||||
private boolean mVolumeDownFromShell, mVolumeDownFromAccessibility;
|
private boolean mVolumeDownFromShell, mVolumeDownFromAccessibility;
|
||||||
private boolean mVolumeUpFromShell, mVolumeUpFromAccessibility;
|
private boolean mVolumeUpFromShell, mVolumeUpFromAccessibility;
|
||||||
|
|
||||||
private GlobalKeyObserver() {
|
private GlobalKeyObserver(Context applicationContext) {
|
||||||
mVolumeDownEventDispatcher = new EventDispatcher<>();
|
mVolumeDownEventDispatcher = new EventDispatcher<>();
|
||||||
AccessibilityService.Companion.getStickOnKeyObserver().addListener(this);
|
AccessibilityService.Companion.getStickOnKeyObserver().addListener(this);
|
||||||
// ShellKeyObserver observer = new ShellKeyObserver();
|
ShellKeyObserver observer = new ShellKeyObserver();
|
||||||
// observer.setKeyListener(this);
|
observer.setKeyListener(this);
|
||||||
// InputEventObserver.getGlobal(GlobalAppContext.get()).addListener(observer);
|
InputEventObserver.getGlobal(applicationContext).addListener(observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initIfNeeded() {
|
public static void initIfNeeded(Context applicationContext) {
|
||||||
if (Pref.isUseVolumeControlRunningEnabled()) makeSureSingletonInitialized();
|
if (Pref.isUseVolumeControlRunningEnabled()) makeSureSingletonInitialized(applicationContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init() {
|
public static void init(Context applicationContext) {
|
||||||
makeSureSingletonInitialized();
|
makeSureSingletonInitialized(applicationContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GlobalKeyObserver getSingleton() {
|
public static GlobalKeyObserver getSingleton(Context applicationContext) {
|
||||||
makeSureSingletonInitialized();
|
makeSureSingletonInitialized(applicationContext);
|
||||||
return sSingleton;
|
return sSingleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void makeSureSingletonInitialized() {
|
private static void makeSureSingletonInitialized(Context applicationContext) {
|
||||||
if (sSingleton == null) {
|
if (sSingleton == null) {
|
||||||
sSingleton = new GlobalKeyObserver();
|
sSingleton = new GlobalKeyObserver(applicationContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#Sat Apr 26 11:16:55 CST 2025
|
#Tue Apr 29 18:56:52 CST 2025
|
||||||
BUILD_TIME=1745637415532
|
BUILD_TIME=1745924212962
|
||||||
COMPILE_SDK_VERSION=35
|
COMPILE_SDK_VERSION=35
|
||||||
JAVA_VERSION=23
|
JAVA_VERSION=23
|
||||||
JAVA_VERSION_MIN_RADICAL=0
|
JAVA_VERSION_MIN_RADICAL=0
|
||||||
@@ -17,6 +17,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13
|
|||||||
RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3
|
RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3
|
||||||
TARGET_SDK_VERSION=35
|
TARGET_SDK_VERSION=35
|
||||||
TARGET_SDK_VERSION_INRT=29
|
TARGET_SDK_VERSION_INRT=29
|
||||||
VERSION_BUILD=3167
|
VERSION_BUILD=3173
|
||||||
VERSION_NAME=6.6.3 Alpha
|
VERSION_NAME=6.6.3 Alpha
|
||||||
VSCODE_EXT_REQUIRED_VERSION=1.0.8
|
VSCODE_EXT_REQUIRED_VERSION=1.0.8
|
||||||
|
|||||||
Reference in New Issue
Block a user