From e82e92ba073b44ca5d4a81efac1aa1ab3fde3ebe Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 16 Jul 2021 13:34:17 +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 --- .../java/io/legado/app/help/JsExtensions.kt | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 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 ce27c40c7..56326e382 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -443,10 +443,7 @@ interface JsExtensions { * @param iv ECB模式的偏移向量 */ fun aesDecodeToByteArray( - str: String, - key: String, - transformation: String, - iv: String + str: String, key: String, transformation: String, iv: String ): ByteArray? { return EncoderUtils.decryptAES( data = str.encodeToByteArray(), @@ -465,10 +462,7 @@ interface JsExtensions { */ fun aesDecodeToString( - str: String, - key: String, - transformation: String, - iv: String + str: String, key: String, transformation: String, iv: String ): String? { return aesDecodeToByteArray(str, key, transformation, iv)?.let { String(it) } } @@ -482,10 +476,7 @@ interface JsExtensions { */ fun aesBase64DecodeToByteArray( - str: String, - key: String, - transformation: String, - iv: String + str: String, key: String, transformation: String, iv: String ): ByteArray? { return EncoderUtils.decryptBase64AES( data = str.encodeToByteArray(), @@ -504,10 +495,7 @@ interface JsExtensions { */ fun aesBase64DecodeToString( - str: String, - key: String, - transformation: String, - iv: String + str: String, key: String, transformation: String, iv: String ): String? { return aesBase64DecodeToByteArray(str, key, transformation, iv)?.let { String(it) } } @@ -520,8 +508,7 @@ interface JsExtensions { * @param iv ECB模式的偏移向量 */ fun aesEncodeToByteArray( - data: String, key: String, transformation: String, - iv: String + data: String, key: String, transformation: String, iv: String ): ByteArray? { return EncoderUtils.encryptAES( data.encodeToByteArray(), @@ -539,8 +526,7 @@ interface JsExtensions { * @param iv ECB模式的偏移向量 */ fun aesEncodeToString( - data: String, key: String, transformation: String, - iv: String + data: String, key: String, transformation: String, iv: String ): String? { return aesEncodeToByteArray(data, key, transformation, iv)?.let { String(it) } } @@ -553,8 +539,7 @@ interface JsExtensions { * @param iv ECB模式的偏移向量 */ fun aesEncodeToBase64ByteArray( - data: String, key: String, transformation: String, - iv: String + data: String, key: String, transformation: String, iv: String ): ByteArray? { return EncoderUtils.encryptAES2Base64( data.encodeToByteArray(), @@ -572,8 +557,7 @@ interface JsExtensions { * @param iv ECB模式的偏移向量 */ fun aesEncodeToBase64String( - data: String, key: String, transformation: String, - iv: String + data: String, key: String, transformation: String, iv: String ): String? { return aesEncodeToBase64ByteArray(data, key, transformation, iv)?.let { String(it) } }