Skip to content

Commit b9de955

Browse files
committed
fix 18.xx support
1 parent c88484b commit b9de955

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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
@@ -55,6 +55,7 @@
5555
import java.util.TimerTask;
5656
import java.util.stream.Collectors;
5757

58+
import de.robv.android.xposed.XposedBridge;
5859
import de.robv.android.xposed.XposedHelpers;
5960

6061
public class Unobfuscator {
@@ -215,7 +216,7 @@ public synchronized static Method loadReceiptOutsideChat(ClassLoader classLoader
215216
public synchronized static Method loadReceiptInChat(ClassLoader classLoader) throws Exception {
216217
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
217218
var method = loadReceiptMethod(classLoader);
218-
var methodDataList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("callCreatorJid").addUsingString("reject").addUsingNumber(6175).addInvoke(DexSignUtil.getMethodDescriptor(method))));
219+
var methodDataList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("callCreatorJid").addUsingString("reject").addInvoke(DexSignUtil.getMethodDescriptor(method))));
219220
if (methodDataList.isEmpty()) throw new Exception("Receipt method not found");
220221
return methodDataList.get(0).getMethodInstance(classLoader);
221222
});
@@ -249,6 +250,25 @@ public synchronized static Field loadBroadcastTagField(ClassLoader classLoader)
249250
var clazzData = dexkit.findClass(FindClass.create().matcher(ClassMatcher.create().addUsingString("UPDATE_MESSAGE_MAIN_BROADCAST_SCAN_SQL")));
250251
if (clazzData.isEmpty()) throw new Exception("BroadcastTag class not found");
251252
var methodData = dexkit.findMethod(FindMethod.create().searchInClass(clazzData).matcher(MethodMatcher.create().usingStrings("participant_hash", "view_mode", "broadcast")));
253+
254+
// 2.25.18.xx, they splitted method and moved to the fmessage
255+
if (methodData.isEmpty()) {
256+
methodData = dexkit.findMethod(FindMethod.create().searchInClass(clazzData).matcher(MethodMatcher.create().usingStrings("received_timestamp", "view_mode", "message")));
257+
if (!methodData.isEmpty()) {
258+
var calledMethods = methodData.get(0).getInvokes();
259+
for (var cmethod : calledMethods) {
260+
if (Modifier.isStatic(cmethod.getModifiers()) && cmethod.getParamCount() == 2 && fmessage.getName().equals(cmethod.getDeclaredClass().getName())) {
261+
var pTypes = cmethod.getParamTypes();
262+
if (pTypes.get(0).getName().equals(ContentValues.class.getName()) && pTypes.get(1).getName().equals(fmessage.getName())) {
263+
methodData.clear();
264+
methodData.add(cmethod);
265+
break;
266+
}
267+
}
268+
}
269+
}
270+
}
271+
252272
if (methodData.isEmpty()) throw new Exception("BroadcastTag method support not found");
253273
var usingFields = methodData.get(0).getUsingFields();
254274
for (var ufield : usingFields) {
@@ -813,6 +833,7 @@ public synchronized static Method loadBlueOnReplayWaJobManagerMethod(ClassLoader
813833
public synchronized static Class loadArchiveChatClass(ClassLoader loader) throws Exception {
814834
return UnobfuscatorCache.getInstance().getClass(loader, () -> {
815835
var clazz = findFirstClassUsingStrings(loader, StringMatchType.Contains, "archive/set-content-indicator-to-empty");
836+
if (clazz == null) clazz = findFirstClassUsingStrings(loader, StringMatchType.Contains, "archive/Unsupported mode in ArchivePreviewView:");
816837
if (clazz == null) throw new Exception("ArchiveHideView method not found");
817838
return clazz;
818839
});

0 commit comments

Comments
 (0)