4 |
5 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/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 |
2 |
6 |
7 |
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 |
2 |
3 |
This package provides a fairly complete VT100 terminal emulator {@link
4 | jackpal.androidterm.emulatorview.TermSession TermSession} and a corresponding
5 | Android view {@link jackpal.androidterm.emulatorview.EmulatorView EmulatorView}.
6 |
7 |
Most users will create a TermSession, connect it to an {@link
8 | java.io.InputStream InputStream} and {@link java.io.OutputStream OutputStream}
9 | from the emulation client, then instantiate the EmulatorView and
10 | add it to an activity's layout.
11 |
12 |
13 |
--------------------------------------------------------------------------------
/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 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/libtermexec/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
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
21 | #include "jni.h"
22 | #include
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 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/intents/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
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 |
2 |
6 |
7 |
12 |
13 |
18 |
19 |
24 |
25 |
29 |
30 |
35 |
36 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/samples/intents/src/main/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | ATE Intent サンプル
4 | 新しいウインドウを開く
5 | スクリプト:
6 | スクリプト実行
7 | スクリプトを実行しウインドウを保存
8 | 保存されたウインドウでスクリプトを実行
9 | このサンプルは Android端末エミュレータへインテントを送る方法を示しています.
10 |
11 |
12 | echo \'Hello, world!\'
13 |
14 |
--------------------------------------------------------------------------------
/samples/intents/src/main/res/values-ko/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | ATE Intent 예제
4 | 새로운 창 열기
5 | 스크립트 :
6 | 스크립트 실행
7 | 스크립트 실행 및 명령창 상태 저장
8 | 저장된 명령창에서 스크립트 실행
9 | 이 예제는 터미널 에뮬레이터에서 어떻게 Intent를 전송하는지 보여줍니다.
10 |
11 |
--------------------------------------------------------------------------------
/samples/intents/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | TEA Intent Sample
4 | Open New Window
5 | Script:
6 | Run Script
7 | Run Script and Save Window
8 | Run Script in Saved Window
9 | This sample shows how to send intents to Android Terminal Emulator.
10 |
11 |
12 | echo \'Hello, world!\'
13 |
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 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
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 |
2 |
3 | TEA Path Broadcast Sample
4 |
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 |
2 |
6 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
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 |
2 |
6 |
7 |
12 |
13 |
18 |
19 |
24 |
25 |
30 |
31 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/samples/telnet/src/main/res/layout/term_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
20 |
21 |
29 |
30 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/samples/telnet/src/main/res/values-ko/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 텔넷
4 | 쉘 열기
5 | 연결
6 | 텔넷 경로 :
7 | 전송
8 | 이 예제는 EmulatorView 위젯과 TermSession 클래스를 통해 텔넷이 어떻게 작동하는지 보여줍니다.
9 |
10 |
11 | telehack.com
12 |
13 |
--------------------------------------------------------------------------------
/samples/telnet/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | TEA Telet Sample
4 | Open shell
5 | Connect
6 | Telnet to:
7 | Send
8 | This example Telnet client demonstrates the use of the EmulatorView widget and the TermSession class.
9 |
10 |
11 | telehack.com
12 |
13 |
--------------------------------------------------------------------------------
/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 |
2 |
3 |
4 |
5 |
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; i1) 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(WFindClass(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
37 |
38 | #include "jni.h"
39 | #include
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
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
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
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 |
2 |
16 |
17 |
18 |
19 |
20 |
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 |
2 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/term/src/main/res/layout/window_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
24 |
32 |
39 |
47 |
48 |
--------------------------------------------------------------------------------
/term/src/main/res/layout/window_list_new_window.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
28 |
--------------------------------------------------------------------------------
/term/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
46 |
--------------------------------------------------------------------------------
/term/src/main/res/values-iw/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | הצג שורת המצב
20 | הסתר שורת מצב
21 |
22 |
23 | הצג תמיד שורת מצב
24 | הסתר בר פעולות (הקש בחלק עליון של המסך או על כפתור תפריט כדי להציג)
25 |
26 |
27 | אוטומטי
28 | שוכב
29 | עומד
30 |
31 |
32 | סמן לא מהבהב
33 | סמן מהבהב
34 |
35 |
36 | מלבן
37 | קו תחתון
38 | קו ניצב
39 |
40 |
41 | 4 * 8 פיקסלים
42 | 6 נק\'
43 | 7 נק\'
44 | 8 נק\'
45 | 9 נק\'
46 | 10 נק\'
47 | 12 נק\'
48 | 14 נק\'
49 | 16 נק\'
50 | 20 נק\'
51 | 24 נק\'
52 | 28 נק\'
53 | 32 נק\'
54 | 36 נק\'
55 | 42 נק\'
56 | 48 נק\'
57 | 64 נק\'
58 | 72 נק\'
59 | 96 נק\'
60 | 144 נק\'
61 | 288 נק\'
62 |
63 |
64 | טקסט שחור על לבן
65 | טקסט לבן על שחור
66 | טקסט לבן על כחול
67 | טקסט ירוק על שחור
68 | טקסט אמבר על שחור
69 | טקסט אדום על שחור
70 | טקסט כחול הולו על שחור
71 | Solarized Light
72 | Solarized Dark
73 | מסוף לינוקס
74 |
75 |
76 | סוגר את חלונות מסוף
77 | סוגר את חלון המסוף הנוכחי בלבד
78 | סוגר פעילות, ומשאיר הפעלות רצות
79 | שולח ESC למסוף
80 | שולח TAB למסוף
81 |
82 |
83 | רענון הכדור
84 | \@ מפתח
85 | מקש ALT שמאלי
86 | מקש ALT ימני
87 | מקש קול עליון
88 | מקש קוך תחתון
89 | לחצן מצלמה
90 | ריק
91 |
92 |
93 | רענון הכדור
94 | \@ מפתח
95 | מקש ALT שמאלי
96 | מקש ALT ימני
97 | מקש קול עליון
98 | מקש קוך תחתון
99 | לחצן מצלמה
100 | ריק
101 |
102 |
103 | מבוסס תווים
104 | מבוסס מילים
105 |
106 |
107 | כדור
108 | \@
109 | ALT-שמאלי
110 | ALT-ימני
111 | קול עליון
112 | קול תחתון
113 | מצלמה
114 | ריק
115 |
116 |
117 | כדור
118 | \@
119 | ALT-שמאלי
120 | ALT-ימני
121 | קול עליון
122 | קול תחתון
123 | מצלמה
124 | ריק
125 |
126 |
127 |
--------------------------------------------------------------------------------
/term/src/main/res/values-pt-rPT/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | Terminal Emulator
19 | Preferências
20 | Reset terminal
21 | Email para
22 | Teclas especiais
23 | Abrir teclado
24 |
25 | Editar texto
26 | Seleccionar texto
27 | Copiar tudo
28 | Colar
29 |
30 |
31 | Ecrã
32 |
33 | Barra de notificações
34 | Mostrar/esconder barra de notificações
35 | Barra de notificações
36 |
37 | Estilo do cursor
38 | Escolha o estilo do cursor
39 | Estilo do cursor
40 |
41 | Piscar do cursor
42 | Escolher piscar do cursor
43 | Piscar do cursor
44 |
45 | Texto
46 |
47 | Tamanho do texto
48 | Escolher a altura dos caracteres em pontos
49 | Tamanho do texto
50 |
51 | Côres
52 | Escolher côr do texto
53 | Côr do texto
54 |
55 | Teclado
56 |
57 | Tecla control
58 | Escolher tecla control
59 | Tecla control
60 |
61 | Método de entrada
62 | Escolher método de entrada
63 | Método de entrada
64 |
65 | Shell
66 | Linha de comandos
67 | Especificar a linha de comando do shell
68 | Shell
69 |
70 | Comando inicial
71 | Enviar para o shell no arranque
72 | Comando inicial
73 |
74 |
75 |
--------------------------------------------------------------------------------
/term/src/main/res/values-ru/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Трекбол
5 | \@
6 | LAlt
7 | RAlt
8 | Vol+
9 | Vol-
10 | Камера
11 | Нет
12 |
13 |
14 | Всегда показывать
15 | Скрывать панель действий (коснитесь верха экрана или клавиши «Меню», чтобы её показать)
16 |
17 |
18 | Закрыть все окна терминала
19 | Закрыть текущее окно терминала
20 | Закрывает приложение, но оставляет запущенным терминал
21 | Посылает ESC в терминал
22 | Посылает TAB в терминал
23 |
24 |
25 | Чёрный на белом
26 | Белый на чёрном
27 | Белый на синем
28 | Зелёный на чёрном
29 | Жёлтый на чёрном
30 | Красный на чёрном
31 | Голубой на чёрном
32 | Соляризованный светлый
33 | Соляризованный тёмный
34 | Консоль Linux
35 |
36 |
37 | Трекбол
38 | Клавиша @
39 | Левый Alt
40 | Правый Alt
41 | Громкость вверх
42 | Громкость вниз
43 | Клавиша камеры
44 | Нет
45 |
46 |
47 | Немигающий курсор
48 | Мигающий курсор
49 |
50 |
51 | Прямоугольник
52 | Подчеркивание
53 | Вертикальная черта
54 |
55 |
56 | Трекбол
57 | Клавиша @
58 | Левый Alt
59 | Правый Alt
60 | Громкость вверх
61 | Громкость вниз
62 | Клавиша камеры
63 | Нет
64 |
65 |
66 | 4 x 8 пикселей
67 | 6 пунктов
68 | 7 пунктов
69 | 8 пунктов
70 | 9 пунктов
71 | 10 пунктов
72 | 12 пунктов
73 | 14 пунктов
74 | 16 пунктов
75 | 20 пунктов
76 | 24 пункта
77 | 28 пунктов
78 | 32 пункта
79 | 36 пунктов
80 | 42 пункта
81 | 48 пунктов
82 | 64 пункта
83 | 72 пункта
84 | 96 пунктов
85 | 144 пункта
86 | 288 пунктов
87 |
88 |
89 | По символам
90 | По словам
91 |
92 |
93 | Автоматически
94 | Альбомная
95 | Портретная
96 |
97 |
98 | Показывать
99 | Скрывать
100 |
101 |
102 | Трекбол
103 | \@
104 | LAlt
105 | RAlt
106 | Vol+
107 | Vol-
108 | Камера
109 | Нет
110 |
111 |
112 |
--------------------------------------------------------------------------------
/term/src/main/res/values-sv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Terminalemulator
4 | Inställningar
5 | Återställ terminal
6 | E-posta till
7 | Special tangenter
8 | Växla till virtuellt tangentbord
9 | Aktivera VäckningsLås
10 | Inaktivera VäckningsLås
11 | Aktivera WifiLås
12 | Inaktivera WifiLås
13 | Redigera text
14 | Markera text
15 | Kopiera allt
16 | Klistra in
17 | Terminalsessionen är igång
18 | Skärm
19 | Statusfält
20 | Visa/Dölj statusfält
21 | Statusfält
22 | Markörstil
23 | Välj markörstil.
24 | Markörstil
25 | Blinkande markör
26 | Välj blinkande markör
27 | Blinkande markör
28 | Text
29 | Teckenstorlek
30 | Välj teckenhöjd i punkter.
31 | Teckenstorlek
32 | Färger
33 | Välj textfärg.
34 | Textfärg
35 | Tangentbord
36 | Ctrl-tangent
37 | Välj Ctrl-tangent
38 | Ctrl-tangent
39 | Fn-tangent
40 | Välj Fn-tangent.
41 | Fn-tangent
42 | Inmatningsmetod
43 | Välj inmatningsmetod för virtuellt tangentbord.
44 | Inmatningsmetod
45 | Skal
46 | Kommandorad
47 | Ange skalkommandorad.
48 | Skal
49 | Inledande kommando
50 | Skickas till skalet när det börjar.
51 | Inledande kommando
52 |
53 |
--------------------------------------------------------------------------------
/term/src/main/res/values-tr/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | Uyarı çubuğunu göster
21 | Uyarı çubuğunu sakla
22 |
23 |
24 |
25 | Non-blinking cursor
26 | Blinking cursor
27 |
28 |
29 |
30 | Rectangle
31 | Underline
32 | Vertical bar
33 |
34 |
35 |
36 | 4 x 8 piksel
37 | 6 pt
38 | 7 pt
39 | 8 pt
40 | 9 pt
41 | 10 pt
42 | 12 pt
43 | 14 pt
44 | 16 pt
45 | 20 pt
46 | 24 pt
47 | 28 pt
48 | 32 pt
49 | 36 pt
50 | 42 pt
51 | 48 pt
52 | 64 pt
53 | 72 pt
54 | 96 pt
55 | 144 pt
56 | 288 pt
57 |
58 |
59 |
60 | Beyaz arkaplan üzerinde siyah metin
61 | Siyah arkaplan üzerinde beyaz metin
62 | Mavi arkaplan üzerinde beyaz metin
63 | Siyah arkaplan üzerinde yeşil metin
64 | Siyah arkaplan üzerinde turuncu metin
65 | Siyah arkaplan üzerinde kırmızı metin
66 | Solarized Light
67 | Solarized Dark
68 | Linux Console
69 |
70 |
71 |
72 | Jog ball
73 | \@ Tuşu
74 | Sol Alt Tuşu
75 | Sağ Alt Tuşu
76 | Ses Arttırma Tuşu
77 | Ses Kısma Tuşu
78 | Kamera Tuşu
79 |
80 |
81 |
82 | Harf tabanlı
83 | Kelime tabanlı
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/term/src/main/res/values-tr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | Terminal Emülatörü
19 | Tercihler
20 | Terminali yeniden başlat
21 | Email olarak yolla
22 | Özel tuşlar
23 | Ekran klavyesine geç
24 |
25 | Metni düzenle
26 | Metni seç
27 | Hepsini kopyala
28 | Yapıştır
29 |
30 |
31 | Ekran
32 |
33 | Uyarı çubuğu
34 | Uyarı çubuğunu göster/gizle.
35 | Uyarı çubuğu
36 |
37 | İmleç stili
38 | İmleç stili seçin.
39 | İmleç stili
40 |
41 | Cursor blink
42 | Choose cursor blink.
43 | Cursor blink
44 |
45 | Metin
46 |
47 | Karakter boyutu
48 | Karakter büyüklüğü seçin.
49 | Karakter boyutu
50 |
51 | Renkler
52 | Metin rengini seçin.
53 | Metin rengi
54 |
55 | Klavye
56 |
57 | Kontrol tuşu
58 | Kontrol tuşunu seçin.
59 | Kontrol tuşu
60 |
61 | Giriş yöntemi
62 | Ekran klavyesi için giriş yöntemi seçin.
63 | Giriş yöntemi
64 |
65 | Kabuk
66 | Komut satırı
67 | Kabukta kullanılacak komut satırını belirtin.
68 | Kabuk
69 |
70 | Başlangıç komutu
71 | Başlangıçta kabukta çalıştır.
72 | Başlangıç komutu
73 |
74 |
--------------------------------------------------------------------------------
/term/src/main/res/values-uk/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Показувати
5 | Приховувати
6 |
7 |
8 | Завжди показувати бар дії
9 | Сховати дії бару (торкніться верху екрану або клавіші Меню, щоб показати)
10 |
11 |
12 | Не-миготливий курсор
13 | Миготливий курсор
14 |
15 |
16 | Прямокутник
17 | Підкреслення
18 | Вертикальний бар
19 |
20 |
21 | 4 x 8 пікселів
22 | 6 пікселів
23 | 7 пікселів
24 | 8 пікселів
25 | 9 пікселів
26 | 10 пікселів
27 | 12 пікселів
28 | 14 пікселів
29 | 16 пікселів
30 | 20 пікселів
31 | 24 пікселів
32 | 28 пікселів
33 | 32 пікселів
34 | 36 пікселів
35 | 42 пікселів
36 | 48 пікселів
37 | 64 пікселів
38 | 72 пікселів
39 | 96 пікселів
40 | 144 пікселів
41 | 288 пікселів
42 |
43 |
44 | Чорний на білому
45 | Білий на чорному
46 | Білий на синьому
47 | Зелений на чорному
48 | Жовтий на чорному
49 | Червоний на чорному
50 | Solarized Light
51 | Solarized Dark
52 | Linux Console
53 |
54 |
55 | Закрити всі вікна терміналу
56 | Закрити тільки це вікно терміналу
57 | Активне закриття, решти запущених сеансів
58 | Послати ESC в термінал
59 | Послати TAB в термінал
60 |
61 |
62 | Куля Jog
63 | Клавіша @
64 | Лівий Alt
65 | Правий Alt
66 | Гучність вверх
67 | Гучність вниз
68 | Клавіша камери
69 | Нема
70 |
71 |
72 | Куля Jog
73 | Клавіша @
74 | Лівий Alt
75 | Правий Alt
76 | Гучність вверх
77 | Гучність вниз
78 | Клавіша камери
79 | Нема
80 |
81 |
82 | За знаками
83 | За словами
84 |
85 |
86 | Куля Jog
87 | Клавіша @
88 | Лівий Alt
89 | Правий Alt
90 | Гучність вверх
91 | Гучність вниз
92 | Клавіша камери
93 | Нема
94 |
95 |
96 | Куля Jog
97 | Клавіша @
98 | Лівий Alt
99 | Правий Alt
100 | Гучність вверх
101 | Гучність вниз
102 | Клавіша камери
103 | Нема
104 |
105 |
106 |
--------------------------------------------------------------------------------
/term/src/main/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
15 |
18 |
22 |
25 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/term/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #607D8B
3 | #455A64
4 | #8BC34A
5 |
6 |
--------------------------------------------------------------------------------
/term/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
9 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/term/src/main/res/values/arraysNoLocalize.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 | 1
23 | 0
24 |
25 |
26 |
27 |
28 | 1
29 | 2
30 |
31 |
32 |
33 | 0
34 | 1
35 | 2
36 |
37 |
38 |
39 | 0
40 | 1
41 |
42 |
43 |
44 | 0
45 | 1
46 | 2
47 |
48 |
49 |
50 |
51 | 0
52 | 6
53 | 7
54 | 8
55 | 9
56 | 10
57 | 12
58 | 14
59 | 16
60 | 20
61 | 24
62 | 28
63 | 32
64 | 36
65 | 42
66 | 48
67 | 64
68 | 72
69 | 96
70 | 144
71 | 288
72 |
73 |
74 |
75 | 0
76 | 1
77 | 2
78 | 3
79 | 4
80 | 5
81 | 6
82 | 7
83 | 8
84 | 9
85 |
86 |
87 |
88 | 0
89 | 1
90 | 2
91 | 3
92 | 4
93 |
94 |
95 |
96 | 0
97 | 1
98 | 2
99 | 3
100 | 4
101 | 5
102 | 6
103 | 7
104 |
105 |
106 |
107 | 0
108 | 1
109 | 2
110 | 3
111 | 4
112 | 5
113 | 6
114 | 7
115 |
116 |
117 |
118 | 0
119 | 1
120 |
121 |
122 |
123 | vt100
124 | screen
125 | linux
126 | screen-256color
127 | xterm
128 |
129 |
130 |
--------------------------------------------------------------------------------
/term/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/term/src/main/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1
5 | 1
6 | 0
7 | 0
8 | 0
9 | 10
10 | 1
11 | false
12 | 2
13 | 5
14 | 4
15 | 0
16 | false
17 | /system/bin/sh -
18 |
19 | screen
20 | true
21 | true
22 | true
23 | true
24 |
25 | false
26 | true
27 |
28 |
--------------------------------------------------------------------------------
/term/src/main/res/values/id.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/term/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
21 |
26 |
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 |
2 |
6 |
7 |
8 |
9 |
12 |
13 |
16 |
17 |
18 |
19 |
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 |
2 |
3 |
4 | Emulatorview-testTest
5 |
6 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------