Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,27 @@ public synchronized static Method loadOnChangeStatus(ClassLoader loader) throws
return UnobfuscatorCache.getInstance().getMethod(loader, () -> {
Method method = findFirstMethodUsingStrings(loader, StringMatchType.Contains, "ConversationViewFiller/setParentGroupProfilePhoto");
if (method == null) throw new Exception("OnChangeStatus method not found");

// for 19.xx, the current implementation returns wrong method
if (method.getParameterCount() < 6) {
ClassData declaringClassData = dexkit.getClassData(method.getDeclaringClass());
if (declaringClassData == null) throw new Exception("OnChangeStatus method not found");

Class<?> arg1Class = findFirstClassUsingStrings(loader, StringMatchType.Contains, "problematic contact:");
MethodDataList methodData = declaringClassData.findMethod(
FindMethod.create().matcher(MethodMatcher.create().paramCount(6, 8)));

for (var methodItem : methodData) {
var paramTypes = methodItem.getParamTypes();

if (paramTypes.get(0).getInstance(loader) == arg1Class &&
paramTypes.get(1).getInstance(loader) == arg1Class) {
method = methodItem.getMethodInstance(loader);
break;
}
}
}

return method;
});
}
Expand Down Expand Up @@ -1397,7 +1418,7 @@ public synchronized static Method loadOnPlaybackFinished(ClassLoader classLoader

public synchronized static Method loadNextStatusRunMethod(ClassLoader classLoader) throws Exception {
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
var methodList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("SequentialVoiceMemoPlayer/playMiddleTone").name("run")));
var methodList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("playMiddleTone").name("run")));
if (methodList.isEmpty()) throw new RuntimeException("RunNextStatus method not found");
return methodList.get(0).getMethodInstance(classLoader);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ public boolean addAll(@NonNull Collection c) {
private boolean checkGroup(Object chat) {
var requiredServer = isGroup ? "g.us" : "s.whatsapp.net";
var jid = getObjectField(chat, "A00");
if (jid == null) jid = getObjectField(chat, "A01");
if (jid == null) return true;
if (XposedHelpers.findMethodExactIfExists(jid.getClass(), "getServer") != null) {
var server = (String) callMethod(jid, "getServer");
return server.equals(requiredServer);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<item>2.24.16.xx</item>
<item>2.24.17.xx</item>
<item>2.24.18.xx</item>
<item>2.24.19.xx</item>
</string-array>
<string-array name="supported_versions_business">
<item>2.24.12.xx</item>
Expand All @@ -130,6 +131,7 @@
<item>2.24.16.xx</item>
<item>2.24.17.xx</item>
<item>2.24.18.xx</item>
<item>2.24.19.xx</item>
</string-array>
<string-array name="image_picker">
<item>image/*</item>
Expand Down