Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
#built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Windows thumbnail db
Thumbs.db

# OSX files
.DS_Store
/build

# Android Studio
*.iml
/.idea/.name
/.idea/gradle.xml
/.idea/misc.xml
/.idea/modules.xml
/term/term-release.apk
/term/Term-nh.apk
release
.idea
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
.gradle
build/
.navigation
captures/
output.json

#NDK
obj/
.externalNativeBuild
22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/scopes/scope_settings.xml

This file was deleted.

2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ LOCAL_SRC_FILES := $(nhterm_dir)/$(nhterm_apk)
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

include $(BUILD_PREBUILT)
include $(BUILD_PREBUILT)
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#NetHunter Terminal Emulator
# NetHunter Terminal Emulator

This is a new fork of the Android Terminal Emulator so we can adapt it to our neeeds for Kali Linux Nethunter.
This is a new fork of the Android Terminal Emulator so we can adapt it to our neeeds for Kali NetHunter.

Dependencies running the terminal:

Nedds a full instalation (included the chroot install) of Kali Nethunter
Needs a full installation of Kali NetHunter (including chroot)



Buiding from sources:
Building from sources:

(Todo) see: https://github.com/jmingov/NetHunter-Terminal-Emulator/blob/master/docs/Building.md


Since the original proyect is "ended" we left here the credits an licenses:
Since the original project has "ended" we'll include the credits and licenses below:


Original author: https://github.com/jackpal

Original proyect: https://github.com/jackpal/Android-Terminal-Emulator
Original project: https://github.com/jackpal/Android-Terminal-Emulator

License: The same as the original proyect. (Thouse files are [included](https://github.com/jmingov/NetHunter-Terminal-Emulator/blob/master/NOTICE) in this proyect too.)
License: The same as the original project. (Thouse files are [included](https://github.com/jmingov/NetHunter-Terminal-Emulator/blob/master/NOTICE) in this project too.)
22 changes: 14 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
task wrapper (type:Wrapper) {
gradleVersion = '4.1'
distributionUrl = 'https://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip'
}

buildscript {
repositories {
jcenter()
Expand All @@ -13,12 +7,24 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta3'
classpath 'com.android.tools.build:gradle:3.2.0'
}
}


allprojects {
repositories {
jcenter()
google()
}
}
}

ext {
compileSdkVersion=28
minSdkVersion=14
targetSdkVersion=28
//version=YYYYMMVVRR (Either "VV" for stable version OR "RR" for pre-release candidate (e.g. 0001 for rc1)
versionCode=2019020002
versionName="2019.2-rc2"
}

14 changes: 10 additions & 4 deletions emulatorview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
apply plugin: 'com.android.library'

repositories {
jcenter()
google()
}

android {
compileSdkVersion 25
buildToolsVersion "25"
<<<<<<< HEAD
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 4
targetSdkVersion 25
minSdkVersion 14
targetSdkVersion 27
}

buildTypes {
Expand Down
1 change: 0 additions & 1 deletion emulatorview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
package="com.offsec.nhterm.emulatorview"
android:versionCode="43"
android:versionName="1.0.42">
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ public interface FinishCallback {
private FinishCallback mFinishCallback;

private boolean mIsRunning = false;
private final Handler mMsgHandler = new Handler() {

private final Handler mMsgHandler = new Handler(new Handler.Callback() {
@Override
public void handleMessage(Message msg) {
public boolean handleMessage(Message msg) {
if (!mIsRunning) {
return;
return false;
}
if (msg.what == NEW_INPUT) {
readFromProcess();
Expand All @@ -128,8 +129,9 @@ public void run() {
}
});
}
return true;
}
};
});

private UpdateCallback mTitleChangedListener;

Expand Down Expand Up @@ -186,16 +188,17 @@ public void run() {
Looper.prepare();

Log.d("TermSession.java: ", "new Handler");
mWriterHandler = new Handler() {
mWriterHandler = new Handler(new Handler.Callback() {
@Override
public void handleMessage(Message msg) {
public boolean handleMessage(Message msg) {
if (msg.what == NEW_OUTPUT) {
writeToOutput();
} else if (msg.what == FINISH) {
Looper.myLooper().quit();
}
return true;
}
};
});

// Drain anything in the queue from before we started
Log.d("TermSession.java: ", "writeToOutput()");
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Fri Sep 16 18:00:52 CDT 2016

4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Aug 31 21:08:59 CDT 2017
#Thu Feb 14 02:14:00 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
19 changes: 10 additions & 9 deletions libtermexec/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
apply plugin: 'com.android.library'
Expand All @@ -13,18 +14,18 @@ repositories {
}

android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 2
versionName "2.0"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName


ndk {
moduleName 'libjackpal-termexec2'
abiFilters 'armeabi', 'arm64-v8a', 'armeabi-v7a', 'x86'
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86'
ldLibs 'log', 'c'
}
}
Expand Down Expand Up @@ -63,5 +64,5 @@ android.libraryVariants.all { variant ->

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-annotations:26+'
implementation 'com.android.support:support-annotations:28.0.0'
}
2 changes: 1 addition & 1 deletion libtermexec/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Build for ARMv5TE, mips and x86 architectures.
APP_ABI := armeabi mips x86 arm64-v8a armeabi-v7a
APP_ABI := mips x86 arm64-v8a armeabi-v7a
5 changes: 3 additions & 2 deletions libtermexec/src/main/jni/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#include <unistd.h>
#include <termios.h>
#include <signal.h>
#include <string.h>

typedef unsigned short char16_t;
typedef unsigned short uint_least16_t;

class String8 {
public:
Expand All @@ -41,7 +42,7 @@ class String8 {
}
}

void set(const char16_t* o, size_t numChars) {
void set(const uint_least16_t* o, size_t numChars) {
if (mString) {
free(mString);
}
Expand Down
14 changes: 8 additions & 6 deletions term/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
applicationId 'com.offsec.nhterm'
minSdkVersion 14
targetSdkVersion 26
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName

ndk {
moduleName "libjackpal-androidterm5nhj1"
abiFilters 'armeabi', 'arm64-v8a', 'armeabi-v7a', 'x86'
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86'
ldLibs 'log', 'c'
}
}
Expand Down Expand Up @@ -44,5 +46,5 @@ android {
dependencies {
implementation project(':emulatorview')
implementation project(':libtermexec')
implementation "com.android.support:support-v4:+"
implementation 'com.android.support:support-v4:+'
}
4 changes: 3 additions & 1 deletion term/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<permission android:name="com.offsec.nhterm.permission.RUN_SCRIPT"
android:label="@string/perm_run_script"
android:description="@string/permdesc_run_script"
Expand Down Expand Up @@ -129,7 +131,7 @@
android:label="@string/preferences"/>
<activity android:name="com.offsec.nhterm.WindowList"
android:label="@string/window_list" />
<service android:name="com.offsec.nhterm.TermService" >
<service android:name="com.offsec.nhterm.TermService" android:permission="android.permission.BIND_JOB_SERVICE">
<intent-filter>
<action android:name="com.offsec.nhterm.action.START_TERM.v1"/>
<category android:name="android.intent.category.DEFAULT"/>
Expand Down
Loading