@@ -832,7 +832,8 @@ public synchronized static Method loadBlueOnReplayWaJobManagerMethod(ClassLoader
832
832
public synchronized static Class loadArchiveChatClass (ClassLoader loader ) throws Exception {
833
833
return UnobfuscatorCache .getInstance ().getClass (loader , () -> {
834
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:" );
835
+ if (clazz == null )
836
+ clazz = findFirstClassUsingStrings (loader , StringMatchType .Contains , "archive/Unsupported mode in ArchivePreviewView:" );
836
837
if (clazz == null ) throw new Exception ("ArchiveHideView method not found" );
837
838
return clazz ;
838
839
});
@@ -911,9 +912,11 @@ public synchronized static Method loadSendPresenceMethod(ClassLoader loader) thr
911
912
if (methodCallers .isEmpty ()) {
912
913
var method = methodData .get (0 );
913
914
var superMethodInterfaces = method .getDeclaredClass ().getInterfaces ();
914
- if (superMethodInterfaces .isEmpty ()) throw new Exception ("SendPresence method interface list empty" );
915
+ if (superMethodInterfaces .isEmpty ())
916
+ throw new Exception ("SendPresence method interface list empty" );
915
917
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" );
918
+ if (superMethod == null )
919
+ throw new Exception ("SendPresence method interface method not found" );
917
920
methodCallers = superMethod .getCallers ();
918
921
}
919
922
var newMethod = methodCallers .firstOrNull (method1 -> method1 .getParamCount () == 4 );
@@ -1677,16 +1680,28 @@ public synchronized static Class<?> loadSenderPlayedClass(ClassLoader classLoade
1677
1680
public synchronized static Method loadSenderPlayedMethod (ClassLoader classLoader ) throws Exception {
1678
1681
return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
1679
1682
var clazz = loadSenderPlayedClass (classLoader );
1680
- var fmessageClass = loadFMessageClass (classLoader );
1683
+ var abstractMediaMessageClass = Unobfuscator .loadAbstractMediaMessageClass (classLoader );
1684
+ var interfaces = abstractMediaMessageClass .getInterfaces ();
1685
+
1686
+ ArrayList <Class > interfacesList = new ArrayList <>();
1687
+ interfacesList .add (abstractMediaMessageClass );
1688
+ interfacesList .addAll (Arrays .asList (interfaces ));
1689
+
1681
1690
Method methodResult = null ;
1691
+ main_loop :
1682
1692
for (var method : clazz .getMethods ()) {
1683
- if (method .getParameterCount () == 1 && fmessageClass .isAssignableFrom (method .getParameterTypes ()[0 ])) {
1684
- methodResult = method ;
1685
- break ;
1693
+ if (method .getParameterCount () != 1 ) continue ;
1694
+ var parameterType = method .getParameterTypes ()[0 ];
1695
+ for (var interfaceClass : interfacesList ) {
1696
+ if (interfaceClass .isAssignableFrom (parameterType )) {
1697
+ methodResult = method ;
1698
+ break main_loop ;
1699
+ }
1686
1700
}
1687
1701
}
1688
1702
1689
1703
// 2.25.19.xx, they refactored the SenderPlayed class
1704
+ var fmessageClass = Unobfuscator .loadFMessageClass (classLoader );
1690
1705
if (methodResult == null ) {
1691
1706
var method = findFirstMethodUsingStrings (classLoader , StringMatchType .Contains , "mediaHash and fileType not both present for upload URL generation" );
1692
1707
if (method != null ) {
@@ -1708,7 +1723,6 @@ public synchronized static Method loadSenderPlayedMethod(ClassLoader classLoader
1708
1723
return methodResult ;
1709
1724
});
1710
1725
}
1711
-
1712
1726
public synchronized static Method loadSenderPlayedBusiness (ClassLoader classLoader ) throws Exception {
1713
1727
return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
1714
1728
var loadSenderPlayed = loadSenderPlayedClass (classLoader );
0 commit comments