Konloch / bytecode-viewer

A Java 8+ Jar & Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger & More)
https://bytecodeviewer.com
GNU General Public License v3.0
14.72k stars 1.15k forks source link

For FernFlower, some functions can be decompiled in class view but not in exported archive #523

Open Nambers opened 3 weeks ago

Nambers commented 3 weeks ago

It has several $ inner .class files, maybe that's the cause. This happened when I decompile lib jar of AppsFlyer. I'll try to find a minimal reproducible example.

ENV:

Konloch commented 3 weeks ago

Hi, thanks for the report. Just to double check, this bug happens when you use File->Save as Zip - but doesn't happen when you manually open a Classfile from within BCV?

Bl3nd commented 3 weeks ago

Hi, thanks for the report. Just to double check, this bug happens when you use File->Save as Zip - but doesn't happen when you manually open a Classfile from within BCV?

I was just about to respond. Right now, I believe that if you decompile a full jar with fernflower, it doesn't understand that it should merge the $ classes into its main class.

Nambers commented 3 weeks ago

Hi, thanks for the report. Just to double check, this bug happens when you use File->Save as Zip - but doesn't happen when you manually open a Classfile from within BCV?

No I did decompile & save all

Hi, thanks for the report. Just to double check, this bug happens when you use File->Save as Zip - but doesn't happen when you manually open a Classfile from within BCV?

I was just about to respond. Right now, I believe that if you decompile a full jar with fernflower, it doesn't understand that it should merge the $ classes into its main class.

Gotcha. What is the recommended actions to get the best result? Do we decompile its individually at first then merge? Also, seems either vineflower or Procyon has better output.

Bl3nd commented 3 weeks ago

The only workaround I can think of is to decompile the full jar and then open whatever class has errors with BCV and copy/paste.

Nambers commented 3 weeks ago

The only workaround I can think of is to decompile the full jar and then open whatever class has errors with BCV and copy/paste.

It's so annoying that FF will have some outcome like xxx.3(xxx) and the 3 is the runnable (ig lambda) in xxx$3.class but it's nowhere in output.

Bl3nd commented 3 weeks ago

It's so annoying that FF will have some outcome like xxx.3(xxx) and the 3 is the runnable (ig lambda) in xxx$3.class but it's nowhere in output.

When you decompile the class with BCV or the whole jar?

Also, I've currently got a fernflower test working that correctly decompiles "$" inner classes. I will need to add the single class decompilation and actually saving it to disk part, so the fix will not be ready until I implement the rest of the functionality.

Nambers commented 3 weeks ago

The only workaround I can think of is to decompile the full jar and then open whatever class has errors with BCV and copy/paste.

It's so annoying that FF will have some outcome like xxx.3(xxx) and the 3 is the runnable (ig lambda) in xxx$3.class but it's nowhere in output.

When you decompile the class with BCV or the whole jar?

Also, are you clicking on the Decompile & Save All Classes? If you are, then I've currently got a fernflower test decompiler working when you use that option that correctly decompiles "$" inner classes. I will need to add the single class decompilation and actually saving it to disk part, so the fix will not be ready until I implement the rest of the functionality.

I used decompile & save all classes but Nah. In my case there isn't any xxx$ + num .java in output(anonymous or lambda). Only xxx$ + inner class name. If u are interested I can shared the jar, it's in maven anyway.

Bl3nd commented 3 weeks ago

If you have rights to it, then feel free to.

Nambers commented 3 weeks ago

If you have rights to it, then feel free to.

repo1[.]maven[.]org/maven2/com/appsflyer/af-android-sdk/6.15.1/af-android-sdk-6.15.1.aar it's the classes.jar inside it and I'm talking about f1zSDK$3