Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisTestUser committed Sep 11, 2018
1 parent efd0ee4 commit a4a7b01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit a4a7b01

Please sign in to comment.