mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Small adjustments
This commit is contained in:
@@ -52,6 +52,9 @@ data class AndroidPrivilegedApp(
|
|||||||
private const val USER_BUILD_TYPE = "userdebug"
|
private const val USER_BUILD_TYPE = "userdebug"
|
||||||
private const val APPS_KEY = "apps"
|
private const val APPS_KEY = "apps"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts a list of AndroidPrivilegedApp objects from a JSONObject.
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun extractPrivilegedApps(jsonObject: JSONObject): List<AndroidPrivilegedApp> {
|
fun extractPrivilegedApps(jsonObject: JSONObject): List<AndroidPrivilegedApp> {
|
||||||
val apps = mutableListOf<AndroidPrivilegedApp>()
|
val apps = mutableListOf<AndroidPrivilegedApp>()
|
||||||
|
|||||||
@@ -22,7 +22,27 @@ data class PublicKeyCredentialUserEntity(
|
|||||||
val name: String,
|
val name: String,
|
||||||
val id: ByteArray,
|
val id: ByteArray,
|
||||||
val displayName: String
|
val displayName: String
|
||||||
)
|
) {
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
if (this === other) return true
|
||||||
|
if (javaClass != other?.javaClass) return false
|
||||||
|
|
||||||
|
other as PublicKeyCredentialUserEntity
|
||||||
|
|
||||||
|
if (name != other.name) return false
|
||||||
|
if (!id.contentEquals(other.id)) return false
|
||||||
|
if (displayName != other.displayName) return false
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
var result = name.hashCode()
|
||||||
|
result = 31 * result + id.contentHashCode()
|
||||||
|
result = 31 * result + displayName.hashCode()
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data class PublicKeyCredentialParameters(val type: String, val alg: Long)
|
data class PublicKeyCredentialParameters(val type: String, val alg: Long)
|
||||||
|
|
||||||
@@ -30,7 +50,27 @@ data class PublicKeyCredentialDescriptor(
|
|||||||
val type: String,
|
val type: String,
|
||||||
val id: ByteArray,
|
val id: ByteArray,
|
||||||
val transports: List<String>
|
val transports: List<String>
|
||||||
)
|
) {
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
if (this === other) return true
|
||||||
|
if (javaClass != other?.javaClass) return false
|
||||||
|
|
||||||
|
other as PublicKeyCredentialDescriptor
|
||||||
|
|
||||||
|
if (type != other.type) return false
|
||||||
|
if (!id.contentEquals(other.id)) return false
|
||||||
|
if (transports != other.transports) return false
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
var result = type.hashCode()
|
||||||
|
result = 31 * result + id.contentHashCode()
|
||||||
|
result = 31 * result + transports.hashCode()
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data class AuthenticatorSelectionCriteria(
|
data class AuthenticatorSelectionCriteria(
|
||||||
val authenticatorAttachment: String,
|
val authenticatorAttachment: String,
|
||||||
|
|||||||
@@ -23,7 +23,29 @@ import java.security.KeyPair
|
|||||||
|
|
||||||
data class PublicKeyCredentialCreationParameters(
|
data class PublicKeyCredentialCreationParameters(
|
||||||
val publicKeyCredentialCreationOptions: PublicKeyCredentialCreationOptions,
|
val publicKeyCredentialCreationOptions: PublicKeyCredentialCreationOptions,
|
||||||
val credentialId: ByteArray, // TODO Equals Hashcode
|
val credentialId: ByteArray,
|
||||||
val signatureKey: Pair<KeyPair, Long>,
|
val signatureKey: Pair<KeyPair, Long>,
|
||||||
val clientDataResponse: ClientDataResponse
|
val clientDataResponse: ClientDataResponse
|
||||||
)
|
) {
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
if (this === other) return true
|
||||||
|
if (javaClass != other?.javaClass) return false
|
||||||
|
|
||||||
|
other as PublicKeyCredentialCreationParameters
|
||||||
|
|
||||||
|
if (publicKeyCredentialCreationOptions != other.publicKeyCredentialCreationOptions) return false
|
||||||
|
if (!credentialId.contentEquals(other.credentialId)) return false
|
||||||
|
if (signatureKey != other.signatureKey) return false
|
||||||
|
if (clientDataResponse != other.clientDataResponse) return false
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
var result = publicKeyCredentialCreationOptions.hashCode()
|
||||||
|
result = 31 * result + credentialId.contentHashCode()
|
||||||
|
result = 31 * result + signatureKey.hashCode()
|
||||||
|
result = 31 * result + clientDataResponse.hashCode()
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user