mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-02 15:17:56 +01:00
Merge branch 'MarcMil-master'
This commit is contained in:
commit
b45054e65e
@ -35,12 +35,13 @@ public class ResResSpec {
|
||||
this.mId = id;
|
||||
String cleanName;
|
||||
|
||||
try {
|
||||
ResResSpec resResSpec = type.getResSpec(name);
|
||||
ResResSpec resResSpec = type.getResSpecUnsafe(name);
|
||||
if (resResSpec != null) {
|
||||
cleanName = name + "_APKTOOL_DUPLICATENAME_" + id.toString();
|
||||
} catch (AndrolibException ex) {
|
||||
} else {
|
||||
cleanName = (name.isEmpty() ? ("APKTOOL_DUMMYVAL_" + id.toString()) : name);
|
||||
}
|
||||
|
||||
this.mName = cleanName;
|
||||
this.mPackage = pkg;
|
||||
this.mType = type;
|
||||
|
@ -62,13 +62,17 @@ public final class ResTypeSpec {
|
||||
}
|
||||
|
||||
public ResResSpec getResSpec(String name) throws AndrolibException {
|
||||
ResResSpec spec = mResSpecs.get(name);
|
||||
ResResSpec spec = getResSpecUnsafe(name);
|
||||
if (spec == null) {
|
||||
throw new UndefinedResObject(String.format("resource spec: %s/%s", getName(), name));
|
||||
}
|
||||
return spec;
|
||||
}
|
||||
|
||||
public ResResSpec getResSpecUnsafe(String name) {
|
||||
return mResSpecs.get(name);
|
||||
}
|
||||
|
||||
public void removeResSpec(ResResSpec spec) throws AndrolibException {
|
||||
mResSpecs.remove(spec.getName());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user