From 5360f54ea80c2ff438ecfb8bc293c2f6699310b6 Mon Sep 17 00:00:00 2001 From: darken Date: Sat, 25 Apr 2026 15:35:29 +0200 Subject: [PATCH] fix(privacy): Stop logging AirPods encryption keys --- .../core/apple/ble/protocol/ProximityMessage.kt | 4 ++-- .../capod/profiles/core/AppleDeviceProfile.kt | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/pods/core/apple/ble/protocol/ProximityMessage.kt b/app/src/main/java/eu/darken/capod/pods/core/apple/ble/protocol/ProximityMessage.kt index 160f5873..24300790 100644 --- a/app/src/main/java/eu/darken/capod/pods/core/apple/ble/protocol/ProximityMessage.kt +++ b/app/src/main/java/eu/darken/capod/pods/core/apple/ble/protocol/ProximityMessage.kt @@ -37,14 +37,14 @@ data class ProximityMessage( log( TAG, Logging.Priority.ERROR - ) { "Failed to decrypt $message with ${key.toByteString()}\n${e.asLog()}" } + ) { "Failed to decrypt $message\n${e.asLog()}" } null } log( TAG, Logging.Priority.VERBOSE - ) { "Decrypted $message with ${key.toByteString()} to ${decryptedData?.toByteString()}" } + ) { "Decrypted $message to ${decryptedData?.toByteString()}" } if (decryptedData == null || decryptedData.size != 16) return null diff --git a/app/src/main/java/eu/darken/capod/profiles/core/AppleDeviceProfile.kt b/app/src/main/java/eu/darken/capod/profiles/core/AppleDeviceProfile.kt index ebc4c506..9405abc4 100644 --- a/app/src/main/java/eu/darken/capod/profiles/core/AppleDeviceProfile.kt +++ b/app/src/main/java/eu/darken/capod/profiles/core/AppleDeviceProfile.kt @@ -55,4 +55,19 @@ data class AppleDeviceProfile( showPopUpOnCaseOpen = showPopUpOnCaseOpen, showPopUpOnConnection = showPopUpOnConnection, ) + + override fun toString(): String = "AppleDeviceProfile(" + + "id=$id, label=$label, priority=$priority, model=$model, " + + "minimumSignalQuality=$minimumSignalQuality, " + + "identityKey=${if (identityKey == null) "null" else ""}, " + + "encryptionKey=${if (encryptionKey == null) "null" else ""}, " + + "address=$address, autoPause=$autoPause, autoPlay=$autoPlay, " + + "onePodMode=$onePodMode, autoConnect=$autoConnect, " + + "autoConnectCondition=$autoConnectCondition, " + + "showPopUpOnCaseOpen=$showPopUpOnCaseOpen, " + + "showPopUpOnConnection=$showPopUpOnConnection, " + + "learnedAllowOffEnabled=$learnedAllowOffEnabled, " + + "lastRequestedListeningModeCycleMask=$lastRequestedListeningModeCycleMask, " + + "stemActions=$stemActions" + + ")" } \ No newline at end of file