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

No sources given error while running from command line

Open Nismirno opened this issue 3 years ago • 2 comments

I tried to run BCV from command line to decompile some jars but kept running into error: no sources given message. After getting into the source code and running it in debug mode I have noticed that this line of code

JarUtils.saveAsJarClassesOnly(BytecodeViewer.getLoadedClasses(), tempZip.getAbsolutePath());

runs before BCV has loaded any classes as it is happens in BytecodeViewer::openFiles().

After changing the code in that way I got decompilation from command line working

BytecodeViewer.openFiles(new File[]{input}, false);
Thread.sleep(5 * 1000);
JarUtils.saveAsJarClassesOnly(BytecodeViewer.getLoadedClasses(), tempZip.getAbsolutePath());

Is this a bug or am I using CLI in some wrong way?

Nismirno avatar Jul 05 '22 15:07 Nismirno

Hi, Any news on this? I can't decompile anything from command line because of this... Thanks.

mora-phi avatar May 21 '24 14:05 mora-phi

Hi, Any news on this? I can't decompile anything from command line because of this... Thanks.

Will try to come up with a fix for this, cheers!

Konloch avatar May 21 '24 14:05 Konloch