diff --git a/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java b/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java index 875a314..8c760da 100644 --- a/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java +++ b/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java @@ -30,6 +30,7 @@ import com.javadeobfuscator.deobfuscator.ui.wrap.WrapperFactory; import java.awt.GridBagLayout; +import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.Insets; import java.awt.Toolkit; @@ -869,6 +870,9 @@ public void run() PrintWriter writer = new PrintWriter(stringWriter); e.printStackTrace(writer); textPane.setText(stringWriter.toString()); + Toolkit toolkit = Toolkit.getDefaultToolkit(); + Dimension screenSize = toolkit.getScreenSize(); + newFrame.setLocation((screenSize.width - newFrame.getWidth()) / 2, (screenSize.height - newFrame.getHeight()) / 2); newFrame.setVisible(true); } deob.clearClasses(); diff --git a/src/java/com/javadeobfuscator/deobfuscator/ui/wrap/WrapperFactory.java b/src/java/com/javadeobfuscator/deobfuscator/ui/wrap/WrapperFactory.java index d372ddd..51fffff 100644 --- a/src/java/com/javadeobfuscator/deobfuscator/ui/wrap/WrapperFactory.java +++ b/src/java/com/javadeobfuscator/deobfuscator/ui/wrap/WrapperFactory.java @@ -103,6 +103,23 @@ private static ByteLoader iter(File dir, boolean recurse) { if (files == null) { return null; } + // check for common names + File deobfuscator = new File(dir, "deobfuscator.jar"); + File deobfuscator100 = new File(dir, "deobfuscator-1.0.0.jar"); + if(deobfuscator.exists()) + try { + ByteLoader v = fromJar(deobfuscator); + if (v != null) { + return v; + } + } catch (IOException e) {} catch (InvalidJarException e) {} + if(deobfuscator100.exists()) + try { + ByteLoader v = fromJar(deobfuscator100); + if (v != null) { + return v; + } + } catch (IOException e) {} catch (InvalidJarException e) {} for (File file : files) { // check sub-dirs if (recurse && file.isDirectory()) {