这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit 10cc047

Browse files
Changed|Fixed: Bump down minSdkVersion from 24 to 21 to restart supporting android 5/6 for the time being
Also fixes vulnerability detailed in https://termux.dev/en/posts/general/2022/02/15/termux-apps-vulnerability-disclosures.html#termuxtasker-privilege-escalation-vulnerability for Android 5/6 Related commit termux/termux-app@623aaebb Related pull request termux/termux-app#2740
1 parent 78130a8 commit 10cc047

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,11 @@ dependencies {
7070
androidTestImplementation 'androidx.test:rules:1.4.0'
7171

7272
implementation 'androidx.appcompat:appcompat:1.3.1'
73-
implementation "androidx.annotation:annotation:1.2.0"
73+
implementation "androidx.annotation:annotation:1.3.0"
7474
implementation 'com.google.android.material:material:1.4.0'
7575
implementation 'com.google.guava:guava:24.1-jre'
7676

77-
implementation 'com.termux.termux-app:termux-shared:68cdbd6ff4'
78-
77+
implementation 'com.termux.termux-app:termux-shared:211340781b'
7978
// Use if below libraries are published locally by termux-app with `./gradlew publishReleasePublicationToMavenLocal` and used with `mavenLocal()`.
8079
// If updates are done, republish there and sync project with gradle files here
8180
// https://github.com/termux/termux-app/wiki/Termux-Libraries

app/src/main/java/com/termux/tasker/FireReceiver.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ public void onReceive(final Context context, final Intent intent) {
7272
String executableExtra = executionCommand.executable = IntentUtils.getStringExtraIfSet(intent, PluginBundleManager.EXTRA_EXECUTABLE, null);
7373
final String arguments_string = bundle.getString(PluginBundleManager.EXTRA_ARGUMENTS);
7474
executionCommand.workingDirectory = IntentUtils.getStringExtraIfSet(intent, PluginBundleManager.EXTRA_WORKDIR, null);
75-
executionCommand.inBackground = !(intent.getBooleanExtra(PluginBundleManager.EXTRA_TERMINAL, false));
75+
executionCommand.runner = intent.getBooleanExtra(PluginBundleManager.EXTRA_TERMINAL, false) ?
76+
ExecutionCommand.Runner.TERMINAL_SESSION.getName() : ExecutionCommand.Runner.APP_SHELL.getName();
7677
final boolean waitForResult = bundle.getBoolean(PluginBundleManager.EXTRA_WAIT_FOR_RESULT, true);
7778

78-
if (executionCommand.inBackground) {
79+
if (ExecutionCommand.Runner.APP_SHELL.equalsRunner(executionCommand.runner)) {
7980
executionCommand.stdin = IntentUtils.getStringExtraIfSet(intent, PluginBundleManager.EXTRA_STDIN, null);
8081
executionCommand.backgroundCustomLogLevel = IntentUtils.getIntegerExtraIfSet(intent, PluginBundleManager.EXTRA_BACKGROUND_CUSTOM_LOG_LEVEL, null);
8182
} else {
@@ -189,7 +190,7 @@ public void onReceive(final Context context, final Intent intent) {
189190
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_STDIN, executionCommand.stdin);
190191
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_SESSION_ACTION, executionCommand.sessionAction);
191192
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_BACKGROUND_CUSTOM_LOG_LEVEL, DataUtils.getStringFromInteger(executionCommand.backgroundCustomLogLevel, null));
192-
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_BACKGROUND, executionCommand.inBackground);
193+
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_RUNNER, executionCommand.runner);
193194
executionIntent.putExtra(TERMUX_SERVICE.EXTRA_PLUGIN_API_HELP, context.getString(R.string.plugin_api_help, TermuxConstants.TERMUX_TASKER_GITHUB_REPO_URL));
194195

195196
// Send execution intent to TERMUX_SERVICE

app/src/main/java/com/termux/tasker/utils/PluginUtils.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.termux.shared.shell.command.runner.app.AppShell;
2222
import com.termux.shared.termux.settings.preferences.TermuxPreferenceConstants.TERMUX_TASKER_APP;
2323
import com.termux.shared.termux.settings.preferences.TermuxTaskerAppSharedPreferences;
24-
import com.termux.shared.termux.settings.properties.TermuxPropertyConstants;
2524
import com.termux.shared.termux.shell.command.runner.terminal.TermuxSession;
2625
import com.termux.tasker.FireReceiver;
2726
import com.termux.tasker.PluginResultsService;
@@ -509,8 +508,11 @@ public static String checkIfTermuxTaskerAllowExternalAppsPolicyIsViolated(final
509508
if (executable == null || executable.isEmpty()) return context.getString(R.string.error_null_or_empty_executable);
510509

511510
String errmsg = null;
511+
512512
if (!FileUtils.isPathInDirPath(executable, TermuxConstants.TERMUX_TASKER_SCRIPTS_DIR_PATH, true) &&
513-
!SharedProperties.isPropertyValueTrue(context, TermuxPropertyConstants.getTermuxPropertiesFile(), TermuxConstants.PROP_ALLOW_EXTERNAL_APPS, true)) {
513+
!SharedProperties.isPropertyValueTrue(context,
514+
SharedProperties.getPropertiesFileFromList(TermuxConstants.TERMUX_PROPERTIES_FILE_PATHS_LIST, LOG_TAG),
515+
TermuxConstants.PROP_ALLOW_EXTERNAL_APPS, true)) {
514516
errmsg = context.getString(R.string.error_allow_external_apps_ungranted_warning);
515517
}
516518

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ org.gradle.jvmargs=-Xmx1536m
1818
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1919
# org.gradle.parallel=true
2020

21-
minSdkVersion=24
21+
minSdkVersion=21
2222
targetSdkVersion=28
2323
compileSdkVersion=30

0 commit comments

Comments
 (0)