aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-05-15 12:56:49 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-05-15 15:40:20 +0530
commit7e2eb2425e7b9b6ccb37b7b89f19de3fa7a20c44 (patch)
tree6b8a9557ac51b5fab5d2ad7611084cf0de6c57cf /app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
parent2fcb285e276594842798be6990b92ba09e733f49 (diff)
downloadHardenedPass-7e2eb2425e7b9b6ccb37b7b89f19de3fa7a20c44.tar.gz
HardenedPass-7e2eb2425e7b9b6ccb37b7b89f19de3fa7a20c44.zip
all: reformat with Spotless again
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt18
1 files changed, 13 insertions, 5 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
index 3a508e45..d3c85fa7 100644
--- a/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/util/settings/GitSettings.kt
@@ -25,7 +25,8 @@ enum class Protocol(val pref: String) {
private val map = values().associateBy(Protocol::pref)
fun fromString(type: String?): Protocol {
- return map[type ?: return Ssh] ?: throw IllegalArgumentException("$type is not a valid Protocol")
+ return map[type ?: return Ssh]
+ ?: throw IllegalArgumentException("$type is not a valid Protocol")
}
}
}
@@ -41,7 +42,8 @@ enum class AuthMode(val pref: String) {
private val map = values().associateBy(AuthMode::pref)
fun fromString(type: String?): AuthMode {
- return map[type ?: return SshKey] ?: throw IllegalArgumentException("$type is not a valid AuthMode")
+ return map[type ?: return SshKey]
+ ?: throw IllegalArgumentException("$type is not a valid AuthMode")
}
}
}
@@ -50,12 +52,18 @@ object GitSettings {
private const val DEFAULT_BRANCH = "master"
- private val settings by lazy(LazyThreadSafetyMode.PUBLICATION) { Application.instance.sharedPrefs }
+ private val settings by lazy(LazyThreadSafetyMode.PUBLICATION) {
+ Application.instance.sharedPrefs
+ }
private val encryptedSettings by lazy(LazyThreadSafetyMode.PUBLICATION) {
Application.instance.getEncryptedGitPrefs()
}
- private val proxySettings by lazy(LazyThreadSafetyMode.PUBLICATION) { Application.instance.getEncryptedProxyPrefs() }
- private val hostKeyPath by lazy(LazyThreadSafetyMode.NONE) { "${Application.instance.filesDir}/.host_key" }
+ private val proxySettings by lazy(LazyThreadSafetyMode.PUBLICATION) {
+ Application.instance.getEncryptedProxyPrefs()
+ }
+ private val hostKeyPath by lazy(LazyThreadSafetyMode.NONE) {
+ "${Application.instance.filesDir}/.host_key"
+ }
var authMode
get() = AuthMode.fromString(settings.getString(PreferenceKeys.GIT_REMOTE_AUTH))