Friday 17 February 2017

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)

  1. Search for webservice, click Day Communique 5 WCM Webservice Support
  2. Notice Bundle Location copy the path after jcrinstall: (If you don't see jcrinstall, go to without vlt section)
  3. Open CRXDE Lite and add the copied path. You should see the name of the jar inside that path
  4. 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)

  1. Search for webservice, click Adobe Granite Asset API Implementation
  2. Notice Bundle Location path does not have jcrinstall:, instead it has launchpad: So we cannot easily track down the jar file in CRXDE Lite
  3. Look at the bundle number at the left 
  4. 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

  1. Terminal --> /crx-quickstart/launchpad/felix
  2. 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

2 comments :

  1. I really appreciate the information shared above. It’s of great help. If someone wants to learn Online (Virtual) instructor lead live training in #VEEVA #CRM, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor-led training on #VEEVA #CRM. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ pieces of training in India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain, and UAE etc.
    Avishek Priyadarshi
    MaxMunus
    E-mail: avishek@maxmunus.com
    Skype id: avishek_2.
    Ph:(0) 8553177744 / 080 - 41103383
    http://www.maxmunus.com/

    ReplyDelete
  2. I really appreciate the information shared above. It’s of great help. MaxMunus provides Remote Support For Corporate and for Individuals. If anyone is facing any issue in his project of #VEEVA #CRM we can support them remotely , kindly Contact MaxMunus
    MaxMunus Offer World Class Industry best Consultant on #VEEVA #VEEVA. We provide end to end Remote Support on Projects. MaxMunus is successfully doing remote support for countries like India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain, and UAE etc.
    Avishek Priyadarshi
    MaxMunus
    E-mail: avishek@maxmunus.com
    Skype id: avishek_2.
    Ph:(0) 8553177744 / 080 - 41103383
    www.MaxMunus.com

    ReplyDelete