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 9e4bca018..754751b01 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -30,6 +30,10 @@ object JsExtensions { return EncoderUtils.base64Decode(str) } + fun base64Encode(str: String): String? { + return EncoderUtils.base64Encode(str) + } + fun base64Encode(str: String, flags: Int = Base64.NO_WRAP): String? { return EncoderUtils.base64Encode(str, flags) } 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 82a767ab5..c97fc7b98 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 @@ -577,6 +577,10 @@ class AnalyzeRule(private var book: BaseBook? = null) { return EncoderUtils.base64Decode(str) } + fun base64Encode(str: String): String? { + return EncoderUtils.base64Encode(str) + } + fun base64Encode(str: String, flags: Int = Base64.NO_WRAP): String? { return EncoderUtils.base64Encode(str, flags) }