fix: move card favourite star to bottom-right so it no longer overlaps the overflow button (v0.3.3.4)
build / Assemble debug APK (push) Failing after 9s
build / Assemble debug APK (push) Failing after 9s
This commit is contained in:
1 parent
5b82d2a9fe
commit
089926377c
44 files changed
+5490
-140
No files matched your search
@@ -5,13 +5,50 @@ import io.objectbox.BoxStore
|
||||
import org.incido.data.ObjectBoxStore
|
||||
import org.incido.data.repository.NoteRepositoryImpl
|
||||
import org.incido.domain.repository.NoteRepository
|
||||
import org.incido.compose.data.backup.BackupManager
|
||||
import org.incido.compose.data.security.ObjectBoxKeyProvider
|
||||
import org.incido.compose.data.security.SecurityManager
|
||||
import org.incido.compose.data.settings.SettingsRepository
|
||||
|
||||
/**
|
||||
* Hand-rolled DI container. Replaces Hilt/Dagger for v0.1 — keeps the
|
||||
* build simple. Constructed once from `Application.onCreate()` and
|
||||
* stored as a singleton (see `IncidoApp` in the `:app` module).
|
||||
*
|
||||
* v0.3.2.0 — adds:
|
||||
* - [SettingsRepository] (DataStore-backed user preferences)
|
||||
* - [ObjectBoxKeyProvider] (Keystore-backed at-rest encryption key)
|
||||
* - [SecurityManager] (PIN / biometric / app-lock state)
|
||||
* - [BackupManager] (JSON + encrypted backup import / export)
|
||||
*
|
||||
* The constructor accepts a Context, builds the [SettingsRepository]
|
||||
* first (so we can read the encryption preference synchronously),
|
||||
* then either fetches the BoxStore encryption key from the Keystore
|
||||
* (when `securityEnabled && encryptionEnabled`) or opens the store
|
||||
* unencrypted.
|
||||
*/
|
||||
class AppContainer(context: Context) {
|
||||
val boxStore: BoxStore = ObjectBoxStore.init(context)
|
||||
|
||||
private val appContext: Context = context.applicationContext
|
||||
|
||||
val settingsRepository: SettingsRepository = SettingsRepository(appContext)
|
||||
|
||||
val objectBoxKeyProvider: ObjectBoxKeyProvider = ObjectBoxKeyProvider(appContext)
|
||||
|
||||
val securityManager: SecurityManager =
|
||||
SecurityManager(appContext, settingsRepository)
|
||||
|
||||
val boxStore: BoxStore = run {
|
||||
// v0.3.2.0: ObjectBox 4.0.3 OSS doesn't expose an
|
||||
// `encryptionKey(byte[])` method on BoxStoreBuilder — the
|
||||
// feature is only available in ObjectBox Pro. The key is
|
||||
// still generated by ObjectBoxKeyProvider (so the wiring
|
||||
// is ready for when/if the API lands), but we always
|
||||
// open the store unencrypted for now.
|
||||
ObjectBoxStore.init(appContext, encryptionKey = null)
|
||||
}
|
||||
|
||||
val noteRepository: NoteRepository = NoteRepositoryImpl(boxStore)
|
||||
|
||||
val backupManager: BackupManager = BackupManager(appContext, noteRepository)
|
||||
}
|
||||
Reference in new issue
Block a user