diff --git a/fints/src/main/java/org/totschnig/fints/BankingViewModel.kt b/fints/src/main/java/org/totschnig/fints/BankingViewModel.kt index ec572de20d..680a2ce44a 100644 --- a/fints/src/main/java/org/totschnig/fints/BankingViewModel.kt +++ b/fints/src/main/java/org/totschnig/fints/BankingViewModel.kt @@ -72,6 +72,9 @@ import org.totschnig.myexpenses.provider.TransactionProvider import org.totschnig.myexpenses.provider.useAndMapToList import org.totschnig.myexpenses.util.ResultUnit import org.totschnig.myexpenses.util.Utils +import org.totschnig.myexpenses.util.config.Configurator +import org.totschnig.myexpenses.util.config.Configurator.Configuration.DKB_USE_LEGACY_PIN_TAN_ADDRESS +import org.totschnig.myexpenses.util.config.get import org.totschnig.myexpenses.util.crashreporting.CrashHandler import org.totschnig.myexpenses.util.crypt.PassphraseRepository import org.totschnig.myexpenses.util.safeMessage @@ -109,6 +112,8 @@ class BankingViewModel(application: Application) : ContentResolvingAndroidViewModel(application) { @Inject lateinit var tracker: Tracker + @Inject + lateinit var configurator: Configurator init { System.setProperty( @@ -272,7 +277,13 @@ class BankingViewModel(application: Application) : HBCIUtils.setParam("client.passport.PinTan.init", "1") Feature.INIT_FLIP_USER_INST.isEnabled = false return HBCIUtils.getBankInfo(bankingCredentials.blz) - ?.takeIf { it.rdhAddress != null && it.pinTanAddress != null } + ?.takeIf { it.pinTanAddress != null }?.also { + if(bankingCredentials.blz == WellKnownBank.DKB.blz.first() && + configurator[DKB_USE_LEGACY_PIN_TAN_ADDRESS, false] + ) { + it.pinTanAddress = "https://banking-dkb.s-fints-pt-dkb.de/fints30" + } + } } private fun passportFile(blz: String, user: String) = diff --git a/myExpenses/src/main/java/org/totschnig/myexpenses/di/AppComponent.java b/myExpenses/src/main/java/org/totschnig/myexpenses/di/AppComponent.java index 168161be02..6f84f61974 100644 --- a/myExpenses/src/main/java/org/totschnig/myexpenses/di/AppComponent.java +++ b/myExpenses/src/main/java/org/totschnig/myexpenses/di/AppComponent.java @@ -61,6 +61,7 @@ import org.totschnig.myexpenses.task.GrisbiImportTask; import org.totschnig.myexpenses.util.ICurrencyFormatter; import org.totschnig.myexpenses.util.ads.BaseAdHandler; +import org.totschnig.myexpenses.util.config.Configurator; import org.totschnig.myexpenses.util.crashreporting.CrashHandler; import org.totschnig.myexpenses.util.licence.LicenceHandler; import org.totschnig.myexpenses.util.tracking.Tracker; @@ -177,6 +178,8 @@ interface Builder { DataStore preferencesDataStore(); + Configurator configurator(); + void inject(MyApplication application); void inject(ExpenseEdit expenseEdit); diff --git a/myExpenses/src/main/java/org/totschnig/myexpenses/util/config/Configurator.kt b/myExpenses/src/main/java/org/totschnig/myexpenses/util/config/Configurator.kt index 4296bc7d1f..2d351e285b 100644 --- a/myExpenses/src/main/java/org/totschnig/myexpenses/util/config/Configurator.kt +++ b/myExpenses/src/main/java/org/totschnig/myexpenses/util/config/Configurator.kt @@ -7,6 +7,7 @@ interface Configurator { enum class Configuration { USE_SET_DECOR_PADDING_WORKAROUND, AUTO_COMPLETE_DROPDOWN_SET_INPUT_METHOD_NEEDED, + DKB_USE_LEGACY_PIN_TAN_ADDRESS, ad_handling_waterfall; }