FORUMS
Remove All Ads from XDA

[Newbie] Can't hook methods. What is the problem?

124 posts
Thanks Meter: 11
 
By MPeti1, Senior Member on 20th March 2018, 09:31 PM
Post Reply Email Thread
Hi!
I've been using Xposed for a long time and now i started to make Xposed modules, but it seems i'm doing something wrong because hooked methods' hooks never gets called.

What did i done?
-disabled instant run
-written code (you can check it here)
-created assets folder beside java and res and put here the xposed_init file (and i've written com.mpeter.asd.Tutorial in it)
-installed app to phone
-enabled module (framework is already enabled)
-rebooted
-searched for mistakes
-searched for the log - no errors (in Android Studio "Logcat" menu i filtered for "xposed:") (ok, there were errors, but they are coming from an other module)
-lost my hair

Interesting that when i tried to hook a class or a method which didn't exist in the package i wanted to hook to than i got the errors, but now i dont get any.
 
 
26th June 2018, 12:36 PM |#2  
Junior Member
Thanks Meter: 0
 
More
Hi! I recently searched some time for the xposed logs via adb logcat, too...
Check out the Logs Tab in the XposedModuleInstaller UI.
Maybe you will find your missing information there.
Good luck!
27th June 2018, 02:04 PM |#3  
Senior Member
Thanks Meter: 141
 
More
Quote:
Originally Posted by MPeti1

Hi!
I've been using Xposed for a long time and now i started to make Xposed modules, but it seems i'm doing something wrong because hooked methods' hooks never gets called.

What did i done?
-disabled instant run
-written code (you can check it here)
-created assets folder beside java and res and put here the xposed_init file (and i've written com.mpeter.asd.Tutorial in it)
-installed app to phone
-enabled module (framework is already enabled)
-rebooted
-searched for mistakes
-searched for the log - no errors (in Android Studio "Logcat" menu i filtered for "xposed:") (ok, there were errors, but they are coming from an other module)
-lost my hair

Interesting that when i tried to hook a class or a method which didn't exist in the package i wanted to hook to than i got the errors, but now i dont get any.


Try this.
Code:
if (!lpparam.packageName.equals("com.john.xmessengerprivacypremium")
                && !lpparam.packageName.equals("com.mpeter.asd"))
            return;
This is equivalent to
Code:
!(lpparam.packageName.equals("com.john.xmessengerprivacypremium")
                || lpparam.packageName.equals("com.mpeter.asd"))
Note how I changed || to && (De Morgan's laws). The code below never got executed, as the packageName couldn't have two different values at once.

Edit: just noticed this was several months old so you've probably already fixed it, but leaving this here in case anyone needs it.
The Following User Says Thank You to Vic. For This Useful Post: [ View ] Gift Vic. Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes