Skip to content
Closed
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
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Termux:Float
# InVx:Float

[![Build status](https://github.com/termux/termux-float/workflows/Build/badge.svg)](https://github.com/termux/termux-float/actions)
> InVxTermux fork of [termux/termux-float](https://github.com/termux/termux-float).
> Package `com.involvex.termux_app.window`, `sharedUserId` `com.involvex.termux_app`.
> Install only alongside same-source InVxTermux APKs (matching test-key signature).
> Depends on `com.invapp:termux-shared/terminal-view:0.203.0` published locally from
> [involvex/termux-app](https://github.com/involvex/termux-app) via
> `./gradlew :terminal-view:publishReleasePublicationToMavenLocal :termux-shared:publishReleasePublicationToMavenLocal`.

[![Build status](https://github.com/involvex/termux-float/workflows/Build/badge.svg)](https://github.com/involvex/termux-float/actions)
[![Join the chat at https://gitter.im/termux/termux](https://badges.gitter.im/termux/termux.svg)](https://gitter.im/termux/termux)

A [Termux] plugin app to show the terminal in a floating terminal window.
Expand Down
49 changes: 27 additions & 22 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
namespace "com.termux.window"
namespace "com.invapp.window"

compileSdk project.properties.compileSdkVersion.toInteger()
def appVersionName = System.getenv("TERMUX_FLOAT_APP__BUILD__APP_VERSION_NAME") ?: ""
def apkVersionTag = System.getenv("TERMUX_FLOAT_APP__BUILD__APK_VERSION_TAG") ?: ""

defaultConfig {
applicationId "com.termux.window"
applicationId "com.involvex.termux_app.window"
minSdk project.properties.minSdkVersion.toInteger()
targetSdk project.properties.targetSdkVersion.toInteger()
versionCode 1001
Expand All @@ -17,9 +17,9 @@ android {
if (appVersionName) versionName = appVersionName
validateVersionName(versionName)

manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.termux"
manifestPlaceholders.TERMUX_APP_NAME = "Termux"
manifestPlaceholders.TERMUX_FLOAT_APP_NAME = "Termux:Float"
manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.involvex.termux_app"
manifestPlaceholders.TERMUX_APP_NAME = "InVxTermux"
manifestPlaceholders.TERMUX_FLOAT_APP_NAME = "InVx:Float"
}

signingConfigs {
Expand All @@ -35,12 +35,11 @@ android {
release {
minifyEnabled true
shrinkResources false // Reproducible builds
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

debug {
signingConfig signingConfigs.debug
zipAlignEnabled true
}
}

Expand All @@ -52,34 +51,40 @@ android {
targetCompatibility JavaVersion.VERSION_11
}

applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = new File("termux-float-app_" +
(apkVersionTag ? apkVersionTag : "v" + versionName + "+" + variant.buildType.name) + ".apk")
}
}

packagingOptions {
jniLibs {
useLegacyPackaging true
}
// Remove terminal-shared JNI libs added via termux-shared dependency
exclude "lib/*/liblocal-socket.so"
}
}

androidComponents {
onVariants(selector().all(), { variant ->
def apkVersionTagLocal = System.getenv("TERMUX_FLOAT_APP__BUILD__APK_VERSION_TAG") ?: ""
variant.outputs.forEach { output ->
def buildTypeName = variant.buildType
def apkName = "invx-float-app_" + (apkVersionTagLocal ? apkVersionTagLocal : "v" + android.defaultConfig.versionName + "+" + buildTypeName) + ".apk"
output.outputFileName.set(apkName)
}
})
}

dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"

testImplementation "junit:junit:4.13.2"

implementation "androidx.annotation:annotation:1.9.1"

implementation "com.termux.termux-app:termux-shared:8aca6dbbf4"
implementation "com.termux.termux-app:terminal-view:8aca6dbbf4"

// Use if below libraries are published locally by termux-app with `./gradlew publishReleasePublicationToMavenLocal` and used with `mavenLocal()`.
// If updates are done, republish there and sync project with gradle files here
// https://github.com/termux/termux-app/wiki/Termux-Libraries
//implementation "com.termux:termux-shared:0.118.0"
//implementation "com.termux:terminal-view:0.118.0"
// InVxTermux libraries published locally from involvex/termux-app with:
// ./gradlew :terminal-view:publishReleasePublicationToMavenLocal :termux-shared:publishReleasePublicationToMavenLocal
// Requires `mavenLocal()` in the root repositories block. Upstream used:
// implementation "com.termux.termux-app:termux-shared:8aca6dbbf4"
// implementation "com.termux.termux-app:terminal-view:8aca6dbbf4"
implementation "com.invapp:termux-shared:0.203.0"
implementation "com.invapp:terminal-view:0.203.0"

implementation "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava"
}
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<application
android:name=".TermuxFloatApplication"
android:allowBackup="true"
android:extractNativeLibs="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.termux.window;
package com.invapp.window;

import android.graphics.Outline;
import android.graphics.drawable.Drawable;
Expand All @@ -7,8 +7,8 @@
import android.view.ViewOutlineProvider;
import android.view.WindowManager;

import com.termux.shared.view.ViewUtils;
import com.termux.view.TerminalView;
import com.invapp.shared.view.ViewUtils;
import com.invapp.view.TerminalView;

/**
* Handles displaying our TermuxFloatView as a collapsed bubble and restoring back
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.termux.window;
package com.invapp.window;

import android.app.Activity;
import android.content.Intent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.termux.window;
package com.invapp.window;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import com.termux.shared.logger.Logger;
import com.termux.shared.termux.TermuxConstants;
import com.termux.shared.termux.crash.TermuxCrashUtils;
import com.termux.shared.termux.settings.preferences.TermuxFloatAppSharedPreferences;
import com.invapp.shared.logger.Logger;
import com.invapp.shared.termux.TermuxConstants;
import com.invapp.shared.termux.crash.TermuxCrashUtils;
import com.invapp.shared.termux.settings.preferences.TermuxFloatAppSharedPreferences;

public class TermuxFloatApplication extends Application {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.termux.window;
package com.invapp.window;

import android.annotation.TargetApi;
import android.app.Activity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.termux.window;
package com.invapp.window;

import android.annotation.SuppressLint;
import android.app.Notification;
Expand All @@ -15,15 +15,15 @@
import android.view.LayoutInflater;
import android.view.View;

import com.termux.shared.data.IntentUtils;
import com.termux.shared.logger.Logger;
import com.termux.shared.notification.NotificationUtils;
import com.termux.shared.shell.command.ExecutionCommand;
import com.termux.shared.termux.TermuxConstants;
import com.termux.shared.termux.TermuxConstants.TERMUX_FLOAT_APP.TERMUX_FLOAT_SERVICE;
import com.termux.shared.termux.shell.command.environment.TermuxShellEnvironment;
import com.termux.shared.termux.shell.command.runner.terminal.TermuxSession;
import com.termux.terminal.TerminalSession;
import com.invapp.shared.data.IntentUtils;
import com.invapp.shared.logger.Logger;
import com.invapp.shared.notification.NotificationUtils;
import com.invapp.shared.shell.command.ExecutionCommand;
import com.invapp.shared.termux.TermuxConstants;
import com.invapp.shared.termux.TermuxConstants.TERMUX_FLOAT_APP.TERMUX_FLOAT_SERVICE;
import com.invapp.shared.termux.shell.command.environment.TermuxShellEnvironment;
import com.invapp.shared.termux.shell.command.runner.terminal.TermuxSession;
import com.invapp.terminal.TerminalSession;

public class TermuxFloatService extends Service {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.termux.window;
package com.invapp.window;

import android.content.ClipData;
import android.content.ClipboardManager;
Expand All @@ -8,14 +8,14 @@
import android.media.SoundPool;
import android.text.TextUtils;

import com.termux.shared.logger.Logger;
import com.termux.shared.termux.TermuxConstants;
import com.termux.shared.termux.settings.properties.TermuxPropertyConstants;
import com.termux.shared.termux.terminal.TermuxTerminalSessionClientBase;
import com.termux.shared.termux.terminal.io.BellHandler;
import com.termux.terminal.TerminalColors;
import com.termux.terminal.TerminalSession;
import com.termux.terminal.TextStyle;
import com.invapp.shared.logger.Logger;
import com.invapp.shared.termux.TermuxConstants;
import com.invapp.shared.termux.settings.properties.TermuxPropertyConstants;
import com.invapp.shared.termux.terminal.TermuxTerminalSessionClientBase;
import com.invapp.shared.termux.terminal.io.BellHandler;
import com.invapp.terminal.TerminalColors;
import com.invapp.terminal.TerminalSession;
import com.invapp.terminal.TextStyle;

import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -134,7 +134,7 @@ private synchronized void loadBellSoundPool() {
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION).build()).build();

try {
mBellSoundId = mBellSoundPool.load(mService, com.termux.shared.R.raw.bell, 1);
mBellSoundId = mBellSoundPool.load(mService, com.invapp.shared.R.raw.bell, 1);
} catch (Exception e){
// Catch java.lang.RuntimeException: Unable to resume activity {com.termux/com.termux.app.TermuxActivity}: android.content.res.Resources$NotFoundException: File res/raw/bell.ogg from drawable resource ID
Logger.logStackTraceWithMessage(LOG_TAG, "Failed to load bell sound pool", e);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.termux.window;
package com.invapp.window;

import android.annotation.SuppressLint;
import android.content.Context;
Expand All @@ -17,15 +17,15 @@
import android.widget.Button;
import android.widget.LinearLayout;

import com.termux.shared.logger.Logger;
import com.termux.shared.termux.TermuxConstants;
import com.termux.shared.termux.settings.preferences.TermuxFloatAppSharedPreferences;
import com.termux.shared.view.KeyboardUtils;
import com.termux.terminal.TerminalSession;
import com.termux.terminal.TerminalSessionClient;
import com.termux.view.TerminalView;
import com.termux.view.TerminalViewClient;
import com.termux.window.settings.properties.TermuxFloatAppSharedProperties;
import com.invapp.shared.logger.Logger;
import com.invapp.shared.termux.TermuxConstants;
import com.invapp.shared.termux.settings.preferences.TermuxFloatAppSharedPreferences;
import com.invapp.shared.view.KeyboardUtils;
import com.invapp.terminal.TerminalSession;
import com.invapp.terminal.TerminalSessionClient;
import com.invapp.view.TerminalView;
import com.invapp.view.TerminalViewClient;
import com.invapp.window.settings.properties.TermuxFloatAppSharedProperties;

public class TermuxFloatView extends LinearLayout {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.termux.window;
package com.invapp.window;

import android.content.Context;
import android.media.AudioManager;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;

import com.termux.shared.termux.terminal.TermuxTerminalViewClientBase;
import com.termux.shared.view.KeyboardUtils;
import com.termux.terminal.KeyHandler;
import com.termux.terminal.TerminalEmulator;
import com.termux.terminal.TerminalSession;
import com.invapp.shared.termux.terminal.TermuxTerminalViewClientBase;
import com.invapp.shared.view.KeyboardUtils;
import com.invapp.terminal.KeyHandler;
import com.invapp.terminal.TerminalEmulator;
import com.invapp.terminal.TerminalSession;

public class TermuxFloatViewClient extends TermuxTerminalViewClientBase {

Expand Down Expand Up @@ -39,7 +39,7 @@ public void initFloatView() {
}

/**
* Should be called when {@link com.termux.view.TerminalView#mEmulator} is set
* Should be called when {@link com.invapp.view.TerminalView#mEmulator} is set
*/
@Override
public void onEmulatorSet() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.termux.window.settings.properties;
package com.invapp.window.settings.properties;

import android.content.Context;

import androidx.annotation.NonNull;

import com.termux.shared.termux.TermuxConstants;
import com.termux.shared.termux.settings.properties.TermuxPropertyConstants;
import com.termux.shared.termux.settings.properties.TermuxSharedProperties;
import com.invapp.shared.termux.TermuxConstants;
import com.invapp.shared.termux.settings.properties.TermuxPropertyConstants;
import com.invapp.shared.termux.settings.properties.TermuxSharedProperties;

public class TermuxFloatAppSharedProperties extends TermuxSharedProperties {

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.termux.window.TermuxFloatView xmlns:android="http://schemas.android.com/apk/res/android"
<com.invapp.window.TermuxFloatView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/window_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
Expand Down Expand Up @@ -36,7 +36,7 @@
android:layout_marginEnd="8dp"/>
</LinearLayout>

<com.termux.view.TerminalView
<com.invapp.view.TerminalView
android:id="@+id/terminal_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -45,4 +45,4 @@
android:focusableInTouchMode="true"
android:scrollbars="vertical" />

</com.termux.window.TermuxFloatView>
</com.invapp.window.TermuxFloatView>
6 changes: 3 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE resources [
<!ENTITY TERMUX_PACKAGE_NAME "com.termux">
<!ENTITY TERMUX_APP_NAME "Termux">
<!ENTITY TERMUX_FLOAT_APP_NAME "Termux:Float">
<!ENTITY TERMUX_PACKAGE_NAME "com.involvex.termux_app">
<!ENTITY TERMUX_APP_NAME "InVxTermux">
<!ENTITY TERMUX_FLOAT_APP_NAME "InVx:Float">
]>

<resources>
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:8.7.3"
classpath "com.android.tools.build:gradle:9.4.0"
}
}

allprojects {
repositories {
mavenCentral()
google()
//mavenLocal()
mavenLocal() // InVxTermux: com.invapp:termux-shared/terminal-view published from involvex/termux-app
maven { url "https://jitpack.io" }
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ android.useAndroidX=true

minSdkVersion=24
targetSdkVersion=28
compileSdkVersion=35
compileSdkVersion=36
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists