This commit is contained in:
p0we7 2025-03-17 23:31:37 +08:00 committed by GitHub
commit ece2b1d823
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -56,7 +56,7 @@ class LogsActivity : BaseActivity<LogsDesign>() {
}
private fun loadFiles(): List<LogFile> {
val list = cacheDir.resolve("logs").listFiles()?.toList() ?: emptyList()
val list = logsDir.listFiles()?.toList() ?: emptyList()
return list.mapNotNull { LogFile.parseFromFileName(it.name) }
}
@ -64,4 +64,4 @@ class LogsActivity : BaseActivity<LogsDesign>() {
private fun deleteAllLogs() {
logsDir.deleteRecursively()
}
}
}

View file

@ -4,7 +4,7 @@ import android.content.Context
import java.io.File
val Context.logsDir: File
get() = cacheDir.resolve("logs")
get() = getExternalFilesDir(null)?.resolve("logs") ?: cacheDir.resolve("logs")
val Context.clashDir: File
get() = filesDir.resolve("clash")
get() = filesDir.resolve("clash")