diff --git a/app/src/main/java/com/termux/app/TermuxInstaller.java b/app/src/main/java/com/termux/app/TermuxInstaller.java index 032c06dd..7bc9a957 100644 --- a/app/src/main/java/com/termux/app/TermuxInstaller.java +++ b/app/src/main/java/com/termux/app/TermuxInstaller.java @@ -58,8 +58,8 @@ final class TermuxInstaller { String bootstrapErrorMessage; Error filesDirectoryAccessibleError; - // This will also call Context.getFilesDir(), which should ensure that TERMUX_INTERNAL_PRIVATE_APP_DATA_DIR_PATH - // is created if it does not already exist, like if it was not already created by android + // This will also call Context.getFilesDir(), which should ensure that TERMUX_FILES_DIR_PATH + // is created if it does not already exist filesDirectoryAccessibleError = TermuxFileUtils.isTermuxFilesDirectoryAccessible(activity, true, true); boolean isFilesDirectoryAccessible = filesDirectoryAccessibleError == null; @@ -79,9 +79,9 @@ final class TermuxInstaller { bootstrapErrorMessage = Error.getMinimalErrorString(filesDirectoryAccessibleError) + "\nTERMUX_FILES_DIR: " + MarkdownUtils.getMarkdownCodeForString(TermuxConstants.TERMUX_FILES_DIR_PATH, false); Logger.logError(LOG_TAG, bootstrapErrorMessage); CrashUtils.sendCrashReportNotification(activity, LOG_TAG, "## Bootstrap Error\n\n" + bootstrapErrorMessage, true, true); - MessageDialogUtils.exitAppWithErrorMessage(activity, + MessageDialogUtils.showMessage(activity, activity.getString(R.string.bootstrap_error_title), - bootstrapErrorMessage); + bootstrapErrorMessage, null); return; } diff --git a/termux-shared/src/main/java/com/termux/shared/file/TermuxFileUtils.java b/termux-shared/src/main/java/com/termux/shared/file/TermuxFileUtils.java index f2ac1dce..5b06725e 100644 --- a/termux-shared/src/main/java/com/termux/shared/file/TermuxFileUtils.java +++ b/termux-shared/src/main/java/com/termux/shared/file/TermuxFileUtils.java @@ -128,8 +128,13 @@ public class TermuxFileUtils { * Validate the existence and permissions of {@link TermuxConstants#TERMUX_FILES_DIR_PATH}. * * The directory will not be created manually but by calling {@link Context#getFilesDir()} - * so that android itself creates it. The `/data/data/[package_name]` directory cannot be - * created by an app itself. Note that the path returned by {@link Context#getFilesDir()} will + * so that android itself creates it. However, the call will not create its parent package + * data directory `/data/user/0/[package_name]` if it does not already exist and a `logcat` + * error will be logged by android. + * {@code Failed to ensure /data/user/0//files: mkdir failed: ENOENT (No such file or directory)} + * An android app likely can't create the package data directory since its parent `/data/user/0` + * is owned by `system` user and is normally create at app install or update time and not at app startup. + * Note that the path returned by {@link Context#getFilesDir()} will * be under `/data/user/[id]/[package_name]` instead of `/data/data/[package_name]` * defined by default by {@link TermuxConstants#TERMUX_FILES_DIR_PATH}, where id will be 0 for * primary user and a higher number for other users/profiles. If app is running under work profile