Continuing the series Hacking Infor Grid application development, today I will show: how to decompile Java applications, how to write to the Grid application log files, how to read Grid application properties, how to secure the Java web application, and how to start playing with the HelloWorld app on GitHub. Remember this is currently a hack, it is at your own risk, there are limitations as discussed on part 1, and please join the campaign and sign the petition to Infor Product Development for making their source code available. The intention is to learn the internals of the applications we use every day, push their limits, and develop great software.
Decompile Java applications
First of all, check your licenses to determine if you are legally allowed to decompile the Java application you have in mind.
For this series I decompiled the Infor Grid core
grid-core-1.11.27.jar to understand how to write to the Grid application log files and how to get Grid application properties. I also often decompile applications like M3_UI_Adapter (MNE), Event Hub, M3 Web Services, and Infor Process Automation to understand how they work, make enhancements, troubleshoot, and find bugs. All the JAR files are located in LifeCycle Manager at
E:\Infor\LifeCycle\<host>\grid\<grid>\grids\<grid>\applications\. It is already common practice to decompile Infor Smart Office with RedGate Reflector (C#) to push the limits of Smart Office scripts and Smart Office SDK applications. I wish the source code of all applications were available.
For decompiling Java applications, I use the great Java Decompiler and its GUI. I simply drag and drop a JAR file and it automatically decompiles all files recursively:
Write to Grid application log files
To write to the Grid application log files, get the logger and log at the information, warning, error, debug, or trace levels:
import com.lawson.grid.util.logging.GridLogger; [...] private static final GridLogger log = GridLogger.getLogger(HelloWorld.class); [...] log.info("Yay, I'm writing to the log file :)"); log.warn("Hey, it feels hot in here!"); log.error("Ouch, that hurt :("); log.debug("Useful data 48656C6C6F576F726C64"); log.trace("Wooohooo 01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 00100001");
Read Grid application properties
Declare Grid application properties in the application deployment descriptor
<property name="message">Hello Wrrrld!</property>
Then, read the properties with:
import com.lawson.grid.node.properties.GridProperties; [...] GridProperties p = ModuleContext.getCurrent().getProperties(); String message = p.getProperty("message"); log.info("The message is: " + message);
Secure Java web application
To secure the Java web application in
<security-constraint> <web-resource-collection> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>grid-user</role-name> </auth-constraint> </security-constraint>
Restart the application.
HelloWorld app on GitHub
I published the HelloWorld Grid application source code on my GitHub repository so you can play along, learn, and contribute your code, and I added tags – part1, part2, part3, and part4 – so you can download the source code that corresponds to the desired part in this series:
That was an illustration of how to decompile Java applications, how to write to the Grid application log files, read Grid application properties, secure the Java web application, and start playing with the HelloWorld app on GitHub. Remember to play responsibly, know the limitations, sign the petition, and contribute your findings to the community.
That’s it! If you liked this, please click Like, write your comments, click Follow to subscribe to the blog, share around you, and author your own ideas. Thank you.