Skip to content

Commit 8e029e7

Browse files
committed
initial rebrand
1 parent 7bceab8 commit 8e029e7

File tree

12 files changed

+94
-68
lines changed

12 files changed

+94
-68
lines changed

Android.bp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
android_app_import {
2+
visibility: ["//visibility:public"],
3+
name: "PFAShell",
4+
apk: "app/build/outputs/apk/release/termux-app_apt-android-7-release_universal.apk",
5+
certificate: "platform",
6+
dex_preopt: {
7+
enabled: false,
8+
},
9+
}

app/build.gradle

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ android {
3838
}
3939

4040
defaultConfig {
41-
applicationId "com.termux"
41+
applicationId "dev.kxxt.shell"
4242
minSdkVersion project.properties.minSdkVersion.toInteger()
4343
targetSdkVersion project.properties.targetSdkVersion.toInteger()
44-
versionCode 118
44+
versionCode 10910010
4545
versionName "0.118.0"
4646

4747
if (appVersionName) versionName = appVersionName
4848
validateVersionName(versionName)
4949

5050
buildConfigField "String", "TERMUX_PACKAGE_VARIANT", "\"" + project.ext.packageVariant + "\"" // Used by TermuxApplication class
5151

52-
manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.termux"
53-
manifestPlaceholders.TERMUX_APP_NAME = "Termux"
54-
manifestPlaceholders.TERMUX_API_APP_NAME = "Termux:API"
55-
manifestPlaceholders.TERMUX_BOOT_APP_NAME = "Termux:Boot"
56-
manifestPlaceholders.TERMUX_FLOAT_APP_NAME = "Termux:Float"
57-
manifestPlaceholders.TERMUX_STYLING_APP_NAME = "Termux:Styling"
58-
manifestPlaceholders.TERMUX_TASKER_APP_NAME = "Termux:Tasker"
59-
manifestPlaceholders.TERMUX_WIDGET_APP_NAME = "Termux:Widget"
52+
manifestPlaceholders.TERMUX_PACKAGE_NAME = "dev.kxxt.shell"
53+
manifestPlaceholders.TERMUX_APP_NAME = "Shell"
54+
manifestPlaceholders.TERMUX_API_APP_NAME = "Shell:API"
55+
manifestPlaceholders.TERMUX_BOOT_APP_NAME = "Shell:Boot"
56+
manifestPlaceholders.TERMUX_FLOAT_APP_NAME = "Shell:Float"
57+
manifestPlaceholders.TERMUX_STYLING_APP_NAME = "Shell:Styling"
58+
manifestPlaceholders.TERMUX_TASKER_APP_NAME = "Shell:Tasker"
59+
manifestPlaceholders.TERMUX_WIDGET_APP_NAME = "Shell:Widget"
6060

6161
externalNativeBuild {
6262
ndkBuild {
@@ -77,10 +77,10 @@ android {
7777

7878
signingConfigs {
7979
debug {
80-
storeFile file('testkey_untrusted.jks')
81-
keyAlias 'alias'
82-
storePassword 'xrj45yWGLbsO7W0v'
83-
keyPassword 'xrj45yWGLbsO7W0v'
80+
storeFile file('platform.keystore')
81+
keyAlias 'platform'
82+
storePassword 'android'
83+
keyPassword 'android'
8484
}
8585
}
8686

@@ -104,12 +104,6 @@ android {
104104
targetCompatibility JavaVersion.VERSION_1_8
105105
}
106106

107-
externalNativeBuild {
108-
ndkBuild {
109-
path "src/main/cpp/Android.mk"
110-
}
111-
}
112-
113107
lintOptions {
114108
disable 'ProtectedPermissions'
115109
}
@@ -230,9 +224,3 @@ task downloadBootstraps() {
230224
}
231225
}
232226
}
233-
234-
afterEvaluate {
235-
android.applicationVariants.all { variant ->
236-
variant.javaCompileProvider.get().dependsOn(downloadBootstraps)
237-
}
238-
}

app/platform.keystore

2.98 KB
Binary file not shown.

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
package="com.termux"
55
android:installLocation="internalOnly"
6-
android:sharedUserId="${TERMUX_PACKAGE_NAME}"
6+
android:sharedUserId="android.uid.shell"
77
android:sharedUserLabel="@string/shared_user_label">
88

99
<uses-feature

app/src/main/java/com/termux/app/TermuxActivity.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -396,18 +396,7 @@ public void onServiceConnected(ComponentName componentName, IBinder service) {
396396

397397
if (mTermuxService.isTermuxSessionsEmpty()) {
398398
if (mIsVisible) {
399-
TermuxInstaller.setupBootstrapIfNeeded(TermuxActivity.this, () -> {
400-
if (mTermuxService == null) return; // Activity might have been destroyed.
401-
try {
402-
boolean launchFailsafe = false;
403-
if (intent != null && intent.getExtras() != null) {
404-
launchFailsafe = intent.getExtras().getBoolean(TERMUX_ACTIVITY.EXTRA_FAILSAFE_SESSION, false);
405-
}
406-
mTermuxTerminalSessionActivityClient.addNewSession(launchFailsafe, null);
407-
} catch (WindowManager.BadTokenException e) {
408-
// Activity finished - ignore.
409-
}
410-
});
399+
mTermuxTerminalSessionActivityClient.addNewSession(true, null);
411400
} else {
412401
// The service connected while not in foreground - just bail out.
413402
finishActivityIfNotFinishing();

app/src/main/java/com/termux/app/TermuxApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void onCreate() {
6060
}
6161

6262
// Setup termux-am-socket server
63-
TermuxAmSocketServer.setupTermuxAmSocketServer(context);
63+
// TermuxAmSocketServer.setupTermuxAmSocketServer(context);
6464
} else {
6565
Logger.logErrorExtended(LOG_TAG, "Termux files directory is not accessible\n" + error);
6666
}

app/src/main/java/com/termux/app/TermuxService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.termux.app.event.SystemEventReceiver;
2323
import com.termux.app.terminal.TermuxTerminalSessionActivityClient;
2424
import com.termux.app.terminal.TermuxTerminalSessionServiceClient;
25+
import com.termux.shared.shell.command.environment.PFAShellEnvironment;
2526
import com.termux.shared.termux.plugins.TermuxPluginUtils;
2627
import com.termux.shared.data.IntentUtils;
2728
import com.termux.shared.net.uri.UriUtils;
@@ -592,7 +593,7 @@ public synchronized TermuxSession createTermuxSession(ExecutionCommand execution
592593
// Otherwise if command was manually started by the user like by adding a new terminal session,
593594
// then no need to set stdout
594595
TermuxSession newTermuxSession = TermuxSession.execute(this, executionCommand, getTermuxTerminalSessionClient(),
595-
this, new TermuxShellEnvironment(), null, executionCommand.isPluginExecutionCommand);
596+
this, new PFAShellEnvironment(), null, executionCommand.isPluginExecutionCommand);
596597
if (newTermuxSession == null) {
597598
Logger.logError(LOG_TAG, "Failed to execute new TermuxSession command for:\n" + executionCommand.getCommandIdAndLabelLogString());
598599
// If the execution command was started for a plugin, then process the error

app/src/main/res/values/strings.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<!DOCTYPE resources [
4-
<!ENTITY TERMUX_PACKAGE_NAME "com.termux">
5-
<!ENTITY TERMUX_APP_NAME "Termux">
6-
<!ENTITY TERMUX_API_APP_NAME "Termux:API">
7-
<!ENTITY TERMUX_BOOT_APP_NAME "Termux:Boot">
8-
<!ENTITY TERMUX_FLOAT_APP_NAME "Termux:Float">
9-
<!ENTITY TERMUX_STYLING_APP_NAME "Termux:Styling">
10-
<!ENTITY TERMUX_TASKER_APP_NAME "Termux:Tasker">
11-
<!ENTITY TERMUX_WIDGET_APP_NAME "Termux:Widget">
4+
<!ENTITY TERMUX_PACKAGE_NAME "dev.kxxt.shell">
5+
<!ENTITY TERMUX_APP_NAME "Shell">
6+
<!ENTITY TERMUX_API_APP_NAME "Shell:API">
7+
<!ENTITY TERMUX_BOOT_APP_NAME "Shell:Boot">
8+
<!ENTITY TERMUX_FLOAT_APP_NAME "Shell:Float">
9+
<!ENTITY TERMUX_STYLING_APP_NAME "Shell:Styling">
10+
<!ENTITY TERMUX_TASKER_APP_NAME "Shell:Tasker">
11+
<!ENTITY TERMUX_WIDGET_APP_NAME "Shell:Widget">
1212
]>
1313

1414
<resources>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.termux.shared.shell.command.environment;
2+
3+
import android.content.Context;
4+
5+
import androidx.annotation.NonNull;
6+
7+
import com.termux.shared.shell.command.ExecutionCommand;
8+
9+
import java.io.File;
10+
import java.util.HashMap;
11+
12+
public class PFAShellEnvironment extends UnixShellEnvironment{
13+
@NonNull
14+
@Override
15+
public HashMap<String, String> getEnvironment(@NonNull Context currentPackageContext, boolean isFailSafe) {
16+
HashMap<String, String> environment = new HashMap<>();
17+
environment.put(ENV_COLORTERM, "truecolor");
18+
environment.put(ENV_TERM, "xterm-256color");
19+
return environment;
20+
}
21+
22+
@NonNull
23+
@Override
24+
public String getDefaultWorkingDirectoryPath() {
25+
return "/data/home/shell";
26+
}
27+
28+
@NonNull
29+
@Override
30+
public String getDefaultBinPath() {
31+
return "/data/usr/bin";
32+
}
33+
34+
@NonNull
35+
@Override
36+
public HashMap<String, String> setupShellCommandEnvironment(@NonNull Context currentPackageContext, @NonNull ExecutionCommand executionCommand) {
37+
return getEnvironment(currentPackageContext, executionCommand.isFailsafe);
38+
}
39+
}

termux-shared/src/main/java/com/termux/shared/shell/command/environment/UnixShellEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public abstract class UnixShellEnvironment implements IShellEnvironment {
5353

5454

5555
/** Names for common/supported login shell binaries. */
56-
public static final String[] LOGIN_SHELL_BINARIES = new String[]{"login", "bash", "zsh", "fish", "sh"};
56+
public static final String[] LOGIN_SHELL_BINARIES = new String[]{"bash", "zsh", "fish", "sh"};
5757

5858

5959

0 commit comments

Comments
 (0)