summaryrefslogtreecommitdiff
path: root/apexer/apexer.py
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-01-05 12:58:11 +0900
committerJiyong Park <jiyong@google.com>2019-01-09 21:08:10 +0900
commit3e0c65b68c495e37f3498c627d530896363f1566 (patch)
tree0d8d0741b8f55580d6a3dafe7263db92becdf60e /apexer/apexer.py
parent685319eba60fdebcb83d3e90d43e58ca4169452b (diff)
Add --override_apk_package_name to override app package name
By default, the app package name of an APEX is equal to the apex package name. The new --override_apk_package_name option is used to override the behavior. In practice, one can use this option by setting PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES := <apex_name>:<manifest_name> Test: m with PRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES for 1) an APK in Android.mk 2) an APK in ANdroid.bp 3) an APEX and check that manifest names are modified as specified Change-Id: Idb30015205c572013a6d193b776409d32452ffb8
Diffstat (limited to 'apexer/apexer.py')
-rw-r--r--apexer/apexer.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/apexer/apexer.py b/apexer/apexer.py
index 6da23e6..d09c44b 100644
--- a/apexer/apexer.py
+++ b/apexer/apexer.py
@@ -73,6 +73,8 @@ def ParseArgs(argv):
parser.add_argument('--payload_type', metavar='TYPE', required=False, default="image",
choices=["zip", "image"],
help='type of APEX payload being built "zip" or "image"')
+ parser.add_argument('--override_apk_package_name', required=False,
+ help='package name of the APK container. Default is the apex name in --manifest.')
return parser.parse_args(argv)
def FindBinaryPath(binary):
@@ -298,7 +300,11 @@ def CreateApex(args, work_dir):
if args.verbose:
print('Creating AndroidManifest ' + android_manifest_file)
with open(android_manifest_file, 'w+') as f:
- f.write(PrepareAndroidManifest(manifest_apex.name, manifest_apex.version))
+ app_package_name = manifest_apex.name
+ if args.override_apk_package_name:
+ app_package_name = args.override_apk_package_name
+
+ f.write(PrepareAndroidManifest(app_package_name, manifest_apex.version))
# copy manifest to the content dir so that it is also accessible
# without mounting the image