From b92dd19a4cd5a4029d00724acd8a35ad8974dfd7 Mon Sep 17 00:00:00 2001 From: Victor Ding <14084856+0dvictor@users.noreply.github.com> Date: Tue, 23 Aug 2022 12:53:17 +0000 Subject: [PATCH] Use StandardCharsets in OkHttpUtil. okhttp3.internal.Util.UTF_8 was never meant to be used outside of okhttp3 library; and it has been deleted in later versions. Signal should use java.nio.charset.StandardCharsets instead. No functional change. Closes #12413 --- .../java/org/thoughtcrime/securesms/util/OkHttpUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/OkHttpUtil.java b/app/src/main/java/org/thoughtcrime/securesms/util/OkHttpUtil.java index 631aaed100..90f92e9ada 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/OkHttpUtil.java +++ b/app/src/main/java/org/thoughtcrime/securesms/util/OkHttpUtil.java @@ -6,13 +6,12 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Objects; import okhttp3.MediaType; import okhttp3.ResponseBody; -import static okhttp3.internal.Util.UTF_8; - public final class OkHttpUtil { private OkHttpUtil() {} @@ -42,7 +41,7 @@ public final class OkHttpUtil { byte[] data = readAsBytes(body.byteStream(), sizeLimit); MediaType contentType = body.contentType(); - Charset charset = contentType != null ? contentType.charset(UTF_8) : UTF_8; + Charset charset = contentType != null ? contentType.charset(StandardCharsets.UTF_8) : StandardCharsets.UTF_8; return new String(data, Objects.requireNonNull(charset)); }