Need help with Java .class decompilation > compilation


Ok, got the go ahead :)


Packing the file now and sending it to cube48.


I'll explain what I did next week, now it is time for my weekend...
 
Last edited by a moderator:
Ok, a quick rundown:


Most important: Read the thread. The whole thread. I tried to decompile the file myself using JAD and failed as JAD is quite old and not maintained anymore. Then I saw cube48 already had done this work for me and posted the source...oh well.


Next step is to get the source to compile. For that I made a new Eclipse project containing the right package, given in the source. Than I added the source to the project. Of course there are compile errors so you have to link the jar containing all the class files to your projects build path.


Clean up the errors that are left (e.g. the fully qualified package being given as org/etc instead of org.etc) and change the screen resolution values. While at it I added a switch so you could specify any resolution you wanted in the run.properties file.


I also checked the rest of the source code and (re)found the switch, that prevents the game from autoupdating (it's in the run.properties file) this is important, as otherwise your soon to be modified jar will get overwritten. I also discovered another switch (which I won't give away for now) which you have to activate as otherwise the game checks, if all the class files are unmodified and won't let you run your changes.


Last but not least open up the jar file (e.g. with 7zip) and replace the three class files your compiler has generated (3 class files because the main class uses inner classes). Delete everything in the META-INF directory but not the MANIFEST. Open the Manifest and remove all class names and sha1 hashes but leave the main class entry intact. The other entries also prevent you from running modified sources.


That's it, you are now able to run the game in different resolutions :)
 
Last edited by a moderator:
Back
Top