OnePlus 2 Forums: Discuss Everything About The OP2!

Now that the OnePlus 2 has been officially unveiled and that we have had close-up … more

Intel & Micron Announce “Revolutionary” Storage Tech

Intel & Micron have announced 3D Xpoint technology—”the … more

Google Now Interfaces With Third-Party Messaging Apps

Google has announced that Ok Google voice commands can now be used to send … more

Make Your Lockscreen More Productive With Widgets

Are you running Android Lollipop? Do you miss the ability to add widgets to your lock … more

Getting object from field from hook of a static method

1,418 posts
Thanks Meter: 1,704
By hamzahrmalik, Senior Member on 18th August 2014, 03:14 PM
Post Reply Subscribe to Thread Email Thread
I'm hooking a static method within class A
Class A contains a Context, mContext

i need to get the mContext
cannot use Xposedhelpers.getObjectField because i can't get param.thisObject so have nothing to pass to it
And i cant use

Class<?> clazz = XposedHelpers.findClass(LockPatternUtils, lpparam.classLoader);
Field f = clazz.getDeclaredField("mContext");
c = (Context) f.get(what to pass here);

because i cant use the
method, because i dont know what to pass
help is appreciated, thanks
Last edited by hamzahrmalik; 18th August 2014 at 03:20 PM.
18th August 2014, 05:46 PM |#2  
GermainZ's Avatar
Forum Moderator / Recognized Developer / XDA Portal Team
Thanks Meter: 8,325
You can't access non static fields from a static method. You'll have to find an alternative way.
The Following User Says Thank You to GermainZ For This Useful Post: [ View ]
18th August 2014, 07:59 PM |#3  
hamzahrmalik's Avatar
OP Senior Member
Thanks Meter: 1,704
Donate to Me
Originally Posted by GermainZ

You can't access non static fields from a static method. You'll have to find an alternative way.

OK, thanks

Sent from my amazingly awesome OnePlus One using Tapatalk
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes