If you unzip apk, you will see that there is a lib folder in the root directory. This directory also exists in your application directory /data/data/package.name/lib as a symbolic link to /data/app-lib/package.name . If you really want to load your own libraries at runtime, one of them is where you would have to put them.
Since applications can get write permissions to their own data directory, you should be able to actually upload the file. ContextWrapper.getFilesDir() will return the path /data/data/package.name so that it does not transcode it.
Be careful with this - updating your own code yourself can be more of a problem than its value. If you're really trying to be safe, consider downloading and running arbitrary code in your application.
source share