「Thanox Profile」修訂間的差異
跳至導覽
跳至搜尋
(→开机自启动) |
|||
行 4: | 行 4: | ||
== 开机自启动 == | == 开机自启动 == | ||
变量名:<code>Foreground</code> 与 <code>Background</code><br> | 变量名:<code>Foreground</code> 与 <code>Background</code><br> | ||
一般情况下请使用 <code>Background</code>,<code>Foreground</code> 主要用在一些仅启动进程不足以正常运行的 APP,如 <code>小米健康运动</code> (只开进程手表无法收到任何通知)。 | 一般情况下请使用 <code>Background</code>,<code>Foreground</code> 主要用在一些仅启动进程不足以正常运行的 APP,如 <code>小米健康运动</code> (只开进程手表无法收到任何通知) 。另不建议移除 <code>Thread.sleep(3000);</code>。密集地执行 <code>activity.launchProcessForPackage</code> 会导致需要启动多个应用的时候部分不成功 。 | ||
<pre> | <pre> | ||
[{ | [{ | ||
行 13: | 行 13: | ||
"actions": | "actions": | ||
[ | [ | ||
"foreach (el : globalVarOf$Background) {activity.launchProcessForPackage(el);}", | "foreach (el : globalVarOf$Background) {activity.launchProcessForPackage(el); Thread.sleep(3000);}", | ||
"foreach (el : globalVarOf$Foreground) {activity.launchMainActivityForPackage(el);}" | "foreach (el : globalVarOf$Foreground) {activity.launchMainActivityForPackage(el); Thread.sleep(3000);}" | ||
] | ] | ||
}] | }] |
於 2022年7月21日 (四) 09:16 的修訂
Thanox Pro 情景模式
開機自啟動
變量名:Foreground
與 Background
一般情況下請使用 Background
,Foreground
主要用在一些僅啟動進程不足以正常運行的 APP,如 小米健康运动
(只開進程手錶無法收到任何通知)。另不建議移除 Thread.sleep(3000);
。密集地執行 activity.launchProcessForPackage
會導致需要啟動多個應用的時候部分不成功。
[{ "name": "System Boot Ready Running", "description": "Global Variant: Foreground, Background", "priority": 1, "condition": "systemReady == true", "actions": [ "foreach (el : globalVarOf$Background) {activity.launchProcessForPackage(el); Thread.sleep(3000);}", "foreach (el : globalVarOf$Foreground) {activity.launchMainActivityForPackage(el); Thread.sleep(3000);}" ] }]
進程守護 (啟動應用進程)
變量名:Background
[{ "name": "Keep Background Running", "description": "Global Variant: Background", "priority": 1, "condition": "pkgKilled == true && globalVarOf$Background.contains(pkgName)", "actions": ["activity.launchProcessForPackage(pkgName)"] }]
進程守護 (打開應用主界面)
變量名:Foreground
主要用在一些僅啟動進程不足以正常運行的 APP,如 小米健康运动
(只開進程手錶無法收到任何通知)。
[{ "name": "Keep Foreground Running", "description": "Global Variant: Foreground", "priority": 1, "condition": "pkgKilled == true && globalVarOf$Foreground.contains(pkgName)", "actions": ["activity.launchMainActivityForPackage(pkgName)"] }]