Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3052)

Unified Diff: build/android/gyp/finalize_apk.py

Issue 1619553003: Support uncompress and page align shared libraries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/apkbuilder.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/finalize_apk.py
diff --git a/build/android/gyp/finalize_apk.py b/build/android/gyp/finalize_apk.py
index a6a1040d3a97fd0d69a1c57e54cb5e4996cafd5d..d71cb8fc7e7704fa58c20bebb2af6e83789d59bd 100755
--- a/build/android/gyp/finalize_apk.py
+++ b/build/android/gyp/finalize_apk.py
@@ -55,10 +55,17 @@ def JarSigner(key_path, key_name, key_passwd, unsigned_path, signed_path):
build_utils.CheckOutput(sign_cmd)
-def AlignApk(zipalign_path, unaligned_path, final_path):
+def AlignApk(zipalign_path, package_align, unaligned_path, final_path):
align_cmd = [
zipalign_path,
- '-f', '4', # 4 bytes
+ '-f'
+ ]
+
+ if package_align:
+ align_cmd += ['-p']
+
+ align_cmd += [
+ '4', # 4 bytes
unaligned_path,
final_path,
]
@@ -74,6 +81,9 @@ def main(args):
parser.add_option('--rezip-apk-jar-path',
help='Path to the RezipApk jar file.')
parser.add_option('--zipalign-path', help='Path to the zipalign tool.')
+ parser.add_option('--page-align-shared-libraries',
+ action='store_true',
+ help='Page align shared libraries.')
parser.add_option('--unsigned-apk-path', help='Path to input unsigned APK.')
parser.add_option('--final-apk-path',
help='Path to output signed and aligned APK.')
@@ -100,6 +110,7 @@ def main(args):
options.load_library_from_zip,
options.key_name,
options.key_passwd,
+ options.page_align_shared_libraries,
]
build_utils.CallAndWriteDepfileIfStale(
@@ -140,7 +151,10 @@ def FinalizeApk(options):
options.rezip_apk_jar_path, signed_apk_path, options.final_apk_path)
else:
# Align uncompressed items to 4 bytes
- AlignApk(options.zipalign_path, signed_apk_path, options.final_apk_path)
+ AlignApk(options.zipalign_path,
+ options.page_align_shared_libraries,
+ signed_apk_path,
+ options.final_apk_path)
if __name__ == '__main__':
« no previous file with comments | « build/android/gyp/apkbuilder.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698