From 6652df5add957d793d8390dd1c7088c985cc6a81 Mon Sep 17 00:00:00 2001 From: Niko Diamadis Date: Thu, 2 Feb 2023 14:59:51 +0100 Subject: [PATCH] Print hash results in Debug builds --- .../com/cyb3rko/pincredible/crypto/CryptoManager.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/cyb3rko/pincredible/crypto/CryptoManager.kt b/app/src/main/kotlin/com/cyb3rko/pincredible/crypto/CryptoManager.kt index 2ff126c..7ae0193 100644 --- a/app/src/main/kotlin/com/cyb3rko/pincredible/crypto/CryptoManager.kt +++ b/app/src/main/kotlin/com/cyb3rko/pincredible/crypto/CryptoManager.kt @@ -18,6 +18,8 @@ package com.cyb3rko.pincredible.crypto import android.security.keystore.KeyGenParameterSpec import android.security.keystore.KeyProperties +import android.util.Log +import com.cyb3rko.pincredible.BuildConfig import com.cyb3rko.pincredible.crypto.xxhash3.XXH3_128 import com.cyb3rko.pincredible.utils.ObjectSerializer import java.io.File @@ -52,7 +54,11 @@ internal object CryptoManager { for (i in ciphertextBytes.indices) { sb.append(((ciphertextBytes[i] and 0xff.toByte()) + 0x100).toString(16).substring(1)) } - return sb.toString() + val hash = sb.toString() + if (BuildConfig.DEBUG) { + Log.d("CryptoManager", "Hash: $hash") + } + return hash } // Random