bytecode-viewer icon indicating copy to clipboard operation
bytecode-viewer copied to clipboard

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

Open Nambers opened this issue 1 year ago • 9 comments

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:

  • FF setting: all except first one(rename ambiguous)
  • Arch with Wayland
  • bytecode viewer 2.12

Nambers avatar Nov 11 '24 21:11 Nambers

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?

Konloch avatar Nov 12 '24 01:11 Konloch

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.

Bl3nd avatar Nov 12 '24 01:11 Bl3nd

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.

Nambers avatar Nov 12 '24 01:11 Nambers

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.

Bl3nd avatar Nov 12 '24 01:11 Bl3nd

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.

Nambers avatar Nov 12 '24 03:11 Nambers

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.

Bl3nd avatar Nov 12 '24 04:11 Bl3nd

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.

Nambers avatar Nov 12 '24 04:11 Nambers

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

Bl3nd avatar Nov 12 '24 04:11 Bl3nd

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

Nambers avatar Nov 12 '24 04:11 Nambers