This repository was archived by the owner on Oct 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed
app/src/main/java/dev/msfjarvis/aps
crypto-pgp/src/main/kotlin/dev/msfjarvis/aps/data/crypto Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,23 @@ import dagger.Module
10
10
import dagger.Provides
11
11
import dagger.hilt.InstallIn
12
12
import dagger.hilt.components.SingletonComponent
13
- import dev.msfjarvis.aps.data.crypto.AndroidKeyManager
13
+ import dev.msfjarvis.aps.data.crypto.GPGKeyManager
14
14
import dev.msfjarvis.aps.data.crypto.KeyManager
15
15
import dev.msfjarvis.aps.injection.context.FilesDirPath
16
16
17
17
@Module
18
18
@InstallIn(SingletonComponent ::class )
19
19
abstract class KeyManagerModule {
20
20
21
- @Binds abstract fun bindKeyManager (androidKeyManager : AndroidKeyManager ): KeyManager
21
+ @Binds
22
+ abstract fun bindKeyManager (gpgKeyManager : GPGKeyManager ): KeyManager
22
23
23
24
internal companion object {
24
25
25
26
@Provides
26
- fun providesAndroidKeyManager (@FilesDirPath filesDirPath : String ): AndroidKeyManager {
27
+ fun providesAndroidKeyManager (@FilesDirPath filesDirPath : String ): GPGKeyManager {
27
28
// TODO: Use dagger for coroutine dispatchers
28
- return AndroidKeyManager (filesDirPath)
29
+ return GPGKeyManager (filesDirPath)
29
30
}
30
31
}
31
32
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import android.view.MenuItem
12
12
import androidx.lifecycle.lifecycleScope
13
13
import dagger.hilt.android.AndroidEntryPoint
14
14
import dev.msfjarvis.aps.R
15
- import dev.msfjarvis.aps.data.crypto.AndroidKeyManager
15
+ import dev.msfjarvis.aps.data.crypto.GPGKeyManager
16
16
import dev.msfjarvis.aps.data.crypto.GopenpgpCryptoHandler
17
17
import dev.msfjarvis.aps.data.passfile.PasswordEntry
18
18
import dev.msfjarvis.aps.data.password.FieldItem
@@ -37,7 +37,7 @@ class GopenpgpDecryptActivity : BasePgpActivity() {
37
37
private val binding by viewBinding(DecryptLayoutBinding ::inflate)
38
38
@Inject lateinit var passwordEntryFactory: PasswordEntryFactory
39
39
@Inject lateinit var gopenpgpCrypto: GopenpgpCryptoHandler
40
- @Inject lateinit var gpgKeyManager: AndroidKeyManager
40
+ @Inject lateinit var gpgKeyManager: GPGKeyManager
41
41
private val relativeParentPath by unsafeLazy { getParentPath(fullPath, repoPath) }
42
42
43
43
private var passwordEntry: PasswordEntry ? = null
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import kotlinx.coroutines.CoroutineDispatcher
10
10
import kotlinx.coroutines.Dispatchers
11
11
import kotlinx.coroutines.withContext
12
12
13
- public class AndroidKeyManager (
13
+ public class GPGKeyManager (
14
14
filesDirPath : String ,
15
15
private val dispatcher : CoroutineDispatcher = Dispatchers .IO
16
16
) : KeyManager {
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ import javax.inject.Inject
13
13
/* * Gopenpgp backed implementation of [CryptoHandler]. */
14
14
public class GopenpgpCryptoHandler
15
15
@Inject
16
- constructor (private val gpgKeyManager: AndroidKeyManager ) : CryptoHandler {
16
+ constructor (
17
+ private val gpgKeyManager: GPGKeyManager
18
+ ) : CryptoHandler {
17
19
18
20
/* *
19
21
* Decrypt the given [ciphertext] using the given PGP [privateKey] and corresponding [passphrase].
You can’t perform that action at this time.
0 commit comments