Fix signapk not found error when running ota_from_target_files locally
location of ota_from_target_files changed from
out/host/linux-x86/bin to
out/soong/host/linux-x86/bin . This changes relative position of
signapj.jar. To fix, use ANDROID_HOST_OUT as search path
Change-Id: I5397171566e9d7598b5ef16ae26641f0c183d748
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index e99152a..5d9cbd2 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -1479,7 +1479,7 @@
# Only check for existence of key file if using the default signer.
# Because the custom signer might not need the key file AT all.
# b/191704641
- if not OPTIONS.signapk_path:
+ if not OPTIONS.payload_signer:
private_key_path = OPTIONS.package_key + OPTIONS.private_key_suffix
if not os.path.exists(private_key_path):
raise common.ExternalError(
@@ -1487,6 +1487,11 @@
" correct key path through -k option".format(
private_key_path)
)
+ signapk_abs_path = os.path.join(
+ OPTIONS.search_path, OPTIONS.signapk_path)
+ if not os.path.exists(signapk_abs_path):
+ raise common.ExternalError(
+ "Failed to find sign apk binary {} in search path {}. Make sure the correct search path is passed via -p".format(OPTIONS.signapk_path, OPTIONS.search_path))
if OPTIONS.source_info_dict:
source_build_prop = OPTIONS.source_info_dict["build.prop"]