Load app resource as shared library.
- Added aapt command line flag --app-as-shared-lib to build app resources
that could be loaded as shared lib at runtime.
- Added new method AssetManager.addAssetPathAsSharedLibrary() to load an
app resource as shared library.
Bug 22487604
Change-Id: Ib9b33c35f9c2b7129f3ba205de03d4564623ea39
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index bcf0d5e5..6411286 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -200,6 +200,9 @@
" --shared-lib\n"
" Make a shared library resource package that can be loaded by an application\n"
" at runtime to access the libraries resources. Implies --non-constant-id.\n"
+ " --app-as-shared-lib\n"
+ " Make an app resource package that also can be loaded as shared library at runtime.\n"
+ " Implies --non-constant-id.\n"
" --error-on-failed-insert\n"
" Forces aapt to return an error if it fails to insert values into the manifest\n"
" with --debug-mode, --min-sdk-version, --target-sdk-version --version-code\n"
@@ -668,6 +671,9 @@
} else if (strcmp(cp, "-shared-lib") == 0) {
bundle.setNonConstantId(true);
bundle.setBuildSharedLibrary(true);
+ } else if (strcmp(cp, "-app-as-shared-lib") == 0) {
+ bundle.setNonConstantId(true);
+ bundle.setBuildAppAsSharedLibrary(true);
} else if (strcmp(cp, "-no-crunch") == 0) {
bundle.setUseCrunchCache(true);
} else if (strcmp(cp, "-ignore-assets") == 0) {