Thanox情景模式/移花接木存档

/ 0评 / 3赞 / 

情景模式

打开特定APP时打开某服务:

[
  {
    "name": "WaiwangOpenClash",
    "description": "打开wai网进程自动开启clash",
    "priority": 1,
    "condition": "frontPkgChanged == true && globalVarOf$waiwangapp.contains(to)",
    "delay": 0,
    "actions": [
      "ui.showShortToast(\"正在打开clash\");",
      "su.exe('am start-service -n com.github.kr328.clash/com.github.kr328.clash.service.TunService')"
    ]
  }
]

使用全局变量:waiwangapp

[
  "tv.twitch.android.app",
  "com.google.android.gm",
  "com.twitter.android",
  "com.google.android.gsf.login",
  "com.picacomic.fregata",
  "org.telegram.messenger",
  "com.google.android.youtube",
  "com.discord",
  "jp.pxv.android"
]

本来还做了一个当全局变量内某app被关闭了任务时,关闭clash服务

[
  {
    "name": "WaiwangStopClash",
    "description": "外网软件被杀的时候关闭clash",
    "priority": 1,
    "condition": "taskRemoved == true && globalVarOf$waiwangapp.contains(pkgName)",
    "actions": [
    "ui.showShortToast(\"正在杀死clash\");",
    "killer.killPackage(“com.github.kr328.clash”);"
   ]
  }
]

但是不管是kill clash还是stopservice,都没办法关闭,不过condition是正常触发的

指令整理:

执行adb命令

使用方法:su.exe(命令)
例子:"su.exe('am start-service -n com.github.kr328.clash/com.github.kr328.clash.service.TunService')"
备注:例子为打开clash服务

屏幕下方提示框

使用方法:ui.showShortToast(\"提示内容\");
例子:"ui.showShortToast(\"正在杀死clash\");"
备注:转义放进去的"好像是必须的?

移花接木

叨鱼:

[{"from":{"mClass":"com.sdo.sdaccountkey.ui.welcome.WelcomeActivity","mPackage":"com.sdo.sdaccountkey"},"to":{"mClass":"com.sdo.sdaccountkey.ui.MainActivity","mPackage":"com.sdo.sdaccountkey"}}]

有个小问题就是会闪退一下 果然还是太暴力了

发表回复

您的电子邮箱地址不会被公开。