diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-07-15 13:48:08 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2022-07-15 13:50:18 +0530 |
commit | a6bcdd1d9da0fbc3d33cbfcace4756c79887170d (patch) | |
tree | ba9c5d35542188b205aaf279db996cfeb1ed6166 /app | |
parent | 29dbcaabba1a7145cd4c95a0b81dc6e850e8ee22 (diff) |
Remove PGPainless feature flag
Diffstat (limited to 'app')
9 files changed, 12 insertions, 72 deletions
diff --git a/app/src/main/java/app/passwordstore/ui/autofill/AutofillFilterView.kt b/app/src/main/java/app/passwordstore/ui/autofill/AutofillFilterView.kt index 869904c1..af8f563b 100644 --- a/app/src/main/java/app/passwordstore/ui/autofill/AutofillFilterView.kt +++ b/app/src/main/java/app/passwordstore/ui/autofill/AutofillFilterView.kt @@ -31,8 +31,6 @@ import app.passwordstore.util.autofill.AutofillMatcher import app.passwordstore.util.autofill.AutofillPreferences import app.passwordstore.util.autofill.DirectoryStructure import app.passwordstore.util.extensions.viewBinding -import app.passwordstore.util.features.Feature -import app.passwordstore.util.features.Features import app.passwordstore.util.viewmodel.FilterMode import app.passwordstore.util.viewmodel.ListMode import app.passwordstore.util.viewmodel.SearchMode @@ -40,7 +38,6 @@ import app.passwordstore.util.viewmodel.SearchableRepositoryAdapter import app.passwordstore.util.viewmodel.SearchableRepositoryViewModel import com.github.androidpasswordstore.autofillparser.FormOrigin import dagger.hilt.android.AndroidEntryPoint -import javax.inject.Inject import logcat.LogPriority.ERROR import logcat.logcat @@ -84,7 +81,6 @@ class AutofillFilterView : AppCompatActivity() { } } - @Inject lateinit var features: Features private lateinit var formOrigin: FormOrigin private lateinit var directoryStructure: DirectoryStructure private val binding by viewBinding(ActivityOreoAutofillFilterBinding::inflate) @@ -231,11 +227,7 @@ class AutofillFilterView : AppCompatActivity() { AutofillMatcher.addMatchFor(applicationContext, formOrigin, item.file) // intent?.extras? is checked to be non-null in onCreate decryptAction.launch( - if (features.isEnabled(Feature.EnablePGPainlessBackend)) { - AutofillDecryptActivityV2.makeDecryptFileIntent(item.file, intent!!.extras!!, this) - } else { - AutofillDecryptActivity.makeDecryptFileIntent(item.file, intent!!.extras!!, this) - } + AutofillDecryptActivityV2.makeDecryptFileIntent(item.file, intent!!.extras!!, this) ) } } diff --git a/app/src/main/java/app/passwordstore/ui/autofill/AutofillSaveActivity.kt b/app/src/main/java/app/passwordstore/ui/autofill/AutofillSaveActivity.kt index d5cb7e1c..a5a0d34e 100644 --- a/app/src/main/java/app/passwordstore/ui/autofill/AutofillSaveActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/autofill/AutofillSaveActivity.kt @@ -21,14 +21,11 @@ import app.passwordstore.util.autofill.AutofillMatcher import app.passwordstore.util.autofill.AutofillPreferences import app.passwordstore.util.autofill.AutofillResponseBuilder import app.passwordstore.util.extensions.unsafeLazy -import app.passwordstore.util.features.Feature -import app.passwordstore.util.features.Features import com.github.androidpasswordstore.autofillparser.AutofillAction import com.github.androidpasswordstore.autofillparser.Credentials import com.github.androidpasswordstore.autofillparser.FormOrigin import dagger.hilt.android.AndroidEntryPoint import java.io.File -import javax.inject.Inject import logcat.LogPriority.ERROR import logcat.logcat @@ -108,17 +105,11 @@ class AutofillSaveActivity : AppCompatActivity() { } } - @Inject lateinit var features: Features - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val repo = PasswordRepository.getRepositoryDirectory() - val creationActivity = - if (features.isEnabled(Feature.EnablePGPainlessBackend)) - PasswordCreationActivityV2::class.java - else PasswordCreationActivity::class.java val saveIntent = - Intent(this, creationActivity).apply { + Intent(this, PasswordCreationActivityV2::class.java).apply { putExtras( bundleOf( "REPO_PATH" to repo.absolutePath, diff --git a/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt b/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt index 8e97b876..7298e038 100644 --- a/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt @@ -25,7 +25,6 @@ import app.passwordstore.util.extensions.clipboard import app.passwordstore.util.extensions.getString import app.passwordstore.util.extensions.snackbar import app.passwordstore.util.extensions.unsafeLazy -import app.passwordstore.util.features.Feature import app.passwordstore.util.features.Features import app.passwordstore.util.services.ClipboardService import app.passwordstore.util.settings.PreferenceKeys @@ -130,7 +129,7 @@ open class BasePgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBou /** Method for subclasses to initiate binding with [OpenPgpServiceConnection]. */ fun bindToOpenKeychain(onBoundListener: OpenPgpServiceConnection.OnBound) { - if (features.isEnabled(Feature.EnablePGPainlessBackend)) return + if (true) return val installed = runCatching { packageManager.getPackageInfo(OPENPGP_PROVIDER, 0) diff --git a/app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt b/app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt index 6b72792a..d2a34c80 100644 --- a/app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt @@ -54,11 +54,7 @@ class LaunchActivity : AppCompatActivity() { } private fun getDecryptIntent(): Intent { - return if (features.isEnabled(Feature.EnablePGPainlessBackend)) { - Intent(this, DecryptActivityV2::class.java) - } else { - Intent(this, DecryptActivity::class.java) - } + return Intent(this, DecryptActivityV2::class.java) } private fun startTargetActivity(noAuth: Boolean) { diff --git a/app/src/main/java/app/passwordstore/ui/passwords/PasswordStore.kt b/app/src/main/java/app/passwordstore/ui/passwords/PasswordStore.kt index cb77bdb7..eb8967f5 100644 --- a/app/src/main/java/app/passwordstore/ui/passwords/PasswordStore.kt +++ b/app/src/main/java/app/passwordstore/ui/passwords/PasswordStore.kt @@ -29,9 +29,7 @@ import app.passwordstore.data.password.PasswordItem import app.passwordstore.data.repo.PasswordRepository import app.passwordstore.ui.crypto.BasePgpActivity import app.passwordstore.ui.crypto.BasePgpActivity.Companion.getLongName -import app.passwordstore.ui.crypto.DecryptActivity import app.passwordstore.ui.crypto.DecryptActivityV2 -import app.passwordstore.ui.crypto.PasswordCreationActivity import app.passwordstore.ui.crypto.PasswordCreationActivityV2 import app.passwordstore.ui.dialogs.FolderCreationDialogFragment import app.passwordstore.ui.folderselect.SelectFolderActivity @@ -46,8 +44,6 @@ import app.passwordstore.util.extensions.getString import app.passwordstore.util.extensions.isInsideRepository import app.passwordstore.util.extensions.listFilesRecursively import app.passwordstore.util.extensions.sharedPrefs -import app.passwordstore.util.features.Feature -import app.passwordstore.util.features.Features import app.passwordstore.util.settings.AuthMode import app.passwordstore.util.settings.PreferenceKeys import app.passwordstore.util.shortcuts.ShortcutHandler @@ -73,7 +69,6 @@ const val PASSWORD_FRAGMENT_TAG = "PasswordsList" @AndroidEntryPoint class PasswordStore : BaseGitActivity() { - @Inject lateinit var features: Features @Inject lateinit var shortcutHandler: ShortcutHandler private lateinit var searchItem: MenuItem private val settings by lazy { sharedPrefs } @@ -388,14 +383,7 @@ class PasswordStore : BaseGitActivity() { val authDecryptIntent = item.createAuthEnabledIntent(this) val decryptIntent = (authDecryptIntent.clone() as Intent).setComponent( - ComponentName( - this, - if (features.isEnabled(Feature.EnablePGPainlessBackend)) { - DecryptActivityV2::class.java - } else { - DecryptActivity::class.java - } - ) + ComponentName(this, DecryptActivityV2::class.java) ) startActivity(decryptIntent) @@ -419,11 +407,7 @@ class PasswordStore : BaseGitActivity() { if (!validateState()) return val currentDir = currentDir logcat(INFO) { "Adding file to : ${currentDir.absolutePath}" } - val creationActivity = - if (features.isEnabled(Feature.EnablePGPainlessBackend)) - PasswordCreationActivityV2::class.java - else PasswordCreationActivity::class.java - val intent = Intent(this, creationActivity) + val intent = Intent(this, PasswordCreationActivityV2::class.java) intent.putExtra(BasePgpActivity.EXTRA_FILE_PATH, currentDir.absolutePath) intent.putExtra( BasePgpActivity.EXTRA_REPO_PATH, diff --git a/app/src/main/java/app/passwordstore/ui/settings/PGPSettings.kt b/app/src/main/java/app/passwordstore/ui/settings/PGPSettings.kt index b59e17ba..85e8667b 100644 --- a/app/src/main/java/app/passwordstore/ui/settings/PGPSettings.kt +++ b/app/src/main/java/app/passwordstore/ui/settings/PGPSettings.kt @@ -8,9 +8,7 @@ package app.passwordstore.ui.settings import androidx.fragment.app.FragmentActivity import app.passwordstore.ui.pgp.PGPKeyImportActivity import app.passwordstore.util.extensions.launchActivity -import app.passwordstore.util.features.Feature import de.Maxr1998.modernpreferences.PreferenceScreen -import de.Maxr1998.modernpreferences.helpers.checkBox import de.Maxr1998.modernpreferences.helpers.onClick import de.Maxr1998.modernpreferences.helpers.pref @@ -18,15 +16,9 @@ class PGPSettings(private val activity: FragmentActivity) : SettingsProvider { override fun provideSettings(builder: PreferenceScreen.Builder) { builder.apply { - val enablePGPainless = - checkBox(Feature.EnablePGPainlessBackend.configKey) { - title = "Enable new PGP backend" - persistent = true - } pref("_") { title = "Import PGP key" persistent = false - dependency = enablePGPainless.key onClick { activity.launchActivity(PGPKeyImportActivity::class.java) false diff --git a/app/src/main/java/app/passwordstore/util/autofill/Api30AutofillResponseBuilder.kt b/app/src/main/java/app/passwordstore/util/autofill/Api30AutofillResponseBuilder.kt index 6d1f2e33..45cc1f61 100644 --- a/app/src/main/java/app/passwordstore/util/autofill/Api30AutofillResponseBuilder.kt +++ b/app/src/main/java/app/passwordstore/util/autofill/Api30AutofillResponseBuilder.kt @@ -15,13 +15,10 @@ import android.view.inputmethod.InlineSuggestionsRequest import android.widget.inline.InlinePresentationSpec import androidx.annotation.RequiresApi import app.passwordstore.autofill.oreo.ui.AutofillSmsActivity -import app.passwordstore.ui.autofill.AutofillDecryptActivity import app.passwordstore.ui.autofill.AutofillDecryptActivityV2 import app.passwordstore.ui.autofill.AutofillFilterView import app.passwordstore.ui.autofill.AutofillPublisherChangedActivity import app.passwordstore.ui.autofill.AutofillSaveActivity -import app.passwordstore.util.features.Feature -import app.passwordstore.util.features.Features import com.github.androidpasswordstore.autofillparser.AutofillAction import com.github.androidpasswordstore.autofillparser.FillableForm import com.github.androidpasswordstore.autofillparser.fillWith @@ -40,7 +37,6 @@ class Api30AutofillResponseBuilder @AssistedInject constructor( @Assisted form: FillableForm, - private val features: Features, ) { @AssistedFactory @@ -85,12 +81,7 @@ constructor( ): Dataset? { if (!scenario.hasFieldsToFillOn(AutofillAction.Match)) return null val metadata = makeFillMatchMetadata(context, file) - val intentSender = - if (features.isEnabled(Feature.EnablePGPainlessBackend)) { - AutofillDecryptActivityV2.makeDecryptFileIntentSender(file, context) - } else { - AutofillDecryptActivity.makeDecryptFileIntentSender(file, context) - } + val intentSender = AutofillDecryptActivityV2.makeDecryptFileIntentSender(file, context) return makeIntentDataset(context, AutofillAction.Match, intentSender, metadata, imeSpec) } diff --git a/app/src/main/java/app/passwordstore/util/autofill/AutofillResponseBuilder.kt b/app/src/main/java/app/passwordstore/util/autofill/AutofillResponseBuilder.kt index de542bac..8f96a67d 100644 --- a/app/src/main/java/app/passwordstore/util/autofill/AutofillResponseBuilder.kt +++ b/app/src/main/java/app/passwordstore/util/autofill/AutofillResponseBuilder.kt @@ -14,13 +14,10 @@ import android.service.autofill.FillResponse import android.service.autofill.SaveInfo import androidx.annotation.RequiresApi import app.passwordstore.autofill.oreo.ui.AutofillSmsActivity -import app.passwordstore.ui.autofill.AutofillDecryptActivity import app.passwordstore.ui.autofill.AutofillDecryptActivityV2 import app.passwordstore.ui.autofill.AutofillFilterView import app.passwordstore.ui.autofill.AutofillPublisherChangedActivity import app.passwordstore.ui.autofill.AutofillSaveActivity -import app.passwordstore.util.features.Feature -import app.passwordstore.util.features.Features import com.github.androidpasswordstore.autofillparser.AutofillAction import com.github.androidpasswordstore.autofillparser.AutofillScenario import com.github.androidpasswordstore.autofillparser.Credentials @@ -40,7 +37,6 @@ class AutofillResponseBuilder @AssistedInject constructor( @Assisted form: FillableForm, - private val features: Features, ) { @AssistedFactory @@ -74,12 +70,7 @@ constructor( private fun makeMatchDataset(context: Context, file: File): Dataset? { if (!scenario.hasFieldsToFillOn(AutofillAction.Match)) return null val metadata = makeFillMatchMetadata(context, file) - val intentSender = - if (features.isEnabled(Feature.EnablePGPainlessBackend)) { - AutofillDecryptActivityV2.makeDecryptFileIntentSender(file, context) - } else { - AutofillDecryptActivity.makeDecryptFileIntentSender(file, context) - } + val intentSender = AutofillDecryptActivityV2.makeDecryptFileIntentSender(file, context) return makeIntentDataset(context, AutofillAction.Match, intentSender, metadata) } diff --git a/app/src/main/java/app/passwordstore/util/features/Feature.kt b/app/src/main/java/app/passwordstore/util/features/Feature.kt index 6e9e77e9..be117102 100644 --- a/app/src/main/java/app/passwordstore/util/features/Feature.kt +++ b/app/src/main/java/app/passwordstore/util/features/Feature.kt @@ -14,6 +14,10 @@ enum class Feature( ) { /** Opt into the new PGP backend powered by the PGPainless library. */ + @Deprecated( + "The PGPainless backend is now the only available one", + level = DeprecationLevel.ERROR + ) EnablePGPainlessBackend(false, "enable_pgp_v2_backend"), ; |