From 3e000175fcc24881fd12a9d3fe19e2eba173e577 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 14 Sep 2015 13:44:57 -0400 Subject: [PATCH] src/android: skip signing the APK if KEY_ALIAS env var is not set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- src/platform/android.nit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/platform/android.nit b/src/platform/android.nit index 72c219f..1a6f458 100644 --- a/src/platform/android.nit +++ b/src/platform/android.nit @@ -337,11 +337,16 @@ $(call import-module,android/native_app_glue) var tsa_server= "TSA_SERVER".environ if key_alias.is_empty then - toolcontext.error(null, - "Error: the environment variable `KEY_ALIAS` must be set to use the `--release` option on Android projects.") + toolcontext.warning(null, "key-alias", + "Warning: the environment variable `KEY_ALIAS` is not set, the APK file will not be signed.") + + # Just move the unsigned APK to outname + args = ["mv", apk_path, outname] + toolcontext.exec_and_check(args, "Android project error") return end + # We have a key_alias, try to sign the APK args = ["jarsigner", "-sigalg", "MD5withRSA", "-digestalg", "SHA1", apk_path, key_alias] ## Use a custom keystore -- 1.7.9.5