2

I am attempting to find a class loader that works for optimized dex files (odex files). I looked through all the android documentation and found the following class loaders.

They all seem to work for either APKs or JAR files (or APKs that contain classes.dex files), but none seem to work for odex files :(

I have an optimized dex file that I would like to load into my app but I am struggling to find a way to load the file. Is there a way to do this?

Thanks!

Jon
  • 1,381
  • 3
  • 16
  • 41
  • how are you creating `DexClassLoader` ? – pskink Aug 27 '17 at 06:17
  • I tried doing this: new DexClassLoader(pathToResourceOnlyApk, pathToOdexFile, null, getClassLoader()); where that last argument is the class loader of my current context. When I do this, since the resourceOnly APK does not have classes.dex, it does not allow me to create the DexClassLoader. – Jon Aug 27 '17 at 06:37
  • post your code in your question – pskink Aug 27 '17 at 06:37
  • Sorry about that :) I pushed enter to put a new line but I guess it auto posts :) – Jon Aug 27 '17 at 06:38

0 Answers0