Fix camera crash & autosave
This commit is contained in:
parent
9b6a69e227
commit
653ee1ccc1
@ -34,6 +34,7 @@ android {
|
|||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
debuggable true
|
debuggable true
|
||||||
|
signingConfig = signingConfigs.getByName("release")
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
|
@ -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) {
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user