X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FDevelLauncher.java;h=254b1e72f05d1e37b3816d0a9154b452874d9468;hb=862eaa5913c657d2760337635de517471f0424cf;hp=e8df9f5bdf2d048ff54569471f12bf4ccb425167;hpb=d690eda36eba121aa79e4f456d5f0eb481be8b86;p=gigi.git diff --git a/src/org/cacert/gigi/DevelLauncher.java b/src/org/cacert/gigi/DevelLauncher.java index e8df9f5b..254b1e72 100644 --- a/src/org/cacert/gigi/DevelLauncher.java +++ b/src/org/cacert/gigi/DevelLauncher.java @@ -17,6 +17,8 @@ import org.kamranzafar.jtar.TarHeader; import org.kamranzafar.jtar.TarOutputStream; public class DevelLauncher { + public static final boolean DEVEL = true; + public static void main(String[] args) throws Exception { Properties mainProps = new Properties(); mainProps.load(new FileInputStream("config/gigi.properties")); @@ -30,20 +32,18 @@ public class DevelLauncher { ByteArrayOutputStream chunkConfig = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(chunkConfig); byte[] cacerts = Files.readAllBytes(Paths.get("config/cacerts.jks")); - byte[] keystore = Files.readAllBytes(Paths - .get("config/keystore.pkcs12")); + byte[] keystore = Files.readAllBytes(Paths.get("config/keystore.pkcs12")); - DevelLauncher.writeGigiConfig(dos, "changeit".getBytes(), - "changeit".getBytes(), mainProps, cacerts, keystore); + DevelLauncher.writeGigiConfig(dos, "changeit".getBytes(), "changeit".getBytes(), mainProps, cacerts, keystore); dos.flush(); InputStream oldin = System.in; System.setIn(new ByteArrayInputStream(chunkConfig.toByteArray())); Launcher.main(args); System.setIn(oldin); } - public static void writeGigiConfig(OutputStream target, byte[] keystorepw, - byte[] truststorepw, Properties mainprop, byte[] cacerts, - byte[] keystore) throws IOException { + + public static void writeGigiConfig(OutputStream target, byte[] keystorepw, byte[] truststorepw, + Properties mainprop, byte[] cacerts, byte[] keystore) throws IOException { TarOutputStream tos = new TarOutputStream(target); ByteArrayOutputStream baos = new ByteArrayOutputStream(); mainprop.store(baos, ""); @@ -56,21 +56,21 @@ public class DevelLauncher { tos.close(); } - private static void putTarEntry(byte[] data, TarOutputStream tos, - String name) throws IOException { + + private static void putTarEntry(byte[] data, TarOutputStream tos, String name) throws IOException { TarHeader th = new TarHeader(); th.name = new StringBuffer(name); th.size = data.length; tos.putNextEntry(new TarEntry(th)); tos.write(data); } - public static void writeChunk(DataOutputStream dos, byte[] chunk) - throws IOException { + + public static void writeChunk(DataOutputStream dos, byte[] chunk) throws IOException { dos.writeInt(chunk.length); dos.write(chunk); } - public static void launch(Properties props, File cacerts, File keystore) - throws IOException { + + public static void launch(Properties props, File cacerts, File keystore) throws IOException { ByteArrayOutputStream config = new ByteArrayOutputStream(); props.store(config, ""); }