Commit 978216ea authored by vvb2060's avatar vvb2060 Committed by John Wu

local module: filter hidden dirs

parent 44cfe94e
...@@ -122,15 +122,13 @@ data class LocalModule( ...@@ -122,15 +122,13 @@ data class LocalModule(
companion object { companion object {
private val PERSIST get() = "${Const.MAGISKTMP}/mirror/persist/magisk"
fun loaded() = RootUtils.fs.getFile(Const.MAGISK_PATH).exists() fun loaded() = RootUtils.fs.getFile(Const.MAGISK_PATH).exists()
suspend fun installed() = withContext(Dispatchers.IO) { suspend fun installed() = withContext(Dispatchers.IO) {
RootUtils.fs.getFile(Const.MAGISK_PATH) RootUtils.fs.getFile(Const.MAGISK_PATH)
.listFiles() .listFiles()
.orEmpty() .orEmpty()
.filter { !it.isFile } .filter { !it.isFile && !it.isHidden }
.map { LocalModule("${Const.MAGISK_PATH}/${it.name}") } .map { LocalModule("${Const.MAGISK_PATH}/${it.name}") }
.sortedBy { it.name.lowercase(Locale.ROOT) } .sortedBy { it.name.lowercase(Locale.ROOT) }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment