From 8f7a39250b4cdd5502cd0fc2ac4b1c7dadd2860d Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Thu, 16 Mar 2023 18:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E4=B9=A6=E7=B1=8D=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=94=AF=E6=8C=81=E5=AF=BC=E5=85=A5=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/utils/ArchiveUtils.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/ArchiveUtils.kt b/app/src/main/java/io/legado/app/utils/ArchiveUtils.kt index 0389f5723..c70dd5652 100644 --- a/app/src/main/java/io/legado/app/utils/ArchiveUtils.kt +++ b/app/src/main/java/io/legado/app/utils/ArchiveUtils.kt @@ -96,9 +96,12 @@ object ArchiveUtils { } } - fun checkAchieve(name: String): Boolean { - if (archiveFileRegex.matches(name)) return true - throw IllegalArgumentException("Unexpected file suffix: Only 7z rar zip Accepted") + fun isArchive(name: String): Boolean { + return if (archiveFileRegex.matches(name)) true else false + } + private fun checkAchieve(name: String) { + if (!isArchive(name)) + throw IllegalArgumentException("Unexpected file suffix: Only 7z rar zip Accepted") } private fun getCacheFolderFileDoc(