Commit 2079d31a authored by Administrator's avatar Administrator

修改

parent 0911b2dc
Pipeline #781 failed with stages
in 0 seconds
......@@ -31,3 +31,5 @@ jadx-output/
*.log
*.cfg
*.orig
local.properties
......@@ -53,9 +53,14 @@ allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
google()
maven {
name "aliyunmaven"
url "https://maven.aliyun.com/repository/public"
}
maven {
name "aliyunGoogle"
url "https://maven.aliyun.com/repository/google"
}
}
jacoco {
......
......@@ -56,10 +56,10 @@ public class JadxCLIArgs {
protected int threadsCount = JadxArgs.DEFAULT_THREADS_COUNT;
@Parameter(names = { "--show-bad-code" }, description = "show inconsistent code (incorrectly decompiled)")
protected boolean showInconsistentCode = false;
protected boolean showInconsistentCode = true;
@Parameter(names = { "--no-imports" }, description = "disable use of imports, always write entire package name")
protected boolean useImports = true;
protected boolean useImports = false;
@Parameter(names = { "--no-debug-info" }, description = "disable debug info")
protected boolean debugInfo = true;
......
......@@ -14,5 +14,7 @@ dependencies {
}
compile 'com.google.guava:guava:28.0-jre'
compile 'net.dongliu:apk-parser:2.6.2'
testCompile 'org.apache.commons:commons-lang3:3.9'
}
......@@ -74,11 +74,26 @@ public class JadxArgsValidator {
File file = args.getInputFiles().get(0);
String name = file.getName();
int pos = name.lastIndexOf('.');
if (pos != -1) {
outDirName = name.substring(0, pos);
// if (pos != -1) {
// outDirName = name.substring(0, pos);
// } else {
// outDirName = name + '-' + JadxArgs.DEFAULT_OUT_DIR;
// }
if (args.isExportAsGradleProject()) {
if (pos != -1) {
name = name.substring(0, pos);
}
outDirName = name + "_gradle_project";
} else {
outDirName = name + '-' + JadxArgs.DEFAULT_OUT_DIR;
outDirName = name + "-" + JadxArgs.DEFAULT_OUT_DIR;
if (pos != -1) {
outDirName = name.substring(0, pos);
} else {
outDirName = name + "-" + JadxArgs.DEFAULT_OUT_DIR;
}
}
LOG.info("output directory: {}", outDirName);
outDir = new File(outDirName);
return outDir;
......
package jadx.core.export;
import net.dongliu.apk.parser.ApkFile;
import net.dongliu.apk.parser.bean.ApkMeta;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
......@@ -54,10 +57,32 @@ public class ExportGradleProject {
if (appPackage == null) {
appPackage = "UNKNOWN";
}
tmpl.add("applicationId", appPackage);
// TODO: load from AndroidManifest.xml
tmpl.add("minSdkVersion", 9);
tmpl.add("targetSdkVersion", 21);
// tmpl.add("applicationId", appPackage);
// // TODO: load from AndroidManifest.xml
// tmpl.add("minSdkVersion", 9);
// tmpl.add("targetSdkVersion", 21);
// tmpl.save(new File(outDir, "build.gradle"));
ApkMeta apkMeta = null;
for (File f : root.getArgs().getInputFiles()) {
try (ApkFile apkFile = new ApkFile(f)) {
apkMeta = apkFile.getApkMeta();
break;
} catch (Exception e) {
//ignore
}
}
if (apkMeta != null) {
tmpl.add("applicationId", apkMeta.getPackageName());
tmpl.add("minSdkVersion", apkMeta.getMinSdkVersion());
tmpl.add("targetSdkVersion", apkMeta.getTargetSdkVersion());
tmpl.add("compileSdkVersion", apkMeta.getTargetSdkVersion());
} else {
tmpl.add("applicationId", appPackage);
tmpl.add("minSdkVersion", 9);
tmpl.add("targetSdkVersion", 21);
tmpl.add("compileSdkVersion", 21);
}
tmpl.save(new File(outDir, "build.gradle"));
}
......
//modified by virjar https://gitee.com/virjar/jadx
buildscript {
repositories {
jcenter()
maven {
name "aliyunmaven"
url "https://maven.aliyun.com/repository/public"
}
maven {
name "aliyunGoogle"
url "https://maven.aliyun.com/repository/google"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
apply plugin: 'com.android.application'
repositories {
mavenCentral()
jcenter()
maven {
name "aliyunmaven"
url "https://maven.aliyun.com/repository/public"
}
maven {
name "aliyunGoogle"
url "https://maven.aliyun.com/repository/google"
}
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
compileSdkVersion {{compileSdkVersion}}
//buildToolsVersion '23.0.1'
defaultConfig {
applicationId '{{applicationId}}'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment