mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-23 02:07:36 +01:00
Merge branch 'crpalmer-ignore-duplicate-res'
This commit is contained in:
commit
1ff3a375d4
@ -72,6 +72,7 @@ public class ApkDecoder {
|
|||||||
|
|
||||||
public void decode() throws AndrolibException, IOException, DirectoryException {
|
public void decode() throws AndrolibException, IOException, DirectoryException {
|
||||||
File outDir = getOutDir();
|
File outDir = getOutDir();
|
||||||
|
AndrolibResources.sKeepBroken = mKeepBrokenResources;
|
||||||
|
|
||||||
if (!mForceDelete && outDir.exists()) {
|
if (!mForceDelete && outDir.exists()) {
|
||||||
throw new OutDirExistsException();
|
throw new OutDirExistsException();
|
||||||
@ -239,7 +240,6 @@ public class ApkDecoder {
|
|||||||
throw new AndrolibException(
|
throw new AndrolibException(
|
||||||
"Apk doesn't contain either AndroidManifest.xml file or resources.arsc file");
|
"Apk doesn't contain either AndroidManifest.xml file or resources.arsc file");
|
||||||
}
|
}
|
||||||
AndrolibResources.sKeepBroken = mKeepBrokenResources;
|
|
||||||
mResTable = mAndrolib.getResTable(mApkFile, hasResources);
|
mResTable = mAndrolib.getResTable(mApkFile, hasResources);
|
||||||
}
|
}
|
||||||
return mResTable;
|
return mResTable;
|
||||||
|
@ -249,8 +249,18 @@ public class ARSCDecoder {
|
|||||||
}
|
}
|
||||||
ResResource res = new ResResource(mType, spec, value);
|
ResResource res = new ResResource(mType, spec, value);
|
||||||
|
|
||||||
|
try {
|
||||||
mType.addResource(res);
|
mType.addResource(res);
|
||||||
spec.addResource(res);
|
spec.addResource(res);
|
||||||
|
} catch (AndrolibException ex) {
|
||||||
|
if (mKeepBroken) {
|
||||||
|
mType.addResource(res, true);
|
||||||
|
spec.addResource(res, true);
|
||||||
|
LOGGER.warning(String.format("Duplicate Resource Detected. Ignoring duplicate: %s", res.toString()));
|
||||||
|
} else {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
mPkg.addResource(res);
|
mPkg.addResource(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user