public void addSynthesizedRes(int resId) { mSynthesizedRes.add(new ResID(resId)); }
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)); }
@Override public String getAttributeNamespace(int index) { int offset = getAttributeOffset(index); int namespace = m_attributes[offset + ATTRIBUTE_IX_NAMESPACE_URI]; if (namespace == -1) { return ""; } // Minifiers like removing the namespace, so we will default to default namespace // unless the pkgId of the resource is private. We will grab the non-standard one. String value = m_strings.getString(namespace); if (value.length() == 0) { ResID resourceId = new ResID(getAttributeNameResource(index)); if (resourceId.package_ == PRIVATE_PKG_ID) { value = getNonDefaultNamespaceUri(); } else { value = android_ns; } } return value; }
private void addMissingResSpecs() throws AndrolibException { int resId = mResId & 0xffff0000; for (int i = 0; i < mMissingResSpecs.length; i++) { if (!mMissingResSpecs[i]) { continue; } ResResSpec spec = new ResResSpec(new ResID(resId | i), "APKTOOL_DUMMY_" + Integer.toHexString(i), mPkg, mTypeSpec); // If we already have this resID dont add it again. if (! mPkg.hasResSpec(new ResID(resId | i))) { mPkg.addResSpec(spec); mTypeSpec.addResSpec(spec); if (mType == null) { mType = mPkg.getOrCreateConfig(new ResConfigFlags()); } ResValue value = new ResBoolValue(false, 0, null); ResResource res = new ResResource(mType, spec, value); mPkg.addResource(res); mType.addResource(res); spec.addResource(res); } } }
ResID resId = new ResID(mResId); ResResSpec spec; if (mPkg.hasResSpec(resId)) {