public ResResSpec getResSpec(int resID) throws AndrolibException { // The pkgId is 0x00. That means a shared library is using its // own resource, so lie to the caller replacing with its own // packageId if (resID >> 24 == 0) { int pkgId = (mPackageId == 0 ? 2 : mPackageId); resID = (0xFF000000 & (pkgId << 24)) | resID; } return getResSpec(new ResID(resID)); }
public ResResSpec getReferent() throws AndrolibException { try { return mPackage.getResTable().getResSpec(getValue()); } catch (UndefinedResObject ex) { return null; } }
public String decodeManifestAttr(int attrResId) throws AndrolibException { if (attrResId != 0) { ResResSpec resResSpec = getCurrentPackage().getResTable().getResSpec(attrResId); if (resResSpec != null) { return resResSpec.getName(); } } return null; }
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(); }
if (resID != -1) { try { ResResSpec spec = resTable.getResSpec(resID); out.println(String.format(RES_NAME_FORMAT, spec.getFullName()));