aapt2: Add a flag to determine if sparse resources or not

This commit is contained in:
Connor Tumbleson 2018-02-15 18:04:05 -05:00
parent e02c5f2b2f
commit 88987e60b3
2 changed files with 14 additions and 0 deletions

View File

@ -345,6 +345,7 @@ public class ApkDecoder {
putPackageInfo(meta);
putVersionInfo(meta);
putSharedLibraryInfo(meta);
putSparseResourcesInfo(meta);
}
putUnknownInfo(meta);
putFileCompressionInfo(meta);
@ -421,6 +422,10 @@ public class ApkDecoder {
}
}
private void putSparseResourcesInfo(MetaInfo meta) throws AndrolibException {
meta.sparseResources = mResTable.getSparseResources();
}
private void putSharedLibraryInfo(MetaInfo meta) throws AndrolibException {
meta.sharedLibrary = mResTable.getSharedLibrary();
}

View File

@ -39,6 +39,7 @@ public class ResTable {
private int mPackageId;
private boolean mAnalysisMode = false;
private boolean mSharedLibrary = false;
private boolean mSparseResources = false;
private Map<String, String> mSdkInfo = new LinkedHashMap<>();
private VersionInfo mVersionInfo = new VersionInfo();
@ -170,6 +171,10 @@ public class ResTable {
mSharedLibrary = flag;
}
public void setSparseResources(boolean flag) {
mSparseResources = flag;
}
public void clearSdkInfo() {
mSdkInfo.clear();
}
@ -213,4 +218,8 @@ public class ResTable {
public boolean getSharedLibrary() {
return mSharedLibrary;
}
public boolean getSparseResources() {
return mSparseResources;
}
}