intellij-community
intellij-community copied to clipboard
Field Declaration Order Fix for Fernflower
This fixes an issue I had when decompiling an obfuscated class. (testData/classes/pkg/Class8.class).
Fernflower did not properly order the fields in which the order they are initialized therefore causing the program to break.
Ex:
Output from Fernflower (no field sorting DOESNT WORK):
int anInt140 = Class126_Sub5.method1715(24) + 1;
int anInt141 = Class126_Sub5.method1715(24);
int anInt142 = Class126_Sub5.method1715(24);
int anInt143 = Class126_Sub5.method1715(8);
int anInt144 = Class126_Sub5.method1715(6) + 1;
int anInt145 = Class126_Sub5.method1715(16);
int[] anIntArray146;
Output from Fernflower (with field sorting WORKING):
int anInt145 = Class126_Sub5.method1715(16);
int anInt141 = Class126_Sub5.method1715(24);
int anInt142 = Class126_Sub5.method1715(24);
int anInt140 = Class126_Sub5.method1715(24) + 1;
int anInt144 = Class126_Sub5.method1715(6) + 1;
int anInt143 = Class126_Sub5.method1715(8);
int[] anIntArray146;
Have you submitted a contributor license agreement? If not, please download the PDF from http://www.jetbrains.org/display/IJOS/Contributor+Agreement and then print it out, sign (mention you github account name there), scan and email to [email protected]
I've just completed the required documentation and sent it in via email. I'm excited to start helping the community :)
We've received the CLA. Thanks.
Hi, you've added fdo preference to control this, any ideas when it shouldn't be turned on?
Please also add a test into SingleClassesTest with the corresponding .dec file (and preferably .java source).
@Jonatino any updates on this?
@gorrus I completely forgot about this. Looking at it now I bet there is a much more elegant solution. I will work on it soon.
Any updates on this? It would be extremely helpful to have this fix merged in because it fixes a major issue that I'm dealing with and frustratingly I'm my restricted to only using master branches... @Jonatino @gorrus
@ccarpenter04 I keep forgetting about this issue. I'll finish it within the next couple days. 👍
@Jonatino I'd really appreciate that, contact me if there's anyway that I can help. I've worked with the fernflower source in the past and have also signed the CLA here exclusively for making contributions to fernflower (although it's been a while)
@ccarpenter04 Do you have any example of .class files that current Fernflower doesn't sort fields in the order they are initialized in bytecode? Would help me with testing :)