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

Function DescriptorToDot

Bcore/src/main/cpp/dex/descriptors_names.cc:137–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137std::string DescriptorToDot(const char* descriptor) {
138 size_t length = strlen(descriptor);
139 if (length > 1) {
140 if (descriptor[0] == 'L' && descriptor[length - 1] == ';') {
141 // Descriptors have the leading 'L' and trailing ';' stripped.
142 std::string result(descriptor + 1, length - 2);
143 std::replace(result.begin(), result.end(), '/', '.');
144 return result;
145 } else {
146 // For arrays the 'L' and ';' remain intact.
147 std::string result(descriptor);
148 std::replace(result.begin(), result.end(), '/', '.');
149 return result;
150 }
151 }
152 // Do nothing for non-class/array descriptors.
153 return descriptor;
154}
155
156std::string DescriptorToName(const char* descriptor) {
157 size_t length = strlen(descriptor);

Callers

nothing calls this directly

Calls 3

replaceFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected