├── MODULE_LICENSE_APACHE2 ├── emulatorview ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── drawable-nodpi │ │ │ └── atari_small_nodpi.png │ │ └── java │ │ ├── jackpal │ │ └── androidterm │ │ │ └── emulatorview │ │ │ ├── package.html │ │ │ ├── GrowableIntArray.java │ │ │ ├── UpdateCallback.java │ │ │ ├── compat │ │ │ └── KeyCharacterMapCompat.java │ │ │ ├── TextStyle.java │ │ │ ├── EmulatorDebug.java │ │ │ ├── TextRenderer.java │ │ │ └── StyleRow.java │ │ └── com │ │ └── termoneplus │ │ ├── utils │ │ └── SimpleClipboardManager.java │ │ └── compat │ │ └── CharacterCompat.java └── build.gradle ├── samples ├── intents │ ├── .gitignore │ ├── lint.xml │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── dimens.xml │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ └── strings.xml │ │ │ ├── drawable │ │ │ │ └── background_rectangle.xml │ │ │ └── layout │ │ │ │ └── main.xml │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── telnet │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── layout │ │ │ │ ├── launch_activity.xml │ │ │ │ └── term_activity.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── jackpal │ │ │ └── androidterm │ │ │ └── sample │ │ │ └── telnet │ │ │ └── LaunchActivity.java │ └── build.gradle ├── pathbroadcasts │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── assets │ │ │ ├── .gitattributes │ │ │ ├── hello │ │ │ └── ls │ │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ │ └── AndroidManifest.xml │ └── build.gradle └── NOTE.pathbroadcasts ├── tests ├── issue145 │ ├── issue145repro.txt │ ├── issue145repro-2.txt │ ├── README.md │ └── fuzzer.go ├── controlSequences │ ├── hideCursor.txt │ ├── showCursor.txt │ ├── setTitle.txt │ ├── combiningChars.txt │ ├── combiningCharReplacement.txt │ └── textStyle.txt ├── reset ├── fullWidthText ├── emulatorview-test │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ └── values │ │ │ └── strings.xml │ ├── src │ │ └── jackpal │ │ │ └── androidterm │ │ │ └── emulatorview │ │ │ ├── ModifierKeyTest.java │ │ │ └── InputConnectionTest.java │ ├── AndroidManifest.xml │ └── proguard-project.txt ├── wideChars │ ├── last-column-wrapping.txt │ ├── linkification.txt │ ├── overwriting1.txt │ ├── overwriting4.txt │ ├── overwriting3.txt │ ├── overwriting2.txt │ ├── overwriting5.txt │ └── combining-chars.txt ├── .gitattributes ├── background-outofindex ├── background-lastline ├── echo-smiley ├── issue149 │ └── colors.go ├── cursor-up ├── cursor-down ├── cursor-down2 ├── cursor-up3 ├── cursor-down3 ├── cursor-up2 └── scroll-at-bottom-margin ├── libtermexec ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ ├── compat.h │ │ │ ├── registration.h │ │ │ ├── compat.c │ │ │ ├── termio.c │ │ │ └── registration.c │ │ ├── java │ │ │ ├── com │ │ │ │ └── termoneplus │ │ │ │ │ ├── TermIO.java │ │ │ │ │ └── Process.java │ │ │ └── jackpal │ │ │ │ └── androidterm │ │ │ │ └── TermExec.java │ │ └── aidl │ │ │ └── jackpal │ │ │ └── androidterm │ │ │ └── libtermexec │ │ │ └── v1 │ │ │ └── ITerminal.aidl │ └── CMakeLists.txt ├── proguard-rules.pro └── build.gradle ├── .gitignore ├── docs ├── termoneplus-logo.xcf ├── UTF-8-SMP-chars-demo.txt ├── termoneplus-launcher-icon.xcf ├── termoneplus-launcher-round_icon.xcf ├── termoneplus-notification-icon.svg ├── atari_small_notice.txt └── google-play-description ├── term ├── .gitignore ├── src │ ├── main │ │ ├── assets │ │ │ └── skel │ │ │ │ └── shrc │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-ldpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable │ │ │ │ ├── ic_stat_service_notification_icon.png │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── ic_close_24dp.xml │ │ │ │ ├── ic_email_white_24dp.xml │ │ │ │ ├── ic_vpn_key_white_24dp.xml │ │ │ │ ├── ic_add_circle_outline_24dp.xml │ │ │ │ ├── ic_help_outline_white_24dp.xml │ │ │ │ ├── background_rectangle.xml │ │ │ │ ├── ic_settings_white_24dp.xml │ │ │ │ ├── fs_directory_24dp.xml │ │ │ │ ├── fs_unknown_24dp.xml │ │ │ │ ├── fs_file_24dp.xml │ │ │ │ ├── ic_windows_white_24dp.xml │ │ │ │ ├── fs_parent_24dp.xml │ │ │ │ └── header_background.xml │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_stat_service_notification_icon.png │ │ │ ├── drawable-ldpi │ │ │ │ └── ic_stat_service_notification_icon.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_stat_service_notification_icon.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_stat_service_notification_icon.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_stat_service_notification_icon.png │ │ │ ├── values │ │ │ │ ├── id.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── attrs.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── defaults.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── values-night │ │ │ │ ├── styles.xml │ │ │ │ └── colors.xml │ │ │ ├── layout │ │ │ │ ├── actionbar_windowlist.xml │ │ │ │ ├── activity_preferences.xml │ │ │ │ ├── content_file_selection.xml │ │ │ │ ├── fragment_windowlist.xml │ │ │ │ ├── item_window.xml │ │ │ │ ├── pref_shell_script.xml │ │ │ │ ├── activity_term.xml │ │ │ │ ├── activity_term_floatbar.xml │ │ │ │ └── activity_file_selection.xml │ │ │ ├── drawable-v21 │ │ │ │ └── header_background.xml │ │ │ ├── menu │ │ │ │ └── main.xml │ │ │ ├── values-tr │ │ │ │ └── arrays.xml │ │ │ └── values-sv │ │ │ │ └── strings.xml │ │ ├── java │ │ │ ├── jackpal │ │ │ │ └── androidterm │ │ │ │ │ ├── BoundSession.java │ │ │ │ │ ├── TermView.java │ │ │ │ │ └── RunShortcut.java │ │ │ └── com │ │ │ │ └── termoneplus │ │ │ │ ├── TermActivity.java │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── WindowListFragment.java │ │ │ │ ├── utils │ │ │ │ ├── ThemeManager.java │ │ │ │ ├── ConsoleStartupScript.java │ │ │ │ └── WrapOpenURL.java │ │ │ │ ├── Permissions.java │ │ │ │ └── TermPreferencesActivity.java │ │ └── jni │ │ │ ├── appinfo.h │ │ │ ├── atomicio.c │ │ │ ├── socket.c │ │ │ └── appcmd.c │ └── CMakeLists.txt ├── lint.xml └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── version.gradle ├── NOTICE ├── .gitattributes ├── README.adoc ├── scripts ├── termoneplus-notification-resources.sh ├── termoneplus-launcher-foreground.sh └── termoneplus-launcher-resources.sh ├── gradle.properties └── gradlew.bat /MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /emulatorview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /samples/intents/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /samples/telnet/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /tests/issue145/issue145repro.txt: -------------------------------------------------------------------------------- 1 | 𬘴 2 | ( -------------------------------------------------------------------------------- /samples/pathbroadcasts/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /tests/issue145/issue145repro-2.txt: -------------------------------------------------------------------------------- 1 | 󂕁a8珮Ÿ蠟茤퓉�B›應Z -------------------------------------------------------------------------------- /libtermexec/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.externalNativeBuild 3 | /.cxx 4 | -------------------------------------------------------------------------------- /tests/controlSequences/hideCursor.txt: -------------------------------------------------------------------------------- 1 | [?25lThe cursor is now hidden. 2 | -------------------------------------------------------------------------------- /tests/controlSequences/showCursor.txt: -------------------------------------------------------------------------------- 1 | [?25hThe cursor is now visible. 2 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/assets/.gitattributes: -------------------------------------------------------------------------------- 1 | hello eol=lf 2 | ls eol=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | .DS_Store 4 | /build 5 | /.idea 6 | *.iml 7 | -------------------------------------------------------------------------------- /tests/reset: -------------------------------------------------------------------------------- 1 | ESC=$'\033' 2 | echo -n "${ESC}c" # // ESC c - RIS - Reset to Initial State 3 | -------------------------------------------------------------------------------- /tests/controlSequences/setTitle.txt: -------------------------------------------------------------------------------- 1 | ]0;I am a title\Window title should now be 'I am a title'. 2 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/assets/hello: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | echo "Hello, world!" 4 | exit 0 5 | -------------------------------------------------------------------------------- /docs/termoneplus-logo.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/docs/termoneplus-logo.xcf -------------------------------------------------------------------------------- /tests/fullWidthText: -------------------------------------------------------------------------------- 1 | Make sure UTF-8 is enabled. 2 | Full-width text: [ABC] 3 | Normal-width text: [ABC ] 4 | -------------------------------------------------------------------------------- /term/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | # Android Studio < 3.5 3 | /.externalNativeBuild 4 | # Android Studio >= 3.5 5 | /.cxx 6 | -------------------------------------------------------------------------------- /docs/UTF-8-SMP-chars-demo.txt: -------------------------------------------------------------------------------- 1 | These are some characters in the Supplementary Multilingual Plane: 2 | 𝄞 𝄴𝅘𝅥𝅯𝅗𝅥 𝑥𝄽 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /docs/termoneplus-launcher-icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/docs/termoneplus-launcher-icon.xcf -------------------------------------------------------------------------------- /docs/termoneplus-launcher-round_icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/docs/termoneplus-launcher-round_icon.xcf -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/assets/ls: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | echo "Hello, I'm pretending to be ls!" 4 | exec /system/bin/ls "$@" 5 | -------------------------------------------------------------------------------- /term/src/main/assets/skel/shrc: -------------------------------------------------------------------------------- 1 | # Note build-in shell startup script sets unconditionally variable PS1 2 | 3 | #PS1='$ ' 4 | #export PS1 5 | -------------------------------------------------------------------------------- /term/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-ldpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-ldpi/ic_launcher_round.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /emulatorview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/tests/emulatorview-test/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/tests/emulatorview-test/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/tests/emulatorview-test/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/tests/emulatorview-test/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /emulatorview/src/main/res/drawable-nodpi/atari_small_nodpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/emulatorview/src/main/res/drawable-nodpi/atari_small_nodpi.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':term' 2 | include ':libtermexec' 3 | include ':emulatorview' 4 | include ':samples:intents' 5 | include ':samples:pathbroadcasts' 6 | include ':samples:telnet' 7 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/drawable/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Emulatorview-testTest 5 | 6 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Deprecated: Path Broadcast 4 | 5 | -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/drawable-hdpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/drawable-ldpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/drawable-mdpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/drawable-xhdpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xxhdpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MuntashirAkon/termoneplus/HEAD/term/src/main/res/drawable-xxhdpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /samples/intents/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /libtermexec/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /tests/wideChars/last-column-wrapping.txt: -------------------------------------------------------------------------------- 1 | A line taking 81 screen columns, with an East Asian wide character at column 79 2 | (should be truncated or wrapped on an 80-column terminal): 3 | 4 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好 5 | -------------------------------------------------------------------------------- /term/src/main/res/values/id.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/controlSequences/combiningChars.txt: -------------------------------------------------------------------------------- 1 | a combining grave accent: à 2 | a combining grave accent combining low line: à̲ 3 | a combining enclosing circle backslash: à̲⃠ 4 | musical symbol g clef: 𝄞 5 | 6 | a combining grave accent combining low line at the end of an 80-column line: à̲ 7 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /samples/telnet/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /tests/wideChars/linkification.txt: -------------------------------------------------------------------------------- 1 | A link on a line with East Asian wide characters: 2 | 中国国际航空公司 http://www.airchina.com/ 3 | 4 | A link on a long line with East Asian wide characters (the link should be 5 | wrapped across two lines on an 80-column terminal): 6 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 中国国际航空公司 http://www.airchina.com/ 7 | -------------------------------------------------------------------------------- /term/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /term/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/termoneplus-notification-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | >1+ 6 | 7 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/drawable/background_rectangle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /term/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/.gitattributes: -------------------------------------------------------------------------------- 1 | # test shell script must have unix(LF) end-of-line conversion 2 | background-lastline text eol=lf 3 | background-outofindex text eol=lf 4 | cursor-down text eol=lf 5 | cursor-down2 text eol=lf 6 | cursor-down3 text eol=lf 7 | cursor-up text eol=lf 8 | cursor-up2 text eol=lf 9 | cursor-up3 text eol=lf 10 | echo-smiley text eol=lf 11 | reset text eol=lf 12 | scroll-at-bottom-margin text eol=lf 13 | -------------------------------------------------------------------------------- /tests/background-outofindex: -------------------------------------------------------------------------------- 1 | # https://gitlab.com/termapps/termoneplus/issues/19 2 | # Expected : ignore sequence and continue output with current background 3 | # Result : crash 4 | 5 | ESC=$'\033' 6 | CSI="${ESC}[" 7 | RST="${CSI}m" 8 | 9 | # output four lines with background color #160(hex): 10 | echo "${CSI}48;5;196m"L1 11 | echo "${CSI}48;5;256m"L2 # incorrect 12 | echo "${CSI}48;5;260m"L3 # crash 13 | echo L4"${RST}" 14 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/background-lastline: -------------------------------------------------------------------------------- 1 | # https://gitlab.com/termapps/termoneplus/issues/14 2 | # Remark : repeat test until last line is scrolled 3 | # Expected : default background from ':' until end of line 4 | # Result : background with color #160 5 | 6 | ESC=$'\033' 7 | CSI="${ESC}[" 8 | RST="${CSI}m" 9 | 10 | # 6 × 6 × 6 cube (0 ≤ r, g, b ≤ 5) 11 | color=196 # 16 + 36 * {r} + 6 * {g} + {b} 12 | 13 | echo "${CSI}48;5;${color}mL1" 14 | echo "L2${RST}:" 15 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_close_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /version.gradle: -------------------------------------------------------------------------------- 1 | tasks.named('wrapper') { 2 | gradleVersion = '6.8.1' 3 | distributionSha256Sum = 'fd591a34af7385730970399f473afabdb8b28d57fd97d6625c388d090039d6fd' 4 | } 5 | /* Notes for distributionSha256Sum 6 | Android Studio 3.5 explicitly require checksum to be removed, see 7 | https://github.com/gradle/gradle/issues/9361 ! 8 | Restored for Android Studio 3.5.2, see 9 | https://issuetracker.google.com/issues/129261435 ! 10 | */ 11 | -------------------------------------------------------------------------------- /docs/atari_small_notice.txt: -------------------------------------------------------------------------------- 1 | COMMENT Copyright (c) 1999, Thomas A. Fine 2 | COMMENT 3 | COMMENT License to copy, modify, and distribute for both commercial and 4 | COMMENT non-commercial use is herby granted, provided this notice 5 | COMMENT is preserved. 6 | COMMENT 7 | COMMENT Email to my last name at head.cfa.harvard.edu 8 | COMMENT http://hea-www.harvard.edu/~fine/ 9 | COMMENT 10 | COMMENT Produced with bdfedit, a tcl/tk font editing program 11 | COMMENT written by Thomas A. Fine -------------------------------------------------------------------------------- /term/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 8dp 4 | 4dp 5 | 16dp 6 | 7 | 16dp 8 | 16dp 9 | 16dp 10 | 11 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_email_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /tests/echo-smiley: -------------------------------------------------------------------------------- 1 | # print "rolling on the floor laughing" emoji 2 | # UTF-8: \xf0\x9f\xa4\xa3 3 | # UTF-32: u+0001f923 4 | 5 | k=${1-263} 6 | while test $k -gt 0 ; do 7 | #printf '\U01F923' # format not supported 8 | #printf '\xf0\x9f\xa4\xa3' # command not found (toolbox) 9 | echo -n '🤣' 10 | 11 | # To reproduce issue #25 output from regression test 12 | # must ensure terminal to draw characters one by one! 13 | sleep 1 14 | 15 | #k=`expr $k - 1` # command not found (toolbox) 16 | ((k=$k-1)) 17 | done 18 | -------------------------------------------------------------------------------- /tests/emulatorview-test/src/jackpal/androidterm/emulatorview/ModifierKeyTest.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview; 2 | 3 | import android.test.AndroidTestCase; 4 | // import android.view.KeyEvent; 5 | 6 | public class ModifierKeyTest extends AndroidTestCase { 7 | 8 | public void testCtrlKey() { 9 | // ModifierKey mk = new ModifierKey(KeyEvent.KEYCODE_CTRL_LEFT); 10 | // assertFalse(mk.isActive()); 11 | // mk.handleModifierKey(KeyEvent.KEYCODE_CTRL_LEFT, true); 12 | // assertTrue(mk.isActive()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_vpn_key_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_add_circle_outline_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /tests/controlSequences/combiningCharReplacement.txt: -------------------------------------------------------------------------------- 1 | Overwriting a letter with combining diacritic with a letter without in an 2 | 80-column line: 3 | 4 | xxxxxMu[combining diaeresis]nchenxxx[...] ESC [ 7 G u: 5 | xxxxxMünchenxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxu 6 | 7 | Overwriting a letter without combining diacritic with a letter with combining diacritic in an 80-column line: 8 | 9 | xxxxMunchenxxx[...] ESC [ 6 G u [combining diaeresis]: 10 | xxxxMunchenxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxü 11 | -------------------------------------------------------------------------------- /tests/issue149/colors.go: -------------------------------------------------------------------------------- 1 | // Generate a repatable string of characters for fuzz testing. 2 | 3 | package main 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func setFore(c int) { 10 | fmt.Printf("\x1b[38;5;%dm", c) 11 | } 12 | 13 | func setBack(c int) { 14 | fmt.Printf("\x1b[48;5;%dm", c) 15 | } 16 | 17 | func main() { 18 | /* 19 | for i := 0; i < 255; i++ { 20 | setFore(i) 21 | fmt.Printf("Fore Color %d \n", i) 22 | } 23 | setFore(0) 24 | */ 25 | 26 | for i := 0; i < 255; i++ { 27 | setBack(i) 28 | fmt.Printf("Back Color %d \n", i) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/emulatorview-test/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting1.txt: -------------------------------------------------------------------------------- 1 | Overwriting an East Asian wide character with another one: 2 | 3 | 中国 ESC [ 2 D 文: 4 | 中国文 5 | 6 | xxx中文 ESC [ 2 D 国: 7 | xxx中文国 8 | 9 | Overwriting an East Asian wide character with another one, in the middle of 10 | an 80-column line with mixed narrow and wide chars: 11 | 12 | xxx[...]xxx中文xxx[...]xxx你好ESC [ 23 G 国: 13 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好国 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好xESC [ 23 G 国: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x国 17 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting4.txt: -------------------------------------------------------------------------------- 1 | Overwriting a narrow character with an East Asian wide character: 2 | 3 | xxx ESC [ D 中: 4 | xxx中 5 | 6 | xxx ESC [ 3 D 中: 7 | xxx中 8 | 9 | Overwriting a narrow character with an East Asian wide character, in the middle 10 | of an 80-column line with mixed narrow and wide chars: 11 | 12 | xxx[...]xxx中文xxx[...]xxx你好xESC [ 25 G 版: 13 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x版 14 | 15 | xxx[...]xxx中文y。xxx[...]xxx你好ESC [ 25 G 版: 16 | xxxxxxxxxxxxxxxxxxxx中文y。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好版 17 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting3.txt: -------------------------------------------------------------------------------- 1 | Overwriting an East Asian wide character with a narrow character: 2 | 3 | 中国 ESC [ 2 D x: 4 | 中国x 5 | 6 | xxx中文 ESC [ 2 D x: 7 | xxx中文x 8 | 9 | Overwriting an East Asian wide character with a narrow character, in the middle 10 | of an 80-column line with mixed narrow and wide chars: 11 | 12 | xxx[...]xxx中文xxx[...]xxx你好xESC [ 23 G y: 13 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好xy 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好ESC [ 23 G y: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好y 17 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting2.txt: -------------------------------------------------------------------------------- 1 | Inserting an East Asian wide character into the middle of another one: 2 | 3 | 中国 ESC [ D 文: 4 | 中国文 5 | 6 | xxx中文 ESC [ D 国: 7 | xxx中文国 8 | 9 | Inserting an East Asian wide character into the middle of another one, in the 10 | middle of an 80-column line with mixed narrow and wide chars: 11 | 12 | xxx[...]xxx中文xxx[...]xxx你好xESC [ 24 G 国: 13 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x国 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G 国: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好国 17 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting5.txt: -------------------------------------------------------------------------------- 1 | Inserting a narrow character into the middle of an East Asian wide character: 2 | 3 | 中国 ESC [ D x: 4 | 中国x 5 | 6 | xxx中文 ESC [ D x: 7 | xxx中文x 8 | 9 | Inserting a narrow character into the middle of an East Asian wide character, 10 | in the middle of an 80-column line with mixed narrow and wide chars: 11 | 12 | xxx[...]xxx中文xxx[...]xxx你好xESC [ 24 G y: 13 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好xy 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G y: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好y 17 | -------------------------------------------------------------------------------- /tests/cursor-up: -------------------------------------------------------------------------------- 1 | ESC=$'\033' 2 | CSI="${ESC}[" 3 | 4 | # // ESC [ Pn J - ED - Erase in Display 5 | echo -n "${CSI}2J" # // Clear all 6 | 7 | # // Esc [ Pn ; Pn r - set top and bottom margins 8 | echo -n "${CSI}4;7r" 9 | 10 | # // ESC [ Pn ; H - Cursor Position 11 | echo -n "${CSI}4;1H" # at top margins 12 | 13 | 14 | # // ESC [ Pn A - Cursor Up 15 | echo -n "L1${CSI}AL2" 16 | 17 | sleep 1; echo text1 18 | sleep 1; echo text2 19 | sleep 1; echo text3 20 | 21 | #expected screen: 22 | # 23 | # 24 | # 25 | #L1L2text1 26 | #text2 27 | #text3 28 | # 29 | #<... empty lines ...> 30 | -------------------------------------------------------------------------------- /tests/cursor-down: -------------------------------------------------------------------------------- 1 | ESC=$'\033' 2 | CSI="${ESC}[" 3 | 4 | # // ESC [ Pn J - ED - Erase in Display 5 | echo -n "${CSI}2J" # // Clear all 6 | 7 | # // Esc [ Pn ; Pn r - set top and bottom margins 8 | echo -n "${CSI}4;7r" 9 | 10 | # // ESC [ Pn ; H - Cursor Position 11 | echo -n "${CSI}7;1H" # at bottom margins 12 | 13 | 14 | # // ESC [ Pn B - Cursor Down 15 | echo -n "L1${CSI}BL2" 16 | 17 | sleep 1; echo text1 18 | sleep 1; echo text2 19 | sleep 1; echo text3 20 | 21 | #expected screen: 22 | # 23 | # 24 | # 25 | #L1L2text1 26 | #text2 27 | #text3 28 | # 29 | #<... empty lines ...> 30 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

This package provides a fairly complete VT100 terminal emulator {@link 4 | jackpal.androidterm.emulatorview.TermSession TermSession} and a corresponding 5 | Android view {@link jackpal.androidterm.emulatorview.EmulatorView EmulatorView}. 6 | 7 |

Most users will create a TermSession, connect it to an {@link 8 | java.io.InputStream InputStream} and {@link java.io.OutputStream OutputStream} 9 | from the emulation client, then instantiate the EmulatorView and 10 | add it to an activity's layout. 11 | 12 | 13 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_help_outline_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /tests/cursor-down2: -------------------------------------------------------------------------------- 1 | ESC=$'\033' 2 | CSI="${ESC}[" 3 | 4 | # // ESC [ Pn J - ED - Erase in Display 5 | echo -n "${CSI}2J" # // Clear all 6 | 7 | # // Esc [ Pn ; Pn r - set top and bottom margins 8 | echo -n "${CSI}4;7r" 9 | 10 | # // ESC [ Pn ; H - Cursor Position 11 | echo -n "${CSI}2;1H" # above top margin 12 | 13 | 14 | # // ESC [ Pn B - Cursor Down 15 | echo -n "L1${CSI}6BL2" # stop at bottom margin! 16 | 17 | sleep 1; echo text1 18 | sleep 1; echo text2 19 | sleep 1; echo text3 20 | 21 | #expected screen: 22 | # 23 | #L1 24 | # 25 | # L2text1 26 | #text2 27 | #text3 28 | # 29 | #<... empty lines ...> 30 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2005-2008, The Android Open Source Project 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /tests/cursor-up3: -------------------------------------------------------------------------------- 1 | ESC=$'\033' 2 | CSI="${ESC}[" 3 | 4 | # // ESC [ Pn J - ED - Erase in Display 5 | echo -n "${CSI}2J" # // Clear all 6 | 7 | # // Esc [ Pn ; Pn r - set top and bottom margins 8 | echo -n "${CSI}4;7r" 9 | 10 | # // ESC [ Pn ; H - Cursor Position 11 | echo -n "${CSI}8;1H" # below bottom margin 12 | 13 | 14 | # // ESC [ Pn A - Cursor Up 15 | echo -n "L1${CSI}6AL2" # stop at top margin 16 | 17 | sleep 1; echo text1 18 | sleep 1; echo text2 19 | sleep 1; echo text3 20 | sleep 2; echo text4 21 | 22 | #expected screen: 23 | # 24 | # 25 | # 26 | #text2 27 | #text3 28 | #text4 29 | # 30 | #L1 31 | #<... empty lines ...> 32 | -------------------------------------------------------------------------------- /tests/issue145/README.md: -------------------------------------------------------------------------------- 1 | This directory contains files to help reproduce issue 145 2 | 3 | fuzzer.go generates random strings of UTF-encoded characters. 4 | 5 | issue145repro.txt - some text from a run of fuzzer.go. 6 | 7 | Created by ./fuzzer | head -c 983 | tail -c 6 >issue145repro.txt 8 | 9 | This is a minimal repro case for 10 | 11 | https://github.com/jackpal/Android-Terminal-Emulator/issues/145 12 | 13 | Repro steps 14 | ----------- 15 | 16 | On a PC: 17 | 18 | adb shell mkdir /data/local 19 | adb push issue145repro.txt /data/local/issue145repro.txt 20 | 21 | Run ATE 22 | 23 | Configure ATE's preferences for UTF8 24 | 25 | On ATE: 26 | 27 | cat /data/local/issue145repro.txt 28 | -------------------------------------------------------------------------------- /tests/cursor-down3: -------------------------------------------------------------------------------- 1 | ESC=$'\033' 2 | CSI="${ESC}[" 3 | 4 | # // ESC [ Pn J - ED - Erase in Display 5 | echo -n "${CSI}2J" # // Clear all 6 | 7 | # // Esc [ Pn ; Pn r - set top and bottom margins 8 | echo -n "${CSI}4;7r" 9 | 10 | # // ESC [ Pn ; H - Cursor Position 11 | echo -n "${CSI}8;1H" # below bottom margin 12 | 13 | 14 | # // ESC [ Pn B - Cursor Down 15 | echo -n "L1${CSI}BL2" 16 | 17 | sleep 1; echo text1 18 | sleep 1; echo text2 19 | sleep 1; echo text3 20 | 21 | #expected screen: 22 | # 23 | # 24 | # 25 | # 26 | # 27 | # 28 | #L1 29 | # L2text1 30 | #text2 31 | #text3 32 | # 33 | #<... empty lines ...> 34 | -------------------------------------------------------------------------------- /samples/telnet/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | TermOnePlus(sample): Telnet 4 | Open shell 5 | Connect 6 | Telnet to: 7 | Send 8 | This example Telnet client demonstrates the use of the EmulatorView widget and the TermSession class. 9 | 10 | 11 | telehack.com 12 | 13 | -------------------------------------------------------------------------------- /tests/cursor-up2: -------------------------------------------------------------------------------- 1 | ESC=$'\033' 2 | CSI="${ESC}[" 3 | 4 | # // ESC [ Pn J - ED - Erase in Display 5 | echo -n "${CSI}2J" # // Clear all 6 | 7 | # // Esc [ Pn ; Pn r - set top and bottom margins 8 | echo -n "${CSI}4;7r" 9 | 10 | # // ESC [ Pn ; H - Cursor Position 11 | echo -n "${CSI}2;1H" # above top margin 12 | 13 | 14 | # // ESC [ Pn A - Cursor Up 15 | echo -n "L1${CSI}AL2" 16 | 17 | sleep 1; echo text1 18 | sleep 1; echo text2 19 | sleep 1; echo text3 20 | sleep 1; echo text4 21 | sleep 1; echo text5 22 | sleep 1; echo text6 23 | sleep 1; echo text7 24 | 25 | #expected screen: 26 | # L2text1 27 | #text2 28 | #text3 29 | #text5 30 | #text6 31 | #text7 32 | # 33 | #<... empty lines ...> 34 | -------------------------------------------------------------------------------- /tests/issue145/fuzzer.go: -------------------------------------------------------------------------------- 1 | // Generate a repatable string of characters for fuzz testing. 2 | 3 | package main 4 | 5 | import ( 6 | "fmt" 7 | "math/rand" 8 | "unicode" 9 | ) 10 | 11 | func main() { 12 | source := rand.NewSource(17) 13 | r := rand.New(source) 14 | 15 | for { 16 | switch r.Intn(4) { 17 | case 0: 18 | if r.Intn(20) == 0 { 19 | fmt.Printf("\n") 20 | } else { 21 | out(r, 32, 128) 22 | } 23 | case 1: 24 | out(r, 128, 256) 25 | case 2: 26 | out(r, 256, 0x10000) 27 | default: 28 | out(r, 0x10000, unicode.MaxRune) 29 | } 30 | } 31 | } 32 | 33 | func out(r *rand.Rand, begin, end int) { 34 | var c rune 35 | c = (rune)(r.Intn(end-begin) + begin) 36 | fmt.Printf("%c", c) 37 | } 38 | -------------------------------------------------------------------------------- /libtermexec/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/uniqa/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/GrowableIntArray.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview; 2 | 3 | class GrowableIntArray { 4 | GrowableIntArray(int initalCapacity) { 5 | mData = new int[initalCapacity]; 6 | mLength = 0; 7 | } 8 | 9 | void append(int i) { 10 | if (mLength + 1 > mData.length) { 11 | int newLength = Math.max((mData.length * 3) >> 1, 16); 12 | int[] temp = new int[newLength]; 13 | System.arraycopy(mData, 0, temp, 0, mLength); 14 | mData = temp; 15 | } 16 | mData[mLength++] = i; 17 | } 18 | 19 | int length() { 20 | return mLength; 21 | } 22 | 23 | int at(int index) { 24 | return mData[index]; 25 | } 26 | 27 | int[] mData; 28 | int mLength; 29 | } 30 | -------------------------------------------------------------------------------- /tests/emulatorview-test/src/jackpal/androidterm/emulatorview/InputConnectionTest.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview; 2 | 3 | import android.test.AndroidTestCase; 4 | // import android.test.mock.MockApplication; 5 | // import android.test.mock.MockContext; 6 | // import android.util.DisplayMetrics; 7 | // import android.view.inputmethod.InputConnection; 8 | 9 | public class InputConnectionTest extends AndroidTestCase { 10 | 11 | public InputConnectionTest() { 12 | super(); 13 | } 14 | 15 | public void testBackSpace() { 16 | // MockContext cn = new MockContext(); 17 | // MockApplication a = new MockApplication(); 18 | // TermSession ts = new TermSession(); 19 | // DisplayMetrics m = new DisplayMetrics(); 20 | // EmulatorView e = new EmulatorView(cn, ts, m); 21 | // InputConnection c = e.onCreateInputConnection(null); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize line endings for text files. 2 | # This only affects how files are stored within the repo. Git will 3 | # automatically convert line endings to the platform choice when checking out, 4 | # and automatically convert them back to the normal form when checking in. 5 | 6 | * text=auto 7 | 8 | # Ensure XML files are treated a text files. 9 | 10 | *.xml text 11 | 12 | # Use java diff syntax for java files. 13 | 14 | *.java diff=java 15 | 16 | # Declare files that will always have CRLF line endings on checkout. 17 | *.bat text eol=crlf 18 | 19 | # shell files have unix(LF) end-of-line conversion 20 | 21 | *.sh text eol=lf 22 | 23 | # gradle wrapper shell script must have unix(LF) end-of-line conversion 24 | 25 | gradlew eol=lf 26 | 27 | # skeleton files must have end-of-line conversion as shell script, i.e. unix(LF) 28 | 29 | /**/assets/skel/* eol=lf 30 | -------------------------------------------------------------------------------- /tests/emulatorview-test/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /term/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /emulatorview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion project.ext.compileSdkVersion 5 | buildToolsVersion project.ext.buildToolsVersion 6 | defaultConfig { 7 | minSdkVersion project.ext.minSdkVersion 8 | targetSdkVersion project.ext.targetSdkVersion 9 | 10 | //Major.Minor.Patch 11 | versionCode 10601 12 | versionName '1.6.1' 13 | } 14 | compileOptions { 15 | sourceCompatibility JavaVersion.VERSION_1_8 16 | targetCompatibility JavaVersion.VERSION_1_8 17 | } 18 | productFlavors { 19 | } 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation "androidx.annotation:annotation:1.1.0" 30 | } 31 | -------------------------------------------------------------------------------- /tests/controlSequences/textStyle.txt: -------------------------------------------------------------------------------- 1 | Text style test 2 | normal: text 3 | bold: text 4 | faint: text 5 | italic: text (may show as inverse) 6 | underline: text 7 | blink: text (may show as bold) 8 | 6: text 9 | inverse: text 10 | invisible: text 11 | bold-underline: text 12 | bold-ul-inverse: text 13 | invis-bold-ul: text 14 | invis-bold-ul-invrs: text 15 | everything: text 16 | Reset bold/faint: texttexttext 17 | Reset bold/faint: texttext 18 | Reset bold/faint: texttext 19 | dim colors: red on green 20 | bright colors: red on green 21 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | Terminal Emulator for Android 2 | ============================= 3 | 4 | https://termoneplus.com/ 5 | 6 | *"TermOne Plus"* is an Android application that turns your Android device into an computer terminal. It is successor of abandoned Jack Palevich's terminal emulator. 7 | 8 | Terminal is useful for accessing the command line shell (built into every Android phone) or use custom one (installed separately). 9 | This allows you to run various command line utilities. 10 | It emulates a reasonably large subset of Digital Equipment Corporation VT-100 terminal codes. 11 | Supported terminal types include *vt100*, *screen* (default), *linux* and *xterm*. 12 | As result console programs like *ssh* (PKIX-SSH), *vi* (unix visual editor), *emacs*, *mc* (Midnight Commander file manager), *nano* (Nano's ANOther editor), and other work smoothly. 13 | 14 | Code of "TermOne Plus" is hosted in https://gitlab.com/termapps/termoneplus[public repository]. 15 | -------------------------------------------------------------------------------- /samples/intents/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /samples/telnet/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion project.ext.compileSdkVersion 5 | buildToolsVersion project.ext.buildToolsVersion 6 | defaultConfig { 7 | applicationId "com.termoneplus.sample.telnet" 8 | minSdkVersion project.ext.minSdkVersion 9 | targetSdkVersion project.ext.targetSdkVersion 10 | 11 | versionCode 210 12 | versionName '2.1.0' 13 | } 14 | compileOptions { 15 | sourceCompatibility JavaVersion.VERSION_1_8 16 | targetCompatibility JavaVersion.VERSION_1_8 17 | } 18 | productFlavors { 19 | } 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation project(':emulatorview') 30 | implementation 'androidx.appcompat:appcompat:1.3.0-beta01' 31 | } 32 | -------------------------------------------------------------------------------- /libtermexec/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright (C) 2018-2019 Roumen Petrov. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | ## 16 | 17 | cmake_minimum_required(VERSION 2.4) 18 | 19 | add_library( 20 | term-system 21 | SHARED 22 | main/cpp/registration.c 23 | main/cpp/process.c 24 | main/cpp/termio.c 25 | main/cpp/compat.c 26 | ) 27 | target_link_libraries( 28 | term-system 29 | log 30 | ) 31 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/UpdateCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package jackpal.androidterm.emulatorview; 18 | 19 | /** 20 | * Generic callback to be invoked to notify of updates. 21 | */ 22 | public interface UpdateCallback { 23 | /** 24 | * Callback function to be invoked when an update happens. 25 | */ 26 | void onUpdate(); 27 | } 28 | -------------------------------------------------------------------------------- /term/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/background_rectangle.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /term/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | #FF121212 20 | #FF121212 21 | #FFC89666 22 | @android:color/white 23 | #FFBEBEBE 24 | 25 | -------------------------------------------------------------------------------- /samples/NOTE.pathbroadcasts: -------------------------------------------------------------------------------- 1 | DEPRECATION: 2 | 3 | Functionality that uses "broadcasts" to collect extra paths with shell commands is deprecated. 4 | 5 | 1) It collects only one path for "prepend" and only one for "append" to the system PATH. Winner is last received. 6 | 2) It is used only in normal start of terminal session but not if terminal is opened from external applications. 7 | 3) Collection of "extra" path components slow down opening of normal sessions. 8 | 4) Applications that run on Android 8.0 (Oreo, API Level 26) or higher no longer receive implicit broadcasts registered in their manifest. 9 | 10 | In transition period "broadcast" functionality will be restricted only to applications signed with the same certificate, i.e. "SecureBox". 11 | 12 | 13 | FUTURE: 14 | Broadcasts based path collection will be replaced with one action based. 15 | External application, according to permissions, could send one or more path components. 16 | "TermOne Plus" activity will allow user to position paths sent in PATH variable. 17 | Also activity will allows user to ignore or delete a path component. 18 | -------------------------------------------------------------------------------- /term/src/main/res/layout/actionbar_windowlist.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/BoundSession.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm; 2 | 3 | import android.os.ParcelFileDescriptor; 4 | import android.text.TextUtils; 5 | import jackpal.androidterm.util.TermSettings; 6 | 7 | 8 | class BoundSession extends GenericTermSession { 9 | private final String issuerTitle; 10 | 11 | private boolean fullyInitialized; 12 | 13 | BoundSession(ParcelFileDescriptor ptmxFd, TermSettings settings, String issuerTitle) { 14 | super(ptmxFd, settings, true); 15 | 16 | this.issuerTitle = issuerTitle; 17 | } 18 | 19 | @Override 20 | public String getTitle() { 21 | final String extraTitle = super.getTitle(); 22 | 23 | return TextUtils.isEmpty(extraTitle) 24 | ? issuerTitle 25 | : issuerTitle + " — " + extraTitle; 26 | } 27 | 28 | @Override 29 | public void initializeEmulator(int columns, int rows) { 30 | super.initializeEmulator(columns, rows); 31 | 32 | fullyInitialized = true; 33 | } 34 | 35 | @Override 36 | boolean isFailFast() { 37 | return !fullyInitialized; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion project.ext.compileSdkVersion 5 | buildToolsVersion project.ext.buildToolsVersion 6 | defaultConfig { 7 | applicationId "com.termoneplus.sample.pathbroadcasts" 8 | minSdkVersion project.ext.minSdkVersion 9 | targetSdkVersion project.ext.targetSdkVersion 10 | 11 | versionCode 210 12 | versionName '2.1.0' 13 | 14 | // TermOnePlus applicationId 15 | manifestPlaceholders = [ termApplicationId:"com.termoneplus"] 16 | buildConfigField("String", "TERM_APPLICATION_ID", "\"com.termoneplus\"") 17 | } 18 | compileOptions { 19 | sourceCompatibility JavaVersion.VERSION_1_8 20 | targetCompatibility JavaVersion.VERSION_1_8 21 | } 22 | productFlavors { 23 | } 24 | buildTypes { 25 | release { 26 | minifyEnabled false 27 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 28 | } 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation project(':emulatorview') 34 | } 35 | -------------------------------------------------------------------------------- /term/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright (C) 2019 Roumen Petrov. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | ## 16 | 17 | cmake_minimum_required(VERSION 2.4) 18 | 19 | add_executable( 20 | libexec-t1plus.so 21 | main/jni/appcmd.c 22 | main/jni/socket.c 23 | main/jni/atomicio.c 24 | ) 25 | target_compile_definitions( 26 | libexec-t1plus.so 27 | PRIVATE 28 | PACKAGE_NAME="${APPLICATION_ID}" 29 | ) 30 | target_compile_options( 31 | libexec-t1plus.so 32 | PRIVATE 33 | -fPIC 34 | ) 35 | target_link_libraries( 36 | libexec-t1plus.so 37 | -pie 38 | ) 39 | -------------------------------------------------------------------------------- /samples/telnet/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_settings_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /samples/intents/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion project.ext.compileSdkVersion 5 | buildToolsVersion project.ext.buildToolsVersion 6 | defaultConfig { 7 | applicationId "com.termoneplus.sample.intents" 8 | minSdkVersion project.ext.minSdkVersion 9 | targetSdkVersion project.ext.targetSdkVersion 10 | 11 | versionCode 210 12 | versionName '2.1.0' 13 | 14 | // TermOnePlus applicationId 15 | manifestPlaceholders = [ termApplicationId:"com.termoneplus"] 16 | buildConfigField("String", "TERM_APPLICATION_ID", "\"com.termoneplus\"") 17 | } 18 | compileOptions { 19 | sourceCompatibility JavaVersion.VERSION_1_8 20 | targetCompatibility JavaVersion.VERSION_1_8 21 | } 22 | productFlavors { 23 | } 24 | buildTypes { 25 | release { 26 | minifyEnabled false 27 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 28 | } 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation 'androidx.appcompat:appcompat:1.3.0-beta01' 34 | implementation 'com.google.android.material:material:1.3.0-rc01' 35 | } 36 | -------------------------------------------------------------------------------- /tests/scroll-at-bottom-margin: -------------------------------------------------------------------------------- 1 | BS=$'\010' 2 | ESC=$'\033' 3 | CSI="${ESC}[" 4 | 5 | # // Esc [ Pn ; Pn r - set top and bottom margins 6 | echo -n "${CSI}1;10r" 7 | 8 | # Select default (ISO 8859-1 mapping) 9 | echo -n "${ESC}(B" 10 | 11 | # Select Graphic Rendition / Default foreground and background color 12 | echo -n "${CSI}39;49m" 13 | 14 | # Set foreground color / White 15 | echo -n "${CSI}37m" 16 | 17 | # Set background color / Black 18 | echo -n "${CSI}40m" 19 | 20 | # Cursor Position 21 | echo -n "${CSI}H" 22 | 23 | # Erase in Display / clear entire screen(2) 24 | echo -n "${CSI}2J" 25 | 26 | # Cursor Position / 3x3 27 | echo -n "${CSI}3;3H" 28 | 29 | echo -n "X" 30 | 31 | # Cursor Horizontal Absolute / 9 32 | echo -n "${CSI}9G" 33 | 34 | echo -n "Z" 35 | 36 | # // Esc [ Pn ; Pn r - set top and bottom margins 37 | echo -n "${CSI}1;5r" 38 | 39 | # Cursor Position / 5x1 40 | echo -n "${CSI}5;1H" 41 | 42 | echo -n o 43 | 44 | sleep 2 # wait before to scroll (better visibility) 45 | 46 | # expected is White on Black line on scroll 47 | echo 48 | 49 | # move down to avoid shell prompt to override line 50 | # // ESC [ Pn B - Cursor Down 51 | echo -n "${CSI}B" 52 | 53 | sleep 2 # wait before to exit (better visibility) 54 | -------------------------------------------------------------------------------- /libtermexec/src/main/cpp/compat.h: -------------------------------------------------------------------------------- 1 | #ifndef TERMONEPLUS_COMPAT_H 2 | #define TERMONEPLUS_COMPAT_H 3 | /* 4 | * Copyright (C) 2018 Roumen Petrov. All rights reserved. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * NAME 21 | * closefrom -- delete open file descriptors 22 | * 23 | * SYNOPSIS 24 | * void closefrom(int lowfd); 25 | * 26 | * DESCRIPTION 27 | * The closefrom() system call deletes all open file descriptors greater 28 | * than or equal to lowfd from the per-process object reference table. Any 29 | * errors encountered while closing file descriptors are ignored. 30 | */ 31 | void closefrom(int lowfd); 32 | 33 | #endif /* ndef TERMONEPLUS_COMPAT_H */ 34 | -------------------------------------------------------------------------------- /term/src/main/res/layout/activity_preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 17 | 18 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /term/src/main/java/com/termoneplus/TermActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018-2019 Roumen Petrov. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.termoneplus; 18 | 19 | import android.content.SharedPreferences; 20 | 21 | import com.termoneplus.utils.ThemeManager; 22 | import jackpal.androidterm.Term; 23 | 24 | public class TermActivity extends Term { 25 | @Override 26 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { 27 | // do not process preference "Theme Mode" 28 | if (ThemeManager.PREF_THEME_MODE.equals(key)) return; 29 | 30 | super.onSharedPreferenceChanged(sharedPreferences, key); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /term/src/main/jni/appinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef TERMONEPLUS_APPINFO_H 2 | #define TERMONEPLUS_APPINFO_H 3 | 4 | /* 5 | * Copyright (C) 2019-2020 Roumen Petrov. All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef PACKAGE_NAME 21 | # error "package name is not defined" 22 | #endif 23 | 24 | int/*bool*/ get_socketname(char *buf, size_t len) ; 25 | int open_socket(const char *name); 26 | int open_appsocket(void); 27 | 28 | 29 | typedef ssize_t (*atomicio_f)(int fd, void *buf, size_t count); 30 | #define vwrite (atomicio_f)write 31 | 32 | size_t atomicio(atomicio_f f, int fd, void *buf, size_t count); 33 | 34 | 35 | int/*bool*/ write_msg(int sock, const char *msg); 36 | 37 | #endif /*TERMONEPLUS_APPINFO_H*/ 38 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Intents (sample) 5 | This sample shows how to send intents to terminal emulator \"TermOne Plus\". 6 | 7 | Open New Window 8 | Script: 9 | Run Script 10 | Run Script and Save Window 11 | Run Script in Saved Window 12 | 13 | 14 | echo \'Hello world!\' 15 | \necho \'Здравейте!\' 16 | \necho \'Καλημέρα κόσμε!\' 17 | \necho \'コンニチハ!\' 18 | 19 | No Activity found 20 | 21 | Permission denial. You have to reinstall application to grant permissions. 22 | Permission denial. You have to grant permissions. 23 | Permission is required to run script in a terminal window. 24 | 25 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/fs_directory_24dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 24 | 25 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /term/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | @android:color/white 20 | @android:color/white 21 | #6200EE 22 | #DE000000 23 | #99000000 24 | 25 | #FFFFFFFF 26 | #FFFF0000 27 | #FF00FF00 28 | #FF0000FF 29 | 30 | -------------------------------------------------------------------------------- /scripts/termoneplus-notification-resources.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | cd `dirname $0` 6 | 7 | SOURCE=../docs/termoneplus-notification-icon.svg 8 | 9 | for DENSITY in l m h xh xxh xxxh ; do 10 | #for VERSION in 11 9 '' ; do 11 | for VERSION in 11 ; do 12 | QUALIFIERS= 13 | test -n "$DENSITY" && QUALIFIERS="-$DENSITY"dpi 14 | case $DENSITY/$VERSION in 15 | l/11) W=18; H=18;; 16 | #l/9) W=12; H=19;; 17 | #l/) W=19; H=19;; 18 | m/11) W=24; H=24;; 19 | #m/9) W=16; H=25;; 20 | #m/) W=25; H=25;; 21 | h/11) W=36; H=36;; 22 | #h/9) W=24; H=38;; 23 | #h/) W=38; H=38;; 24 | xh/11) W=48; H=48;; 25 | #xh/9) W=32; H=50;; 26 | #xh/) W=50; H=50;; 27 | xxh/11) W=72; H=72;; 28 | #xxh/9) W=48; H=75;; 29 | #xxh/) W=75; H=75;; 30 | xxxh*) # TODO 31 | continue;; 32 | *) 33 | echo "unsupported density-version: $DENSITY-$VERSION" >&2 34 | exit 1 35 | ;; 36 | esac 37 | test -n "$VERSION" && QUALIFIERS=$QUALIFIERS-v$VERSION 38 | 39 | rsvg-convert -w $W -h $H $SOURCE -o notification-icon$QUALIFIERS.png 40 | 41 | #DIR=../term/src/main/res/drawable$QUALIFIERS 42 | DIR=../term/src/main/res/drawable"-$DENSITY"dpi 43 | test -d $DIR || mkdir -p $DIR 44 | mv -v notification-icon$QUALIFIERS.png $DIR/ic_stat_service_notification_icon.png 45 | done 46 | done 47 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | 16 | # AndroidX package structure to make it clearer which packages are bundled with the 17 | # Android operating system, and which are packaged with your app's APK 18 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 19 | android.useAndroidX=true 20 | # Automatically convert third-party libraries to use AndroidX 21 | android.enableJetifier=true 22 | 23 | # NOTE: R8 enabled by default in gradle plugin 3.4.0! 24 | # Disables R8 for Android Library modules only. 25 | #android.enableR8.libraries = false 26 | # Disables R8 for all modules. 27 | #android.enableR8 = false 28 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/fs_unknown_24dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /libtermexec/src/main/cpp/registration.h: -------------------------------------------------------------------------------- 1 | #ifndef TERMONEPLUS_REGISTRATION_H 2 | #define TERMONEPLUS_REGISTRATION_H 3 | /* 4 | * Copyright (C) 2018-2020 Roumen Petrov. All rights reserved. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | 23 | int register_native( 24 | JNIEnv *env, const char *class_name, 25 | JNINativeMethod *methods, size_t num_methods 26 | ); 27 | 28 | int register_process(JNIEnv *env); 29 | int register_termio(JNIEnv *env); 30 | 31 | 32 | void throwOutOfMemoryError(JNIEnv *env, const char *msg) ; 33 | void throwIOException(JNIEnv *env, const char *fmt, ...); 34 | 35 | 36 | int termoneplus_log_print(int prio, const char *fmt, ...); 37 | #define LOGE(...) do { termoneplus_log_print(ANDROID_LOG_ERROR, __VA_ARGS__); } while(0) 38 | 39 | #endif /* ndef TERMONEPLUS_REGISTRATION_H */ 40 | -------------------------------------------------------------------------------- /samples/telnet/src/main/res/layout/launch_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 |