only store renamed-manifest-package if the apk requires the change

This commit is contained in:
Connor Tumbleson 2014-01-07 15:06:45 -06:00
parent f6a61ba1b4
commit 501a6df677
2 changed files with 6 additions and 2 deletions

View File

@ -318,10 +318,15 @@ public class ApkDecoder {
private void putPackageInfo(Map<String, Object> meta)
throws AndrolibException {
String renamed = getResTable().getPackageRenamed();
String original = getResTable().getPackageOriginal();
int id = getResTable().getPackageId();
HashMap<String, String> packages = new HashMap<String, String>();
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);
}

View File

@ -181,7 +181,6 @@ final public class AndrolibResources {
mPackageOriginal = resPackage.getName();
mPackageRenamed = resTable.getPackageRenamed();
resTable.setPackageId(resPackage.getId());
resTable.setPackageOriginal(mPackageOriginal);