To list all the classes in the .jar file containing the classes.dex file, you use DexFile , not DexClassLoader , for example. eg:
String path = "/path/to/your/library.jar" try { DexFile dx = DexFile.loadDex(path, File.createTempFile("opt", "dex", getCacheDir()).getPath(), 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) { Log.w(TAG, "Error opening " + path, e); }
source share