@@ -875,7 +875,7 @@ public synchronized static Method loadPinnedLimitMethod(ClassLoader loader) thro
875875
876876 public synchronized static Method loadPinnedHashSetMethod (ClassLoader loader ) throws Exception {
877877 return UnobfuscatorCache .getInstance ().getMethod (loader , () -> {
878- var clazz = findFirstClassUsingStrings (loader , StringMatchType .Contains , "SELECT jid, pinned_time FROM settings " );
878+ var clazz = findFirstClassUsingStrings (loader , StringMatchType .Contains , "getPinnedJids/QUERY_CHAT_SETTINGS " );
879879 if (clazz == null ) throw new Exception ("PinnedList class not found" );
880880 var method = Arrays .stream (clazz .getDeclaredMethods ()).filter (m -> m .getReturnType ().equals (Set .class )).findFirst ().orElse (null );
881881 if (method == null ) throw new Exception ("PinnedHashSet method not found" );
@@ -967,6 +967,14 @@ public synchronized static Method loadNewMessageMethod(ClassLoader loader) throw
967967 var field = clazzMessage .getDeclaredField ("A02" );
968968 methodData = clazzData .findMethod (new FindMethod ().matcher (new MethodMatcher ().addUsingField (DexSignUtil .getFieldDescriptor (field )).returnType (String .class )));
969969 }
970+ if (methodData .isEmpty ()) {
971+ var csClazzData = dexkit .findClass (FindClass .create ().matcher (ClassMatcher .create ().addUsingString ("FMessageSystemScheduledCallStart/setData index out of bounds: " ))).singleOrNull ();
972+ if (csClazzData != null ) {
973+ var csClazz = csClazzData .getInstance (loader );
974+ var field = csClazz .getDeclaredField ("A02" );
975+ methodData = clazzData .findMethod (new FindMethod ().matcher (new MethodMatcher ().addUsingField (DexSignUtil .getFieldDescriptor (field )).returnType (String .class )));
976+ }
977+ }
970978 if (methodData .isEmpty ()) throw new RuntimeException ("NewMessage method not found" );
971979 return methodData .get (0 ).getMethodInstance (loader );
972980 });
@@ -1013,7 +1021,8 @@ public synchronized static Method loadGetEditMessageMethod(ClassLoader loader) t
10131021 }
10141022
10151023 // 21.xx+ method (static)
1016- if (Modifier .isStatic (invoke .getMethodInstance (loader ).getModifiers ()) && Objects .equals (invoke .getParamTypes ().get (0 ), methodData .getParamTypes ().get (0 ))) {
1024+ // 25.xx+ added additional type check
1025+ if (Modifier .isStatic (invoke .getMethodInstance (loader ).getModifiers ()) && Objects .equals (invoke .getParamTypes ().get (0 ), methodData .getParamTypes ().get (0 )) && !Objects .equals (invoke .getParamTypes ().get (0 ), invoke .getDeclaredClass ())) {
10171026 return invoke .getMethodInstance (loader );
10181027 }
10191028 }
@@ -1209,10 +1218,11 @@ public synchronized static Constructor loadSeeMoreConstructor(ClassLoader loader
12091218 var clazzData = classList .get (0 );
12101219 XposedBridge .log (clazzData .toString ());
12111220 for (var method : clazzData .getMethods ()) {
1212- if (method .getParamCount () == 2 && method .isConstructor () && method .getParamTypes ().get ( 0 ). getName (). equals ( int . class . getName ()) && method . getParamTypes (). get ( 1 ). getName ().equals (int .class .getName ())) {
1221+ if (Arrays . asList ( 2 , 3 ). contains ( method .getParamCount ()) && method .isConstructor () && method .getParamTypes ().stream (). allMatch ( c -> c . getName ().equals (int .class .getName () ))) {
12131222 return method .getConstructorInstance (loader );
12141223 }
12151224 }
1225+
12161226 throw new RuntimeException ("SeeMore constructor 2 not found" );
12171227 });
12181228 }
@@ -1549,20 +1559,24 @@ public synchronized static Method loadTextStatusComposer2(ClassLoader classLoade
15491559 addMethod (MethodMatcher .create ().paramCount (1 ).addParamType (TextDataClass ))
15501560 ));
15511561 if (result .isEmpty ()) {
1552- result = dexkit .findClass (FindClass .create ().matcher (
1553- ClassMatcher .create ().addUsingString ("ViewOnce messages can not be forwarded" ).
1554- addMethod (MethodMatcher .create ().paramCount (1 ).addParamType (TextDataClass ))
1555- ));
1556- if (result .isEmpty ()) {
1557- throw new RuntimeException ("TextStatusComposer2 class not found" );
1562+ var tscClazzData = dexkit .getClassData ("com.whatsapp.statuscomposer.composer.TextStatusComposerFragment" );
1563+ if (tscClazzData != null ) {
1564+ for (var method : tscClazzData .getMethods ()) {
1565+ var tdMethod = method .getInvokes ().stream ().filter (m -> m .isMethod () && m .getParamCount () == 1 && m .getParamTypes ().get (0 ).equals (dexkit .getClassData (TextDataClass ))).findFirst ();
1566+ if (tdMethod .isPresent ()) {
1567+ return tdMethod .get ().getMethodInstance (classLoader );
1568+ }
1569+ }
15581570 }
1571+
1572+ throw new RuntimeException ("TextStatusComposer2 class not found 1" );
15591573 }
15601574
15611575 var foundClass = result .get (0 ).getInstance (classLoader );
15621576 var resultMethod = ReflectionUtils .findMethodUsingFilter (foundClass , method -> method .getParameterCount () == 1 && method .getParameterTypes ()[0 ] == TextDataClass );
15631577 if (resultMethod != null )
15641578 return resultMethod ;
1565- throw new RuntimeException ("TextStatusComposer2 method not found" );
1579+ throw new RuntimeException ("TextStatusComposer2 method not found 2 " );
15661580 });
15671581 }
15681582
0 commit comments