本文整理汇总了Java中brut.androlib.err.UndefinedResObject类的典型用法代码示例。如果您正苦于以下问题:Java UndefinedResObject类的具体用法?Java UndefinedResObject怎么用?Java UndefinedResObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UndefinedResObject类属于brut.androlib.err包,在下文中一共展示了UndefinedResObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: putPackageInfo
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
private void putPackageInfo(MetaInfo meta) throws AndrolibException {
String renamed = getResTable().getPackageRenamed();
String original = getResTable().getPackageOriginal();
int id = getResTable().getPackageId();
try {
id = getResTable().getPackage(renamed).getId();
} catch (UndefinedResObject ignored) {}
if (Strings.isNullOrEmpty(original)) {
return;
}
meta.packageInfo = new PackageInfo();
// only put rename-manifest-package into apktool.yml, if the change will be required
if (!renamed.equalsIgnoreCase(original)) {
meta.packageInfo.renameManifestPackage = renamed;
}
meta.packageInfo.forcedPackageId = String.valueOf(id);
}
示例2: decode
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public String decode(int type, int value, String rawValue, int attrResId)
throws AndrolibException {
ResScalarValue resValue = mCurrentPackage.getValueFactory().factory(
type, value, rawValue);
String decoded = null;
if (attrResId > 0) {
try {
ResAttr attr = (ResAttr) getCurrentPackage().getResTable()
.getResSpec(attrResId).getDefaultResource().getValue();
decoded = attr.convertToResXmlFormat(resValue);
} catch (UndefinedResObject | ClassCastException ex) {
// ignored
}
}
return decoded != null ? decoded : resValue.encodeAsResXmlAttr();
}
示例3: getPackage
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResPackage getPackage(int id) throws AndrolibException {
ResPackage pkg = mPackagesById.get(id);
if (pkg != null) {
return pkg;
}
if (mAndRes != null) {
return mAndRes.loadFrameworkPkg(this, id, mAndRes.apkOptions.frameworkTag);
}
throw new UndefinedResObject(String.format("package: id=%d", id));
}
示例4: getResSpec
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResResSpec getResSpec(String name) throws AndrolibException {
ResResSpec spec = mResSpecs.get(name);
if (spec == null) {
throw new UndefinedResObject(String.format("resource spec: %s/%s", getName(), name));
}
return spec;
}
示例5: getResSpec
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResResSpec getResSpec(ResID resID) throws UndefinedResObject {
ResResSpec spec = mResSpecs.get(resID);
if (spec == null) {
throw new UndefinedResObject("resource spec: " + resID.toString());
}
return spec;
}
示例6: getConfig
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResType getConfig(ResConfigFlags flags) throws AndrolibException {
ResType config = mConfigs.get(flags);
if (config == null) {
throw new UndefinedResObject("config: " + flags);
}
return config;
}
示例7: getType
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResTypeSpec getType(String typeName) throws AndrolibException {
ResTypeSpec type = mTypes.get(typeName);
if (type == null) {
throw new UndefinedResObject("type: " + typeName);
}
return type;
}
示例8: getResource
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResResource getResource(ResResSpec spec) throws AndrolibException {
ResResource res = mResources.get(spec);
if (res == null) {
throw new UndefinedResObject(String.format("resource: spec=%s, config=%s", spec, this));
}
return res;
}
示例9: getResource
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResResource getResource(ResConfigFlags config) throws AndrolibException {
ResResource res = mResources.get(config);
if (res == null) {
throw new UndefinedResObject(String.format("resource: spec=%s, config=%s", this, config));
}
return res;
}
示例10: tagResIdsForFile
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
private void tagResIdsForFile(ResTable resTable, Directory dir,
String fileName) throws IOException, DirectoryException,
AndrolibException {
Iterator<String> it = IOUtils.readLines(dir.getFileInput(fileName))
.iterator();
PrintWriter out = new PrintWriter(dir.getFileOutput(fileName));
while (it.hasNext()) {
String line = it.next();
if (RES_NAME_PATTERN.matcher(line).matches()) {
out.println(line);
out.println(it.next());
continue;
}
Matcher m = RES_ID_PATTERN.matcher(line);
if (m.matches()) {
int resID = parseResID(m.group(3));
if (resID != -1) {
try {
ResResSpec spec = resTable.getResSpec(resID);
out.println(String.format(RES_NAME_FORMAT,
spec.getFullName()));
} catch (UndefinedResObject ex) {
if (!R_FILE_PATTERN.matcher(fileName).matches()) {
LOGGER.warning(String.format(
"Undefined resource spec in %s: 0x%08x",
fileName, resID));
}
}
}
}
out.println(line);
}
out.close();
}
示例11: getPackage
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResPackage getPackage(int id) throws AndrolibException {
ResPackage pkg = mPackagesById.get(id);
if (pkg != null) {
return pkg;
}
if (mAndRes != null) {
return mAndRes.loadFrameworkPkg(this, id, mFrameTag);
}
throw new UndefinedResObject(String.format("package: id=%d", id));
}
示例12: getResource
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResResource getResource(ResResSpec spec) throws AndrolibException {
ResResource res = mResources.get(spec);
if (res == null) {
throw new UndefinedResObject(String.format(
"resource: spec=%s, config=%s", spec, this));
}
return res;
}
示例13: getResSpec
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResResSpec getResSpec(ResID resID) throws UndefinedResObject {
ResResSpec spec = mResSpecs.get(resID);
if (spec == null) {
throw new UndefinedResObject("resource spec: " + resID.toString());
}
return spec;
}
示例14: getConfig
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResConfig getConfig(ResConfigFlags flags) throws AndrolibException {
ResConfig config = mConfigs.get(flags);
if (config == null) {
throw new UndefinedResObject("config: " + flags);
}
return config;
}
示例15: getType
import brut.androlib.err.UndefinedResObject; //导入依赖的package包/类
public ResType getType(String typeName) throws AndrolibException {
ResType type = mTypes.get(typeName);
if (type == null) {
throw new UndefinedResObject("type: " + typeName);
}
return type;
}