forked from skylot/jadx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added module for check recompilation of test app
- Loading branch information
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "jadx-test-app/test-app"] | ||
path = jadx-test-app/test-app | ||
url = git://github.com/skylot/jadx-test-app.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### Run jadx on test android application | ||
|
||
This module contains build scripts for test recompilation of simple android app from: | ||
https://github.com/skylot/jadx-test-app | ||
|
||
For run tests type follow commands in jadx root directory: | ||
|
||
```java | ||
git submodule init | ||
git submodule update | ||
./gradlew testAppCheck | ||
``` | ||
|
||
Note: You will need connected device or emulator for success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
project.ext { | ||
testAppDir = 'test-app' | ||
testAppTmpDir = 'test-app-tmp' | ||
|
||
buildFile = "${testAppTmpDir}/build.gradle" | ||
apkFile = "${testAppTmpDir}/build/outputs/apk/test-app-tmp-debug.apk" | ||
outSrcDir = "${testAppTmpDir}/src/main/java" | ||
outResDir = "${testAppTmpDir}/src/main" | ||
checkTask = 'connectedCheck' | ||
} | ||
|
||
dependencies { | ||
compile(project(":jadx-cli")) | ||
} | ||
|
||
sonarRunner { | ||
skipProject = true | ||
} | ||
|
||
task deleteTmp(type:Delete) { | ||
delete testAppTmpDir | ||
} | ||
|
||
task copyApp(type:Copy, dependsOn: deleteTmp) { | ||
from testAppDir | ||
into testAppTmpDir | ||
} | ||
|
||
task buildApp(type:Exec, dependsOn: copyApp) { | ||
workingDir testAppTmpDir | ||
commandLine "./gradlew clean build ${checkTask}".split(' ') | ||
} | ||
|
||
task removeSource(type:Delete, dependsOn: buildApp) { | ||
delete "${outResDir}/**" | ||
} | ||
|
||
task runJadxSrc(type: JavaExec, dependsOn: removeSource) { | ||
classpath = sourceSets.main.output + configurations.compile | ||
main = project(':jadx-cli').mainClassName | ||
args = ['-d', outSrcDir, '-r', apkFile, '-v'] | ||
} | ||
|
||
task runJadxResources(type: JavaExec, dependsOn: runJadxSrc) { | ||
classpath = sourceSets.main.output + configurations.compile | ||
main = project(':jadx-cli').mainClassName | ||
args = ['-d', outResDir, '-s', apkFile, '-v'] | ||
} | ||
|
||
task decompile(type:Delete, dependsOn: runJadxResources) { | ||
delete "${outSrcDir}/com/github/skylot/jadx/testapp/BuildConfig.java" | ||
delete "${outSrcDir}/com/github/skylot/jadx/testapp/R.java" | ||
} | ||
|
||
task runChecks(type:Exec, dependsOn: decompile) { | ||
workingDir testAppTmpDir | ||
commandLine "./gradlew clean build ${checkTask}".split(' ') | ||
} | ||
|
||
task testAppCheck(dependsOn: runChecks) { | ||
doFirst { | ||
def buildFile = file(buildFile) | ||
if (!buildFile.exists() || !buildFile.isFile()) { | ||
throw new StopExecutionException("Test app not found") | ||
} | ||
} | ||
} | ||
|
||
clean.dependsOn deleteTmp |
Submodule test-app
added at
2f34a7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ include 'jadx-core' | |
include 'jadx-cli' | ||
include 'jadx-gui' | ||
include 'jadx-samples' | ||
include 'jadx-test-app' |