From 890e3b311c14afc8c848e3ee38cf249ee9ece020 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 8 Oct 2022 13:27:46 +0200 Subject: [PATCH] Avoid printing binary in logs The ByteArray may contain arbitrary bytes. Printing it to the logs results in garbage and terminal emulators will try to interpret escape codes. --- app/src/main/java/io/heckel/ntfy/up/Distributor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/heckel/ntfy/up/Distributor.kt b/app/src/main/java/io/heckel/ntfy/up/Distributor.kt index 5a11d6b..b6f9cce 100644 --- a/app/src/main/java/io/heckel/ntfy/up/Distributor.kt +++ b/app/src/main/java/io/heckel/ntfy/up/Distributor.kt @@ -10,7 +10,7 @@ import io.heckel.ntfy.util.Log */ class Distributor(val context: Context) { fun sendMessage(app: String, connectorToken: String, message: ByteArray) { - Log.d(TAG, "Sending MESSAGE to $app (token=$connectorToken): ${String(message)} (${message.size} bytes)}") + Log.d(TAG, "Sending MESSAGE to $app (token=$connectorToken): ${message.size} bytes") val broadcastIntent = Intent() broadcastIntent.`package` = app broadcastIntent.action = ACTION_MESSAGE