summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/main/LaunchActivity.kt18
1 files changed, 17 insertions, 1 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/main/LaunchActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/main/LaunchActivity.kt
index b5f7a593..a918a076 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/main/LaunchActivity.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/main/LaunchActivity.kt
@@ -10,16 +10,24 @@ import android.os.Handler
import android.os.Looper
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.edit
+import dagger.hilt.android.AndroidEntryPoint
import dev.msfjarvis.aps.ui.crypto.BasePgpActivity
import dev.msfjarvis.aps.ui.crypto.DecryptActivity
+import dev.msfjarvis.aps.ui.crypto.DecryptActivityV2
import dev.msfjarvis.aps.ui.passwords.PasswordStore
import dev.msfjarvis.aps.util.auth.BiometricAuthenticator
import dev.msfjarvis.aps.util.auth.BiometricAuthenticator.Result
import dev.msfjarvis.aps.util.extensions.sharedPrefs
+import dev.msfjarvis.aps.util.features.Feature
+import dev.msfjarvis.aps.util.features.Features
import dev.msfjarvis.aps.util.settings.PreferenceKeys
+import javax.inject.Inject
+@AndroidEntryPoint
class LaunchActivity : AppCompatActivity() {
+ @Inject lateinit var features: Features
+
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val prefs = sharedPrefs
@@ -44,10 +52,18 @@ class LaunchActivity : AppCompatActivity() {
}
}
+ private fun getDecryptIntent(): Intent {
+ return if (features.isEnabled(Feature.EnablePGPainlessBackend)) {
+ Intent(this, DecryptActivityV2::class.java)
+ } else {
+ Intent(this, DecryptActivity::class.java)
+ }
+ }
+
private fun startTargetActivity(noAuth: Boolean) {
val intentToStart =
if (intent.action == ACTION_DECRYPT_PASS)
- Intent(this, DecryptActivity::class.java).apply {
+ getDecryptIntent().apply {
putExtra(
BasePgpActivity.EXTRA_FILE_PATH,
intent.getStringExtra(BasePgpActivity.EXTRA_FILE_PATH)