Skip to content

Commit

Permalink
Merge pull request #1379 from WalletConnect/develop
Browse files Browse the repository at this point in the history
BOM_1.31.2
  • Loading branch information
jakubuid authored Apr 23, 2024
2 parents 55f7c32 + 03ef6a3 commit 3d89941
Show file tree
Hide file tree
Showing 88 changed files with 1,733 additions and 1,005 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ captures/
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
!.idea/codeStyles/**
!.idea/editor.xml
!/.idea/inspectionProfiles

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
Expand Down
127 changes: 127 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WalletConnect v2 protocols for Android applications.

| BOM | [Core SDK](core/android) | [Sign SDK](protocol/sign) | [Auth SDK](protocol/auth) | [Chat SDK](protocol/chat) | [Notify SDK](protocol/notify) | [web3wallet](product/web3wallet) | [web3modal](product/web3modal) | [WalletConnectModal](product/walletconnectmodal) |
|-----------------------------------------------------------------------------------------|--------------------------|---------------------------|---------------------------|---------------------------|:------------------------------|----------------------------------|--------------------------------|--------------------------------------------------|
| 1.31.2 | 1.31.2 | 2.31.2 | 1.28.1 | 1.0.0.beta26 | 1.3.2 | 1.31.2 | 1.5.2 | 1.5.2 |
| 1.31.1 | 1.31.1 | 2.31.1 | 1.28.1 | 1.0.0.beta26 | 1.3.1 | 1.31.1 | 1.5.1 | 1.5.1 |
| 1.31.0<sup>[**](https://gist.github.com/TalhaAli00/7b9e1cadf19b9dc5141cd033aa4e6172) | 1.31.0 | 2.31.0 | 1.28.0 | 1.0.0.beta25 | 1.3.0 | 1.31.0 | 1.5.0 | 1.5.0 |
| 1.30.0 | 1.30.0 | 2.30.0 | 1.27.0 | 1.0.0.beta25 | 1.2.0 | 1.30.0 | 1.4.0 | 1.4.0 |
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sonar {
"sonar.organization" to "walletconnect",
"sonar.host.url" to "https://sonarcloud.io",
"sonar.gradle.skipCompile" to true,
"sonar.coverage.exclusions" to "sample/**"
"sonar.coverage.exclusions" to "sample/**,**/di/**"
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fun DependencyHandlerScope.security() {
}

fun DependencyHandlerScope.web3jCrypto() {
"api"("com.walletconnect.web3j:crypto:$web3jVersion")
"api"("org.web3j:crypto:$web3jVersion")
}

fun DependencyHandlerScope.kethereum() {
Expand Down
20 changes: 10 additions & 10 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
const val KEY_SDK_NAME = "SDK_NAME"

//Latest versions
const val BOM_VERSION = "1.31.1"
const val FOUNDATION_VERSION = "1.17.0"
const val CORE_VERSION = "1.31.1"
const val SIGN_VERSION = "2.31.1"
const val BOM_VERSION = "1.31.2"
const val FOUNDATION_VERSION = "1.17.1"
const val CORE_VERSION = "1.31.2"
const val SIGN_VERSION = "2.31.2"
const val AUTH_VERSION = "1.28.1"
const val CHAT_VERSION = "1.0.0-beta29"
const val NOTIFY_VERSION = "1.3.1"
const val WEB_3_WALLET_VERSION = "1.31.1"
const val WEB_3_MODAL_VERSION = "1.5.1"
const val WC_MODAL_VERSION = "1.5.1"
const val MODAL_CORE_VERSION = "1.5.1"
const val NOTIFY_VERSION = "1.3.2"
const val WEB_3_WALLET_VERSION = "1.31.2"
const val WEB_3_MODAL_VERSION = "1.5.2"
const val WC_MODAL_VERSION = "1.5.2"
const val MODAL_CORE_VERSION = "1.5.2"

val jvmVersion = JavaVersion.VERSION_11
const val MIN_SDK: Int = 23
Expand Down Expand Up @@ -54,7 +54,7 @@ const val mockkVersion = "1.13.5"
const val jsonVersion = "20220924"
const val timberVersion = "5.0.1"
const val androidSecurityVersion = "1.1.0-alpha06"
const val web3jVersion = "4.9.8-wc"
const val web3jVersion = "4.9.8-hotfix"
const val kethereumVersion = "0.85.7"
const val wsRestJavaVersion = "3.1.0"
const val relinkerVersion = "1.4.5"
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/src/main/kotlin/signing-config.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@ project.extensions.configure(BaseExtension::class.java) {
}
}
}
}

dependencies {
add("implementation", "com.google.firebase:firebase-appdistribution:16.0.0-beta12")
}
1 change: 1 addition & 0 deletions core/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ dependencies {
testJson()
coroutinesTest()
scarletTest()
turbine()
testImplementation(libs.bundles.sqlDelightTest)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ import org.junit.Test
import timber.log.Timber

class KeyserverInstrumentedAndroidTest {


object CacaoSigner : CacaoSignerInterface<Cacao.Signature>


@get:Rule
val scenarioExtension = WCInstrumentedActivityScenario()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ internal object TestClient {
secondaryKoinApp.modules(overrideModule(Relay, Pairing, PairingController, "test_secondary"))

// Necessary reinit of Relay, Pairing and PairingController
Relay.initialize(RELAY_URL, ConnectionType.MANUAL) { Timber.e(it) }
Relay.initialize { Timber.e(it) }
Pairing.initialize()
PairingController.initialize()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.walletconnect.android

import android.app.Application
import com.walletconnect.android.di.coreStorageModule
import com.walletconnect.android.internal.common.di.coreAndroidNetworkModule
import com.walletconnect.android.internal.common.di.coreCommonModule
import com.walletconnect.android.internal.common.di.coreCryptoModule
import com.walletconnect.android.internal.common.di.coreJsonRpcModule
Expand All @@ -27,8 +28,10 @@ import com.walletconnect.android.relay.ConnectionType
import com.walletconnect.android.relay.NetworkClientTimeout
import com.walletconnect.android.relay.RelayClient
import com.walletconnect.android.relay.RelayConnectionInterface
import com.walletconnect.android.utils.isValidRelayServerUrl
import com.walletconnect.android.utils.plantTimber
import com.walletconnect.android.utils.projectId
import com.walletconnect.android.utils.toCommonConnectionType
import com.walletconnect.android.verify.client.VerifyClient
import com.walletconnect.android.verify.client.VerifyInterface
import org.koin.android.ext.koin.androidContext
Expand Down Expand Up @@ -66,13 +69,22 @@ class CoreProtocol(private val koinApp: KoinApplication = wcKoinApp) : CoreInter
relay: RelayConnectionInterface?,
keyServerUrl: String?,
networkClientTimeout: NetworkClientTimeout?,
onError: (Core.Model.Error) -> Unit,
onError: (Core.Model.Error) -> Unit
) {
with(koinApp) {
androidContext(application)
require(relayServerUrl.isValidRelayServerUrl()) { "Check the schema and projectId parameter of the Server Url" }
modules(
coreAndroidNetworkModule(relayServerUrl, connectionType.toCommonConnectionType(), BuildConfig.SDK_VERSION, networkClientTimeout),
coreCommonModule(),
coreCryptoModule(),
)

if (relay == null) {
Relay.initialize { error -> onError(Core.Model.Error(error)) }
}

modules(
module { single { ProjectId(relayServerUrl.projectId()) } },
coreStorageModule(),
pushModule(),
Expand All @@ -90,10 +102,6 @@ class CoreProtocol(private val koinApp: KoinApplication = wcKoinApp) : CoreInter
)
}

if (relay == null) {
Relay.initialize(relayServerUrl, connectionType, networkClientTimeout) { error -> onError(Core.Model.Error(error)) }
}

Verify.initialize()
Pairing.initialize()
PairingController.initialize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,24 @@ import timber.log.Timber
internal class ConnectivityState(context: Context) {
private val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager

private val _isAvailable = MutableStateFlow(false)
val isAvailable: StateFlow<Boolean> = _isAvailable.asStateFlow()
private val _isAvailable = MutableStateFlow<Boolean?>(null)
val isAvailable: StateFlow<Boolean?> = _isAvailable.asStateFlow()
private val networks: MutableSet<Network> = mutableSetOf()

private val callback = object : ConnectivityManager.NetworkCallback() {

override fun onAvailable(network: Network) {
if (network.isCapable()) {
networks.add(network)
_isAvailable.compareAndSet(expect = false, update = true)
_isAvailable.value = true
} else {
_isAvailable.compareAndSet(expect = true, update = false)
_isAvailable.value = false
}
}

override fun onLost(network: Network) {
networks.remove(network)

if (networks.isNotEmpty()) {
_isAvailable.compareAndSet(expect = false, update = true)
} else {
_isAvailable.compareAndSet(expect = true, update = false)
}
_isAvailable.value = networks.isNotEmpty()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.walletconnect.android.internal.common.crypto.kmr

import com.walletconnect.android.internal.common.model.MissingKeyException
import com.walletconnect.android.internal.common.model.SymmetricKey
import com.walletconnect.foundation.common.model.Key
import com.walletconnect.foundation.common.model.PrivateKey
Expand All @@ -8,6 +9,7 @@ import com.walletconnect.foundation.common.model.Topic

interface KeyManagementRepository {
fun setKey(key: Key, tag: String)
@Throws(MissingKeyException::class)
fun removeKeys(tag: String)

fun getPublicKey(tag: String): PublicKey
Expand Down
Loading

0 comments on commit 3d89941

Please sign in to comment.