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 { buildTypes {
debug { debug {
debuggable true debuggable true
signingConfig = signingConfigs.getByName("release")
} }
release { release {
minifyEnabled true minifyEnabled true

View File

@ -151,6 +151,11 @@ class CreateEntry : Fragment() {
kpEntry.second kpEntry.second
) )
) )
if (!binding.checkboxProtected.isChecked) {
val r = KeepassWrapper.entryExtract(kpEntry.first)
CacheManager.addFidelity(r)
}
activity?.supportFragmentManager?.popBackStack()
} catch (e: ActivityNotFoundException) { } catch (e: ActivityNotFoundException) {
ErrorToaster.noKP2AFound(context) ErrorToaster.noKP2AFound(context)
} catch (e: Exception) { } catch (e: Exception) {

View File

@ -68,7 +68,7 @@ class Scanner : Fragment() {
this.fmt = format this.fmt = format
} }
val isDone = this.code.isNotEmpty() && this.fmt.isNotEmpty() val isDone = this.code.isNotEmpty() && this.fmt.isNotEmpty()
requireActivity().runOnUiThread { activity?.runOnUiThread {
binding.btnScanDone.isEnabled = isDone binding.btnScanDone.isEnabled = isDone
binding.ScanActive.isEnabled = !isDone binding.ScanActive.isEnabled = !isDone
} }

View File

@ -7,8 +7,8 @@ import org.json.JSONObject
object Kp2aControl { object Kp2aControl {
fun getAddEntryIntent( fun getAddEntryIntent(
fields: HashMap<String?, String?>, fields: HashMap<String, String>,
protectedFields: ArrayList<String?>? protectedFields: ArrayList<String>?
): Intent { ): Intent {
val outputData = JSONObject((fields as Map<*, *>)).toString() val outputData = JSONObject((fields as Map<*, *>)).toString()
val startKp2aIntent = Intent(Strings.ACTION_START_WITH_TASK) val startKp2aIntent = Intent(Strings.ACTION_START_WITH_TASK)

View File

@ -21,10 +21,10 @@ object KeepassWrapper {
code: String, code: String,
format: String, format: String,
protectCode: Boolean, protectCode: Boolean,
): Pair<HashMap<String?, String?>, ArrayList<String?>> { ): Pair<HashMap<String, String>, ArrayList<String>> {
val fields = HashMap<String?, String?>() val fields = HashMap<String, String>()
val protected = ArrayList<String?>() val protected = ArrayList<String>()
fields[KeepassDef.TitleField] = title fields[KeepassDef.TitleField] = title
fields[KeepassDef.UrlField] = fields[KeepassDef.UrlField] =
"androidapp://" + fragment.requireActivity().packageName "androidapp://" + fragment.requireActivity().packageName