當前位置: 首頁>>代碼示例>>Java>>正文


Java UndefinedResObject類代碼示例

本文整理匯總了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);
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:22,代碼來源:ApkDecoder.java

示例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();
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:20,代碼來源:ResAttrDecoder.java

示例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));
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:11,代碼來源:ResTable.java

示例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;
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:8,代碼來源:ResTypeSpec.java

示例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;
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:8,代碼來源:ResPackage.java

示例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;
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:8,代碼來源:ResPackage.java

示例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;
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:8,代碼來源:ResPackage.java

示例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;
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:8,代碼來源:ResType.java

示例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;
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:8,代碼來源:ResResSpec.java

示例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();
}
 
開發者ID:imkiva,項目名稱:AndroidApktool,代碼行數:35,代碼來源:ResSmaliUpdater.java

示例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));
}
 
開發者ID:Sukelluskello,項目名稱:VectorAttackScanner,代碼行數:11,代碼來源:ResTable.java

示例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;
}
 
開發者ID:Sukelluskello,項目名稱:VectorAttackScanner,代碼行數:9,代碼來源:ResConfig.java

示例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;
}
 
開發者ID:Sukelluskello,項目名稱:VectorAttackScanner,代碼行數:8,代碼來源:ResPackage.java

示例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;
}
 
開發者ID:Sukelluskello,項目名稱:VectorAttackScanner,代碼行數:8,代碼來源:ResPackage.java

示例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;
}
 
開發者ID:Sukelluskello,項目名稱:VectorAttackScanner,代碼行數:8,代碼來源:ResPackage.java


注:本文中的brut.androlib.err.UndefinedResObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。