Git Product home page Git Product logo

Comments (6)

theknut avatar theknut commented on September 26, 2024

Can you provide a sample code?
Am 04.09.2014 10:57 schrieb "someonec" [email protected]:

My Issue is quite strage.

I am working on a Wechat Plugin. The origin app has an extra dex file in
it's folder app_dex

which can be called plugin-dex. The plugin-dex contains some activities
and UIs and

what I want to hook is in the plugin-dex.

when the app package was loaded, Xposed cant find the UI class, but
startActivity(myUI Intent) is

able to launch.

Perhaps the two dex file in the same app are not loaded at one time ,How
can I use Xposed to

solve the problem?


Reply to this email directly or view it on GitHub
#230.

from xposedinstaller.

someonec avatar someonec commented on September 26, 2024

Thanks for your focus.

Sorry I can't copy out some code to the browser because the disk is under a sandbox protection.

When I used findandhookmethod , it's able to hook classes in classe-dex but not in plugin-dex.

After I hook the launch class in classes-dex,I parsed param.thisObject to activity and lauch the aim class nearbyUI in plugin-dex successfully.

But when I hook the aim class directly , Xposed loged cant find the aim class.

Have you ever seen this situation ,One app have multiple dex file and Xposed can only hook classes in one dex?

------------------ 原始邮件 ------------------
发件人: "theknut";[email protected];
发送时间: 2014年9月4日(星期四) 下午5:00
收件人: "rovo89/XposedInstaller"[email protected];
抄送: "Keith Lee"[email protected];
主题: Re: [XposedInstaller] Xposed can not find class (#230)

Can you provide a sample code?
Am 04.09.2014 10:57 schrieb "someonec" [email protected]:

My Issue is quite strage.

I am working on a Wechat Plugin. The origin app has an extra dex file in
it's folder app_dex

which can be called plugin-dex. The plugin-dex contains some activities
and UIs and

what I want to hook is in the plugin-dex.

when the app package was loaded, Xposed cant find the UI class, but
startActivity(myUI Intent) is

able to launch.

Perhaps the two dex file in the same app are not loaded at one time ,How
can I use Xposed to

solve the problem?


Reply to this email directly or view it on GitHub
#230.


Reply to this email directly or view it on GitHub.

from xposedinstaller.

rovo89 avatar rovo89 commented on September 26, 2024

Have you ever seen this situation ,One app have multiple dex file and Xposed can only hook classes in one dex?

Xposed can hook any class - if you're using the correct ClassLoader. Most likely, the app creates an additional ClassLoader to load classes from the other dex files. So if you're using lpparam.classLoader, it probably doesn't know that the class exists. If you use the custom ClassLoader for findAndHookMethod, it should work.
It might also be possible that apps manipulate their primary ClassLoader, I think Facebook did/does this. Then you could hook the class only after the manipulation was done.

from xposedinstaller.

theknut avatar theknut commented on September 26, 2024

How would one be able to get the other class loader?
Am 04.09.2014 19:20 schrieb "rovo89" [email protected]:

Have you ever seen this situation ,One app have multiple dex file and
Xposed can only hook classes in one dex?

Xposed can hook any class - if you're using the correct ClassLoader. Most
likely, the app creates an additional ClassLoader to load classes from the
other dex files. So if you're using lpparam.classLoader, it probably
doesn't know that the class exists. If you use the custom ClassLoader for
findAndHookMethod, it should work.
It might also be possible that apps manipulate their primary ClassLoader,
I think Facebook did/does this. Then you could hook the class only after
the manipulation was done.


Reply to this email directly or view it on GitHub
#230 (comment)
.

from xposedinstaller.

rovo89 avatar rovo89 commented on September 26, 2024

Indirectly... depends on the application. I would suggest looking for class reachable from the primary ClassLoader which has access to a class or instance of the secondary ClassLoader. Then you could get the ClassLoader with reflection.

from xposedinstaller.

someonec avatar someonec commented on September 26, 2024

Hi rovo89,

Thank you for your help.

I'm glad to tell you that it works.

Finally I found the custom ClassLoader and hooked it, and then use findandhookmethod and

findstaticobjectfield to foreach ‍the aim list-field .

You did good job!

Cheers,

------------------ 原始邮件 ------------------
发件人: "rovo89";[email protected];
发送时间: 2014年9月5日(星期五) 凌晨1:20
收件人: "rovo89/XposedInstaller"[email protected];
抄送: "Keith Lee"[email protected];
主题: Re: [XposedInstaller] Xposed can not find class (#230)

Have you ever seen this situation ,One app have multiple dex file and Xposed can only hook classes in one dex?

Xposed can hook any class - if you're using the correct ClassLoader. Most likely, the app creates an additional ClassLoader to load classes from the other dex files. So if you're using lpparam.classLoader, it probably doesn't know that the class exists. If you use the custom ClassLoader for findAndHookMethod, it should work.
It might also be possible that apps manipulate their primary ClassLoader, I think Facebook did/does this. Then you could hook the class only after the manipulation was done.


Reply to this email directly or view it on GitHub.

from xposedinstaller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.