From 2b8d2d49e80e12a7b2795202aada06f4c732d900 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 7 Aug 2024 12:50:14 +1000 Subject: [PATCH 1/5] Making sure we do not have AD_ID in the app --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index f8fa9e2c2f..fcdde6dea4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,7 +31,7 @@ configurations.all { exclude module: "commons-logging" } -def canonicalVersionCode = 377 +def canonicalVersionCode = 378 def canonicalVersionName = "1.19.0" def postFixSize = 10 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d70c9e080e..250ca69528 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -61,6 +61,7 @@ + From 2c4b8bf443567b4b96a8b7ce5db885721371343b Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 7 Aug 2024 14:33:24 +1000 Subject: [PATCH 2/5] Do not check errors if profileAvatar is null --- .../libsession/messaging/jobs/RetrieveProfileAvatarJob.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt b/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt index 54efa1c80b..dfbc413472 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt @@ -39,7 +39,7 @@ class RetrieveProfileAvatarJob(private val profileAvatar: String?, val recipient override suspend fun execute(dispatcherName: String) { val delegate = delegate ?: return Log.w(TAG, "RetrieveProfileAvatarJob has no delegate method to work with!") - if (profileAvatar in errorUrls) return delegate.handleJobFailed(this, dispatcherName, Exception("Profile URL 404'd this app instance")) + if (profileAvatar != null && profileAvatar in errorUrls) return delegate.handleJobFailed(this, dispatcherName, Exception("Profile URL 404'd this app instance")) val context = MessagingModuleConfiguration.shared.context val storage = MessagingModuleConfiguration.shared.storage val recipient = Recipient.from(context, recipientAddress, true) From 76a74f7e9f6b06392b7aca87f723ace016c4eea9 Mon Sep 17 00:00:00 2001 From: alansley Date: Wed, 7 Aug 2024 15:31:19 +1000 Subject: [PATCH 3/5] Upgraded firebase from v18.0.0 to v24.0.0 --- app/build.gradle | 3 +-- .../notifications/FirebaseTokenFetcher.kt | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fcdde6dea4..21e2521ece 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -263,7 +263,7 @@ dependencies { implementation 'androidx.fragment:fragment-ktx:1.5.3' implementation "androidx.core:core-ktx:$coreVersion" implementation "androidx.work:work-runtime-ktx:2.7.1" - playImplementation ("com.google.firebase:firebase-messaging:18.0.0") { + playImplementation ("com.google.firebase:firebase-messaging:24.0.0") { exclude group: 'com.google.firebase', module: 'firebase-core' exclude group: 'com.google.firebase', module: 'firebase-analytics' exclude group: 'com.google.firebase', module: 'firebase-measurement-connector' @@ -393,7 +393,6 @@ dependencies { implementation "androidx.camera:camera-lifecycle:1.3.2" implementation "androidx.camera:camera-view:1.3.2" - implementation 'com.google.firebase:firebase-core:21.1.1' implementation "com.google.mlkit:barcode-scanning:17.2.0" } diff --git a/app/src/play/kotlin/org/thoughtcrime/securesms/notifications/FirebaseTokenFetcher.kt b/app/src/play/kotlin/org/thoughtcrime/securesms/notifications/FirebaseTokenFetcher.kt index d40f160d0b..22c258ddcf 100644 --- a/app/src/play/kotlin/org/thoughtcrime/securesms/notifications/FirebaseTokenFetcher.kt +++ b/app/src/play/kotlin/org/thoughtcrime/securesms/notifications/FirebaseTokenFetcher.kt @@ -1,19 +1,19 @@ package org.thoughtcrime.securesms.notifications -import com.google.android.gms.tasks.Tasks -import com.google.firebase.iid.FirebaseInstanceId +import com.google.firebase.messaging.FirebaseMessaging + import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.isActive +import kotlinx.coroutines.tasks.await import kotlinx.coroutines.withContext import javax.inject.Inject import javax.inject.Singleton @Singleton class FirebaseTokenFetcher @Inject constructor(): TokenFetcher { + val TAG = "FirebaseTF" + override suspend fun fetch() = withContext(Dispatchers.IO) { - FirebaseInstanceId.getInstance().instanceId - .also(Tasks::await) - .takeIf { isActive } // don't 'complete' task if we were canceled - ?.run { result?.token ?: throw exception!! } + FirebaseMessaging.getInstance().token.await().takeIf { isActive } ?: throw Exception("Firebase token is null") } -} +} \ No newline at end of file From bbac0939f57572fbdc127d3e32d03b06d4afd7d3 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 7 Aug 2024 15:57:44 +1000 Subject: [PATCH 4/5] Unchecked code --- .../messagerequests/MessageRequestsAdapter.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsAdapter.kt b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsAdapter.kt index 3040bb774f..07f3f02c66 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsAdapter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsAdapter.kt @@ -1,13 +1,14 @@ package org.thoughtcrime.securesms.messagerequests import android.content.Context -import android.content.res.ColorStateList import android.database.Cursor +import android.os.Build import android.text.SpannableString import android.text.style.ForegroundColorSpan import android.view.ContextThemeWrapper import android.view.ViewGroup import android.widget.PopupMenu +import androidx.core.graphics.drawable.DrawableCompat import androidx.recyclerview.widget.RecyclerView import network.loki.messenger.R import org.session.libsession.utilities.ThemeUtil @@ -63,10 +64,17 @@ class MessageRequestsAdapter( val s = SpannableString(item.title) val danger = ThemeUtil.getThemedColor(context, R.attr.danger) s.setSpan(ForegroundColorSpan(danger), 0, s.length, 0) - item.iconTintList = ColorStateList.valueOf(danger) + item.icon?.let { + DrawableCompat.setTint( + it, + danger + ) + } item.title = s } - popupMenu.setForceShowIcon(true) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + popupMenu.setForceShowIcon(true) + } popupMenu.show() } From a742620b6f50ac81c413af3429d68c3b097648a3 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Wed, 7 Aug 2024 16:01:25 +1000 Subject: [PATCH 5/5] Not needed anymre --- app/src/main/AndroidManifest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 250ca69528..d70c9e080e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -61,7 +61,6 @@ -