Created
January 20, 2015 09:19
-
-
Save f2prateek/524603beb8a90776cb2f to your computer and use it in GitHub Desktop.
Print all classes in a DexFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
File dexFileOutputDir = context.getDir("dexFileOutput" + fileKey, Context.MODE_PRIVATE); | |
File dexFileOutputFile = new File(dexFileOutputDir, "dex"); | |
DexFile dx = | |
DexFile.loadDex(jarFile.getAbsolutePath(), dexFileOutputFile.getAbsolutePath(), 0); | |
// Print all classes in the DexFile | |
for (Enumeration<String> classNames = dx.entries(); classNames.hasMoreElements(); ) { | |
String className = classNames.nextElement(); | |
System.out.println("class: " + className); | |
} | |
} catch (IOException e) { | |
throw new RuntimeException(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment