2.7 KiB
Login
LoginActivity handles adding bank accounts. It is shown on first launch (after onboarding) and also opened from Settings → Logins → Add Account.
Fragment Flow
LoginActivity
└─ BankSelectionFragment ← pick a bank
└─ CredentialsFragment ← enter credentials for that bank
Bank Selection — BankSelectionFragment
A scrollable list of supported banks presented as selectable cards:
| Bank | Notes |
|---|---|
| MIB (Maldives Islamic Bank) | Username + password |
| BML (Bank of Maldives) | Username + password |
| Fahipay | Mobile number + password |
Tapping a card navigates to CredentialsFragment with the selected bank pre-set.
Credentials — CredentialsFragment
MIB Login
Fields:
- Username
- Password
Flow on submit:
MibLoginFlow.login()— performs Diffie-Hellman key exchange, then authenticates with Blowfish/ECB-encrypted credentials- On success, fetches
operatingProfiles— the list of CIF profiles (Individual, Sole Propr, etc.) - Each profile is stored as a
MibAccountwithbank = "MIB"andcifTypefrom the API - Sessions are stored in
BasedBankApp.mibSessions
BML Login
Fields:
- Username (customer ID)
- Password
Flow on submit:
BmlLoginFlow.login()— OAuth password grant → access token + refresh token- Fetches dashboard → list of CASA accounts + cards
- Each account/card stored as
MibAccountwithbank = "BML" - Tokens stored in
BasedBankApp.bmlSessions
Fahipay Login
Fields:
- Mobile number (7-digit local, auto-prefixed with +960)
- Password
Flow on submit:
FahipayLoginFlow.login()— authenticates against Fahipay API- On success, stores
authID+__Secure-sesscookie - Single wallet account stored with
bank = "FAHIPAY"
Multi-Profile Support
Each MIB login can have multiple CIF profiles (e.g., an individual and a business account under the same username). Each profile appears as a separate entry in the accounts list and can be toggled independently in Settings → Logins.
BML and Fahipay each yield a single profile per login.
Adding the same bank login a second time merges its profiles into the existing login rather than creating a duplicate.
Credential Storage
All credentials (username, password, tokens, session cookies) are encrypted via CredentialStore, which uses Android EncryptedSharedPreferences backed by a hardware-keystore key where available.
After Login
CredentialsFragment calls app.autoRefresh() after a successful login, then navigates back to LoginActivity's result which routes to HomeActivity (or back to Settings if called from there).
← Lock Screen Next → Accounts