Updates and fixes

This commit is contained in:
soraefir
2024-06-28 22:19:53 +02:00
parent e7f55c2be2
commit 917a01b2ed
27 changed files with 416 additions and 190 deletions

View File

@@ -31,7 +31,6 @@ class MainActivity : AppCompatActivity() {
binding = ActMainBinding.inflate(layoutInflater)
setContentView(binding.root)
onBackPressedDispatcher.addCallback(this) {
if (supportFragmentManager.backStackEntryCount > 0) {
supportFragmentManager.popBackStackImmediate()

View File

@@ -151,16 +151,16 @@ 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) {
e.printStackTrace()
}
if (!binding.checkboxProtected.isChecked) {
val r = KeepassWrapper.entryExtract(kpEntry.first)
CacheManager.addFidelity(r)
}
activity?.supportFragmentManager?.popBackStack()
}
}

View File

@@ -80,7 +80,7 @@ class ViewEntry : Fragment() {
return (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
}
private fun setScreenBrightness(brightness: Float?) {
private fun setScreenBrightness(brightness: Float) {
requireActivity().window?.attributes?.screenBrightness = brightness
}
}

View File

@@ -15,7 +15,7 @@ object Kp2aControl {
startKp2aIntent.addCategory(Intent.CATEGORY_DEFAULT)
startKp2aIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
startKp2aIntent.putExtra("KP2A_APPTASK", "CreateEntryThenCloseTask")
startKp2aIntent.putExtra("ShowUserNotifications", "false")
startKp2aIntent.putExtra("ShowUserNotifications", "true")
startKp2aIntent.putExtra(Strings.EXTRA_ENTRY_OUTPUT_DATA, outputData)
if (protectedFields != null)
startKp2aIntent.putStringArrayListExtra(

View File

@@ -7,6 +7,7 @@ object Strings {
const val SCOPE_CURRENT_ENTRY = "keepass2android.SCOPE_CURRENT_ENTRY"
const val SCOPE_QUERY_CREDENTIALS_FOR_OWN_PACKAGE =
"keepass2android.SCOPE_QUERY_CREDENTIALS_FOR_OWN_PACKAGE"
const val SCOPE_QUERY_CREDENTIALS = "keepass2android.SCOPE_QUERY_CREDENTIALS"
const val EXTRA_SCOPES = "keepass2android.EXTRA_SCOPES"
const val EXTRA_PLUGIN_PACKAGE = "keepass2android.EXTRA_PLUGIN_PACKAGE"