INNER CODE UNIT · Java

main

anggrayudi/android-hidden-api · cli/Stubifier.java:41

    public static void main(String[] args) throws IOException {
        if (args.length < 1) {
            System.err.println("usage: Stubifier <classes-dir>");
            System.exit(2);
        }
        Path root = Paths.get(args[0]);
        List<Path> classes = new ArrayList<>();
        try (Stream<Path> s = Files.walk(root)) {
            s.filter(p -> p.toString().endsWith(".class")).forEach(classes::add);
        }
        int stubbed = 0;
        int failed = 0;
        for (Path p : classes) {
            try {
                byte[] out = stubify(Files.readAllBytes(p));
                Files.write(p, out);
                stubbed++;
            } catch (Throwable t) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…