mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 10:35:52 +01:00
fix: accept empty resources.arsc (#2998)
* fix: accept empty resources.arsc * fix: accept empty resources.arsc (fix isFrameworkApk=true)
This commit is contained in:
parent
0a3c7595eb
commit
120611879c
@ -776,7 +776,7 @@ public class Androlib {
|
||||
|
||||
public boolean isFrameworkApk(ResTable resTable) {
|
||||
for (ResPackage pkg : resTable.listMainPackages()) {
|
||||
if (pkg.getId() < 64) {
|
||||
if (pkg.getId() > 0 && pkg.getId() < 64) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ final public class AndrolibResources {
|
||||
|
||||
switch (pkgs.length) {
|
||||
case 0:
|
||||
pkg = null;
|
||||
pkg = new ResPackage(resTable, 0, null);
|
||||
break;
|
||||
case 1:
|
||||
pkg = pkgs[0];
|
||||
@ -80,10 +80,6 @@ final public class AndrolibResources {
|
||||
break;
|
||||
}
|
||||
|
||||
if (pkg == null) {
|
||||
throw new AndrolibException("arsc files with zero packages or no arsc file found.");
|
||||
}
|
||||
|
||||
resTable.addPackage(pkg, true);
|
||||
return pkg;
|
||||
}
|
||||
@ -168,9 +164,11 @@ final public class AndrolibResources {
|
||||
resTable.setPackageId(resPackage.getId());
|
||||
resTable.setPackageOriginal(pkgOriginal);
|
||||
|
||||
// 1) Check if pkgOriginal === mPackageRenamed
|
||||
// 2) Check if pkgOriginal is ignored via IGNORED_PACKAGES
|
||||
if (pkgOriginal.equalsIgnoreCase(mPackageRenamed) || (Arrays.asList(IGNORED_PACKAGES).contains(pkgOriginal))) {
|
||||
// 1) Check if pkgOriginal is null (empty resources.arsc)
|
||||
// 2) Check if pkgOriginal === mPackageRenamed
|
||||
// 3) Check if pkgOriginal is ignored via IGNORED_PACKAGES
|
||||
if (pkgOriginal == null || pkgOriginal.equalsIgnoreCase(mPackageRenamed)
|
||||
|| (Arrays.asList(IGNORED_PACKAGES).contains(pkgOriginal))) {
|
||||
LOGGER.info("Regular manifest package...");
|
||||
} else {
|
||||
LOGGER.info("Renamed manifest package found! Replacing " + mPackageRenamed + " with " + pkgOriginal);
|
||||
|
Loading…
Reference in New Issue
Block a user