Skip to content

Commit fc4596c

Browse files
authored
Merge pull request #2327 from ImranR98/dev
- Better error message for file deletion failures (#2298) - Experiment with smarter version detection (#2324) - Support Debian-style standard versions (#2314) - Minor UI tweak (pseudo-version in italics on apps page instead of readout) - Search should not select any sources by default - Update Android-side Gradle + upgrade to Java 21 + upgrade Flutter packages where possible
2 parents a2a1f48 + f6587ae commit fc4596c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+295
-295
lines changed

.flutter

Submodule .flutter updated 3634 files

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/setup-java@v4
2121
with:
2222
distribution: 'temurin' # See 'Supported distributions' for available options
23-
java-version: '17'
23+
java-version: '21'
2424

2525
- name: Flutter Doctor
2626
id: flutter_doctor
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Build APKs
4646
run: |
47-
sed -i 's/signingConfig signingConfigs.release//g' android/app/build.gradle
47+
sed -i 's/signingConfig = signingConfigs.getByName("release")//g' android/app/build.gradle.kts
4848
flutter build apk --flavor normal && flutter build apk --split-per-abi --flavor normal
4949
for file in build/app/outputs/flutter-apk/app-*normal*.apk*; do mv "$file" "${file//-normal/}"; done
5050
flutter build apk --flavor fdroid -t lib/main_fdroid.dart && flutter build apk --split-per-abi --flavor fdroid -t lib/main_fdroid.dart

android/app/build.gradle

Lines changed: 0 additions & 105 deletions
This file was deleted.

android/app/build.gradle.kts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import java.io.FileInputStream
2+
import java.util.Properties
3+
import com.android.build.api.variant.FilterConfiguration.FilterType.*
4+
5+
plugins {
6+
id("com.android.application")
7+
id("kotlin-android")
8+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
9+
id("dev.flutter.flutter-gradle-plugin")
10+
}
11+
12+
val localProperties = Properties()
13+
val localPropertiesFile = rootProject.file("local.properties")
14+
if (localPropertiesFile.exists()) {
15+
localPropertiesFile.reader(Charsets.UTF_8).use { reader ->
16+
localProperties.load(reader)
17+
}
18+
}
19+
20+
var flutterVersionCode = localProperties.getProperty("flutter.versionCode") ?: "1"
21+
var flutterVersionName = localProperties.getProperty("flutter.versionName") ?: "1.0"
22+
23+
val keystoreProperties = Properties()
24+
val keystorePropertiesFile = rootProject.file("key.properties")
25+
if (keystorePropertiesFile.exists()) {
26+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
27+
}
28+
29+
android {
30+
namespace = "dev.imranr.obtainium"
31+
compileSdk = flutter.compileSdkVersion
32+
ndkVersion = "27.0.12077973" // 'flutter.ndkVersion' produces warnings (TODO can/should we switch back?)
33+
34+
compileOptions {
35+
isCoreLibraryDesugaringEnabled = true
36+
sourceCompatibility = JavaVersion.VERSION_11
37+
targetCompatibility = JavaVersion.VERSION_11
38+
}
39+
40+
kotlinOptions {
41+
jvmTarget = JavaVersion.VERSION_11.toString()
42+
}
43+
44+
defaultConfig {
45+
applicationId = "dev.imranr.obtainium"
46+
// You can update the following values to match your application needs.
47+
// For more information, see: https://flutter.dev/to/review-gradle-config.
48+
minSdk = 24
49+
targetSdk = flutter.targetSdkVersion
50+
versionCode = flutterVersionCode.toInt()
51+
versionName = flutterVersionName
52+
}
53+
54+
flavorDimensions("flavor")
55+
56+
productFlavors {
57+
create("normal") {
58+
dimension = "flavor"
59+
applicationIdSuffix = ""
60+
}
61+
create("fdroid") {
62+
dimension = "flavor"
63+
applicationIdSuffix = ".fdroid"
64+
}
65+
}
66+
67+
signingConfigs {
68+
create("release") {
69+
keyAlias = keystoreProperties["keyAlias"].toString()
70+
keyPassword = keystoreProperties["keyPassword"].toString()
71+
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
72+
storePassword = keystoreProperties["storePassword"].toString()
73+
}
74+
}
75+
76+
buildTypes {
77+
getByName("release") {
78+
signingConfig = signingConfigs.getByName("release")
79+
}
80+
getByName("debug") {
81+
applicationIdSuffix = ".debug"
82+
versionNameSuffix = "-debug"
83+
}
84+
}
85+
}
86+
87+
val abiCodes = mapOf("x86_64" to 1, "armeabi-v7a" to 2, "arm64-v8a" to 3)
88+
89+
androidComponents {
90+
onVariants { variant ->
91+
variant.outputs.forEach { output ->
92+
val name = output.filters.find { it.filterType == ABI }?.identifier
93+
val baseAbiCode = abiCodes[name]
94+
if (baseAbiCode != null) {
95+
output.versionCode.set(baseAbiCode + ((output.versionCode.get() ?: 0) * 10))
96+
}
97+
}
98+
}
99+
}
100+
101+
dependencies {
102+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
103+
}
104+
105+
flutter {
106+
source = "../.."
107+
}

android/app/src/main/kotlin/dev/imranr/obtainium/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ package dev.imranr.obtainium
22

33
import io.flutter.embedding.android.FlutterActivity
44

5-
class MainActivity: FlutterActivity()
5+
class MainActivity : FlutterActivity()

android/build.gradle

Lines changed: 0 additions & 22 deletions
This file was deleted.

android/build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
allprojects {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
maven {
6+
// [required] background_fetch
7+
url = uri("${project(":background_fetch").projectDir}/libs")
8+
}
9+
}
10+
}
11+
12+
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
13+
rootProject.layout.buildDirectory.value(newBuildDir)
14+
15+
subprojects {
16+
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
17+
project.layout.buildDirectory.value(newSubprojectBuildDir)
18+
}
19+
subprojects {
20+
project.evaluationDependsOn(":app")
21+
}
22+
23+
tasks.register<Delete>("clean") {
24+
delete(rootProject.layout.buildDirectory)
25+
}

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
1+
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip

android/settings.gradle

Lines changed: 0 additions & 25 deletions
This file was deleted.

android/settings.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pluginManagement {
2+
val flutterSdkPath = run {
3+
val properties = java.util.Properties()
4+
file("local.properties").inputStream().use { properties.load(it) }
5+
val flutterSdkPath = properties.getProperty("flutter.sdk")
6+
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7+
flutterSdkPath
8+
}
9+
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11+
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
19+
plugins {
20+
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21+
id("com.android.application") version "8.7.3" apply false
22+
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
23+
}
24+
25+
include(":app")

assets/translations/ar.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
"welcome": "مرحبًا",
330330
"documentationLinksNote": "تحتوي صفحة Obtainium على GitHub المرتبطة أدناه على روابط لمقاطع فيديو، مقالات، مناقشات وموارد أخرى ستساعدك على فهم كيفية استخدام التطبيق.",
331331
"batteryOptimizationNote": "لاحظ أن التنزيلات في الخلفية قد تعمل بشكل أكثر موثوقية إذا قمت بتعطيل تحسينات بطارية النظام لـ Obtainium.",
332+
"fileDeletionError": "فشل حذف الملف (حاول حذفه يدويًا ثم حاول مرة أخرى): \"{}\"",
332333
"removeAppQuestion": {
333334
"one": "إزالة التطبيق؟",
334335
"other": "إزالة التطبيقات؟"

assets/translations/bs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
"welcome": "Welcome",
330330
"documentationLinksNote": "The Obtainium GitHub page linked below contains links to videos, articles, discussions and other resources that will help you understand how to use the app.",
331331
"batteryOptimizationNote": "Note that background downloads may work more reliably if you disable OS battery optimizations for Obtainium.",
332+
"fileDeletionError": "Failed to delete file (try deleting it manually then try again): \"{}\"",
332333
"removeAppQuestion": {
333334
"one": "Želite li ukloniti aplikaciju?",
334335
"other": "Želite li ukloniti aplikacije?"

assets/translations/ca.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
"welcome": "Benvinguda",
330330
"documentationLinksNote": "La pàgina GitHub d'Obtainium enllaçada a sota conté enllaços a vídeos, articles, debats i altres recursos que t'ajudaran a entendre com usar l'aplicació.",
331331
"batteryOptimizationNote": "Tingues present que les descàrregues en segon pla funcionaran millor si inhabilites l'optimització de bateria per a Obtainium.",
332+
"fileDeletionError": "Failed to delete file (try deleting it manually then try again): \"{}\"",
332333
"removeAppQuestion": {
333334
"one": "¿Suprimeixo l'aplicació?",
334335
"other": "¿Suprimeixo les aplicacions?"

assets/translations/cs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
"welcome": "Vítejte na",
330330
"documentationLinksNote": "Níže odkazovaná stránka Obtainium GitHub obsahuje odkazy na videa, články, diskuse a další zdroje, které vám pomohou pochopit, jak aplikaci používat.",
331331
"batteryOptimizationNote": "Všimněte si, že stahování na pozadí může fungovat spolehlivěji, pokud vypnete optimalizaci baterie operačního systému pro Obtainium.",
332+
"fileDeletionError": "Soubor se nepodařilo odstranit (zkuste jej odstranit ručně a pak to zkuste znovu): \"{}\"",
332333
"removeAppQuestion": {
333334
"one": "Odstranit Apku?",
334335
"other": "Odstranit Apky?"

assets/translations/da.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@
329329
"welcome": "Velkommen",
330330
"documentationLinksNote": "Obtainiums GitHub-side, som der linkes til nedenfor, indeholder links til videoer, artikler, diskussioner og andre ressourcer, som kan hjælpe dig med at forstå, hvordan du bruger appen.",
331331
"batteryOptimizationNote": "Bemærk, at baggrundsdownloads kan fungere mere pålideligt, hvis du deaktiverer OS-batterioptimering for Obtainium.",
332+
"fileDeletionError": "Kunne ikke slette filen (prøv at slette den manuelt og prøv igen): \"{}\"",
332333
"removeAppQuestion": {
333334
"one": "Fjern app?",
334335
"other": "Fjern apps?"

0 commit comments

Comments
 (0)