From 18ae731a9d215c5954ab9ff227cee867b50b5176 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 16 Oct 2022 19:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/JsExtensions.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 bcda4039dc9e..7f85f6aafd03 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -3,11 +3,11 @@ package io.legado.app.help import android.net.Uri import android.util.Base64 import androidx.annotation.Keep +import cn.hutool.core.util.HexUtil +import cn.hutool.crypto.SecureUtil import cn.hutool.crypto.digest.DigestUtil import cn.hutool.crypto.digest.HMac -import cn.hutool.core.util.HexUtil import cn.hutool.crypto.symmetric.SymmetricCrypto -import cn.hutool.crypto.SecureUtil import io.legado.app.constant.AppConst import io.legado.app.constant.AppConst.dateFormat import io.legado.app.constant.AppLog @@ -178,13 +178,16 @@ interface JsExtensions { /** * 缓存以文本方式保存的文件 如.js .txt等 * @param urlStr 网络文件的链接 - * @param saveTime 缓存时间,单位:秒 * @return 返回缓存后的文件内容 */ fun cacheFile(urlStr: String): String? { return cacheFile(urlStr, 0) } + /** + * 缓存以文本方式保存的文件 如.js .txt等 + * @param saveTime 缓存时间,单位:秒 + */ fun cacheFile(urlStr: String, saveTime: Int): String? { val key = md5Encode16(urlStr) val cache = CacheManager.getFile(key) @@ -675,7 +678,7 @@ interface JsExtensions { iv: ByteArray? ): SymmetricCrypto { val symmetricCrypto = SymmetricCrypto(transformation, key) - return if (iv != null && !iv.isEmpty()) symmetricCrypto.setIv(iv) else symmetricCrypto + return if (iv != null && iv.isNotEmpty()) symmetricCrypto.setIv(iv) else symmetricCrypto } fun createSymmetricCrypto(