Add a check so that if ANDROID_KEYSTORE_PASS is not given, apksigner can still be invoked.

This is done by omitting the --ks-pass argument completely
This commit is contained in:
mcc 2020-10-27 23:26:30 -04:00
parent 85cc82d8cb
commit 2be1c777d7
1 changed files with 5 additions and 1 deletions

View File

@ -653,6 +653,10 @@ elseif(ANDROID)
set(ANDROID_MANIFEST "${CMAKE_CURRENT_SOURCE_DIR}/src/resources/AndroidManifest_${MANIFEST}.xml" CACHE STRING "The AndroidManifest.xml file to use")
if (ANDROID_KEYSTORE_PASS) # Trick so that --ks-pass is not passed if no password is given.
set(ANDROID_APKSIGNER_KEYSTORE_PASS --ks-pass)
endif()
# Make an apk
add_custom_command(
TARGET lovr
@ -678,7 +682,7 @@ elseif(ANDROID)
COMMAND ${ANDROID_TOOLS}/apksigner
sign
--ks ${ANDROID_KEYSTORE}
--ks-pass ${ANDROID_KEYSTORE_PASS}
${ANDROID_APKSIGNER_KEYSTORE_PASS} ${ANDROID_KEYSTORE_PASS}
--in lovr.unsigned.apk
--out lovr.apk
COMMAND ${CMAKE_COMMAND} -E remove lovr.unaligned.apk lovr.unsigned.apk AndroidManifest.xml Activity.java classes.dex