Reverse Engineering from BAR files to create Application Projects

In real time projects when working on a large team, it is the duty of the developers to regularly commit their work to the repository (SVN/GIT) to ensure they maintain everything in place, version control and avoid conflicts upon merge due to parallel developments.

However, in times of a repository/workspace crash it becomes impossible to fetch the last deployed project version for the developer to work on enhancements/bug fixes/change requests as we need to recreate the Application structure.

The only artifact available to the developer is the last deployed BAR file which is present to the server.

Problem Statement

Application Project contents are lost due to repository crash or workspace issue. We need to recreate the Application projects from last deployed BAR file.

Suggested Solution

  • Rename the .bar extension to .zip to unzip the Broker Archive package.
  • Use WinZip or 7zip to extract the contents of the package.
  •  
  • Inside the extracted folder, we can find a *.appzip file. Change *. appzip to *.zip and perform another unzip operation.
  • The highlighted contents below are the artifacts which needs to be included in the Application project.
  • Create a new application in IIB toolkit with the same name as the extracted appzip folder.
  • Right click on the newly created Application and select Import -> File System (Under General) -> Select the location of the folder from the extracted appzip file done in the above steps.

This completes the creation of the Application project from a bar file.

If your Application has java projects, the Bar file stores the related java files as a *.jar file.

The steps to extract the *.java files from *.jar files are below,

  • Use Java Decompile Online (http://www.javadecompilers.com/) to extract the java files from jar files.
  • Choose the location of the jar file in your local computer using the browse button.
  • Click Upload and Decompile button to create the java files from the jar file.
  • Use the save button to save the java files to your local system.
  • Once the decompile process is done, go to the location of your jar file and convert the *.jar to *.zip and unzip the contents.
  • Copy the java files created from the decompile process and place it inside the extracted java folder. Ensure the *.class files and META-INF folder is deleted.
  • In the IIB toolkit, Right click on Application development view, New -> Other -> Java Project.
  • The name of the java project should be the same as the folder name after extraction of the jar file (in this case, VCCIS040-partsdataJava)
  • Creating the Java project will switch your perspective to Java, Right click on the java project just created and select Import -> File System (Under General) -> Select the location of the Java folder from the extracted jar file done in the above steps.
  • Ensure the necessary dependencies are added to the java project by configuring the Java Build Path. (Right Click on the Java Project -> Properties -> Java Build Path)
  • Finally, add the Java project to the Application as Project References (Right Click on Application -> Manage Included Project -> Check the Java Project)

Note: Ensure the project does not throw any compile errors and deploys successfully after the reverse engineering process.

What to do next

Royal Cyber has many solutions lined up and is paving the way for resolving problems with exceptional techniques and technologies used.  For more information email us at info@royalcyber.com or visit www.royalcyber.com.

By Surendhar P