Skip to content

Commit 7623a40

Browse files
authored
Android 11: Fix cancelNotificationWithTag signature
1 parent 529e1bb commit 7623a40

File tree

1 file changed

+14
-4
lines changed
  • VirtualApp/lib/src/main/java/com/lody/virtual/client/hook/proxies/notification

1 file changed

+14
-4
lines changed

VirtualApp/lib/src/main/java/com/lody/virtual/client/hook/proxies/notification/MethodProxies.java

+14-4
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,23 @@ public Object call(Object who, Method method, Object... args) throws Throwable {
105105
if (getHostPkg().equals(pkg)) {
106106
return method.invoke(who, args);
107107
}
108-
String tag = (String) args[1];
109-
int id = (int) args[2];
108+
109+
int index_tag = 1;
110+
int index_id = 2;
111+
112+
if (Build.VERSION.SDK_INT >= 30) {
113+
index_tag = 2;
114+
index_id = 3;
115+
}
116+
117+
String tag = (String) args[index_tag];
118+
int id = (int) args[index_id];
119+
110120
id = VNotificationManager.get().dealNotificationId(id, pkg, tag, getAppUserId());
111121
tag = VNotificationManager.get().dealNotificationTag(id, pkg, tag, getAppUserId());
112122

113-
args[1] = tag;
114-
args[2] = id;
123+
args[index_tag] = tag;
124+
args[index_id] = id;
115125
return method.invoke(who, args);
116126
}
117127
}

0 commit comments

Comments
 (0)