Revert^4: Add dex item for hiddenapi flags
Move hiddenapi access flags to own data section so as to:
(a) increase amount of information stored per method/field
(b) use encoding which can be supported long-term.
The dex item is implemented as:
- array of offsets indexed by class def index
- streams of uleb-128 encoded flags.
Offsets in array point to the beginning of the flags stream
for the given class def. Flags are encoded in the same order
as fields and methods are encoded in class data. Zero offset
means that the class either does not have class data, or all
of its flags are zero.
The patch updates:
(a) libdexfile with data structure declarations and accessor
methods,
(b) hiddenapi tool to create the new item from hiddenapi lists
and insert it into the given dex file,
(c) dexlayout to copy the flags into compact dex,
(d) dex file verifier to verify the item.
It also removes skipping of verification for boot class path
dex files as those now pass DexFileVerifier, and removes the
need for removing the flags for JVMTI.
The size increase is 450 KB.
This reverts commit d33d318685ec4a1c9e7995c914c104ab6487513b.
Change-Id: Id00e0efb38ee1eab8d7ed5c645a7778b6b94b849
Test: phone boots
Test: m test-art
diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc
index 6b2a1b9..2b59342 100644
--- a/dexdump/dexdump.cc
+++ b/dexdump/dexdump.cc
@@ -1208,7 +1208,7 @@
*/
static void dumpMethod(const ClassAccessor::Method& method, int i) {
// Bail for anything private if export only requested.
- const uint32_t flags = method.GetRawAccessFlags();
+ const uint32_t flags = method.GetAccessFlags();
if (gOptions.exportsOnly && (flags & (kAccPublic | kAccProtected)) == 0) {
return;
}
@@ -1319,7 +1319,7 @@
*/
static void dumpField(const ClassAccessor::Field& field, int i, const u1** data = nullptr) {
// Bail for anything private if export only requested.
- const uint32_t flags = field.GetRawAccessFlags();
+ const uint32_t flags = field.GetAccessFlags();
if (gOptions.exportsOnly && (flags & (kAccPublic | kAccProtected)) == 0) {
return;
}