Skip to content

Commit d4133c5

Browse files
committed
fix: Replace obsolete TextStatusComposer2 method with new behavior
1 parent 8bb17fe commit d4133c5

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,20 +1557,22 @@ public synchronized static Method loadTextStatusComposer2(ClassLoader classLoade
15571557
addMethod(MethodMatcher.create().paramCount(1).addParamType(TextDataClass))
15581558
));
15591559
if (result.isEmpty()) {
1560-
result = dexkit.findClass(FindClass.create().matcher(
1561-
ClassMatcher.create().addUsingString("ViewOnce messages can not be forwarded").
1562-
addMethod(MethodMatcher.create().paramCount(1).addParamType(TextDataClass))
1563-
));
1560+
var tscClazzData = dexkit.getClassData("com.whatsapp.statuscomposer.composer.TextStatusComposerFragment");
1561+
for (var method : tscClazzData.getMethods()) {
1562+
var tdMethod = method.getInvokes().stream().filter(m -> m.isMethod() && m.getParamCount() == 1 && m.getParamTypes().get(0).equals(dexkit.getClassData(TextDataClass))).findFirst();
1563+
tdMethod.ifPresent(methodData -> result.add(methodData.getDeclaredClass()));
1564+
}
1565+
15641566
if (result.isEmpty()) {
1565-
throw new RuntimeException("TextStatusComposer2 class not found");
1567+
throw new RuntimeException("TextStatusComposer2 class not found 1");
15661568
}
15671569
}
15681570

15691571
var foundClass = result.get(0).getInstance(classLoader);
15701572
var resultMethod = ReflectionUtils.findMethodUsingFilter(foundClass, method -> method.getParameterCount() == 1 && method.getParameterTypes()[0] == TextDataClass);
15711573
if (resultMethod != null)
15721574
return resultMethod;
1573-
throw new RuntimeException("TextStatusComposer2 method not found");
1575+
throw new RuntimeException("TextStatusComposer2 method not found 2");
15741576
});
15751577
}
15761578

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<item>2.24.23.xx</item>
121121
<item>2.24.24.xx</item>
122122
<item>2.24.25.xx</item>
123+
<item>2.24.26.xx</item>
123124
</string-array>
124125
<string-array name="supported_versions_business">
125126
<item>2.24.20.xx</item>
@@ -128,6 +129,7 @@
128129
<item>2.24.23.xx</item>
129130
<item>2.24.24.xx</item>
130131
<item>2.24.25.xx</item>
132+
<item>2.24.26.xx</item>
131133
</string-array>
132134
<string-array name="image_picker">
133135
<item>image/*</item>

0 commit comments

Comments
 (0)