2.9.7 preview

This commit is contained in:
Konloch 2015-07-06 09:39:32 -06:00
parent ca1cad8c6f
commit 881c405101
2 changed files with 24 additions and 16 deletions

Binary file not shown.

View file

@ -32,6 +32,7 @@ import javax.swing.text.html.HTMLEditorKit;
import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.Resources; import the.bytecode.club.bytecodeviewer.Resources;
import the.bytecode.club.bytecodeviewer.Settings;
import me.konloch.kontainer.io.HTTPRequest; import me.konloch.kontainer.io.HTTPRequest;
/** /**
@ -110,6 +111,7 @@ public class BootScreen extends JFrame {
setTitle("Bytecode Viewer Boot Screen - Checking Libraries..."); setTitle("Bytecode Viewer Boot Screen - Checking Libraries...");
File libsDirectory = new File(BytecodeViewer.libsDirectory);
try { try {
int completedCheck = 0; int completedCheck = 0;
@ -126,7 +128,6 @@ public class BootScreen extends JFrame {
return; return;
} }
File libsDirectory = new File(BytecodeViewer.libsDirectory);
if(args.length >= 1) if(args.length >= 1)
if(args[0].equalsIgnoreCase("-clean")) if(args[0].equalsIgnoreCase("-clean"))
libsDirectory.delete(); libsDirectory.delete();
@ -221,29 +222,36 @@ public class BootScreen extends JFrame {
setTitle("Bytecode Viewer Boot Screen - Loading Library " + f.getName()); setTitle("Bytecode Viewer Boot Screen - Loading Library " + f.getName());
System.out.println(f.getName()); System.out.println(f.getName());
JarFile jarFile = new JarFile(s); try {
Enumeration<JarEntry> e = jarFile.entries(); JarFile jarFile = new JarFile(s);
ClassPathHack.addFile(f); Enumeration<JarEntry> e = jarFile.entries();
while (e.hasMoreElements()) { ClassPathHack.addFile(f);
JarEntry je = (JarEntry) e.nextElement(); while (e.hasMoreElements()) {
if(je.isDirectory() || !je.getName().endsWith(".class")){ JarEntry je = (JarEntry) e.nextElement();
continue; if(je.isDirectory() || !je.getName().endsWith(".class")){
} continue;
try { }
String className = je.getName().substring(0,je.getName().length()-6); try {
className = className.replace('/', '.'); String className = je.getName().substring(0,je.getName().length()-6);
ClassLoader.getSystemClassLoader().loadClass(className); className = className.replace('/', '.');
} catch(java.lang.VerifyError | java.lang.ExceptionInInitializerError | java.lang.IncompatibleClassChangeError | java.lang.NoClassDefFoundError | Exception e2) { ClassLoader.getSystemClassLoader().loadClass(className);
//ignore } catch(java.lang.VerifyError | java.lang.ExceptionInInitializerError | java.lang.IncompatibleClassChangeError | java.lang.NoClassDefFoundError | Exception e2) {
//ignore
}
} }
jarFile.close();
} catch(java.util.zip.ZipException e) {
e.printStackTrace();
f.delete();
BytecodeViewer.showMessage("Error, Library " + f.getName() + " is corrupt, please restart to redownload it.");
} }
jarFile.close();
} }
} }
} }
setTitle("Bytecode Viewer Boot Screen - Booting!"); setTitle("Bytecode Viewer Boot Screen - Booting!");
} catch(Exception e) { } catch(Exception e) {
Settings.saveGUI();
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw)); e.printStackTrace(new PrintWriter(sw));
e.printStackTrace(); e.printStackTrace();