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

Method CheckInterStringIdItem

Bcore/src/main/cpp/dex/dex_file_verifier.cc:2027–2048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2025}
2026
2027bool DexFileVerifier::CheckInterStringIdItem() {
2028 const DexFile::StringId* item = reinterpret_cast<const DexFile::StringId*>(ptr_);
2029
2030 // Check the map to make sure it has the right offset->type.
2031 if (!CheckOffsetToTypeMap(item->string_data_off_, DexFile::kDexTypeStringDataItem)) {
2032 return false;
2033 }
2034
2035 // Check ordering between items.
2036 if (previous_item_ != nullptr) {
2037 const DexFile::StringId* prev_item = reinterpret_cast<const DexFile::StringId*>(previous_item_);
2038 const char* prev_str = dex_file_->GetStringData(*prev_item);
2039 const char* str = dex_file_->GetStringData(*item);
2040 if (UNLIKELY(CompareModifiedUtf8ToModifiedUtf8AsUtf16CodePointValues(prev_str, str) >= 0)) {
2041 ErrorStringPrintf("Out-of-order string_ids: '%s' then '%s'", prev_str, str);
2042 return false;
2043 }
2044 }
2045
2046 ptr_ += sizeof(DexFile::StringId);
2047 return true;
2048}
2049
2050bool DexFileVerifier::CheckInterTypeIdItem() {
2051 const DexFile::TypeId* item = reinterpret_cast<const DexFile::TypeId*>(ptr_);

Callers

nothing calls this directly

Tested by

no test coverage detected