fix: Small adjustments

This commit is contained in:
J-Jamet
2025-09-08 13:34:23 +02:00
parent 65157f661f
commit 8086289e4b
3 changed files with 69 additions and 4 deletions

View File

@@ -52,6 +52,9 @@ data class AndroidPrivilegedApp(
private const val USER_BUILD_TYPE = "userdebug"
private const val APPS_KEY = "apps"
/**
* Extracts a list of AndroidPrivilegedApp objects from a JSONObject.
*/
@JvmStatic
fun extractPrivilegedApps(jsonObject: JSONObject): List<AndroidPrivilegedApp> {
val apps = mutableListOf<AndroidPrivilegedApp>()

View File

@@ -22,7 +22,27 @@ data class PublicKeyCredentialUserEntity(
val name: String,
val id: ByteArray,
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)
@@ -30,7 +50,27 @@ data class PublicKeyCredentialDescriptor(
val type: String,
val id: ByteArray,
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(
val authenticatorAttachment: String,

View File

@@ -23,7 +23,29 @@ import java.security.KeyPair
data class PublicKeyCredentialCreationParameters(
val publicKeyCredentialCreationOptions: PublicKeyCredentialCreationOptions,
val credentialId: ByteArray, // TODO Equals Hashcode
val credentialId: ByteArray,
val signatureKey: Pair<KeyPair, Long>,
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
}
}