Skip to content

Commit 26be477

Browse files
committed
Merge branch 'develop'
2 parents fae70f4 + 8fc3307 commit 26be477

Some content is hidden

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

65 files changed

+1090
-324
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Harden Runner
20-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
20+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
2121
with:
2222
egress-policy: audit
2323

.github/workflows/quality-check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Harden Runner
21-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
21+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
2222
with:
2323
egress-policy: audit
2424

@@ -55,7 +55,7 @@ jobs:
5555
build-mode: manual
5656
steps:
5757
- name: Harden Runner
58-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
58+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
5959
with:
6060
egress-policy: audit
6161

@@ -72,7 +72,7 @@ jobs:
7272

7373
# Initializes the CodeQL tools for scanning.
7474
- name: Initialize CodeQL
75-
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
75+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
7676
with:
7777
languages: ${{ matrix.language }}
7878
build-mode: ${{ matrix.build-mode }}
@@ -86,6 +86,6 @@ jobs:
8686
./flutterw build apk --profile -t lib/main_play.dart --flavor play
8787
8888
- name: Perform CodeQL Analysis
89-
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
89+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
9090
with:
9191
category: "/language:${{matrix.language}}"

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
id-token: write
1919
steps:
2020
- name: Harden Runner
21-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
21+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
2222
with:
2323
egress-policy: audit
2424

@@ -83,7 +83,7 @@ jobs:
8383
subject-path: 'outputs/*'
8484

8585
- name: Create GitHub release
86-
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
86+
uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
8787
with:
8888
artifacts: "outputs/*"
8989
body: "[Changelog](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ github.ref_name }})"
@@ -101,7 +101,7 @@ jobs:
101101
runs-on: ubuntu-latest
102102
steps:
103103
- name: Harden Runner
104-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
104+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
105105
with:
106106
egress-policy: audit
107107

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333
- name: Harden Runner
34-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
34+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
3535
with:
3636
egress-policy: audit
3737

@@ -71,6 +71,6 @@ jobs:
7171

7272
# Upload the results to GitHub's code scanning dashboard.
7373
- name: "Upload to code-scanning"
74-
uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
74+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
7575
with:
7676
sarif_file: results.sarif

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
## <a id="unreleased"></a>[Unreleased]
66

7+
## <a id="v1.13.4"></a>[v1.13.4] - 2025-07-09
8+
9+
### Added
10+
11+
- Map: allow setting subdomains, user-agent for custom styles
12+
13+
### Fixed
14+
15+
- showing directories wrongly registered as media in the Media Store
16+
- apply preferred first day of the week for date picker
17+
718
## <a id="v1.13.3"></a>[v1.13.3] - 2025-06-25
819

920
### Added

android/app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ android {
5555
}
5656
}
5757

58-
flavorDimensions = ["store"]
58+
flavorDimensions += "store"
5959

6060
productFlavors {
6161
play {
@@ -93,9 +93,9 @@ android {
9393
applicationIdSuffix ".profile"
9494
}
9595
release {
96-
signingConfig signingConfigs.release
97-
minifyEnabled true
98-
shrinkResources true
96+
signingConfig = signingConfigs.release
97+
minifyEnabled = true
98+
shrinkResources = true
9999
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
100100
}
101101

@@ -178,7 +178,7 @@ dependencies {
178178
implementation 'com.github.deckerst:pixymeta-android:f4513291b7'
179179
implementation project(':exifinterface')
180180

181-
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.13.2'
181+
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.13.3'
182182

183183
kapt 'androidx.annotation:annotation:1.9.1'
184184
ksp "com.github.bumptech.glide:ksp:$glide_version"

android/app/src/main/kotlin/deckers/thibault/aves/AnalysisWorker.kt

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,40 @@ import deckers.thibault.aves.utils.LogUtils
2828
import io.flutter.embedding.engine.FlutterEngine
2929
import io.flutter.plugin.common.MethodCall
3030
import io.flutter.plugin.common.MethodChannel
31+
import kotlinx.coroutines.CancellableContinuation
32+
import kotlinx.coroutines.CancellationException
3133
import kotlinx.coroutines.CoroutineScope
3234
import kotlinx.coroutines.Dispatchers
3335
import kotlinx.coroutines.SupervisorJob
3436
import kotlinx.coroutines.launch
3537
import kotlinx.coroutines.runBlocking
36-
import kotlin.coroutines.Continuation
38+
import kotlinx.coroutines.suspendCancellableCoroutine
3739
import kotlin.coroutines.resume
3840
import kotlin.coroutines.resumeWithException
39-
import kotlin.coroutines.suspendCoroutine
4041

4142
class AnalysisWorker(context: Context, parameters: WorkerParameters) : CoroutineWorker(context, parameters) {
4243
private val defaultScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
43-
private var workCont: Continuation<Any?>? = null
44+
private var workCont: CancellableContinuation<Any?>? = null
4445
private var flutterEngine: FlutterEngine? = null
4546
private var backgroundChannel: MethodChannel? = null
4647

4748
override suspend fun doWork(): Result {
4849
Log.i(LOG_TAG, "Start analysis worker $id")
49-
defaultScope.launch {
50-
// prevent ANR triggered by slow operations in main thread
51-
createNotificationChannel()
52-
setForeground(createForegroundInfo())
53-
}.join()
54-
suspendCoroutine { cont ->
55-
workCont = cont
56-
onStart()
50+
createNotificationChannel()
51+
val foregroundInfo = createForegroundInfo()
52+
if (!isStopped) {
53+
setForeground(foregroundInfo)
54+
suspendCancellableCoroutine { cont ->
55+
workCont = cont
56+
cont.invokeOnCancellation {
57+
Log.i(LOG_TAG, "Analysis worker got cancelled")
58+
stopDartAnalysisService()
59+
workCont?.resumeWithException(CancellationException())
60+
}
61+
onStart()
62+
}
63+
dispose()
5764
}
58-
dispose()
5965
return Result.success()
6066
}
6167

@@ -81,17 +87,7 @@ class AnalysisWorker(context: Context, parameters: WorkerParameters) : Coroutine
8187

8288
val preferences = applicationContext.getSharedPreferences(SHARED_PREFERENCES_KEY, Context.MODE_PRIVATE)
8389
val entryIdStrings = preferences.getStringSet(PREF_ENTRY_IDS_KEY, null)
84-
85-
runBlocking {
86-
FlutterUtils.runOnUiThread {
87-
backgroundChannel?.invokeMethod(
88-
"start", hashMapOf(
89-
"entryIds" to entryIdStrings?.map { Integer.parseUnsignedInt(it) }?.toList(),
90-
"force" to inputData.getBoolean(KEY_FORCE, false),
91-
)
92-
)
93-
}
94-
}
90+
startDartAnalysisService(entryIdStrings)
9591
} catch (e: Exception) {
9692
Log.e(LOG_TAG, "failed to initialize worker", e)
9793
workCont?.resumeWithException(e)
@@ -126,6 +122,27 @@ class AnalysisWorker(context: Context, parameters: WorkerParameters) : Coroutine
126122
}
127123
}
128124

125+
private fun startDartAnalysisService(entryIdStrings: Set<String>?) {
126+
runBlocking {
127+
FlutterUtils.runOnUiThread {
128+
backgroundChannel?.invokeMethod(
129+
"start", hashMapOf(
130+
"entryIds" to entryIdStrings?.map { Integer.parseUnsignedInt(it) }?.toList(),
131+
"force" to inputData.getBoolean(KEY_FORCE, false),
132+
)
133+
)
134+
}
135+
}
136+
}
137+
138+
private fun stopDartAnalysisService() {
139+
runBlocking {
140+
FlutterUtils.runOnUiThread {
141+
backgroundChannel?.invokeMethod("stop", null)
142+
}
143+
}
144+
}
145+
129146
private fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
130147
when (call.method) {
131148
"initialized" -> {
@@ -136,7 +153,7 @@ class AnalysisWorker(context: Context, parameters: WorkerParameters) : Coroutine
136153
"updateNotification" -> defaultScope.launch { safeSuspend(call, result, ::updateNotification) }
137154

138155
"stop" -> {
139-
workCont?.resume(null)
156+
workCont?.takeIf { it.isActive }?.resume(null)
140157
result.success(null)
141158
}
142159

android/app/src/main/kotlin/deckers/thibault/aves/MainActivity.kt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.app.KeyguardManager
55
import android.app.SearchManager
66
import android.appwidget.AppWidgetManager
77
import android.content.ClipData
8-
import android.content.Context
98
import android.content.Intent
109
import android.net.Uri
1110
import android.os.Build
@@ -85,10 +84,7 @@ open class MainActivity : FlutterFragmentActivity() {
8584

8685
override fun onCreate(savedInstanceState: Bundle?) {
8786
Log.i(LOG_TAG, "onCreate intent=$intent")
88-
89-
intent.extras?.takeUnless { it.isEmpty }?.let {
90-
Log.i(LOG_TAG, "onCreate intent extras=$it")
91-
}
87+
logExtras(intent, "onCreate")
9288

9389
// StrictMode.setThreadPolicy(
9490
// StrictMode.ThreadPolicy.Builder()
@@ -105,6 +101,17 @@ open class MainActivity : FlutterFragmentActivity() {
105101
super.onCreate(savedInstanceState)
106102
}
107103

104+
private fun logExtras(intent: Intent?, method: String) {
105+
try {
106+
intent?.extras?.takeUnless { it.isEmpty }?.let {
107+
Log.i(LOG_TAG, "$method intent extras=$it")
108+
}
109+
} catch (e: Exception) {
110+
// accessing extras may fail if their type comes from sending app
111+
Log.w(LOG_TAG, "failed to parse extras", e)
112+
}
113+
}
114+
108115
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
109116
super.configureFlutterEngine(flutterEngine)
110117

@@ -228,19 +235,15 @@ open class MainActivity : FlutterFragmentActivity() {
228235

229236
override fun onNewIntent(intent: Intent) {
230237
Log.i(LOG_TAG, "onNewIntent intent=$intent")
231-
intent.extras?.takeUnless { it.isEmpty }?.let {
232-
Log.i(LOG_TAG, "onNewIntent intent extras=$it")
233-
}
238+
logExtras(intent, "onNewIntent")
234239
super.onNewIntent(intent)
235240
intentStreamHandler.notifyNewIntent(extractIntentData(intent))
236241
}
237242

238243
@Deprecated("Deprecated in Java")
239244
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
240245
Log.i(LOG_TAG, "onActivityResult requestCode=$requestCode resultCode=$resultCode data=$data")
241-
data?.extras?.takeUnless { it.isEmpty }?.let {
242-
Log.i(LOG_TAG, "onActivityResult intent extras=$it")
243-
}
246+
logExtras(data, "onActivityResult")
244247
super.onActivityResult(requestCode, resultCode, data)
245248
when (requestCode) {
246249
DOCUMENT_TREE_ACCESS_REQUEST -> onDocumentTreeAccessResult(requestCode, resultCode, data)
@@ -332,7 +335,7 @@ open class MainActivity : FlutterFragmentActivity() {
332335
INTENT_DATA_KEY_URI to uri.toString(),
333336
)
334337

335-
val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
338+
val keyguardManager = getSystemService(KEYGUARD_SERVICE) as KeyguardManager
336339
val isLocked = keyguardManager.isKeyguardLocked
337340
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
338341
setShowWhenLocked(isLocked)

android/app/src/main/kotlin/deckers/thibault/aves/channel/calls/DeviceHandler.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import android.provider.MediaStore
1414
import android.provider.Settings
1515
import androidx.core.content.pm.ShortcutManagerCompat
1616
import androidx.core.net.toUri
17+
import androidx.core.text.util.LocalePreferences
1718
import com.google.android.material.color.DynamicColors
1819
import deckers.thibault.aves.channel.calls.Coresult.Companion.safe
1920
import deckers.thibault.aves.model.FieldMap
@@ -36,6 +37,7 @@ class DeviceHandler(private val context: Context) : MethodCallHandler {
3637
"getCapabilities" -> defaultScope.launch { safe(call, result, ::getCapabilities) }
3738
"getLocales" -> safe(call, result, ::getLocales)
3839
"setLocaleConfig" -> safe(call, result, ::setLocaleConfig)
40+
"getFirstDayOfWeek" -> safe(call, result, ::getFirstDayOfWeek)
3941
"getPerformanceClass" -> safe(call, result, ::getPerformanceClass)
4042
"isLocked" -> safe(call, result, ::isLocked)
4143
"isSystemFilePickerEnabled" -> safe(call, result, ::isSystemFilePickerEnabled)
@@ -111,6 +113,10 @@ class DeviceHandler(private val context: Context) : MethodCallHandler {
111113
result.success(true)
112114
}
113115

116+
private fun getFirstDayOfWeek(@Suppress("unused_parameter") call: MethodCall, result: MethodChannel.Result) {
117+
result.success(LocalePreferences.getFirstDayOfWeek())
118+
}
119+
114120
private fun getPerformanceClass(@Suppress("unused_parameter") call: MethodCall, result: MethodChannel.Result) {
115121
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
116122
val performanceClass = Build.VERSION.MEDIA_PERFORMANCE_CLASS

0 commit comments

Comments
 (0)