Skip to content

Commit f74a719

Browse files
authored
Merge pull request #139 from frknkrc44/fix-new-ui-20-xx
fix new filter ui for 20.xx
2 parents 1094669 + ea9f95b commit f74a719

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/core/devkit/Unobfuscator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,8 +1406,14 @@ public synchronized static Method getFilterInitMethod(ClassLoader loader) throws
14061406
var methods = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addInvoke(DexSignUtil.getMethodDescriptor(constructor))));
14071407
if (methods.isEmpty()) throw new RuntimeException("FilterInit method not found");
14081408
var cFrag = XposedHelpers.findClass("com.whatsapp.conversationslist.ConversationsFragment", loader);
1409-
var method = methods.stream().filter(m -> m.getParamCount() == 1 && m.getParamTypes().get(0).getName().equals(cFrag.getName())).findFirst().orElse(null);
1409+
var method = methods.stream().filter(m -> Arrays.asList(1, 2).contains(m.getParamCount()) && m.getParamTypes().get(0).getName().equals(cFrag.getName())).findFirst().orElse(null);
14101410
if (method == null) throw new RuntimeException("FilterInit method not found 2");
1411+
1412+
// for 20.xx, it returned with 2 parameter count
1413+
if (method.getParamCount() == 2) {
1414+
method = method.getDeclaredClass().findMethod(FindMethod.create().matcher(new MethodMatcher().addInvoke(DexSignUtil.getMethodDescriptor(method.getMethodInstance(loader))))).singleOrNull();
1415+
if (method == null) throw new RuntimeException("FilterInit method not found 3");
1416+
}
14111417
return method.getMethodInstance(loader);
14121418
});
14131419
}

0 commit comments

Comments
 (0)