「Thanox Profile」修訂間的差異
跳至導覽
跳至搜尋
(未顯示同一使用者於中間所作的 3 次修訂) | |||
行 1: | 行 1: | ||
[[Category:Android]] | [[Category:Android]] | ||
[https://play.google.com/store/apps/details?id=github.tornaco.android.thanos.pro Thanox Pro] 情景模式 | [https://play.google.com/store/apps/details?id=github.tornaco.android.thanos.pro Thanox Pro] 情景模式 | ||
== 总集篇 (开机自启动 + 被杀后台自动重新运行 + 开关屏幕运行) == | |||
<pre> | |||
[ | |||
{ | |||
"name": "KeepAlive", | |||
"description": "Global Variant: keepAlive", | |||
"priority": -1, | |||
"condition": "systemReady == true || screenOff == true || screenOn == true || pkgKilled == true", | |||
"delay": 10000, | |||
"actions": [ | |||
"foreach (app: globalVarOf$keepAlive) {activity.launchProcessForPackage(app); Thread.sleep(3000);}" | |||
] | |||
} | |||
] | |||
</pre> | |||
== 开机自启动 == | == 开机自启动 == | ||
行 14: | 行 30: | ||
"delay": 10000, | "delay": 10000, | ||
"actions": [ | "actions": [ | ||
"foreach ( | "foreach (back: globalVarOf$Background) {activity.launchProcessForPackage(back); Thread.sleep(3000);}", | ||
"foreach ( | "foreach (fore: globalVarOf$Foreground) {activity.launchMainActivityForPackage(fore); Thread.sleep(3000);}" | ||
] | ] | ||
} | } | ||
行 49: | 行 65: | ||
"actions": [ | "actions": [ | ||
"activity.launchMainActivityForPackage(pkgName)" | "activity.launchMainActivityForPackage(pkgName)" | ||
] | |||
} | |||
] | |||
</pre> | |||
== NFC 被关闭后自动打开 == | |||
避免任何情况下 NFC 被关闭后不会自动打开 (如无线充电)。 | |||
<pre> | |||
[ | |||
{ | |||
"name": "NFC Always On", | |||
"description": "NFC Always On", | |||
"priority": 1, | |||
"condition": "hw.isNfcEnabled() == false", | |||
"actions": [ | |||
"hw.enableNfc()" | |||
] | ] | ||
} | } | ||
] | ] | ||
</pre> | </pre> |
於 2024年5月11日 (六) 03:07 的最新修訂
Thanox Pro 情景模式
總集篇 (開機自啟動 + 被殺後台自動重新運行 + 開關屏幕運行)
[ { "name": "KeepAlive", "description": "Global Variant: keepAlive", "priority": -1, "condition": "systemReady == true || screenOff == true || screenOn == true || pkgKilled == true", "delay": 10000, "actions": [ "foreach (app: globalVarOf$keepAlive) {activity.launchProcessForPackage(app); Thread.sleep(3000);}" ] } ]
開機自啟動
變量名: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", "delay": 10000, "actions": [ "foreach (back: globalVarOf$Background) {activity.launchProcessForPackage(back); Thread.sleep(3000);}", "foreach (fore: globalVarOf$Foreground) {activity.launchMainActivityForPackage(fore); 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)" ] } ]
NFC 被關閉後自動打開
避免任何情況下 NFC 被關閉後不會自動打開 (如無線充電)。
[ { "name": "NFC Always On", "description": "NFC Always On", "priority": 1, "condition": "hw.isNfcEnabled() == false", "actions": [ "hw.enableNfc()" ] } ]