Fix camera crash & autosave

This commit is contained in:
soraefir 2024-04-06 19:24:36 +02:00
parent 9b6a69e227
commit 653ee1ccc1
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
5 changed files with 12 additions and 6 deletions

View File

@ -34,6 +34,7 @@ android {
buildTypes {
debug {
debuggable true
signingConfig = signingConfigs.getByName("release")
}
release {
minifyEnabled true

View File

@ -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) {

View File

@ -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
}

View File

@ -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)

View File

@ -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