├── .gitattributes ├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── LICENSE ├── MODULE_LICENSE_APACHE2 ├── NOTICE ├── README.md ├── artwork ├── Feature Graphic.xcf ├── android-terminal-emulator-512.png └── android-terminal-emulator.svg ├── build.gradle ├── docs ├── Building.md ├── UTF-8-SMP-chars-demo.txt ├── UTF-8-demo.txt ├── atari_small_notice.txt ├── notification icon source.png └── releaseChecklist.md ├── emulatorview ├── .gitignore ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── jackpal │ │ └── androidterm │ │ └── emulatorview │ │ ├── BaseTextRenderer.java │ │ ├── Bitmap4x8FontRenderer.java │ │ ├── ByteQueue.java │ │ ├── ColorScheme.java │ │ ├── EmulatorDebug.java │ │ ├── EmulatorView.java │ │ ├── GrowableIntArray.java │ │ ├── PaintRenderer.java │ │ ├── Screen.java │ │ ├── StyleRow.java │ │ ├── TermKeyListener.java │ │ ├── TermSession.java │ │ ├── TerminalEmulator.java │ │ ├── TextRenderer.java │ │ ├── TextStyle.java │ │ ├── TranscriptScreen.java │ │ ├── UnicodeTranscript.java │ │ ├── UpdateCallback.java │ │ ├── compat │ │ ├── AndroidCharacterCompat.java │ │ ├── AndroidCompat.java │ │ ├── ClipboardManagerCompat.java │ │ ├── ClipboardManagerCompatFactory.java │ │ ├── ClipboardManagerCompatV1.java │ │ ├── ClipboardManagerCompatV11.java │ │ ├── KeyCharacterMapCompat.java │ │ ├── KeycodeConstants.java │ │ └── Patterns.java │ │ └── package.html │ └── res │ ├── drawable-nodpi │ └── atari_small_nodpi.png │ └── drawable │ └── atari_small.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libtermexec ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── jackpal │ │ └── androidterm │ │ └── libtermexec │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── jackpal │ │ └── androidterm │ │ └── libtermexec │ │ └── v1 │ │ └── ITerminal.aidl │ ├── java │ └── jackpal │ │ └── androidterm │ │ └── TermExec.java │ └── jni │ ├── process.cpp │ └── process.h ├── samples ├── intents │ ├── .gitignore │ ├── build.gradle │ ├── lint.xml │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── jackpal │ │ │ └── androidterm │ │ │ └── sample │ │ │ └── intents │ │ │ └── IntentSampleActivity.java │ │ └── res │ │ ├── layout │ │ └── main.xml │ │ ├── values-ja │ │ └── strings.xml │ │ ├── values-ko │ │ └── strings.xml │ │ └── values │ │ └── strings.xml ├── pathbroadcasts │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ ├── hello │ │ └── ls │ │ ├── java │ │ └── jackpal │ │ │ └── androidterm │ │ │ └── sample │ │ │ └── pathbroadcasts │ │ │ └── PathReceiver.java │ │ └── res │ │ └── values │ │ └── strings.xml └── telnet │ ├── .gitignore │ ├── build.gradle │ └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── jackpal │ │ └── androidterm │ │ └── sample │ │ └── telnet │ │ ├── LaunchActivity.java │ │ ├── TelnetSession.java │ │ └── TermActivity.java │ └── res │ ├── layout │ ├── launch_activity.xml │ └── term_activity.xml │ ├── values-ko │ └── strings.xml │ └── values │ └── strings.xml ├── settings.gradle ├── term ├── .gitignore ├── build.gradle ├── lint.xml └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── jackpal │ │ └── androidterm │ │ ├── BoundSession.java │ │ ├── Exec.java │ │ ├── GenericTermSession.java │ │ ├── RemoteInterface.java │ │ ├── RunScript.java │ │ ├── RunShortcut.java │ │ ├── ShellTermSession.java │ │ ├── Term.java │ │ ├── TermDebug.java │ │ ├── TermPreferences.java │ │ ├── TermService.java │ │ ├── TermView.java │ │ ├── TermViewFlipper.java │ │ ├── WindowList.java │ │ ├── WindowListAdapter.java │ │ ├── compat │ │ ├── ActionBarCompat.java │ │ ├── ActivityCompat.java │ │ ├── AlertDialogCompat.java │ │ ├── AndroidCompat.java │ │ ├── Base64.java │ │ ├── FileCompat.java │ │ ├── MenuItemCompat.java │ │ ├── PRNGFixes.java │ │ └── ServiceForegroundCompat.java │ │ ├── shortcuts │ │ ├── AddShortcut.java │ │ ├── ColorValue.java │ │ ├── FSNavigator.java │ │ └── TextIcon.java │ │ └── util │ │ ├── SessionList.java │ │ ├── ShortcutEncryption.java │ │ └── TermSettings.java │ ├── jni │ ├── common.cpp │ ├── common.h │ ├── fileCompat.cpp │ ├── fileCompat.h │ ├── termExec.cpp │ └── termExec.h │ └── res │ ├── drawable-hdpi-v11 │ ├── ic_menu_add.png │ ├── ic_menu_back.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_forward.png │ ├── ic_menu_preferences.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-hdpi-v9 │ └── ic_stat_service_notification_icon.png │ ├── drawable-hdpi │ ├── btn_close_window.png │ ├── ic_launcher.png │ ├── ic_menu_add.png │ ├── ic_menu_back.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_forward.png │ ├── ic_menu_preferences.png │ ├── ic_menu_windows.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-ldpi-v11 │ ├── ic_menu_add.png │ ├── ic_menu_back.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_forward.png │ ├── ic_menu_preferences.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-ldpi-v9 │ └── ic_stat_service_notification_icon.png │ ├── drawable-ldpi │ ├── ic_launcher.png │ ├── ic_menu_add.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_preferences.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-mdpi-v11 │ ├── ic_menu_add.png │ ├── ic_menu_back.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_forward.png │ ├── ic_menu_preferences.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-mdpi-v9 │ └── ic_stat_service_notification_icon.png │ ├── drawable-mdpi │ ├── btn_close_window.png │ ├── ic_launcher.png │ ├── ic_menu_add.png │ ├── ic_menu_back.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_forward.png │ ├── ic_menu_preferences.png │ ├── ic_menu_windows.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-xhdpi-v11 │ ├── ic_menu_add.png │ ├── ic_menu_back.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_forward.png │ ├── ic_menu_preferences.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-xhdpi-v9 │ └── ic_stat_service_notification_icon.png │ ├── drawable-xhdpi │ ├── ic_launcher.png │ └── ic_stat_service_notification_icon.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── drawable-xxxhdpi │ └── ic_launcher.png │ ├── drawable │ ├── btn_close_window.png │ ├── close_background.xml │ ├── ic_folder.png │ ├── ic_folderup.png │ ├── ic_launcher.png │ ├── ic_menu_add.png │ ├── ic_menu_back.png │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_forward.png │ ├── ic_menu_preferences.png │ ├── ic_menu_windows.png │ └── ic_stat_service_notification_icon.png │ ├── layout │ ├── term_activity.xml │ ├── window_list_item.xml │ └── window_list_new_window.xml │ ├── menu │ └── main.xml │ ├── values-cs │ ├── arrays.xml │ └── strings.xml │ ├── values-de │ ├── arrays.xml │ └── strings.xml │ ├── values-es │ ├── arrays.xml │ └── strings.xml │ ├── values-eu │ ├── arrays.xml │ └── strings.xml │ ├── values-fr │ ├── arrays.xml │ └── strings.xml │ ├── values-hu │ ├── arrays.xml │ └── strings.xml │ ├── values-it │ ├── arrays.xml │ └── strings.xml │ ├── values-iw │ ├── arrays.xml │ └── strings.xml │ ├── values-ja │ ├── arrays.xml │ └── strings.xml │ ├── values-ka │ ├── arrays.xml │ └── strings.xml │ ├── values-ko │ ├── arrays.xml │ └── strings.xml │ ├── values-nb │ ├── arrays.xml │ └── strings.xml │ ├── values-nl │ ├── arrays.xml │ └── strings.xml │ ├── values-pl │ ├── arrays.xml │ └── strings.xml │ ├── values-pt-rPT │ ├── arrays.xml │ └── strings.xml │ ├── values-pt │ ├── arrays.xml │ └── strings.xml │ ├── values-ro │ ├── arrays.xml │ └── strings.xml │ ├── values-ru │ ├── arrays.xml │ └── strings.xml │ ├── values-sk │ ├── arrays.xml │ └── strings.xml │ ├── values-sr │ ├── arrays.xml │ └── strings.xml │ ├── values-sv │ ├── arrays.xml │ └── strings.xml │ ├── values-tr │ ├── arrays.xml │ └── strings.xml │ ├── values-uk │ ├── arrays.xml │ └── strings.xml │ ├── values-v11 │ └── styles.xml │ ├── values-v21 │ ├── colors.xml │ └── styles.xml │ ├── values-zh-rCN │ ├── arrays.xml │ └── strings.xml │ ├── values-zh-rTW │ ├── arrays.xml │ └── strings.xml │ ├── values │ ├── arrays.xml │ ├── arraysNoLocalize.xml │ ├── attrs.xml │ ├── defaults.xml │ ├── id.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── preferences.xml ├── tests ├── controlSequences │ ├── 256color.txt │ ├── combiningCharReplacement.txt │ ├── combiningChars.txt │ ├── hideCursor.txt │ ├── setTitle.txt │ ├── showCursor.txt │ └── textStyle.txt ├── emulatorview-test │ ├── AndroidManifest.xml │ ├── ant.properties │ ├── proguard-project.txt │ ├── project.properties │ ├── 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 │ │ ├── InputConnectionTest.java │ │ ├── ModifierKeyTest.java │ │ └── TermKeyListenerTest.java ├── fullWidthText ├── issue145 │ ├── README.md │ ├── fuzzer.go │ ├── issue145repro-2.txt │ └── issue145repro.txt ├── issue149 │ └── colors.go └── wideChars │ ├── combining-chars.txt │ ├── last-column-wrapping.txt │ ├── linkification.txt │ ├── overwriting1.txt │ ├── overwriting2.txt │ ├── overwriting3.txt │ ├── overwriting4.txt │ ├── overwriting5.txt │ └── sip-chars.txt └── tools ├── build-debug ├── build-release ├── import-icons ├── increment-version-number ├── install-sdk-packages ├── push-and-run-debug ├── push-and-run-release ├── push-samples-debug └── sign-release-build /.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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | *.iml 8 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Android-Terminal-Emulator -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="CompilerConfiguration"> 4 | <option name="DEFAULT_COMPILER" value="Javac" /> 5 | <resourceExtensions /> 6 | <wildcardResourcePatterns> 7 | <entry name="!?*.java" /> 8 | <entry name="!?*.form" /> 9 | <entry name="!?*.class" /> 10 | <entry name="!?*.groovy" /> 11 | <entry name="!?*.scala" /> 12 | <entry name="!?*.flex" /> 13 | <entry name="!?*.kt" /> 14 | <entry name="!?*.clj" /> 15 | </wildcardResourcePatterns> 16 | <annotationProcessing> 17 | <profile default="true" name="Default" enabled="false"> 18 | <processorPath useClasspath="true" /> 19 | </profile> 20 | </annotationProcessing> 21 | </component> 22 | </project> 23 | 24 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | <component name="CopyrightManager"> 2 | <settings default="" /> 3 | </component> -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> 4 | </project> 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="GradleSettings"> 4 | <option name="linkedExternalProjectsSettings"> 5 | <GradleProjectSettings> 6 | <option name="distributionType" value="LOCAL" /> 7 | <option name="externalProjectPath" value="$PROJECT_DIRquot; /> 8 | <option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.2.1" /> 9 | <option name="gradleJvm" value="1.7" /> 10 | <option name="modules"> 11 | <set> 12 | <option value="$PROJECT_DIRquot; /> 13 | <option value="$PROJECT_DIR$/emulatorview" /> 14 | <option value="$PROJECT_DIR$/libtermexec" /> 15 | <option value="$PROJECT_DIR$/samples" /> 16 | <option value="$PROJECT_DIR$/samples/intents" /> 17 | <option value="$PROJECT_DIR$/samples/pathbroadcasts" /> 18 | <option value="$PROJECT_DIR$/samples/telnet" /> 19 | <option value="$PROJECT_DIR$/term" /> 20 | </set> 21 | </option> 22 | </GradleProjectSettings> 23 | </option> 24 | </component> 25 | </project> -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="EntryPointsManager"> 4 | <entry_points version="2.0" /> 5 | </component> 6 | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK"> 7 | <output url="file://$PROJECT_DIR$/build/classes" /> 8 | </component> 9 | </project> 10 | 11 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="ProjectModuleManager"> 4 | <modules> 5 | <module fileurl="file://$PROJECT_DIR$/Android-Terminal-Emulator.iml" filepath="$PROJECT_DIR$/Android-Terminal-Emulator.iml" /> 6 | <module fileurl="file://$PROJECT_DIR$/emulatorview/emulatorview.iml" filepath="$PROJECT_DIR$/emulatorview/emulatorview.iml" /> 7 | <module fileurl="file://$PROJECT_DIR$/samples/intents/intents.iml" filepath="$PROJECT_DIR$/samples/intents/intents.iml" /> 8 | <module fileurl="file://$PROJECT_DIR$/libtermexec/libtermexec.iml" filepath="$PROJECT_DIR$/libtermexec/libtermexec.iml" /> 9 | <module fileurl="file://$PROJECT_DIR$/samples/pathbroadcasts/pathbroadcasts.iml" filepath="$PROJECT_DIR$/samples/pathbroadcasts/pathbroadcasts.iml" /> 10 | <module fileurl="file://$PROJECT_DIR$/samples/samples.iml" filepath="$PROJECT_DIR$/samples/samples.iml" /> 11 | <module fileurl="file://$PROJECT_DIR$/samples/telnet/telnet.iml" filepath="$PROJECT_DIR$/samples/telnet/telnet.iml" /> 12 | <module fileurl="file://$PROJECT_DIR$/term/term.iml" filepath="$PROJECT_DIR$/term/term.iml" /> 13 | </modules> 14 | </component> 15 | </project> 16 | 17 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | <component name="DependencyValidationManager"> 2 | <state> 3 | <option name="SKIP_IMPORT_STATEMENTS" value="false" /> 4 | </state> 5 | </component> -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="VcsDirectoryMappings"> 4 | <mapping directory="$PROJECT_DIRquot; vcs="Git" /> 5 | </component> 6 | </project> -------------------------------------------------------------------------------- /MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Terminal Emulator for Android 2 | 3 | *Note:* Terminal Emulator for Android development has ended. I am not 4 | accepting pull requests any more. 5 | 6 | Terminal Emulator for Android is a terminal emulator for communicating with the 7 | built-in Android shell. It emulates a reasonably large subset of Digital 8 | Equipment Corporation VT-100 terminal codes, so that programs like "vi", "Emacs" 9 | and "NetHack" will display properly. 10 | 11 | This application was previously named "Android Terminal Emulator". Same great 12 | application, just with a new name. (The change was made at the request of the 13 | Android trademark owner.) 14 | 15 | This code is based on the "Term" application which is included in the Android 16 | Open Source Project. (Which I also wrote. :-) ) 17 | 18 | [Download the Terminal Emulator for Android from Google Play](https://play.google.com/store/apps/details?id=jackpal.androidterm) 19 | 20 | If you are unable to use the Play Store, you can also 21 | [download from GitHub](https://jackpal.github.io/Android-Terminal-Emulator/) 22 | 23 | See [Building](docs/Building.md) for build instructions. 24 | 25 | Got questions? Please check out the 26 | [FAQ](http://github.com/jackpal/Android-Terminal-Emulator/wiki/Frequently-Asked-Questions). Thanks! 27 | 28 | Please see the 29 | [Recent Updates](http://github.com/jackpal/Android-Terminal-Emulator/wiki/Recent-Updates) 30 | page for recent updates. 31 | -------------------------------------------------------------------------------- /artwork/Feature Graphic.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/artwork/Feature Graphic.xcf -------------------------------------------------------------------------------- /artwork/android-terminal-emulator-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/artwork/android-terminal-emulator-512.png -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | task wrapper (type:Wrapper) { 3 | gradleVersion = '2.2.1' 4 | distributionUrl = 'https://services.gradle.org/distributions/gradle-2.2.1-all.zip' 5 | } 6 | 7 | buildscript { 8 | repositories { 9 | jcenter() 10 | mavenCentral() 11 | } 12 | dependencies { 13 | classpath 'com.android.tools.build:gradle:1.0.0' 14 | classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0' 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | jcenter() 21 | } 22 | } 23 | 24 | subprojects { 25 | def androidHome 26 | 27 | if ((androidHome = System.env.'ANDROID_HOME') 28 | && (androidHome = androidHome as File).exists() 29 | && androidHome.canWrite()) 30 | apply plugin: 'android-sdk-manager' 31 | } -------------------------------------------------------------------------------- /docs/Building.md: -------------------------------------------------------------------------------- 1 | Building 2 | ======== 3 | 4 | To keep from typing "Terminal Emulator for Android" over and over again, this 5 | document will use the abbreviation "TEA" to stand for "Terminal 6 | Emulator for Android". 7 | 8 | 9 | Download the Software Needed to Build Terminal Emulator for Android 10 | ------------------------------------------------------------------- 11 | 12 | TEA is built using: 13 | 14 | + [Android Studio](http://developer.android.com/sdk) 1.0 or newer 15 | + [Android NDK](http://developer.android.com/tools/sdk/ndk/) r10d or newer 16 | 17 | 18 | Telling Gradle where to find the Android NDK and SDK 19 | ---------------------------------------------------- 20 | 21 | Android Studio and the gradle build tool need to know where to find the NDK and 22 | SDK on your computer. 23 | 24 | Create a file local.properties in the root directiory of the TEA project that 25 | contains this text: 26 | 27 | ndk.dir=path/to/ndk 28 | sdk.dir=path/to/sdk 29 | 30 | On my personal dev machine the file looks like this, but of course it will 31 | be different on your machine, depending upon your OS, user name, directory 32 | tree, and version of the NDK that you have installed. 33 | 34 | ndk.dir=/Users/jack/code/android-ndk-r10d 35 | sdk.dir=/Users/jack/Library/Android/sdk 36 | 37 | In addition, if you are building from the command line, the scripts in the 38 | "tools" directory expect the environment variable ANDROID_SDK_ROOT to be 39 | defined. 40 | 41 | On my personal dev machine I have this line in my .profile: 42 | 43 | export ANDROID_SDK_ROOT=/Users/jack/Library/Android/sdk 44 | 45 | Installing required SDK Packages 46 | -------------------------------- 47 | 48 | In order to build, in addition to a current SDK version, 49 | TEA requires the Android 3.0 (API 11) version of the Android SDK 50 | to be installed. 51 | 52 | You can install it by running the following command-line script: 53 | 54 | tools/install-sdk-packages 55 | 56 | Or you can run Android Studio and choose Configure > SDK Manager, then 57 | choose the "Android 3.0 (API 11) > SDK Platform" package. 58 | 59 | Building TEA 60 | ------------ 61 | 62 | You can build TEA two ways: 63 | 64 | 1. Using the Android Studio IDE 65 | 2. Using the "gradlew" command line tool 66 | 67 | Using Android Studio is convenient for development. Using "gradlew" is 68 | convenient for automated testing and publishing. 69 | 70 | 71 | Building TEA with Android Studio 72 | -------------------------------- 73 | 74 | 1. Open Android Studio 75 | 2. Choose "Open an existing Android Studio project" from the "Quick Start" 76 | wizard. 77 | 3. Choose the top-level TEA directory. (If you installed the source code from 78 | github, this directory will be named Android-Terminal-Emulator). 79 | 4. Use the Android Studio menu "Run : Run 'term'" to build and run the app. 80 | 81 | 82 | Building TEA from the command line 83 | ---------------------------------- 84 | 85 | 0. Make sure a file local.properties exists at the root of the TEA source 86 | tree. Android Studio will create this file automaticaly. If you don't 87 | want to run Android Studio, you can create this file manually with the 88 | paths of your local sdk and ndk installations. For my machine that's: 89 | 90 | sdk.dir=/Users/jack/Library/Android/sdk 91 | ndk.dir=/Users/jack/code/android-ndk-r10d 92 | 93 | 1. Open a command line shell window and navigate to the main TEA directory. 94 | 95 | 2. Build 96 | 97 | $ ./tools/build-debug 98 | 99 | 3. Copy the built executable to a device: 100 | 101 | $ ./tools/push-and-run-debug 102 | -------------------------------------------------------------------------------- /docs/UTF-8-SMP-chars-demo.txt: -------------------------------------------------------------------------------- 1 | These are some characters in the Supplementary Multilingual Plane: 2 | 𝄞 𝄴𝅘𝅥𝅯𝅗𝅥 𝑥𝄽 3 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /docs/notification icon source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/docs/notification icon source.png -------------------------------------------------------------------------------- /docs/releaseChecklist.md: -------------------------------------------------------------------------------- 1 | ## Terminal Emulator for Android Release Checklist 2 | 3 | # Test on 1.6 Donut API 4 4 | 5 | (Lowest supported level -- will be dropped soon.) 6 | 7 | # Test on 2.1 Eclair API 7 8 | 9 | # Test on 2.2 Froyo API 8 10 | 11 | # Test on 2.3 Gingerbread API 10 12 | 13 | (Still popular with cheap phones.) 14 | 15 | # Test on 4.3 Jelly Bean API 18 16 | 17 | # Test on 4.4 Kit Kat API 19 18 | 19 | # Test on 5.1 Lollipop API 22 20 | 21 | (Or whatever latest is.) 22 | 23 | # Test with Swype 24 | 25 | (Has to be on a real device, Swype beta won't run on an emulator.) 26 | 27 | # Update ./term/src/main/AndroidManifest.xml version number 28 | 29 | tools/increment-version-number 30 | 31 | # Commit changes 32 | 33 | git commit -a -m "Increment version number to v1.0.xx" 34 | 35 | # Tag git branch with version number 36 | 37 | git tag v1.0.xx 38 | 39 | # Push git to repository 40 | 41 | git push 42 | git push --tags 43 | 44 | # Build release apk 45 | 46 | tools/build-release 47 | 48 | (Will only work if you have the signing keys for the app.) 49 | 50 | # Publish to the Google Play Store 51 | 52 | open https://play.google.com/apps/publish 53 | 54 | The Android Developer Console Publishing UI is error prone: 55 | 56 | 1) Click on the "Terminal Emulator for Android" link. 57 | 58 | 2) Click on the APK files tab 59 | 60 | 3) Upload your new APK. 61 | 62 | 4) Activate it by clicking on the Activate link 63 | 64 | 5) Click on the "Save" button. 65 | 66 | 6) Click on the "Product Details button". 67 | 68 | 7) Fill in the "Listing Details" for the new version. 69 | 70 | 8) Click on the "Save" button 71 | 72 | 9) Visit https://play.google.com/apps/publish and verify that the new version is listed as the current version. 73 | 74 | 10) Verify that Google Play Store is serving the new version 75 | (check the "What's New" portion.) 76 | 77 | https://play.google.com/store/apps/details?id=jackpal.androidterm 78 | 79 | (Note, it can take several hours for the app to appear in the store.) 80 | 81 | # Update the Terminal Emulator for Android Wiki 82 | 83 | open https://github.com/jackpal/Android-Terminal-Emulator/wiki/Recent-Updates 84 | 85 | # Publish a new pre-compiled version of the APK for people who can't access Market. 86 | 87 | Github serves pages out of branch gh-pages , directory downloads/Term.apk 88 | Also update the version number in index.html 89 | 90 | cp ./term/build/outputs/apk/Term.apk /tmp 91 | git checkout gh-pages 92 | mv /tmp/Term.apk downloads/Term.apk 93 | git add downloads/Term.apk 94 | subl index.html 95 | # Update version save index.html 96 | git add index.html 97 | git commit -m "Update to version v1.0.xx" 98 | git push 99 | git checkout master 100 | 101 | Public URL is http://jackpal.github.com/Android-Terminal-Emulator/downloads/Term.apk 102 | 103 | 104 | -------------------------------------------------------------------------------- /emulatorview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /emulatorview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 4 9 | targetSdkVersion 22 10 | } 11 | 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /emulatorview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 | package="jackpal.androidterm.emulatorview" 4 | android:versionCode="43" 5 | android:versionName="1.0.42"> 6 | <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11" /> 7 | </manifest> 8 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/EmulatorDebug.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 | * Debug settings. 21 | */ 22 | 23 | class EmulatorDebug { 24 | /** 25 | * Set to true to add debugging code and logging. 26 | */ 27 | public static final boolean DEBUG = false; 28 | 29 | /** 30 | * Set to true to log IME calls. 31 | */ 32 | public static final boolean LOG_IME = DEBUG & false; 33 | 34 | /** 35 | * Set to true to log each character received from the remote process to the 36 | * android log, which makes it easier to debug some kinds of problems with 37 | * emulating escape sequences and control codes. 38 | */ 39 | public static final boolean LOG_CHARACTERS_FLAG = DEBUG & false; 40 | 41 | /** 42 | * Set to true to log unknown escape sequences. 43 | */ 44 | public static final boolean LOG_UNKNOWN_ESCAPE_SEQUENCES = DEBUG & false; 45 | 46 | /** 47 | * The tag we use when logging, so that our messages can be distinguished 48 | * from other messages in the log. Public because it's used by several 49 | * classes. 50 | */ 51 | public static final String LOG_TAG = "EmulatorView"; 52 | 53 | public static String bytesToString(byte[] data, int base, int length) { 54 | StringBuilder buf = new StringBuilder(); 55 | for (int i = 0; i < length; i++) { 56 | byte b = data[base + i]; 57 | if (b < 32 || b > 126) { 58 | buf.append(String.format("\\x%02x", b)); 59 | } else { 60 | buf.append((char)b); 61 | } 62 | } 63 | return buf.toString(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/StyleRow.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview; 2 | 3 | /** 4 | * Utility class for dealing with text style lines. 5 | * 6 | * We pack color and formatting information for a particular character into an 7 | * int -- see the TextStyle class for details. The simplest way of storing 8 | * that information for a screen row would be to use an array of int -- but 9 | * given that we only use the lower three bytes of the int to store information, 10 | * that effectively wastes one byte per character -- nearly 8 KB per 100 lines 11 | * with an 80-column transcript. 12 | * 13 | * Instead, we use an array of bytes and store the bytes of each int 14 | * consecutively in big-endian order. 15 | */ 16 | final class StyleRow { 17 | private int mStyle; 18 | private int mColumns; 19 | /** Initially null, will be allocated when needed. */ 20 | private byte[] mData; 21 | 22 | StyleRow(int style, int columns) { 23 | mStyle = style; 24 | mColumns = columns; 25 | } 26 | 27 | void set(int column, int style) { 28 | if (style == mStyle && mData == null) { 29 | return; 30 | } 31 | ensureData(); 32 | setStyle(column, style); 33 | } 34 | 35 | int get(int column) { 36 | if (mData == null) { 37 | return mStyle; 38 | } 39 | return getStyle(column); 40 | } 41 | 42 | boolean isSolidStyle() { 43 | return mData == null; 44 | } 45 | 46 | int getSolidStyle() { 47 | if (mData != null) { 48 | throw new IllegalArgumentException("Not a solid style"); 49 | } 50 | return mStyle; 51 | } 52 | 53 | void copy(int start, StyleRow dst, int offset, int len) { 54 | // fast case 55 | if (mData == null && dst.mData == null && start == 0 && offset == 0 56 | && len == mColumns) { 57 | dst.mStyle = mStyle; 58 | return; 59 | } 60 | // There are other potentially fast cases, but let's just treat them 61 | // all the same for simplicity. 62 | ensureData(); 63 | dst.ensureData(); 64 | System.arraycopy(mData, 3*start, dst.mData, 3*offset, 3*len); 65 | 66 | } 67 | 68 | void ensureData() { 69 | if (mData == null) { 70 | allocate(); 71 | } 72 | } 73 | 74 | private void allocate() { 75 | mData = new byte[3*mColumns]; 76 | for (int i = 0; i < mColumns; i++) { 77 | setStyle(i, mStyle); 78 | } 79 | } 80 | 81 | private int getStyle(int column) { 82 | int index = 3 * column; 83 | byte[] line = mData; 84 | return line[index] & 0xff | (line[index+1] & 0xff) << 8 85 | | (line[index+2] & 0xff) << 16; 86 | } 87 | 88 | private void setStyle(int column, int value) { 89 | int index = 3 * column; 90 | byte[] line = mData; 91 | line[index] = (byte) (value & 0xff); 92 | line[index+1] = (byte) ((value >> 8) & 0xff); 93 | line[index+2] = (byte) ((value >> 16) & 0xff); 94 | } 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/TextRenderer.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 | import android.graphics.Canvas; 20 | 21 | /** 22 | * Text renderer interface 23 | */ 24 | 25 | interface TextRenderer { 26 | public static final int MODE_OFF = 0; 27 | public static final int MODE_ON = 1; 28 | public static final int MODE_LOCKED = 2; 29 | public static final int MODE_MASK = 3; 30 | 31 | public static final int MODE_SHIFT_SHIFT = 0; 32 | public static final int MODE_ALT_SHIFT = 2; 33 | public static final int MODE_CTRL_SHIFT = 4; 34 | public static final int MODE_FN_SHIFT = 6; 35 | 36 | void setReverseVideo(boolean reverseVideo); 37 | float getCharacterWidth(); 38 | int getCharacterHeight(); 39 | /** @return pixels above top row of text to avoid looking cramped. */ 40 | int getTopMargin(); 41 | /** 42 | * Draw a run of text 43 | * @param canvas The canvas to draw into. 44 | * @param x Canvas coordinate of the left edge of the whole line. 45 | * @param y Canvas coordinate of the bottom edge of the whole line. 46 | * @param lineOffset The screen character offset of this text run (0..length of line) 47 | * @param runWidth 48 | * @param text 49 | * @param index 50 | * @param count 51 | * @param selectionStyle True to draw the text using the "selected" style (for clipboard copy) 52 | * @param textStyle 53 | * @param cursorOffset The screen character offset of the cursor (or -1 if not on this line.) 54 | * @param cursorIndex The index of the cursor in text chars. 55 | * @param cursorIncr The width of the cursor in text chars. (1 or 2) 56 | * @param cursorWidth The width of the cursor in screen columns (1 or 2) 57 | * @param cursorMode The cursor mode (used to show state of shift/control/alt/fn locks. 58 | */ 59 | void drawTextRun(Canvas canvas, float x, float y, 60 | int lineOffset, int runWidth, char[] text, 61 | int index, int count, boolean selectionStyle, int textStyle, 62 | int cursorOffset, int cursorIndex, int cursorIncr, int cursorWidth, int cursorMode); 63 | } 64 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/TextStyle.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview; 2 | 3 | final class TextStyle { 4 | // Effect bitmasks: 5 | final static int fxNormal = 0; 6 | final static int fxBold = 1; // Originally Bright 7 | //final static int fxFaint = 2; 8 | final static int fxItalic = 1 << 1; 9 | final static int fxUnderline = 1 << 2; 10 | final static int fxBlink = 1 << 3; 11 | final static int fxInverse = 1 << 4; 12 | final static int fxInvisible = 1 << 5; 13 | 14 | // Special color indices 15 | final static int ciForeground = 256; // VT100 text foreground color 16 | final static int ciBackground = 257; // VT100 text background color 17 | final static int ciCursorForeground = 258; // VT100 text cursor foreground color 18 | final static int ciCursorBackground = 259; // VT100 text cursor background color 19 | 20 | final static int ciColorLength = ciCursorBackground + 1; 21 | 22 | final static int kNormalTextStyle = encode(ciForeground, ciBackground, fxNormal); 23 | 24 | static int encode(int foreColor, int backColor, int effect) { 25 | return ((effect & 0x3f) << 18) | ((foreColor & 0x1ff) << 9) | (backColor & 0x1ff); 26 | } 27 | 28 | static int decodeForeColor(int encodedColor) { 29 | return (encodedColor >> 9) & 0x1ff; 30 | } 31 | 32 | static int decodeBackColor(int encodedColor) { 33 | return encodedColor & 0x1ff; 34 | } 35 | 36 | static int decodeEffect(int encodedColor) { 37 | return (encodedColor >> 18) & 0x3f; 38 | } 39 | 40 | private TextStyle() { 41 | // Prevent instantiation 42 | throw new UnsupportedOperationException(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/compat/AndroidCharacterCompat.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview.compat; 2 | 3 | import android.text.AndroidCharacter; 4 | 5 | /** 6 | * Definitions related to android.text.AndroidCharacter 7 | */ 8 | public class AndroidCharacterCompat { 9 | public static final int EAST_ASIAN_WIDTH_NEUTRAL = 0; 10 | public static final int EAST_ASIAN_WIDTH_AMBIGUOUS = 1; 11 | public static final int EAST_ASIAN_WIDTH_HALF_WIDTH = 2; 12 | public static final int EAST_ASIAN_WIDTH_FULL_WIDTH = 3; 13 | public static final int EAST_ASIAN_WIDTH_NARROW = 4; 14 | public static final int EAST_ASIAN_WIDTH_WIDE = 5; 15 | 16 | private static class Api8OrLater { 17 | public static int getEastAsianWidth(char c) { 18 | return AndroidCharacter.getEastAsianWidth(c); 19 | } 20 | } 21 | 22 | public static int getEastAsianWidth(char c) { 23 | if (AndroidCompat.SDK >= 8) { 24 | return Api8OrLater.getEastAsianWidth(c); 25 | } else { 26 | return EAST_ASIAN_WIDTH_NARROW; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/compat/AndroidCompat.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview.compat; 2 | 3 | /** 4 | * The classes in this package take advantage of the fact that the VM does 5 | * not attempt to load a class until it's accessed, and the verifier 6 | * does not run until a class is loaded. By keeping the methods which 7 | * are unavailable on older platforms in subclasses which are only ever 8 | * accessed on platforms where they are available, we can preserve 9 | * compatibility with older platforms without resorting to reflection. 10 | * 11 | * See http://developer.android.com/resources/articles/backward-compatibility.html 12 | * and http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html 13 | * for further discussion of this technique. 14 | */ 15 | 16 | public class AndroidCompat { 17 | public final static int SDK = getSDK(); 18 | 19 | private final static int getSDK() { 20 | int result; 21 | try { 22 | result = AndroidLevel4PlusCompat.getSDKInt(); 23 | } catch (VerifyError e) { 24 | // We must be at an SDK level less than 4. 25 | try { 26 | result = Integer.valueOf(android.os.Build.VERSION.SDK); 27 | } catch (NumberFormatException e2) { 28 | // Couldn't parse string, assume the worst. 29 | result = 1; 30 | } 31 | } 32 | return result; 33 | } 34 | } 35 | 36 | class AndroidLevel4PlusCompat { 37 | static int getSDKInt() { 38 | return android.os.Build.VERSION.SDK_INT; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/compat/ClipboardManagerCompat.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview.compat; 2 | 3 | public interface ClipboardManagerCompat { 4 | CharSequence getText(); 5 | 6 | boolean hasText(); 7 | 8 | void setText(CharSequence text); 9 | } 10 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/compat/ClipboardManagerCompatFactory.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview.compat; 2 | 3 | import android.content.Context; 4 | 5 | public class ClipboardManagerCompatFactory { 6 | 7 | private ClipboardManagerCompatFactory() { 8 | /* singleton */ 9 | } 10 | 11 | public static ClipboardManagerCompat getManager(Context context) { 12 | if (AndroidCompat.SDK < 11) { 13 | return new ClipboardManagerCompatV1(context); 14 | } else { 15 | return new ClipboardManagerCompatV11(context); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/compat/ClipboardManagerCompatV1.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview.compat; 2 | 3 | import android.content.Context; 4 | import android.text.ClipboardManager; 5 | 6 | @SuppressWarnings("deprecation") 7 | public class ClipboardManagerCompatV1 implements ClipboardManagerCompat { 8 | private final ClipboardManager clip; 9 | 10 | public ClipboardManagerCompatV1(Context context) { 11 | clip = (ClipboardManager) context.getApplicationContext() 12 | .getSystemService(Context.CLIPBOARD_SERVICE); 13 | } 14 | 15 | @Override 16 | public CharSequence getText() { 17 | return clip.getText(); 18 | } 19 | 20 | @Override 21 | public boolean hasText() { 22 | return clip.hasText(); 23 | } 24 | 25 | @Override 26 | public void setText(CharSequence text) { 27 | clip.setText(text); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/compat/ClipboardManagerCompatV11.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.emulatorview.compat; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.ClipData; 5 | import android.content.ClipDescription; 6 | import android.content.Context; 7 | import android.content.ClipboardManager; 8 | 9 | @SuppressLint("NewApi") 10 | public class ClipboardManagerCompatV11 implements ClipboardManagerCompat { 11 | private final ClipboardManager clip; 12 | 13 | public ClipboardManagerCompatV11(Context context) { 14 | clip = (ClipboardManager) context.getApplicationContext() 15 | .getSystemService(Context.CLIPBOARD_SERVICE); 16 | } 17 | 18 | @Override 19 | public CharSequence getText() { 20 | ClipData.Item item = clip.getPrimaryClip().getItemAt(0); 21 | return item.getText(); 22 | } 23 | 24 | @Override 25 | public boolean hasText() { 26 | return (clip.hasPrimaryClip() && clip.getPrimaryClipDescription() 27 | .hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)); 28 | } 29 | 30 | @Override 31 | public void setText(CharSequence text) { 32 | ClipData clipData = ClipData.newPlainText("simple text", text); 33 | clip.setPrimaryClip(clipData); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/compat/KeyCharacterMapCompat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Jack Palevich 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.compat; 18 | 19 | import android.view.KeyCharacterMap; 20 | 21 | public abstract class KeyCharacterMapCompat { 22 | public static final int MODIFIER_BEHAVIOR_CHORDED = 0; 23 | public static final int MODIFIER_BEHAVIOR_CHORDED_OR_TOGGLED = 1; 24 | 25 | public static KeyCharacterMapCompat wrap(Object map) { 26 | if (map != null) { 27 | if (AndroidCompat.SDK >= 11) { 28 | return new KeyCharacterMapApi11OrLater(map); 29 | } 30 | } 31 | return null; 32 | } 33 | 34 | private static class KeyCharacterMapApi11OrLater 35 | extends KeyCharacterMapCompat { 36 | private KeyCharacterMap mMap; 37 | public KeyCharacterMapApi11OrLater(Object map) { 38 | mMap = (KeyCharacterMap) map; 39 | } 40 | public int getModifierBehaviour() { 41 | return mMap.getModifierBehavior(); 42 | } 43 | } 44 | 45 | public abstract int getModifierBehaviour(); 46 | } 47 | -------------------------------------------------------------------------------- /emulatorview/src/main/java/jackpal/androidterm/emulatorview/package.html: -------------------------------------------------------------------------------- 1 | <html> 2 | <body> 3 | <p>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 | <p>Most users will create a <code>TermSession</code>, connect it to an {@link 8 | java.io.InputStream InputStream} and {@link java.io.OutputStream OutputStream} 9 | from the emulation client, then instantiate the <code>EmulatorView</code> and 10 | add it to an activity's layout. 11 | </body> 12 | </html> 13 | -------------------------------------------------------------------------------- /emulatorview/src/main/res/drawable-nodpi/atari_small_nodpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/emulatorview/src/main/res/drawable-nodpi/atari_small_nodpi.png -------------------------------------------------------------------------------- /emulatorview/src/main/res/drawable/atari_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/emulatorview/src/main/res/drawable/atari_small.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /libtermexec/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libtermexec/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | dependencies { 6 | classpath 'com.android.tools.build:gradle:1.0.0' 7 | } 8 | } 9 | apply plugin: 'com.android.library' 10 | 11 | repositories { 12 | jcenter() 13 | } 14 | 15 | android { 16 | compileSdkVersion 22 17 | buildToolsVersion "22.0.1" 18 | 19 | defaultConfig { 20 | minSdkVersion 4 21 | targetSdkVersion 22 22 | versionCode 1 23 | versionName "1.0" 24 | 25 | ndk { 26 | moduleName 'libjackpal-termexec2' 27 | abiFilters 'all' 28 | ldLibs 'log', 'c' 29 | } 30 | } 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_7 34 | targetCompatibility JavaVersion.VERSION_1_7 35 | } 36 | 37 | buildTypes { 38 | release { 39 | minifyEnabled false 40 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 41 | } 42 | } 43 | } 44 | 45 | // by default recent plugin version does not copy any AIDL files "to avoid publishing too much" 46 | android.libraryVariants.all { variant -> 47 | Sync packageAidl = project.tasks.create("addPublic${variant.name.capitalize()}Aidl", Sync) { sync -> 48 | from "$project.projectDir/src/main/aidl/" 49 | into "$buildDir/intermediates/bundles/${variant.dirName}/aidl/" 50 | } 51 | 52 | variant.javaCompile.dependsOn packageAidl 53 | } 54 | 55 | dependencies { 56 | compile fileTree(dir: 'libs', include: ['*.jar']) 57 | 58 | compile 'com.android.support:support-annotations:21.0.0' 59 | } 60 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libtermexec/src/androidTest/java/jackpal/androidterm/libtermexec/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.libtermexec; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase<Application> { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /libtermexec/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 | package="jackpal.androidterm.libtermexec"> 3 | <application/> 4 | </manifest> 5 | -------------------------------------------------------------------------------- /libtermexec/src/main/aidl/jackpal/androidterm/libtermexec/v1/ITerminal.aidl: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.libtermexec.v1; 2 | 3 | import android.content.IntentSender; 4 | import android.os.ParcelFileDescriptor; 5 | import android.os.ResultReceiver; 6 | 7 | // see also: 8 | // the (clumsy) way to handle object inheritance with Binder: 9 | // https://kevinhartman.github.io/blog/2012/07/23/inheritance-through-ipc-using-aidl-in-android/ 10 | // some (possibly outdated) notes on preserving backward compatibility: 11 | // https://stackoverflow.com/questions/18197783/android-aidl-interface-parcelables-and-backwards-compatibility 12 | /** 13 | * An interface for interacting with Terminal implementation. 14 | * 15 | * The version of the interface is encoded in Intent action and the AIDL package name. New versions 16 | * of this interface may be implemented in future. Those versions will be made available 17 | * in separate packages and older versions will continue to work. 18 | */ 19 | interface ITerminal { 20 | /** 21 | * Start a new Terminal session. A session will remain hosted by service, that provides binding, 22 | * but no gurantees of process pesistence as well as stability of connection are made. You 23 | * should keep your ParcelFileDescriptor around and allow ServiceConnection to call this method 24 | * again, when reconnection happens, in case service hosting the session is killed by system. 25 | * 26 | * Allows caller to be notified of terminal session events. Multiple calls can happen on each, 27 | * and new call types can be introduced, so prepare to ignore unknown event codes. 28 | * 29 | * So far only notifications about session end (code 0) are supported. This notification is 30 | * issued after abovementioned file descriptor is closed and the session is ended from 31 | * Terminal's standpoint. 32 | * 33 | * @param pseudoTerminalMultiplexerFd file descriptor, obtained by opening /dev/ptmx. 34 | * @param a callback 35 | * 36 | * @return IntentSender, that can be used to start corresponding Terminal Activity. 37 | */ 38 | IntentSender startSession(in ParcelFileDescriptor pseudoTerminalMultiplexerFd, in ResultReceiver callback); 39 | } 40 | -------------------------------------------------------------------------------- /libtermexec/src/main/jni/process.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Steven Luo 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 | #ifndef _JACKPAL_PROCESS_H 18 | #define _JACKPAL_PROCESS_H 1 19 | 20 | #include <stddef.h> 21 | #include "jni.h" 22 | #include <android/log.h> 23 | 24 | #define LOG_TAG "jackpal-termexec" 25 | 26 | extern "C" { 27 | JNIEXPORT jint JNICALL Java_jackpal_androidterm_TermExec_createSubprocessInternal 28 | (JNIEnv *, jclass, jstring, jobjectArray, jobjectArray, jint); 29 | 30 | JNIEXPORT jint JNICALL Java_jackpal_androidterm_TermExec_waitFor 31 | (JNIEnv *, jclass, jint); 32 | } 33 | 34 | #endif /* !defined(_JACKPAL_PROCESS_H) */ 35 | -------------------------------------------------------------------------------- /samples/intents/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /samples/intents/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "jackpal.androidterm.sample.intents" 9 | minSdkVersion 4 10 | targetSdkVersion 22 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/intents/lint.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <lint> 3 | <issue id="MissingTranslation" severity="ignore" /> 4 | <issue id="UseSparseArrays" severity="ignore" /> 5 | </lint> 6 | -------------------------------------------------------------------------------- /samples/intents/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 | package="jackpal.androidterm.sample.intents" 4 | android:versionCode="1" 5 | android:versionName="1.0"> 6 | <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11" /> 7 | <uses-permission android:name="jackpal.androidterm.permission.RUN_SCRIPT" /> 8 | <application android:label="@string/app_name" > 9 | <activity android:name="IntentSampleActivity" 10 | android:label="@string/app_name"> 11 | <intent-filter> 12 | <action android:name="android.intent.action.MAIN" /> 13 | <category android:name="android.intent.category.LAUNCHER" /> 14 | </intent-filter> 15 | </activity> 16 | </application> 17 | </manifest> 18 | -------------------------------------------------------------------------------- /samples/intents/src/main/java/jackpal/androidterm/sample/intents/IntentSampleActivity.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.sample.intents; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.view.View.OnClickListener; 8 | import android.widget.Button; 9 | import android.widget.EditText; 10 | 11 | public class IntentSampleActivity extends Activity 12 | { 13 | private String mHandle; 14 | private static final int REQUEST_WINDOW_HANDLE = 1; 15 | 16 | /** Called when the activity is first created. */ 17 | @Override 18 | public void onCreate(Bundle savedInstanceState) 19 | { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.main); 22 | addClickListener(R.id.openNewWindow, new OnClickListener() { 23 | public void onClick(View v) { 24 | // Intent for opening a new window without providing script 25 | Intent intent = 26 | new Intent("jackpal.androidterm.OPEN_NEW_WINDOW"); 27 | intent.addCategory(Intent.CATEGORY_DEFAULT); 28 | startActivity(intent); 29 | }}); 30 | 31 | final EditText script = (EditText) findViewById(R.id.script); 32 | script.setText(getString(R.string.default_script)); 33 | addClickListener(R.id.runScript, new OnClickListener() { 34 | public void onClick(View v) { 35 | /* Intent for opening a new window and running the provided 36 | script -- you must declare the permission 37 | jackpal.androidterm.permission.RUN_SCRIPT in your manifest 38 | to use */ 39 | Intent intent = 40 | new Intent("jackpal.androidterm.RUN_SCRIPT"); 41 | intent.addCategory(Intent.CATEGORY_DEFAULT); 42 | String command = script.getText().toString(); 43 | intent.putExtra("jackpal.androidterm.iInitialCommand", command); 44 | startActivity(intent); 45 | }}); 46 | addClickListener(R.id.runScriptSaveWindow, new OnClickListener() { 47 | public void onClick(View v) { 48 | /* Intent for running a script in a previously opened window, 49 | if it still exists 50 | This will open another window if it doesn't find a match */ 51 | Intent intent = 52 | new Intent("jackpal.androidterm.RUN_SCRIPT"); 53 | intent.addCategory(Intent.CATEGORY_DEFAULT); 54 | String command = script.getText().toString(); 55 | intent.putExtra("jackpal.androidterm.iInitialCommand", command); 56 | if (mHandle != null) { 57 | // Identify the targeted window by its handle 58 | intent.putExtra("jackpal.androidterm.window_handle", 59 | mHandle); 60 | } 61 | /* The handle for the targeted window -- whether newly opened 62 | or reused -- is returned to us via onActivityResult() 63 | You can compare it against an existing saved handle to 64 | determine whether or not a new window was opened */ 65 | startActivityForResult(intent, REQUEST_WINDOW_HANDLE); 66 | }}); 67 | } 68 | 69 | private void addClickListener(int buttonId, OnClickListener onClickListener) { 70 | ((Button) findViewById(buttonId)).setOnClickListener(onClickListener); 71 | } 72 | 73 | protected void onActivityResult(int request, int result, Intent data) { 74 | if (result != RESULT_OK) { 75 | return; 76 | } 77 | 78 | if (request == REQUEST_WINDOW_HANDLE && data != null) { 79 | mHandle = data.getStringExtra("jackpal.androidterm.window_handle"); 80 | ((Button) findViewById(R.id.runScriptSaveWindow)).setText( 81 | R.string.run_script_existing_window); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 | android:layout_width="fill_parent" 4 | android:layout_height="fill_parent" 5 | android:orientation="vertical" > 6 | 7 | <TextView 8 | android:id="@+id/help" 9 | android:layout_width="wrap_content" 10 | android:layout_height="wrap_content" 11 | android:text="@string/help" /> 12 | 13 | <Button 14 | android:id="@+id/openNewWindow" 15 | android:layout_width="wrap_content" 16 | android:layout_height="wrap_content" 17 | android:text="@string/open_new_window" /> 18 | 19 | <TextView 20 | android:id="@+id/scriptLabel" 21 | android:layout_width="wrap_content" 22 | android:layout_height="wrap_content" 23 | android:text="@string/script_label" /> 24 | 25 | <EditText 26 | android:id="@+id/script" 27 | android:layout_width="fill_parent" 28 | android:layout_height="wrap_content" /> 29 | 30 | <Button 31 | android:id="@+id/runScript" 32 | android:layout_width="wrap_content" 33 | android:layout_height="wrap_content" 34 | android:text="@string/run_script" /> 35 | 36 | <Button 37 | android:id="@+id/runScriptSaveWindow" 38 | android:layout_width="wrap_content" 39 | android:layout_height="wrap_content" 40 | android:text="@string/run_script_save_window" /> 41 | 42 | </LinearLayout> 43 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string name="app_name">ATE Intent サンプル</string> 4 | <string name="open_new_window">新しいウインドウを開く</string> 5 | <string name="script_label">スクリプト:</string> 6 | <string name="run_script">スクリプト実行</string> 7 | <string name="run_script_save_window">スクリプトを実行しウインドウを保存</string> 8 | <string name="run_script_existing_window">保存されたウインドウでスクリプトを実行</string> 9 | <string name="help">このサンプルは Android端末エミュレータへインテントを送る方法を示しています.</string> 10 | 11 | <!-- Do not translate: --> 12 | <string name="default_script">echo \'Hello, world!\'</string> 13 | </resources> 14 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/values-ko/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string name="app_name">ATE Intent 예제</string> 4 | <string name="open_new_window">새로운 창 열기</string> 5 | <string name="script_label">스크립트 : </string> 6 | <string name="run_script">스크립트 실행</string> 7 | <string name="run_script_save_window">스크립트 실행 및 명령창 상태 저장</string> 8 | <string name="run_script_existing_window">저장된 명령창에서 스크립트 실행</string> 9 | <string name="help">이 예제는 터미널 에뮬레이터에서 어떻게 Intent를 전송하는지 보여줍니다.</string> 10 | </resources> 11 | -------------------------------------------------------------------------------- /samples/intents/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string name="app_name">TEA Intent Sample</string> 4 | <string name="open_new_window">Open New Window</string> 5 | <string name="script_label">Script:</string> 6 | <string name="run_script">Run Script</string> 7 | <string name="run_script_save_window">Run Script and Save Window</string> 8 | <string name="run_script_existing_window">Run Script in Saved Window</string> 9 | <string name="help">This sample shows how to send intents to Android Terminal Emulator.</string> 10 | 11 | <!-- Do not translate: --> 12 | <string name="default_script">echo \'Hello, world!\'</string> 13 | </resources> 14 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "jackpal.androidterm.sample.pathbroadcasts" 9 | minSdkVersion 4 10 | targetSdkVersion 22 11 | 12 | ndk { 13 | moduleName "libjackpal-androidterm4" 14 | ldLibs "log" 15 | } 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile project(':emulatorview') 28 | } 29 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 | package="jackpal.androidterm.sample.pathbroadcasts" 4 | android:versionCode="1" 5 | android:versionName="1.0"> 6 | <uses-permission android:name="jackpal.androidterm.permission.APPEND_TO_PATH" /> 7 | <!-- Declare this if you want to receive PATH prepend broadcasts --> 8 | <uses-permission android:name="jackpal.androidterm.permission.PREPEND_TO_PATH" /> 9 | 10 | <application android:label="@string/app_name" > 11 | <receiver android:name=".PathReceiver"> 12 | <intent-filter> 13 | <action android:name="jackpal.androidterm.broadcast.APPEND_TO_PATH" /> 14 | </intent-filter> 15 | <intent-filter> 16 | <action android:name="jackpal.androidterm.broadcast.PREPEND_TO_PATH" /> 17 | </intent-filter> 18 | </receiver> 19 | </application> 20 | </manifest> 21 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/assets/hello: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | echo "Hello, world!" 4 | exit 0 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /samples/pathbroadcasts/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string name="app_name">TEA Path Broadcast Sample</string> 4 | </resources> 5 | -------------------------------------------------------------------------------- /samples/telnet/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /samples/telnet/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "jackpal.androidterm.sample.telnet" 9 | minSdkVersion 4 10 | targetSdkVersion 22 11 | 12 | ndk { 13 | moduleName "libjackpal-androidterm4" 14 | ldLibs "log" 15 | } 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile project(':emulatorview') 28 | } 29 | -------------------------------------------------------------------------------- /samples/telnet/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 | package="jackpal.androidterm.sample.telnet" 4 | android:versionCode="1" 5 | android:versionName="1.0"> 6 | <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11" /> 7 | <uses-permission android:name="android.permission.INTERNET" /> 8 | <application android:label="@string/app_name" > 9 | <activity android:name="LaunchActivity" 10 | android:label="@string/app_name"> 11 | <intent-filter> 12 | <action android:name="android.intent.action.MAIN" /> 13 | <category android:name="android.intent.category.LAUNCHER" /> 14 | </intent-filter> 15 | </activity> 16 | <activity android:name="TermActivity" 17 | android:label="@string/app_name" 18 | android:configChanges="keyboard|keyboardHidden|orientation" 19 | android:windowSoftInputMode="adjustResize" /> 20 | </application> 21 | </manifest> 22 | -------------------------------------------------------------------------------- /samples/telnet/src/main/java/jackpal/androidterm/sample/telnet/LaunchActivity.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.sample.telnet; 2 | 3 | import java.io.File; 4 | import java.io.FileOutputStream; 5 | import java.io.InputStream; 6 | import java.io.IOException; 7 | import java.io.OutputStream; 8 | 9 | import android.app.Activity; 10 | import android.content.Context; 11 | import android.content.Intent; 12 | import android.content.pm.PackageManager; 13 | import android.os.Bundle; 14 | import android.util.Log; 15 | import android.view.View; 16 | import android.view.View.OnClickListener; 17 | import android.widget.Button; 18 | import android.widget.EditText; 19 | 20 | /** 21 | * Provides a UI to launch the terminal emulator activity, connected to 22 | * either a local shell or a Telnet server. 23 | */ 24 | public class LaunchActivity extends Activity 25 | { 26 | private static final String TAG = "TelnetLaunchActivity"; 27 | 28 | /** Called when the activity is first created. */ 29 | @Override 30 | public void onCreate(Bundle savedInstanceState) 31 | { 32 | super.onCreate(savedInstanceState); 33 | setContentView(R.layout.launch_activity); 34 | final Context context = this; 35 | addClickListener(R.id.launchLocal, new OnClickListener() { 36 | public void onClick(View v) { 37 | Intent intent = new Intent(context, TermActivity.class); 38 | intent.putExtra("type", "local"); 39 | startActivity(intent); 40 | }}); 41 | 42 | final EditText hostEdit = (EditText) findViewById(R.id.hostname); 43 | addClickListener(R.id.launchTelnet, new OnClickListener() { 44 | public void onClick(View v) { 45 | Intent intent = new Intent(context, TermActivity.class); 46 | intent.putExtra("type", "telnet"); 47 | String hostname = hostEdit.getText().toString(); 48 | intent.putExtra("host", hostname); 49 | startActivity(intent); 50 | }}); 51 | } 52 | 53 | private void addClickListener(int buttonId, OnClickListener onClickListener) { 54 | ((Button) findViewById(buttonId)).setOnClickListener(onClickListener); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /samples/telnet/src/main/res/layout/launch_activity.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 | android:layout_width="fill_parent" 4 | android:layout_height="fill_parent" 5 | android:orientation="vertical" > 6 | 7 | <TextView 8 | android:id="@+id/help" 9 | android:layout_width="wrap_content" 10 | android:layout_height="wrap_content" 11 | android:text="@string/help" /> 12 | 13 | <Button 14 | android:id="@+id/launchLocal" 15 | android:layout_width="wrap_content" 16 | android:layout_height="wrap_content" 17 | android:text="@string/launch_local_session" /> 18 | 19 | <TextView 20 | android:id="@+id/hostLabel" 21 | android:layout_width="wrap_content" 22 | android:layout_height="wrap_content" 23 | android:text="@string/host_label" /> 24 | 25 | <EditText 26 | android:id="@+id/hostname" 27 | android:layout_width="fill_parent" 28 | android:layout_height="wrap_content" 29 | android:text="@string/default_telnet_hostname" /> 30 | 31 | <Button 32 | android:id="@+id/launchTelnet" 33 | android:layout_width="wrap_content" 34 | android:layout_height="wrap_content" 35 | android:text="@string/launch_telnet_session" /> 36 | 37 | </LinearLayout> 38 | -------------------------------------------------------------------------------- /samples/telnet/src/main/res/layout/term_activity.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 | android:layout_width="fill_parent" 4 | android:layout_height="fill_parent" 5 | android:orientation="vertical" > 6 | 7 | <jackpal.androidterm.emulatorview.EmulatorView 8 | android:id="@+id/emulatorView" 9 | android:layout_width="fill_parent" 10 | android:layout_height="wrap_content" 11 | android:layout_weight="1" 12 | android:focusable="true" 13 | android:focusableInTouchMode="true" /> 14 | 15 | <LinearLayout 16 | android:layout_width="fill_parent" 17 | android:layout_height="wrap_content" 18 | android:layout_weight="0" 19 | android:orientation="horizontal" > 20 | 21 | <EditText 22 | android:id="@+id/term_entry" 23 | android:layout_width="wrap_content" 24 | android:layout_height="wrap_content" 25 | android:layout_weight="1" 26 | android:singleLine="true" 27 | android:imeOptions="actionNone|flagNoExtractUi" 28 | android:inputType="text|textImeMultiLine" /> 29 | 30 | <Button 31 | android:id="@+id/term_entry_send" 32 | android:layout_width="wrap_content" 33 | android:layout_height="wrap_content" 34 | android:layout_weight="0" 35 | android:text="@string/entry_send" /> 36 | 37 | </LinearLayout> 38 | 39 | </LinearLayout> 40 | -------------------------------------------------------------------------------- /samples/telnet/src/main/res/values-ko/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string name="app_name">텔넷</string> 4 | <string name="launch_local_session">쉘 열기</string> 5 | <string name="launch_telnet_session">연결</string> 6 | <string name="host_label">텔넷 경로 : </string> 7 | <string name="entry_send">전송</string> 8 | <string name="help">이 예제는 EmulatorView 위젯과 TermSession 클래스를 통해 텔넷이 어떻게 작동하는지 보여줍니다.</string> 9 | 10 | <!-- This is a better demo, but towel.blinkenlights.nl is more fun :) --> 11 | <string name="default_telnet_hostname">telehack.com</string> 12 | </resources> 13 | -------------------------------------------------------------------------------- /samples/telnet/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string name="app_name">TEA Telet Sample</string> 4 | <string name="launch_local_session">Open shell</string> 5 | <string name="launch_telnet_session">Connect</string> 6 | <string name="host_label">Telnet to:</string> 7 | <string name="entry_send">Send</string> 8 | <string name="help">This example Telnet client demonstrates the use of the EmulatorView widget and the TermSession class.</string> 9 | 10 | <!-- This is a better demo, but towel.blinkenlights.nl is more fun :) --> 11 | <string name="default_telnet_hostname">telehack.com</string> 12 | </resources> 13 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':emulatorview', ':libtermexec' 2 | include ':term' 3 | include ':samples:intents' 4 | include ':samples:pathbroadcasts' 5 | include ':samples:telnet' 6 | -------------------------------------------------------------------------------- /term/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /term/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "jackpal.androidterm" 9 | minSdkVersion 4 10 | targetSdkVersion 22 11 | 12 | ndk { 13 | moduleName "libjackpal-androidterm5" 14 | abiFilters 'armeabi', 'mips', 'x86' 15 | ldLibs "log" 16 | } 17 | } 18 | 19 | compileOptions { 20 | sourceCompatibility JavaVersion.VERSION_1_7 21 | targetCompatibility JavaVersion.VERSION_1_7 22 | } 23 | 24 | buildTypes { 25 | release { 26 | minifyEnabled false 27 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 28 | } 29 | } 30 | } 31 | 32 | dependencies { 33 | compile project(':emulatorview') 34 | compile project(':libtermexec') 35 | } 36 | -------------------------------------------------------------------------------- /term/lint.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <lint> 3 | <issue id="MissingTranslation" severity="ignore" /> 4 | <issue id="UseSparseArrays" severity="ignore" /> 5 | </lint> 6 | -------------------------------------------------------------------------------- /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 | class BoundSession extends GenericTermSession { 8 | private final String issuerTitle; 9 | 10 | private boolean fullyInitialized; 11 | 12 | BoundSession(ParcelFileDescriptor ptmxFd, TermSettings settings, String issuerTitle) { 13 | super(ptmxFd, settings, true); 14 | 15 | this.issuerTitle = issuerTitle; 16 | 17 | setTermIn(new ParcelFileDescriptor.AutoCloseInputStream(ptmxFd)); 18 | setTermOut(new ParcelFileDescriptor.AutoCloseOutputStream(ptmxFd)); 19 | } 20 | 21 | @Override 22 | public String getTitle() { 23 | final String extraTitle = super.getTitle(); 24 | 25 | return TextUtils.isEmpty(extraTitle) 26 | ? issuerTitle 27 | : issuerTitle + " — " + extraTitle; 28 | } 29 | 30 | @Override 31 | public void initializeEmulator(int columns, int rows) { 32 | super.initializeEmulator(columns, rows); 33 | 34 | fullyInitialized = true; 35 | } 36 | 37 | @Override 38 | boolean isFailFast() { 39 | return !fullyInitialized; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/Exec.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; 18 | import android.os.Build; 19 | import android.os.ParcelFileDescriptor; 20 | import android.util.Log; 21 | 22 | import java.io.File; 23 | import java.io.FileDescriptor; 24 | import java.io.IOException; 25 | import java.lang.IllegalStateException; 26 | import java.lang.Process; 27 | import java.lang.reflect.Field; 28 | 29 | /** 30 | * Utility methods for managing a pty file descriptor. 31 | */ 32 | public class Exec 33 | { 34 | // Warning: bump the library revision, when an incompatible change happens 35 | static { 36 | System.loadLibrary("jackpal-androidterm5"); 37 | } 38 | 39 | static native void setPtyWindowSizeInternal(int fd, int row, int col, int xpixel, int ypixel) throws IOException; 40 | 41 | static native void setPtyUTF8ModeInternal(int fd, boolean utf8Mode) throws IOException; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/RunScript.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Steven Luo 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; 18 | 19 | import android.content.Intent; 20 | import android.net.Uri; 21 | import android.util.Log; 22 | 23 | /* 24 | * New procedure for launching a command in ATE. 25 | * Build the path and arguments into a Uri and set that into Intent.data. 26 | * intent.data(new Uri.Builder().setScheme("file").setPath(path).setFragment(arguments)) 27 | * 28 | * The old procedure of using Intent.Extra is still available but is discouraged. 29 | */ 30 | public final class RunScript extends RemoteInterface { 31 | private static final String ACTION_RUN_SCRIPT = "jackpal.androidterm.RUN_SCRIPT"; 32 | 33 | private static final String EXTRA_WINDOW_HANDLE = "jackpal.androidterm.window_handle"; 34 | private static final String EXTRA_INITIAL_COMMAND = "jackpal.androidterm.iInitialCommand"; 35 | 36 | @Override 37 | protected void handleIntent() { 38 | TermService service = getTermService(); 39 | if (service == null) { 40 | finish(); 41 | return; 42 | } 43 | 44 | Intent myIntent = getIntent(); 45 | String action = myIntent.getAction(); 46 | if (action.equals(ACTION_RUN_SCRIPT)) { 47 | /* Someone with the appropriate permissions has asked us to 48 | run a script */ 49 | String handle = myIntent.getStringExtra(EXTRA_WINDOW_HANDLE); 50 | String command=null; 51 | /* 52 | * First look in Intent.data for the path; if not there, revert to 53 | * the EXTRA_INITIAL_COMMAND location. 54 | */ 55 | Uri uri=myIntent.getData(); 56 | if(uri!=null) // scheme[path][arguments] 57 | { 58 | String s=uri.getScheme(); 59 | if(s!=null && s.toLowerCase().equals("file")) 60 | { 61 | command=uri.getPath(); 62 | // Allow for the command to be contained within the arguments string. 63 | if(command==null) command=""; 64 | if(!command.equals("")) command=quoteForBash(command); 65 | // Append any arguments. 66 | if(null!=(s=uri.getFragment())) command+=" "+s; 67 | } 68 | } 69 | // If Intent.data not used then fall back to old method. 70 | if(command==null) command=myIntent.getStringExtra(EXTRA_INITIAL_COMMAND); 71 | if (handle != null) { 72 | // Target the request at an existing window if open 73 | handle = appendToWindow(handle, command); 74 | } else { 75 | // Open a new window 76 | handle = openNewWindow(command); 77 | } 78 | Intent result = new Intent(); 79 | result.putExtra(EXTRA_WINDOW_HANDLE, handle); 80 | setResult(RESULT_OK, result); 81 | 82 | finish(); 83 | } else { 84 | super.handleIntent(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/RunShortcut.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Steven Luo 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; 18 | 19 | import jackpal.androidterm.util.ShortcutEncryption; 20 | 21 | import java.security.GeneralSecurityException; 22 | 23 | import android.content.Intent; 24 | import android.util.Log; 25 | 26 | public final class RunShortcut extends RemoteInterface { 27 | public static final String ACTION_RUN_SHORTCUT = "jackpal.androidterm.RUN_SHORTCUT"; 28 | 29 | public static final String EXTRA_WINDOW_HANDLE = "jackpal.androidterm.window_handle"; 30 | public static final String EXTRA_SHORTCUT_COMMAND = "jackpal.androidterm.iShortcutCommand"; 31 | 32 | @Override 33 | protected void handleIntent() { 34 | TermService service = getTermService(); 35 | if (service == null) { 36 | finish(); 37 | return; 38 | } 39 | 40 | Intent myIntent = getIntent(); 41 | String action = myIntent.getAction(); 42 | if (action.equals(ACTION_RUN_SHORTCUT)) { 43 | String encCommand = myIntent.getStringExtra(EXTRA_SHORTCUT_COMMAND); 44 | if (encCommand == null) { 45 | Log.e(TermDebug.LOG_TAG, "No command provided in shortcut!"); 46 | finish(); 47 | return; 48 | } 49 | 50 | // Decrypt and verify the command 51 | ShortcutEncryption.Keys keys = ShortcutEncryption.getKeys(this); 52 | if (keys == null) { 53 | // No keys -- no valid shortcuts can exist 54 | Log.e(TermDebug.LOG_TAG, "No shortcut encryption keys found!"); 55 | finish(); 56 | return; 57 | } 58 | String command; 59 | try { 60 | command = ShortcutEncryption.decrypt(encCommand, keys); 61 | } catch (GeneralSecurityException e) { 62 | Log.e(TermDebug.LOG_TAG, "Invalid shortcut: " + e.toString()); 63 | finish(); 64 | return; 65 | } 66 | 67 | String handle = myIntent.getStringExtra(EXTRA_WINDOW_HANDLE); 68 | if (handle != null) { 69 | // Target the request at an existing window if open 70 | handle = appendToWindow(handle, command); 71 | } else { 72 | // Open a new window 73 | handle = openNewWindow(command); 74 | } 75 | Intent result = new Intent(); 76 | result.putExtra(EXTRA_WINDOW_HANDLE, handle); 77 | setResult(RESULT_OK, result); 78 | } 79 | 80 | finish(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/TermDebug.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; 18 | 19 | /** 20 | * Debug settings. 21 | */ 22 | 23 | public class TermDebug { 24 | /** 25 | * Set to true to add debugging code and logging. 26 | */ 27 | public static final boolean DEBUG = false; 28 | 29 | /** 30 | * The tag we use when logging, so that our messages can be distinguished 31 | * from other messages in the log. Public because it's used by several 32 | * classes. 33 | */ 34 | public static final String LOG_TAG = "Term"; 35 | } 36 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/TermPreferences.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; 18 | 19 | import jackpal.androidterm.compat.ActionBarCompat; 20 | import jackpal.androidterm.compat.ActivityCompat; 21 | import jackpal.androidterm.compat.AndroidCompat; 22 | import android.os.Bundle; 23 | import android.preference.Preference; 24 | import android.preference.PreferenceActivity; 25 | import android.preference.PreferenceCategory; 26 | import android.view.MenuItem; 27 | 28 | public class TermPreferences extends PreferenceActivity { 29 | private static final String ACTIONBAR_KEY = "actionbar"; 30 | private static final String CATEGORY_SCREEN_KEY = "screen"; 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | 36 | // Load the preferences from an XML resource 37 | addPreferencesFromResource(R.xml.preferences); 38 | 39 | // Remove the action bar pref on older platforms without an action bar 40 | if (AndroidCompat.SDK < 11) { 41 | Preference actionBarPref = findPreference(ACTIONBAR_KEY); 42 | PreferenceCategory screenCategory = 43 | (PreferenceCategory) findPreference(CATEGORY_SCREEN_KEY); 44 | if ((actionBarPref != null) && (screenCategory != null)) { 45 | screenCategory.removePreference(actionBarPref); 46 | } 47 | } 48 | 49 | // Display up indicator on action bar home button 50 | if (AndroidCompat.V11ToV20) { 51 | ActionBarCompat bar = ActivityCompat.getActionBar(this); 52 | if (bar != null) { 53 | bar.setDisplayOptions(ActionBarCompat.DISPLAY_HOME_AS_UP, ActionBarCompat.DISPLAY_HOME_AS_UP); 54 | } 55 | } 56 | } 57 | 58 | @Override 59 | public boolean onOptionsItemSelected(MenuItem item) { 60 | switch (item.getItemId()) { 61 | case ActionBarCompat.ID_HOME: 62 | // Action bar home button selected 63 | finish(); 64 | return true; 65 | default: 66 | return super.onOptionsItemSelected(item); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/TermView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Steven Luo 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; 18 | 19 | import android.content.Context; 20 | import android.util.DisplayMetrics; 21 | 22 | import jackpal.androidterm.emulatorview.ColorScheme; 23 | import jackpal.androidterm.emulatorview.EmulatorView; 24 | import jackpal.androidterm.emulatorview.TermSession; 25 | 26 | import jackpal.androidterm.util.TermSettings; 27 | 28 | public class TermView extends EmulatorView { 29 | public TermView(Context context, TermSession session, DisplayMetrics metrics) { 30 | super(context, session, metrics); 31 | } 32 | 33 | public void updatePrefs(TermSettings settings, ColorScheme scheme) { 34 | if (scheme == null) { 35 | scheme = new ColorScheme(settings.getColorScheme()); 36 | } 37 | 38 | setTextSize(settings.getFontSize()); 39 | setUseCookedIME(settings.useCookedIME()); 40 | setColorScheme(scheme); 41 | setBackKeyCharacter(settings.getBackKeyCharacter()); 42 | setAltSendsEsc(settings.getAltSendsEscFlag()); 43 | setControlKeyCode(settings.getControlKeyCode()); 44 | setFnKeyCode(settings.getFnKeyCode()); 45 | setTermType(settings.getTermType()); 46 | setMouseTracking(settings.getMouseTrackingFlag()); 47 | } 48 | 49 | public void updatePrefs(TermSettings settings) { 50 | updatePrefs(settings, null); 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return getClass().toString() + '(' + getTermSession() + ')'; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/WindowListAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Steven Luo 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; 18 | 19 | import android.app.Activity; 20 | import android.content.Context; 21 | import android.content.ContextWrapper; 22 | import android.view.View; 23 | import android.view.ViewGroup; 24 | import android.widget.BaseAdapter; 25 | import android.widget.TextView; 26 | 27 | import jackpal.androidterm.emulatorview.TermSession; 28 | import jackpal.androidterm.emulatorview.UpdateCallback; 29 | 30 | import jackpal.androidterm.util.SessionList; 31 | 32 | public class WindowListAdapter extends BaseAdapter implements UpdateCallback { 33 | private SessionList mSessions; 34 | 35 | public WindowListAdapter(SessionList sessions) { 36 | setSessions(sessions); 37 | } 38 | 39 | public void setSessions(SessionList sessions) { 40 | mSessions = sessions; 41 | 42 | if (sessions != null) { 43 | sessions.addCallback(this); 44 | sessions.addTitleChangedListener(this); 45 | } else { 46 | onUpdate(); 47 | } 48 | } 49 | 50 | public int getCount() { 51 | if (mSessions != null) { 52 | return mSessions.size(); 53 | } else { 54 | return 0; 55 | } 56 | } 57 | 58 | public Object getItem(int position) { 59 | return mSessions.get(position); 60 | } 61 | 62 | public long getItemId(int position) { 63 | return position; 64 | } 65 | 66 | protected String getSessionTitle(int position, String defaultTitle) { 67 | TermSession session = mSessions.get(position); 68 | if (session != null && session instanceof GenericTermSession) { 69 | return ((GenericTermSession) session).getTitle(defaultTitle); 70 | } else { 71 | return defaultTitle; 72 | } 73 | } 74 | 75 | public View getView(int position, View convertView, ViewGroup parent) { 76 | Activity act = findActivityFromContext(parent.getContext()); 77 | View child = act.getLayoutInflater().inflate(R.layout.window_list_item, parent, false); 78 | View close = child.findViewById(R.id.window_list_close); 79 | 80 | TextView label = (TextView) child.findViewById(R.id.window_list_label); 81 | String defaultTitle = act.getString(R.string.window_title, position+1); 82 | label.setText(getSessionTitle(position, defaultTitle)); 83 | 84 | final SessionList sessions = mSessions; 85 | final int closePosition = position; 86 | close.setOnClickListener(new View.OnClickListener() { 87 | public void onClick(View v) { 88 | TermSession session = sessions.remove(closePosition); 89 | if (session != null) { 90 | session.finish(); 91 | notifyDataSetChanged(); 92 | } 93 | } 94 | }); 95 | 96 | return child; 97 | } 98 | 99 | public void onUpdate() { 100 | notifyDataSetChanged(); 101 | } 102 | 103 | private static Activity findActivityFromContext(Context context) { 104 | if (context == null) { 105 | return null; 106 | } else if (context instanceof Activity) { 107 | return (Activity) context; 108 | } else if (context instanceof ContextWrapper) { 109 | ContextWrapper cw = (ContextWrapper) context; 110 | return findActivityFromContext(cw.getBaseContext()); 111 | } 112 | return null; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/compat/ActivityCompat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Steven Luo 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.compat; 18 | 19 | import android.app.Activity; 20 | 21 | /** 22 | * Compatibility class for android.app.Activity 23 | */ 24 | public class ActivityCompat { 25 | private static class Api11OrLater { 26 | public static void invalidateOptionsMenu(Activity activity) { 27 | activity.invalidateOptionsMenu(); 28 | } 29 | 30 | public static Object getActionBar(Activity activity) { 31 | return activity.getActionBar(); 32 | } 33 | } 34 | 35 | public static void invalidateOptionsMenu(Activity activity) { 36 | if (AndroidCompat.SDK >= 11) { 37 | Api11OrLater.invalidateOptionsMenu(activity); 38 | } 39 | } 40 | 41 | public static ActionBarCompat getActionBar(Activity activity) { 42 | if (AndroidCompat.SDK < 11) { 43 | return null; 44 | } 45 | return ActionBarCompat.wrap(Api11OrLater.getActionBar(activity)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/compat/AlertDialogCompat.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.compat; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.Context; 5 | import android.content.DialogInterface; 6 | 7 | public class AlertDialogCompat extends AlertDialog 8 | { 9 | // API 11 10 | public static int THEME_HOLO_TRADITIONAL= 1; 11 | public static int THEME_HOLO_DARK= 2; 12 | public static int THEME_HOLO_LIGHT= 3; 13 | // API 14 14 | public static int THEME_DEVICE_DEFAULT_DARK= 4; 15 | public static int THEME_DEVICE_DEFAULT_LIGHT= 5; 16 | //////////////////////////////////////////////////////////// 17 | private AlertDialogCompat(Context context) 18 | { 19 | super(context); 20 | } 21 | private AlertDialogCompat(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener) 22 | { 23 | super(context, cancelable, cancelListener); 24 | } 25 | //////////////////////////////////////////////////////////// 26 | private static class Api11OrLater extends AlertDialog 27 | { 28 | public Api11OrLater(Context context, int theme) 29 | { 30 | super(context, theme); 31 | } 32 | public Api11OrLater(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener) 33 | { 34 | super(context, cancelable, cancelListener); 35 | } 36 | } 37 | //////////////////////////////////////////////////////////// 38 | private static class Api14OrLater extends AlertDialog 39 | { 40 | public Api14OrLater(Context context, int theme) 41 | { 42 | super(context, theme); 43 | } 44 | public Api14OrLater(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener) 45 | { 46 | super(context, cancelable, cancelListener); 47 | } 48 | } 49 | //////////////////////////////////////////////////////////// 50 | public static AlertDialog newInstance(Context context) 51 | { 52 | return(new AlertDialogCompat(context)); 53 | } 54 | //////////////////////////////////////////////////////////// 55 | public static AlertDialog newInstance(Context context, int theme) 56 | { 57 | if(AndroidCompat.SDK >= 14) 58 | { 59 | return(new Api14OrLater(context, theme)); 60 | } 61 | if(AndroidCompat.SDK >= 11) 62 | { 63 | return(new Api11OrLater(context, theme)); 64 | } 65 | return(new AlertDialogCompat(context)); 66 | } 67 | //////////////////////////////////////////////////////////// 68 | public static AlertDialog newInstance(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener) 69 | { 70 | return(new AlertDialogCompat(context, cancelable, cancelListener)); 71 | } 72 | //////////////////////////////////////////////////////////// 73 | 74 | public static AlertDialog.Builder newInstanceBuilder(Context context, int theme) { 75 | if (AndroidCompat.SDK >= 11) { 76 | return new Api11OrLaterBuilder(context, theme); 77 | } else { 78 | return new AlertDialog.Builder(context); 79 | } 80 | } 81 | private static class Api11OrLaterBuilder extends AlertDialog.Builder { 82 | public Api11OrLaterBuilder(Context context) { 83 | super(context); 84 | } 85 | public Api11OrLaterBuilder(Context context, int theme) { 86 | super(context, theme); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/compat/AndroidCompat.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.compat; 2 | 3 | /** 4 | * The classes in this package take advantage of the fact that the VM does 5 | * not attempt to load a class until it's accessed, and the verifier 6 | * does not run until a class is loaded. By keeping the methods which 7 | * are unavailable on older platforms in subclasses which are only ever 8 | * accessed on platforms where they are available, we can preserve 9 | * compatibility with older platforms without resorting to reflection. 10 | * 11 | * See http://developer.android.com/resources/articles/backward-compatibility.html 12 | * and http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html 13 | * for further discussion of this technique. 14 | */ 15 | 16 | public class AndroidCompat { 17 | public final static int SDK = getSDK(); 18 | 19 | // The era of Holo Design 20 | public final static boolean V11ToV20; 21 | 22 | static { 23 | V11ToV20 = (SDK >= 11) && (SDK <= 20); 24 | } 25 | 26 | private final static int getSDK() { 27 | int result; 28 | try { 29 | result = AndroidLevel4PlusCompat.getSDKInt(); 30 | } catch (VerifyError e) { 31 | // We must be at an SDK level less than 4. 32 | try { 33 | result = Integer.valueOf(android.os.Build.VERSION.SDK); 34 | } catch (NumberFormatException e2) { 35 | // Couldn't parse string, assume the worst. 36 | result = 1; 37 | } 38 | } 39 | return result; 40 | } 41 | } 42 | 43 | class AndroidLevel4PlusCompat { 44 | static int getSDKInt() { 45 | return android.os.Build.VERSION.SDK_INT; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/compat/FileCompat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Steven Luo 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.compat; 18 | 19 | import java.io.File; 20 | 21 | /** 22 | * Compatibility class for java.io.File 23 | */ 24 | public class FileCompat { 25 | private static class Api9OrLater { 26 | public static boolean canExecute(File file) { 27 | return file.canExecute(); 28 | } 29 | } 30 | 31 | private static class Api8OrEarlier { 32 | static { 33 | System.loadLibrary("jackpal-androidterm5"); 34 | } 35 | 36 | public static boolean canExecute(File file) { 37 | return testExecute(file.getAbsolutePath()); 38 | } 39 | 40 | private static native boolean testExecute(String pathname); 41 | } 42 | 43 | public static boolean canExecute(File file) { 44 | if (AndroidCompat.SDK < 9) { 45 | return Api8OrEarlier.canExecute(file); 46 | } else { 47 | return Api9OrLater.canExecute(file); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/compat/MenuItemCompat.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.compat; 2 | 3 | import android.view.MenuItem; 4 | 5 | /** 6 | * Definitions related to android.view.MenuItem 7 | */ 8 | public class MenuItemCompat { 9 | public static final int SHOW_AS_ACTION_NEVER = 0; 10 | public static final int SHOW_AS_ACTION_IF_ROOM = 1; 11 | public static final int SHOW_AS_ACTION_ALWAYS = 2; 12 | public static final int SHOW_AS_ACTION_WITH_TEXT = 4; 13 | 14 | private static class Api11OrLater { 15 | public static void setShowAsAction(MenuItem item, int actionEnum) { 16 | item.setShowAsAction(actionEnum); 17 | } 18 | } 19 | 20 | public static void setShowAsAction(MenuItem item, int actionEnum) { 21 | if (AndroidCompat.SDK >= 11) { 22 | Api11OrLater.setShowAsAction(item, actionEnum); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/compat/ServiceForegroundCompat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Steven Luo 3 | * Copyright (C) 2011 Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package jackpal.androidterm.compat; 19 | 20 | import java.lang.reflect.Method; 21 | import java.lang.reflect.InvocationTargetException; 22 | import android.app.Service; 23 | import android.util.Log; 24 | import android.app.Notification; 25 | import android.app.NotificationManager; 26 | import android.content.Context; 27 | 28 | /* Provide startForeground() and stopForeground() compatibility, using the 29 | current interfaces where available and the deprecated setForeground() 30 | interface where necessary 31 | The idea for the implementation comes from an example in the documentation of 32 | android.app.Service */ 33 | public class ServiceForegroundCompat { 34 | private static Class<?>[] mSetForegroundSig = new Class[] { 35 | boolean.class }; 36 | private static Class<?>[] mStartForegroundSig = new Class[] { 37 | int.class, Notification.class }; 38 | private static Class<?>[] mStopForegroundSig = new Class[] { 39 | boolean.class }; 40 | 41 | private Service service; 42 | private NotificationManager mNM; 43 | private Method mSetForeground; 44 | private Method mStartForeground; 45 | private Method mStopForeground; 46 | private int notifyId; 47 | 48 | private void invokeMethod(Object receiver, Method method, Object... args) { 49 | try { 50 | method.invoke(receiver, args); 51 | } catch (IllegalAccessException e) { 52 | // Shouldn't happen, but we have to catch this 53 | Log.w("ServiceCompat", "Unable to invoke method", e); 54 | } catch (InvocationTargetException e) { 55 | /* The methods we call don't throw exceptions -- in general, 56 | we should throw e.getCause() */ 57 | Log.w("ServiceCompat", "Method threw exception", e.getCause()); 58 | } 59 | } 60 | 61 | public void startForeground(int id, Notification notification) { 62 | if (mStartForeground != null) { 63 | invokeMethod(service, mStartForeground, id, notification); 64 | return; 65 | } 66 | 67 | invokeMethod(service, mSetForeground, Boolean.TRUE); 68 | mNM.notify(id, notification); 69 | notifyId = id; 70 | } 71 | 72 | public void stopForeground(boolean removeNotify) { 73 | if (mStopForeground != null) { 74 | invokeMethod(service, mStopForeground, removeNotify); 75 | return; 76 | } 77 | 78 | if (removeNotify) { 79 | mNM.cancel(notifyId); 80 | } 81 | invokeMethod(service, mSetForeground, Boolean.FALSE); 82 | } 83 | 84 | public ServiceForegroundCompat(Service service) { 85 | this.service = service; 86 | mNM = (NotificationManager)service.getSystemService(Context.NOTIFICATION_SERVICE); 87 | 88 | Class<?> clazz = service.getClass(); 89 | 90 | try { 91 | mStartForeground = clazz.getMethod("startForeground", mStartForegroundSig); 92 | mStopForeground = clazz.getMethod("stopForeground", mStopForegroundSig); 93 | } catch (NoSuchMethodException e) { 94 | mStartForeground = mStopForeground = null; 95 | } 96 | 97 | try { 98 | mSetForeground = clazz.getMethod("setForeground", mSetForegroundSig); 99 | } catch (NoSuchMethodException e) { 100 | mSetForeground = null; 101 | } 102 | 103 | if (mStartForeground == null && mSetForeground == null) { 104 | throw new IllegalStateException("Neither startForeground() or setForeground() present!"); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /term/src/main/java/jackpal/androidterm/shortcuts/TextIcon.java: -------------------------------------------------------------------------------- 1 | package jackpal.androidterm.shortcuts; 2 | 3 | import android.graphics. Bitmap; 4 | import android.graphics. Bitmap.Config; 5 | import android.graphics. Canvas; 6 | import android.graphics. Paint; 7 | import android.graphics. Paint.Align; 8 | import android.graphics. Rect; 9 | import android.util. FloatMath; 10 | import java.lang. Float; 11 | 12 | public class TextIcon 13 | { 14 | //////////////////////////////////////////////////////////// 15 | public static Bitmap getTextIcon(String text, int color, int width, int height) 16 | { 17 | text= text. trim(); 18 | String lines[]= text.split("\\s*\n\\s*"); 19 | int nLines= lines.length; 20 | Rect R= new Rect(); 21 | Paint p= new Paint(Paint.ANTI_ALIAS_FLAG); 22 | p. setShadowLayer(2, 10, 10, 0xFF000000); 23 | p. setColor(color); 24 | p. setSubpixelText(true); 25 | p. setTextSize(256); 26 | p. setTextAlign(Align.CENTER); 27 | float HH[]= new float[nLines]; 28 | float H= 0f; 29 | float W= 0f; 30 | for(int i=0; i<nLines; ++i) 31 | { 32 | p. getTextBounds(lines[i], 0, lines[i].length(), R); 33 | float h= Float.valueOf(Math.abs(R.top-R.bottom)); 34 | float w= Float.valueOf(Math.abs(R.right-R.left)); 35 | if(nLines>1) h+=0.1f*h; // Add space between lines. 36 | HH[i]= h; 37 | H+= h; 38 | if(w>W) W=w; 39 | } 40 | float f= ((float)width)*H/((float)height); 41 | int hBitmap= (int)H; 42 | int wBitmap= (int)W; 43 | if(W<f) {wBitmap=(int)FloatMath.ceil(f); hBitmap=(int)FloatMath.ceil(H);} 44 | else {wBitmap=(int)FloatMath.ceil(W); hBitmap=(int)FloatMath.ceil(height*wBitmap/width);} 45 | 46 | Bitmap b= Bitmap.createBitmap(wBitmap, hBitmap, Config.ARGB_8888); 47 | b. setDensity(Bitmap.DENSITY_NONE); 48 | Canvas c= new Canvas(b); 49 | 50 | W=wBitmap/2f; 51 | float top= hBitmap/2f-H/2f+HH[0]/2f; 52 | for(int i=0; i<nLines; ++i) 53 | { 54 | top+= HH[i]/2f; 55 | c. drawText(lines[i], W, top, p); 56 | top+= HH[i]/2f; 57 | } 58 | return( 59 | Bitmap.createScaledBitmap( 60 | b 61 | , width 62 | , height 63 | , true 64 | ) 65 | ); 66 | } 67 | //////////////////////////////////////////////////////////// 68 | } 69 | -------------------------------------------------------------------------------- /term/src/main/jni/common.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 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 | */ 16 | 17 | /* 18 | * Copyright (C) 2007 The Android Open Source Project 19 | * 20 | * Licensed under the Apache License, Version 2.0 (the "License"); 21 | * you may not use this file except in compliance with the License. 22 | * You may obtain a copy of the License at 23 | * 24 | * http://www.apache.org/licenses/LICENSE-2.0 25 | * 26 | * Unless required by applicable law or agreed to in writing, software 27 | * distributed under the License is distributed on an "AS IS" BASIS, 28 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | * See the License for the specific language governing permissions and 30 | * limitations under the License. 31 | */ 32 | 33 | #include "common.h" 34 | #include "termExec.h" 35 | #include "fileCompat.h" 36 | 37 | #define LOG_TAG "libjackpal-androidterm" 38 | 39 | /* 40 | * Register several native methods for one class. 41 | */ 42 | int registerNativeMethods(JNIEnv* env, const char* className, 43 | JNINativeMethod* gMethods, int numMethods) 44 | { 45 | jclass clazz; 46 | 47 | clazz = env->FindClass(className); 48 | if (clazz == NULL) { 49 | LOGE("Native registration unable to find class '%s'", className); 50 | return JNI_FALSE; 51 | } 52 | if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) { 53 | LOGE("RegisterNatives failed for '%s'", className); 54 | return JNI_FALSE; 55 | } 56 | 57 | return JNI_TRUE; 58 | } 59 | 60 | // ---------------------------------------------------------------------------- 61 | 62 | /* 63 | * This is called by the VM when the shared library is first loaded. 64 | */ 65 | 66 | typedef union { 67 | JNIEnv* env; 68 | void* venv; 69 | } UnionJNIEnvToVoid; 70 | 71 | jint JNI_OnLoad(JavaVM* vm, void* reserved) { 72 | UnionJNIEnvToVoid uenv; 73 | uenv.venv = NULL; 74 | jint result = -1; 75 | JNIEnv* env = NULL; 76 | 77 | LOGI("JNI_OnLoad"); 78 | 79 | if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_4) != JNI_OK) { 80 | LOGE("ERROR: GetEnv failed"); 81 | goto bail; 82 | } 83 | env = uenv.env; 84 | 85 | if (init_Exec(env) != JNI_TRUE) { 86 | LOGE("ERROR: init of Exec failed"); 87 | goto bail; 88 | } 89 | 90 | if (init_FileCompat(env) != JNI_TRUE) { 91 | LOGE("ERROR: init of Exec failed"); 92 | goto bail; 93 | } 94 | 95 | result = JNI_VERSION_1_4; 96 | 97 | bail: 98 | return result; 99 | } 100 | -------------------------------------------------------------------------------- /term/src/main/jni/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 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 | */ 16 | 17 | /* 18 | * Copyright (C) 2007 The Android Open Source Project 19 | * 20 | * Licensed under the Apache License, Version 2.0 (the "License"); 21 | * you may not use this file except in compliance with the License. 22 | * You may obtain a copy of the License at 23 | * 24 | * http://www.apache.org/licenses/LICENSE-2.0 25 | * 26 | * Unless required by applicable law or agreed to in writing, software 27 | * distributed under the License is distributed on an "AS IS" BASIS, 28 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | * See the License for the specific language governing permissions and 30 | * limitations under the License. 31 | */ 32 | 33 | #ifndef _COMMON_H 34 | #define _COMMON_H 1 35 | 36 | #include <stddef.h> 37 | 38 | #include "jni.h" 39 | #include <android/log.h> 40 | 41 | #define LOGI(...) do { __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__); } while(0) 42 | #define LOGW(...) do { __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__); } while(0) 43 | #define LOGE(...) do { __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__); } while(0) 44 | 45 | int registerNativeMethods(JNIEnv* env, const char* className, 46 | JNINativeMethod* gMethods, int numMethods); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /term/src/main/jni/fileCompat.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Steven Luo 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 | #include "common.h" 18 | 19 | #define LOG_TAG "FileCompat" 20 | 21 | #include <unistd.h> 22 | 23 | #include "fileCompat.h" 24 | 25 | static jboolean testExecute(JNIEnv *env, jobject clazz, jstring jPathString) 26 | { 27 | const char *pathname = NULL; 28 | int result; 29 | 30 | /* XXX We should convert CESU-8 to UTF-8 to deal with potential non-BMP 31 | chars in pathname */ 32 | pathname = env->GetStringUTFChars(jPathString, NULL); 33 | 34 | result = access(pathname, X_OK); 35 | 36 | env->ReleaseStringUTFChars(jPathString, pathname); 37 | return (result == 0); 38 | } 39 | 40 | static const char *classPathName = "jackpal/androidterm/compat/FileCompat$Api8OrEarlier"; 41 | static JNINativeMethod method_table[] = { 42 | { "testExecute", "(Ljava/lang/String;)Z", (void *) testExecute }, 43 | }; 44 | 45 | int init_FileCompat(JNIEnv *env) { 46 | if (!registerNativeMethods(env, classPathName, method_table, 47 | sizeof(method_table) / sizeof(method_table[0]))) { 48 | return JNI_FALSE; 49 | } 50 | 51 | return JNI_TRUE; 52 | } 53 | -------------------------------------------------------------------------------- /term/src/main/jni/fileCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Steven Luo 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 | #ifndef _FILECOMPAT_H 18 | #define _FILECOMPAT_H 1 19 | 20 | #include "jni.h" 21 | 22 | int init_FileCompat(JNIEnv *env); 23 | 24 | #endif /* !defined(_FILECOMPAT_H) */ 25 | -------------------------------------------------------------------------------- /term/src/main/jni/termExec.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007, 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 | */ 16 | 17 | #include "common.h" 18 | 19 | #define LOG_TAG "Exec" 20 | 21 | #include <sys/types.h> 22 | #include <sys/ioctl.h> 23 | #include <sys/wait.h> 24 | #include <errno.h> 25 | #include <fcntl.h> 26 | #include <stdlib.h> 27 | #include <unistd.h> 28 | #include <termios.h> 29 | #include <signal.h> 30 | 31 | #include "termExec.h" 32 | 33 | static void android_os_Exec_setPtyWindowSize(JNIEnv *env, jobject clazz, 34 | jint fd, jint row, jint col, jint xpixel, jint ypixel) 35 | { 36 | struct winsize sz; 37 | 38 | sz.ws_row = row; 39 | sz.ws_col = col; 40 | sz.ws_xpixel = xpixel; 41 | sz.ws_ypixel = ypixel; 42 | 43 | // TODO: handle the situation, when the file descriptor is incompatible with TIOCSWINSZ (e.g. not from /dev/ptmx) 44 | if (ioctl(fd, TIOCSWINSZ, &sz) == -1) 45 | env->ThrowNew(env->FindClass("java/io/IOException"), "Failed to issue TIOCSWINSZ ioctl"); 46 | } 47 | 48 | // tcgetattr /tcsetattr are not part of Bionic at API level 4. Here's a compatible version. 49 | 50 | static __inline__ int my_tcgetattr(int fd, struct termios *s) 51 | { 52 | return ioctl(fd, TCGETS, s); 53 | } 54 | 55 | static __inline__ int my_tcsetattr(int fd, const struct termios *s) 56 | { 57 | return ioctl(fd, TCSETS, (void *)s); 58 | } 59 | 60 | static void android_os_Exec_setPtyUTF8Mode(JNIEnv *env, jobject clazz, jint fd, jboolean utf8Mode) 61 | { 62 | struct termios tios; 63 | 64 | if (my_tcgetattr(fd, &tios) != 0) 65 | env->ThrowNew(env->FindClass("java/io/IOException"), "Failed to get terminal attributes"); 66 | 67 | if (utf8Mode) { 68 | tios.c_iflag |= IUTF8; 69 | } else { 70 | tios.c_iflag &= ~IUTF8; 71 | } 72 | 73 | if (my_tcsetattr(fd, &tios) != 0) 74 | env->ThrowNew(env->FindClass("java/io/IOException"), "Failed to set terminal UTF-8 mode"); 75 | } 76 | 77 | static const char *classPathName = "jackpal/androidterm/Exec"; 78 | static JNINativeMethod method_table[] = { 79 | { "setPtyWindowSizeInternal", "(IIIII)V", 80 | (void*) android_os_Exec_setPtyWindowSize}, 81 | { "setPtyUTF8ModeInternal", "(IZ)V", 82 | (void*) android_os_Exec_setPtyUTF8Mode} 83 | }; 84 | 85 | int init_Exec(JNIEnv *env) { 86 | if (!registerNativeMethods(env, classPathName, method_table, 87 | sizeof(method_table) / sizeof(method_table[0]))) { 88 | return JNI_FALSE; 89 | } 90 | 91 | return JNI_TRUE; 92 | } 93 | -------------------------------------------------------------------------------- /term/src/main/jni/termExec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Steven Luo 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 | #ifndef _TERMEXEC_H 18 | #define _TERMEXEC_H 1 19 | 20 | #include "jni.h" 21 | 22 | int init_Exec(JNIEnv *env); 23 | 24 | #endif /* !defined(_TERMEXEC_H) */ 25 | -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi-v11/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi-v11/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi-v11/ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi-v11/ic_menu_back.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi-v11/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi-v11/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi-v11/ic_menu_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi-v11/ic_menu_forward.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi-v11/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi-v11/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi-v11/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi-v11/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi-v9/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi-v9/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/btn_close_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/btn_close_window.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_menu_back.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_menu_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_menu_forward.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_menu_windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_menu_windows.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-hdpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-hdpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi-v11/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi-v11/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi-v11/ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi-v11/ic_menu_back.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi-v11/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi-v11/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi-v11/ic_menu_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi-v11/ic_menu_forward.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi-v11/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi-v11/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi-v11/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi-v11/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi-v9/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi-v9/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-ldpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-ldpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi-v11/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi-v11/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi-v11/ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi-v11/ic_menu_back.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi-v11/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi-v11/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi-v11/ic_menu_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi-v11/ic_menu_forward.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi-v11/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi-v11/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi-v11/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi-v11/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi-v9/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi-v9/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/btn_close_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/btn_close_window.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_menu_back.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_menu_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_menu_forward.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_menu_windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_menu_windows.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-mdpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-mdpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi-v11/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi-v11/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi-v11/ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi-v11/ic_menu_back.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi-v11/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi-v11/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi-v11/ic_menu_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi-v11/ic_menu_forward.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi-v11/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi-v11/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi-v11/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi-v11/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi-v9/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi-v9/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xhdpi/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xhdpi/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/btn_close_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/btn_close_window.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/close_background.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- Copyright (C) 2009 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 | <selector xmlns:android="http://schemas.android.com/apk/res/android"> 18 | <item android:state_pressed="true" android:drawable="@android:color/white" /> 19 | <item android:drawable="@android:color/transparent"/> 20 | </selector> 21 | -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_folder.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_folderup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_folderup.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_menu_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_menu_add.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_menu_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_menu_back.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_menu_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_menu_forward.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_menu_preferences.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_menu_windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_menu_windows.png -------------------------------------------------------------------------------- /term/src/main/res/drawable/ic_stat_service_notification_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/term/src/main/res/drawable/ic_stat_service_notification_icon.png -------------------------------------------------------------------------------- /term/src/main/res/layout/term_activity.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | /* Copyright 2007, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | --> 18 | 19 | <jackpal.androidterm.TermViewFlipper xmlns:android="http://schemas.android.com/apk/res/android" 20 | android:id="@+id/view_flipper" 21 | android:layout_width="fill_parent" 22 | android:layout_height="fill_parent" 23 | android:background="@android:color/black" 24 | /> 25 | -------------------------------------------------------------------------------- /term/src/main/res/layout/window_list_item.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | /* Copyright 2007, The Android Open Source Project 4 | ** Copyright 2011 Steven Luo 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 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 21 | android:layout_width="fill_parent" 22 | android:layout_height="fill_parent" 23 | android:orientation="horizontal"> 24 | <TextView android:id="@+id/window_list_label" 25 | android:layout_width="wrap_content" 26 | android:layout_height="fill_parent" 27 | android:layout_weight="1" 28 | android:padding="15dp" 29 | android:maxLines="1" 30 | android:singleLine="true" 31 | android:textAppearance="?android:attr/textAppearanceLarge" /> 32 | <View android:id="@+id/window_list_separator" 33 | android:background="#ff313431" 34 | android:layout_width="1dp" 35 | android:layout_height="fill_parent" 36 | android:layout_marginLeft="8dp" 37 | android:layout_marginTop="5dp" 38 | android:layout_marginBottom="5dp" /> 39 | <view class="jackpal.androidterm.WindowList$CloseButton" android:id="@+id/window_list_close" 40 | android:layout_width="wrap_content" 41 | android:layout_height="fill_parent" 42 | android:paddingLeft="15dp" 43 | android:paddingRight="15dp" 44 | android:background="@drawable/close_background" 45 | android:src="@drawable/btn_close_window" 46 | android:scaleType="center" /> 47 | </LinearLayout> 48 | -------------------------------------------------------------------------------- /term/src/main/res/layout/window_list_new_window.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | /* Copyright 2007, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | --> 18 | 19 | <TextView xmlns:android="http://schemas.android.com/apk/res/android" 20 | android:layout_width="fill_parent" 21 | android:layout_height="fill_parent" 22 | android:padding="15dp" 23 | android:maxLines="1" 24 | android:singleLine="true" 25 | android:textAppearance="?android:attr/textAppearanceLarge" 26 | android:text="@string/new_window" 27 | /> 28 | -------------------------------------------------------------------------------- /term/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | * Copyright (C) 2008 The Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | --> 17 | 18 | <menu xmlns:android="http://schemas.android.com/apk/res/android"> 19 | <item android:id="@+id/menu_new_window" 20 | android:title="@string/new_window" 21 | android:icon="@drawable/ic_menu_add" /> 22 | <item android:id="@+id/menu_close_window" 23 | android:title="@string/close_window" 24 | android:icon="@drawable/ic_menu_close_clear_cancel" /> 25 | <item android:id="@+id/menu_window_list" 26 | android:title="@string/window_list" 27 | android:icon="@drawable/ic_menu_windows" /> 28 | <item android:id="@+id/menu_toggle_soft_keyboard" 29 | android:title="@string/toggle_soft_keyboard" /> 30 | <item android:id="@+id/menu_special_keys" 31 | android:title="@string/special_keys" /> 32 | <item android:id="@+id/menu_preferences" 33 | android:title="@string/preferences" 34 | android:icon="@drawable/ic_menu_preferences" /> 35 | <item android:id="@+id/menu_reset" 36 | android:title="@string/reset" /> 37 | <item android:id="@+id/menu_send_email" 38 | android:title="@string/send_email" /> 39 | <item android:id="@+id/menu_toggle_wakelock" 40 | android:title="@string/enable_wakelock" /> 41 | <item android:id="@+id/menu_toggle_wifilock" 42 | android:title="@string/enable_wifilock" /> 43 | <item android:id="@+id/action_help" 44 | android:title="@string/help" /> 45 | </menu> 46 | -------------------------------------------------------------------------------- /term/src/main/res/values-iw/arrays.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | * Copyright (C) 2010 The Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | --> 17 | <resources> 18 | <string-array name="entries_statusbar_preference"> 19 | <item>הצג שורת המצב</item> 20 | <item>הסתר שורת מצב</item> 21 | </string-array> 22 | <string-array name="entries_actionbar_preference"> 23 | <item>הצג תמיד שורת מצב</item> 24 | <item>הסתר בר פעולות (הקש בחלק עליון של המסך או על כפתור תפריט כדי להציג)</item> 25 | </string-array> 26 | <string-array name="entries_orientation_preference"> 27 | <item>אוטומטי</item> 28 | <item>שוכב</item> 29 | <item>עומד</item> 30 | </string-array> 31 | <string-array name="entries_cursorblink_preference"> 32 | <item>סמן לא מהבהב</item> 33 | <item>סמן מהבהב</item> 34 | </string-array> 35 | <string-array name="entries_cursorstyle_preference"> 36 | <item>מלבן</item> 37 | <item>קו תחתון</item> 38 | <item>קו ניצב</item> 39 | </string-array> 40 | <string-array name="entries_fontsize_preference"> 41 | <item>4 * 8 פיקסלים</item> 42 | <item>6 נק\'</item> 43 | <item>7 נק\'</item> 44 | <item>8 נק\'</item> 45 | <item>9 נק\'</item> 46 | <item>10 נק\'</item> 47 | <item>12 נק\'</item> 48 | <item>14 נק\'</item> 49 | <item>16 נק\'</item> 50 | <item>20 נק\'</item> 51 | <item>24 נק\'</item> 52 | <item>28 נק\'</item> 53 | <item>32 נק\'</item> 54 | <item>36 נק\'</item> 55 | <item>42 נק\'</item> 56 | <item>48 נק\'</item> 57 | <item>64 נק\'</item> 58 | <item>72 נק\'</item> 59 | <item>96 נק\'</item> 60 | <item>144 נק\'</item> 61 | <item>288 נק\'</item> 62 | </string-array> 63 | <string-array name="entries_color_preference"> 64 | <item>טקסט שחור על לבן</item> 65 | <item>טקסט לבן על שחור</item> 66 | <item>טקסט לבן על כחול</item> 67 | <item>טקסט ירוק על שחור</item> 68 | <item>טקסט אמבר על שחור</item> 69 | <item>טקסט אדום על שחור</item> 70 | <item>טקסט כחול הולו על שחור</item> 71 | <item>Solarized Light</item> 72 | <item>Solarized Dark</item> 73 | <item>מסוף לינוקס</item> 74 | </string-array> 75 | <string-array name="entries_backaction_preference"> 76 | <item>סוגר את חלונות מסוף</item> 77 | <item>סוגר את חלון המסוף הנוכחי בלבד</item> 78 | <item>סוגר פעילות, ומשאיר הפעלות רצות</item> 79 | <item>שולח ESC למסוף</item> 80 | <item>שולח TAB למסוף</item> 81 | </string-array> 82 | <string-array name="entries_controlkey_preference"> 83 | <item>רענון הכדור</item> 84 | <item>\@ מפתח</item> 85 | <item>מקש ALT שמאלי</item> 86 | <item>מקש ALT ימני</item> 87 | <item>מקש קול עליון</item> 88 | <item>מקש קוך תחתון</item> 89 | <item>לחצן מצלמה</item> 90 | <item>ריק</item> 91 | </string-array> 92 | <string-array name="entries_fnkey_preference"> 93 | <item>רענון הכדור</item> 94 | <item>\@ מפתח</item> 95 | <item>מקש ALT שמאלי</item> 96 | <item>מקש ALT ימני</item> 97 | <item>מקש קול עליון</item> 98 | <item>מקש קוך תחתון</item> 99 | <item>לחצן מצלמה</item> 100 | <item>ריק</item> 101 | </string-array> 102 | <string-array name="entries_ime_preference"> 103 | <item>מבוסס תווים</item> 104 | <item>מבוסס מילים</item> 105 | </string-array> 106 | <string-array name="control_keys_short_names"> 107 | <item>כדור</item> 108 | <item>\@</item> 109 | <item>ALT-שמאלי</item> 110 | <item>ALT-ימני</item> 111 | <item>קול עליון</item> 112 | <item>קול תחתון</item> 113 | <item>מצלמה</item> 114 | <item>ריק</item> 115 | </string-array> 116 | <string-array name="fn_keys_short_names"> 117 | <item>כדור</item> 118 | <item>\@</item> 119 | <item>ALT-שמאלי</item> 120 | <item>ALT-ימני</item> 121 | <item>קול עליון</item> 122 | <item>קול תחתון</item> 123 | <item>מצלמה</item> 124 | <item>ריק</item> 125 | </string-array> 126 | </resources> 127 | -------------------------------------------------------------------------------- /term/src/main/res/values-pt-rPT/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | * Copyright (C) 2008 The Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | --> 17 | <resources> 18 | <string name="application_terminal">Terminal Emulator</string> 19 | <string name="preferences">Preferências</string> 20 | <string name="reset">Reset terminal</string> 21 | <string name="send_email">Email para</string> 22 | <string name="special_keys">Teclas especiais</string> 23 | <string name="toggle_soft_keyboard">Abrir teclado</string> 24 | 25 | <string name="edit_text">Editar texto</string> 26 | <string name="select_text">Seleccionar texto</string> 27 | <string name="copy_all">Copiar tudo</string> 28 | <string name="paste">Colar</string> 29 | 30 | <!-- Preference dialog --> 31 | <string name="screen_preferences">Ecrã</string> 32 | 33 | <string name="title_statusbar_preference">Barra de notificações</string> 34 | <string name="summary_statusbar_preference">Mostrar/esconder barra de notificações</string> 35 | <string name="dialog_title_statusbar_preference">Barra de notificações</string> 36 | 37 | <string name="title_cursorstyle_preference">Estilo do cursor</string> 38 | <string name="summary_cursorstyle_preference">Escolha o estilo do cursor</string> 39 | <string name="dialog_title_cursorstyle_preference">Estilo do cursor</string> 40 | 41 | <string name="title_cursorblink_preference">Piscar do cursor</string> 42 | <string name="summary_cursorblink_preference">Escolher piscar do cursor</string> 43 | <string name="dialog_title_cursorblink_preference">Piscar do cursor</string> 44 | 45 | <string name="text_preferences">Texto</string> 46 | 47 | <string name="title_fontsize_preference">Tamanho do texto</string> 48 | <string name="summary_fontsize_preference">Escolher a altura dos caracteres em pontos</string> 49 | <string name="dialog_title_fontsize_preference">Tamanho do texto</string> 50 | 51 | <string name="title_color_preference">Côres</string> 52 | <string name="summary_color_preference">Escolher côr do texto</string> 53 | <string name="dialog_title_color_preference">Côr do texto</string> 54 | 55 | <string name="keyboard_preferences">Teclado</string> 56 | 57 | <string name="title_controlkey_preference">Tecla control</string> 58 | <string name="summary_controlkey_preference">Escolher tecla control</string> 59 | <string name="dialog_title_controlkey_preference">Tecla control</string> 60 | 61 | <string name="title_ime_preference">Método de entrada</string> 62 | <string name="summary_ime_preference">Escolher método de entrada</string> 63 | <string name="dialog_title_ime_preference">Método de entrada</string> 64 | 65 | <string name="shell_preferences">Shell</string> 66 | <string name="title_shell_preference">Linha de comandos</string> 67 | <string name="summary_shell_preference">Especificar a linha de comando do shell</string> 68 | <string name="dialog_title_shell_preference">Shell</string> 69 | 70 | <string name="title_initialcommand_preference">Comando inicial</string> 71 | <string name="summary_initialcommand_preference">Enviar para o shell no arranque</string> 72 | <string name="dialog_title_initialcommand_preference">Comando inicial</string> 73 | 74 | </resources> 75 | -------------------------------------------------------------------------------- /term/src/main/res/values-ru/arrays.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string-array name="control_keys_short_names"> 4 | <item>Трекбол</item> 5 | <item>\@</item> 6 | <item>LAlt</item> 7 | <item>RAlt</item> 8 | <item>Vol+</item> 9 | <item>Vol-</item> 10 | <item>Камера</item> 11 | <item>Нет</item> 12 | </string-array> 13 | <string-array name="entries_actionbar_preference"> 14 | <item>Всегда показывать</item> 15 | <item>Скрывать панель действий (коснитесь верха экрана или клавиши «Меню», чтобы её показать)</item> 16 | </string-array> 17 | <string-array name="entries_backaction_preference"> 18 | <item>Закрыть все окна терминала</item> 19 | <item>Закрыть текущее окно терминала</item> 20 | <item>Закрывает приложение, но оставляет запущенным терминал</item> 21 | <item>Посылает ESC в терминал</item> 22 | <item>Посылает TAB в терминал</item> 23 | </string-array> 24 | <string-array name="entries_color_preference"> 25 | <item>Чёрный на белом</item> 26 | <item>Белый на чёрном</item> 27 | <item>Белый на синем</item> 28 | <item>Зелёный на чёрном</item> 29 | <item>Жёлтый на чёрном</item> 30 | <item>Красный на чёрном</item> 31 | <item>Голубой на чёрном</item> 32 | <item>Соляризованный светлый</item> 33 | <item>Соляризованный тёмный</item> 34 | <item>Консоль Linux</item> 35 | </string-array> 36 | <string-array name="entries_controlkey_preference"> 37 | <item>Трекбол</item> 38 | <item>Клавиша @</item> 39 | <item>Левый Alt</item> 40 | <item>Правый Alt</item> 41 | <item>Громкость вверх</item> 42 | <item>Громкость вниз</item> 43 | <item>Клавиша камеры</item> 44 | <item>Нет</item> 45 | </string-array> 46 | <string-array name="entries_cursorblink_preference"> 47 | <item>Немигающий курсор</item> 48 | <item>Мигающий курсор</item> 49 | </string-array> 50 | <string-array name="entries_cursorstyle_preference"> 51 | <item>Прямоугольник</item> 52 | <item>Подчеркивание</item> 53 | <item>Вертикальная черта</item> 54 | </string-array> 55 | <string-array name="entries_fnkey_preference"> 56 | <item>Трекбол</item> 57 | <item>Клавиша @</item> 58 | <item>Левый Alt</item> 59 | <item>Правый Alt</item> 60 | <item>Громкость вверх</item> 61 | <item>Громкость вниз</item> 62 | <item>Клавиша камеры</item> 63 | <item>Нет</item> 64 | </string-array> 65 | <string-array name="entries_fontsize_preference"> 66 | <item>4 x 8 пикселей</item> 67 | <item>6 пунктов</item> 68 | <item>7 пунктов</item> 69 | <item>8 пунктов</item> 70 | <item>9 пунктов</item> 71 | <item>10 пунктов</item> 72 | <item>12 пунктов</item> 73 | <item>14 пунктов</item> 74 | <item>16 пунктов</item> 75 | <item>20 пунктов</item> 76 | <item>24 пункта</item> 77 | <item>28 пунктов</item> 78 | <item>32 пункта</item> 79 | <item>36 пунктов</item> 80 | <item>42 пункта</item> 81 | <item>48 пунктов</item> 82 | <item>64 пункта</item> 83 | <item>72 пункта</item> 84 | <item>96 пунктов</item> 85 | <item>144 пункта</item> 86 | <item>288 пунктов</item> 87 | </string-array> 88 | <string-array name="entries_ime_preference"> 89 | <item>По символам</item> 90 | <item>По словам</item> 91 | </string-array> 92 | <string-array name="entries_orientation_preference"> 93 | <item>Автоматически</item> 94 | <item>Альбомная</item> 95 | <item>Портретная</item> 96 | </string-array> 97 | <string-array name="entries_statusbar_preference"> 98 | <item>Показывать</item> 99 | <item>Скрывать</item> 100 | </string-array> 101 | <string-array name="fn_keys_short_names"> 102 | <item>Трекбол</item> 103 | <item>\@</item> 104 | <item>LAlt</item> 105 | <item>RAlt</item> 106 | <item>Vol+</item> 107 | <item>Vol-</item> 108 | <item>Камера</item> 109 | <item>Нет</item> 110 | </string-array> 111 | </resources> 112 | -------------------------------------------------------------------------------- /term/src/main/res/values-sv/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string name="application_terminal">Terminalemulator</string> 4 | <string name="preferences">Inställningar</string> 5 | <string name="reset">Återställ terminal</string> 6 | <string name="send_email">E-posta till</string> 7 | <string name="special_keys">Special tangenter</string> 8 | <string name="toggle_soft_keyboard">Växla till virtuellt tangentbord</string> 9 | <string name="enable_wakelock">Aktivera VäckningsLås</string> 10 | <string name="disable_wakelock">Inaktivera VäckningsLås</string> 11 | <string name="enable_wifilock">Aktivera WifiLås</string> 12 | <string name="disable_wifilock">Inaktivera WifiLås</string> 13 | <string name="edit_text">Redigera text</string> 14 | <string name="select_text">Markera text</string> 15 | <string name="copy_all">Kopiera allt</string> 16 | <string name="paste">Klistra in</string> 17 | <string name="service_notify_text">Terminalsessionen är igång</string> 18 | <string name="screen_preferences">Skärm</string> 19 | <string name="title_statusbar_preference">Statusfält</string> 20 | <string name="summary_statusbar_preference">Visa/Dölj statusfält</string> 21 | <string name="dialog_title_statusbar_preference">Statusfält</string> 22 | <string name="title_cursorstyle_preference">Markörstil</string> 23 | <string name="summary_cursorstyle_preference">Välj markörstil.</string> 24 | <string name="dialog_title_cursorstyle_preference">Markörstil</string> 25 | <string name="title_cursorblink_preference">Blinkande markör</string> 26 | <string name="summary_cursorblink_preference">Välj blinkande markör</string> 27 | <string name="dialog_title_cursorblink_preference">Blinkande markör</string> 28 | <string name="text_preferences">Text</string> 29 | <string name="title_fontsize_preference">Teckenstorlek</string> 30 | <string name="summary_fontsize_preference">Välj teckenhöjd i punkter.</string> 31 | <string name="dialog_title_fontsize_preference">Teckenstorlek</string> 32 | <string name="title_color_preference">Färger</string> 33 | <string name="summary_color_preference">Välj textfärg.</string> 34 | <string name="dialog_title_color_preference">Textfärg</string> 35 | <string name="keyboard_preferences">Tangentbord</string> 36 | <string name="title_controlkey_preference">Ctrl-tangent</string> 37 | <string name="summary_controlkey_preference">Välj Ctrl-tangent</string> 38 | <string name="dialog_title_controlkey_preference">Ctrl-tangent</string> 39 | <string name="title_fnkey_preference">Fn-tangent</string> 40 | <string name="summary_fnkey_preference">Välj Fn-tangent.</string> 41 | <string name="dialog_title_fnkey_preference">Fn-tangent</string> 42 | <string name="title_ime_preference">Inmatningsmetod</string> 43 | <string name="summary_ime_preference">Välj inmatningsmetod för virtuellt tangentbord.</string> 44 | <string name="dialog_title_ime_preference">Inmatningsmetod</string> 45 | <string name="shell_preferences">Skal</string> 46 | <string name="title_shell_preference">Kommandorad</string> 47 | <string name="summary_shell_preference">Ange skalkommandorad.</string> 48 | <string name="dialog_title_shell_preference">Skal</string> 49 | <string name="title_initialcommand_preference">Inledande kommando</string> 50 | <string name="summary_initialcommand_preference">Skickas till skalet när det börjar.</string> 51 | <string name="dialog_title_initialcommand_preference">Inledande kommando</string> 52 | </resources> 53 | -------------------------------------------------------------------------------- /term/src/main/res/values-tr/arrays.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | * Copyright (C) 2007 The Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | --> 17 | 18 | <resources> 19 | <string-array name="entries_statusbar_preference"> 20 | <item>Uyarı çubuğunu göster</item> 21 | <item>Uyarı çubuğunu sakla</item> 22 | </string-array> 23 | 24 | <string-array name="entries_cursorblink_preference"> 25 | <item>Non-blinking cursor</item> 26 | <item>Blinking cursor</item> 27 | </string-array> 28 | 29 | <string-array name="entries_cursorstyle_preference"> 30 | <item>Rectangle</item> 31 | <item>Underline</item> 32 | <item>Vertical bar</item> 33 | </string-array> 34 | 35 | <string-array name="entries_fontsize_preference"> 36 | <item>4 x 8 piksel</item> 37 | <item>6 pt</item> 38 | <item>7 pt</item> 39 | <item>8 pt</item> 40 | <item>9 pt</item> 41 | <item>10 pt</item> 42 | <item>12 pt</item> 43 | <item>14 pt</item> 44 | <item>16 pt</item> 45 | <item>20 pt</item> 46 | <item>24 pt</item> 47 | <item>28 pt</item> 48 | <item>32 pt</item> 49 | <item>36 pt</item> 50 | <item>42 pt</item> 51 | <item>48 pt</item> 52 | <item>64 pt</item> 53 | <item>72 pt</item> 54 | <item>96 pt</item> 55 | <item>144 pt</item> 56 | <item>288 pt</item> 57 | </string-array> 58 | 59 | <string-array name="entries_color_preference"> 60 | <item>Beyaz arkaplan üzerinde siyah metin</item> 61 | <item>Siyah arkaplan üzerinde beyaz metin</item> 62 | <item>Mavi arkaplan üzerinde beyaz metin</item> 63 | <item>Siyah arkaplan üzerinde yeşil metin</item> 64 | <item>Siyah arkaplan üzerinde turuncu metin</item> 65 | <item>Siyah arkaplan üzerinde kırmızı metin</item> 66 | <item>Solarized Light</item> 67 | <item>Solarized Dark</item> 68 | <item>Linux Console</item> 69 | </string-array> 70 | 71 | <string-array name="entries_controlkey_preference"> 72 | <item>Jog ball</item> 73 | <item>\@ Tuşu</item> 74 | <item>Sol Alt Tuşu</item> 75 | <item>Sağ Alt Tuşu</item> 76 | <item>Ses Arttırma Tuşu</item> 77 | <item>Ses Kısma Tuşu</item> 78 | <item>Kamera Tuşu</item> 79 | </string-array> 80 | 81 | <string-array name="entries_ime_preference"> 82 | <item>Harf tabanlı</item> 83 | <item>Kelime tabanlı</item> 84 | </string-array> 85 | 86 | </resources> 87 | -------------------------------------------------------------------------------- /term/src/main/res/values-tr/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | * Copyright (C) 2008 The Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | --> 17 | <resources> 18 | <string name="application_terminal">Terminal Emülatörü</string> 19 | <string name="preferences">Tercihler</string> 20 | <string name="reset">Terminali yeniden başlat</string> 21 | <string name="send_email">Email olarak yolla</string> 22 | <string name="special_keys">Özel tuşlar</string> 23 | <string name="toggle_soft_keyboard">Ekran klavyesine geç</string> 24 | 25 | <string name="edit_text">Metni düzenle</string> 26 | <string name="select_text">Metni seç</string> 27 | <string name="copy_all">Hepsini kopyala</string> 28 | <string name="paste">Yapıştır</string> 29 | 30 | <!-- Preference dialog --> 31 | <string name="screen_preferences">Ekran</string> 32 | 33 | <string name="title_statusbar_preference">Uyarı çubuğu</string> 34 | <string name="summary_statusbar_preference">Uyarı çubuğunu göster/gizle.</string> 35 | <string name="dialog_title_statusbar_preference">Uyarı çubuğu</string> 36 | 37 | <string name="title_cursorstyle_preference">İmleç stili</string> 38 | <string name="summary_cursorstyle_preference">İmleç stili seçin.</string> 39 | <string name="dialog_title_cursorstyle_preference">İmleç stili</string> 40 | 41 | <string name="title_cursorblink_preference">Cursor blink</string> 42 | <string name="summary_cursorblink_preference">Choose cursor blink.</string> 43 | <string name="dialog_title_cursorblink_preference">Cursor blink</string> 44 | 45 | <string name="text_preferences">Metin</string> 46 | 47 | <string name="title_fontsize_preference">Karakter boyutu</string> 48 | <string name="summary_fontsize_preference">Karakter büyüklüğü seçin.</string> 49 | <string name="dialog_title_fontsize_preference">Karakter boyutu</string> 50 | 51 | <string name="title_color_preference">Renkler</string> 52 | <string name="summary_color_preference">Metin rengini seçin.</string> 53 | <string name="dialog_title_color_preference">Metin rengi</string> 54 | 55 | <string name="keyboard_preferences">Klavye</string> 56 | 57 | <string name="title_controlkey_preference">Kontrol tuşu</string> 58 | <string name="summary_controlkey_preference">Kontrol tuşunu seçin.</string> 59 | <string name="dialog_title_controlkey_preference">Kontrol tuşu</string> 60 | 61 | <string name="title_ime_preference">Giriş yöntemi</string> 62 | <string name="summary_ime_preference">Ekran klavyesi için giriş yöntemi seçin.</string> 63 | <string name="dialog_title_ime_preference">Giriş yöntemi</string> 64 | 65 | <string name="shell_preferences">Kabuk</string> 66 | <string name="title_shell_preference">Komut satırı</string> 67 | <string name="summary_shell_preference">Kabukta kullanılacak komut satırını belirtin.</string> 68 | <string name="dialog_title_shell_preference">Kabuk</string> 69 | 70 | <string name="title_initialcommand_preference">Başlangıç komutu</string> 71 | <string name="summary_initialcommand_preference">Başlangıçta kabukta çalıştır.</string> 72 | <string name="dialog_title_initialcommand_preference">Başlangıç komutu</string> 73 | </resources> 74 | -------------------------------------------------------------------------------- /term/src/main/res/values-uk/arrays.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <string-array name="entries_statusbar_preference"> 4 | <item>Показувати</item> 5 | <item>Приховувати</item> 6 | </string-array> 7 | <string-array name="entries_actionbar_preference"> 8 | <item>Завжди показувати бар дії</item> 9 | <item>Сховати дії бару (торкніться верху екрану або клавіші Меню, щоб показати)</item> 10 | </string-array> 11 | <string-array name="entries_cursorblink_preference"> 12 | <item>Не-миготливий курсор</item> 13 | <item>Миготливий курсор</item> 14 | </string-array> 15 | <string-array name="entries_cursorstyle_preference"> 16 | <item>Прямокутник</item> 17 | <item>Підкреслення</item> 18 | <item>Вертикальний бар</item> 19 | </string-array> 20 | <string-array name="entries_fontsize_preference"> 21 | <item>4 x 8 пікселів</item> 22 | <item>6 пікселів</item> 23 | <item>7 пікселів</item> 24 | <item>8 пікселів</item> 25 | <item>9 пікселів</item> 26 | <item>10 пікселів</item> 27 | <item>12 пікселів</item> 28 | <item>14 пікселів</item> 29 | <item>16 пікселів</item> 30 | <item>20 пікселів</item> 31 | <item>24 пікселів</item> 32 | <item>28 пікселів</item> 33 | <item>32 пікселів</item> 34 | <item>36 пікселів</item> 35 | <item>42 пікселів</item> 36 | <item>48 пікселів</item> 37 | <item>64 пікселів</item> 38 | <item>72 пікселів</item> 39 | <item>96 пікселів</item> 40 | <item>144 пікселів</item> 41 | <item>288 пікселів</item> 42 | </string-array> 43 | <string-array name="entries_color_preference"> 44 | <item>Чорний на білому</item> 45 | <item>Білий на чорному</item> 46 | <item>Білий на синьому</item> 47 | <item>Зелений на чорному</item> 48 | <item>Жовтий на чорному</item> 49 | <item>Червоний на чорному</item> 50 | <item>Solarized Light</item> 51 | <item>Solarized Dark</item> 52 | <item>Linux Console</item> 53 | </string-array> 54 | <string-array name="entries_backaction_preference"> 55 | <item>Закрити всі вікна терміналу</item> 56 | <item>Закрити тільки це вікно терміналу</item> 57 | <item>Активне закриття, решти запущених сеансів</item> 58 | <item>Послати ESC в термінал</item> 59 | <item>Послати TAB в термінал</item> 60 | </string-array> 61 | <string-array name="entries_controlkey_preference"> 62 | <item>Куля Jog</item> 63 | <item>Клавіша @</item> 64 | <item>Лівий Alt</item> 65 | <item>Правий Alt</item> 66 | <item>Гучність вверх</item> 67 | <item>Гучність вниз</item> 68 | <item>Клавіша камери</item> 69 | <item>Нема</item> 70 | </string-array> 71 | <string-array name="entries_fnkey_preference"> 72 | <item>Куля Jog</item> 73 | <item>Клавіша @</item> 74 | <item>Лівий Alt</item> 75 | <item>Правий Alt</item> 76 | <item>Гучність вверх</item> 77 | <item>Гучність вниз</item> 78 | <item>Клавіша камери</item> 79 | <item>Нема</item> 80 | </string-array> 81 | <string-array name="entries_ime_preference"> 82 | <item>За знаками</item> 83 | <item>За словами</item> 84 | </string-array> 85 | <string-array name="control_keys_short_names"> 86 | <item>Куля Jog</item> 87 | <item>Клавіша @</item> 88 | <item>Лівий Alt</item> 89 | <item>Правий Alt</item> 90 | <item>Гучність вверх</item> 91 | <item>Гучність вниз</item> 92 | <item>Клавіша камери</item> 93 | <item>Нема</item> 94 | </string-array> 95 | <string-array name="fn_keys_short_names"> 96 | <item>Куля Jog</item> 97 | <item>Клавіша @</item> 98 | <item>Лівий Alt</item> 99 | <item>Правий Alt</item> 100 | <item>Гучність вверх</item> 101 | <item>Гучність вниз</item> 102 | <item>Клавіша камери</item> 103 | <item>Нема</item> 104 | </string-array> 105 | </resources> 106 | -------------------------------------------------------------------------------- /term/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | 3 | <!-- The Holo-era theme. This theme is only used for API level 11..20. 4 | --> 5 | 6 | <resources> 7 | <!-- This style is used for all activities except the main terminal 8 | window. (Example: preferences.) 9 | --> 10 | <style name="Theme" parent="@android:style/Theme.Holo"> 11 | <item name="android:windowNoTitle">true</item> 12 | <item name="android:windowFrame">@null</item> 13 | <item name="android:windowContentOverlay">@null</item> 14 | </style> 15 | <!-- This style is used for the main terminal window when the action bar 16 | is visible. It is set programmatically at run time. 17 | --> 18 | <style name="Theme.Holo" parent="@android:style/Theme.Holo"> 19 | <item name="android:windowFrame">@null</item> 20 | <item name="android:windowContentOverlay">@null</item> 21 | </style> 22 | <!-- This style is used for the main terminal window when the action bar 23 | is hidden. It is set programmatically at run time. 24 | --> 25 | <style name="Theme.Holo.ActionBarOverlay" parent="@style/Theme.Holo"> 26 | <item name="android:windowActionBarOverlay">true</item> 27 | <item name="android:actionBarStyle">@style/Widget.ActionBarOverlay</item> 28 | </style> 29 | <style name="Widget.ActionBarOverlay" parent="@android:style/Widget.Holo.ActionBar"> 30 | <item name="android:background">#a0000000</item> 31 | </style> 32 | </resources> 33 | 34 | -------------------------------------------------------------------------------- /term/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | <color name="primary">#607D8B</color> 3 | <color name="primary_dark">#455A64</color> 4 | <color name="accent">#8BC34A</color> 5 | </resources> 6 | -------------------------------------------------------------------------------- /term/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | 3 | <!-- The Material Design theme. This theme is only used for API level 21... 4 | --> 5 | 6 | <resources> 7 | <!-- This style is used for all activities. 8 | --> 9 | <style name="Theme" parent="@android:style/Theme.DeviceDefault"> 10 | <item name="android:windowFrame">@null</item> 11 | <item name="android:windowContentOverlay">@null</item> 12 | <!-- Main theme colors --> 13 | <!-- your app branding color for the app bar --> 14 | <item name="android:colorPrimary">@color/primary</item> 15 | <!-- darker variant for the status bar and contextual app bars --> 16 | <item name="android:colorPrimaryDark">@color/primary_dark</item> 17 | <!-- theme UI controls like checkboxes and text fields --> 18 | <item name="android:colorAccent">@color/accent</item> 19 | </style> 20 | </resources> 21 | 22 | -------------------------------------------------------------------------------- /term/src/main/res/values/arraysNoLocalize.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | * Copyright (C) 2007 The Android Open Source Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | --> 17 | 18 | <!-- Don't localize this file --> 19 | 20 | <resources> 21 | <string-array name="entryvalues_statusbar_preference"> 22 | <item>1</item> 23 | <item>0</item> 24 | </string-array> 25 | 26 | <string-array name="entryvalues_actionbar_preference"> 27 | <!-- <item>0</item> --> 28 | <item>1</item> 29 | <item>2</item> 30 | </string-array> 31 | 32 | <string-array name="entryvalues_orientation_preference"> 33 | <item>0</item> 34 | <item>1</item> 35 | <item>2</item> 36 | </string-array> 37 | 38 | <string-array name="entryvalues_cursorblink_preference"> 39 | <item>0</item> 40 | <item>1</item> 41 | </string-array> 42 | 43 | <string-array name="entryvalues_cursorstyle_preference"> 44 | <item>0</item> 45 | <item>1</item> 46 | <item>2</item> 47 | </string-array> 48 | 49 | <!-- Note: Must also modify the maximum allowed preference value in TermSettings.readPrefs --> 50 | <string-array name="entryvalues_fontsize_preference"> 51 | <item>0</item> 52 | <item>6</item> 53 | <item>7</item> 54 | <item>8</item> 55 | <item>9</item> 56 | <item>10</item> 57 | <item>12</item> 58 | <item>14</item> 59 | <item>16</item> 60 | <item>20</item> 61 | <item>24</item> 62 | <item>28</item> 63 | <item>32</item> 64 | <item>36</item> 65 | <item>42</item> 66 | <item>48</item> 67 | <item>64</item> 68 | <item>72</item> 69 | <item>96</item> 70 | <item>144</item> 71 | <item>288</item> 72 | </string-array> 73 | 74 | <string-array name="entryvalues_color_preference"> 75 | <item>0</item> 76 | <item>1</item> 77 | <item>2</item> 78 | <item>3</item> 79 | <item>4</item> 80 | <item>5</item> 81 | <item>6</item> 82 | <item>7</item> 83 | <item>8</item> 84 | <item>9</item> 85 | </string-array> 86 | 87 | <string-array name="entryvalues_backaction_preference"> 88 | <item>0</item> 89 | <item>1</item> 90 | <item>2</item> 91 | <item>3</item> 92 | <item>4</item> 93 | </string-array> 94 | 95 | <string-array name="entryvalues_controlkey_preference"> 96 | <item>0</item> 97 | <item>1</item> 98 | <item>2</item> 99 | <item>3</item> 100 | <item>4</item> 101 | <item>5</item> 102 | <item>6</item> 103 | <item>7</item> 104 | </string-array> 105 | 106 | <string-array name="entryvalues_fnkey_preference"> 107 | <item>0</item> 108 | <item>1</item> 109 | <item>2</item> 110 | <item>3</item> 111 | <item>4</item> 112 | <item>5</item> 113 | <item>6</item> 114 | <item>7</item> 115 | </string-array> 116 | 117 | <string-array name="entryvalues_ime_preference"> 118 | <item>0</item> 119 | <item>1</item> 120 | </string-array> 121 | 122 | <string-array name="entries_termtype_preference"> 123 | <item>vt100</item> 124 | <item>screen</item> 125 | <item>linux</item> 126 | <item>screen-256color</item> 127 | <item>xterm</item> 128 | </string-array> 129 | </resources> 130 | -------------------------------------------------------------------------------- /term/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <!-- 3 | /* Copyright 2007, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | --> 18 | 19 | <resources> 20 | <declare-styleable name="EmulatorView"> 21 | </declare-styleable> 22 | </resources> 23 | -------------------------------------------------------------------------------- /term/src/main/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <!-- Don't localize these default values --> 4 | <string name="pref_statusbar_default" translatable="false">1</string> 5 | <integer name="pref_actionbar_default">1</integer> 6 | <integer name="pref_orientation_default">0</integer> 7 | <string name="pref_cursorstyle_default" translatable="false">0</string> 8 | <string name="pref_cursorblink_default" translatable="false">0</string> 9 | <string name="pref_fontsize_default" translatable="false">10</string> 10 | <string name="pref_color_default" translatable="false">1</string> 11 | <bool name="pref_utf8_by_default_default">false</bool> 12 | <string name="pref_backaction_default" translatable="false">2</string> 13 | <string name="pref_controlkey_default" translatable="false">5</string> 14 | <string name="pref_fnkey_default" translatable="false">4</string> 15 | <string name="pref_ime_default" translatable="false">0</string> 16 | <bool name="pref_alt_sends_esc_default">false</bool> 17 | <string name="pref_shell_default" translatable="false">/system/bin/sh -</string> 18 | <string name="pref_initialcommand_default" translatable="false"></string> 19 | <string name="pref_termtype_default" translatable="false">screen</string> 20 | <bool name="pref_close_window_on_process_exit_default">true</bool> 21 | <bool name="pref_verify_path_default">true</bool> 22 | <bool name="pref_do_path_extensions_default">true</bool> 23 | <bool name="pref_allow_prepend_path_default">true</bool> 24 | <!-- the home_path default is set dynamically in Term.onResume() --> 25 | <bool name="pref_mouse_tracking_default">false</bool> 26 | <bool name="pref_use_keyboard_shortcuts_default">true</bool> 27 | </resources> 28 | -------------------------------------------------------------------------------- /term/src/main/res/values/id.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <item type="id" name="imageview" /> 4 | <item type="id" name="textview" /> 5 | <item type="id" name="mainview" /> 6 | <item type="id" name="scrollview" /> 7 | </resources> 8 | -------------------------------------------------------------------------------- /term/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 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 | <!-- The base theme. This theme is only used for API level 1..10. 18 | --> 19 | 20 | <resources> 21 | <style name="Theme" parent="@android:style/Theme.Light"> 22 | <item name="android:windowNoTitle">true</item> 23 | <item name="android:windowFrame">@null</item> 24 | <item name="android:windowContentOverlay">@null</item> 25 | </style> 26 | </resources> 27 | 28 | -------------------------------------------------------------------------------- /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ünchenxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[7Gu 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[6Gü 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/controlSequences/hideCursor.txt: -------------------------------------------------------------------------------- 1 | [?25lThe cursor is now hidden. 2 | -------------------------------------------------------------------------------- /tests/controlSequences/setTitle.txt: -------------------------------------------------------------------------------- 1 | ]0;I am a title\Window title should now be 'I am a title'. 2 | -------------------------------------------------------------------------------- /tests/controlSequences/showCursor.txt: -------------------------------------------------------------------------------- 1 | [?25hThe cursor is now visible. 2 | -------------------------------------------------------------------------------- /tests/controlSequences/textStyle.txt: -------------------------------------------------------------------------------- 1 | Text style test 2 | normal: [0mtext[0m 3 | bold: [1mtext[0m 4 | faint: [2mtext[0m 5 | italic: [3mtext[0m (may show as inverse) 6 | underline: [4mtext[0m 7 | blink: [5mtext[0m (may show as bold) 8 | 6: [6mtext[0m 9 | inverse: [7mtext[0m 10 | invisible: [8mtext[0m 11 | bold-underline: [1;4mtext[0m 12 | bold-ul-inverse: [1;4;7mtext[0m 13 | invis-bold-ul: [1;4;8mtext[0m 14 | invis-bold-ul-invrs: [1;4;7;8mtext[0m 15 | everything: [1;2;3;4;5;6;7;8mtext[0m 16 | Reset bold/faint: [1;2;3;4;5;6;7mtext[22mtext[23;24;25;27mtext[0m 17 | Reset bold/faint: [1mtext[22mtext[0m 18 | Reset bold/faint: [2mtext[22mtext[0m 19 | dim colors: [31;42mred on green[0m 20 | bright colors: [91;102mred on green[0m 21 | -------------------------------------------------------------------------------- /tests/emulatorview-test/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 | package="jackpal.androidterm.test" 4 | android:versionCode="1" 5 | android:versionName="1.0" > 6 | 7 | <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11" /> 8 | 9 | <instrumentation 10 | android:name="android.test.InstrumentationTestRunner" 11 | android:targetPackage="jackpal.androidterm" /> 12 | 13 | <application 14 | android:icon="@drawable/ic_launcher" 15 | android:label="@string/app_name" > 16 | <uses-library android:name="android.test.runner" /> 17 | </application> 18 | 19 | </manifest> 20 | -------------------------------------------------------------------------------- /tests/emulatorview-test/ant.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked into Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | tested.project.dir=../.. 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/emulatorview-test/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-11 15 | -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/tests/emulatorview-test/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/tests/emulatorview-test/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/tests/emulatorview-test/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackpal/Android-Terminal-Emulator/35188f8a8b57989a4a4ec9485e11187b46be26d9/tests/emulatorview-test/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /tests/emulatorview-test/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | 4 | <string name="app_name">Emulatorview-testTest</string> 5 | 6 | </resources> -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/fullWidthText: -------------------------------------------------------------------------------- 1 | Make sure UTF-8 is enabled. 2 | Full-width text: [ABC] 3 | Normal-width text: [ABC ] 4 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /tests/issue145/issue145repro-2.txt: -------------------------------------------------------------------------------- 1 | a8珮蠟茤퓉�B應Z -------------------------------------------------------------------------------- /tests/issue145/issue145repro.txt: -------------------------------------------------------------------------------- 1 | 𬘴 2 | ( -------------------------------------------------------------------------------- /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/wideChars/combining-chars.txt: -------------------------------------------------------------------------------- 1 | East Asian wide characters with combining diacritics: 2 | 3 | 中文 [combining low line]: 4 | 中文̲ 5 | 6 | xxx中[combining low line]文: 7 | xxx中̲文 8 | 9 | Overwriting an East Asian wide character with combining diacritic with an East 10 | Asian wide character without combining diacritic, in the middle of an 80-column 11 | line with mixed narrow and wide chars: 12 | 13 | xxx[...]xxx中文[combining low line]xxx[...]xxx你好ESC [ 23 G 国: 14 | xxxxxxxxxxxxxxxxxxxx中文̲xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23G国 15 | 16 | xxx[...]xxx中文[combining low line]。xxx[...]xxx你好xESC [ 23 G 国: 17 | xxxxxxxxxxxxxxxxxxxx中文̲。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23G国 18 | 19 | Overwriting an East Asian wide character with another one with a combining 20 | diacritic, in the middle of an 80-column line with mixed narrow and wide chars: 21 | 22 | xxx[...]xxx中文xxx[...]xxx你好ESC [ 23 G 国[combining low line]: 23 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23G国̲ 24 | 25 | xxx[...]xxx中文。xxx[...]xxx你好xESC [ 23 G 国[combining low line]: 26 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23G国̲ 27 | 28 | Overwriting a narrow character with an East Asian wide character with a 29 | combining diacritic, in the middle of an 80-column line with mixed narrow and 30 | wide chars: 31 | 32 | xxx[...]xxx中文xxx[...]xxx你好xESC [ 25 G 。[combining low line]: 33 | xxxxxxxxxxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[25G。̲ 34 | 35 | xxx[...]xxx中y文xxx[...]xxx你好ESC [ 23 G ,[combining low line]: 36 | xxxxxxxxxxxxxxxxxxxx中y文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23G,̲ 37 | 38 | Overwriting a narrow character with a combining diacritic with an East Asian 39 | wide character, in the middle of an 80-column line with mixed narrow and 40 | widechars: 41 | 42 | xxxxxxxxàxxx[...]xxx中文xxx[...]xxx你好xESC [ 9 G 中: 43 | xxxxxxxxàxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[9G中 44 | 45 | xxxxxxxxàxxx[...]xxx中文xxx[...]xxx你好xESC [ 8 G 中: 46 | xxxxxxxxàxxxxxxxxxxx中文xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[8G中 47 | 48 | Overwriting an East Asian wide character with combining diacritic with a narrow 49 | character without combining diacritic, in the middle of an 80-column line with 50 | mixed narrow and wide chars: 51 | 52 | xxx[...]xxx中文[combining low line]xxx[...]xxx你好ESC [ 23 G y: 53 | xxxxxxxxxxxxxxxxxxxx中文̲xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23Gy 54 | 55 | xxx[...]xxx中文[combining low line]。xxx[...]xxx你好xESC [ 23 G y: 56 | xxxxxxxxxxxxxxxxxxxx中文̲。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23Gy 57 | 58 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting1.txt: -------------------------------------------------------------------------------- 1 | Overwriting an East Asian wide character with another one: 2 | 3 | 中国 ESC [ 2 D 文: 4 | 中国[2D文 5 | 6 | xxx中文 ESC [ 2 D 国: 7 | xxx中文[2D国 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你好[23G国 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好xESC [ 23 G 国: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[23G国 17 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting2.txt: -------------------------------------------------------------------------------- 1 | Inserting an East Asian wide character into the middle of another one: 2 | 3 | 中国 ESC [ D 文: 4 | 中国[D文 5 | 6 | xxx中文 ESC [ D 国: 7 | xxx中文[D国 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[24G国 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G 国: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[24G国 17 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting3.txt: -------------------------------------------------------------------------------- 1 | Overwriting an East Asian wide character with a narrow character: 2 | 3 | 中国 ESC [ 2 D x: 4 | 中国[2Dx 5 | 6 | xxx中文 ESC [ 2 D x: 7 | xxx中文[2Dx 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你好x[23Gy 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好ESC [ 23 G y: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[23Gy 17 | -------------------------------------------------------------------------------- /tests/wideChars/overwriting4.txt: -------------------------------------------------------------------------------- 1 | Overwriting a narrow character with an East Asian wide character: 2 | 3 | xxx ESC [ D 中: 4 | xxx[D中 5 | 6 | xxx ESC [ 3 D 中: 7 | xxx[3D中 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[25G版 14 | 15 | xxx[...]xxx中文y。xxx[...]xxx你好ESC [ 25 G 版: 16 | xxxxxxxxxxxxxxxxxxxx中文y。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[25G版 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 | 中国[Dx 5 | 6 | xxx中文 ESC [ D x: 7 | xxx中文[Dx 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你好x[24Gy 14 | 15 | xxx[...]xxx中文。xxx[...]xxx你好ESC [ 24 G y: 16 | xxxxxxxxxxxxxxxxxxxx中文。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[24Gy 17 | -------------------------------------------------------------------------------- /tests/wideChars/sip-chars.txt: -------------------------------------------------------------------------------- 1 | East Asian wide characters in the Supplementary Ideographic Plane (thanks to 2 | http://www.i18nguy.com/unicode/supplementary-test.html): 3 | 4 | 𠜎𠜱𠝹𠱓𠱸 5 | 6 | Mixed East Asian wide characters from the BMP and SIP: 7 | 8 | 中文:𠜎𠜱,你好,𠝹国。 9 | 𠱸,中文:你好,𠝹国。 10 | 11 | Narrow characters and mixed east Asian wide characters from the BMP and SIP, in 12 | an 80-column line: 13 | xxxxxxxxxx中文:𠜎𠜱,你好,xx𠝹国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好xxxxxxxxxx 14 | xxxxxxxxxx𠱸,中文:你xx好,𠝹国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx好 15 | 16 | Overwriting an East Asian wide character from the SIP with a narrow character: 17 | 18 | 中文:𠜎 ESC [ 2 D x: 19 | 中文:𠜎[2Dx 20 | 21 | xxx中文:𠜎 ESC [ 2 D x: 22 | xxx中文:𠜎[2Dx 23 | 24 | Overwriting an East Asian wide character from the SIP with a narrow character, 25 | in the middle of an 80-column line with mixed narrow and wide chars: 26 | 27 | xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 27 G y: 28 | xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[27Gy 29 | 30 | xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 27 G y: 31 | xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[27Gy 32 | 33 | Overwriting an East Asian wide character from the SIP with an East Asian wide 34 | character from the BMP: 35 | 36 | 中文:𠜎 ESC [ 2 D 国: 37 | 中文:𠜎[2D国 38 | 39 | xxx中文:𠜎 ESC [ 2 D 国: 40 | xxx中文:𠜎[2D国 41 | 42 | Overwriting an East Asian wide character from the SIP with an East Asian wide 43 | character from the BMP in the middle of an 80-column line with mixed narrow and 44 | wide chars: 45 | 46 | xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 27 G 国: 47 | xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[27G国 48 | 49 | xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 27 G 国: 50 | xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[27G国 51 | 52 | Overwriting an East Asian wide character from the BMP with an East Asian wide 53 | character from the SIP: 54 | 55 | 中文:国 ESC [ 2 D 𠜎: 56 | 中文:国[2D𠜎 57 | 58 | xxx中文:国 ESC [ 2 D 𠜎: 59 | xxx中文:国[2D𠜎 60 | 61 | Overwriting an East Asian wide character from the BMP with an East Asian wide 62 | character from the SIP in the middle of an 80-column line with mixed narrow and 63 | wide chars: 64 | 65 | xxx[...]xxx中文:国xxx[...]xxx你好xESC [ 27 G 𠜎: 66 | xxxxxxxxxxxxxxxxxxxx中文:国xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[27G𠜎 67 | 68 | xxx[...]xxx中文:国。xxx[...]xxx你好ESC [ 27 G 𠜎: 69 | xxxxxxxxxxxxxxxxxxxx中文:国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[27G𠜎 70 | 71 | Inserting a narrow character into the middle of an East Asian wide character 72 | from the SIP in the middle of an 80-column line with mixed narrow and wide 73 | chars: 74 | 75 | xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 28 G y: 76 | xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[28Gy 77 | 78 | xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 28 G y: 79 | xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[28Gy 80 | 81 | Inserting an East Asian wide character from the SIP into the middle of an East 82 | Asian wide character from the BMP in the middle of an 80-column line with mixed 83 | narrow and wide chars: 84 | 85 | xxx[...]xxx中文:国xxx[...]xxx你好xESC [ 28 G 𠜎: 86 | xxxxxxxxxxxxxxxxxxxx中文:国xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[28G𠜎 87 | 88 | xxx[...]xxx中文:国。xxx[...]xxx你好ESC [ 28 G 𠜎: 89 | xxxxxxxxxxxxxxxxxxxx中文:国。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[28G𠜎 90 | 91 | Inserting an East Asian wide character from the BMP into the middle of an East 92 | Asian wide character from the SIP in the middle of an 80-column line with mixed 93 | narrow and wide chars: 94 | 95 | xxx[...]xxx中文:𠜎xxx[...]xxx你好xESC [ 28 G 国: 96 | xxxxxxxxxxxxxxxxxxxx中文:𠜎xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好x[28G国 97 | 98 | xxx[...]xxx中文:𠜎。xxx[...]xxx你好ESC [ 28 G 国: 99 | xxxxxxxxxxxxxxxxxxxx中文:𠜎。xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx你好[28G国 100 | 101 | -------------------------------------------------------------------------------- /tools/build-debug: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # command line build script for building debug version 3 | set -e 4 | 5 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | ATE_ROOT="$( cd $DIR/.. && pwd )" 7 | 8 | cd "$ATE_ROOT" 9 | 10 | if [ ! -f "local.properties" ]; then 11 | echo "local.properties does not exist. Please create it." 12 | exit 1 13 | fi 14 | 15 | ./gradlew assembleDebug 16 | -------------------------------------------------------------------------------- /tools/build-release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # command line build script for building release version 3 | # This will only work on my (Jack Palevich) computer, because it 4 | # requires the private key store used to sign the release version 5 | # of Terminal Emulator for Android. 6 | set -e 7 | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 9 | ATE_ROOT="$( cd $DIR/.. && pwd )" 10 | 11 | cd "$ATE_ROOT" 12 | 13 | if [ ! -f "local.properties" ]; then 14 | echo "local.properties does not exist. Please create it." 15 | exit 1 16 | fi 17 | 18 | ./gradlew assembleRelease && ./tools/sign-release-build 19 | -------------------------------------------------------------------------------- /tools/import-icons: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | ATE_ROOT="$( cd $DIR/.. && pwd )" 7 | 8 | cd "$ATE_ROOT" 9 | 10 | if [ "$#" -ne 1 ] || ! [ -f "$1-512.png" ]; then 11 | echo "Usage: $0 BASE_PATH_OF_ICONS_TO_IMPORT" >&2 12 | exit 1 13 | fi 14 | 15 | ICON=$1 16 | 17 | RES=term/src/main/res 18 | IC_LAUNCHER=ic_launcher.png 19 | 20 | cp $ICON-48.png $RES/drawable/$IC_LAUNCHER 21 | cp $ICON-36.png $RES/drawable-ldpi/$IC_LAUNCHER 22 | cp $ICON-48.png $RES/drawable-mdpi/$IC_LAUNCHER 23 | cp $ICON-72.png $RES/drawable-hdpi/$IC_LAUNCHER 24 | cp $ICON-96.png $RES/drawable-xhdpi/$IC_LAUNCHER 25 | cp $ICON-144.png $RES/drawable-xxhdpi/$IC_LAUNCHER 26 | cp $ICON-192.png $RES/drawable-xxxhdpi/$IC_LAUNCHER 27 | 28 | cp $ICON-512.png artwork/android-terminal-emulator-512.png 29 | 30 | echo "Remember to update artwork/Feature Graphic.xcf" 31 | -------------------------------------------------------------------------------- /tools/increment-version-number: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # command line build script for building release version 3 | # This will only work on my (Jack Palevich) computer, because it 4 | # requires the private key store used to sign the release version 5 | # of Terminal Emulator for Android. 6 | set -e 7 | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 9 | ATE_ROOT="$( cd $DIR/.. && pwd )" 10 | 11 | cd "$ATE_ROOT" 12 | 13 | MANIFEST="./term/src/main/AndroidManifest.xml" 14 | 15 | if [ ! -f "$MANIFEST" ]; then 16 | echo "manifest $MANIFEST not found." 17 | exit 1 18 | fi 19 | 20 | perl -i -pe 's/(?<=android:versionName="1.0.)(\d+)/$1+1/e;s/(?<=android:versionCode=")(\d+)/$1+1/e;' "$MANIFEST" 21 | -------------------------------------------------------------------------------- /tools/install-sdk-packages: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # command line build script for installing required SDK packages. 3 | set -e 4 | 5 | if [ -z "${ANDROID_SDK_ROOT+xxx}" ]; then 6 | echo "Please define ANDROID_SDK_ROOT to point to the Android SDK" 7 | exit 1 8 | fi 9 | 10 | if [ ! -d "$ANDROID_SDK_ROOT" ]; then 11 | echo "The directory $ANDROID_SDK_ROOT = ${ANDROID_SDK_ROOT} does not exist." 12 | exit 1 13 | fi 14 | 15 | ANDROID="$ANDROID_SDK_ROOT/tools/android" 16 | 17 | # The available SDK versions can be listed by: 18 | # $ANDROID list sdk --all -e 19 | 20 | # The update sdk command takes a comma-separated list of packages to install. 21 | # Installing them all at once may simplify the process of agreeing to licenses. 22 | 23 | $ANDROID update sdk -u -a -t android-22,build-tools-22.0.1,extra-android-m2repository 24 | -------------------------------------------------------------------------------- /tools/push-and-run-debug: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # command line build script for installing and running terminal emulator. 3 | set -e 4 | 5 | if [ -z "${ANDROID_SDK_ROOT+xxx}" ]; then 6 | echo "Please define ANDROID_SDK_ROOT to point to the Android SDK" 7 | exit 1 8 | fi 9 | 10 | if [ ! -d "$ANDROID_SDK_ROOT" ]; then 11 | echo "The directory $ANDROID_SDK_ROOT = ${ANDROID_SDK_ROOT} does not exist." 12 | exit 1 13 | fi 14 | 15 | ADB="$ANDROID_SDK_ROOT/platform-tools/adb" 16 | 17 | $ADB uninstall jackpal.androidterm 18 | $ADB install -r term/build/outputs/apk/term-debug.apk && $ADB shell am start -n jackpal.androidterm/jackpal.androidterm.Term 19 | -------------------------------------------------------------------------------- /tools/push-and-run-release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # command line build script for installing and running terminal emulator. 3 | set -e 4 | 5 | if [ -z "${ANDROID_SDK_ROOT+xxx}" ]; then 6 | echo "Please define ANDROID_SDK_ROOT to point to the Android SDK" 7 | exit 1 8 | fi 9 | 10 | if [ ! -d "$ANDROID_SDK_ROOT" ]; then 11 | echo "The directory $ANDROID_SDK_ROOT = ${ANDROID_SDK_ROOT} does not exist." 12 | exit 1 13 | fi 14 | 15 | ADB="$ANDROID_SDK_ROOT/platform-tools/adb" 16 | 17 | $ADB uninstall jackpal.androidterm 18 | $ADB install -r term/build/outputs/apk/Term.apk && $ADB shell am start -n jackpal.androidterm/jackpal.androidterm.Term 19 | -------------------------------------------------------------------------------- /tools/push-samples-debug: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # command line build script for installing and running terminal emulator. 3 | set -e 4 | 5 | if [ -z "${ANDROID_SDK_ROOT+xxx}" ]; then 6 | echo "Please define ANDROID_SDK_ROOT to point to the Android SDK" 7 | exit 1 8 | fi 9 | 10 | if [ ! -d "$ANDROID_SDK_ROOT" ]; then 11 | echo "The directory $ANDROID_SDK_ROOT = ${ANDROID_SDK_ROOT} does not exist." 12 | exit 1 13 | fi 14 | 15 | ADB="$ANDROID_SDK_ROOT/platform-tools/adb" 16 | 17 | $ADB uninstall jackpal.androidterm.sample.intents 18 | $ADB install -r samples/intents/build/outputs/apk/intents-debug.apk 19 | 20 | $ADB uninstall jackpal.androidterm.sample.pathbroadcasts 21 | $ADB install -r samples/pathbroadcasts/build/outputs/apk/pathbroadcasts-debug.apk 22 | 23 | $ADB uninstall jackpal.androidterm.sample.telnet 24 | $ADB install -r samples/telnet/build/outputs/apk/telnet-debug.apk 25 | -------------------------------------------------------------------------------- /tools/sign-release-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script to sign the APK. Only needed by Jack Palevich. 4 | 5 | # command line build script for building release version 6 | # This will only work on my (Jack Palevich) computer, because it 7 | # requires the private key store used to sign the release version 8 | # of Terminal Emulator for Android. 9 | set -e 10 | 11 | ANDROID_TERMINAL_EMULATOR_KEYSTORE="$HOME/Documents/workspace/keystore/jackpal.keystore" 12 | 13 | ZIPALIGN="/Users/jack/Library/Android/sdk/build-tools/21.1.2/zipalign" 14 | 15 | if [ ! -f "$ANDROID_TERMINAL_EMULATOR_KEYSTORE" ]; then 16 | echo "Release keystore file is missing at ${ANDROID_TERMINAL_EMULATOR_KEYSTORE}. Cannot build release build." 17 | exit 1 18 | fi 19 | 20 | if [ ! -f "$ZIPALIGN" ]; then 21 | echo "Zipalign tool is missing at ${ZIPALIGN}. Cannot build release build." 22 | exit 1 23 | fi 24 | 25 | 26 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 27 | 28 | APKDIR="$DIR/../term/build/outputs/apk" 29 | 30 | if [ ! -d "$APKDIR" ]; then 31 | echo "No APK directory $APKDIR" 32 | exit 1 33 | fi 34 | 35 | cd "$APKDIR" 36 | 37 | jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 \ 38 | -keystore "$ANDROID_TERMINAL_EMULATOR_KEYSTORE" \ 39 | -signedjar term-release-signed.apk \ 40 | term-release-unsigned.apk jackpal.keystore 41 | 42 | # Verify signature 43 | # jarsigner -verify -verbose -certs term-release-signed.apk 44 | 45 | # Align for faster loading. 46 | 47 | rm -f Term.apk 48 | "$ZIPALIGN" -v 4 term-release-signed.apk Term.apk 49 | 50 | echo "Signed-and-aligned APK:" 51 | echo `pwd`/Term.apk 52 | 53 | --------------------------------------------------------------------------------