mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 00:51:17 -08:00
perf(android): shrink the release APK
This commit is contained in:
5 files changed
+23
-7
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Shrink the Android APK: strip the native library, drop bundled source maps, and split the F-Droid build per ABI.
|
||||
@@ -326,7 +326,7 @@ jobs:
|
||||
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
|
||||
|
||||
# Must run before the Google build: they share one Gradle output directory.
|
||||
- name: Build FOSS Android APK
|
||||
- name: Build FOSS Android APKs
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
shell: bash
|
||||
env:
|
||||
@@ -335,13 +335,16 @@ jobs:
|
||||
# tauri-build validates every file in capabilities/, so the geolocation
|
||||
# permissions must be absent, not just unreferenced.
|
||||
rm src-tauri/capabilities/geolocation.json
|
||||
pnpm tauri android build --apk --target aarch64 armv7 -- --no-default-features --features wry,matrix-crypto
|
||||
pnpm tauri android build --apk --split-per-abi --target aarch64 armv7 -- --no-default-features --features wry,matrix-crypto
|
||||
git checkout -- src-tauri/capabilities/geolocation.json
|
||||
OUT='src-tauri/gen/android/app/build/outputs/apk/universal/release'
|
||||
APK=$(find "$OUT" -name '*.apk' -type f | head -1)
|
||||
[ -n "$APK" ] || { echo 'FOSS APK not found' >&2; exit 1; }
|
||||
mkdir -p android-artifacts
|
||||
mv "$APK" "android-artifacts/Sable-${VERSION}-android-universal-foss.apk"
|
||||
for pair in 'arm64:arm64' 'arm:armv7'; do
|
||||
FLAVOR=${pair%%:*}
|
||||
ABI=${pair##*:}
|
||||
APK=$(find "src-tauri/gen/android/app/build/outputs/apk/$FLAVOR/release" -name '*.apk' -type f | head -1)
|
||||
[ -n "$APK" ] || { echo "FOSS $ABI APK not found" >&2; exit 1; }
|
||||
mv "$APK" "android-artifacts/Sable-${VERSION}-android-${ABI}-foss.apk"
|
||||
done
|
||||
|
||||
- name: Build Android bundles
|
||||
shell: bash
|
||||
|
||||
@@ -243,3 +243,8 @@ tauri-typegen = { git = "https://github.com/SableClient/tauri-typegen", branch =
|
||||
# tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
|
||||
# tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
|
||||
# tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "feat/cef" }
|
||||
|
||||
[profile.release]
|
||||
strip = "symbols"
|
||||
lto = "thin"
|
||||
codegen-units = 1
|
||||
@@ -58,6 +58,9 @@ android {
|
||||
getByName("release") {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
isMinifyEnabled = true
|
||||
packaging {
|
||||
jniLibs.useLegacyPackaging = true
|
||||
}
|
||||
proguardFiles(
|
||||
*fileTree(".") { include("**/*.pro") }
|
||||
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ const callEmbeddedDir = 'node_modules/@sableclient/sable-call-embedded/dist';
|
||||
const copyFiles = {
|
||||
targets: [
|
||||
{
|
||||
src: callEmbeddedDir,
|
||||
src: [callEmbeddedDir, `!${callEmbeddedDir}/**/*.map`],
|
||||
dest: 'public/element-call',
|
||||
rename: { stripBase: callEmbeddedDir.split('/').length },
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user