Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LSPlant in zygisk modules #53

Closed
nitanmarcel opened this issue Oct 26, 2023 · 5 comments
Closed

Use LSPlant in zygisk modules #53

nitanmarcel opened this issue Oct 26, 2023 · 5 comments

Comments

@nitanmarcel
Copy link

Is it possible to integrame LSPlant in an zygisk module? I tried searching for way of doing it but I can't seem to find an optimal way of doing it. Is there a way to maybe use it in an ndk project and statically include lsposed in the zygisk library?

@BryanGIG
Copy link

Yes, you can use LsPlant in zygisk module

You just have to init LsPlant in your native and use java hook api such as Maple or anything else to be able hook from java

I've tried it, and it works

@yujincheng08
Copy link
Member

LSPosed is also one example.

@nitanmarcel
Copy link
Author

Yes, you can use LsPlant in zygisk module

You just have to init LsPlant in your native and use java hook api such as Maple or anything else to be able hook from java

I've tried it, and it works

Won't that mean that I somehow have to load the dex with the java side of hooks into the process from zygisk.so?

That's where I'm confused, Maple and some of the similar projects creates it's own zygisk.so file so I won't be able to load the hooks defined in java in the process. Or am I? Maybe I'm just setting up my projects in the wrong way.

@BryanGIG
Copy link

BryanGIG commented Oct 26, 2023

Won't that mean that I somehow have to load the dex with the java side of hooks into the process from zygisk.so?

Yes, you need to load dex into your targeted process,

That's where I'm confused, Maple and some of the similar projects creates it's own zygisk.so file so I won't be able to load the hooks defined in java in the process. Or am I? Maybe I'm just setting up my projects in the wrong way.

You just need to take the java library and register the native function to your own zygisk.so, then you can call lsplant api from it

As, @yujincheng08 said, LSPosed can be reference for this implementation

@nitanmarcel
Copy link
Author

Ah, thanks to both.

Idk why I had the idea that LSPosed doesn't use LSPatch and they are different implementations for the same thing. Anyway looking a little more carefully at the lsposed repo I got a good example on how to use it in my own project.

Thanks, I appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants