mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 18:45:58 +01:00
only store renamed-manifest-package if the apk requires the change
This commit is contained in:
parent
f6a61ba1b4
commit
501a6df677
@ -318,10 +318,15 @@ public class ApkDecoder {
|
|||||||
private void putPackageInfo(Map<String, Object> meta)
|
private void putPackageInfo(Map<String, Object> meta)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
String renamed = getResTable().getPackageRenamed();
|
String renamed = getResTable().getPackageRenamed();
|
||||||
|
String original = getResTable().getPackageOriginal();
|
||||||
int id = getResTable().getPackageId();
|
int id = getResTable().getPackageId();
|
||||||
|
|
||||||
HashMap<String, String> packages = new HashMap<String, String>();
|
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));
|
packages.put("forced-package-id", String.valueOf(id));
|
||||||
meta.put("packageInfo", packages);
|
meta.put("packageInfo", packages);
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,6 @@ final public class AndrolibResources {
|
|||||||
mPackageOriginal = resPackage.getName();
|
mPackageOriginal = resPackage.getName();
|
||||||
mPackageRenamed = resTable.getPackageRenamed();
|
mPackageRenamed = resTable.getPackageRenamed();
|
||||||
|
|
||||||
|
|
||||||
resTable.setPackageId(resPackage.getId());
|
resTable.setPackageId(resPackage.getId());
|
||||||
resTable.setPackageOriginal(mPackageOriginal);
|
resTable.setPackageOriginal(mPackageOriginal);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user