frankish
frankish

Reputation: 6826

How to loadLibrary from another package signed by the same developer in Android?

Is it possible to load a c library put into "A" package of a developer from a package called "B" of the same developer? (package = standalone application package on Play Store)

Basically, I want to check if "com.myapps.codecArmv6" exists from "com.myapps.mainapp" and if yes, I want to use System.loadLibrary on "com.myapps.codecArmv6"'s "abc.so" from a specific class of "com.myapps.mainapp".

Is this possible?

Upvotes: 0

Views: 215

Answers (1)

Alex Cohn
Alex Cohn

Reputation: 57173

Yes, it is possible, even if the two apps are not signed by the same developer. Essentially, the native libs are unpacked by installer into /data/data/<app.package>/lib or possibly elsewhere for Android version higher than 2.2, but with full read and execute permissions. You should use nativeLibraryDir method on 2.3 and higher to find the exact path.

Upvotes: 1

Related Questions