MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / UnHideAccessFlags

Method UnHideAccessFlags

Bcore/src/main/cpp/dex/dex_file.cc:48–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46static_assert(std::is_trivially_copyable<dex::TypeIndex>::value, "TypeIndex not trivial");
47
48void DexFile::UnHideAccessFlags(ClassDataItemIterator& class_it) {
49 uint8_t* data = const_cast<uint8_t*>(class_it.DataPointer());
50 uint32_t new_flag = class_it.GetMemberAccessFlags();
51 bool is_method = class_it.IsAtMethod();
52 // Go back 1 uleb to start.
53 data = ReverseSearchUnsignedLeb128(data);
54 if (is_method) {
55 // Methods have another uleb field before the access flags
56 data = ReverseSearchUnsignedLeb128(data);
57 }
58 DCHECK_EQ(HiddenApiAccessFlags::RemoveFromDex(DecodeUnsignedLeb128WithoutMovingCursor(data)),
59 new_flag);
60 UpdateUnsignedLeb128(data, new_flag);
61}
62
63uint32_t DexFile::CalculateChecksum() const {
64 return CalculateChecksum(Begin(), Size());

Callers

nothing calls this directly

Calls 6

UpdateUnsignedLeb128Function · 0.85
GetMemberAccessFlagsMethod · 0.80
IsAtMethodMethod · 0.80
DataPointerMethod · 0.45

Tested by

no test coverage detected