Hi team,
Kindly suggest what is the best practice to extract source code from jar or AEM bundle.
Thanks
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @upendarme1
I just want to add a note indicating that decompiling a JAR file can have legal implications depending on several factors, including the software license, and how you intend to use the decompiled code. So just be aware of that. Other than that, a bundle is just a normal JAR (with extra metadata) that can be treated like others have already replied.
You can use java decompiler and drop the bundle jar to see folders https://java-decompiler.github.io/ or JD-Eclipse is a plug-in for the Eclipse IDE which serves the same purpose.
Hello @upendarme1,
First, you can download the jar from AEM, for that
Then you can use any decompiler tool to see the Java codes. for that, you can find some tools - https://medium.com/@aashupel2023/the-best-java-decompilers-online-in-2023-517bf6f4971f
After that, you can copy and paste the original code and write your custom code.
Need to understand before customizing the code, how the bundle was previously executed by AEM.
The best approach for a large customize or bug jar is to create a separate AEM project to maintain this in the future. For smaller you can keep you project codebase in separate package.
There are multiple ways of doing it.
One way is to use this site http://www.javadecompilers.com/ and upload the jar and you can see all the classes available in jar/bundle. But Decompiled code will not be having any comments or inputs given in comments by code developer.
Hi @upendarme1
I just want to add a note indicating that decompiling a JAR file can have legal implications depending on several factors, including the software license, and how you intend to use the decompiled code. So just be aware of that. Other than that, a bundle is just a normal JAR (with extra metadata) that can be treated like others have already replied.
Views
Likes
Replies
Views
Like
Replies