summaryrefslogtreecommitdiff
path: root/tools/veridex/hidden_api.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-04-09 12:49:48 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2024-04-11 15:10:07 +0000
commite8da7cd1d0e7d3535c82f8d05adcef3edd43cd40 (patch)
treef39114f368998a7b6415bb905fa71dc04dc3b232 /tools/veridex/hidden_api.cc
parent69dc24557f951ce2513d0ea77f35a499fa58467b (diff)
Clean up string data access in `DexFile`.
The `*ByIdx()` and `*ByTypeIdx()` functions were doing validity checks that were needed only for processing the debug data, so move the checks to these callers. Replace these functions with new overloads of other functions to provide consistent naming. In a few cases, rewrite calls to these functions to fetch and work with a `string_view` instead. Rename `GetStringLength()` to `GetStringUtf16Length()` and change its return type to `uint32_t`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I561899606f6e5ec5f23aa4be617349dacdb376e3
Diffstat (limited to 'tools/veridex/hidden_api.cc')
-rw-r--r--tools/veridex/hidden_api.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/veridex/hidden_api.cc b/tools/veridex/hidden_api.cc
index 69e6fe403f..4156aa954b 100644
--- a/tools/veridex/hidden_api.cc
+++ b/tools/veridex/hidden_api.cc
@@ -82,7 +82,7 @@ void HiddenApi::AddSignatureToApiList(const std::string& signature, hiddenapi::A
std::string HiddenApi::GetApiMethodName(const DexFile& dex_file, uint32_t method_index) {
std::stringstream ss;
const dex::MethodId& method_id = dex_file.GetMethodId(method_index);
- ss << dex_file.StringByTypeIdx(method_id.class_idx_)
+ ss << dex_file.GetTypeDescriptorView(method_id.class_idx_)
<< "->"
<< dex_file.GetMethodName(method_id)
<< dex_file.GetMethodSignature(method_id).ToString();
@@ -92,7 +92,7 @@ std::string HiddenApi::GetApiMethodName(const DexFile& dex_file, uint32_t method
std::string HiddenApi::GetApiFieldName(const DexFile& dex_file, uint32_t field_index) {
std::stringstream ss;
const dex::FieldId& field_id = dex_file.GetFieldId(field_index);
- ss << dex_file.StringByTypeIdx(field_id.class_idx_)
+ ss << dex_file.GetTypeDescriptorView(field_id.class_idx_)
<< "->"
<< dex_file.GetFieldName(field_id)
<< ":"