Index: build/config/android/internal_rules.gni |
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni |
index 6883600f5caf58a8adcc1c59369b5a4df016b7f5..f6052ae4229546aeb26da53541a149f19594add3 100644 |
--- a/build/config/android/internal_rules.gni |
+++ b/build/config/android/internal_rules.gni |
@@ -32,6 +32,7 @@ |
# TODO(agrieve): Rename targets below to match above patterns. |
"*android_webview/glue:glue", |
+ "//build/android/rezip:rezip", |
"//chrome/test/android/cast_emulator:cast_emulator", |
] |
@@ -1384,6 +1385,7 @@ |
# keystore_path: Path to keystore to use for signing. |
# keystore_name: Key alias to use. |
# keystore_password: Keystore password. |
+ # rezip_apk: Whether to add crazy-linker alignment. |
template("finalize_apk") { |
action(target_name) { |
deps = [] |
@@ -1426,6 +1428,20 @@ |
"--key-passwd", |
invoker.keystore_password, |
] |
+ if (defined(invoker.rezip_apk) && invoker.rezip_apk) { |
+ deps += [ "//build/android/rezip" ] |
+ _rezip_jar_path = "$root_build_dir/lib.java/rezip_apk.jar" |
+ args += [ |
+ "--load-library-from-zip=1", |
+ "--rezip-apk-jar-path", |
+ rebase_path(_rezip_jar_path, root_build_dir), |
+ ] |
+ } |
+ |
+ if (defined(invoker.page_align_shared_libraries) && |
+ invoker.page_align_shared_libraries) { |
+ args += [ "--page-align-shared-libraries" ] |
+ } |
} |
} |
@@ -1668,9 +1684,6 @@ |
"uncompress_shared_libraries", |
"write_asset_list", |
]) |
- if (!defined(uncompress_shared_libraries)) { |
- uncompress_shared_libraries = _load_library_from_apk |
- } |
deps = _deps + [ ":${_package_resources_target_name}" ] |
native_libs = _native_libs + _native_libs_even_when_incremental |
@@ -1691,9 +1704,6 @@ |
"secondary_native_libs", |
"uncompress_shared_libraries", |
]) |
- if (!defined(uncompress_shared_libraries)) { |
- uncompress_shared_libraries = _load_library_from_apk |
- } |
_dex_target = "//build/android/incremental_install:bootstrap_java__dex" |
deps = _incremental_deps + [ |
":${_incremental_package_resources_target_name}", |
@@ -1720,11 +1730,14 @@ |
_finalize_apk_rule_name = "${target_name}__finalize" |
finalize_apk(_finalize_apk_rule_name) { |
+ forward_variables_from(invoker, [ "page_align_shared_libraries" ]) |
+ |
input_apk_path = _packaged_apk_path |
output_apk_path = _final_apk_path |
keystore_path = _keystore_path |
keystore_name = _keystore_name |
keystore_password = _keystore_password |
+ rezip_apk = _load_library_from_apk |
public_deps = [ |
# Generator of the _packaged_apk_path this target takes as input. |