Skip to content

Commit

Permalink
Merge pull request #611 from WalletConnect/develop
Browse files Browse the repository at this point in the history
BOM 1.4.1
  • Loading branch information
Talhaali00 authored Jan 30, 2023
2 parents 8ebd89f + c9ef385 commit 268a060
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WalletConnect v2 protocols for Android applications.

| BOM | [Core SDK](androidCore) | [web3wallet](web3/wallet) | [Sign SDK](sign) | [Auth SDK](auth) | [Chat SDK](chat) |
|-------|-------------------------|---------------------------|------------------|------------------|------------------|
| 1.4.0 | 1.9.0 | 1.2.0 | 2.7.0 | 1.7.0 | 1.0.0-alpha08 |
| 1.4.1 | 1.9.1 | 1.2.1 | 2.7.1 | 1.7.1 | 1.0.0-alpha09 |
| 1.3.0 | 1.8.0 | 1.1.0 | 2.6.0 | 1.6.0 | 1.0.0-alpha07 |
| 1.2.0 | 1.7.0 | 1.0.0 | 2.5.0 | 1.5.0 | 1.0.0-alpha06 |
| 1.1.1 | 1.6.0 | | 2.4.0 | 1.4.0 | 1.0.0-alpha05 |
Expand Down
2 changes: 1 addition & 1 deletion androidCore/sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application android:fullBackupContent="@xml/backup_rules" />
<application android:fullBackupContent="@xml/backup_rules" android:dataExtractionRules="@xml/backup_config" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ object DBUtils {
const val ANDROID_CORE_DB_NAME = "WalletConnectAndroidCore.db"
const val SIGN_SDK_DB_NAME = "WalletConnectV2.db"
const val CHAT_SDK_DB_NAME = "WalletConnectV2_chat.db"
const val PUSH_DAPP_SDK_DB_NAME = "WalletConnectV2_DappPush.db"
const val PUSH_WALLET_SDK_DB_NAME = "WalletConnectV2_WalletPush.db"

val dbNames: List<String> = listOf(ANDROID_CORE_DB_NAME, SIGN_SDK_DB_NAME, CHAT_SDK_DB_NAME)
val dbNames: List<String> = listOf(ANDROID_CORE_DB_NAME, SIGN_SDK_DB_NAME, CHAT_SDK_DB_NAME, PUSH_DAPP_SDK_DB_NAME, PUSH_WALLET_SDK_DB_NAME)
}

fun Scope.deleteDatabase(dbName: String) {
Expand Down
17 changes: 17 additions & 0 deletions androidCore/sdk/src/main/res/xml/backup_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="sharedpref" path="keys.xml"/>
<exclude domain="sharedpref" path="wc_key_store.xml"/>
<exclude domain="sharedpref" path="wc_keystore_key.xml"/>
<exclude domain="sharedpref" path="db_key_store.xml"/>
<exclude domain="database" path="WalletConnectAndroidCore.db"/>
</cloud-backup>
<device-transfer>
<exclude domain="sharedpref" path="keys.xml"/>
<exclude domain="sharedpref" path="wc_key_store.xml"/>
<exclude domain="sharedpref" path="wc_keystore_key.xml"/>
<exclude domain="sharedpref" path="db_key_store.xml"/>
<exclude domain="database" path="WalletConnectAndroidCore.db"/>
</device-transfer>
</data-extraction-rules>
12 changes: 6 additions & 6 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
const val KEY_SDK_NAME = "SDK_NAME"

//Latest versions
const val BOM_VERSION = "1.4.0"
const val BOM_VERSION = "1.4.1"
const val FOUNDATION_VERSION = "1.4.0"
const val CORE_VERSION = "1.9.0"
const val SIGN_VERSION = "2.7.0"
const val AUTH_VERSION = "1.7.0"
const val CHAT_VERSION = "1.0.0-alpha08"
const val WEB_3_WALLET = "1.2.0"
const val CORE_VERSION = "1.9.1"
const val SIGN_VERSION = "2.7.1"
const val AUTH_VERSION = "1.7.1"
const val CHAT_VERSION = "1.0.0-alpha09"
const val WEB_3_WALLET = "1.2.1"

val jvmVersion = JavaVersion.VERSION_11
const val MIN_SDK: Int = 23
Expand Down
2 changes: 1 addition & 1 deletion push/sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.walletconnect.push">

<application android:fullBackupContent="@xml/backup_rules" />
<application android:fullBackupContent="@xml/backup_rules" android:dataExtractionRules="@xml/backup_config" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package com.walletconnect.push.wallet.di

import com.walletconnect.android.di.AndroidCoreDITags
import com.walletconnect.android.di.sdkBaseStorageModule
import com.walletconnect.android.internal.common.di.DBNames
import com.walletconnect.android.internal.common.di.deleteDBs
import com.walletconnect.android.internal.common.di.DBUtils
import com.walletconnect.android.internal.common.di.deleteDatabase
import com.walletconnect.push.PushDatabase
import com.walletconnect.push.common.storage.data.SubscriptionStorageRepository
import com.walletconnect.push.common.storage.data.dao.Subscriptions
Expand All @@ -14,21 +14,21 @@ import org.koin.core.scope.Scope
import org.koin.dsl.module

@JvmSynthetic
internal fun pushStorageModule(storageSuffix: String) = module {
internal fun pushStorageModule(dbName: String) = module {
fun Scope.createPushDB() = PushDatabase(
get(),
SubscriptionsAdapter = Subscriptions.Adapter(metadata_iconsAdapter = get(named(AndroidCoreDITags.COLUMN_ADAPTER_LIST)))
)

includes(sdkBaseStorageModule(PushDatabase.Schema, storageSuffix))
includes(sdkBaseStorageModule(PushDatabase.Schema, dbName))

single {
try {
createPushDB().also {
it.subscriptionsQueries.getAllSubscriptions().executeAsOneOrNull()
}
} catch (e: Exception) {
deleteDBs(DBNames.getSdkDBName(storageSuffix))
deleteDatabase(dbName)
createPushDB()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.walletconnect.push.dapp.client

import com.walletconnect.android.internal.common.di.DBUtils
import com.walletconnect.android.internal.common.model.SDKError
import com.walletconnect.android.internal.common.scope
import com.walletconnect.android.internal.common.wcKoinApp
Expand All @@ -20,14 +21,13 @@ internal class PushDappProtocol : PushDappInterface {

companion object {
val instance = PushDappProtocol()
const val storageSuffix = "DappPush"
}

override fun initialize(init: Push.Dapp.Params.Init, onError: (Push.Model.Error) -> Unit) {
try {
wcKoinApp.modules(
pushJsonRpcModule(),
pushStorageModule(storageSuffix),
pushStorageModule(DBUtils.PUSH_DAPP_SDK_DB_NAME),
dappEngineModule(),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.walletconnect.push.wallet.client

import com.walletconnect.android.internal.common.di.DBUtils
import com.walletconnect.android.internal.common.model.SDKError
import com.walletconnect.android.internal.common.scope
import com.walletconnect.android.internal.common.wcKoinApp
Expand All @@ -21,14 +22,13 @@ class PushWalletProtocol : PushWalletInterface {

companion object {
val instance = PushWalletProtocol()
const val storageSuffix: String = "WalletPush"
}

override fun initialize(init: Push.Wallet.Params.Init, onError: (Push.Model.Error) -> Unit) {
try {
wcKoinApp.modules(
pushJsonRpcModule(),
pushStorageModule(storageSuffix),
pushStorageModule(DBUtils.PUSH_WALLET_SDK_DB_NAME),
walletEngineModule(),
)

Expand Down
11 changes: 11 additions & 0 deletions push/sdk/src/main/res/xml/backup_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="database" path="WalletConnectV2WalletPush.db"/>
<exclude domain="database" path="WalletConnectV2DappPush.db"/>
</cloud-backup>
<device-transfer>
<exclude domain="database" path="WalletConnectV2WalletPush.db"/>
<exclude domain="database" path="WalletConnectV2DappPush.db"/>
</device-transfer>
</data-extraction-rules>
2 changes: 1 addition & 1 deletion sign/sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.walletconnect.sign">

<application android:fullBackupContent="@xml/backup_rules" />
<application android:fullBackupContent="@xml/backup_rules" android:dataExtractionRules="@xml/backup_config" />
</manifest>
9 changes: 9 additions & 0 deletions sign/sdk/src/main/res/xml/backup_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="database" path="WalletConnectV2.db"/>
</cloud-backup>
<device-transfer>
<exclude domain="database" path="WalletConnectV2.db"/>
</device-transfer>
</data-extraction-rules>

0 comments on commit 268a060

Please sign in to comment.