From eed3a270ba56eee4e446e9c1deaec36f9cc62075 Mon Sep 17 00:00:00 2001 From: renwj Date: Sun, 23 Apr 2023 15:19:47 +0800 Subject: [PATCH] =?UTF-8?q?[2.15.0][=E5=A2=9E=E9=87=8F=E5=8D=87=E7=BA=A7]?= =?UTF-8?q?=20=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/launcher/patch/PatchManager.kt | 3 +- .../com/mogo/launcher/patch/utils/Md5Util.kt | 42 ------------------- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/utils/Md5Util.kt diff --git a/core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/PatchManager.kt b/core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/PatchManager.kt index 2474c0e784..f6de93fd65 100644 --- a/core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/PatchManager.kt +++ b/core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/PatchManager.kt @@ -4,8 +4,7 @@ import android.content.* import android.text.TextUtils import android.util.* import com.github.sisong.* -import com.mogo.eagle.core.utilcode.util.AppUtils -import com.mogo.launcher.patch.utils.* +import com.mogo.eagle.core.utilcode.util.* import java.io.File internal object PatchManager { diff --git a/core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/utils/Md5Util.kt b/core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/utils/Md5Util.kt deleted file mode 100644 index d0ac1c76ea..0000000000 --- a/core/function-impl/mogo-core-function-patch/src/main/java/com/mogo/launcher/patch/utils/Md5Util.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.mogo.launcher.patch.utils - -import java.io.* -import java.nio.channels.FileChannel.MapMode -import java.security.* - -class Md5Util { - - companion object { - - /** - * 获取单个文件的MD5值! - * @param file - * @return - * 解决首位0被省略问题 - */ - fun getMd5FromFile(file: File): String? { - var stringbuffer: StringBuffer? = null - try { - val hexDigits = charArrayOf('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f') - val input = FileInputStream(file) - val ch = input.channel - val byteBuffer = ch.map(MapMode.READ_ONLY, 0, file.length()) - val digest = MessageDigest.getInstance("MD5") - digest.update(byteBuffer) - val bytes = digest.digest() - val n = bytes.size - stringbuffer = StringBuffer(2 * n) - for (l in 0 until n) { - val bt = bytes[l] - val c0 = hexDigits[bt.toInt() and 0xf0 shr 4] - val c1 = hexDigits[bt.toInt() and 0xf] - stringbuffer.append(c0) - stringbuffer.append(c1) - } - } catch (e: java.lang.Exception) { - e.printStackTrace() - } - return stringbuffer?.toString() - } - } -} \ No newline at end of file