--
Mārtiņš Možeiko
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.
Afaik files in /data/local are writable and executable without root.
AFAICT you can put them anywhere under
ContextWrapper.getFilesDir().getCanonicalPath(). This will tipically
lead to
/data/data/org.example.myapp/files
You will have to load them with System.load(fullPathName) instead of
System.loadLibrary(shortName). E.g.
System.load("/data/data/org.example.myapp/files/libfoo.so");
--
"The flames are all long gone, but the pain lingers on"
Just wanted to check with android representatives - is this an officially
supported use case (loading libraries from other directories than the ones
installed from the apk - possibly downloaded at runtime), or is it
unsupported accidental feature that might break with tighter platform
security at later updates?
// Martin
// Martin
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
> As for loading libraries that are located in your own application's
> directory, I would say it's likely to keep working for a long time,
> though I can't guarantee we'll never prevent it.�We're
> generally�cautious about not breaking existing apps when modifying the
> platform, even those that do crazy stuff we strictly tell not to do, but
> there are cases where security and valuable features trump any backwards
> compatibility concerns.
Thanks, this was the part I was interested in, and the explanation makes
sense.
// Martin
// Martin
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "android-ndk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-ndk/u_JadDj9uBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-ndk...@googlegroups.com.
I realize this is an old thread, but can someone confirm if this would work on Android 4.x :com.example.nativelib.apk => contains a native .so which goes into /data/data/com.example.nativelib/lib.so
com.foo.myapp.apk => Android application, different package namespace and no sharedUserId tries to execute System.load('/data/data/com.example.nativelib/lib.so')Without resorting to the sharedUserId solution, will System.load( ) succeed in loading an .so from an absolute path when the process has a different uid?If not, what is the recommended way forward for sharing an .so among several apk's without modifying the ROM to put libs under the read only /system/lib partition?
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "android-ndk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-ndk/u_JadDj9uBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-ndk...@googlegroups.com.
The alternative approach is that I can encapsulate the .so in its own apk that can be versioned separately. It can act as a ContentProvider to apk's that require it -- similar perhaps to how OSGi bundles are resolved. An apk requests a version of the native library and the ContentProvider resolves it for them provided the version requested matches. This is far more desirable than having each apk that depends on this package the binary inside itself.
"Another approach is to bypass the automatic deployment of .so files. Put them in the assets folder instead. In your app copy the assets to a folder of your choice so you can System.load() them. This way you can even load versioned libraries."
--
On Tue, Sep 17, 2013 at 11:01 PM, Davis Ford <davi...@gmail.com> wrote:
I realize this is an old thread, but can someone confirm if this would work on Android 4.x :com.example.nativelib.apk => contains a native .so which goes into /data/data/com.example.nativelib/lib.soTechnically, the real installation location of the shared libraries changed a lot between different Android revisions, but the installer currently maintains a symbolic link from /data/data/<packagename>/lib that points to the actual location.However, whether this link can be accessed or followed by any UID is absolutely not guaranteed at all. This is intentional since this may conflict with other system-level features (i.e. "protected" apps, guest mode, multi-user, whatever comes up in the future).It's not difficult to imagine that the link itself would disappear in a future version of the system (with some VM / linker tricks to keep things working inside applications who want to access their own shared libraries).
So the fact that this may currently work for other UIDs is _purely_ accidental and should not be relied on.