MCPcopy Create free account
hub / github.com/CyanogenMod/android_frameworks_base / addProguardKeepRule

Function addProguardKeepRule

tools/aapt/Resource.cpp:2285–2317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2283}
2284
2285void
2286addProguardKeepRule(ProguardKeepSet* keep, const String8& inClassName,
2287 const char* pkg, const String8& srcName, int line)
2288{
2289 String8 className(inClassName);
2290 if (pkg != NULL) {
2291 // asdf --> package.asdf
2292 // .asdf .a.b --> package.asdf package.a.b
2293 // asdf.adsf --> asdf.asdf
2294 const char* p = className.string();
2295 const char* q = strchr(p, '.');
2296 if (p == q) {
2297 className = pkg;
2298 className.append(inClassName);
2299 } else if (q == NULL) {
2300 className = pkg;
2301 className.append(".");
2302 className.append(inClassName);
2303 }
2304 }
2305
2306 String8 rule("-keep class ");
2307 rule += className;
2308 rule += " { <init>(...); }";
2309
2310 String8 location("view ");
2311 location += srcName;
2312 char lineno[20];
2313 sprintf(lineno, ":%d", line);
2314 location += lineno;
2315
2316 keep->add(rule, location);
2317}
2318
2319void
2320addProguardKeepMethodRule(ProguardKeepSet* keep, const String8& memberName,

Callers 2

writeProguardForXmlFunction · 0.85

Calls 3

stringMethod · 0.80
appendMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected