@@ -36,17 +36,21 @@ public void doHook() throws Throwable {
3636 @ SuppressLint ("ResourceType" )
3737 @ Override
3838 protected void afterHookedMethod (MethodHookParam param ) throws Throwable {
39- var fMessage = XposedHelpers .callMethod (param .thisObject , "getFMessage" );
39+ var targetObj = param .thisObject != null
40+ ? param .thisObject
41+ : param .args [1 ];
42+
43+ var fMessage = XposedHelpers .callMethod (targetObj , "getFMessage" );
4044 var userJidClass = XposedHelpers .findClass ("com.whatsapp.jid.UserJid" , classLoader );
4145 var methodResult = ReflectionUtils .findMethodUsingFilter (fMessage .getClass (), method -> method .getReturnType () == userJidClass && method .getParameterCount () == 0 );
4246 var userJid = ReflectionUtils .callMethod (methodResult , fMessage );
4347 var chatCurrentJid = WppCore .getCurrentRawJID ();
4448 if (!WppCore .isGroup (chatCurrentJid )) return ;
45- var field = ReflectionUtils .getFieldByType (param . thisObject .getClass (), grpcheckAdmin .getDeclaringClass ());
46- var grpParticipants = field .get (param . thisObject );
49+ var field = ReflectionUtils .getFieldByType (targetObj .getClass (), grpcheckAdmin .getDeclaringClass ());
50+ var grpParticipants = field .get (targetObj );
4751 var jidGrp = jidFactory .invoke (null , chatCurrentJid );
4852 var result = ReflectionUtils .callMethod (grpcheckAdmin , grpParticipants , jidGrp , userJid );
49- var view = (View ) param . thisObject ;
53+ var view = (View ) targetObj ;
5054 var context = view .getContext ();
5155 ImageView iconAdmin ;
5256 if ((iconAdmin = view .findViewById (0x7fff0010 )) == null ) {
0 commit comments