Skip to content

Commit

Permalink
android: If keystore password is not present, produce unsigned apk
Browse files Browse the repository at this point in the history
This makes sure untrusted builds in doozer (PRs, etc) don't fail
  • Loading branch information
andoma committed Mar 20, 2018
1 parent b81d305 commit b269949
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/arch/android/android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ${BUILDDIR}/src/arch/android/%.o : CFLAGS = ${OPTFLAGS} \
-Wall -Werror -Wwrite-strings -Wno-deprecated-declarations \
-Wno-multichar -std=gnu99

.DEFAULT_GOAL := ${BUILDDIR}/${APPNAME}.aligned.apk
.DEFAULT_GOAL := ${BUILDDIR}/${APPNAME}.apk


MANIFEST := ${BUILDDIR}/AndroidManifest.xml
Expand Down Expand Up @@ -87,9 +87,9 @@ ${BUILDDIR}/${APPNAME}.aligned.apk: ${BUILDDIR}/${APPNAME}.unsigned.apk
${ZIPALIGN} -f -p 4 $< $@

${BUILDDIR}/${APPNAME}.apk: ${BUILDDIR}/${APPNAME}.aligned.apk
${APKSIGNER} sign -ks android/movian.keystore -ks-pass env:MOVIAN_KEYSTORE_PASS --out $@ $<
@[ -z "$$MOVIAN_KEYSTORE_PASS" ] && (cp $< $@ ; echo "Warning: Keystore password not present, producing unsigned APK") || (${APKSIGNER} sign -ks android/movian.keystore -ks-pass env:MOVIAN_KEYSTORE_PASS --out $@ $< ; echo "APK signed")

signed-apk: ${BUILDDIR}/${APPNAME}.apk
apk: ${BUILDDIR}/${APPNAME}.apk
@echo "doozer-artifact:${BUILDDIR}/${APPNAME}.apk:apk:application/vnd.android.package-archive:${APPNAME}_api${ANDROID_MIN_SDK_VERSION}_${ANDROID_ABI}.apk:versioncode=${NUMVER}"

install: ${BUILDDIR}/${APPNAME}.apk
Expand Down

0 comments on commit b269949

Please sign in to comment.