Skip to content

Update kotlin to 2.0+ #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
alias(libs.plugins.compose.compiler)
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt)
Expand Down Expand Up @@ -44,7 +45,7 @@ android {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.9"
kotlinCompilerExtensionVersion = "1.5.15"
}
packaging {
resources {
Expand Down Expand Up @@ -74,7 +75,6 @@ dependencies {

implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.preview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,11 @@ private fun ProfileContent(
)
profile.factorSources.forEach { fs ->
val fsHint = when (fs) {
is FactorSource.ArculusCard -> "${fs.value.hint.name} ${fs.value.hint.model}"
is FactorSource.Device -> "${fs.value.hint.name} ${fs.value.hint.model}"
is FactorSource.Ledger -> "${fs.value.hint.name} ${fs.value.hint.model}"
is FactorSource.OffDeviceMnemonic -> "${fs.value.hint.displayName}"
is FactorSource.SecurityQuestions -> "security questions"
is FactorSource.TrustedContact -> "${fs.value.contact.name} - ${fs.value.contact.emailAddress.email} "
is FactorSource.ArculusCard -> "${fs.value.hint.label} ${fs.value.hint.model}"
is FactorSource.Device -> "${fs.value.hint.label} ${fs.value.hint.model}"
is FactorSource.Ledger -> "${fs.value.hint.label} ${fs.value.hint.model}"
is FactorSource.OffDeviceMnemonic -> "${fs.value.hint.label}"
is FactorSource.Password -> fs.value.hint.label
}

val kind = if (fs is FactorSource.Device) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MainViewModel @Inject constructor(

state.copy(
info = HostInformation(
id = osState.os.resolveHostId(),
id = osState.os.hostId(),
info = osState.os.resolveHostInfo()
)
)
Expand All @@ -62,7 +62,7 @@ class MainViewModel @Inject constructor(
withContext(Dispatchers.Default) {
val os = sargonOsManager.sargonOs
runCatching {
os.newWallet()
os.newWallet(shouldPreDeriveInstances = false)
}.onFailure { error ->
Timber.tag("sargon app").w(error)
}
Expand Down Expand Up @@ -99,7 +99,7 @@ class MainViewModel @Inject constructor(
val os = sargonOsManager.sargonOs

runCatching {
os.createAndSaveNewAccount(
os.createAndSaveNewAccountWithMainBdfs(
networkId = networkId,
name = DisplayName(accountName)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStore
import com.radixdlt.sargon.AuthorizationPurpose
import com.radixdlt.sargon.AuthorizationResponse
import com.radixdlt.sargon.Bios
import com.radixdlt.sargon.FactorSource
import com.radixdlt.sargon.HostInteractor
import com.radixdlt.sargon.KeyDerivationRequest
import com.radixdlt.sargon.KeyDerivationResponse
import com.radixdlt.sargon.SignRequestOfAuthIntent
import com.radixdlt.sargon.SignRequestOfSubintent
import com.radixdlt.sargon.SignRequestOfTransactionIntent
import com.radixdlt.sargon.SignResponseOfAuthIntentHash
import com.radixdlt.sargon.SignResponseOfSubintentHash
import com.radixdlt.sargon.SignResponseOfTransactionIntentHash
import com.radixdlt.sargon.SpotCheckResponse
import com.radixdlt.sargon.android.BuildConfig
import com.radixdlt.sargon.os.SargonOsManager
import com.radixdlt.sargon.os.driver.AndroidEventBusDriver
Expand Down Expand Up @@ -139,6 +152,34 @@ object ApplicationModule {
fun provideProfileStateChangeDriver(): AndroidProfileStateChangeDriver =
AndroidProfileStateChangeDriver

object HostInteractorStub : HostInteractor {

override suspend fun signTransactions(request: SignRequestOfTransactionIntent): SignResponseOfTransactionIntentHash {
throw Exception("Not yet implemented")
}

override suspend fun signSubintents(request: SignRequestOfSubintent): SignResponseOfSubintentHash {
throw Exception("Not yet implemented")
}

override suspend fun deriveKeys(request: KeyDerivationRequest): KeyDerivationResponse {
throw Exception("Not yet implemented")
}

override suspend fun signAuth(request: SignRequestOfAuthIntent): SignResponseOfAuthIntentHash {
throw Exception("Not yet implemented")
}

override suspend fun requestAuthorization(purpose: AuthorizationPurpose): AuthorizationResponse {
throw Exception("Not yet implemented")
}

override suspend fun spotCheck(factorSource: FactorSource, allowSkip: Boolean): SpotCheckResponse {
throw Exception("Not yet implemented")
}

}

@Provides
@Singleton
fun provideBios(
Expand Down Expand Up @@ -170,6 +211,7 @@ object ApplicationModule {
): SargonOsManager = SargonOsManager.factory(
bios = bios,
applicationScope = applicationScope,
defaultDispatcher = dispatcher
defaultDispatcher = dispatcher,
hostInteractor = HostInteractorStub
)
}
1 change: 1 addition & 0 deletions jvm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
Expand Down
35 changes: 18 additions & 17 deletions jvm/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
[versions]
activity-compose = "1.7.0"
lifecycle = "2.6.1"
activity-compose = "1.10.1"
lifecycle = "2.8.7"
sdk-min = "27"
sdk-target = "34"
sdk-compile = "34"
appcompat = "1.6.1"
core-ktx = "1.12.0"
sdk-target = "35"
sdk-compile = "35"
appcompat = "1.7.0"
core-ktx = "1.15.0"
biometric = "1.2.0-alpha05"
junit = "5.10.2"
mockk = "1.13.10"
kotlin = "1.9.22"
mockk = "1.13.11"
kotlin = "2.0.21"
agp = "8.9.0"
material = "1.11.0"
material = "1.12.0"
timber = "5.0.1"
cargo-ndk = "0.3.4"
compose-bom = "2024.02.00"
compose-bom = "2025.03.00"
kover = "0.7.6"
datastore = "1.1.1"
datastore = "1.1.3"
coroutines = "1.8.0"
okhttp = "5.0.0-alpha.14"
turbine = "1.1.0"
hilt = "2.51.1"
ksp = "1.9.22-1.0.17"
ksp = "2.0.21-1.0.28"
jna = "5.13.0"
serialization-json = "1.6.3"
viewmodel = "2.7.0"
androidx-test = "1.5.0"
androidx-test-junit = "1.1.5"
activity = "1.9.1"
serialization-json = "1.8.0"
viewmodel = "2.8.7"
androidx-test = "1.6.1"
androidx-test-junit = "1.2.1"
activity = "1.10.1"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
Expand Down Expand Up @@ -68,6 +68,7 @@ androidx-test-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }

[plugins]
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
Expand Down