From ffd8687b4cbc9ae9dab8f56384bfecab83a4049b Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Tue, 13 Apr 2021 16:09:31 +0500 Subject: [PATCH 1/5] Revert "Bump to v0.109" --- app/build.gradle | 4 ++-- terminal-emulator/build.gradle | 2 +- terminal-view/build.gradle | 2 +- termux-shared/build.gradle | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7bcd6bed..fc866cd5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,8 +26,8 @@ android { applicationId "com.termux" minSdkVersion project.properties.minSdkVersion.toInteger() targetSdkVersion project.properties.targetSdkVersion.toInteger() - versionCode 109 - versionName "0.109" + versionCode 108 + versionName "0.108" manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.termux" manifestPlaceholders.TERMUX_APP_NAME = "Termux" diff --git a/terminal-emulator/build.gradle b/terminal-emulator/build.gradle index 20232c65..d899a96f 100644 --- a/terminal-emulator/build.gradle +++ b/terminal-emulator/build.gradle @@ -59,7 +59,7 @@ publishing { bar(MavenPublication) { groupId 'com.termux' artifactId 'terminal-emulator' - version '0.109' + version '0.106.1' artifact("$buildDir/outputs/aar/terminal-emulator-release.aar") } } diff --git a/terminal-view/build.gradle b/terminal-view/build.gradle index d83e8b83..b196e223 100644 --- a/terminal-view/build.gradle +++ b/terminal-view/build.gradle @@ -37,7 +37,7 @@ publishing { bar(MavenPublication) { groupId 'com.termux' artifactId 'terminal-view' - version '0.109' + version '0.106.1' artifact("$buildDir/outputs/aar/terminal-view-release.aar") } } diff --git a/termux-shared/build.gradle b/termux-shared/build.gradle index c01d8d6e..a1523253 100644 --- a/termux-shared/build.gradle +++ b/termux-shared/build.gradle @@ -50,7 +50,7 @@ publishing { bar(MavenPublication) { groupId 'com.termux' artifactId 'termux-shared' - version '0.109' + version '0.108' artifact("$buildDir/outputs/aar/termux-shared-release.aar") } } From b7b4a0a8a20147d78cbc541d4a88a421a25d2807 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Tue, 13 Apr 2021 16:20:47 +0500 Subject: [PATCH 2/5] Move TermuxTerminalSessionClientBase to com.termux.shared.terminal package --- app/src/main/java/com/termux/app/TermuxService.java | 2 +- .../com/termux/app/terminal/TermuxTerminalSessionClient.java | 2 +- .../{shell => terminal}/TermuxTerminalSessionClientBase.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename termux-shared/src/main/java/com/termux/shared/{shell => terminal}/TermuxTerminalSessionClientBase.java (97%) diff --git a/app/src/main/java/com/termux/app/TermuxService.java b/app/src/main/java/com/termux/app/TermuxService.java index c5056457..64ca3685 100644 --- a/app/src/main/java/com/termux/app/TermuxService.java +++ b/app/src/main/java/com/termux/app/TermuxService.java @@ -27,7 +27,7 @@ import com.termux.shared.termux.TermuxConstants.TERMUX_APP.TERMUX_ACTIVITY; import com.termux.shared.termux.TermuxConstants.TERMUX_APP.TERMUX_SERVICE; import com.termux.shared.settings.preferences.TermuxAppSharedPreferences; import com.termux.shared.shell.TermuxSession; -import com.termux.shared.shell.TermuxTerminalSessionClientBase; +import com.termux.shared.terminal.TermuxTerminalSessionClientBase; import com.termux.shared.logger.Logger; import com.termux.shared.notification.NotificationUtils; import com.termux.shared.packages.PermissionUtils; diff --git a/app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionClient.java b/app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionClient.java index 8beb7971..c1f1185b 100644 --- a/app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionClient.java +++ b/app/src/main/java/com/termux/app/terminal/TermuxTerminalSessionClient.java @@ -16,7 +16,7 @@ import com.termux.R; import com.termux.shared.shell.TermuxSession; import com.termux.shared.interact.DialogUtils; import com.termux.app.TermuxActivity; -import com.termux.shared.shell.TermuxTerminalSessionClientBase; +import com.termux.shared.terminal.TermuxTerminalSessionClientBase; import com.termux.shared.termux.TermuxConstants; import com.termux.app.TermuxService; import com.termux.shared.settings.properties.TermuxPropertyConstants; diff --git a/termux-shared/src/main/java/com/termux/shared/shell/TermuxTerminalSessionClientBase.java b/termux-shared/src/main/java/com/termux/shared/terminal/TermuxTerminalSessionClientBase.java similarity index 97% rename from termux-shared/src/main/java/com/termux/shared/shell/TermuxTerminalSessionClientBase.java rename to termux-shared/src/main/java/com/termux/shared/terminal/TermuxTerminalSessionClientBase.java index ac5014c9..1f77eaa1 100644 --- a/termux-shared/src/main/java/com/termux/shared/shell/TermuxTerminalSessionClientBase.java +++ b/termux-shared/src/main/java/com/termux/shared/terminal/TermuxTerminalSessionClientBase.java @@ -1,4 +1,4 @@ -package com.termux.shared.shell; +package com.termux.shared.terminal; import com.termux.shared.logger.Logger; import com.termux.terminal.TerminalSession; From 1132028bd20cbff0691d8f1e2cace5f0864816c7 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Tue, 13 Apr 2021 16:34:24 +0500 Subject: [PATCH 3/5] Add TermuxTerminalViewClientBase to com.termux.shared.terminal package and extend that in TermuxTerminalViewClient --- .../terminal/TermuxTerminalViewClient.java | 41 +------ .../TermuxTerminalViewClientBase.java | 105 ++++++++++++++++++ 2 files changed, 107 insertions(+), 39 deletions(-) create mode 100644 termux-shared/src/main/java/com/termux/shared/terminal/TermuxTerminalViewClientBase.java diff --git a/app/src/main/java/com/termux/app/terminal/TermuxTerminalViewClient.java b/app/src/main/java/com/termux/app/terminal/TermuxTerminalViewClient.java index 39ca33d9..e906b01c 100644 --- a/app/src/main/java/com/termux/app/terminal/TermuxTerminalViewClient.java +++ b/app/src/main/java/com/termux/app/terminal/TermuxTerminalViewClient.java @@ -21,6 +21,7 @@ import android.widget.Toast; import com.termux.R; import com.termux.app.TermuxActivity; import com.termux.shared.shell.ShellUtils; +import com.termux.shared.terminal.TermuxTerminalViewClientBase; import com.termux.shared.termux.TermuxConstants; import com.termux.app.activities.ReportActivity; import com.termux.app.models.ReportInfo; @@ -35,7 +36,6 @@ import com.termux.shared.termux.TermuxUtils; import com.termux.terminal.KeyHandler; import com.termux.terminal.TerminalEmulator; import com.termux.terminal.TerminalSession; -import com.termux.view.TerminalViewClient; import java.util.Arrays; import java.util.Collections; @@ -44,7 +44,7 @@ import java.util.List; import androidx.drawerlayout.widget.DrawerLayout; -public class TermuxTerminalViewClient implements TerminalViewClient { +public class TermuxTerminalViewClient extends TermuxTerminalViewClientBase { final TermuxActivity mActivity; @@ -440,41 +440,4 @@ public class TermuxTerminalViewClient implements TerminalViewClient { session.getEmulator().paste(paste.toString()); } - - - @Override - public void logError(String tag, String message) { - Logger.logError(tag, message); - } - - @Override - public void logWarn(String tag, String message) { - Logger.logWarn(tag, message); - } - - @Override - public void logInfo(String tag, String message) { - Logger.logInfo(tag, message); - } - - @Override - public void logDebug(String tag, String message) { - Logger.logDebug(tag, message); - } - - @Override - public void logVerbose(String tag, String message) { - Logger.logVerbose(tag, message); - } - - @Override - public void logStackTraceWithMessage(String tag, String message, Exception e) { - Logger.logStackTraceWithMessage(tag, message, e); - } - - @Override - public void logStackTrace(String tag, Exception e) { - Logger.logStackTrace(tag, e); - } - } diff --git a/termux-shared/src/main/java/com/termux/shared/terminal/TermuxTerminalViewClientBase.java b/termux-shared/src/main/java/com/termux/shared/terminal/TermuxTerminalViewClientBase.java new file mode 100644 index 00000000..701582ad --- /dev/null +++ b/termux-shared/src/main/java/com/termux/shared/terminal/TermuxTerminalViewClientBase.java @@ -0,0 +1,105 @@ +package com.termux.shared.terminal; + +import android.view.KeyEvent; +import android.view.MotionEvent; + +import com.termux.shared.logger.Logger; +import com.termux.terminal.TerminalSession; +import com.termux.view.TerminalViewClient; + +public class TermuxTerminalViewClientBase implements TerminalViewClient { + + public TermuxTerminalViewClientBase() { + } + + @Override + public float onScale(float scale) { + return 1.0f; + } + + @Override + public void onSingleTapUp(MotionEvent e) { + } + + public boolean shouldBackButtonBeMappedToEscape() { + return false; + } + + public boolean shouldEnforceCharBasedInput() { + return false; + } + + public boolean shouldUseCtrlSpaceWorkaround() { + return false; + } + + @Override + public void copyModeChanged(boolean copyMode) { + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent e, TerminalSession session) { + return false; + } + + @Override + public boolean onKeyUp(int keyCode, KeyEvent e) { + return false; + } + + @Override + public boolean onLongPress(MotionEvent event) { + return false; + } + + @Override + public boolean readControlKey() { + return false; + } + + @Override + public boolean readAltKey() { + return false; + } + + @Override + public boolean onCodePoint(int codePoint, boolean ctrlDown, TerminalSession session) { + return false; + } + + @Override + public void logError(String tag, String message) { + Logger.logError(tag, message); + } + + @Override + public void logWarn(String tag, String message) { + Logger.logWarn(tag, message); + } + + @Override + public void logInfo(String tag, String message) { + Logger.logInfo(tag, message); + } + + @Override + public void logDebug(String tag, String message) { + Logger.logDebug(tag, message); + } + + @Override + public void logVerbose(String tag, String message) { + Logger.logVerbose(tag, message); + } + + @Override + public void logStackTraceWithMessage(String tag, String message, Exception e) { + Logger.logStackTraceWithMessage(tag, message, e); + } + + @Override + public void logStackTrace(String tag, Exception e) { + Logger.logStackTrace(tag, e); + } + +} From d19cf435be6f7f4456400bedde03be5f3ffcb7f1 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Tue, 13 Apr 2021 16:57:24 +0500 Subject: [PATCH 4/5] Add ".sh" extension to apt_info_script file --- .../main/res/raw/{apt_info_script. => apt_info_script.sh} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename termux-shared/src/main/res/raw/{apt_info_script. => apt_info_script.sh} (94%) diff --git a/termux-shared/src/main/res/raw/apt_info_script. b/termux-shared/src/main/res/raw/apt_info_script.sh similarity index 94% rename from termux-shared/src/main/res/raw/apt_info_script. rename to termux-shared/src/main/res/raw/apt_info_script.sh index 3319e9ba..4812c100 100644 --- a/termux-shared/src/main/res/raw/apt_info_script. +++ b/termux-shared/src/main/res/raw/apt_info_script.sh @@ -20,7 +20,7 @@ subscribed_repositories() { else echo "#### sources.list.d/$(basename "$filename")" fi - echo "\`$supl_sources\`" + echo "\`$supl_sources\` " fi done < <(find "@TERMUX_PREFIX@/etc/apt/sources.list.d" -maxdepth 1 ! -type d) } @@ -37,7 +37,7 @@ updatable_packages() { if [ -z "$updatable" ];then echo "All packages up to date" else - echo "\`$updatable\`" + echo $'```\n'"$updatable"$'\n```\n' fi fi } @@ -50,6 +50,7 @@ $(subscribed_repositories) ### Updatable Packages + $(updatable_packages) ## From ae1c9bacd6f58bf550cba28e9a0b66e969307a44 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Tue, 13 Apr 2021 16:58:18 +0500 Subject: [PATCH 5/5] Bump to v0.109 --- app/build.gradle | 4 ++-- terminal-emulator/build.gradle | 2 +- terminal-view/build.gradle | 2 +- termux-shared/build.gradle | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fc866cd5..7bcd6bed 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,8 +26,8 @@ android { applicationId "com.termux" minSdkVersion project.properties.minSdkVersion.toInteger() targetSdkVersion project.properties.targetSdkVersion.toInteger() - versionCode 108 - versionName "0.108" + versionCode 109 + versionName "0.109" manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.termux" manifestPlaceholders.TERMUX_APP_NAME = "Termux" diff --git a/terminal-emulator/build.gradle b/terminal-emulator/build.gradle index d899a96f..20232c65 100644 --- a/terminal-emulator/build.gradle +++ b/terminal-emulator/build.gradle @@ -59,7 +59,7 @@ publishing { bar(MavenPublication) { groupId 'com.termux' artifactId 'terminal-emulator' - version '0.106.1' + version '0.109' artifact("$buildDir/outputs/aar/terminal-emulator-release.aar") } } diff --git a/terminal-view/build.gradle b/terminal-view/build.gradle index b196e223..d83e8b83 100644 --- a/terminal-view/build.gradle +++ b/terminal-view/build.gradle @@ -37,7 +37,7 @@ publishing { bar(MavenPublication) { groupId 'com.termux' artifactId 'terminal-view' - version '0.106.1' + version '0.109' artifact("$buildDir/outputs/aar/terminal-view-release.aar") } } diff --git a/termux-shared/build.gradle b/termux-shared/build.gradle index a1523253..c01d8d6e 100644 --- a/termux-shared/build.gradle +++ b/termux-shared/build.gradle @@ -50,7 +50,7 @@ publishing { bar(MavenPublication) { groupId 'com.termux' artifactId 'termux-shared' - version '0.108' + version '0.109' artifact("$buildDir/outputs/aar/termux-shared-release.aar") } }