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

Is there an easy way to replace chaquopys runtime jar? #1337

Open
zekrom567 opened this issue Feb 25, 2025 · 4 comments
Open

Is there an easy way to replace chaquopys runtime jar? #1337

zekrom567 opened this issue Feb 25, 2025 · 4 comments

Comments

@zekrom567
Copy link

I'm investigating away to do modifications on the app.imy before the app is ran. So, I created a runtime.jar from chaquopy that unzips and replaces a string in my code to test

@zekrom567 zekrom567 changed the title Is there an eassy way to replace chaquopys runtime jar? Is there an easy way to replace chaquopys runtime jar? Feb 25, 2025
@mhsmith
Copy link
Member

mhsmith commented Feb 26, 2025

What kind of modifications? Is it for security or obfuscation purposes, or something else?

@zekrom567
Copy link
Author

A mix of both but mostly for obfuscation purposes

@mhsmith
Copy link
Member

mhsmith commented Mar 1, 2025

In that case, you'd probably want to modify the code during the build, not at runtime. You can do that as follows:

  • Store the original copy of your code in a different directory.
  • In your build.gradle file, add an afterEvaluate block like this one, which copies the code to src/main/python while doing whatever obfuscation you want.

@mhsmith
Copy link
Member

mhsmith commented Mar 1, 2025

I've now added this to the obfuscation FAQ.

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

2 participants