Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ dependencies {
implementation(Dependencies.ThirdParty.jgit) {
exclude(group = "org.apache.httpcomponents", module = "httpclient")
}
// Loaded dynamically by JGit to provide symlink support
implementation(Dependencies.ThirdParty.jgit_java7)
implementation(Dependencies.ThirdParty.jsch)
implementation(Dependencies.ThirdParty.sshj)
implementation(Dependencies.ThirdParty.bouncycastle)
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/com/zeapo/pwdstore/crypto/DecryptActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.text.method.PasswordTransformationMethod
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.widget.Toast
import androidx.activity.result.IntentSenderRequest
import androidx.activity.result.contract.ActivityResultContracts.StartIntentSenderForResult
import androidx.lifecycle.lifecycleScope
Expand All @@ -23,6 +24,7 @@ import com.zeapo.pwdstore.utils.PreferenceKeys
import com.zeapo.pwdstore.utils.viewBinding
import java.io.ByteArrayOutputStream
import java.io.File
import java.io.FileNotFoundException
import kotlin.time.ExperimentalTime
import kotlin.time.seconds
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -135,7 +137,13 @@ class DecryptActivity : BasePgpActivity(), OpenPgpServiceConnection.OnBound {
val data = receivedIntent ?: Intent()
data.action = OpenPgpApi.ACTION_DECRYPT_VERIFY

val inputStream = File(fullPath).inputStream()
val inputStream = try {
File(fullPath).inputStream()
} catch (e: FileNotFoundException) {
Toast.makeText(this, getString(R.string.error_broken_symlink), Toast.LENGTH_SHORT).show()
finish()
return
}
val outputStream = ByteArrayOutputStream()

lifecycleScope.launch(Dispatchers.IO) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
<string name="no_repo_selected">No external repository selected</string>
<string name="send_plaintext_password_to">Send password as plaintext using…</string>
<string name="app_icon_hint">App icon</string>
<string name="error_broken_symlink">File not found, likely because of a broken symlink</string>

<!-- Oreo Autofill -->
<string name="oreo_autofill_strict_domain_search">Phishing-resistant search</string>
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ object Dependencies {
const val fastscroll = "me.zhanghai.android.fastscroll:library:1.1.4"
const val jsch = "com.jcraft:jsch:0.1.55"
const val jgit = "org.eclipse.jgit:org.eclipse.jgit:3.7.1.201504261725-r"
const val jgit_java7 = "org.eclipse.jgit:org.eclipse.jgit.java7:3.7.1.201504261725-r"
const val leakcanary = "com.squareup.leakcanary:leakcanary-android:2.4"
const val plumber = "com.squareup.leakcanary:plumber-android:2.4"
const val sshj = "com.hierynomus:sshj:0.29.0"
Expand Down