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

Method FindStringId

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

Source from the content-addressed store, hash-verified

311}
312
313const DexFile::StringId* DexFile::FindStringId(const char* string) const {
314 int32_t lo = 0;
315 int32_t hi = NumStringIds() - 1;
316 while (hi >= lo) {
317 int32_t mid = (hi + lo) / 2;
318 const DexFile::StringId& str_id = GetStringId(dex::StringIndex(mid));
319 const char* str = GetStringData(str_id);
320 int compare = CompareModifiedUtf8ToModifiedUtf8AsUtf16CodePointValues(string, str);
321 if (compare > 0) {
322 lo = mid + 1;
323 } else if (compare < 0) {
324 hi = mid - 1;
325 } else {
326 return &str_id;
327 }
328 }
329 return nullptr;
330}
331
332const DexFile::TypeId* DexFile::FindTypeId(const char* string) const {
333 int32_t lo = 0;

Callers

nothing calls this directly

Tested by

no test coverage detected