diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index 4e9bf6c41..6a0a87109 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -29,7 +29,7 @@ object JsExtensions { return EncoderUtils.base64Decoder(str) } - fun base64Encoder(str: String): ByteArray? { + fun base64Encoder(str: String): String? { return EncoderUtils.base64Encoder(str) } diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index 287774a77..501e00777 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -576,7 +576,7 @@ class AnalyzeRule(private var book: BaseBook? = null) { return EncoderUtils.base64Decoder(str) } - fun base64Encoder(str: String): ByteArray? { + fun base64Encoder(str: String): String? { return EncoderUtils.base64Encoder(str) } 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 3798bfa9c..9e98b35db 100644 --- a/app/src/main/java/io/legado/app/utils/EncoderUtils.kt +++ b/app/src/main/java/io/legado/app/utils/EncoderUtils.kt @@ -33,7 +33,7 @@ object EncoderUtils { } } - fun base64Encoder(str: String): ByteArray? { - return Base64.encode(str.toByteArray(), Base64.DEFAULT) + fun base64Encoder(str: String): String? { + return Base64.encodeToString(str.toByteArray(), Base64.DEFAULT) } } \ No newline at end of file