MCPcopy Create free account
hub / github.com/ALEX5402/NewBlackbox / redirectPath

Method redirectPath

Bcore/src/main/cpp/IO.cpp:37–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37const char *IO::redirectPath(const char *__path) {
38
39 if (strstr(__path, "resource-cache")) {
40 ALOGD("Blocking resource-cache path: %s", __path);
41 return "/dev/null";
42 }
43
44
45 if (strstr(__path, "@idmap")) {
46 ALOGD("Blocking idmap path: %s", __path);
47 return "/dev/null";
48 }
49
50
51 if (strstr(__path, "systemui") && (strstr(__path, ".frro") || strstr(__path, "-accent-") || strstr(__path, "-dynamic-") || strstr(__path, "-neutral-"))) {
52 ALOGD("Blocking systemui problematic path: %s", __path);
53 return "/dev/null";
54 }
55
56
57 if (strstr(__path, "data@resource-cache@")) {
58 ALOGD("Blocking data@resource-cache@ pattern: %s", __path);
59 return "/dev/null";
60 }
61
62
63 if (strstr(__path, ".frro")) {
64 ALOGD("Blocking .frro file: %s", __path);
65 return "/dev/null";
66 }
67
68
69 if (strstr(__path, "systemui")) {
70 ALOGD("Blocking systemui path: %s", __path);
71 return "/dev/null";
72 }
73
74 list<IO::RelocateInfo>::iterator iterator;
75 for (iterator = relocate_rule.begin(); iterator != relocate_rule.end(); ++iterator) {
76 IO::RelocateInfo info = *iterator;
77 if (strstr(__path, info.targetPath) && !strstr(__path, "/blackbox/")) {
78 char *ret = replace(__path, info.targetPath, info.relocatePath);
79
80 return ret;
81 }
82 }
83 return __path;
84}
85
86jstring IO::redirectPath(JNIEnv *env, jstring path) {
87

Callers

nothing calls this directly

Calls 1

replaceFunction · 0.85

Tested by

no test coverage detected