|
8 | 8 | import android.hardware.SensorEventListener; |
9 | 9 | import android.net.Uri; |
10 | 10 | import android.util.Log; |
| 11 | +import android.view.ContextMenu; |
11 | 12 | import android.view.LayoutInflater; |
12 | 13 | import android.view.Menu; |
13 | 14 | import android.view.MenuInflater; |
@@ -311,7 +312,7 @@ public synchronized static Class<?> loadForwardClassMethod(ClassLoader classLoad |
311 | 312 | // TODO: Classes and Methods for HideView |
312 | 313 | public synchronized static Method loadHideViewSendReadJob(ClassLoader classLoader) throws Exception { |
313 | 314 | return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> { |
314 | | - var classData = dexkit.getClassData(findFirstClassUsingName(classLoader, StringMatchType.EndsWith,"SendReadReceiptJob")); |
| 315 | + var classData = dexkit.getClassData(findFirstClassUsingName(classLoader, StringMatchType.EndsWith, "SendReadReceiptJob")); |
315 | 316 | var methodResult = classData.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("receipt", StringMatchType.Equals))); |
316 | 317 | if (methodResult.isEmpty()) { |
317 | 318 | methodResult = classData.getSuperClass().findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("receipt", StringMatchType.Equals))); |
@@ -1364,25 +1365,23 @@ public synchronized static Method loadJidFactory(ClassLoader loader) throws Exce |
1364 | 1365 |
|
1365 | 1366 | public synchronized static Method loadGroupCheckAdminMethod(ClassLoader loader) throws Exception { |
1366 | 1367 | return UnobfuscatorCache.getInstance().getMethod(loader, () -> { |
1367 | | - var classData = dexkit.findClass(FindClass.create().matcher(ClassMatcher.create().addUsingString("saveGroupParticipants/INSERT_GROUP_PARTICIPANT_USER"))); |
1368 | | - var resultMethod = classData.findMethod( |
1369 | | - FindMethod.create().matcher(MethodMatcher.create().paramCount(2).paramTypes(null, "com.whatsapp.jid.UserJid") |
1370 | | - .opNames(List.of( |
1371 | | - "const/4", |
1372 | | - "invoke-static", |
1373 | | - "const/4", |
1374 | | - "invoke-static", |
1375 | | - "invoke-virtual", |
1376 | | - "move-result-object", |
1377 | | - "const/4", |
1378 | | - "invoke-virtual", |
1379 | | - "move-result-object", |
1380 | | - "if-nez" |
1381 | | - ), OpCodeMatchType.StartsWith) |
1382 | | - )).singleOrNull(); |
1383 | | - if (resultMethod == null) |
1384 | | - throw new RuntimeException("GroupCheckAdmin method not found"); |
1385 | | - return resultMethod.getMethodInstance(loader); |
| 1368 | + |
| 1369 | + var classData = dexkit.findClass(FindClass.create().matcher(ClassMatcher.create().addUsingString("saveGroupParticipants/INSERT_GROUP_PARTICIPANT_USER"))).singleOrNull(); |
| 1370 | + var GroupChatClass = findFirstClassUsingName(loader, StringMatchType.EndsWith, "GroupChatInfoActivity"); |
| 1371 | + var onCreateMenu = ReflectionUtils.findMethodUsingFilter(GroupChatClass, method -> method.getName().equals("onCreateContextMenu")); |
| 1372 | + var onCreateMenuData = dexkit.getMethodData(onCreateMenu); |
| 1373 | + var invokes = onCreateMenuData.getInvokes().stream().filter(m -> Objects.equals(m.getDeclaredClassName(), classData.getName())).collect(Collectors.toList()); |
| 1374 | + for (var invoke : invokes) { |
| 1375 | + var invokeMethod = invoke.getMethodInstance(loader); |
| 1376 | + if (invokeMethod.getParameterCount() != 2 || invokeMethod.getReturnType() != boolean.class) |
| 1377 | + continue; |
| 1378 | + if (invokeMethod.getParameterTypes()[1].getName().equals("com.whatsapp.jid.UserJid")) { |
| 1379 | + XposedBridge.log("FIND: " + invokeMethod); |
| 1380 | + return invokeMethod; |
| 1381 | + } |
| 1382 | + |
| 1383 | + } |
| 1384 | + throw new RuntimeException("GroupCheckAdmin method not found"); |
1386 | 1385 | }); |
1387 | 1386 | } |
1388 | 1387 |
|
@@ -2039,6 +2038,6 @@ public static Method loadConvertJidToLid(ClassLoader loader) throws Exception { |
2039 | 2038 | } |
2040 | 2039 |
|
2041 | 2040 | public static Class loadWaContactData(ClassLoader classLoader) throws Exception { |
2042 | | - return UnobfuscatorCache.getInstance().getClass(classLoader, () -> findFirstClassUsingStrings(classLoader,StringMatchType.EndsWith,"WaContactData")); |
| 2041 | + return UnobfuscatorCache.getInstance().getClass(classLoader, () -> findFirstClassUsingStrings(classLoader, StringMatchType.EndsWith, "WaContactData")); |
2043 | 2042 | } |
2044 | 2043 | } |
0 commit comments