Beispiel #1
0
        private static void Initialize()
        {
            VfsDirectory root = new VfsDirectory();

            root.AddDirectory("lib").AddDirectory("security").Add("cacerts", new VfsCacertsEntry());
            VfsDirectory bin = new VfsDirectory();

            root.Add("bin", bin);
            root.Add("assembly", new VfsAssembliesDirectory());
            AddDummyLibrary(bin, "zip");
            AddDummyLibrary(bin, "awt");
            AddDummyLibrary(bin, "rmi");
            AddDummyLibrary(bin, "w2k_lsa_auth");
            AddDummyLibrary(bin, "jaas_nt");
            AddDummyLibrary(bin, "jaas_unix");
            AddDummyLibrary(bin, "net");
            AddDummyLibrary(bin, "splashscreen");
            AddDummyLibrary(bin, "osx");
            AddDummyLibrary(bin, "management");
            bin.Add("java", new VfsJavaExe());
            bin.Add("javaw", new VfsJavaExe());
            bin.Add("java.exe", new VfsJavaExe());
            bin.Add("javaw.exe", new VfsJavaExe());

            // this is a weird loop back, the vfs.zip resource is loaded from vfs,
            // because that's the easiest way to construct a ZipFile from a Stream.
            java.util.zip.ZipFile zf = new java.util.zip.ZipFile(RootPath + "vfs.zip");
            java.util.Enumeration e  = zf.entries();
            while (e.hasMoreElements())
            {
                AddZipEntry(zf, root, (java.util.zip.ZipEntry)e.nextElement());
            }

            Interlocked.CompareExchange(ref VirtualFileSystem.root, root, null);
        }
Beispiel #2
0
        private static void Initialize()
        {
            VfsDirectory root = new VfsDirectory();

            root.AddDirectory("lib").AddDirectory("security").Add("cacerts", new VfsCacertsEntry());
            VfsDirectory bin = new VfsDirectory();

            root.Add("bin", bin);
            root.Add("assembly", new VfsAssembliesDirectory());
            AddDummyLibrary(bin, "zip");
            AddDummyLibrary(bin, "awt");
            AddDummyLibrary(bin, "rmi");
            AddDummyLibrary(bin, "w2k_lsa_auth");
            AddDummyLibrary(bin, "jaas_nt");
            AddDummyLibrary(bin, "jaas_unix");
            AddDummyLibrary(bin, "net");
            AddDummyLibrary(bin, "splashscreen");
            AddDummyLibrary(bin, "osx");
            AddDummyLibrary(bin, "management");
            bin.Add("java", new VfsJavaExe());
            bin.Add("javaw", new VfsJavaExe());
            bin.Add("java.exe", new VfsJavaExe());
            bin.Add("javaw.exe", new VfsJavaExe());

            // this is a weird loop back, the vfs.zip resource is loaded from vfs,
            // because that's the easiest way to construct a ZipFile from a Stream.
            //Console.Error.WriteLine($"Opening virtual Zip file: {RootPath + "vfs.zip"}");
            java.util.zip.ZipFile zf = new java.util.zip.ZipFile(RootPath + "vfs.zip");
            java.util.Enumeration e  = zf.entries();
            while (e.hasMoreElements())
            {
                AddZipEntry(zf, root, (java.util.zip.ZipEntry)e.nextElement());
            }

            // make "lib/security/local_policy.jar" point to "lib/security/US_export_policy.jar"
            // to get the unrestricted crypto policy
            VfsDirectory security = (VfsDirectory)((VfsDirectory)root.GetEntry("lib")).GetEntry("security");

            security.Add("local_policy.jar", security.GetEntry("US_export_policy.jar"));

            Interlocked.CompareExchange(ref VirtualFileSystem.root, root, null);
        }
Beispiel #3
0
		private static void Initialize()
		{
			VfsDirectory root = new VfsDirectory();
			root.AddDirectory("lib").AddDirectory("security").Add("cacerts", new VfsCacertsEntry());
			VfsDirectory bin = new VfsDirectory();
			root.Add("bin", bin);
			root.Add("assembly", new VfsAssembliesDirectory());
			AddDummyLibrary(bin, "zip");
			AddDummyLibrary(bin, "awt");
			AddDummyLibrary(bin, "rmi");
			AddDummyLibrary(bin, "w2k_lsa_auth");
			AddDummyLibrary(bin, "jaas_nt");
			AddDummyLibrary(bin, "jaas_unix");
			AddDummyLibrary(bin, "unpack");
			AddDummyLibrary(bin, "net");
			AddDummyLibrary(bin, "splashscreen");
			AddDummyLibrary(bin, "osx");
			bin.Add("java", new VfsJavaExe());
			bin.Add("javaw", new VfsJavaExe());
			bin.Add("java.exe", new VfsJavaExe());
			bin.Add("javaw.exe", new VfsJavaExe());

			// this is a weird loop back, the vfs.zip resource is loaded from vfs,
			// because that's the easiest way to construct a ZipFile from a Stream.
			java.util.zip.ZipFile zf = new java.util.zip.ZipFile(RootPath + "vfs.zip");
			java.util.Enumeration e = zf.entries();
			while (e.hasMoreElements())
			{
				AddZipEntry(zf, root, (java.util.zip.ZipEntry)e.nextElement());
			}

			// make "lib/security/local_policy.jar" point to "lib/security/US_export_policy.jar"
			// to get the unrestricted crypto policy
			VfsDirectory security = (VfsDirectory)((VfsDirectory)root.GetEntry("lib")).GetEntry("security");
			security.Add("local_policy.jar", security.GetEntry("US_export_policy.jar"));

			Interlocked.CompareExchange(ref VirtualFileSystem.root, root, null);
		}