Col-E / Recaf

The modern Java bytecode editor
https://recaf.coley.software
MIT License
6.02k stars 465 forks source link

Saving jar changes classes which have not been edited? #49

Closed cnsgithub closed 6 years ago

cnsgithub commented 6 years ago

Hi, i noticed that saving a jar will result in a lot of changes in *.class files which have not been touched.

I only changed a single ICONST_0 to ICONST_1 in one .class file, and saved the jar. So i expected that this change is only reflected in the changed class. However most .class files have been edited.

Would it be possible to add a separate Save to each single class when something has been changed? This would make it easier to compare / see what has been changed manually compared with the genuine jar

Only change in one class: image

This class has not been touched manually: image

Thanks.. Nice tool btw :)

Col-E commented 6 years ago

So Recaf when it loads a Jar file converts all *.class files into ClassNode objects. The original bytecode is never stored anywhere. When exporting the bytecode is regenerated from these ClassNode objects.

The good news is, I have already done this in the total rewrite of Recaf. In the update the way Recaf handles file input allows for this and a bit more (Save-states will allow you to save your progress, and after changes go back to that point in time in case you messed something up).

The bad news is, the rewrite is not ready to be pushed. I was hoping to finish it in April, but college has been taking up my time and will to live. Final exams are this week and next week, so I'm going to be focusing on those for a bit. It should be out this month.

Col-E commented 6 years ago

Well, the new release is out (Its not 100% done, but nothing that won't be added over the next week or so) so this is now complete.