How can I customize the destination of where dependencies resources are placed in an APK?

132 Views Asked by At

I am looking for a way to customize where an android application places any of its dependencies resource files. These properties files are part of resource directories in jar dependencies.

I've looked at the aapt documentation's aaptOptions and packagingOptions of the Android DSL docs, but can't find any way to manipulate the destination of assets, res, resources files found in a projects dependencies.

Here's an example of the APK when viewed the APK Analyzer built into Android Studio. The blacked out names of properties files are the ones I'd like moved into assets or res folders.analyzed apk example

I'd like for them to be placed into the assets or res folders of the APK rather than in the root path of the apk.

1

There are 1 best solutions below

1
Moonbloom On

You can't choose where files are placed in the APK.

The structure is like that, so when the APK is unpacked on device, the Android system knows how to handle the files and where they are located.

If you could randomly move files around and into other folders, it would completely break the installation of APK files.