Code example for JarURLConnection

Methods: getJarFile

0
			stub.setCodeBase(srcUrl);
			stub.setDocumentBase(srcUrl);
			logger.info("Opening jar connection...");
			URL url = new URL(stub.getCodeBase() + "/"+stub.getParameter("archive"));
			JarURLConnection conn = (JarURLConnection) new URL("jar:"+url.toString()+"!/").openConnection();
			JarFile jar = conn.getJarFile();
			logger.info("Jar connection opened. Loading jar archive...");
 
			if (decrypt) {
				Archive<ClassNode> archive = new JarArchive(jar);//new ClassArchive(AES.decryptPack(jar.getInputStream(jar.getEntry("inner.pack.gz")), stub.getParameter("0"), stub.getParameter("-1")));
				logger.info("Archive opened. Injecting bytecode...");
				ClassLoader classLoader = loader.classLoader = new ArchiveClassLoader(archive, log);
				Applet applet = loader.applet = (Applet) classLoader.loadClass("client").newInstance();
				applet.setStub(stub);
				applet.setPreferredSize(new Dimension(765, 503));
				applet.init();
				applet.start();
				return loader;
			} 
 
			logger.info("Archive opened. Running applet.");