Skip to content

Commit

Permalink
Fix camera crash & autosave
Browse files Browse the repository at this point in the history
  • Loading branch information
soraefir committed Apr 6, 2024
1 parent 9b6a69e commit 653ee1c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Expand Up @@ -34,6 +34,7 @@ android {
buildTypes {
debug {
debuggable true
signingConfig = signingConfigs.getByName("release")
}
release {
minifyEnabled true
Expand Down
Expand Up @@ -151,6 +151,11 @@ class CreateEntry : Fragment() {
kpEntry.second
)
)
if (!binding.checkboxProtected.isChecked) {
val r = KeepassWrapper.entryExtract(kpEntry.first)
CacheManager.addFidelity(r)
}
activity?.supportFragmentManager?.popBackStack()
} catch (e: ActivityNotFoundException) {
ErrorToaster.noKP2AFound(context)
} catch (e: Exception) {
Expand Down
Expand Up @@ -68,7 +68,7 @@ class Scanner : Fragment() {
this.fmt = format
}
val isDone = this.code.isNotEmpty() && this.fmt.isNotEmpty()
requireActivity().runOnUiThread {
activity?.runOnUiThread {
binding.btnScanDone.isEnabled = isDone
binding.ScanActive.isEnabled = !isDone
}
Expand Down
Expand Up @@ -7,8 +7,8 @@ import org.json.JSONObject
object Kp2aControl {

fun getAddEntryIntent(
fields: HashMap<String?, String?>,
protectedFields: ArrayList<String?>?
fields: HashMap<String, String>,
protectedFields: ArrayList<String>?
): Intent {
val outputData = JSONObject((fields as Map<*, *>)).toString()
val startKp2aIntent = Intent(Strings.ACTION_START_WITH_TASK)
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/net/helcel/fidelity/tools/KeepassWrapper.kt
Expand Up @@ -21,10 +21,10 @@ object KeepassWrapper {
code: String,
format: String,
protectCode: Boolean,
): Pair<HashMap<String?, String?>, ArrayList<String?>> {
): Pair<HashMap<String, String>, ArrayList<String>> {

val fields = HashMap<String?, String?>()
val protected = ArrayList<String?>()
val fields = HashMap<String, String>()
val protected = ArrayList<String>()
fields[KeepassDef.TitleField] = title
fields[KeepassDef.UrlField] =
"androidapp://" + fragment.requireActivity().packageName
Expand Down

0 comments on commit 653ee1c

Please sign in to comment.