Mark Anderson
Mark Anderson

Reputation: 370

Android Can I inject data into a shared object permanently at runtime, in other words alter the shared object once

I have an android app that uses several shared objects (C++) I wrote that hold specific and constant data. Linked at build. All is fine.

However there is one piece of data that is generated at runtime either dynamicaly or user input. I would like to then "store" this data into a shared object, once only, that is then loaded at subsequent runtimes presumably using System.load as is currently used for my other shared objects.

Currently I am storing this data encrypted in a SQLite table but for security reasons I would like to have it imbedded with a .so (injected once) I understand bringing the data intio the .so at runtime would simply be a memory insert and would be lost on closing the app, so not different say to pulling the data from a database, bar it perhaps being more secure on the .so The issue of course is how to alter the actual .so physically (inject data into it)

Is this posible ?

I have read the following but not sure if they address the need. Answer is the one with 99 upvotes ;

Is it possible to dynamically load a library at runtime from an Android application?

The above link suggests an alternative approach perhaps.

About 40 years ago I remember being able to inject data into a field within a built C library but I'm afraid that bit of knowledge has long since left me unfortunately.

I'm not an Android guy so struggling with this. Would appreciate any direction.

Upvotes: 0

Views: 18

Answers (0)

Related Questions