Rebrand as Nix / Nix-on-Droid

This commit is contained in:
Alexander Sosedkin 2019-03-06 19:01:23 +00:00
parent 893d86be50
commit 9c901645f9
10 changed files with 103 additions and 17 deletions

View file

@ -15,7 +15,8 @@ android {
minSdkVersion 21
targetSdkVersion 28
versionCode 66
versionName "0.66_v0.4_by-xeffyr"
versionName "0.66_v0.1.0_nix"
applicationIdSuffix ".nix"
}
buildTypes {
@ -30,6 +31,10 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
}
dependencies {
@ -38,7 +43,7 @@ dependencies {
preBuild.doFirst {
assert file("./src/main/assets/bootstrap-aarch64").exists()
assert file("./src/main/assets/bootstrap-arm").exists()
assert file("./src/main/assets/bootstrap-i686").exists()
assert file("./src/main/assets/bootstrap-x86_64").exists()
//assert file("./src/main/assets/bootstrap-arm").exists()
//assert file("./src/main/assets/bootstrap-i686").exists()
//assert file("./src/main/assets/bootstrap-x86_64").exists()
}

View file

@ -2,7 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.termux"
android:installLocation="internalOnly"
android:sharedUserId="com.termux"
android:sharedUserId="com.termux.nix"
android:sharedUserLabel="@string/shared_user_label" >
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
@ -114,6 +114,7 @@
</intent-filter>
</activity-alias>
<!--
<provider
android:name=".filepicker.TermuxDocumentsProvider"
android:authorities="com.termux.documents"
@ -124,6 +125,7 @@
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
</intent-filter>
</provider>
-->
<service
android:name="com.termux.app.TermuxService"
@ -136,11 +138,13 @@
<receiver android:name=".app.TermuxOpenReceiver" />
<!--
<provider android:authorities="com.termux.files"
android:readPermission="android.permission.permRead"
android:exported="true"
android:grantUriPermissions="true"
android:name="com.termux.app.TermuxOpenReceiver$ContentProvider" />
-->
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />

View file

@ -153,8 +153,8 @@ public final class TermuxActivity extends Activity implements ServiceConnection
void checkForFontAndColors() {
try {
@SuppressLint("SdCardPath") File fontFile = new File("/data/data/com.termux/files/home/.termux/font.ttf");
@SuppressLint("SdCardPath") File colorsFile = new File("/data/data/com.termux/files/home/.termux/colors.properties");
@SuppressLint("SdCardPath") File fontFile = new File("/data/data/com.termux.nix/files/home/.termux/font.ttf");
@SuppressLint("SdCardPath") File colorsFile = new File("/data/data/com.termux.nix/files/home/.termux/colors.properties");
final Properties props = new Properties();
if (colorsFile.isFile()) {

View file

@ -136,7 +136,11 @@ final class TermuxInstaller {
if (!executables.isEmpty()) {
for (String executable : executables) {
//noinspection OctalInteger
try {
Os.chmod(STAGING_PREFIX_PATH + "/" + executable, 0700);
} catch (Throwable t) {
Log.e(EmulatorDebug.LOG_TAG, "EXECUTABLES error: " + STAGING_PREFIX_FILE + "/" + executable, t);
}
}
} else {
throw new RuntimeException("Installer: no EXECUTABLES.txt found while extracting environment archive.");
@ -144,7 +148,11 @@ final class TermuxInstaller {
if (!symlinks.isEmpty()) {
for (Pair<String, String> symlink : symlinks) {
try {
Os.symlink(symlink.first, symlink.second);
} catch (Throwable t) {
Log.e(EmulatorDebug.LOG_TAG, "SYMLINKS error: " + symlink.first + " ! " + symlink.second, t);
}
}
} else {
throw new RuntimeException("Installer: no SYMLINKS.txt found while extracting environment archive.");

View file

@ -46,7 +46,7 @@ public final class TermuxService extends Service implements SessionChangedCallba
/** Note that this is a symlink on the Android M preview. */
@SuppressLint("SdCardPath")
public static final String FILES_PATH = "/data/data/com.termux/files";
public static final String FILES_PATH = "/data/data/com.termux.nix/files";
public static final String PREFIX_PATH = FILES_PATH + "/usr";
public static final String HOME_PATH = FILES_PATH + "/home";
@ -269,6 +269,7 @@ public final class TermuxService extends Service implements SessionChangedCallba
if (executablePath == null) {
for (String shellBinary : new String[]{"login", "bash", "zsh"}) {
File shellFile = new File(PREFIX_PATH + "/bin/" + shellBinary);
Log.w(EmulatorDebug.LOG_TAG, "sf: " + shellFile + " " + shellFile.canExecute());
if (shellFile.canExecute()) {
executablePath = shellFile.getAbsolutePath();
break;
@ -279,6 +280,7 @@ public final class TermuxService extends Service implements SessionChangedCallba
// Fall back to system shell as last resort:
executablePath = "/system/bin/sh";
}
Log.w(EmulatorDebug.LOG_TAG, "Shell: " + executablePath);
isLoginShell = true;
}

View file

@ -16,7 +16,7 @@ import java.util.List;
public final class TermuxWidgetService extends RemoteViewsService {
@SuppressLint("SdCardPath")
public static final File SHORTCUTS_DIR = new File("/data/data/com.termux/files/home/.shortcuts");
public static final File SHORTCUTS_DIR = new File("/data/data/com.termux.nix/files/home/.shortcuts");
public static final class TermuxWidgetItem {

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="application_name">Termux</string>
<string name="shared_user_label">Termux user</string>
<string name="app_failsafe_mode">Termux (failsafe)</string>
<string name="termux_exec_permission_label">Termux:Execute</string>
<string name="termux_exec_permission_desc">Allows application to execute arbitrary shell commands within Termux.</string>
<string name="application_name">Nix</string>
<string name="shared_user_label">Nix user</string>
<string name="app_failsafe_mode">Nix (failsafe shell)</string>
<string name="termux_exec_permission_label">Nix:Execute</string>
<string name="termux_exec_permission_desc">Allows application to execute arbitrary shell commands within Nix (Termux).</string>
<string name="new_session">New session</string>
<string name="new_session_failsafe">Failsafe</string>
<string name="toggle_soft_keyboard">Keyboard</string>
@ -16,10 +16,10 @@
<string name="bootstrap_installer_body">Installing…</string>
<string name="bootstrap_error_title">Unable to install</string>
<string name="bootstrap_error_body">Termux was unable to install the bootstrap packages.\n\nCheck your network connection and try again.</string>
<string name="bootstrap_error_body">Nix was unable to install the bootstrap package.</string>
<string name="bootstrap_error_abort">Abort</string>
<string name="bootstrap_error_try_again">Try again</string>
<string name="bootstrap_error_not_primary_user_message">Termux can only be installed on the primary user account.</string>
<string name="bootstrap_error_not_primary_user_message">Nix can only be installed on the primary user account.</string>
<string name="max_terminals_reached_title">Max terminals reached</string>
<string name="max_terminals_reached_message">Close down existing ones before creating new.</string>