Skip to content

Commit

Permalink
Allow remote configure for DKB legacy server (new server is provided …
Browse files Browse the repository at this point in the history
…via hbci4java)
  • Loading branch information
mtotschnig committed Nov 19, 2024
1 parent 6634a70 commit 0c40fa5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fints/src/main/java/org/totschnig/fints/BankingViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -109,6 +112,8 @@ class BankingViewModel(application: Application) :
ContentResolvingAndroidViewModel(application) {
@Inject
lateinit var tracker: Tracker
@Inject
lateinit var configurator: Configurator

init {
System.setProperty(
Expand Down Expand Up @@ -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) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -177,6 +178,8 @@ interface Builder {

DataStore<Preferences> preferencesDataStore();

Configurator configurator();

void inject(MyApplication application);

void inject(ExpenseEdit expenseEdit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0c40fa5

Please sign in to comment.