BeautifulJava is a tool meant to help with reversing the source code from the game Project Zomboid.
Once setup properly, BeautifulJava will do the following for you:
- Grab the Java class files from Project Zomboid folder
- Decompile them using the Java decompiler from IntelliJ
- Rename missing symbols (such as var1, var2, var3, etc), based on their type.
Obviously you need Project Zomboid installed:
To configure BeautifulJava, you'll have to find the path to Zomboid install folder. Open Steam, go to your Library section, right-click the game Project Zomboid, select Properties..., choose LOCAL FILES, then click the Browse... button. Open the properties of any file available in the window that just opened and copy its location.
This is the path you'll have to set for ZOMBOID when configuring BeautifulJava.
You also have to install IntelliJ Community Edition. BeautifulJava is using IntelliJ for disassembling and formatting the code. It can be downloaded from here:
https://www.jetbrains.com/idea/download/
Remember the location where you install IntelliJ. This is the path you'll have to set for INTELLIJ when configuring BeautifulJava.
-
Install Git:
sudo apt install git
- Install XCode: https://developer.apple.com/xcode/
- Install Git Bash: https://gitforwindows.org/
- Install Notepad++: https://notepad-plus-plus.org/downloads/
Once you've got Zomboid, IntelliJ, and the prerequisites for your operating system installed, you can proceed to installing BeautifulJava.
Start a Bash interpreter (or Git Bash). If you want to checkout the code using git, run the following commands:
cd "${HOME}"
git clone https://github.com/quarantin/beautiful-java
If you prefer you can download BeautifulJava as a Zip archive:
cd "${HOME}"
wget https://github.com/quarantin/beautiful-java/releases/download/0.0.1/BeautifulJava.zip
unzip BeautifulJava.zip
Type the following commands:
cd "${HOME}/beautiful-java"
cp resources/config.txt.example config.txt
Edit the file config.txt according to your setup. You have to identify the section for your operating system, and remove the ';' character in front of the lines starting with INTELLIJ and ZOMBOID. Replace the paths with the values from previous steps. When done, just save the file and quit the editor.
vim config.txt
open -a TextEdit config.txt
start notepad++ config.txt
To run BeautifulJava, type the following commands and wait for the script to finish. It should take at minimum a few minutes:
cd "${HOME}/beautiful-java/"
./BeautifulJava
Once the script has finished running, the Java source files should be available in this folder:
${HOME}/beautiful-java/pz/
or if you decompiled the server part of Zomboid:
${HOME}/beautiful-java/pzserver/
If you installed BeautifulJava using git, you can update the code as follow:
cd "${HOME}/beautiful-java/"
./bin/update
Otherwise you can uninstall BeautifulJava and start over the install process.
To uninstall BeautifulJava, simply delete beautiful-java folder:
cd "${HOME}"
rm -rf beautiful-java
Please report bugs here.