@@ -205,11 +205,17 @@ public synchronized static Method loadGhostModeMethod(ClassLoader classLoader) t
205205
206206 public synchronized static Method loadReceiptMethod (ClassLoader classLoader ) throws Exception {
207207 return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
208- Method [] methods = findAllMethodUsingStrings (classLoader , StringMatchType .Equals , "receipt" );
209- var deviceJidClass = XposedHelpers .findClass ("com.whatsapp.jid.DeviceJid" , classLoader );
210- Method bestMethod = Arrays .stream (methods ).filter (method -> method .getParameterTypes ().length > 1 && method .getParameterTypes ()[1 ] == deviceJidClass ).findFirst ().orElse (null );
211- if (bestMethod == null ) throw new Exception ("Receipt method not found" );
212- return bestMethod ;
208+ var methods = dexkit .findMethod (
209+ FindMethod .create ()
210+ .matcher (MethodMatcher .create ().addUsingString ("receipt" )
211+ .paramCount (2 , 6 )
212+ .paramTypes (null , "com.whatsapp.jid.DeviceJid" , null , null , null , null )
213+ )
214+ );
215+ if (methods .isEmpty ())
216+ throw new NoSuchMethodError ("Receipt method not found" );
217+
218+ return methods .get (0 ).getMethodInstance (classLoader );
213219 });
214220 }
215221
@@ -341,7 +347,7 @@ public synchronized static Method loadHideViewSendReadJob(ClassLoader classLoade
341347 public synchronized static Method loadHideViewInChatMethod (ClassLoader classLoader ) throws Exception {
342348 return UnobfuscatorCache .getInstance ().getMethod (classLoader , () -> {
343349 var strings = new String []{
344- "ReadReceipts/sendDeliveryReadReceipt" , "ReadReceipts/acknowledgeMessageIfNeeded" , "ReadReceipts/sendDeliveryReceiptIfNotRetry"
350+ "ReadReceipts/sendReceiptForIncomingMessage" , "ReadReceipts/ sendDeliveryReadReceipt" , "ReadReceipts/acknowledgeMessageIfNeeded" , "ReadReceipts/sendDeliveryReceiptIfNotRetry"
345351 };
346352 for (var s : strings ) {
347353 var method = findFirstMethodUsingStrings (classLoader , StringMatchType .Contains , s );
0 commit comments