aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-02 20:55:08 +0100
committerDanilo M. <danix@danix.xyz>2026-11-02 20:55:08 +0100
commitc4f4f92bbfdeef244767c09a9710c64b065896a2 (patch)
tree4e0338374237bc99883f2c051afd4fec41688432 /app
parent3e1f3a6f5ef5fba661f702e7457ee9c833c516f3 (diff)
downloadHardenedPass-c4f4f92bbfdeef244767c09a9710c64b065896a2.tar.gz
HardenedPass-c4f4f92bbfdeef244767c09a9710c64b065896a2.zip
feat(app): route the launcher through MainActivity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt20
1 files changed, 5 insertions, 15 deletions
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 1a5e8a89..befd37f9 100644
--- a/app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt
+++ b/app/src/main/java/app/passwordstore/ui/main/LaunchActivity.kt
@@ -13,8 +13,6 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.edit
import app.passwordstore.data.repo.PasswordRepository
import app.passwordstore.ui.crypto.BasePGPActivity
-import app.passwordstore.ui.crypto.DecryptActivity
-import app.passwordstore.ui.passwords.PasswordStore
import app.passwordstore.util.auth.BiometricAuthenticator
import app.passwordstore.util.auth.BiometricAuthenticator.Result
import app.passwordstore.util.extensions.sharedPrefs
@@ -50,22 +48,14 @@ class LaunchActivity : AppCompatActivity() {
}
}
- private fun getDecryptIntent(): Intent {
- return Intent(this, DecryptActivity::class.java)
- }
-
private fun startTargetActivity(noAuth: Boolean) {
- // This activity is exported, so the file path is untrusted input: only forward it to
- // DecryptActivity when it points at a file inside the password store.
+ // This activity is exported, so the file path is untrusted input: only forward it when it
+ // points at a file inside the password store. MainActivity is not exported and trusts it.
val repoDir = PasswordRepository.getRepositoryDirectory()
val filePath = intent.getStringExtra(BasePGPActivity.EXTRA_FILE_PATH)
- val intentToStart =
- if (intent.action == ACTION_DECRYPT_PASS && isFileInRepo(filePath, repoDir))
- getDecryptIntent().apply {
- putExtra(BasePGPActivity.EXTRA_FILE_PATH, filePath)
- putExtra(BasePGPActivity.EXTRA_REPO_PATH, repoDir.absolutePath)
- }
- else Intent(this, PasswordStore::class.java).setAction(Intent.ACTION_VIEW)
+ val intentToStart = Intent(this, MainActivity::class.java)
+ if (intent.action == ACTION_DECRYPT_PASS && isFileInRepo(filePath, repoDir))
+ intentToStart.putExtra(BasePGPActivity.EXTRA_FILE_PATH, filePath)
startActivity(intentToStart)
Handler(Looper.getMainLooper()).postDelayed({ finish() }, if (noAuth) 0L else 500L)