@@ -832,7 +832,8 @@ public synchronized static Method loadBlueOnReplayWaJobManagerMethod(ClassLoader
832832 public synchronized static Class loadArchiveChatClass (ClassLoader loader ) throws Exception {
833833 return UnobfuscatorCache .getInstance ().getClass (loader , () -> {
834834 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:" );
836837 if (clazz == null ) throw new Exception ("ArchiveHideView method not found" );
837838 return clazz ;
838839 });
@@ -911,9 +912,11 @@ public synchronized static Method loadSendPresenceMethod(ClassLoader loader) thr
911912 if (methodCallers .isEmpty ()) {
912913 var method = methodData .get (0 );
913914 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" );
915917 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" );
917920 methodCallers = superMethod .getCallers ();
918921 }
919922 var newMethod = methodCallers .firstOrNull (method1 -> method1 .getParamCount () == 4 );
@@ -1677,16 +1680,28 @@ public synchronized static Class<?> loadSenderPlayedClass(ClassLoader classLoade
16771680 public synchronized static Method loadSenderPlayedMethod (ClassLoader classLoader ) throws Exception {
16781681 return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
16791682 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+
16811690 Method methodResult = null ;
1691+ main_loop :
16821692 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+ }
16861700 }
16871701 }
16881702
16891703 // 2.25.19.xx, they refactored the SenderPlayed class
1704+ var fmessageClass = Unobfuscator .loadFMessageClass (classLoader );
16901705 if (methodResult == null ) {
16911706 var method = findFirstMethodUsingStrings (classLoader , StringMatchType .Contains , "mediaHash and fileType not both present for upload URL generation" );
16921707 if (method != null ) {
@@ -1708,7 +1723,6 @@ public synchronized static Method loadSenderPlayedMethod(ClassLoader classLoader
17081723 return methodResult ;
17091724 });
17101725 }
1711-
17121726 public synchronized static Method loadSenderPlayedBusiness (ClassLoader classLoader ) throws Exception {
17131727 return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
17141728 var loadSenderPlayed = loadSenderPlayedClass (classLoader );
0 commit comments