diff --git a/app/src/main/java/me/kyuubiran/qqcleaner/util/CleanManager.kt b/app/src/main/java/me/kyuubiran/qqcleaner/util/CleanManager.kt index c3d10a7..84b08d7 100644 --- a/app/src/main/java/me/kyuubiran/qqcleaner/util/CleanManager.kt +++ b/app/src/main/java/me/kyuubiran/qqcleaner/util/CleanManager.kt @@ -18,10 +18,10 @@ object CleanManager { fun execute(data: CleanData, showToast: Boolean = true, forceExec: Boolean = false) { if (!data.valid) return if (!data.enable && !forceExec) return - if (showToast) Log.toast( - moduleRes.getString(R.string.executing_config).format(data.title) - ) pool.execute e@{ + if (showToast) Log.toast( + moduleRes.getString(R.string.executing_config).format(data.title) + ) runCatching { data.content.forEach { data -> if (!data.enable) return@forEach @@ -46,6 +46,9 @@ object CleanManager { it.forEach { data -> execute(data, showToast) } + pool.execute { + if (showToast) Log.toast(moduleRes.getString(R.string.clean_finished)) + } } } } diff --git a/app/src/main/java/me/kyuubiran/qqcleaner/util/path/WeChatPath.kt b/app/src/main/java/me/kyuubiran/qqcleaner/util/path/WeChatPath.kt index 4692b35..37ad2c5 100644 --- a/app/src/main/java/me/kyuubiran/qqcleaner/util/path/WeChatPath.kt +++ b/app/src/main/java/me/kyuubiran/qqcleaner/util/path/WeChatPath.kt @@ -4,25 +4,26 @@ import java.io.File object WeChatPath { //P: storage/emulated/0/Android/data/com.tencent.mm/MicroMsg/${UserDataDirName} - val publicUserData by lazy { + val publicUserData: Pair by lazy { "!PublicUserDataDir" to run { val dirs = File("${CommonPath.publicData.second}/MicroMsg").listFiles() if (dirs != null && dirs.isNotEmpty()) { - dirs.firstOrNull { it.name.length == 32 && it.isDirectory }?.absolutePath + return@run dirs.firstOrNull { it.name.length == 32 && it.isDirectory }?.absolutePath + ?: "" } "" } } //P: data/user/0/com.tencent.mm/MicroMsg/${UserDataDirName} - val privateUserData by lazy { + val privateUserData: Pair by lazy { "!PrivateUserDataDir" to run { val dirs = File("${CommonPath.privateData.second}/MicroMsg").listFiles() if (dirs != null && dirs.isNotEmpty()) { - dirs.firstOrNull { + return@run dirs.firstOrNull { it.name.length == 32 && it.isDirectory && File("${it.absolutePath}/account.bin").exists() - }?.absolutePath + }?.absolutePath ?: "" } "" } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eb39877..ad8661f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -90,5 +90,6 @@ 空空如也 添加路径 文件夹图标 + 瘦身完毕!