mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 10:35:52 +01:00
ResConfig, ResResSpec: added possibility to overwrite stored ResResource.
This commit is contained in:
parent
6c98d60922
commit
4899344817
@ -56,8 +56,13 @@ public class ResConfig {
|
|||||||
|
|
||||||
public void addResource(ResResource res)
|
public void addResource(ResResource res)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
|
addResource(res, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addResource(ResResource res, boolean overwrite)
|
||||||
|
throws AndrolibException {
|
||||||
ResResSpec spec = res.getResSpec();
|
ResResSpec spec = res.getResSpec();
|
||||||
if (mResources.put(spec, res) != null) {
|
if (mResources.put(spec, res) != null && ! overwrite) {
|
||||||
throw new AndrolibException(String.format(
|
throw new AndrolibException(String.format(
|
||||||
"Multiple resources: spec=%s, config=%s", spec, this));
|
"Multiple resources: spec=%s, config=%s", spec, this));
|
||||||
}
|
}
|
||||||
|
@ -107,8 +107,13 @@ public class ResResSpec {
|
|||||||
|
|
||||||
public void addResource(ResResource res)
|
public void addResource(ResResource res)
|
||||||
throws AndrolibException {
|
throws AndrolibException {
|
||||||
|
addResource(res, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addResource(ResResource res, boolean overwrite)
|
||||||
|
throws AndrolibException {
|
||||||
ResConfigFlags flags = res.getConfig().getFlags();
|
ResConfigFlags flags = res.getConfig().getFlags();
|
||||||
if (mResources.put(flags, res) != null) {
|
if (mResources.put(flags, res) != null && ! overwrite) {
|
||||||
throw new AndrolibException(String.format(
|
throw new AndrolibException(String.format(
|
||||||
"Multiple resources: spec=%s, config=%s", this, flags));
|
"Multiple resources: spec=%s, config=%s", this, flags));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user