Android: a RuStore build, without the app's own updates and the counted check
The owner puts the app in RuStore: the store updates it, and the store's build must neither update itself nor be counted by the site. A build type «rustore» on the same branch (not a branch to catch up each time): the release with SELF_UPDATE off — no check of releases (the check is what the site counts installations by), no download or install, no updates block in About, a release kept from the site's build forgotten; its manifest drops the install permissions and the installer's receiver. The full build only; the same package and key, so it goes over the site's one and back with the databases. release.sh builds it into dist-rustore and checks it asks for no install permission; the release workflow keeps it as the run's «rustore» artifact, not a file of the release. The site's builds are as they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f31023dcd7
commit
dd4572fd8a
9 changed files with 73 additions and 10 deletions
|
|
@ -2,6 +2,9 @@
|
|||
# Builds the two signed release APKs into androidApp/dist:
|
||||
# ChessPenguin-<version>-android.apk Stockfish built in ("full")
|
||||
# ChessPenguin-<version>-android-noengine.apk Stockfish downloaded in the app ("light")
|
||||
# and, apart (not a file of the release), into androidApp/dist-rustore:
|
||||
# ChessPenguin-<version>-rustore.apk the full one for RuStore: no updates of its
|
||||
# own, no check the site counts
|
||||
# The key comes from the environment or from ~/.config/chesspenguin/android/.env.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
|
@ -13,15 +16,22 @@ if [[ -z "${CP_KEYSTORE:-}" && -f "${env_file}" ]]; then
|
|||
set +a
|
||||
fi
|
||||
: "${CP_KEYSTORE:?no release key: set CP_KEYSTORE and the passwords, or CP_SIGNING_ENV}"
|
||||
./gradlew --console=plain assembleFullRelease assembleLightRelease
|
||||
./gradlew --console=plain assembleFullRelease assembleLightRelease assembleFullRustore
|
||||
version="$(sed -n 's/^version = "\(.*\)"/\1/p' ../Cargo.toml | head -n1)"
|
||||
mkdir -p dist
|
||||
cp app/build/outputs/apk/full/release/app-full-release.apk "dist/ChessPenguin-${version}-android.apk"
|
||||
cp app/build/outputs/apk/light/release/app-light-release.apk "dist/ChessPenguin-${version}-android-noengine.apk"
|
||||
mkdir -p dist-rustore
|
||||
cp app/build/outputs/apk/full/rustore/app-full-rustore.apk "dist-rustore/ChessPenguin-${version}-rustore.apk"
|
||||
build_tools="$(ls -d "${ANDROID_HOME:-$HOME/Android/Sdk}"/build-tools/* | sort -V | tail -n1)"
|
||||
for apk in dist/ChessPenguin-"${version}"-android*.apk; do
|
||||
for apk in dist/ChessPenguin-"${version}"-android*.apk dist-rustore/ChessPenguin-"${version}"-rustore.apk; do
|
||||
"${build_tools}/apksigner" verify "${apk}"
|
||||
"${build_tools}/zipalign" -c -P 16 4 "${apk}"
|
||||
done
|
||||
(cd dist && sha256sum ChessPenguin-"${version}"-android*.apk > ChessPenguin-"${version}"-android.sha256)
|
||||
ls -l dist
|
||||
# The store's build asks for nothing it would not need.
|
||||
if "${build_tools}/aapt2" dump permissions "dist-rustore/ChessPenguin-${version}-rustore.apk" | grep -q 'INSTALL_PACKAGES'; then
|
||||
echo "the RuStore build may install packages" >&2
|
||||
exit 1
|
||||
fi
|
||||
ls -l dist dist-rustore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue