Android example #567
Replies: 5 comments 9 replies
-
Android does not use classfiles at time of deployment, therefore ClassGraph cannot be used. However, ClassGraph can be used at build time in Android projects, before the compiled code is converted from Java bytecodes to Dalvik bytecodes. This is documented here: https://github.com/classgraph/classgraph/wiki/Build-Time-Scanning |
Beta Was this translation helpful? Give feedback.
-
I have found it after asking the question here. The sample did not compile I had to modify it:
That's why it's better to have a sample on github with gradle version java version and everything else specified. Also I see it cannot access files not in my sources. |
Beta Was this translation helpful? Give feedback.
-
It used to work, so probably Gradle or Android changed, or something... and the same exact bitrot can happen just as easily with sample projects. I don't actively work on Android anymore, as of several years ago. You are welcome to set up your own example project on GitHub for people to discover. But honestly there seems to be very little demand for scanning classes in Android projects -- I get about one question per year about this. I can update the build-time scanning page though. Thanks for the working example! |
Beta Was this translation helpful? Give feedback.
-
i have updated my gradle script to pick the aapt2 dynamically based on user's sdk directory, now the manual path setup is not required, below is tested and found working, you can update the wiki accordingly
|
Beta Was this translation helpful? Give feedback.
-
@HashirLabs Nice work! Thanks, I updated the wiki. |
Beta Was this translation helpful? Give feedback.
-
Please provide a sample showing what is possible on Android.
Beta Was this translation helpful? Give feedback.
All reactions