Skip to content

Commit

Permalink
Shrink apk file size
Browse files Browse the repository at this point in the history
Split apks to arm v7a and v8
  • Loading branch information
Octav14n committed Aug 18, 2024
1 parent 20ed4f9 commit 1f8f44f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A Android frontend for https://github.com/JimmXinu/FanFicFare

Download apk from ![](app/src/main/res/drawable-mdpi/ic_notification_download.png)[ releases](https://github.com/Octav14n/BoFiLo/releases)
Download apk from ![](app/src/main/res/drawable-mdpi/ic_notification_download.png)[ releases](https://github.com/Octav14n/BoFiLo/releases), if you don't know which Version matches your device, use the one ending in "...-universal-release.apk"

## How to use this App

Expand Down
28 changes: 28 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,34 @@ android {
setProperty("archivesBaseName", "BoFiLo_v$versionName")

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// Ref: https://developer.android.com/studio/build/configure-apk-splits.html#configure-abi-split
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
var isRelease = false
gradle.startParameter.taskNames.find {
// Enable split for release builds in different build flavors
// (assemblePaidRelease, assembleFreeRelease, etc.).
if (it.matches(Regex(".*assemble.*Release.*"))) {
isRelease = true
return@find true // break
}

return@find false // continue
}

isEnable = isRelease
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for armeabi-v7a, x86, arm64-v8a and x86_64.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include("armeabi-v7a", "arm64-v8a") //, "x86", "x86_64")
// Generate a universal APK that includes all ABIs, so user who installs from CI tool can use this one by default.
isUniversalApk = true
}
}

ndk {
//noinspection ChromeOsAbiSupport
Expand Down

0 comments on commit 1f8f44f

Please sign in to comment.