Skip to content

Commit 1d9dc2c

Browse files
committed
2 parents 5d374cd + 6da241f commit 1d9dc2c

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

src/common/version.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,9 @@ export const versionList = [{
13041304
}, {
13051305
version: '20240118_01',
13061306
desc: '因功能0结束判断的参数“结束当前方案后切换方案”变更为“结束后的操作”,如果有存在方案在功能0中设置过切换方案,需手动重新设置下该功能的新参数“结束后的操作”值为“切换方案”'
1307+
}, {
1308+
version: '20250122_01',
1309+
desc: '因透明悬浮的穿透因未知情况失效,恢复设置项“允许不受信任触摸的事件穿透”',
13071310
}];
13081311

13091312
export default versionList[versionList.length - 1].version;

src/system/FloatButton/FloatButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ global.FloatButton = function () {
264264
mWindows.logo = floaty.rawWindow("<frame id='content' w='auto' h='auto' />");
265265
//修复 更新悬浮窗LayoutParams 报错
266266
ui.run(() => {
267-
mWindows.menu.content.getRootView().getLayoutParams().alpha = 0.8; // alpha设置0.8,在安卓12以上实现悬浮窗穿透
268-
// mWindows.logo.content.getRootView().getLayoutParams().alpha = 0.8; // alpha设置0.8,在安卓12以上实现悬浮窗穿透
267+
mWindows.menu.content.getRootView().getLayoutParams().alpha = 0.8; // alpha设置0.8,在安卓12以上实现悬浮窗穿透(好像失效了)
268+
mWindows.logo.content.getRootView().getLayoutParams().alpha = 0.8; // alpha设置0.8,在安卓12以上实现悬浮窗穿透(好像失效了)
269269
mWindows.logo.setSize(-2, -2);
270270
mWindows.menu.setSize(-2, -2);
271271
mWindows.logo.setTouchable(false);

src/system/webviewEvents/settings.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import helperBridge from '@/system/helperBridge';
99
import { mlkitOcr } from '@/system/Ocr/MlkitOcr';
1010
import { mlkitOcr2 } from '@/system/Ocr/MlkitOcr2';
1111
import { yunxiOcr } from '@/system/Ocr/YunxiOcr';
12-
// import { myShell } from '@/system/MyAutomator';
12+
import { myShell } from '@/system/MyAutomator';
1313
import pushClients from '@/system/PushClient/index';
1414
import { AbstractPushClient } from '../PushClient/AbstractPushClient';
1515

@@ -151,19 +151,19 @@ export default function webviewSettigns() {
151151
});
152152
}
153153

154-
// if (device.sdkInt >= 31 && isRoot) { // 安卓12,有root
155-
// // 不受信任触摸事件
156-
// const unTrunstedTouchStatus = myShell.execAndWaitFor('settings get global block_untrusted_touches');
157-
// if (typeof unTrunstedTouchStatus !== 'undefined') {
158-
// console.log('unTrunstedTouchStatus', unTrunstedTouchStatus);
159-
// ret.push({
160-
// desc: '允许不受信任触摸的事件穿透',
161-
// name: 'unTrunstedTouchStatus',
162-
// type: 'autojs_inner_setting_unTrunstedTouchStatus',
163-
// enabled: 0 === parseInt(unTrunstedTouchStatus) ? true : false
164-
// });
165-
// }
166-
// }
154+
if (device.sdkInt >= 31 && isRoot) { // 安卓12,有root
155+
// 不受信任触摸事件
156+
const unTrunstedTouchStatus = myShell.execAndWaitFor('settings get global block_untrusted_touches');
157+
if (typeof unTrunstedTouchStatus !== 'undefined') {
158+
console.log('unTrunstedTouchStatus', unTrunstedTouchStatus);
159+
ret.push({
160+
desc: '允许不受信任触摸的事件穿透',
161+
name: 'unTrunstedTouchStatus',
162+
type: 'autojs_inner_setting_unTrunstedTouchStatus',
163+
enabled: 0 === parseInt(unTrunstedTouchStatus) ? true : false
164+
});
165+
}
166+
}
167167

168168
ret = [...ret, {
169169
desc: '悬浮选择方案后是否直接启动脚本',
@@ -402,14 +402,14 @@ export default function webviewSettigns() {
402402
// done(true);
403403
// });
404404
}
405-
// } else if ('autojs_inner_setting_unTrunstedTouchStatus' === item.type) {
406-
// if (item.enabled) {
407-
// myShell.execAndWaitFor('settings put global block_untrusted_touches 0');
408-
// done(true);
409-
// } else {
410-
// toastLog('请勿关闭允许不受信任触摸的事件穿透');
411-
// done(false);
412-
// }
405+
} else if ('autojs_inner_setting_unTrunstedTouchStatus' === item.type) {
406+
if (item.enabled) {
407+
myShell.execAndWaitFor('settings put global block_untrusted_touches 0');
408+
done(true);
409+
} else {
410+
toastLog('请勿关闭允许不受信任触摸的事件穿透');
411+
done(false);
412+
}
413413
} else if ('assttyys_setting' === item.type) {
414414
const storeSettings = storeCommon.get('settings', {});
415415
if ((item.stype || 'switch') === 'switch') {

0 commit comments

Comments
 (0)