2ed3ee0ea1
- new lib/src/ui/links.dart holds kPrivacyPolicyUrl (single source of truth for the app, the store listing and the compliance docs) - settings sheet: "Datenschutzerklaerung" tile opens the policy in the browser via url_launcher; manifest grown a <queries> VIEW/https intent so Android 11+ can resolve it - verified on device: tap sends ACTION_VIEW for the URL and Chrome comes up - guard: tools/build_release.sh aborts while links.dart still contains the example.invalid placeholder, so a release cannot ship without a policy URL - docs: compliance row updated (in-app entry done, only the public URL missing)
52 lines
2.0 KiB
Bash
Executable File
52 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Builds a Play-ready App Bundle plus the native debug symbols.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
export ANDROID_NDK_HOME="${ANDROID_NDK_HOME:-$HOME/Android/Sdk/ndk/28.2.13676358}"
|
|
|
|
echo '==> Rust release libraries'
|
|
cargo ndk --platform 24 -t arm64-v8a -t armeabi-v7a -o app/android/app/src/main/jniLibs build --release -p ffi
|
|
|
|
for abi in arm64-v8a armeabi-v7a; do
|
|
so="app/android/app/src/main/jniLibs/$abi/libffi.so"
|
|
# 16 KB pages are mandatory for 64-bit ABIs; 32-bit ARM still uses 4 KB.
|
|
case "$abi" in
|
|
arm64-v8a|x86_64) expect=0x4000 ;;
|
|
*) expect=0x1000 ;;
|
|
esac
|
|
if readelf -lW "$so" | awk -v e="$expect" '$1=="LOAD" && $NF!=e {found=1} END{exit !found}'; then
|
|
echo "ERROR: $abi is not aligned to $expect" >&2
|
|
exit 1
|
|
fi
|
|
echo "OK: $abi aligned to $expect ($(stat -c%s "$so") bytes)"
|
|
done
|
|
|
|
echo '==> Native debug symbols (unstripped)'
|
|
rm -rf build/native-symbols
|
|
mkdir -p build/native-symbols
|
|
for abi in arm64-v8a armeabi-v7a; do
|
|
mkdir -p "build/native-symbols/$abi"
|
|
cp "app/android/app/src/main/jniLibs/$abi/libffi.so" "build/native-symbols/$abi/"
|
|
done
|
|
(cd build/native-symbols && zip -qr ../native-debug-symbols.zip .)
|
|
echo "symbols: $(stat -c%s build/native-debug-symbols.zip) bytes"
|
|
|
|
echo '==> Release guards'
|
|
if grep -q 'example.invalid' app/lib/src/ui/links.dart; then
|
|
echo 'ERROR: privacy policy URL is still the placeholder (app/lib/src/ui/links.dart).' >&2
|
|
echo ' Play rejects a listing whose privacy policy is not reachable.' >&2
|
|
exit 1
|
|
fi
|
|
echo "OK: privacy policy -> $(grep -oE "https://[^']+" app/lib/src/ui/links.dart)"
|
|
|
|
echo '==> Flutter bundle (AAB)'
|
|
(cd app && flutter build appbundle --release)
|
|
|
|
AAB=app/build/app/outputs/bundle/release/app-release.aab
|
|
echo "aab: $(stat -c%s "$AAB") bytes"
|
|
unzip -l "$AAB" | grep -E 'lib/|AndroidManifest' | head -8
|
|
|
|
echo '==> Release APK for device smoke test'
|
|
(cd app && flutter build apk --release --target-platform android-arm64)
|
|
echo "apk: $(stat -c%s app/build/app/outputs/flutter-apk/app-release.apk) bytes"
|