Skip to content

Commit

Permalink
Merge pull request #139 from frknkrc44/fix-new-ui-20-xx
Browse files Browse the repository at this point in the history
fix new filter ui for 20.xx
  • Loading branch information
Dev4Mod authored Oct 10, 2024
2 parents 1094669 + ea9f95b commit f74a719
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,14 @@ public synchronized static Method getFilterInitMethod(ClassLoader loader) throws
var methods = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addInvoke(DexSignUtil.getMethodDescriptor(constructor))));
if (methods.isEmpty()) throw new RuntimeException("FilterInit method not found");
var cFrag = XposedHelpers.findClass("com.whatsapp.conversationslist.ConversationsFragment", loader);
var method = methods.stream().filter(m -> m.getParamCount() == 1 && m.getParamTypes().get(0).getName().equals(cFrag.getName())).findFirst().orElse(null);
var method = methods.stream().filter(m -> Arrays.asList(1, 2).contains(m.getParamCount()) && m.getParamTypes().get(0).getName().equals(cFrag.getName())).findFirst().orElse(null);
if (method == null) throw new RuntimeException("FilterInit method not found 2");

// for 20.xx, it returned with 2 parameter count
if (method.getParamCount() == 2) {
method = method.getDeclaredClass().findMethod(FindMethod.create().matcher(new MethodMatcher().addInvoke(DexSignUtil.getMethodDescriptor(method.getMethodInstance(loader))))).singleOrNull();
if (method == null) throw new RuntimeException("FilterInit method not found 3");
}
return method.getMethodInstance(loader);
});
}
Expand Down

0 comments on commit f74a719

Please sign in to comment.