mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-05 02:22:55 +01:00
+ UndefinedResourceSpec
This commit is contained in:
parent
2ef47b3f60
commit
440140b082
40
src/brut/androlib/err/UndefinedResourceSpec.java
Normal file
40
src/brut/androlib/err/UndefinedResourceSpec.java
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package brut.androlib.err;
|
||||||
|
|
||||||
|
import brut.androlib.AndrolibException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
|
||||||
|
*/
|
||||||
|
public class UndefinedResourceSpec extends AndrolibException {
|
||||||
|
public UndefinedResourceSpec(Throwable cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UndefinedResourceSpec(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UndefinedResourceSpec(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UndefinedResourceSpec() {
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package brut.androlib.res.data;
|
package brut.androlib.res.data;
|
||||||
|
|
||||||
|
import brut.androlib.err.UndefinedResourceSpec;
|
||||||
import brut.androlib.AndrolibException;
|
import brut.androlib.AndrolibException;
|
||||||
import brut.androlib.res.data.value.ResFileValue;
|
import brut.androlib.res.data.value.ResFileValue;
|
||||||
import brut.androlib.res.data.value.ResValue;
|
import brut.androlib.res.data.value.ResValue;
|
||||||
@ -58,10 +59,10 @@ public class ResPackage {
|
|||||||
return mResSpecs.containsKey(resID);
|
return mResSpecs.containsKey(resID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResResSpec getResSpec(ResID resID) throws AndrolibException {
|
public ResResSpec getResSpec(ResID resID) throws UndefinedResourceSpec {
|
||||||
ResResSpec spec = mResSpecs.get(resID);
|
ResResSpec spec = mResSpecs.get(resID);
|
||||||
if (spec == null) {
|
if (spec == null) {
|
||||||
throw new AndrolibException("Undefined resource spec: " + resID);
|
throw new UndefinedResourceSpec(resID.toString());
|
||||||
}
|
}
|
||||||
return spec;
|
return spec;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user