Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
2079d31a
Commit
2079d31a
authored
Jul 25, 2019
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
0911b2dc
Pipeline
#781
failed with stages
in 0 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
18 deletions
+83
-18
.gitignore
.gitignore
+2
-0
build.gradle
build.gradle
+8
-3
JadxCLIArgs.java
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
+2
-2
build.gradle
jadx-core/build.gradle
+2
-0
JadxArgsValidator.java
jadx-core/src/main/java/jadx/api/JadxArgsValidator.java
+18
-3
ExportGradleProject.java
...e/src/main/java/jadx/core/export/ExportGradleProject.java
+29
-4
build.gradle.tmpl
jadx-core/src/main/resources/export/build.gradle.tmpl
+22
-6
No files found.
.gitignore
View file @
2079d31a
...
@@ -31,3 +31,5 @@ jadx-output/
...
@@ -31,3 +31,5 @@ jadx-output/
*.log
*.log
*.cfg
*.cfg
*.orig
*.orig
local.properties
build.gradle
View file @
2079d31a
...
@@ -53,9 +53,14 @@ allprojects {
...
@@ -53,9 +53,14 @@ allprojects {
repositories
{
repositories
{
mavenLocal
()
mavenLocal
()
mavenCentral
()
maven
{
jcenter
()
name
"aliyunmaven"
google
()
url
"https://maven.aliyun.com/repository/public"
}
maven
{
name
"aliyunGoogle"
url
"https://maven.aliyun.com/repository/google"
}
}
}
jacoco
{
jacoco
{
...
...
jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java
View file @
2079d31a
...
@@ -56,10 +56,10 @@ public class JadxCLIArgs {
...
@@ -56,10 +56,10 @@ public class JadxCLIArgs {
protected
int
threadsCount
=
JadxArgs
.
DEFAULT_THREADS_COUNT
;
protected
int
threadsCount
=
JadxArgs
.
DEFAULT_THREADS_COUNT
;
@Parameter
(
names
=
{
"--show-bad-code"
},
description
=
"show inconsistent code (incorrectly decompiled)"
)
@Parameter
(
names
=
{
"--show-bad-code"
},
description
=
"show inconsistent code (incorrectly decompiled)"
)
protected
boolean
showInconsistentCode
=
fals
e
;
protected
boolean
showInconsistentCode
=
tru
e
;
@Parameter
(
names
=
{
"--no-imports"
},
description
=
"disable use of imports, always write entire package name"
)
@Parameter
(
names
=
{
"--no-imports"
},
description
=
"disable use of imports, always write entire package name"
)
protected
boolean
useImports
=
tru
e
;
protected
boolean
useImports
=
fals
e
;
@Parameter
(
names
=
{
"--no-debug-info"
},
description
=
"disable debug info"
)
@Parameter
(
names
=
{
"--no-debug-info"
},
description
=
"disable debug info"
)
protected
boolean
debugInfo
=
true
;
protected
boolean
debugInfo
=
true
;
...
...
jadx-core/build.gradle
View file @
2079d31a
...
@@ -14,5 +14,7 @@ dependencies {
...
@@ -14,5 +14,7 @@ dependencies {
}
}
compile
'com.google.guava:guava:28.0-jre'
compile
'com.google.guava:guava:28.0-jre'
compile
'net.dongliu:apk-parser:2.6.2'
testCompile
'org.apache.commons:commons-lang3:3.9'
testCompile
'org.apache.commons:commons-lang3:3.9'
}
}
jadx-core/src/main/java/jadx/api/JadxArgsValidator.java
View file @
2079d31a
...
@@ -74,11 +74,26 @@ public class JadxArgsValidator {
...
@@ -74,11 +74,26 @@ public class JadxArgsValidator {
File
file
=
args
.
getInputFiles
().
get
(
0
);
File
file
=
args
.
getInputFiles
().
get
(
0
);
String
name
=
file
.
getName
();
String
name
=
file
.
getName
();
int
pos
=
name
.
lastIndexOf
(
'.'
);
int
pos
=
name
.
lastIndexOf
(
'.'
);
if
(
pos
!=
-
1
)
{
// if (pos != -1) {
outDirName
=
name
.
substring
(
0
,
pos
);
// 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
{
}
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
);
LOG
.
info
(
"output directory: {}"
,
outDirName
);
outDir
=
new
File
(
outDirName
);
outDir
=
new
File
(
outDirName
);
return
outDir
;
return
outDir
;
...
...
jadx-core/src/main/java/jadx/core/export/ExportGradleProject.java
View file @
2079d31a
package
jadx
.
core
.
export
;
package
jadx
.
core
.
export
;
import
net.dongliu.apk.parser.ApkFile
;
import
net.dongliu.apk.parser.bean.ApkMeta
;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -54,10 +57,32 @@ public class ExportGradleProject {
...
@@ -54,10 +57,32 @@ public class ExportGradleProject {
if
(
appPackage
==
null
)
{
if
(
appPackage
==
null
)
{
appPackage
=
"UNKNOWN"
;
appPackage
=
"UNKNOWN"
;
}
}
tmpl
.
add
(
"applicationId"
,
appPackage
);
// tmpl.add("applicationId", appPackage);
// TODO: load from AndroidManifest.xml
// // TODO: load from AndroidManifest.xml
tmpl
.
add
(
"minSdkVersion"
,
9
);
// tmpl.add("minSdkVersion", 9);
tmpl
.
add
(
"targetSdkVersion"
,
21
);
// 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"
));
tmpl
.
save
(
new
File
(
outDir
,
"build.gradle"
));
}
}
...
...
jadx-core/src/main/resources/export/build.gradle.tmpl
View file @
2079d31a
//modified by virjar https://gitee.com/virjar/jadx
buildscript {
buildscript {
repositories {
repositories {
jcenter()
maven {
name "aliyunmaven"
url "https://maven.aliyun.com/repository/public"
}
maven {
name "aliyunGoogle"
url "https://maven.aliyun.com/repository/google"
}
}
}
dependencies {
dependencies {
classpath 'com.android.tools.build:gradle:
1.5.0
'
classpath 'com.android.tools.build:gradle:
3.4.2
'
}
}
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
repositories {
repositories {
mavenCentral()
maven {
jcenter()
name "aliyunmaven"
url "https://maven.aliyun.com/repository/public"
}
maven {
name "aliyunGoogle"
url "https://maven.aliyun.com/repository/google"
}
}
}
android {
android {
compileSdkVersion
23
compileSdkVersion
{{compileSdkVersion}}
buildToolsVersion '23.0.1'
//
buildToolsVersion '23.0.1'
defaultConfig {
defaultConfig {
applicationId '{{applicationId}}'
applicationId '{{applicationId}}'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment