这是indexloc提供的服务,不要输入任何密码
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
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ android {
def splitAPKsForDebugBuilds = System.getenv("TERMUX_SPLIT_APKS_FOR_DEBUG_BUILDS") ?: "1"
def splitAPKsForReleaseBuilds = System.getenv("TERMUX_SPLIT_APKS_FOR_RELEASE_BUILDS") ?: "0" // F-Droid does not support split APKs #1904

buildFeatures {
buildConfig true
}

dependencies {
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.core:core:1.6.0"
Expand All @@ -37,6 +41,7 @@ android {
implementation project(":termux-shared")
}

namespace "com.termux"
defaultConfig {
applicationId "com.termux"
minSdkVersion project.properties.minSdkVersion.toInteger()
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
android:label="@string/permission_run_command_label"
android:protectionLevel="dangerous" />

<!-- Expected or not, this pemissions: DUMP, READ_LOGS and WRITE_SECURE_SETTINGS are limited -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand All @@ -31,7 +32,7 @@
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.DUMP" />
<uses-permission android:name="android.permission.DUMP" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# won't this help more than mk?
cmake_minimum_required(VERSION 3.10)
project(libtermux-bootstrap C)
set(SOURCES
termux-bootstrap-zip.S
termux-bootstrap.c
)
add_library(termux-bootstrap SHARED ${SOURCES})
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) {
mWebView = new WebView(this);
WebSettings settings = mWebView.getSettings();
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setAppCacheEnabled(false);
//settings.setAppCacheEnabled(false); // uh?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

setContentView(progressLayout);
mWebView.clearCache(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ private synchronized void loadBellSoundPool() {
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION).build()).build();

try {
mBellSoundId = mBellSoundPool.load(mActivity, R.raw.bell, 1);
mBellSoundId = mBellSoundPool.load(mActivity, com.termux.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
Expand Up @@ -735,8 +735,8 @@ public void reportIssueFromTranscript() {

MessageDialogUtils.showMessage(mActivity, TermuxConstants.TERMUX_APP_NAME + " Report Issue",
mActivity.getString(R.string.msg_add_termux_debug_info),
mActivity.getString(R.string.action_yes), (dialog, which) -> reportIssueFromTranscript(transcriptText, true),
mActivity.getString(R.string.action_no), (dialog, which) -> reportIssueFromTranscript(transcriptText, false),
mActivity.getString(com.termux.shared.R.string.action_yes), (dialog, which) -> reportIssueFromTranscript(transcriptText, true),
mActivity.getString(com.termux.shared.R.string.action_no), (dialog, which) -> reportIssueFromTranscript(transcriptText, false),
null);
}

Expand Down
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath "com.android.tools.build:gradle:8.1.1"
}
}

Expand All @@ -15,7 +15,3 @@ allprojects {
maven { url "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Sun Apr 06 11:06:59 EEST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
15 changes: 12 additions & 3 deletions terminal-emulator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
plugins {
id 'com.android.library'
id 'maven-publish'
}

android {
compileSdkVersion project.properties.compileSdkVersion.toInteger()
ndkVersion = System.getenv("JITPACK_NDK_VERSION") ?: project.properties.ndkVersion

namespace "com.termux.terminal"
defaultConfig {
minSdkVersion project.properties.minSdkVersion.toInteger()
targetSdkVersion project.properties.targetSdkVersion.toInteger()
Expand Down Expand Up @@ -41,6 +44,11 @@ android {
testOptions {
unitTests.returnDefaultValues = true
}
publishing {
singleVariant("release") {
withSourcesJar()
}
}
}

tasks.withType(Test) {
Expand All @@ -56,7 +64,8 @@ dependencies {

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
//classifier "sources" //depracated
archiveClassifier.set("sources") //functional
}

afterEvaluate {
Expand Down
10 changes: 9 additions & 1 deletion terminal-view/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ android {
api project(":terminal-emulator")
}

namespace "com.termux.view"
defaultConfig {
minSdkVersion project.properties.minSdkVersion.toInteger()
targetSdkVersion project.properties.targetSdkVersion.toInteger()
Expand All @@ -26,6 +27,12 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

publishing {
singleVariant("release") {
withSourcesJar()
}
}
}

dependencies {
Expand All @@ -34,7 +41,8 @@ dependencies {

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
//classifier "sources" //depracated
archiveClassifier.set("sources") //functional
}

afterEvaluate {
Expand Down
13 changes: 11 additions & 2 deletions termux-shared/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ android {
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.core:core:1.6.0"
implementation "com.google.android.material:material:1.4.0"
implementation "com.google.guava:guava:24.1-jre"
implementation("com.google.guava:guava:24.1-jre") {
exclude group: 'com.google.guava', module: 'listenablefuture'
}
implementation "io.noties.markwon:core:$markwonVersion"
implementation "io.noties.markwon:ext-strikethrough:$markwonVersion"
implementation "io.noties.markwon:linkify:$markwonVersion"
Expand All @@ -30,6 +32,7 @@ android {
implementation "com.termux:termux-am-library:v2.0.0"
}

namespace "com.termux.shared"
defaultConfig {
minSdkVersion project.properties.minSdkVersion.toInteger()
targetSdkVersion project.properties.targetSdkVersion.toInteger()
Expand Down Expand Up @@ -60,6 +63,11 @@ android {
path file('src/main/cpp/Android.mk')
}
}
publishing {
singleVariant("release") {
withSourcesJar()
}
}
}

dependencies {
Expand All @@ -71,7 +79,8 @@ dependencies {

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
//classifier "sources" //depracated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//classifier "sources" //depracated
// classifier parameter is deprecated
``

archiveClassifier.set("sources") //functional
}

afterEvaluate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void showMessage(Context context, String titleText, String message
final DialogInterface.OnClickListener onNegativeButton,
final DialogInterface.OnDismissListener onDismiss) {

AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.Theme_AppCompat_Light_Dialog);
AlertDialog.Builder builder = new AlertDialog.Builder(context, androidx.appcompat.R.style.Theme_AppCompat_Light_Dialog);

LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
View view = inflater.inflate(R.layout.dialog_show_message, null);
Expand Down