@@ -215,7 +215,7 @@ public synchronized static Method loadReceiptOutsideChat(ClassLoader classLoader
215
215
public synchronized static Method loadReceiptInChat (ClassLoader classLoader ) throws Exception {
216
216
return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
217
217
var method = loadReceiptMethod (classLoader );
218
- var methodDataList = dexkit .findMethod (new FindMethod ().matcher (new MethodMatcher ().addUsingString ("callCreatorJid" ).addUsingString ("reject" ).addUsingNumber ( 6175 ). addInvoke (DexSignUtil .getMethodDescriptor (method ))));
218
+ var methodDataList = dexkit .findMethod (new FindMethod ().matcher (new MethodMatcher ().addUsingString ("callCreatorJid" ).addUsingString ("reject" ).addInvoke (DexSignUtil .getMethodDescriptor (method ))));
219
219
if (methodDataList .isEmpty ()) throw new Exception ("Receipt method not found" );
220
220
return methodDataList .get (0 ).getMethodInstance (classLoader );
221
221
});
@@ -249,6 +249,25 @@ public synchronized static Field loadBroadcastTagField(ClassLoader classLoader)
249
249
var clazzData = dexkit .findClass (FindClass .create ().matcher (ClassMatcher .create ().addUsingString ("UPDATE_MESSAGE_MAIN_BROADCAST_SCAN_SQL" )));
250
250
if (clazzData .isEmpty ()) throw new Exception ("BroadcastTag class not found" );
251
251
var methodData = dexkit .findMethod (FindMethod .create ().searchInClass (clazzData ).matcher (MethodMatcher .create ().usingStrings ("participant_hash" , "view_mode" , "broadcast" )));
252
+
253
+ // 2.25.18.xx, they splitted method and moved to the fmessage
254
+ if (methodData .isEmpty ()) {
255
+ methodData = dexkit .findMethod (FindMethod .create ().searchInClass (clazzData ).matcher (MethodMatcher .create ().usingStrings ("received_timestamp" , "view_mode" , "message" )));
256
+ if (!methodData .isEmpty ()) {
257
+ var calledMethods = methodData .get (0 ).getInvokes ();
258
+ for (var cmethod : calledMethods ) {
259
+ if (Modifier .isStatic (cmethod .getModifiers ()) && cmethod .getParamCount () == 2 && fmessage .getName ().equals (cmethod .getDeclaredClass ().getName ())) {
260
+ var pTypes = cmethod .getParamTypes ();
261
+ if (pTypes .get (0 ).getName ().equals (ContentValues .class .getName ()) && pTypes .get (1 ).getName ().equals (fmessage .getName ())) {
262
+ methodData .clear ();
263
+ methodData .add (cmethod );
264
+ break ;
265
+ }
266
+ }
267
+ }
268
+ }
269
+ }
270
+
252
271
if (methodData .isEmpty ()) throw new Exception ("BroadcastTag method support not found" );
253
272
var usingFields = methodData .get (0 ).getUsingFields ();
254
273
for (var ufield : usingFields ) {
@@ -813,6 +832,7 @@ public synchronized static Method loadBlueOnReplayWaJobManagerMethod(ClassLoader
813
832
public synchronized static Class loadArchiveChatClass (ClassLoader loader ) throws Exception {
814
833
return UnobfuscatorCache .getInstance ().getClass (loader , () -> {
815
834
var clazz = findFirstClassUsingStrings (loader , StringMatchType .Contains , "archive/set-content-indicator-to-empty" );
835
+ if (clazz == null ) clazz = findFirstClassUsingStrings (loader , StringMatchType .Contains , "archive/Unsupported mode in ArchivePreviewView:" );
816
836
if (clazz == null ) throw new Exception ("ArchiveHideView method not found" );
817
837
return clazz ;
818
838
});
@@ -887,7 +907,16 @@ public synchronized static Method loadSendPresenceMethod(ClassLoader loader) thr
887
907
return UnobfuscatorCache .getInstance ().getMethod (loader , () -> {
888
908
var methodData = dexkit .findMethod (FindMethod .create ().matcher (MethodMatcher .create ().addUsingString ("app/send-presence-subscription jid=" )));
889
909
if (methodData .isEmpty ()) throw new Exception ("SendPresence method not found" );
890
- var newMethod = methodData .get (0 ).getCallers ().singleOrNull (method1 -> method1 .getParamCount () == 4 );
910
+ var methodCallers = methodData .get (0 ).getCallers ();
911
+ if (methodCallers .isEmpty ()) {
912
+ var method = methodData .get (0 );
913
+ var superMethodInterfaces = method .getDeclaredClass ().getInterfaces ();
914
+ if (superMethodInterfaces .isEmpty ()) throw new Exception ("SendPresence method interface list empty" );
915
+ var superMethod = superMethodInterfaces .get (0 ).findMethod (FindMethod .create ().matcher (MethodMatcher .create ().name (method .getName ()))).firstOrNull ();
916
+ if (superMethod == null ) throw new Exception ("SendPresence method interface method not found" );
917
+ methodCallers = superMethod .getCallers ();
918
+ }
919
+ var newMethod = methodCallers .firstOrNull (method1 -> method1 .getParamCount () == 4 );
891
920
if (newMethod == null ) throw new Exception ("SendPresence method not found 2" );
892
921
return newMethod .getMethodInstance (loader );
893
922
});
@@ -1637,21 +1666,53 @@ public synchronized static Method loadCopiedMessageMethod(ClassLoader classLoade
1637
1666
});
1638
1667
}
1639
1668
1640
- public synchronized static Method loadSenderPlayed (ClassLoader classLoader ) throws Exception {
1641
- return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
1669
+ public synchronized static Class <?> loadSenderPlayedClass (ClassLoader classLoader ) throws Exception {
1670
+ return UnobfuscatorCache .getInstance ().getClass (classLoader , () -> {
1642
1671
var clazz = findFirstClassUsingStrings (classLoader , StringMatchType .Contains , "sendmethods/sendClearDirty" );
1643
1672
if (clazz == null ) throw new RuntimeException ("SenderPlayed class not found" );
1673
+ return clazz ;
1674
+ });
1675
+ }
1676
+
1677
+ public synchronized static Method loadSenderPlayedMethod (ClassLoader classLoader ) throws Exception {
1678
+ return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
1679
+ var clazz = loadSenderPlayedClass (classLoader );
1644
1680
var fmessageClass = loadFMessageClass (classLoader );
1645
- var methodResult = ReflectionUtils .findMethodUsingFilter (clazz , method -> method .getParameterCount () == 1 && fmessageClass .isAssignableFrom (method .getParameterTypes ()[0 ]));
1646
- if (methodResult == null ) throw new RuntimeException ("SenderPlayed method not found" );
1681
+ Method methodResult = null ;
1682
+ for (var method : clazz .getMethods ()) {
1683
+ if (method .getParameterCount () == 1 && fmessageClass .isAssignableFrom (method .getParameterTypes ()[0 ])) {
1684
+ methodResult = method ;
1685
+ break ;
1686
+ }
1687
+ }
1688
+
1689
+ // 2.25.19.xx, they refactored the SenderPlayed class
1690
+ if (methodResult == null ) {
1691
+ var method = findFirstMethodUsingStrings (classLoader , StringMatchType .Contains , "mediaHash and fileType not both present for upload URL generation" );
1692
+ if (method != null ) {
1693
+ var cMethods = dexkit .getMethodData (method ).getInvokes ();
1694
+ Collections .reverse (cMethods );
1695
+ for (var cmethod : cMethods ) {
1696
+ if (cmethod .isMethod () && cmethod .getParamCount () == 1 ) {
1697
+ var cParamType = cmethod .getParamTypes ().get (0 ).getInstance (classLoader );
1698
+ if (fmessageClass .isAssignableFrom (cParamType )) {
1699
+ methodResult = cmethod .getMethodInstance (classLoader );
1700
+ break ;
1701
+ }
1702
+ }
1703
+ }
1704
+ }
1705
+ }
1706
+
1707
+ if (methodResult == null ) throw new RuntimeException ("SenderPlayed method not found 2" );
1647
1708
return methodResult ;
1648
1709
});
1649
1710
}
1650
1711
1651
1712
public synchronized static Method loadSenderPlayedBusiness (ClassLoader classLoader ) throws Exception {
1652
1713
return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
1653
- var loadSenderPlayed = loadSenderPlayed (classLoader );
1654
- var foundMethod = ReflectionUtils .findMethodUsingFilter (loadSenderPlayed . getDeclaringClass () , method -> method .getParameterCount () > 0 && method .getParameterTypes ()[0 ] == Set .class );
1714
+ var loadSenderPlayed = loadSenderPlayedClass (classLoader );
1715
+ var foundMethod = ReflectionUtils .findMethodUsingFilter (loadSenderPlayed , method -> method .getParameterCount () > 0 && method .getParameterTypes ()[0 ] == Set .class );
1655
1716
if (foundMethod == null )
1656
1717
throw new RuntimeException ("SenderPlayedBusiness method not found" );
1657
1718
return foundMethod ;
0 commit comments