From c123b28652baa6f4d3e4bf57ed5c7bf79314cc74 Mon Sep 17 00:00:00 2001 From: sadorowo Date: Thu, 13 Jun 2024 09:44:42 +0200 Subject: [PATCH] fix missing Intent receiver flags for Tiramisu+ --- app/build.gradle | 34 +++++++++---------- .../szczodrzynski/edziennik/MainActivity.kt | 9 ++++- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ceacc39b..5d0e7564 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -144,34 +144,32 @@ tasks.whenTaskAdded { task -> } dependencies { - debugImplementation fileTree(include: ['*.jar','*.aar'], dir: 'libs') + implementation fileTree(include: ['*.jar'], dir: 'libs') // Language cores implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "androidx.multidex:multidex:2.0.1" -// implementation files('libs/navlib-debug.aar') -// implementation files('libs/navlib-font-debug.aar') - coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4" + coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5" // Android Jetpack - implementation "androidx.appcompat:appcompat:1.7.0" + implementation "androidx.appcompat:appcompat:1.5.1" implementation "androidx.cardview:cardview:1.0.0" implementation "androidx.constraintlayout:constraintlayout:2.1.4" - implementation "androidx.core:core-ktx:1.13.1" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.2" - implementation "androidx.navigation:navigation-fragment-ktx:2.7.7" - implementation "androidx.recyclerview:recyclerview:1.3.2" - implementation "androidx.room:room-runtime:2.6.1" - implementation "androidx.work:work-runtime-ktx:2.9.0" - kapt "androidx.room:room-compiler:2.6.1" + implementation "androidx.core:core-ktx:1.9.0" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1" + implementation "androidx.navigation:navigation-fragment-ktx:2.5.2" + implementation "androidx.recyclerview:recyclerview:1.2.1" + implementation "androidx.room:room-runtime:2.4.3" + implementation "androidx.work:work-runtime-ktx:2.7.1" + kapt "androidx.room:room-compiler:2.4.3" // Google design libs - implementation "com.google.android.material:material:1.12.0" + implementation "com.google.android.material:material:1.11.0-beta01" implementation "com.google.android.flexbox:flexbox:3.0.0" // Play Services/Firebase - implementation "com.google.android.gms:play-services-wearable:18.2.0" + implementation "com.google.android.gms:play-services-wearable:17.1.0" implementation("com.google.firebase:firebase-core") { version { strictly "19.0.2" } } - implementation "com.google.firebase:firebase-crashlytics:19.0.1" + implementation "com.google.firebase:firebase-crashlytics:18.2.13" implementation("com.google.firebase:firebase-messaging") { version { strictly "20.1.3" } } // OkHttp, Retrofit, Gson, Jsoup @@ -179,7 +177,7 @@ dependencies { implementation "com.squareup.retrofit2:retrofit:2.9.0" implementation "com.squareup.retrofit2:converter-gson:2.9.0" implementation "com.squareup.retrofit2:converter-scalars:2.9.0" - implementation 'com.google.code.gson:gson:2.10.1' + implementation 'com.google.code.gson:gson:2.8.8' implementation 'org.jsoup:jsoup:1.14.3' implementation "pl.droidsonroids:jspoon:1.3.2" implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2" @@ -215,7 +213,7 @@ dependencies { implementation "com.daimajia.swipelayout:library:1.2.0@aar" implementation "com.github.Applandeo:Material-Calendar-View:15de569cbc" // https://github.com/Applandeo/Material-Calendar-View implementation "com.github.CanHub:Android-Image-Cropper:2.2.2" // https://github.com/CanHub/Android-Image-Cropper - implementation "com.github.ChuckerTeam.Chucker:library:3.0.1" // https://github.com/ChuckerTeam/chucker + implementation "com.github.ChuckerTeam.Chucker:library:3.5.2" // https://github.com/ChuckerTeam/chucker implementation "com.github.antonKozyriatskyi:CircularProgressIndicator:1.2.2" // https://github.com/antonKozyriatskyi/CircularProgressIndicator implementation "com.github.bassaer:chatmessageview:2.0.1" // https://github.com/bassaer/ChatMessageView implementation "com.github.hypertrack:hyperlog-android:0.0.10" // https://github.com/hypertrack/hyperlog-android @@ -257,5 +255,5 @@ dependencies { debugImplementation 'net.yslibrary.licenseadapter:licenseadapter:3.0.0' - testImplementation 'junit:junit:4.13.2' + testImplementation 'junit:junit:4.13' } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 32b20e76..2f633ffe 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -1,5 +1,6 @@ package pl.szczodrzynski.edziennik +import android.annotation.SuppressLint import android.app.ActivityManager import android.content.BroadcastReceiver import android.content.Context @@ -986,7 +987,13 @@ class MainActivity : AppCompatActivity(), CoroutineScope { d(TAG, "Activity resumed") val filter = IntentFilter() filter.addAction(Intent.ACTION_MAIN) - registerReceiver(intentReceiver, filter) + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) + registerReceiver(intentReceiver, filter, RECEIVER_NOT_EXPORTED) + else + @Suppress("UnspecifiedRegisterReceiverFlag") + registerReceiver(intentReceiver, filter) + EventBus.getDefault().register(this) super.onResume() }