Centralize config + EncryptedSharedPreferences for credentials
ClippyAuto CI / build (push) Has been cancelled
ClippyAuto CI / build (push) Has been cancelled
- New AppConfig singleton backed by EncryptedSharedPreferences - Credentials stored in Android Keystore (AES256-GCM) - Removed hardcoded creds from ClippySession and SetupActivity - Access token caching to avoid re-login on each session - Defaults seeded on first run for backward compatibility Co-authored-by: Spirit <spirit@hobbs.farm>
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
package farm.hobbs.clippyauto
|
||||
|
||||
import android.app.Application
|
||||
import farm.hobbs.clippyauto.config.AppConfig
|
||||
import farm.hobbs.clippyauto.matrix.MatrixRestClient
|
||||
|
||||
class ClippyAutoApp : Application() {
|
||||
|
||||
lateinit var matrixClient: farm.hobbs.clippyauto.matrix.MatrixRestClient
|
||||
lateinit var matrixClient: MatrixRestClient
|
||||
private set
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
instance = this
|
||||
matrixClient = farm.hobbs.clippyauto.matrix.MatrixRestClient(
|
||||
homeserverUrl = "https://mess.hobbs.farm"
|
||||
|
||||
// Initialize encrypted config before anything else
|
||||
AppConfig.init(this)
|
||||
|
||||
matrixClient = MatrixRestClient(
|
||||
homeserverUrl = AppConfig.homeserverUrl
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user