Prevent frameworks from modifying sharedLibrary

Since all frameworks are decoded the same via readPackage(), reading
a framework that was a sharedLibrary would throw the sharedLibrary
flag for the apk. Since packageName isn't set until after the first
decode, we check the values to make sure we only set this variable on
the first apk decoded. Refs #936
This commit is contained in:
Connor Tumbleson 2015-05-05 07:43:48 -05:00
parent 1fb87e3e4c
commit 48285bde03

View File

@ -90,7 +90,9 @@ public class ARSCDecoder {
// for Apktool's use we need a non-zero packageId.
// AOSP indicates 0x02 is next, as 0x01 is system and 0x7F is private.
id = 2;
mResTable.setSharedLibrary(true);
if (mResTable.getPackageOriginal() == null && mResTable.getPackageRenamed() == null) {
mResTable.setSharedLibrary(true);
}
}
String name = mIn.readNullEndedString(128, true);