From 5a3ad87a9f9657c127b77d0d44f07b81f4b8fd86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=C3=B3rio=20Granado=20Magalh=C3=A3es?= Date: Fri, 26 Jul 2024 13:39:45 -0300 Subject: [PATCH 1/2] Add a new util to check internet connectivity (#15) * Add isOnline helper * Fix imports * Add class to manage connection state --- WalletSdk/src/main/AndroidManifest.xml | 3 +- .../spruceid/wallet/sdk/ConnectionLiveData.kt | 86 +++++++++++++++++++ .../java/com/spruceid/wallet/sdk/Utils.kt | 2 +- example/src/main/AndroidManifest.xml | 2 + .../spruceid/walletsdkexample/MainActivity.kt | 18 +++- 5 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 WalletSdk/src/main/java/com/spruceid/wallet/sdk/ConnectionLiveData.kt diff --git a/WalletSdk/src/main/AndroidManifest.xml b/WalletSdk/src/main/AndroidManifest.xml index 7a467ff..1fa894b 100644 --- a/WalletSdk/src/main/AndroidManifest.xml +++ b/WalletSdk/src/main/AndroidManifest.xml @@ -15,5 +15,6 @@ - + + \ No newline at end of file diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ConnectionLiveData.kt b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ConnectionLiveData.kt new file mode 100644 index 0000000..e2cfb4d --- /dev/null +++ b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ConnectionLiveData.kt @@ -0,0 +1,86 @@ +package com.spruceid.wallet.sdk + +import android.content.Context +import android.content.Context.CONNECTIVITY_SERVICE +import android.net.ConnectivityManager +import android.net.Network +import android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET +import android.net.NetworkCapabilities.TRANSPORT_CELLULAR +import android.net.NetworkCapabilities.TRANSPORT_WIFI +import android.net.NetworkRequest +import androidx.lifecycle.LiveData +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import java.io.IOException +import java.net.InetSocketAddress +import javax.net.SocketFactory + +class ConnectionLiveData(context: Context) : LiveData() { + + private lateinit var networkCallback: ConnectivityManager.NetworkCallback + private val connectivityManager = + context.getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager + private val validNetworks: MutableSet = HashSet() + + private fun checkValidNetworks() { + postValue(validNetworks.size > 0) + } + + override fun onActive() { + networkCallback = createNetworkCallback() + val networkRequest = NetworkRequest.Builder() + .addCapability(NET_CAPABILITY_INTERNET) + .addTransportType(TRANSPORT_WIFI) + .addTransportType(TRANSPORT_CELLULAR) + .build() + connectivityManager.registerNetworkCallback(networkRequest, networkCallback) + } + + override fun onInactive() { + connectivityManager.unregisterNetworkCallback(networkCallback) + } + + private fun createNetworkCallback() = object : ConnectivityManager.NetworkCallback() { + + override fun onAvailable(network: Network) { + val networkCapabilities = connectivityManager.getNetworkCapabilities(network) + val hasInternetCapability = networkCapabilities?.hasCapability(NET_CAPABILITY_INTERNET) + + if (hasInternetCapability == true) { + // Check if this network actually has internet + CoroutineScope(Dispatchers.IO).launch { + val hasInternet = DoesNetworkHaveInternet.execute(network.socketFactory) + if (hasInternet) { + withContext(Dispatchers.Main) { + validNetworks.add(network) + checkValidNetworks() + } + } + } + } + } + + override fun onLost(network: Network) { + validNetworks.remove(network) + checkValidNetworks() + } + } + + object DoesNetworkHaveInternet { + suspend fun execute(socketFactory: SocketFactory): Boolean { + // Make sure to execute this on a background thread. + delay(1000) + return try { + val socket = socketFactory.createSocket() ?: throw IOException("Socket is null.") + socket.connect(InetSocketAddress("8.8.8.8", 53), 1500) + socket.close() + true + } catch (e: IOException) { + false + } + } + } +} diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Utils.kt b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Utils.kt index 01127a6..6f1ca93 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Utils.kt +++ b/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Utils.kt @@ -27,4 +27,4 @@ enum class PresentmentState { /// App should display a success message and offer to close the page SUCCESS, -} \ No newline at end of file +} diff --git a/example/src/main/AndroidManifest.xml b/example/src/main/AndroidManifest.xml index f70e08b..1364f7c 100644 --- a/example/src/main/AndroidManifest.xml +++ b/example/src/main/AndroidManifest.xml @@ -15,6 +15,8 @@ + + () + var isConnected by remember { mutableStateOf(false) } + + connectionLiveData = ConnectionLiveData(this) + + connectionLiveData.observe(this) { isNetworkAvailable -> + isNetworkAvailable?.let { + isConnected = it + } + } viewModel.storeCredential(generateMDoc()) @@ -96,7 +112,7 @@ class MainActivity : ComponentActivity() { viewModel.present(getBluetoothManager(baseContext)!!) } ) { - Text(text = "Share via QR Code") + Text(text = "Share via QR Code " + isConnected) } } } From 157e47fc6fcf0e0822dcbd5fcbe9fa3838abc523 Mon Sep 17 00:00:00 2001 From: Simon Bihel Date: Fri, 2 Aug 2024 09:07:57 +0100 Subject: [PATCH 2/2] Rename wallet-sdk to mobile-sdk (#19) --- .gitignore | 2 ++ {WalletSdk => MobileSdk}/.gitignore | 0 {WalletSdk => MobileSdk}/build.gradle.kts | 16 +++++++-------- {WalletSdk => MobileSdk}/consumer-rules.pro | 0 {WalletSdk => MobileSdk}/proguard-rules.pro | 0 .../src/main/AndroidManifest.xml | 0 .../spruceid/mobile}/sdk/BaseCredential.kt | 2 +- .../com/spruceid/mobile}/sdk/BleCentral.kt | 2 +- .../mobile}/sdk/BleCentralCallback.kt | 2 +- .../com/spruceid/mobile}/sdk/BlePeripheral.kt | 2 +- .../spruceid/mobile}/sdk/BleSessionManager.kt | 16 +++++++-------- .../com/spruceid/mobile}/sdk/BleStates.kt | 2 +- .../mobile}/sdk/ConnectionLiveData.kt | 2 +- .../mobile}/sdk/CredentialsViewModel.kt | 14 ++++++------- .../com/spruceid/mobile}/sdk/GattClient.kt | 2 +- .../mobile}/sdk/GattClientCallback.kt | 2 +- .../com/spruceid/mobile}/sdk/GattServer.kt | 2 +- .../mobile}/sdk/GattServerCallback.kt | 2 +- .../com/spruceid/mobile}/sdk/KeyManager.kt | 2 +- .../mobile}/sdk/KeyManagerEnvironment.kt | 2 +- .../java/com/spruceid/mobile}/sdk/MDoc.kt | 4 ++-- .../com/spruceid/mobile}/sdk/Transport.kt | 2 +- .../com/spruceid/mobile}/sdk/TransportBle.kt | 2 +- .../sdk/TransportBleCentralClientHolder.kt | 2 +- .../sdk/TransportBlePeripheralServerHolder.kt | 2 +- .../java/com/spruceid/mobile}/sdk/Utils.kt | 2 +- .../spruceid/mobile}/sdk/ui/QRCodeAnalyzer.kt | 2 +- .../spruceid/mobile}/sdk/ui/QRCodeScanner.kt | 2 +- .../spruceid/mobile}/sdk/KeyManagerTest.kt | 2 +- README.md | 12 +++++------ example/build.gradle.kts | 6 +++--- .../ExampleInstrumentedTest.kt | 4 ++-- example/src/main/AndroidManifest.xml | 4 ++-- .../BleCentralCallbackHandler.kt | 4 ++-- .../MainActivity.kt | 20 +++++++++---------- .../NamespaceField.kt | 6 +++--- .../ui/theme/Color.kt | 2 +- .../ui/theme/QRPainter.kt | 2 +- .../ui/theme/Theme.kt | 4 ++-- .../ui/theme/Type.kt | 2 +- example/src/main/res/values/strings.xml | 2 +- example/src/main/res/values/themes.xml | 2 +- .../ExampleUnitTest.kt | 2 +- settings.gradle.kts | 4 ++-- 44 files changed, 85 insertions(+), 83 deletions(-) rename {WalletSdk => MobileSdk}/.gitignore (100%) rename {WalletSdk => MobileSdk}/build.gradle.kts (89%) rename {WalletSdk => MobileSdk}/consumer-rules.pro (100%) rename {WalletSdk => MobileSdk}/proguard-rules.pro (100%) rename {WalletSdk => MobileSdk}/src/main/AndroidManifest.xml (100%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/BaseCredential.kt (86%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/BleCentral.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/BleCentralCallback.kt (92%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/BlePeripheral.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/BleSessionManager.kt (88%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/BleStates.kt (95%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/ConnectionLiveData.kt (98%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/CredentialsViewModel.kt (93%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/GattClient.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/GattClientCallback.kt (92%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/GattServer.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/GattServerCallback.kt (92%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/KeyManager.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/KeyManagerEnvironment.kt (83%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/MDoc.kt (79%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/Transport.kt (98%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/TransportBle.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/TransportBleCentralClientHolder.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/TransportBlePeripheralServerHolder.kt (99%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/Utils.kt (95%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/ui/QRCodeAnalyzer.kt (98%) rename {WalletSdk/src/main/java/com/spruceid/wallet => MobileSdk/src/main/java/com/spruceid/mobile}/sdk/ui/QRCodeScanner.kt (99%) rename {WalletSdk/src/test/java/com/spruceid/wallet => MobileSdk/src/test/java/com/spruceid/mobile}/sdk/KeyManagerTest.kt (97%) rename example/src/androidTest/java/com/spruceid/{walletsdkexample => mobilesdkexample}/ExampleInstrumentedTest.kt (84%) rename example/src/main/java/com/spruceid/{walletsdkexample => mobilesdkexample}/BleCentralCallbackHandler.kt (87%) rename example/src/main/java/com/spruceid/{walletsdkexample => mobilesdkexample}/MainActivity.kt (99%) rename example/src/main/java/com/spruceid/{walletsdkexample => mobilesdkexample}/NamespaceField.kt (88%) rename example/src/main/java/com/spruceid/{walletsdkexample => mobilesdkexample}/ui/theme/Color.kt (83%) rename example/src/main/java/com/spruceid/{walletsdkexample => mobilesdkexample}/ui/theme/QRPainter.kt (98%) rename example/src/main/java/com/spruceid/{walletsdkexample => mobilesdkexample}/ui/theme/Theme.kt (97%) rename example/src/main/java/com/spruceid/{walletsdkexample => mobilesdkexample}/ui/theme/Type.kt (95%) rename example/src/test/java/com/spruceid/{walletsdkexample => mobilesdkexample}/ExampleUnitTest.kt (89%) diff --git a/.gitignore b/.gitignore index 0f8b0e1..010ba1e 100644 --- a/.gitignore +++ b/.gitignore @@ -335,3 +335,5 @@ $RECYCLE.BIN/ !gradle/wrapper/gradle-wrapper.jar # End of https://www.gitignore.io/api/java,linux,macos,windows,android,intellij,androidstudio + +kls_database.db diff --git a/WalletSdk/.gitignore b/MobileSdk/.gitignore similarity index 100% rename from WalletSdk/.gitignore rename to MobileSdk/.gitignore diff --git a/WalletSdk/build.gradle.kts b/MobileSdk/build.gradle.kts similarity index 89% rename from WalletSdk/build.gradle.kts rename to MobileSdk/build.gradle.kts index b627da1..c96a955 100644 --- a/WalletSdk/build.gradle.kts +++ b/MobileSdk/build.gradle.kts @@ -10,7 +10,7 @@ publishing { repositories { maven { name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/spruceid/wallet-sdk-kt") + url = uri("https://maven.pkg.github.com/spruceid/mobile-sdk-kt") credentials { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GITHUB_TOKEN") @@ -20,8 +20,8 @@ publishing { publications { // Creates a Maven publication called "release". create("release") { - groupId = "com.spruceid.wallet.sdk" - artifactId = "walletsdk" + groupId = "com.spruceid.mobile.sdk" + artifactId = "mobilesdk" version = System.getenv("VERSION") afterEvaluate { @@ -30,9 +30,9 @@ publishing { pom { packaging = "aar" - name.set("walletsdk") - description.set("Android SpruceID Wallet SDK") - url.set("https://github.com/spruceid/wallet-sdk-kt") + name.set("mobilesdk") + description.set("Android SpruceID Mobile SDK") + url.set("https://github.com/spruceid/mobile-sdk-kt") licenses { license { name.set("MIT License") @@ -76,7 +76,7 @@ nmcp { android { - namespace = "com.spruceid.wallet.sdk" + namespace = "com.spruceid.mobile.sdk" compileSdk = 33 defaultConfig { @@ -118,7 +118,7 @@ android { } dependencies { - api("com.spruceid.wallet.sdk.rs:walletsdkrs:0.0.25") + api("com.spruceid.mobile.sdk.rs:mobilesdkrs:0.0.26") //noinspection GradleCompatible implementation("com.android.support:appcompat-v7:28.0.0") /* Begin UI dependencies */ diff --git a/WalletSdk/consumer-rules.pro b/MobileSdk/consumer-rules.pro similarity index 100% rename from WalletSdk/consumer-rules.pro rename to MobileSdk/consumer-rules.pro diff --git a/WalletSdk/proguard-rules.pro b/MobileSdk/proguard-rules.pro similarity index 100% rename from WalletSdk/proguard-rules.pro rename to MobileSdk/proguard-rules.pro diff --git a/WalletSdk/src/main/AndroidManifest.xml b/MobileSdk/src/main/AndroidManifest.xml similarity index 100% rename from WalletSdk/src/main/AndroidManifest.xml rename to MobileSdk/src/main/AndroidManifest.xml diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BaseCredential.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BaseCredential.kt similarity index 86% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/BaseCredential.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/BaseCredential.kt index 7d9e7b9..a736d7a 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BaseCredential.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BaseCredential.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk open class BaseCredential constructor(private val id: String?) { diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleCentral.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleCentral.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleCentral.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleCentral.kt index b9f413a..a08569b 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleCentral.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleCentral.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.le.* import android.os.Handler diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleCentralCallback.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleCentralCallback.kt similarity index 92% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleCentralCallback.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleCentralCallback.kt index ea94843..51ce81b 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleCentralCallback.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleCentralCallback.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.le.ScanResult diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BlePeripheral.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BlePeripheral.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/BlePeripheral.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/BlePeripheral.kt index f6192f4..fc2d874 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BlePeripheral.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BlePeripheral.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.BluetoothAdapter import android.bluetooth.le.AdvertiseCallback diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleSessionManager.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleSessionManager.kt similarity index 88% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleSessionManager.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleSessionManager.kt index bd02b95..bff5fe5 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleSessionManager.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleSessionManager.kt @@ -1,14 +1,14 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.BluetoothManager import android.util.Log -import com.spruceid.wallet.sdk.rs.ItemsRequest -import com.spruceid.wallet.sdk.rs.SessionManager -import com.spruceid.wallet.sdk.rs.SessionManagerEngaged -import com.spruceid.wallet.sdk.rs.initialiseSession -import com.spruceid.wallet.sdk.rs.handleRequest -import com.spruceid.wallet.sdk.rs.submitResponse -import com.spruceid.wallet.sdk.rs.submitSignature +import com.spruceid.mobile.sdk.rs.ItemsRequest +import com.spruceid.mobile.sdk.rs.SessionManager +import com.spruceid.mobile.sdk.rs.SessionManagerEngaged +import com.spruceid.mobile.sdk.rs.initialiseSession +import com.spruceid.mobile.sdk.rs.handleRequest +import com.spruceid.mobile.sdk.rs.submitResponse +import com.spruceid.mobile.sdk.rs.submitSignature import java.security.KeyStore import java.security.Signature import java.util.UUID diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleStates.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleStates.kt similarity index 95% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleStates.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleStates.kt index f58d219..7da5bcc 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/BleStates.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/BleStates.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk enum class BleStates(val string: String) { Scanning("scanning"), diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ConnectionLiveData.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ConnectionLiveData.kt similarity index 98% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/ConnectionLiveData.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/ConnectionLiveData.kt index e2cfb4d..d04edaf 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ConnectionLiveData.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ConnectionLiveData.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.content.Context import android.content.Context.CONNECTIVITY_SERVICE diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/CredentialsViewModel.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/CredentialsViewModel.kt similarity index 93% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/CredentialsViewModel.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/CredentialsViewModel.kt index de9b2fa..459a18f 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/CredentialsViewModel.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/CredentialsViewModel.kt @@ -1,14 +1,14 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.BluetoothManager import android.util.Log import androidx.lifecycle.ViewModel -import com.spruceid.wallet.sdk.rs.RequestData -import com.spruceid.wallet.sdk.rs.SessionData -import com.spruceid.wallet.sdk.rs.handleRequest -import com.spruceid.wallet.sdk.rs.initialiseSession -import com.spruceid.wallet.sdk.rs.submitResponse -import com.spruceid.wallet.sdk.rs.submitSignature +import com.spruceid.mobile.sdk.rs.RequestData +import com.spruceid.mobile.sdk.rs.SessionData +import com.spruceid.mobile.sdk.rs.handleRequest +import com.spruceid.mobile.sdk.rs.initialiseSession +import com.spruceid.mobile.sdk.rs.submitResponse +import com.spruceid.mobile.sdk.rs.submitSignature import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import java.security.KeyStore diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClient.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattClient.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClient.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattClient.kt index 42b57ef..110fec8 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClient.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattClient.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.BluetoothDevice import android.bluetooth.BluetoothGatt diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClientCallback.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattClientCallback.kt similarity index 92% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClientCallback.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattClientCallback.kt index 3a6ea6d..fe50803 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattClientCallback.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattClientCallback.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk abstract class GattClientCallback { open fun onPeerConnected() {} diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattServer.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattServer.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattServer.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattServer.kt index cab3efe..2e42f60 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattServer.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattServer.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.* diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattServerCallback.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattServerCallback.kt similarity index 92% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattServerCallback.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattServerCallback.kt index 71ea112..ce9286d 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/GattServerCallback.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/GattServerCallback.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk abstract class GattServerCallback { open fun onPeerConnected() {} diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/KeyManager.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/KeyManager.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/KeyManager.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/KeyManager.kt index d71afc7..4a6c020 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/KeyManager.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/KeyManager.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.os.Build import android.security.keystore.KeyGenParameterSpec diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/KeyManagerEnvironment.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/KeyManagerEnvironment.kt similarity index 83% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/KeyManagerEnvironment.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/KeyManagerEnvironment.kt index 50dbd93..0f5e73e 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/KeyManagerEnvironment.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/KeyManagerEnvironment.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk /** * The Keystore environment used for the key generation. diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/MDoc.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/MDoc.kt similarity index 79% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/MDoc.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/MDoc.kt index 82dc1c9..c7e1c53 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/MDoc.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/MDoc.kt @@ -1,7 +1,7 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.util.Log -import com.spruceid.wallet.sdk.rs.MDoc as InnerMDoc +import com.spruceid.mobile.sdk.rs.MDoc as InnerMDoc class MDoc(id: String, issuerAuth: ByteArray, val keyAlias: String) : BaseCredential(id) { val inner: InnerMDoc diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Transport.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/Transport.kt similarity index 98% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/Transport.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/Transport.kt index b2f59c4..73c7b99 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Transport.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/Transport.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.BluetoothManager import android.util.Log diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBle.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBle.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBle.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBle.kt index 22ca399..373b1dd 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBle.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBle.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.bluetooth.BluetoothManager import android.util.Log diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBleCentralClientHolder.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBleCentralClientHolder.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBleCentralClientHolder.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBleCentralClientHolder.kt index ed476e9..1ad75e9 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBleCentralClientHolder.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBleCentralClientHolder.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.app.Activity import android.bluetooth.BluetoothAdapter diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBlePeripheralServerHolder.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBlePeripheralServerHolder.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBlePeripheralServerHolder.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBlePeripheralServerHolder.kt index 4cb6e45..95bdccb 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/TransportBlePeripheralServerHolder.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/TransportBlePeripheralServerHolder.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import android.app.Activity import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothManager diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Utils.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/Utils.kt similarity index 95% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/Utils.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/Utils.kt index 6f1ca93..aa7b454 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/Utils.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/Utils.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk fun hexToByteArray(value: String): ByteArray { diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ui/QRCodeAnalyzer.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/QRCodeAnalyzer.kt similarity index 98% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/ui/QRCodeAnalyzer.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/QRCodeAnalyzer.kt index 8bcf56f..25ca5be 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ui/QRCodeAnalyzer.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/QRCodeAnalyzer.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk.ui +package com.spruceid.mobile.sdk.ui import android.graphics.ImageFormat import android.os.Build diff --git a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ui/QRCodeScanner.kt b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/QRCodeScanner.kt similarity index 99% rename from WalletSdk/src/main/java/com/spruceid/wallet/sdk/ui/QRCodeScanner.kt rename to MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/QRCodeScanner.kt index 2cf3146..14f9df8 100644 --- a/WalletSdk/src/main/java/com/spruceid/wallet/sdk/ui/QRCodeScanner.kt +++ b/MobileSdk/src/main/java/com/spruceid/mobile/sdk/ui/QRCodeScanner.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk.ui +package com.spruceid.mobile.sdk.ui import android.content.res.Resources import android.util.Range diff --git a/WalletSdk/src/test/java/com/spruceid/wallet/sdk/KeyManagerTest.kt b/MobileSdk/src/test/java/com/spruceid/mobile/sdk/KeyManagerTest.kt similarity index 97% rename from WalletSdk/src/test/java/com/spruceid/wallet/sdk/KeyManagerTest.kt rename to MobileSdk/src/test/java/com/spruceid/mobile/sdk/KeyManagerTest.kt index 0d483eb..a177c41 100644 --- a/WalletSdk/src/test/java/com/spruceid/wallet/sdk/KeyManagerTest.kt +++ b/MobileSdk/src/test/java/com/spruceid/mobile/sdk/KeyManagerTest.kt @@ -1,4 +1,4 @@ -package com.spruceid.wallet.sdk +package com.spruceid.mobile.sdk import org.junit.Test diff --git a/README.md b/README.md index b3aa09f..3952128 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Kotlin Wallet SDK +# Kotlin Mobile SDK ## Maturity Disclaimer -In its current version, Wallet SDK has not yet undergone a formal security audit +In its current version, Mobile SDK has not yet undergone a formal security audit to desired levels of confidence for suitable use in production systems. This implementation is currently suitable for exploratory work and experimentation only. We welcome feedback on the usability, architecture, and security of this @@ -11,7 +11,7 @@ security firm before the v1.0 release. ## Architecture -Our Wallet SDKs use shared code, with most of the logic being written once in +Our Mobile SDKs use shared code, with most of the logic being written once in Rust, and when not possible, native APIs (e.g. Bluetooth, OS Keychain) are called in native SDKs. @@ -30,6 +30,6 @@ called in native SDKs. │Rust│ └────┘ ``` -- [Kotlin SDK](https://github.com/spruceid/wallet-sdk-kt) -- [Swift SDK](https://github.com/spruceid/wallet-sdk-swift) -- [Rust layer](https://github.com/spruceid/wallet-sdk-rs) +- [Kotlin SDK](https://github.com/spruceid/mobile-sdk-kt) +- [Swift SDK](https://github.com/spruceid/mobile-sdk-swift) +- [Rust layer](https://github.com/spruceid/mobile-sdk-rs) diff --git a/example/build.gradle.kts b/example/build.gradle.kts index cdf423b..ea114c5 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -4,11 +4,11 @@ plugins { } android { - namespace = "com.spruceid.walletsdkexample" + namespace = "com.spruceid.mobilesdkexample" compileSdk = 34 defaultConfig { - applicationId = "com.spruceid.walletsdkexample" + applicationId = "com.spruceid.mobilesdkexample" minSdk = 26 targetSdk = 34 versionCode = 1 @@ -59,7 +59,7 @@ dependencies { implementation("androidx.compose.ui:ui-graphics") implementation("androidx.compose.ui:ui-tooling-preview") implementation("androidx.compose.material3:material3") - implementation(project(mapOf("path" to ":WalletSdk"))) + implementation(project(mapOf("path" to ":MobileSdk"))) implementation("com.google.zxing:core:3.5.1") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") diff --git a/example/src/androidTest/java/com/spruceid/walletsdkexample/ExampleInstrumentedTest.kt b/example/src/androidTest/java/com/spruceid/mobilesdkexample/ExampleInstrumentedTest.kt similarity index 84% rename from example/src/androidTest/java/com/spruceid/walletsdkexample/ExampleInstrumentedTest.kt rename to example/src/androidTest/java/com/spruceid/mobilesdkexample/ExampleInstrumentedTest.kt index d0ade2e..926901d 100644 --- a/example/src/androidTest/java/com/spruceid/walletsdkexample/ExampleInstrumentedTest.kt +++ b/example/src/androidTest/java/com/spruceid/mobilesdkexample/ExampleInstrumentedTest.kt @@ -1,4 +1,4 @@ -package com.spruceid.walletsdkexample +package com.spruceid.mobilesdkexample import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -19,6 +19,6 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.spruceid.walletsdk", appContext.packageName) + assertEquals("com.spruceid.mobilesdk", appContext.packageName) } } \ No newline at end of file diff --git a/example/src/main/AndroidManifest.xml b/example/src/main/AndroidManifest.xml index 1364f7c..4ace2ee 100644 --- a/example/src/main/AndroidManifest.xml +++ b/example/src/main/AndroidManifest.xml @@ -27,13 +27,13 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.WalletSdk" + android:theme="@style/Theme.MobileSdk" tools:targetApi="31"> + android:theme="@style/Theme.MobileSdk"> diff --git a/example/src/main/java/com/spruceid/walletsdkexample/BleCentralCallbackHandler.kt b/example/src/main/java/com/spruceid/mobilesdkexample/BleCentralCallbackHandler.kt similarity index 87% rename from example/src/main/java/com/spruceid/walletsdkexample/BleCentralCallbackHandler.kt rename to example/src/main/java/com/spruceid/mobilesdkexample/BleCentralCallbackHandler.kt index 10ee5e9..5bbdd75 100644 --- a/example/src/main/java/com/spruceid/walletsdkexample/BleCentralCallbackHandler.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/BleCentralCallbackHandler.kt @@ -1,8 +1,8 @@ -package com.spruceid.walletsdkexample +package com.spruceid.mobilesdkexample import android.bluetooth.le.ScanResult import android.util.Log -import com.spruceid.wallet.sdk.BleCentralCallback +import com.spruceid.mobile.sdk.BleCentralCallback class BleCentralCallbackHandler: BleCentralCallback() { override fun onScanResult(callbackType: Int, result: ScanResult) { diff --git a/example/src/main/java/com/spruceid/walletsdkexample/MainActivity.kt b/example/src/main/java/com/spruceid/mobilesdkexample/MainActivity.kt similarity index 99% rename from example/src/main/java/com/spruceid/walletsdkexample/MainActivity.kt rename to example/src/main/java/com/spruceid/mobilesdkexample/MainActivity.kt index 04fa704..b469906 100644 --- a/example/src/main/java/com/spruceid/walletsdkexample/MainActivity.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/MainActivity.kt @@ -1,4 +1,4 @@ -package com.spruceid.walletsdkexample +package com.spruceid.mobilesdkexample import android.content.Context import android.content.pm.PackageManager @@ -35,14 +35,14 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.unit.dp import androidx.core.content.ContextCompat -import com.spruceid.wallet.sdk.ConnectionLiveData -import com.spruceid.wallet.sdk.CredentialsViewModel -import com.spruceid.wallet.sdk.MDoc -import com.spruceid.wallet.sdk.PresentmentState -import com.spruceid.wallet.sdk.getBluetoothManager -import com.spruceid.wallet.sdk.getPermissions -import com.spruceid.walletsdkexample.ui.theme.WalletSdkTheme -import com.spruceid.walletsdkexample.ui.theme.rememberQrBitmapPainter +import com.spruceid.mobile.sdk.ConnectionLiveData +import com.spruceid.mobile.sdk.CredentialsViewModel +import com.spruceid.mobile.sdk.MDoc +import com.spruceid.mobile.sdk.PresentmentState +import com.spruceid.mobile.sdk.getBluetoothManager +import com.spruceid.mobile.sdk.getPermissions +import com.spruceid.mobilesdkexample.ui.theme.MobileSdkTheme +import com.spruceid.mobilesdkexample.ui.theme.rememberQrBitmapPainter import java.security.KeyFactory import java.security.KeyStore import java.security.cert.Certificate @@ -70,7 +70,7 @@ class MainActivity : ComponentActivity() { viewModel.storeCredential(generateMDoc()) - WalletSdkTheme { + MobileSdkTheme { // A surface container using the 'background' color from the theme Surface( modifier = Modifier.fillMaxSize(), diff --git a/example/src/main/java/com/spruceid/walletsdkexample/NamespaceField.kt b/example/src/main/java/com/spruceid/mobilesdkexample/NamespaceField.kt similarity index 88% rename from example/src/main/java/com/spruceid/walletsdkexample/NamespaceField.kt rename to example/src/main/java/com/spruceid/mobilesdkexample/NamespaceField.kt index 2019817..48c88e7 100644 --- a/example/src/main/java/com/spruceid/walletsdkexample/NamespaceField.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/NamespaceField.kt @@ -1,4 +1,4 @@ -package com.spruceid.walletsdkexample +package com.spruceid.mobilesdkexample import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row @@ -10,11 +10,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import com.spruceid.walletsdkexample.ui.theme.WalletSdkTheme +import com.spruceid.mobilesdkexample.ui.theme.MobileSdkTheme @Composable fun NamespaceField(namespace: Map.Entry, isChecked: Boolean, onCheck: (Boolean) -> Unit) { - WalletSdkTheme { + MobileSdkTheme { Row( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, diff --git a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Color.kt b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Color.kt similarity index 83% rename from example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Color.kt rename to example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Color.kt index b78fb87..bbff626 100644 --- a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Color.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Color.kt @@ -1,4 +1,4 @@ -package com.spruceid.walletsdkexample.ui.theme +package com.spruceid.mobilesdkexample.ui.theme import androidx.compose.ui.graphics.Color diff --git a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/QRPainter.kt b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/QRPainter.kt similarity index 98% rename from example/src/main/java/com/spruceid/walletsdkexample/ui/theme/QRPainter.kt rename to example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/QRPainter.kt index 2a43644..82bae33 100644 --- a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/QRPainter.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/QRPainter.kt @@ -1,4 +1,4 @@ -package com.spruceid.walletsdkexample.ui.theme +package com.spruceid.mobilesdkexample.ui.theme import android.graphics.Bitmap import android.graphics.Color diff --git a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Theme.kt b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Theme.kt similarity index 97% rename from example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Theme.kt rename to example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Theme.kt index 2e2475a..f912882 100644 --- a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Theme.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Theme.kt @@ -1,4 +1,4 @@ -package com.spruceid.walletsdkexample.ui.theme +package com.spruceid.mobilesdkexample.ui.theme import android.app.Activity import android.os.Build @@ -38,7 +38,7 @@ private val LightColorScheme = lightColorScheme( ) @Composable -fun WalletSdkTheme( +fun MobileSdkTheme( darkTheme: Boolean = isSystemInDarkTheme(), // Dynamic color is available on Android 12+ dynamicColor: Boolean = true, diff --git a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Type.kt b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Type.kt similarity index 95% rename from example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Type.kt rename to example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Type.kt index a260af8..75860d1 100644 --- a/example/src/main/java/com/spruceid/walletsdkexample/ui/theme/Type.kt +++ b/example/src/main/java/com/spruceid/mobilesdkexample/ui/theme/Type.kt @@ -1,4 +1,4 @@ -package com.spruceid.walletsdkexample.ui.theme +package com.spruceid.mobilesdkexample.ui.theme import androidx.compose.material3.Typography import androidx.compose.ui.text.TextStyle diff --git a/example/src/main/res/values/strings.xml b/example/src/main/res/values/strings.xml index 263aa3c..51c58b3 100644 --- a/example/src/main/res/values/strings.xml +++ b/example/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - WalletSdk Example + MobileSdk Example \ No newline at end of file diff --git a/example/src/main/res/values/themes.xml b/example/src/main/res/values/themes.xml index 2e9b093..271f405 100644 --- a/example/src/main/res/values/themes.xml +++ b/example/src/main/res/values/themes.xml @@ -1,5 +1,5 @@ -