diff --git a/app/src/main/java/com/github/kr328/clash/LogsActivity.kt b/app/src/main/java/com/github/kr328/clash/LogsActivity.kt index bbed63bb..008efd79 100644 --- a/app/src/main/java/com/github/kr328/clash/LogsActivity.kt +++ b/app/src/main/java/com/github/kr328/clash/LogsActivity.kt @@ -56,7 +56,7 @@ class LogsActivity : BaseActivity() { } private fun loadFiles(): List { - 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() { private fun deleteAllLogs() { logsDir.deleteRecursively() } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/github/kr328/clash/util/Files.kt b/app/src/main/java/com/github/kr328/clash/util/Files.kt index 9b696c8a..008062cc 100644 --- a/app/src/main/java/com/github/kr328/clash/util/Files.kt +++ b/app/src/main/java/com/github/kr328/clash/util/Files.kt @@ -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") \ No newline at end of file + get() = filesDir.resolve("clash")