Skip to content

Commit c94e7e7

Browse files
committed
Fix File Chooser Selected Folder
1 parent 0192839 commit c94e7e7

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
* + Add stackmapframes to bytecode decompiler
101101
* + Add https://github.com/exbin/bined as the replacement Hed Viewer/Editor
102102
* + Make the decompilers launch in a separate process
103-
* + Make it use that global last used file folder inside of export as jar
104103
* + Make zipfile not include the decode shit
105104
* + Add decompile as zip for krakatau-bytecode, jd-gui and smali for CLI
106105
* + Add decompile all as zip for CLI

src/main/java/the/bytecode/club/bytecodeviewer/Configuration.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import the.bytecode.club.bytecodeviewer.translation.Language;
77

88
import java.io.File;
9+
import java.io.IOException;
910

1011
/***************************************************************************
1112
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
@@ -118,7 +119,14 @@ public static File getLastSaveDirectory()
118119
if(lastDir.getParentFile() != null && lastDir.getParentFile().exists())
119120
return lastDir;
120121

121-
return new File(".");
122+
try
123+
{
124+
return new File(".").getCanonicalFile();
125+
}
126+
catch (IOException e)
127+
{
128+
return new File(".");
129+
}
122130
}
123131

124132
public static File getLastPluginDirectory()

src/main/java/the/bytecode/club/bytecodeviewer/gui/components/FileChooser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public FileChooser(boolean skipFileFilter, File file, String title, String descr
4444
HashSet<String> extensionSet = new HashSet<>(Arrays.asList(extensions));
4545

4646
try {
47-
setSelectedFile(file);
47+
if(file.isDirectory())
48+
setCurrentDirectory(file);
49+
else
50+
setSelectedFile(file);
4851
} catch (Exception ignored) { }
4952

5053
setDialogTitle(title);

0 commit comments

Comments
 (0)