From 6fd3582be08822ddd2c9810147a1c3d49819b023 Mon Sep 17 00:00:00 2001 From: Hilledkinged Date: Tue, 4 May 2021 18:49:35 +0300 Subject: [PATCH] v2.0.5 --- app/build.gradle | 5 +---- app/src/main/java/io/neoterm/component/pm/SourceHelper.kt | 2 +- .../main/java/io/neoterm/frontend/config/DefaultValues.kt | 2 +- app/src/main/java/io/neoterm/frontend/config/NeoTermPath.kt | 2 +- .../io/neoterm/frontend/session/shell/ShellTermSession.kt | 5 +++-- .../java/io/neoterm/ui/customize/BaseCustomizeActivity.kt | 2 +- app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt | 4 +++- app/src/main/res/menu/menu_main.xml | 1 + app/src/main/res/values/strings.xml | 2 +- app/src/main/res/xml/setting_general.xml | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index dd0d0ef..46d5c1f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { minSdkVersion rootProject.ext.android.MIN_SDK_VERSION targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION versionCode 37 - versionName "2.1.0" + versionName "2.0.5" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' resConfigs "zh-rCN", "zh-rTW" externalNativeBuild { @@ -35,9 +35,6 @@ android { proguardFile 'app/proguard-rules.pro' versionNameSuffix "-${getGitHeadRefsSuffix()}" } - debug { - versionNameSuffix "-snapshot-${getGitHeadRefsSuffix()}" - } } externalNativeBuild { cmake { diff --git a/app/src/main/java/io/neoterm/component/pm/SourceHelper.kt b/app/src/main/java/io/neoterm/component/pm/SourceHelper.kt index 1edffb6..c9069cb 100644 --- a/app/src/main/java/io/neoterm/component/pm/SourceHelper.kt +++ b/app/src/main/java/io/neoterm/component/pm/SourceHelper.kt @@ -21,7 +21,7 @@ object SourceHelper { val content = buildString { this.append("# Generated by NeoTerm-Preference\n") sourceManager.getEnabledSources() - .joinTo(this, "\n") { "deb ${it.url} ${it.repo}\n" } + .joinTo(this, "\n") { "deb [trusted=yes] ${it.url} ${it.repo}\n" } } FileUtils.writeFile(sourceFile, content.toByteArray()) } diff --git a/app/src/main/java/io/neoterm/frontend/config/DefaultValues.kt b/app/src/main/java/io/neoterm/frontend/config/DefaultValues.kt index fe729b2..42164f4 100644 --- a/app/src/main/java/io/neoterm/frontend/config/DefaultValues.kt +++ b/app/src/main/java/io/neoterm/frontend/config/DefaultValues.kt @@ -19,7 +19,7 @@ object DefaultValues { const val enableSpecialVolumeKeys = false const val enableWordBasedIme = false - const val loginShell = "sh" + const val loginShell = "bash" const val initialCommand = "" const val defaultFont = "SourceCodePro" } diff --git a/app/src/main/java/io/neoterm/frontend/config/NeoTermPath.kt b/app/src/main/java/io/neoterm/frontend/config/NeoTermPath.kt index 79ded73..d537e15 100644 --- a/app/src/main/java/io/neoterm/frontend/config/NeoTermPath.kt +++ b/app/src/main/java/io/neoterm/frontend/config/NeoTermPath.kt @@ -25,7 +25,7 @@ object NeoTermPath { const val SOURCE_FILE = "$USR_PATH/etc/apt/sources.list" const val PACKAGE_LIST_DIR = "$USR_PATH/var/lib/apt/lists" - private const val SOURCE = "http://120.79.193.152/neoterm" + private const val SOURCE = "https://raw.githubusercontent.com/NeoTerm/NeoTerm-repo/main" val DEFAULT_MAIN_PACKAGE_SOURCE: String diff --git a/app/src/main/java/io/neoterm/frontend/session/shell/ShellTermSession.kt b/app/src/main/java/io/neoterm/frontend/session/shell/ShellTermSession.kt index 3e96e0e..b0f2ba4 100644 --- a/app/src/main/java/io/neoterm/frontend/session/shell/ShellTermSession.kt +++ b/app/src/main/java/io/neoterm/frontend/session/shell/ShellTermSession.kt @@ -182,6 +182,7 @@ open class ShellTermSession private constructor(shellPath: String, cwd: String, val androidRootEnv = "ANDROID_ROOT=" + System.getenv("ANDROID_ROOT") val androidDataEnv = "ANDROID_DATA=" + System.getenv("ANDROID_DATA") val externalStorageEnv = "EXTERNAL_STORAGE=" + System.getenv("EXTERNAL_STORAGE") + val colorterm = "COLORTERM=truecolor" // PY Trade: Some programs support NeoTerm in a special way. val neotermIdEnv = "__NEOTERM=1" @@ -192,7 +193,7 @@ open class ShellTermSession private constructor(shellPath: String, cwd: String, val pathEnv = "PATH=" + System.getenv("PATH") arrayOf(termEnv, homeEnv, androidRootEnv, androidDataEnv, externalStorageEnv, pathEnv, neotermIdEnv, prefixEnv, - originLdEnv, originPathEnv) + originLdEnv, originPathEnv, colorterm) } else { val ps1Env = "PS1=$ " @@ -213,7 +214,7 @@ open class ShellTermSession private constructor(shellPath: String, cwd: String, arrayOf(termEnv, homeEnv, ps1Env, ldEnv, langEnv, pathEnv, pwdEnv, androidRootEnv, androidDataEnv, externalStorageEnv, tmpdirEnv, neotermIdEnv, originPathEnv, originLdEnv, - ldPreloadEnv, prefixEnv) + ldPreloadEnv, prefixEnv, colorterm) } .filter { it.isNotEmpty() } .toTypedArray() diff --git a/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt b/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt index e30ee5e..be1226d 100644 --- a/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt +++ b/app/src/main/java/io/neoterm/ui/customize/BaseCustomizeActivity.kt @@ -41,7 +41,7 @@ open class BaseCustomizeActivity : AppCompatActivity() { val script = resources.getStringArray(R.array.custom_preview_script_colors) val parameter = ShellParameter() - .executablePath("${NeoTermPath.USR_PATH}/bin/applets/echo") + .executablePath("${NeoTermPath.USR_PATH}/bin/echo") .arguments(arrayOf("echo", "-e", *script)) .callback(sessionCallback) .systemShell(false) diff --git a/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt b/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt index 76a7695..207e308 100644 --- a/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt +++ b/app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt @@ -25,8 +25,10 @@ import io.neoterm.R import io.neoterm.backend.TerminalSession import io.neoterm.component.profile.ProfileComponent import io.neoterm.frontend.component.ComponentManager +import io.neoterm.frontend.config.DefaultValues import io.neoterm.frontend.config.NeoPermission import io.neoterm.frontend.config.NeoPreference +import io.neoterm.frontend.config.NeoTermPath import io.neoterm.frontend.session.shell.ShellParameter import io.neoterm.frontend.session.shell.ShellProfile import io.neoterm.frontend.session.shell.client.TermSessionCallback @@ -179,7 +181,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference true } R.id.menu_item_new_x_session -> { - addXSession(); + addXSession() true } else -> super.onOptionsItemSelected(item) diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index c387ea5..c0a4664 100755 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -30,6 +30,7 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6774f68..0770194 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -168,7 +168,7 @@ Dangerous Zone You will have to re-setup later, confirm? - http://120.79.193.152/neoterm + https://raw.githubusercontent.com/NeoTerm/NeoTerm-repo/main sh diff --git a/app/src/main/res/xml/setting_general.xml b/app/src/main/res/xml/setting_general.xml index 55ca9e3..77861d3 100644 --- a/app/src/main/res/xml/setting_general.xml +++ b/app/src/main/res/xml/setting_general.xml @@ -1,7 +1,7 @@