mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 10:45:23 +08:00
Use $PREFIX/storage for symlinks. Rix null check.
This commit is contained in:
@@ -205,9 +205,7 @@ final class TermuxInstaller {
|
|||||||
new Thread() {
|
new Thread() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
File homeDir = new File(TermuxService.HOME_PATH);
|
File storageDir = new File(TermuxService.FILES_PATH, "storage");
|
||||||
homeDir.mkdirs();
|
|
||||||
File storageDir = new File(homeDir, "storage");
|
|
||||||
|
|
||||||
if (storageDir.exists()) {
|
if (storageDir.exists()) {
|
||||||
if (storageDir.isDirectory()) {
|
if (storageDir.isDirectory()) {
|
||||||
@@ -241,7 +239,7 @@ final class TermuxInstaller {
|
|||||||
Os.symlink(moviesDir.getAbsolutePath(), new File(storageDir, "movies").getAbsolutePath());
|
Os.symlink(moviesDir.getAbsolutePath(), new File(storageDir, "movies").getAbsolutePath());
|
||||||
|
|
||||||
final File[] dirs = context.getExternalFilesDirs(null);
|
final File[] dirs = context.getExternalFilesDirs(null);
|
||||||
if (dirs == null || dirs.length >= 2) {
|
if (dirs != null && dirs.length >= 2) {
|
||||||
final File externalDir = dirs[1];
|
final File externalDir = dirs[1];
|
||||||
Os.symlink(externalDir.getAbsolutePath(), new File(storageDir, "external").getAbsolutePath());
|
Os.symlink(externalDir.getAbsolutePath(), new File(storageDir, "external").getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user