Skip to content

Commit 4597c8b

Browse files
committed
Merge tag 'v0.24.2' into fdroid
Because Flutter version is now pinned in the pusbpec.yaml, the flutter-version file was removed
2 parents f98ac62 + 9532bd1 commit 4597c8b

631 files changed

Lines changed: 7274 additions & 3326 deletions

File tree

Some content is hidden

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

.github/workflows/deploy_play_store.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Set up JDK 17
24-
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
24+
uses: actions/setup-java@v5.2.0
2525
with:
2626
java-version: 17
2727
distribution: temurin
2828

29-
- name: Install Flutter
30-
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0
31-
- run: flutter doctor -v
32-
3329
- name: Checkout mobile code
34-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
uses: actions/checkout@v6.0.2
31+
32+
- name: Install Flutter
33+
uses: subosito/flutter-action@v2.23.0
34+
with:
35+
channel: stable
36+
flutter-version-file: pubspec.yaml
37+
- run: flutter --version
3538

3639
- name: Install dependencies
3740
run: flutter pub get
@@ -40,7 +43,7 @@ jobs:
4043
run: dart run build_runner build
4144

4245
- name: Setup Fastlane
43-
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
46+
uses: ruby/setup-ruby@v1.310.0
4447
with:
4548
ruby-version: "3.2"
4649
bundler-cache: true

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- 'pubspec.yaml'
1010
branches:
1111
- main
12-
- v0.18.x
1312
pull_request:
1413
paths:
1514
- 'lib/**'
@@ -18,7 +17,6 @@ on:
1817
- 'pubspec.yaml'
1918
branches:
2019
- main
21-
- v0.18.x
2220

2321
# Declare default permissions as read only.
2422
permissions: read-all
@@ -31,10 +29,10 @@ jobs:
3129
matrix:
3230
os: [ubuntu-latest]
3331
steps:
34-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
- uses: actions/checkout@v6.0.2
3533

3634
- name: 🐦 Install flutter
37-
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0
35+
uses: subosito/flutter-action@v2.23.0
3836
with:
3937
cache: true
4038
flutter-version-file: pubspec.yaml

.github/workflows/upload_fdroid_apks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
- name: Install Flutter
2626
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0
2727
with:
28-
flutter-version: ${{ env.FLUTTER_VERSION }}
28+
channel: stable
29+
flutter-version-file: pubspec.yaml
2930

3031
- name: Patch Flutter
3132
run: |

CLAUDE.md

Lines changed: 36 additions & 3 deletions

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ analyzer:
2121
- lib/src/styles/social_icons.dart
2222
- lib/firebase_options.dart
2323
- lib/l10n/*.dart
24+
- build/
2425
errors:
2526
invalid_annotation_target: ignore
2627
# plugins:

android/app/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ if (keystorePropertiesFile.exists()) {
3030

3131
android {
3232
namespace = "org.lichess.mobileV2"
33-
compileSdk = flutter.compileSdkVersion
33+
// compileSdk = flutter.compileSdkVersion
34+
// home_widget pulls in glance-appwidget and remote-creation-android, both of which
35+
// declare in their AAR metadata that all dependents (including the app) must compile
36+
// against SDK 37+. This cannot be suppressed — it is enforced by AGP at build time.
37+
compileSdk = 37
3438
ndkVersion = flutter.ndkVersion
3539

3640
compileOptions {

android/app/src/main/AndroidManifest.xml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,23 @@
154154
android:name="flutterEmbedding"
155155
android:value="2" />
156156
</application>
157-
<!-- Required to query activities that can process text, see:
158-
https://developer.android.com/training/package-visibility and
159-
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
160-
161-
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
157+
<!-- On Android 11+ (API 30) package visibility is restricted: the app can only see/resolve other
158+
apps it explicitly declares intents for here. See:
159+
https://developer.android.com/training/package-visibility -->
162160
<queries>
161+
<!-- Lets the Flutter engine resolve text-processing apps (io.flutter.plugin.text.ProcessTextPlugin), see:
162+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT -->
163163
<intent>
164164
<action android:name="android.intent.action.PROCESS_TEXT"/>
165165
<data android:mimeType="text/plain"/>
166166
</intent>
167+
<!-- Lets url_launcher discover a browser/Custom Tabs handler for https. Required for OAuth
168+
login: without it, launchUrl() can't resolve a browser on Android 11+ and returns false,
169+
so the in-app browser never opens and sign-in fails. -->
170+
<intent>
171+
<action android:name="android.intent.action.VIEW" />
172+
<category android:name="android.intent.category.BROWSABLE" />
173+
<data android:scheme="https" />
174+
</intent>
167175
</queries>
168176
</manifest>

android/app/src/main/kotlin/org/lichess/mobileV2/MainActivity.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.lichess.mobileV2
22

33
import android.app.ActivityManager
44
import android.content.Context
5+
import android.content.Intent
56
import android.graphics.Rect
67
import android.os.Bundle
78
import android.util.Log
@@ -20,6 +21,16 @@ class MainActivity: FlutterActivity() {
2021
super.onCreate(savedInstanceState)
2122
}
2223

24+
// The OAuth redirect (org.lichess.mobile://login-callback) is delivered here, not in onCreate,
25+
// because OAuthCallbackActivity forwards it to this already-running singleTop instance. Flutter's
26+
// default handling leaves getIntent() pointing at the stale launch intent, so app_links would read
27+
// the wrong URI and the login flow would never receive the callback. setIntent() updates the
28+
// activity's current intent to the one carrying the OAuth code so app_links surfaces it correctly.
29+
override fun onNewIntent(intent: Intent) {
30+
setIntent(intent)
31+
super.onNewIntent(intent)
32+
}
33+
2334
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
2435
super.configureFlutterEngine(flutterEngine)
2536
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, GESTURES_CHANNEL).setMethodCallHandler {

android/build.gradle.kts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,43 @@ subprojects {
1616
project.evaluationDependsOn(":app")
1717
}
1818

19+
// home_widget 0.9.2 skips applying the Kotlin Gradle Plugin when AGP >= 9, assuming the
20+
// project uses AGP's built-in Kotlin. We keep android.builtInKotlin=false (the app and all
21+
// other plugins still apply KGP), so home_widget's Kotlin sources would never compile,
22+
// producing "cannot find symbol HomeWidgetPlugin" at javac time. Apply KGP to it ourselves,
23+
// right after its android library plugin is applied so ordering is correct.
24+
subprojects {
25+
if (name == "home_widget") {
26+
pluginManager.withPlugin("com.android.library") {
27+
pluginManager.apply("org.jetbrains.kotlin.android")
28+
}
29+
// home_widget's own `jvmTarget = "1.8"` is also gated behind the AGP < 9 check, so
30+
// Kotlin defaults to a target that doesn't match its Java tasks (compiled at 1.8).
31+
// Align Kotlin to 1.8 to avoid "Inconsistent JVM Target Compatibility".
32+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
33+
compilerOptions {
34+
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8)
35+
}
36+
}
37+
}
38+
}
39+
40+
// Some plugins declare a compileSdk lower than what their transitive dependencies require.
41+
// gradle.afterProject fires after each project finishes its own configuration, so it
42+
// runs after the module has set its compileSdk and we can safely override it.
43+
gradle.afterProject {
44+
extensions.findByType(com.android.build.gradle.LibraryExtension::class.java)?.apply {
45+
val minRequired = when (project.name) {
46+
// glance-appwidget:1.3.0-alpha01 and remote-creation-android:1.0.0-alpha11
47+
// both require compileSdk 37+, but home_widget declares only 36.
48+
"home_widget" -> 37
49+
// sound_effect 0.1.3 declares compileSdk 35 but flutter_plugin_android_lifecycle requires 36+.
50+
else -> 36
51+
}
52+
if ((compileSdk ?: 0) < minRequired) compileSdk = minRequired
53+
}
54+
}
55+
1956
tasks.register<Delete>("clean") {
2057
delete(rootProject.layout.buildDirectory)
2158
}

android/gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
4+
# This builtInKotlin flag was added automatically by Flutter migrator
5+
android.builtInKotlin=false
6+
# This newDsl flag was added automatically by Flutter migrator
7+
android.newDsl=false
8+
# AGP 9.0 enforces unique package names; cronet-embedded bundles multiple artifacts
9+
# sharing the org.chromium.net namespace — disable until Chromium fixes this upstream
10+
android.uniquePackageNames=false

0 commit comments

Comments
 (0)