INNER CODE UNIT · Java

main

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

    public static void main(String[] args) throws IOException {
        if (args.length < 1) { System.err.println("usage: ClosureVerify <jar|dir>"); System.exit(2); return; }
        Map<String, ClassNode> all = new HashMap<>();
        Path root = Paths.get(args[0]);
        if (Files.isDirectory(root)) loadDir(root, all);
        else loadJar(root, all);
        System.exit(verify(all) > 0 ? 1 : 0);
    }

    // ------------------------------------------------------------------ loading
    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);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…