mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-11 13:27:47 +01:00
fix: remove unused methods from Res* data classes
This commit is contained in:
parent
edb4fc86cc
commit
618d9b23e5
@ -58,27 +58,11 @@ public class ResPackage {
|
||||
return spec;
|
||||
}
|
||||
|
||||
public List<ResType> getConfigs() {
|
||||
return new ArrayList<ResType>(mConfigs.values());
|
||||
}
|
||||
|
||||
public boolean hasConfig(ResConfigFlags flags) {
|
||||
return mConfigs.containsKey(flags);
|
||||
}
|
||||
|
||||
public ResType getConfig(ResConfigFlags flags) throws AndrolibException {
|
||||
ResType config = mConfigs.get(flags);
|
||||
if (config == null) {
|
||||
throw new UndefinedResObjectException("config: " + flags);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
public int getResSpecCount() {
|
||||
return mResSpecs.size();
|
||||
}
|
||||
|
||||
public ResType getOrCreateConfig(ResConfigFlags flags) throws AndrolibException {
|
||||
public ResType getOrCreateConfig(ResConfigFlags flags) {
|
||||
ResType config = mConfigs.get(flags);
|
||||
if (config == null) {
|
||||
config = new ResType(flags);
|
||||
@ -87,14 +71,6 @@ public class ResPackage {
|
||||
return config;
|
||||
}
|
||||
|
||||
public List<ResTypeSpec> listTypes() {
|
||||
return new ArrayList<ResTypeSpec>(mTypes.values());
|
||||
}
|
||||
|
||||
public boolean hasType(String typeName) {
|
||||
return mTypes.containsKey(typeName);
|
||||
}
|
||||
|
||||
public ResTypeSpec getType(String typeName) throws AndrolibException {
|
||||
ResTypeSpec type = mTypes.get(typeName);
|
||||
if (type == null) {
|
||||
@ -151,7 +127,7 @@ public class ResPackage {
|
||||
return mSynthesizedRes.contains(resId);
|
||||
}
|
||||
|
||||
public void removeResSpec(ResResSpec spec) throws AndrolibException {
|
||||
public void removeResSpec(ResResSpec spec) {
|
||||
mResSpecs.remove(spec.getId());
|
||||
}
|
||||
|
||||
@ -161,13 +137,7 @@ public class ResPackage {
|
||||
}
|
||||
}
|
||||
|
||||
public void addConfig(ResType config) throws AndrolibException {
|
||||
if (mConfigs.put(config.getFlags(), config) != null) {
|
||||
throw new AndrolibException("Multiple configs: " + config);
|
||||
}
|
||||
}
|
||||
|
||||
public void addType(ResTypeSpec type) throws AndrolibException {
|
||||
public void addType(ResTypeSpec type) {
|
||||
if (mTypes.containsKey(type.getName())) {
|
||||
LOGGER.warning("Multiple types detected! " + type + " ignored!");
|
||||
} else {
|
||||
@ -175,12 +145,6 @@ public class ResPackage {
|
||||
}
|
||||
}
|
||||
|
||||
public void addResource(ResResource res) {
|
||||
}
|
||||
|
||||
public void removeResource(ResResource res) {
|
||||
}
|
||||
|
||||
public void addSynthesizedRes(int resId) {
|
||||
mSynthesizedRes.add(new ResID(resId));
|
||||
}
|
||||
|
@ -64,14 +64,6 @@ public class ResResSpec {
|
||||
return res;
|
||||
}
|
||||
|
||||
public boolean hasResource(ResType config) {
|
||||
return hasResource(config.getFlags());
|
||||
}
|
||||
|
||||
private boolean hasResource(ResConfigFlags flags) {
|
||||
return mResources.containsKey(flags);
|
||||
}
|
||||
|
||||
public ResResource getDefaultResource() throws AndrolibException {
|
||||
return getResource(new ResConfigFlags());
|
||||
}
|
||||
@ -80,10 +72,6 @@ public class ResResSpec {
|
||||
return mResources.containsKey(new ResConfigFlags());
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return getFullName(false, false);
|
||||
}
|
||||
|
||||
public String getFullName(ResPackage relativeToPackage, boolean excludeType) {
|
||||
return getFullName(getPackage().equals(relativeToPackage), excludeType);
|
||||
}
|
||||
@ -124,11 +112,6 @@ public class ResResSpec {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeResource(ResResource res) throws AndrolibException {
|
||||
ResConfigFlags flags = res.getConfig().getFlags();
|
||||
mResources.remove(flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return mId.toString() + " " + mType.toString() + "/" + mName;
|
||||
|
@ -117,14 +117,6 @@ public class ResTable {
|
||||
return pkg;
|
||||
}
|
||||
|
||||
public boolean hasPackage(int id) {
|
||||
return mPackagesById.containsKey(id);
|
||||
}
|
||||
|
||||
public boolean hasPackage(String name) {
|
||||
return mPackagesByName.containsKey(name);
|
||||
}
|
||||
|
||||
public ResValue getValue(String package_, String type, String name) throws AndrolibException {
|
||||
return getPackage(package_).getType(type).getResSpec(name).getDefaultResource().getValue();
|
||||
}
|
||||
|
@ -28,10 +28,6 @@ public class ResType {
|
||||
this.mFlags = flags;
|
||||
}
|
||||
|
||||
public Set<ResResource> listResources() {
|
||||
return new LinkedHashSet<ResResource>(mResources.values());
|
||||
}
|
||||
|
||||
public ResResource getResource(ResResSpec spec) throws AndrolibException {
|
||||
ResResource res = mResources.get(spec);
|
||||
if (res == null) {
|
||||
@ -40,10 +36,6 @@ public class ResType {
|
||||
return res;
|
||||
}
|
||||
|
||||
public Set<ResResSpec> listResSpecs() {
|
||||
return mResources.keySet();
|
||||
}
|
||||
|
||||
public ResConfigFlags getFlags() {
|
||||
return mFlags;
|
||||
}
|
||||
@ -52,11 +44,6 @@ public class ResType {
|
||||
addResource(res, false);
|
||||
}
|
||||
|
||||
public void removeResource(ResResource res) throws AndrolibException {
|
||||
ResResSpec spec = res.getResSpec();
|
||||
mResources.remove(spec);
|
||||
}
|
||||
|
||||
public void addResource(ResResource res, boolean overwrite) throws AndrolibException {
|
||||
ResResSpec spec = res.getResSpec();
|
||||
if (mResources.put(spec, res) != null && !overwrite) {
|
||||
|
@ -52,18 +52,10 @@ public final class ResTypeSpec {
|
||||
return mId;
|
||||
}
|
||||
|
||||
public int getEntryCount() {
|
||||
return mEntryCount;
|
||||
}
|
||||
|
||||
public boolean isString() {
|
||||
return mName.equalsIgnoreCase("string");
|
||||
}
|
||||
|
||||
public Set<ResResSpec> listResSpecs() {
|
||||
return new LinkedHashSet<ResResSpec>(mResSpecs.values());
|
||||
}
|
||||
|
||||
public ResResSpec getResSpec(String name) throws AndrolibException {
|
||||
ResResSpec spec = getResSpecUnsafe(name);
|
||||
if (spec == null) {
|
||||
@ -76,7 +68,7 @@ public final class ResTypeSpec {
|
||||
return mResSpecs.get(name);
|
||||
}
|
||||
|
||||
public void removeResSpec(ResResSpec spec) throws AndrolibException {
|
||||
public void removeResSpec(ResResSpec spec) {
|
||||
mResSpecs.remove(spec.getName());
|
||||
}
|
||||
|
||||
|
@ -45,10 +45,6 @@ public class ResValuesFile {
|
||||
return mType;
|
||||
}
|
||||
|
||||
public ResType getConfig() {
|
||||
return mConfig;
|
||||
}
|
||||
|
||||
public boolean isSynthesized(ResResource res) {
|
||||
return mPackage.isSynthesized(res.getResSpec().getId());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user