raphw / byte-buddy

Runtime code generation for the Java virtual machine.
https://bytebuddy.net
Apache License 2.0
6.23k stars 804 forks source link

Android Sample Application #1626

Closed jasperblues closed 5 months ago

jasperblues commented 5 months ago

Is there a sample application for Android with the various parts in place? This would greatly speed up getting started.

(Especially for folks like myself, who don't regularly develop for Android, but nonetheless need bytecode instrumentation on this platform).

raphw commented 5 months ago

Yes, it is part of the project.

raphw commented 5 months ago

https://github.com/raphw/byte-buddy/tree/master/byte-buddy-android-test

jasperblues commented 5 months ago

I saw this! However, it didn't seem to match the documentation on Gradle usage here: https://github.com/raphw/byte-buddy/blob/master/byte-buddy-gradle-plugin/android-plugin/README.md

The above guide talks about setting up a separate build target for an instrumentation module, and then applying that via a plugin during compilation.

Nonetheless thank you, I will check out the sample more closely.

jasperblues commented 5 months ago

Ah I see. There is a sample for both the compile time instrumentation and runtime usage.

I'm happy with the answer, shall I close the issue?

raphw commented 5 months ago

If your question is answered, yes.

jasperblues commented 5 months ago

Cool. Closed, and thank you. Although it took me a while to get my head around the Gradle plugin.

Possibly a stand-alone app + tutorial would help. . If I get time, I'll write a blog post for this.