Skip to content

Commit

Permalink
update 总是跳回应用
Browse files Browse the repository at this point in the history
  • Loading branch information
gallonyin committed May 12, 2023
1 parent 359dbcd commit 21fb01a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions app/src/main/java/org/yameida/worktool/service/GlobalMethod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,13 @@ fun getRoot(ignoreCheck: Boolean): AccessibilityNodeInfo {
WeworkController.weworkService.currentPackage = root.packageName?.toString() ?: ""
if (System.currentTimeMillis() % 30 == 0L) {
error("当前不在企业微信: ${root.packageName}")
if (!root.packageName.contains("worktool")) {
if (!FloatWindowHelper.isPause) {
ToastUtils.show("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
Utils.getApp().packageManager.getLaunchIntentForPackage(Constant.PACKAGE_NAMES)
?.apply {
this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
Utils.getApp().startActivity(this)
}
}
if (!FloatWindowHelper.isPause) {
ToastUtils.show("当前不在企业微信: ${root.packageName}\n尝试跳转到企业微信")
Utils.getApp().packageManager.getLaunchIntentForPackage(Constant.PACKAGE_NAMES)
?.apply {
this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
Utils.getApp().startActivity(this)
}
}
}
if (ignoreCheck) {
Expand Down

0 comments on commit 21fb01a

Please sign in to comment.