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

Commit cdea779

Browse files
committed
app: rename AndroidKeyManager to GPGKeyManager
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
1 parent a2a9386 commit cdea779

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

app/src/main/java/dev/msfjarvis/aps/injection/crypto/KeyManagerModule.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@ import dagger.Module
1010
import dagger.Provides
1111
import dagger.hilt.InstallIn
1212
import dagger.hilt.components.SingletonComponent
13-
import dev.msfjarvis.aps.data.crypto.AndroidKeyManager
13+
import dev.msfjarvis.aps.data.crypto.GPGKeyManager
1414
import dev.msfjarvis.aps.data.crypto.KeyManager
1515
import dev.msfjarvis.aps.injection.context.FilesDirPath
1616

1717
@Module
1818
@InstallIn(SingletonComponent::class)
1919
abstract class KeyManagerModule {
2020

21-
@Binds abstract fun bindKeyManager(androidKeyManager: AndroidKeyManager): KeyManager
21+
@Binds
22+
abstract fun bindKeyManager(gpgKeyManager: GPGKeyManager): KeyManager
2223

2324
internal companion object {
2425

2526
@Provides
26-
fun providesAndroidKeyManager(@FilesDirPath filesDirPath: String): AndroidKeyManager {
27+
fun providesAndroidKeyManager(@FilesDirPath filesDirPath: String): GPGKeyManager {
2728
// TODO: Use dagger for coroutine dispatchers
28-
return AndroidKeyManager(filesDirPath)
29+
return GPGKeyManager(filesDirPath)
2930
}
3031
}
3132
}

app/src/main/java/dev/msfjarvis/aps/ui/crypto/GopenpgpDecryptActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import android.view.MenuItem
1212
import androidx.lifecycle.lifecycleScope
1313
import dagger.hilt.android.AndroidEntryPoint
1414
import dev.msfjarvis.aps.R
15-
import dev.msfjarvis.aps.data.crypto.AndroidKeyManager
15+
import dev.msfjarvis.aps.data.crypto.GPGKeyManager
1616
import dev.msfjarvis.aps.data.crypto.GopenpgpCryptoHandler
1717
import dev.msfjarvis.aps.data.passfile.PasswordEntry
1818
import dev.msfjarvis.aps.data.password.FieldItem
@@ -37,7 +37,7 @@ class GopenpgpDecryptActivity : BasePgpActivity() {
3737
private val binding by viewBinding(DecryptLayoutBinding::inflate)
3838
@Inject lateinit var passwordEntryFactory: PasswordEntryFactory
3939
@Inject lateinit var gopenpgpCrypto: GopenpgpCryptoHandler
40-
@Inject lateinit var gpgKeyManager: AndroidKeyManager
40+
@Inject lateinit var gpgKeyManager: GPGKeyManager
4141
private val relativeParentPath by unsafeLazy { getParentPath(fullPath, repoPath) }
4242

4343
private var passwordEntry: PasswordEntry? = null

crypto-pgp/src/main/kotlin/dev/msfjarvis/aps/data/crypto/AndroidKeyManager.kt renamed to crypto-pgp/src/main/kotlin/dev/msfjarvis/aps/data/crypto/GPGKeyManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import kotlinx.coroutines.CoroutineDispatcher
1010
import kotlinx.coroutines.Dispatchers
1111
import kotlinx.coroutines.withContext
1212

13-
public class AndroidKeyManager(
13+
public class GPGKeyManager(
1414
filesDirPath: String,
1515
private val dispatcher: CoroutineDispatcher = Dispatchers.IO
1616
) : KeyManager {

crypto-pgp/src/main/kotlin/dev/msfjarvis/aps/data/crypto/GopenpgpCryptoHandler.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import javax.inject.Inject
1313
/** Gopenpgp backed implementation of [CryptoHandler]. */
1414
public class GopenpgpCryptoHandler
1515
@Inject
16-
constructor(private val gpgKeyManager: AndroidKeyManager) : CryptoHandler {
16+
constructor(
17+
private val gpgKeyManager: GPGKeyManager
18+
) : CryptoHandler {
1719

1820
/**
1921
* Decrypt the given [ciphertext] using the given PGP [privateKey] and corresponding [passphrase].

0 commit comments

Comments
 (0)