Skip to content

Commit aab9a9e

Browse files
committed
Fix Dex2Jar Classfiles Incorrectly Showing On Windows
1 parent 15a2b4d commit aab9a9e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainerImporter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.commons.compress.archivers.zip.ZipFile;
2323
import org.apache.commons.io.FilenameUtils;
2424
import org.objectweb.asm.tree.ClassNode;
25+
import the.bytecode.club.bytecodeviewer.Constants;
2526
import the.bytecode.club.bytecodeviewer.api.ASMUtil;
2627
import the.bytecode.club.bytecodeviewer.util.FileHeaderUtils;
2728
import the.bytecode.club.bytecodeviewer.util.MiscUtils;
@@ -92,7 +93,8 @@ private void importFolder(String rootPath, File folder, boolean classesOnly) thr
9293
if (file.isDirectory())
9394
{
9495
importFolder(rootPath, file, classesOnly);
95-
} else
96+
}
97+
else
9698
{
9799
try (FileInputStream fis = new FileInputStream(file))
98100
{
@@ -136,6 +138,10 @@ public ResourceContainerImporter importAsZip() throws IOException
136138
*/
137139
public ResourceContainerImporter addUnknownFile(String name, InputStream stream, boolean classesOnly) throws IOException
138140
{
141+
// Fix incorrect paths in BCV GUI
142+
if(Constants.isWindows())
143+
name = name.replace('\\', '/');
144+
139145
//TODO remove this .class check and just look for cafebabe
140146
if (name.endsWith(".class"))
141147
return addClassResource(name, stream);

0 commit comments

Comments
 (0)