Skip to content

Commit

Permalink
Fix a bug there mkdir() wasn't working due to insufficient permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Jan 18, 2025
1 parent ffe3fcd commit fa95fbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/org/andbootmgr/app/util/Terminal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.dp
import com.topjohnwu.superuser.io.SuFile
import com.topjohnwu.superuser.io.SuFileOutputStream
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -175,7 +176,7 @@ fun TerminalWork(logFile: String? = null, action: suspend (TerminalList) -> Unit
val logDispatcher = Dispatchers.IO.limitedParallelism(1)
val log = logFile?.let {
val logDir = ctx.externalCacheDirs.firstOrNull() ?: run {
File(Environment.getExternalStorageDirectory(), "AbmLogs").also { it.mkdir() }
SuFile.open(Environment.getExternalStorageDirectory(), "AbmLogs").also { it.mkdir() }
}
SuFileOutputStream.open(File(logDir, it))
}
Expand Down

0 comments on commit fa95fbe

Please sign in to comment.