fix missing Intent receiver flags for Tiramisu+

This commit is contained in:
Franek 2024-06-13 09:44:42 +02:00 committed by Kuba Szczodrzyński
parent 5bb7b8ea2c
commit 2fa1474caa
2 changed files with 23 additions and 18 deletions

View File

@ -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"
@ -257,5 +255,5 @@ dependencies {
debugImplementation 'net.yslibrary.licenseadapter:licenseadapter:3.0.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'junit:junit:4.13'
}

View File

@ -1,5 +1,6 @@
package pl.szczodrzynski.edziennik
import android.annotation.SuppressLint
import android.app.ActivityManager
import android.content.BroadcastReceiver
import android.content.Context
@ -791,7 +792,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()
}