Reinstate minimalistic debug option to inject android:debuggable with aapt

This commit is contained in:
Benjamin Dobell 2016-04-18 08:05:39 +10:00 committed by Connor Tumbleson
parent 8689991626
commit 032a3e5e25
3 changed files with 7 additions and 3 deletions

View File

@ -199,8 +199,8 @@ public class Main {
apkOptions.forceBuildAll = true; apkOptions.forceBuildAll = true;
} }
if (cli.hasOption("d") || cli.hasOption("debug")) { if (cli.hasOption("d") || cli.hasOption("debug")) {
System.err.println("SmaliDebugging has been removed in 2.1.0 onward. Please see: https://github.com/iBotPeaches/Apktool/issues/1061"); System.out.println("SmaliDebugging has been removed in 2.1.0 onward. Please see: https://github.com/iBotPeaches/Apktool/issues/1061");
System.exit(1); apkOptions.debugMode = true;
} }
if (cli.hasOption("v") || cli.hasOption("verbose")) { if (cli.hasOption("v") || cli.hasOption("verbose")) {
apkOptions.verbose = true; apkOptions.verbose = true;
@ -286,7 +286,7 @@ public class Main {
.create(); .create();
Option debugBuiOption = OptionBuilder.withLongOpt("debug") Option debugBuiOption = OptionBuilder.withLongOpt("debug")
.withDescription("Builds in debug mode. Check project page for more info.") .withDescription("Sets android:debuggable to \"true\" in the APK's compiled manifest")
.create("d"); .create("d");
Option noDbgOption = OptionBuilder.withLongOpt("no-debug-info") Option noDbgOption = OptionBuilder.withLongOpt("no-debug-info")

View File

@ -19,6 +19,7 @@ import java.util.Collection;
public class ApkOptions { public class ApkOptions {
public boolean forceBuildAll = false; public boolean forceBuildAll = false;
public boolean debugMode = false;
public boolean verbose = false; public boolean verbose = false;
public boolean copyOriginalFiles = false; public boolean copyOriginalFiles = false;
public boolean updateFiles = false; public boolean updateFiles = false;

View File

@ -346,6 +346,9 @@ final public class AndrolibResources {
if (apkOptions.updateFiles) { if (apkOptions.updateFiles) {
cmd.add("-u"); cmd.add("-u");
} }
if (apkOptions.debugMode) { // inject debuggable="true" into manifest
cmd.add("--debug-mode");
}
// force package id so that some frameworks build with correct id // force package id so that some frameworks build with correct id
// disable if user adds own aapt (can't know if they have this feature) // disable if user adds own aapt (can't know if they have this feature)
if (mPackageId != null && ! customAapt && ! mSharedLibrary) { if (mPackageId != null && ! customAapt && ! mSharedLibrary) {