diff --git a/app/build.gradle b/app/build.gradle index 5a575c0..2fc6504 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,6 +34,7 @@ android { buildTypes { debug { debuggable true + signingConfig = signingConfigs.getByName("release") } release { minifyEnabled true diff --git a/app/src/main/java/net/helcel/fidelity/activity/fragment/CreateEntry.kt b/app/src/main/java/net/helcel/fidelity/activity/fragment/CreateEntry.kt index f39330f..856f063 100644 --- a/app/src/main/java/net/helcel/fidelity/activity/fragment/CreateEntry.kt +++ b/app/src/main/java/net/helcel/fidelity/activity/fragment/CreateEntry.kt @@ -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) { diff --git a/app/src/main/java/net/helcel/fidelity/activity/fragment/Scanner.kt b/app/src/main/java/net/helcel/fidelity/activity/fragment/Scanner.kt index 589ec57..f7fe055 100644 --- a/app/src/main/java/net/helcel/fidelity/activity/fragment/Scanner.kt +++ b/app/src/main/java/net/helcel/fidelity/activity/fragment/Scanner.kt @@ -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 } diff --git a/app/src/main/java/net/helcel/fidelity/pluginSDK/Kp2aControl.kt b/app/src/main/java/net/helcel/fidelity/pluginSDK/Kp2aControl.kt index 98f8f6f..8865d2b 100644 --- a/app/src/main/java/net/helcel/fidelity/pluginSDK/Kp2aControl.kt +++ b/app/src/main/java/net/helcel/fidelity/pluginSDK/Kp2aControl.kt @@ -7,8 +7,8 @@ import org.json.JSONObject object Kp2aControl { fun getAddEntryIntent( - fields: HashMap, - protectedFields: ArrayList? + fields: HashMap, + protectedFields: ArrayList? ): Intent { val outputData = JSONObject((fields as Map<*, *>)).toString() val startKp2aIntent = Intent(Strings.ACTION_START_WITH_TASK) diff --git a/app/src/main/java/net/helcel/fidelity/tools/KeepassWrapper.kt b/app/src/main/java/net/helcel/fidelity/tools/KeepassWrapper.kt index 4d08b52..a3ba82c 100644 --- a/app/src/main/java/net/helcel/fidelity/tools/KeepassWrapper.kt +++ b/app/src/main/java/net/helcel/fidelity/tools/KeepassWrapper.kt @@ -21,10 +21,10 @@ object KeepassWrapper { code: String, format: String, protectCode: Boolean, - ): Pair, ArrayList> { + ): Pair, ArrayList> { - val fields = HashMap() - val protected = ArrayList() + val fields = HashMap() + val protected = ArrayList() fields[KeepassDef.TitleField] = title fields[KeepassDef.UrlField] = "androidapp://" + fragment.requireActivity().packageName