mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
Merge pull request #58 from Droid-Deck/tools/local-release-signing
build_local: sign with DroidDeck's key when a local .signing.env has it
This commit is contained in:
2 files changed
+26
No files matched your search
@@ -29,3 +29,6 @@ app/src/main/jniLibs/arm64-v8a/libproot-loader.so
|
|||||||
droiddeck-release-key/
|
droiddeck-release-key/
|
||||||
password.txt
|
password.txt
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|
||||||
|
# Local signing with the release key (tools/build_local.sh); holds a password.
|
||||||
|
.signing.env
|
||||||
@@ -309,6 +309,29 @@ grep -qi 'CN=Android, OU=Android, O=Android' <<<"${signature_output}" || {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# With DroidDeck's own key at hand, sign as CI's main builds are (tools/release/sign-apk.sh), so
|
||||||
|
# the apk installs over a release instead of being refused as a different signer. The key's
|
||||||
|
# location and password live in an untracked .signing.env (RELEASE_KEYSTORE, RELEASE_STORE_PASSWORD,
|
||||||
|
# RELEASE_KEY_ALIAS), looked for in this checkout and then in the main one, which worktrees share.
|
||||||
|
signing_env=${DROIDDECK_SIGNING_ENV:-}
|
||||||
|
if [[ -z "${signing_env}" ]]; then
|
||||||
|
for candidate in "${repo_root}/.signing.env" \
|
||||||
|
"$(dirname "$(git -C "${repo_root}" rev-parse --path-format=absolute --git-common-dir 2>/dev/null || echo .)")/.signing.env"; do
|
||||||
|
[[ -f "${candidate}" ]] && { signing_env=${candidate}; break; }
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
if [[ -n "${signing_env}" ]]; then
|
||||||
|
echo "Signing with DroidDeck's key (${signing_env})"
|
||||||
|
(
|
||||||
|
set -a
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
. "${signing_env}"
|
||||||
|
set +a
|
||||||
|
BUILD_TOOLS="${build_tools}" "${repo_root}/tools/release/sign-apk.sh" "${apk}" standard "${apk}.release"
|
||||||
|
)
|
||||||
|
mv "${apk}.release" "${apk}"
|
||||||
|
fi
|
||||||
|
|
||||||
printf 'APK: %s\n' "${apk}"
|
printf 'APK: %s\n' "${apk}"
|
||||||
printf 'SHA-256: '
|
printf 'SHA-256: '
|
||||||
shasum -a 256 "${apk}" | awk '{print $1}'
|
shasum -a 256 "${apk}" | awk '{print $1}'
|
||||||
Reference in new issue
Block a user