Skip to content

Commit

Permalink
Update unifiedpush libs
Browse files Browse the repository at this point in the history
  • Loading branch information
p1gp1g authored and valldrac committed Sep 23, 2024
1 parent d701fc5 commit bd23a21
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ dependencies {
implementation(libs.gosimple.nbvcxz)
"fossImplementation"("org.osmdroid:osmdroid-android:6.1.16")
implementation(libs.unifiedpush.connector)
implementation(libs.unifiedpush.connector.ui)

"gmsImplementation"(project(":billing"))

Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/values/strings2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,4 @@
<string name="NotificationMethod__label_unifiedpush">UnifiedPush</string>
<string name="NotificationMethod__label_fcm">Google Services</string>
<string name="NotificationMethod__label_websocket">WebSocket</string>
<string name="UnifiedPush_RegistrationDialog_NoDistrib_title">No notification method found</string>
<string name="UnifiedPush_RegistrationDialog_NoDistrib_message">You have configure Molly to use UnifiedPush, but you haven\'t installed any distributor. For more information, visit https://unifiedpush.org/</string>
<string name="UnifiedPush_RegistrationDialog_NoDistrib_ok">OK</string>
<string name="UnifiedPush_RegistrationDialog_NoDistrib_ignore">Ignore</string>
<string name="UnifiedPush_RegistrationDialog_Choose_title">Choose your notification method</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import android.content.Context
import im.molly.unifiedpush.device.MollySocketLinkedDevice
import im.molly.unifiedpush.model.UnifiedPushStatus
import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.unifiedpush.android.connector.ChooseDialog
import org.unifiedpush.android.connector.NoDistributorDialog
import org.unifiedpush.android.connector.RegistrationDialogContent
import org.unifiedpush.android.connector.INSTANCE_DEFAULT
import org.unifiedpush.android.connector.UnifiedPush
import org.unifiedpush.android.connector.ui.SelectDistributorDialogBuilder
import org.unifiedpush.android.connector.ui.UnifiedPushFunctions

object UnifiedPushHelper {
private val TAG = Log.tag(UnifiedPushHelper::class.java)
Expand All @@ -33,16 +32,16 @@ object UnifiedPushHelper {
fun registerAppWithDialogIfNeeded(context: Context) {
checkDistributorPresence(context)
if (SignalStore.unifiedpush.status == UnifiedPushStatus.MISSING_ENDPOINT) {
val dialogContent = RegistrationDialogContent(
noDistributorDialog = NoDistributorDialog(
title = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_title),
message = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_message),
okButton = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_ok),
ignoreButton = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_ignore)
),
chooseDialog = ChooseDialog(context.getString(R.string.UnifiedPush_RegistrationDialog_Choose_title))
)
UnifiedPush.registerAppWithDialog(context, registrationDialogContent = dialogContent)
object : SelectDistributorDialogBuilder(
context,
listOf(INSTANCE_DEFAULT),
object : UnifiedPushFunctions {
override fun getAckDistributor(): String? = UnifiedPush.getAckDistributor(context)
override fun getDistributors(): List<String> = UnifiedPush.getDistributors(context)
override fun registerApp(instance: String) = UnifiedPush.registerApp(context, instance)
override fun saveDistributor(distributor: String) = UnifiedPush.saveDistributor(context, distributor)
},
){}.show()
}
}

Expand Down
3 changes: 2 additions & 1 deletion dependencies.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ dependencyResolutionManagement {
library("molly-glide-webp-decoder", "im.molly:glide-webp-decoder:1.3.2-2")

// UnifiedPush
library("unifiedpush-connector", "com.github.UnifiedPush:android-connector:2.4.0")
library("unifiedpush-connector", "org.unifiedpush.android:connector:2.5.0")
library("unifiedpush-connector-ui", "org.unifiedpush.android:connector-ui:1.1.0-rc2")

// Third Party
library("greenrobot-eventbus", "org.greenrobot:eventbus:3.0.0")
Expand Down
29 changes: 29 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8427,6 +8427,14 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
<sha256 value="f482314b5079c1455f6fb0d4257a745d101c6124ce961522ba86f9dc90901e47" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jetbrains.kotlin" name="kotlin-stdlib" version="2.0.10">
<artifact name="kotlin-stdlib-2.0.10.jar">
<sha256 value="60f1cefbf1c101676abc9f413f569dad464929d7dc63d5e70e15ae26986e08ac" origin="Generated by Gradle"/>
</artifact>
<artifact name="kotlin-stdlib-2.0.10.module">
<sha256 value="319fd65cd4fe27603ada96a56af22c94c86f132e70b5b4ad00ef4b2b80b95bc9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jetbrains.kotlin" name="kotlin-stdlib-common" version="1.4.21">
<artifact name="kotlin-stdlib-common-1.4.21.jar">
<sha256 value="812cf197d9c4c67e1f47f95e2d72a9b600f0d1124560617bfe9850773eccbcff" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -8502,6 +8510,11 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
<sha256 value="f93c9e9abf8d52d8e8fd8e851aa802ecec55132161c4aeee7d3cd924bf794246" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jetbrains.kotlin" name="kotlin-stdlib-common" version="2.0.10">
<artifact name="kotlin-stdlib-common-2.0.10.module">
<sha256 value="ab210c7fce363f8d8facec3d7e8f764bd09e6cf8fbad7c9e3c047567c5de05fc" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jetbrains.kotlin" name="kotlin-stdlib-jdk7" version="1.4.10">
<artifact name="kotlin-stdlib-jdk7-1.4.10.jar">
<sha256 value="f9566380c08722c780ce33ceee23e98ddf765ca98fabd3e2fabae7975c8d232b" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -9515,6 +9528,22 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
<sha256 value="2c2a264f842498c36d34d2a7b91342490d9a962862c85baac1acd54ec2fca6d9" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.unifiedpush.android" name="connector" version="2.5.0">
<artifact name="connector-2.5.0.aar">
<sha256 value="5d37754a3a8c5cc7be7a1b628a2d56d4e894a92ea82de67563aaab0951aa290e" origin="Generated by Gradle"/>
</artifact>
<artifact name="connector-2.5.0.module">
<sha256 value="173a1bbff5df469ef1eb308dcb58018c42a670533cc9c2d768e9dfe2c66142e6" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.unifiedpush.android" name="connector-ui" version="1.1.0-rc2">
<artifact name="connector-ui-1.1.0-rc2.aar">
<sha256 value="f1e0dfe81d697023deb3d19b6ee6717a677fa74f5fece0eefa45feaf40b7eedd" origin="Generated by Gradle"/>
</artifact>
<artifact name="connector-ui-1.1.0-rc2.module">
<sha256 value="c6e32c120c8e6d73a10960ba995ef1780b5d85743a045f0286e1b46f0647c2e7" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="se.emilsjolander" name="stickylistheaders" version="2.7.0">
<artifact name="stickylistheaders-2.7.0.aar">
<sha256 value="a08ca948aa6b220f09d82f16bbbac395f6b78897e9eeac6a9f0b0ba755928eeb" origin="Generated by Gradle"/>
Expand Down

0 comments on commit bd23a21

Please sign in to comment.