blob: 288932bbe1b6f3eb4af2a9518509a96931b2d9d6 [file] [log] [blame]
Tor Lillqvistfae45f52012-08-21 13:52:05 +03001# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2#
3# This file is part of the LibreOffice project.
4#
5# This Source Code Form is subject to the terms of the Mozilla Public
6# License, v. 2.0. If a copy of the MPL was not distributed with this
7# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
10
11include $(module_directory)/../solenv/gbuild/partial_build.mk
12
Jan Holesovsky167412c2015-01-21 15:05:34 +010013.PHONY: sign
14
Miklos Vajna562d8f52015-05-21 17:55:28 +010015SIGNED_APK := $(BUILDDIR)/android/source/bin/LibreOfficeViewer.apk
Jan Holesovsky39289322015-01-22 08:57:23 +010016RELEASE_APK_USAGE := echo; echo "Usage: make versionCode=<version_num+1> exampleDocument=</absolute/path/example.odt> key=<key_name> release-apk"
Jan Holesovsky167412c2015-01-21 15:05:34 +010017
Jan Holesovskyae924ed2015-01-22 08:35:40 +010018release-apk: build
Andrea Gelminia9408262017-05-04 10:34:36 +020019 # versionCode and key are mandatory, exampleDocument is not
Jan Holesovskyae924ed2015-01-22 08:35:40 +010020 @if test -z "$(versionCode)" ; then $(RELEASE_APK_USAGE) ; exit 1 ; fi
21 @if test -z "$(key)" ; then $(RELEASE_APK_USAGE) ; exit 1 ; fi
Jan Holesovsky39289322015-01-22 08:57:23 +010022
Jan Holesovsky167412c2015-01-21 15:05:34 +010023 rm -f $(SIGNED_APK)
Jan Holesovsky39289322015-01-22 08:57:23 +010024
25 # the actual signing
Christian Lohmaieree8257a2015-10-11 01:53:29 +020026 jarsigner --verbose -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/.keystore $(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk $(key)
27 $(ANDROID_SDK_HOME)/build-tools/*/zipalign -v 4 $(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk $(SIGNED_APK)
Jan Holesovsky39289322015-01-22 08:57:23 +010028
Jan Holesovsky167412c2015-01-21 15:05:34 +010029 @echo
30 @echo "Resulting signed apk: $(SIGNED_APK)"
31
Tor Lillqvistfae45f52012-08-21 13:52:05 +030032# vim: set noet sw=4 ts=4: