From 758d7e585b6d207c95ffac9a510b157b45de4771 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 24 Oct 2019 09:21:39 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/JsExtensions.kt | 4 ++++ .../main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 4 ++++ 2 files changed, 8 insertions(+) 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) }