The background is :
- I'm using xposed framework to hook a third party app.
- When I hook method XXX, xposed gave me "ClassNotFound" error. I checked and found the method XXX is in a dex file and would be loaded by DexClassLoader on the run.
- To hook the method XXX, I need to change the default ClassLoader in xposed to
DexClassLoader
. To get a DexClassLoader
instance, I need a Context instance of the third party app.
- Here comes the question: how to get the context instance?
I searched stackoverflow and found someone said you can hook the method in Activity or Receiver to retrieve their context. But I checked the Activity.class and found no method that return Context type value, and only one method has Context type parameter, the onCreateView(String name, Context context, AttributeSet attrs)
.
Is there any way to get the Context?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…