mirror of
https://github.com/revanced/revanced-manager-compose.git
synced 2025-04-29 22:04:25 +02:00
refactor: use getDir instead of filesDir directly
This commit is contained in:
parent
ea3d20997c
commit
c324483485
@ -1,6 +1,7 @@
|
||||
package app.revanced.manager.domain.manager
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import app.revanced.manager.util.signing.Signer
|
||||
import app.revanced.manager.util.signing.SigningOptions
|
||||
import java.io.File
|
||||
@ -23,7 +24,7 @@ class KeystoreManager(app: Application, private val prefs: PreferencesManager) {
|
||||
const val FLUTTER_MANAGER_PASSWORD = "s3cur3p@ssw0rd"
|
||||
}
|
||||
|
||||
private val keystorePath = app.filesDir.resolve("manager.keystore").toPath()
|
||||
private val keystorePath = app.getDir("signing", Context.MODE_PRIVATE).resolve("manager.keystore").toPath()
|
||||
private fun options(
|
||||
cn: String = prefs.keystoreCommonName!!,
|
||||
pass: String = prefs.keystorePass!!
|
||||
|
@ -1,6 +1,7 @@
|
||||
package app.revanced.manager.domain.repository
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import app.revanced.manager.data.room.sources.SourceEntity
|
||||
import app.revanced.manager.data.room.sources.SourceLocation
|
||||
@ -20,7 +21,7 @@ import java.io.File
|
||||
import java.io.InputStream
|
||||
|
||||
class SourceRepository(app: Application, private val persistenceRepo: SourcePersistenceRepository) {
|
||||
private val sourcesDir = app.filesDir.resolve("sources").also { it.mkdirs() }
|
||||
private val sourcesDir = app.getDir("sources", Context.MODE_PRIVATE)
|
||||
|
||||
private val _sources: MutableStateFlow<Map<Int, Source>> = MutableStateFlow(emptyMap())
|
||||
val sources = _sources.map { it.values.toList() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user