Skip to content

Commit

Permalink
fix new filter ui for 20.xx
Browse files Browse the repository at this point in the history
  • Loading branch information
frknkrc44 committed Oct 10, 2024
1 parent 1094669 commit ea9f95b
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 ea9f95b

Please sign in to comment.