public static boolean acceptFile(File f) { if (f.isDirectory()) { return true; } else { return ArchiveReader.isSupportedArchiveFile(f); } }
public static void runAllClassesInDex(String jarCanonicalPath) throws Exception { DexFile dexFile = ArchiveReader.get(new File(jarCanonicalPath)); Set<? extends ClassDef> allClassesInDex = dexFile.getClasses(); for (ClassDef currentClass : allClassesInDex) { String normType = DexlibAdapter.getClassStringFromDex(currentClass.getType()); Translator sourceGenerator = TranslatorFactory.createTranslator(normType, new File(jarCanonicalPath)); sourceGenerator.apply(); System.out.println(sourceGenerator.toString()); } }