From 30d14ee69c5d4c78667faaabad77494f0d7dfde3 Mon Sep 17 00:00:00 2001 From: iyhkhtrk <104120418+iyhkhtrk@users.noreply.github.com> Date: Tue, 29 Nov 2022 18:52:28 +0800 Subject: [PATCH] Update EncoderUtils.kt --- app/src/main/java/io/legado/app/utils/EncoderUtils.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/io/legado/app/utils/EncoderUtils.kt b/app/src/main/java/io/legado/app/utils/EncoderUtils.kt index fec85ff2c..54c528f03 100644 --- a/app/src/main/java/io/legado/app/utils/EncoderUtils.kt +++ b/app/src/main/java/io/legado/app/utils/EncoderUtils.kt @@ -37,5 +37,10 @@ object EncoderUtils { fun base64Encode(str: String, flags: Int = Base64.NO_WRAP): String? { return Base64.encodeToString(str.toByteArray(), flags) } + + @JvmOverloads + fun base64DecodeToByteArray(str: String, flags: Int = Base64.DEFAULT): ByteArray { + return Base64.decode(str, flags) + } }