mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-06 01:55:53 +01:00
Allows run app from gradle for debugging purposes (#3179)
Co-authored-by: Connor Tumbleson <iBotPeaches@users.noreply.github.com>
This commit is contained in:
parent
ca07a0a56c
commit
e3e2a7e1d6
@ -42,17 +42,24 @@ application {
|
||||
mainClass = 'brut.apktool.Main'
|
||||
}
|
||||
|
||||
tasks.named('run') {
|
||||
// run from root directory
|
||||
// otherwise run from brut.apktool/apktool-cli
|
||||
workingDir = file(System.getProperty('user.dir'))
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'Main-Class': 'brut.apktool.Main'
|
||||
}
|
||||
}
|
||||
|
||||
task cleanOutputDirectory(type: Delete) {
|
||||
tasks.register('cleanOutputDirectory', Delete) {
|
||||
delete fileTree(dir: jar.getDestinationDirectory().getAsFile(), exclude: "apktool-cli-all.jar")
|
||||
}
|
||||
|
||||
task proguard(type: ProGuardTask, dependsOn: shadowJar) {
|
||||
tasks.register('proguard', ProGuardTask) {
|
||||
dependsOn shadowJar
|
||||
injars shadowJar.getArchiveFile()
|
||||
|
||||
// Java 9 and prior uses merged package for runtime, later uses split jmod files.
|
||||
|
@ -183,7 +183,8 @@ public class Main {
|
||||
outDir = new File(outName);
|
||||
}
|
||||
|
||||
ApkDecoder decoder = new ApkDecoder(config, new ExtFile(apkName));
|
||||
ExtFile apkFile = new ExtFile(apkName);
|
||||
ApkDecoder decoder = new ApkDecoder(config, apkFile);
|
||||
|
||||
try {
|
||||
decoder.decode(outDir);
|
||||
@ -195,7 +196,7 @@ public class Main {
|
||||
+ "already exists. Use -f switch if you want to overwrite it.");
|
||||
System.exit(1);
|
||||
} catch (InFileNotFoundException ex) {
|
||||
System.err.println("Input file (" + apkName + ") " + "was not found or was not readable.");
|
||||
System.err.println("Input file (" + apkFile.getAbsolutePath() + ") " + "was not found or was not readable.");
|
||||
System.exit(1);
|
||||
} catch (CantFindFrameworkResException ex) {
|
||||
System.err
|
||||
|
Loading…
Reference in New Issue
Block a user