diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java index e7dc636a..398c7efb 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java @@ -318,10 +318,15 @@ public class ApkDecoder { private void putPackageInfo(Map meta) throws AndrolibException { String renamed = getResTable().getPackageRenamed(); + String original = getResTable().getPackageOriginal(); int id = getResTable().getPackageId(); HashMap packages = new HashMap(); - packages.put("rename-manifest-package", renamed); + + // only put rename-manifest-package into apktool.yml, if the change will be required + if (!renamed.equalsIgnoreCase(original)) { + packages.put("rename-manifest-package", renamed); + } packages.put("forced-package-id", String.valueOf(id)); meta.put("packageInfo", packages); } diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java index 65846d99..112253a0 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java @@ -181,7 +181,6 @@ final public class AndrolibResources { mPackageOriginal = resPackage.getName(); mPackageRenamed = resTable.getPackageRenamed(); - resTable.setPackageId(resPackage.getId()); resTable.setPackageOriginal(mPackageOriginal);