Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xposed: how to block a method call

I'm using Xposed to do some method hooking (for now, just for learning). I've manged to hook the method SendTextMessage (android.telephony.SmsManager), i can do some things before the call and after the call of the method, so my question is, can i do something in the before that will cause the original method not be called?

Thanks,

like image 706
Sharas Avatar asked Mar 15 '26 13:03

Sharas


2 Answers

Use this somewhere in a "before" hook to prevent call to original method

param.setResult(null);

(In a "after" hook it only changes result of original method because it was executed yet)

like image 128
defim Avatar answered Mar 18 '26 01:03

defim


You can use XC_MethodReplacement instead of XC_MethodHook to replace a call.

like image 37
Bugster Avatar answered Mar 18 '26 03:03

Bugster