diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7c5c71355a..523778d665 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -256,8 +256,11 @@ dependencies { implementation(projects.features.hotWallet.api) implementation(projects.features.hotWallet.impl) implementation(projects.features.kyc.api) - //TODO disable for release because of the permissions - // implementation(projects.features.kyc.impl) + debugImplementation(projects.features.kyc.impl) + internalImplementation(projects.features.kyc.impl) + mockedImplementation(projects.features.kyc.impl) + releaseImplementation(projects.features.kyc.mock) + externalImplementation(projects.features.kyc.mock) implementation(projects.features.welcome.api) implementation(projects.features.welcome.impl) implementation(projects.features.createWalletSelection.api) diff --git a/features/kyc/mock/.gitignore b/features/kyc/mock/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/features/kyc/mock/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/features/kyc/mock/build.gradle.kts b/features/kyc/mock/build.gradle.kts new file mode 100644 index 0000000000..a64c1f8a89 --- /dev/null +++ b/features/kyc/mock/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.kapt) + alias(deps.plugins.hilt.android) + id("configuration") +} + +android { + namespace = "com.tangem.features.kyc.impl" +} + +dependencies { + /** Api */ + implementation(projects.features.kyc.api) + + implementation(projects.core.decompose) + + /** DI */ + implementation(deps.hilt.android) + kapt(deps.hilt.kapt) +} \ No newline at end of file diff --git a/features/kyc/mock/src/main/kotlin/com/tangem/features/kyc/MockKycComponent.kt b/features/kyc/mock/src/main/kotlin/com/tangem/features/kyc/MockKycComponent.kt new file mode 100644 index 0000000000..2f1b4ef303 --- /dev/null +++ b/features/kyc/mock/src/main/kotlin/com/tangem/features/kyc/MockKycComponent.kt @@ -0,0 +1,23 @@ +package com.tangem.features.kyc + +import com.tangem.core.decompose.context.AppComponentContext +import dagger.assisted.Assisted +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject + +/** + * Mocking it for release/external builds to exclude SumSub dependency + */ +class MockKycComponent @AssistedInject constructor( + @Assisted appComponentContext: AppComponentContext, +) : KycComponent, AppComponentContext by appComponentContext { + + override fun launch() { + /* no op */ + } + + @AssistedFactory + interface Factory : KycComponent.Factory { + override fun create(appComponentContext: AppComponentContext): MockKycComponent + } +} \ No newline at end of file diff --git a/features/kyc/mock/src/main/kotlin/com/tangem/features/kyc/di/FeatureModule.kt b/features/kyc/mock/src/main/kotlin/com/tangem/features/kyc/di/FeatureModule.kt new file mode 100644 index 0000000000..94de8a68b8 --- /dev/null +++ b/features/kyc/mock/src/main/kotlin/com/tangem/features/kyc/di/FeatureModule.kt @@ -0,0 +1,16 @@ +package com.tangem.features.kyc.di + +import com.tangem.features.kyc.KycComponent +import com.tangem.features.kyc.MockKycComponent +import dagger.Binds +import dagger.Module +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent + +@Module +@InstallIn(SingletonComponent::class) +internal interface FeatureModule { + + @Binds + fun bindComponentFactory(impl: MockKycComponent.Factory): KycComponent.Factory +} \ No newline at end of file diff --git a/features/tangempay/onboarding/impl/build.gradle.kts b/features/tangempay/onboarding/impl/build.gradle.kts index 8ebb588cdd..1d205ff513 100644 --- a/features/tangempay/onboarding/impl/build.gradle.kts +++ b/features/tangempay/onboarding/impl/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { /** Features api */ implementation(projects.features.tangempay.onboarding.api) + implementation(projects.features.tangempay.details.api) implementation(projects.features.kyc.api) /** Compose */ diff --git a/features/tangempay/onboarding/impl/src/main/kotlin/com/tangem/features/tangempay/deeplink/DefaultOnboardVisaDeepLinkHandler.kt b/features/tangempay/onboarding/impl/src/main/kotlin/com/tangem/features/tangempay/deeplink/DefaultOnboardVisaDeepLinkHandler.kt index a843aade0a..3b10b702a9 100644 --- a/features/tangempay/onboarding/impl/src/main/kotlin/com/tangem/features/tangempay/deeplink/DefaultOnboardVisaDeepLinkHandler.kt +++ b/features/tangempay/onboarding/impl/src/main/kotlin/com/tangem/features/tangempay/deeplink/DefaultOnboardVisaDeepLinkHandler.kt @@ -3,6 +3,7 @@ package com.tangem.features.tangempay.deeplink import android.net.Uri import dagger.assisted.Assisted import com.tangem.common.routing.AppRoute +import com.tangem.features.tangempay.TangemPayFeatureToggles import com.tangem.common.routing.AppRouter import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject @@ -10,10 +11,15 @@ import dagger.assisted.AssistedInject internal class DefaultOnboardVisaDeepLinkHandler @AssistedInject constructor( @Assisted uri: Uri, appRouter: AppRouter, + tangemPayFeatureToggles: TangemPayFeatureToggles, ) : OnboardVisaDeepLinkHandler { init { - appRouter.push(AppRoute.TangemPayOnboarding(uri.toString())) + if (tangemPayFeatureToggles.isTangemPayEnabled) { + appRouter.push(AppRoute.TangemPayOnboarding(uri.toString())) + } else { + appRouter.push(AppRoute.Home()) + } } @AssistedFactory diff --git a/settings.gradle.kts b/settings.gradle.kts index c70d2637a1..305ea20cc8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -263,8 +263,8 @@ include(":features:hot-wallet:api") include(":features:hot-wallet:impl") include(":features:kyc:api") -//TODO disable for release because of the permissions -// include(":features:kyc:impl") +include(":features:kyc:impl") +include(":features:kyc:mock") include(":features:tangempay:main:api") include(":features:tangempay:main:impl")