local module: filter hidden dirs

This commit is contained in:
vvb2060 2022-09-02 23:28:44 +08:00 committed by John Wu
parent 44cfe94e4d
commit 978216eade

View File

@ -122,15 +122,13 @@ data class LocalModule(
companion object {
private val PERSIST get() = "${Const.MAGISKTMP}/mirror/persist/magisk"
fun loaded() = RootUtils.fs.getFile(Const.MAGISK_PATH).exists()
suspend fun installed() = withContext(Dispatchers.IO) {
RootUtils.fs.getFile(Const.MAGISK_PATH)
.listFiles()
.orEmpty()
.filter { !it.isFile }
.filter { !it.isFile && !it.isHidden }
.map { LocalModule("${Const.MAGISK_PATH}/${it.name}") }
.sortedBy { it.name.lowercase(Locale.ROOT) }
}