mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-09 02:26:47 +01:00
fix: crash when decompiling framework-res.apk with a tag (regression) (#3193)
This commit is contained in:
parent
79b2173b85
commit
24b0c3249d
@ -243,9 +243,6 @@ public class ResourcesDecoder {
|
||||
break;
|
||||
}
|
||||
mResTable.initApkInfo(mApkInfo, outDir);
|
||||
if (mConfig.frameworkTag != null) {
|
||||
mApkInfo.usesFramework.tag = mConfig.frameworkTag;
|
||||
}
|
||||
}
|
||||
return mResTable;
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ public class ResTable {
|
||||
}
|
||||
|
||||
private boolean isFrameworkApk() {
|
||||
for (ResPackage pkg : listMainPackages()) {
|
||||
for (ResPackage pkg : mMainPackages) {
|
||||
if (pkg.getId() > 0 && pkg.getId() < 64) {
|
||||
return true;
|
||||
}
|
||||
@ -301,9 +301,7 @@ public class ResTable {
|
||||
|
||||
public void initApkInfo(ApkInfo apkInfo, File outDir) throws AndrolibException {
|
||||
apkInfo.isFrameworkApk = isFrameworkApk();
|
||||
if (!listFramePackages().isEmpty()) {
|
||||
apkInfo.usesFramework = getUsesFramework();
|
||||
}
|
||||
if (!mApkInfo.getSdkInfo().isEmpty()) {
|
||||
updateSdkInfoFromResources(outDir);
|
||||
}
|
||||
@ -312,18 +310,15 @@ public class ResTable {
|
||||
}
|
||||
|
||||
private UsesFramework getUsesFramework() {
|
||||
Set<ResPackage> pkgs = listFramePackages();
|
||||
|
||||
Integer[] ids = new Integer[pkgs.size()];
|
||||
UsesFramework info = new UsesFramework();
|
||||
Integer[] ids = new Integer[mFramePackages.size()];
|
||||
int i = 0;
|
||||
for (ResPackage pkg : pkgs) {
|
||||
for (ResPackage pkg : mFramePackages) {
|
||||
ids[i++] = pkg.getId();
|
||||
}
|
||||
Arrays.sort(ids);
|
||||
|
||||
UsesFramework info = new UsesFramework();
|
||||
info.ids = Arrays.asList(ids);
|
||||
|
||||
info.tag = mConfig.frameworkTag;
|
||||
return info;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user