Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Jan 18, 2025
1 parent 7fd39bc commit c708620
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/main/java/org/andbootmgr/app/util/Terminal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,12 @@ fun TerminalWork(logFile: String? = null, action: suspend (TerminalList) -> Unit
val ctx = LocalContext.current.applicationContext
LaunchedEffect(Unit) {
val logDispatcher = Dispatchers.IO.limitedParallelism(1)
val log = logFile?.let { SuFileOutputStream.open(File(ctx.externalCacheDirs
.filterNotNull().firstOrNull() ?: File(Environment.getExternalStorageDirectory(), "AbmLogs"), it)) }
val log = logFile?.let {
val logDir = ctx.externalCacheDirs.filterNotNull().firstOrNull() ?: run {
File(Environment.getExternalStorageDirectory(), "AbmLogs").also { it.mkdir() }
}
SuFileOutputStream.open(File(logDir, it))
}
val s = BudgetCallbackList(CoroutineScope(logDispatcher), log)
StayAliveConnection(ctx, {
withContext(Dispatchers.Default) {
Expand Down

0 comments on commit c708620

Please sign in to comment.