我想帮助解决问题.
首先,按照我的代码的详细信息:
build.gradle (Project: android)
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url '/home/melti/java/repository' }
}
dependencies {
classpath "com.android.tools.build:gradle:1.3.0-beta4"
classpath "com.android.databinding:dataBinder:1.0-rc0"
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url '/home/melti/java/repository' }
}
}
Run Code Online (Sandbox Code Playgroud)
build.gradle(模块:app)
apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
defaultConfig {
applicationId "br.com.soma"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile …Run Code Online (Sandbox Code Playgroud) 如何避免以下代码的“This use of java/lang/ProcessBuilder.([Ljava/lang/String;)V can be eager to Command Injection”声纳消息?
更新
void assign(String path, File jarFile) {
File cert = new File(path, "Cert");
String password = "123";
File script = new File(path, "assign.bat");
String command = "\"" + script.getAbsolutePath() + "\" " + password
+ " \"" + cert.getAbsolutePath() + "\""
+ " \"" + jarFile.getAbsolutePath() + "\"";
Process proc = new ProcessBuilder(command).start();
}
Run Code Online (Sandbox Code Playgroud) 我的 Android 应用程序请求可访问性的权限。在旧版本的 Android 上,下面的代码会打开正确的辅助功能权限屏幕。但在 Android 12 的三星上测试,它不起作用。
private void launchPermission() {
AppOpsManager ops = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
Intent intent = new Intent("android.settings.ACCESSIBILITY_SETTINGS");
startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)
你能帮我解决这个问题吗?