Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit c980c89

Browse files
committed
chore: reformat with trailing commas changes
1 parent de6cdfe commit c980c89

File tree

100 files changed

+309
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+309
-563
lines changed

app/src/main/java/app/passwordstore/data/crypto/CryptoRepository.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ constructor(
7777
.withAsciiArmor(settings.getBoolean(PreferenceKeys.ASCII_ARMOR, false))
7878
.build()
7979
val keys = identities.map { id -> pgpKeyManager.getKeyById(id) }.filterValues()
80-
return pgpCryptoHandler.encrypt(
81-
keys,
82-
content,
83-
out,
84-
encryptionOptions,
85-
)
80+
return pgpCryptoHandler.encrypt(keys, content, out, encryptionOptions)
8681
}
8782
}

app/src/main/java/app/passwordstore/data/crypto/PGPPassphraseCache.kt

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,21 @@ import javax.inject.Inject
1111
import kotlinx.coroutines.withContext
1212

1313
/** Implements a rudimentary [EncryptedSharedPreferences]-backed cache for GPG passphrases. */
14-
class PGPPassphraseCache
15-
@Inject
16-
constructor(
17-
private val dispatcherProvider: DispatcherProvider,
18-
) {
14+
class PGPPassphraseCache @Inject constructor(private val dispatcherProvider: DispatcherProvider) {
1915

20-
suspend fun cachePassphrase(
21-
context: Context,
22-
identifier: PGPIdentifier,
23-
passphrase: String,
24-
) {
16+
suspend fun cachePassphrase(context: Context, identifier: PGPIdentifier, passphrase: String) {
2517
withContext(dispatcherProvider.io()) {
2618
getPreferences(context).edit { putString(identifier.toString(), passphrase) }
2719
}
2820
}
2921

30-
suspend fun retrieveCachedPassphrase(
31-
context: Context,
32-
identifier: PGPIdentifier,
33-
): String? {
22+
suspend fun retrieveCachedPassphrase(context: Context, identifier: PGPIdentifier): String? {
3423
return withContext(dispatcherProvider.io()) {
3524
getPreferences(context).getString(identifier.toString())
3625
}
3726
}
3827

39-
suspend fun clearCachedPassphrase(
40-
context: Context,
41-
identifier: PGPIdentifier,
42-
) {
28+
suspend fun clearCachedPassphrase(context: Context, identifier: PGPIdentifier) {
4329
withContext(dispatcherProvider.io()) {
4430
getPreferences(context).edit { remove(identifier.toString()) }
4531
}

app/src/main/java/app/passwordstore/data/password/FieldItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import app.passwordstore.data.passfile.Totp
1010
class FieldItem(val key: String, val value: String, val action: ActionType) {
1111
enum class ActionType {
1212
COPY,
13-
HIDE
13+
HIDE,
1414
}
1515

1616
enum class ItemType(val type: String, val label: String) {

app/src/main/java/app/passwordstore/data/password/PasswordItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data class PasswordItem(
1616
val parent: PasswordItem? = null,
1717
val type: Char,
1818
val file: File,
19-
val rootDir: File
19+
val rootDir: File,
2020
) : Comparable<PasswordItem> {
2121

2222
val fullPathToParent = file.absolutePath.replace(rootDir.absolutePath, "").replace(file.name, "")

app/src/main/java/app/passwordstore/data/repo/PasswordRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ object PasswordRepository {
167167
fun getPasswords(
168168
path: File,
169169
rootDir: File,
170-
sortOrder: PasswordSortOrder
170+
sortOrder: PasswordSortOrder,
171171
): ArrayList<PasswordItem> {
172172
// We need to recover the passwords then parse the files
173173
val passList = getFilesList(path).also { it.sortBy { f -> f.name } }

app/src/main/java/app/passwordstore/injection/crypto/KeyManagerModule.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ object KeyManagerModule {
2323
@PGPKeyDir keyDir: String,
2424
dispatcherProvider: DispatcherProvider,
2525
): PGPKeyManager {
26-
return PGPKeyManager(
27-
keyDir,
28-
dispatcherProvider.io(),
29-
)
26+
return PGPKeyManager(keyDir, dispatcherProvider.io())
3027
}
3128

3229
@Provides

app/src/main/java/app/passwordstore/injection/prefs/PreferenceModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PreferenceModule {
2525
fileName,
2626
masterKeyAlias,
2727
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
28-
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
28+
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM,
2929
)
3030
}
3131

app/src/main/java/app/passwordstore/injection/pwgen/DicewareModule.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ object DicewareModule {
3232
}
3333

3434
@Provides
35-
fun provideDie(
36-
intGenerator: RandomIntGenerator,
37-
): Die {
35+
fun provideDie(intGenerator: RandomIntGenerator): Die {
3836
return Die(6, intGenerator)
3937
}
4038

app/src/main/java/app/passwordstore/ui/autofill/AutofillDecryptActivity.kt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ class AutofillDecryptActivity : BasePGPActivity() {
113113
val cachedPassphrase =
114114
passphraseCache.retrieveCachedPassphrase(
115115
this@AutofillDecryptActivity,
116-
gpgIdentifiers.first()
116+
gpgIdentifiers.first(),
117117
)
118118
if (cachedPassphrase != null) {
119119
decryptWithPassphrase(
120120
File(filePath),
121121
gpgIdentifiers,
122122
clientState,
123123
action,
124-
cachedPassphrase
124+
cachedPassphrase,
125125
)
126126
} else {
127127
askPassphrase(filePath, gpgIdentifiers, clientState, action)
@@ -169,12 +169,12 @@ class AutofillDecryptActivity : BasePGPActivity() {
169169
this@AutofillDecryptActivity,
170170
credentials,
171171
clientState,
172-
action
172+
action,
173173
)
174174
withContext(dispatcherProvider.main()) {
175175
setResult(
176176
RESULT_OK,
177-
Intent().apply { putExtra(AutofillManager.EXTRA_AUTHENTICATION_RESULT, fillInDataset) }
177+
Intent().apply { putExtra(AutofillManager.EXTRA_AUTHENTICATION_RESULT, fillInDataset) },
178178
)
179179
}
180180
}
@@ -195,12 +195,7 @@ class AutofillDecryptActivity : BasePGPActivity() {
195195
runCatching {
196196
withContext(dispatcherProvider.io()) {
197197
val outputStream = ByteArrayOutputStream()
198-
repository.decrypt(
199-
password,
200-
identifiers,
201-
encryptedInput,
202-
outputStream,
203-
)
198+
repository.decrypt(password, identifiers, encryptedInput, outputStream)
204199
outputStream
205200
}
206201
}

app/src/main/java/app/passwordstore/ui/autofill/AutofillFilterView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class AutofillFilterView : AppCompatActivity() {
6161

6262
fun makeMatchAndDecryptFileIntentSender(
6363
context: Context,
64-
formOrigin: FormOrigin
64+
formOrigin: FormOrigin,
6565
): IntentSender {
6666
val intent =
6767
Intent(context, AutofillFilterView::class.java).apply {
@@ -193,7 +193,7 @@ class AutofillFilterView : AppCompatActivity() {
193193
shouldMatch.text =
194194
getString(
195195
R.string.oreo_autofill_match_with,
196-
formOrigin.getPrettyIdentifier(applicationContext)
196+
formOrigin.getPrettyIdentifier(applicationContext),
197197
)
198198
lifecycleScope.launch { handleSearchResults() }
199199
}
@@ -222,7 +222,7 @@ class AutofillFilterView : AppCompatActivity() {
222222
filterMode =
223223
if (binding.strictDomainSearch.isChecked) FilterMode.StrictDomain else FilterMode.Fuzzy,
224224
searchMode = SearchMode.RecursivelyInSubdirectories,
225-
listMode = ListMode.FilesOnly
225+
listMode = ListMode.FilesOnly,
226226
)
227227
}
228228

0 commit comments

Comments
 (0)