mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-02 15:04:24 +02:00
only use --forced-package-id if prebuilt aapt is used
This commit is contained in:
parent
d8b774864c
commit
be77354859
@ -328,6 +328,7 @@ final public class AndrolibResources {
|
|||||||
HashMap<String, Boolean> flags, String aaptPath)
|
HashMap<String, Boolean> flags, String aaptPath)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
|
|
||||||
|
boolean customAapt = false;
|
||||||
List<String> cmd = new ArrayList<String>();
|
List<String> cmd = new ArrayList<String>();
|
||||||
|
|
||||||
// path for aapt binary
|
// path for aapt binary
|
||||||
@ -336,6 +337,7 @@ final public class AndrolibResources {
|
|||||||
if (aaptFile.canRead() && aaptFile.exists()) {
|
if (aaptFile.canRead() && aaptFile.exists()) {
|
||||||
aaptFile.setExecutable(true);
|
aaptFile.setExecutable(true);
|
||||||
cmd.add(aaptFile.getPath());
|
cmd.add(aaptFile.getPath());
|
||||||
|
customAapt = true;
|
||||||
|
|
||||||
if (flags.get("verbose")) {
|
if (flags.get("verbose")) {
|
||||||
LOGGER.info(aaptFile.getPath()
|
LOGGER.info(aaptFile.getPath()
|
||||||
@ -369,7 +371,10 @@ final public class AndrolibResources {
|
|||||||
if (flags.get("debug")) { // inject debuggable="true" into manifest
|
if (flags.get("debug")) { // inject debuggable="true" into manifest
|
||||||
cmd.add("--debug-mode");
|
cmd.add("--debug-mode");
|
||||||
}
|
}
|
||||||
if (mPackageId != null) {
|
|
||||||
|
// 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)
|
||||||
|
if (mPackageId != null && customAapt == false) {
|
||||||
cmd.add("--forced-package-id");
|
cmd.add("--forced-package-id");
|
||||||
cmd.add(mPackageId);
|
cmd.add(mPackageId);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user