forked from thijooree/android
rever commit/4b1c2419 but keeping contact picker fix
This commit is contained in:
@@ -79,41 +79,9 @@ class CredentialStore(context: Context) {
|
||||
.remove("mib_${loginId}_enc_profile")
|
||||
.remove("mib_${loginId}_enc_full_name")
|
||||
.remove("mib_${loginId}_hidden_profile_ids")
|
||||
.remove("mib_${loginId}_enc_session")
|
||||
.apply()
|
||||
}
|
||||
|
||||
// ── MIB active session (xxid + sessionKey + nonceGenerator) ─────────────────
|
||||
|
||||
fun saveMibSession(loginId: String, session: sh.sar.basedbank.api.mib.MibSession) {
|
||||
val json = JSONObject().apply {
|
||||
put("xxid", session.xxid)
|
||||
put("sessionKey", session.sessionKey)
|
||||
put("nonceGenerator", session.nonceGenerator)
|
||||
put("appId", session.appId)
|
||||
}.toString()
|
||||
val key = getOrCreateKey()
|
||||
prefs.edit().putString("mib_${loginId}_enc_session", encrypt(json, key)).apply()
|
||||
}
|
||||
|
||||
fun loadMibSession(loginId: String): sh.sar.basedbank.api.mib.MibSession? {
|
||||
val key = getOrCreateKey()
|
||||
val enc = prefs.getString("mib_${loginId}_enc_session", null) ?: return null
|
||||
return try {
|
||||
val o = JSONObject(decrypt(enc, key))
|
||||
sh.sar.basedbank.api.mib.MibSession(
|
||||
appId = o.getString("appId"),
|
||||
xxid = o.getString("xxid"),
|
||||
nonceGenerator = o.getString("nonceGenerator"),
|
||||
sessionKey = o.getString("sessionKey")
|
||||
)
|
||||
} catch (_: Exception) { null }
|
||||
}
|
||||
|
||||
fun clearMibSession(loginId: String) {
|
||||
prefs.edit().remove("mib_${loginId}_enc_session").apply()
|
||||
}
|
||||
|
||||
// ── MIB session keys (key1/key2) and app ID (per loginId) ────────────────
|
||||
|
||||
fun saveMibKeys(loginId: String, key1: String, key2: String) {
|
||||
|
||||
Reference in New Issue
Block a user