Skip to content

Commit 44ad2fa

Browse files
authored
Merge pull request #126 from frknkrc44/feat-19-xx-support
feat: Add initial 19.xx support for WA and WB
2 parents aea82db + 0caa014 commit 44ad2fa

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,27 @@ public synchronized static Method loadOnChangeStatus(ClassLoader loader) throws
865865
return UnobfuscatorCache.getInstance().getMethod(loader, () -> {
866866
Method method = findFirstMethodUsingStrings(loader, StringMatchType.Contains, "ConversationViewFiller/setParentGroupProfilePhoto");
867867
if (method == null) throw new Exception("OnChangeStatus method not found");
868+
869+
// for 19.xx, the current implementation returns wrong method
870+
if (method.getParameterCount() < 6) {
871+
ClassData declaringClassData = dexkit.getClassData(method.getDeclaringClass());
872+
if (declaringClassData == null) throw new Exception("OnChangeStatus method not found");
873+
874+
Class<?> arg1Class = findFirstClassUsingStrings(loader, StringMatchType.Contains, "problematic contact:");
875+
MethodDataList methodData = declaringClassData.findMethod(
876+
FindMethod.create().matcher(MethodMatcher.create().paramCount(6, 8)));
877+
878+
for (var methodItem : methodData) {
879+
var paramTypes = methodItem.getParamTypes();
880+
881+
if (paramTypes.get(0).getInstance(loader) == arg1Class &&
882+
paramTypes.get(1).getInstance(loader) == arg1Class) {
883+
method = methodItem.getMethodInstance(loader);
884+
break;
885+
}
886+
}
887+
}
888+
868889
return method;
869890
});
870891
}
@@ -1397,7 +1418,7 @@ public synchronized static Method loadOnPlaybackFinished(ClassLoader classLoader
13971418

13981419
public synchronized static Method loadNextStatusRunMethod(ClassLoader classLoader) throws Exception {
13991420
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
1400-
var methodList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("SequentialVoiceMemoPlayer/playMiddleTone").name("run")));
1421+
var methodList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("playMiddleTone").name("run")));
14011422
if (methodList.isEmpty()) throw new RuntimeException("RunNextStatus method not found");
14021423
return methodList.get(0).getMethodInstance(classLoader);
14031424
});

app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/SeparateGroup.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ public boolean addAll(@NonNull Collection c) {
337337
private boolean checkGroup(Object chat) {
338338
var requiredServer = isGroup ? "g.us" : "s.whatsapp.net";
339339
var jid = getObjectField(chat, "A00");
340+
if (jid == null) jid = getObjectField(chat, "A01");
341+
if (jid == null) return true;
340342
if (XposedHelpers.findMethodExactIfExists(jid.getClass(), "getServer") != null) {
341343
var server = (String) callMethod(jid, "getServer");
342344
return server.equals(requiredServer);

app/src/main/res/values/arrays.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
<item>2.24.16.xx</item>
122122
<item>2.24.17.xx</item>
123123
<item>2.24.18.xx</item>
124+
<item>2.24.19.xx</item>
124125
</string-array>
125126
<string-array name="supported_versions_business">
126127
<item>2.24.12.xx</item>
@@ -130,6 +131,7 @@
130131
<item>2.24.16.xx</item>
131132
<item>2.24.17.xx</item>
132133
<item>2.24.18.xx</item>
134+
<item>2.24.19.xx</item>
133135
</string-array>
134136
<string-array name="image_picker">
135137
<item>image/*</item>

0 commit comments

Comments
 (0)