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

Function GetJniShortName

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

Source from the content-addressed store, hash-verified

80}
81
82std::string GetJniShortName(const std::string& class_descriptor, const std::string& method) {
83 // Remove the leading 'L' and trailing ';'...
84 std::string class_name(class_descriptor);
85 CHECK_EQ(class_name[0], 'L') << class_name;
86 CHECK_EQ(class_name[class_name.size() - 1], ';') << class_name;
87 class_name.erase(0, 1);
88 class_name.erase(class_name.size() - 1, 1);
89
90 std::string short_name;
91 short_name += "Java_";
92 short_name += MangleForJni(class_name);
93 short_name += "_";
94 short_name += MangleForJni(method);
95 return short_name;
96}
97
98// See http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/design.html#wp615 for the full rules.
99std::string MangleForJni(const std::string& s) {

Callers

nothing calls this directly

Calls 3

MangleForJniFunction · 0.85
eraseMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected