From 494246097da38023f3f3f8ede18610e477466e48 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 25 Sep 2024 11:20:58 +0200
Subject: [PATCH] fix(deps): update dependency
com.github.unifiedpush:android-connector to v2.5.0 (#915)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[com.github.UnifiedPush:android-connector](https://unifiedpush.org/developers/android/)
([source](https://codeberg.org/UnifiedPush/android-connector)) | `2.4.0`
-> `2.5.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.github.UnifiedPush:android-connector/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.github.UnifiedPush:android-connector/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.github.UnifiedPush:android-connector/2.4.0/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.github.UnifiedPush:android-connector/2.4.0/2.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.
---
### Release Notes
UnifiedPush/android-connector
(com.github.UnifiedPush:android-connector)
###
[`v2.5.0`](https://codeberg.org/UnifiedPush/android-connector/releases/tag/2.5.0)
[Compare
Source](https://codeberg.org/UnifiedPush/android-connector/compare/2.4.0...2.5.0)
- Avoid possible desynchronization that let the app use the token of a
removed instance
- Deprecate `registerAppWithDialog` in favor of the new lib
`org.unifiedpush.android:connector-ui`
- Drop toolchains in favor of compatibility API, removing requirement of
Java version to build project
- Bump dependencies
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
â™» **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/pachli/pachli-android).
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nik Clayton
---
.../notifications/PushNotificationHelper.kt | 18 +-----------------
gradle/libs.versions.toml | 2 +-
2 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt b/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt
index c933bf334..f9e42b278 100644
--- a/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt
+++ b/app/src/main/java/app/pachli/components/notifications/PushNotificationHelper.kt
@@ -37,8 +37,6 @@ import kotlinx.coroutines.withContext
import org.unifiedpush.android.connector.PREF_MASTER
import org.unifiedpush.android.connector.PREF_MASTER_DISTRIBUTOR
import org.unifiedpush.android.connector.PREF_MASTER_DISTRIBUTOR_ACK
-import org.unifiedpush.android.connector.PREF_MASTER_INSTANCE
-import org.unifiedpush.android.connector.PREF_MASTER_TOKEN
import org.unifiedpush.android.connector.UnifiedPush
import timber.log.Timber
@@ -249,24 +247,10 @@ suspend fun disableAllNotifications(context: Context, api: MastodonApi, accountM
}
/**
- * Disables all push notifications.
- *
- * Disables push notifications for each account, and clears the relevant UnifiedPush preferences
- * to work around a bug.
+ * Disables push push notifications for each account.
*/
private suspend fun disablePushNotifications(context: Context, api: MastodonApi, accountManager: AccountManager) {
accountManager.accounts.forEach { disablePushNotificationsForAccount(context, api, accountManager, it) }
-
- // Clear UnifiedPush preferences, to work around
- // https://github.com/UnifiedPush/android-connector/issues/85
- val prefs = context.getSharedPreferences(PREF_MASTER, Context.MODE_PRIVATE)
- prefs.edit().apply {
- // Remove the set of instances.
- remove(PREF_MASTER_INSTANCE)
-
- // Remove the entry for each instance that points to the instance's token.
- prefs.all.filter { it.key.endsWith("/$PREF_MASTER_TOKEN") }.forEach { remove(it.key) }
- }.apply()
}
/**
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 39eb1ed52..e4b188903 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -74,7 +74,7 @@ timber = "5.0.1"
touchimageview = "3.6"
truth = "1.4.4"
turbine = "1.1.0"
-unified-push = "2.4.0"
+unified-push = "2.5.0"
xmlwriter = "1.0.4"
# Tool dependencies