Compare commits

...

7 Commits

Author SHA1 Message Date
J-Jamet
d560c3e8de Merge branch 'release/2.10.1' 2021-05-10 07:24:42 +02:00
J-Jamet
4f8e8e6669 Upgrade version code for deployment 2021-05-10 06:05:22 +02:00
J-Jamet
7cdc2e0915 Fix custom data item #986 2021-05-10 06:03:12 +02:00
J-Jamet
74b236b317 Fix class cast exception #986 2021-05-09 22:29:46 +02:00
J-Jamet
89ffeaf03b Fix crash with parcelable cast 2021-05-08 12:52:56 +02:00
J-Jamet
8b779a0fca Upgrade version 2021-05-07 17:45:12 +02:00
J-Jamet
4b71dc8445 Merge tag '2.10.0' into develop
2.10.0
2021-05-07 17:36:12 +02:00
6 changed files with 17 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
KeePassDX(2.10.1)
* Fix parcelable with custom data #986
KeePassDX(2.10.0) KeePassDX(2.10.0)
* Manage new database format 4.1 #956 * Manage new database format 4.1 #956
* Fix show button consistency #980 * Fix show button consistency #980

View File

@@ -11,8 +11,8 @@ android {
applicationId "com.kunzisoft.keepass" applicationId "com.kunzisoft.keepass"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 30 targetSdkVersion 30
versionCode = 76 versionCode = 78
versionName = "2.10.0" versionName = "2.10.1"
multiDexEnabled true multiDexEnabled true
testApplicationId = "com.kunzisoft.keepass.tests" testApplicationId = "com.kunzisoft.keepass.tests"

View File

@@ -17,7 +17,7 @@ class CustomData : Parcelable {
} }
constructor(parcel: Parcel) { constructor(parcel: Parcel) {
ParcelableUtil.readStringParcelableMap(parcel, CustomData::class.java) ParcelableUtil.readStringParcelableMap(parcel, CustomDataItem::class.java)
} }
fun get(key: String): CustomDataItem? { fun get(key: String): CustomDataItem? {

View File

@@ -42,8 +42,12 @@ object ParcelableUtil {
val size = parcel.readInt() val size = parcel.readInt()
val map = HashMap<K, V>(size) val map = HashMap<K, V>(size)
for (i in 0 until size) { for (i in 0 until size) {
val key: K? = kClass.cast(parcel.readParcelable(kClass.classLoader)) val key: K? = try {
val value: V? = vClass.cast(parcel.readParcelable(vClass.classLoader)) parcel.readParcelable(kClass.classLoader)
} catch (e: Exception) { null }
val value: V? = try {
parcel.readParcelable(vClass.classLoader)
} catch (e: Exception) { null }
if (key != null && value != null) if (key != null && value != null)
map[key] = value map[key] = value
} }
@@ -76,7 +80,9 @@ object ParcelableUtil {
val map = LinkedHashMap<String, V>(size) val map = LinkedHashMap<String, V>(size)
for (i in 0 until size) { for (i in 0 until size) {
val key: String? = parcel.readString() val key: String? = parcel.readString()
val value: V? = vClass.cast(parcel.readParcelable(vClass.classLoader)) val value: V? = try {
parcel.readParcelable(vClass.classLoader)
} catch (e: Exception) { null }
if (key != null && value != null) if (key != null && value != null)
map[key] = value map[key] = value
} }

View File

@@ -0,0 +1 @@
*

View File

@@ -0,0 +1 @@
*