The Bytecode Club
Log inJoin the club
Programming

πŸ› Fernflower not renaming fields/methods

Started by sothatsit Β· May 10, 2015

19 replies326,848 views
May 10, 2015#1

Hey,

I am new to the Java Reverse Engineering scene and have started out using FernFlower.

I am currently working on a project which simply decompiles and refactors a jar. It is all going well except for one major issue: It doesnt rename the fields/methods when they are declared, it does when they are referenced but not when they are declared.

For example:
My renaming class will rename field "aa" to "String_1"
I will end up with this:
String aa;

class_13(String someString) {
String_1 = someString;
}

This is obviously not ideal.

I have tried looking through the source code of FernFlower but i cannot find the issue.

I have emailed fernflower.decompiler@gmail.com but have not recieved a reply as of yet and thought it would be worth looking for help elsewhere.

I hope you can help me out,

Thanks πŸ™‚

May 10, 2015#2

are you using the orginal fernflower or the one jetbrains stole and claimed as their own?
**edit: ** not changing this edit snip

Spoiler

![](http://i..com/485bLTI)

May 10, 2015#3

are you using the orginal fernflower or the one jetbrains stole and claimed as their own?

I am using the fernflower from https://github.com/fesh0r/fernflower. I have just cloned and built it.

May 10, 2015#4

you could use proguard or retroguard to rename the fields or make your own field renamer (methods are a bit tricker).

May 10, 2015#5

you could use proguard or retroguard to rename the fields or make your own field renamer (methods are a bit tricker).

Like, editing the bytecode?

May 11, 2015#6

@Bibl do you know any libraries which can provide an api for editing java bytecode?

May 14, 2015#8

just tried fernflower and the same thing is happening for me, guess you should rename with proguard or retroguard.

May 15, 2015#9

just tried fernflower and the same thing is happening for me, guess you should rename with proguard or retroguard.

I think I'm actually going to use asm to edit the bytecode to rename the fields/methods/classes. This is good because then I don't have to recompile the source code afterwards. Thanks for your help πŸ™‚

May 16, 2015#10

sothatsit wrote:

Bibl wrote:

just tried fernflower and the same thing is happening for me, guess you should rename with proguard or retroguard.

I think I'm actually going to use asm to edit the bytecode to rename the fields/methods/classes. This is good because then I don't have to recompile the source code afterwards. Thanks for your help πŸ™‚

nono, you can run retroguard it and the classes are renamed (still in classfile form)
i'm working on one with asm at the moment that doesnt rely on the asm visitors
http://hastebin.com/aqocujidaj.java

Got something to add?

Log in to post a reply.

Join the conversation