INNER CODE UNIT · Java

loadJar

anggrayudi/android-hidden-api · cli/ClosureVerify.java:52

    private static void loadJar(Path jar, Map<String, ClassNode> all) throws IOException {
        try (ZipFile z = new ZipFile(jar.toFile())) {
            Enumeration<? extends ZipEntry> e = z.entries();
            while (e.hasMoreElements()) {
                ZipEntry en = e.nextElement();
                if (!en.getName().endsWith(".class")) continue;
                try (InputStream in = z.getInputStream(en)) {
                    ClassNode cn = read(in);
                    all.put(cn.name, cn);
                }
            }
        }
    }

    private static void loadDir(Path dir, Map<String, ClassNode> all) throws IOException {
        List<Path> paths = new ArrayList<>();
        try (Stream<Path> s = Files.walk(dir)) {
            s.filter(p -> p.toString().endsWith(".class")).forEach(paths::add);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…