April 25, 2020
Estimated Post Reading Time ~

Decompile AEM: How to get a jar from AEM

AEM development is sometimes difficult to get started due to limited documentation. By having some code examples or a clearer understanding of what is under the hood, this could be the difference from good code to great code. Having the ability to decompile a jar can be very helpful in the development process. Decompiling the jar is the easy part. Finding and getting the jar in AEM can be more difficult. There are two ways that this can be accomplished in AEM, with Vault or without Vault.
Check it out!

With Vault (vlt)

Go to http://localhost:4502/system/console/bundles
Search for webservice, click Day Communique 5 WCM Webservice Support
Notice Bundle Location copy the path after jcrinstall: (If you don't see jcrinstall, go to without vlt section)
Open CRXDE Lite and add the copied path. You should see the name of the jar inside that path
Now that the location is confirmed. Go to terminal and vlt down the jar. In my case this is what I used: vlt --credentials admin:admin co --force http://localhost:4502/crx/-/jcr:root/libs/wcm/webservice-support/install

Without Vault (vlt)
Go to http://localhost:4502/system/console/bundles
Search for webservice, click Adobe Granite Asset API Implementation
Notice Bundle Location path does not have jcrinstall:, instead it has launchpad: So we cannot easily track down the jar file in CRXDE Lite
Look at the bundle number at the left
Go to your terminal and go to /crx-quickstart/launchpad/felix/bundle84
In this case we will have to drill down into version0.0 then we see bundle.jar
Not all bundles are like this, sometimes there is a /data/install folder and that is where the jar is located
How to decompile a jar
There are a bunch of decompilers out there but I use JD-GUI
Open using JD-GUI
That's it!

Fast Method

Terminal --> /crx-quickstart/launchpad/felix
Use this command: grep -rnw . -e "com.adobe.cq.mcm.salesforce.SalesforceExportProcess"

Result:
Note:
You can supply either a package name or a jar file name


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.