From 0efba8b501f83ba231a06070c8a2c8cef5be7e48 Mon Sep 17 00:00:00 2001 From: DatLag Date: Sun, 14 Apr 2024 17:18:57 +0200 Subject: [PATCH] updated to new sekret version --- composeApp/build.gradle.kts | 4 +++- composeApp/sekret/build.gradle.kts | 2 +- .../datlag/aniflow/module/PlatformModule.android.kt | 6 ------ .../dev/datlag/aniflow/module/NetworkModule.kt | 6 ++++-- .../kotlin/dev/datlag/aniflow/other/Constants.kt | 5 ----- .../dev/datlag/aniflow/module/PlatformModule.ios.kt | 12 +++--------- gradle/libs.versions.toml | 2 +- 7 files changed, 12 insertions(+), 25 deletions(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index e51d7e8..6599ff8 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -47,7 +47,9 @@ sekret { enabled.set(true) packageName.set(artifact) - androidJNIFolder.set(project.layout.projectDirectory.dir("src/androidMain/jniLibs")) + nativeCopy { + androidJNIFolder.set(project.layout.projectDirectory.dir("src/androidMain/jniLibs")) + } } } diff --git a/composeApp/sekret/build.gradle.kts b/composeApp/sekret/build.gradle.kts index 73e9c6d..6b061fd 100644 --- a/composeApp/sekret/build.gradle.kts +++ b/composeApp/sekret/build.gradle.kts @@ -47,7 +47,7 @@ kotlin { sourceSets { commonMain.dependencies { - api("dev.datlag.sekret:sekret:2.0.0-alpha-01") + api("dev.datlag.sekret:sekret:2.0.0-alpha-04") } val jniNativeMain by creating { diff --git a/composeApp/src/androidMain/kotlin/dev/datlag/aniflow/module/PlatformModule.android.kt b/composeApp/src/androidMain/kotlin/dev/datlag/aniflow/module/PlatformModule.android.kt index 15a75dc..108bec8 100644 --- a/composeApp/src/androidMain/kotlin/dev/datlag/aniflow/module/PlatformModule.android.kt +++ b/composeApp/src/androidMain/kotlin/dev/datlag/aniflow/module/PlatformModule.android.kt @@ -74,12 +74,6 @@ actual object PlatformModule { FirebaseFactory.Empty } } - bindSingleton(Constants.Sekret.ANILIST_CLIENT_ID) { - Sekret.anilistClientId(BuildKonfig.packageName) ?: "" - } - bindSingleton(Constants.Sekret.ANILIST_CLIENT_SECRET) { - Sekret.anilistClientSecret(BuildKonfig.packageName) ?: "" - } bindSingleton { val app: Context = instance() DataStoreFactory.create( diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/module/NetworkModule.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/module/NetworkModule.kt index 09842bb..b734125 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/module/NetworkModule.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/module/NetworkModule.kt @@ -12,6 +12,8 @@ import com.apollographql.apollo3.api.http.HttpRequest import com.apollographql.apollo3.api.http.HttpResponse import com.apollographql.apollo3.network.http.HttpInterceptor import com.apollographql.apollo3.network.http.HttpInterceptorChain +import dev.datlag.aniflow.BuildKonfig +import dev.datlag.aniflow.Sekret import dev.datlag.aniflow.anilist.AiringTodayStateMachine import dev.datlag.aniflow.anilist.PopularNextSeasonStateMachine import dev.datlag.aniflow.anilist.PopularSeasonStateMachine @@ -115,8 +117,8 @@ data object NetworkModule { tokenEndpoint = "token" } } - clientId = instance(Constants.Sekret.ANILIST_CLIENT_ID).ifBlank { null } - clientSecret = instance(Constants.Sekret.ANILIST_CLIENT_SECRET).ifBlank { null } + clientId = Sekret.anilistClientId(BuildKonfig.packageName) + clientSecret = Sekret.anilistClientSecret(BuildKonfig.packageName) redirectUri = Constants.AniList.Auth.REDIRECT_URL } } diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/other/Constants.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/other/Constants.kt index d06026b..feb8f1b 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/other/Constants.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/other/Constants.kt @@ -12,9 +12,4 @@ data object Constants { const val CLIENT = "AniListAuthClient" } } - - data object Sekret { - const val ANILIST_CLIENT_ID = "AniListClientId" - const val ANILIST_CLIENT_SECRET = "AniListClientSecret" - } } \ No newline at end of file diff --git a/composeApp/src/iosMain/kotlin/dev/datlag/aniflow/module/PlatformModule.ios.kt b/composeApp/src/iosMain/kotlin/dev/datlag/aniflow/module/PlatformModule.ios.kt index fc4ce74..da50e37 100644 --- a/composeApp/src/iosMain/kotlin/dev/datlag/aniflow/module/PlatformModule.ios.kt +++ b/composeApp/src/iosMain/kotlin/dev/datlag/aniflow/module/PlatformModule.ios.kt @@ -44,21 +44,15 @@ actual object PlatformModule { } bindSingleton { FirebaseFactory.initialize( - projectId = firebaseProject(BuildKonfig.packageName), - applicationId = firebaseIosApplication(BuildKonfig.packageName), - apiKey = firebaseIosApiKey(BuildKonfig.packageName), + projectId = Sekret.firebaseProject(BuildKonfig.packageName), + applicationId = Sekret.firebaseIosApplication(BuildKonfig.packageName)!!, + apiKey = Sekret.firebaseIosApiKey(BuildKonfig.packageName)!!, googleAuthProvider = instanceOrNull() ) } bindEagerSingleton { IosCodeAuthFlowFactory() } - bindSingleton(Constants.Sekret.ANILIST_CLIENT_ID) { - anilistClientId(BuildKonfig.packageName) - } - bindSingleton(Constants.Sekret.ANILIST_CLIENT_SECRET) { - anilistClientSecret(BuildKonfig.packageName) - } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c659e3d..9b3e0e0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -39,7 +39,7 @@ moko-resources = "0.24.0-alpha-5" multidex = "2.0.1" napier = "2.7.1" oidc = "0.9.1" -sekret = "2.0.0-alpha-01" +sekret = "2.0.0-alpha-04" serialization = "1.6.3" splashscreen = "1.0.1" tooling = "1.3.2"