Questions tagged [dexclassloader]

Android dalvik.system.DexClassLoader class loader loads classes from .jar and .apk files containing a classes.dex entry. This class can allow code execution not installed as part of an Android application.

dalvik.system.DexClassLoader was added in API level 3.

See also

  1. http://developer.android.com/reference/dalvik/system/DexClassLoader.html
  2. http://developer.android.com/reference/dalvik/system/BaseDexClassLoader.html
73 questions
16
votes
1 answer

How to execute APKs on a customized data directory?

I was wondering how Parallel Space app can duplicate and execute other apps without copying their APKs or running them under modified package names like other apps on Playstore do (e.g.: "com.whatever.name-of-duplicated-app"). After investigating…
Perazzo
  • 1,127
  • 13
  • 24
14
votes
2 answers

How to fix "dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:134)"

After I upgraded to the 64-bit armeabi library and released the app to googleplay in bundle packaging, I encountered the following problems in googleplay crashes report page: java.lang.RuntimeException: at…
user2811667
  • 201
  • 1
  • 3
  • 4
10
votes
1 answer

Why does Android classloader allow reflective access to the public field of a package-private class from another package?

It seems that the Android application class loader allows to reflectively acquire a reference to the public static field of a package-private class even from a different package (than the one the aforementioned class is defined in), while Sun JDK…
desseim
  • 7,968
  • 2
  • 24
  • 26
9
votes
2 answers

how to load class dynamically from aar file with DexClassLoader

I have succeeded in dynamically loading classes from a dex file in the following way enter code here File file = getDir("dex", 0); DexClassLoader dexClassLoader = new DexClassLoader("/data/data/com.example.callerapp/files/test.dex",…
woosuk
  • 191
  • 2
  • 11
8
votes
1 answer

Is it still the case that Android never unloads classes?

We have a large app that's always running into the dread method count limit. I've been asked to come up with a way to let it do much more, including supporting plugins. Looking for ways to unload code, I ran across JNI Tips which says Classes are…
Jon Shemitz
  • 1,235
  • 13
  • 29
8
votes
2 answers

Plugin system with DexClassLoader() and user interface

For a long-term student project, i'm trying to develop a modular application with plugins. Specifically, we would have: A master application where we could search, update, delete and run the plugins. This master application would also store some…
4
votes
0 answers

Stranger things in Android class resolution

I observe quite a few behaviors on Android (I am working on a multidex issue, so I use an emulator in 4.4.4) that leave me speechless about Android class loading: On Android classes are not supposed to be resolved when being loaded by the class…
Snicolas
  • 37,840
  • 15
  • 114
  • 173
4
votes
2 answers

What are differences between DexClassLoader and PathClassLoader?

I put a .jar file containing .dex file to directory "/sdcard", then I try to load the class in the .jar file using DexClassLoader and PathClassLoader respectively. Both of them can load the class successfully. What are differences between them? Here…
dreamer
  • 153
  • 2
  • 10
4
votes
1 answer

Strange ClassCastException in findViewById

I observe a weird exception thrown on line: viewPager = (ViewPager) view.findViewById(R.id.pager); the exception looks as follows: java.lang.ClassCastException: android.support.v4.view.ViewPager cannot be cast to…
4
votes
0 answers

Caught ClassNotFound exception when load class from downloaded dex file

I'm trying to implement a hot-fix mechanism in my android app. After googling for a while, here's what I've done: I generated a dynamic.jar file with the classes that I want to patch. (I'm using eclipse and ADT) Using dx --dex --output=patch.jar…
Void Main
  • 2,241
  • 3
  • 27
  • 36
3
votes
1 answer

How to use InMemoryDexClassLoader?

I'd like to be able to run code not installed as part of an application in memory. I assumed InMemoryDexClassLoader was created precisely for this, so I tried using it to execute a method in the same application (same class, even), but from memory.…
rloura
  • 31
  • 2
3
votes
1 answer

Android: DexClassLoader class loading fails when loading interface

Intro: I'm trying to load code in run-time from a classes.dex that's inside a classes.jar. I've done a lot of research and spend a lot of time on this so I really need help. Problem: When my jar contains a simple class it is loaded successfully.…
esWoobi
  • 31
  • 1
  • 5
3
votes
0 answers

Android: DexClassLoader: Unable to extract+optimize DEX from xx err: No child processes

I use DexClassloader to load a dex file from /data/data/packagename/ just like: private static synchronized Boolean injectAboveEqualApiLevel14( String dexPath, String defaultDexOptPath, String nativeLibPath, String dummyClassName) { …
RoseJames
  • 31
  • 3
3
votes
1 answer

How to check if the second dex was loaded completed or not after my application was installed?

Our application has three dexes in apk which was built by gradle with multidex feature. After the application was installed, Were the main dex and the second dex loaded by the same class loader? How to check if the second( classes2.dex ) and the…
Zachary
  • 127
  • 1
  • 2
  • 15
3
votes
1 answer

DexClassLoader, reload Code fails with Signal 7

I'm trying to build a plugin-System, where DexClassLoader is fetching code from other installed apks containing fragments(my plugins), and showing them in my host. This is working quite nice. I also like to make the plugins hotswappable, this means…
Kevin Gebhardt
  • 368
  • 1
  • 12
1
2 3 4 5