MCPcopy Create free account
hub / github.com/MhmRdd/NoHello / anomaly

Function anomaly

module/src/main/cpp/nohello.cpp:66–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64static const std::string adbPathPrefix = "/data/adb";
65
66static bool anomaly(MountRootResolver mrs, const MountInfo &mount) {
67 const std::string resolved_root = mrs.resolveRoot(mount);
68 if (resolved_root.starts_with(adbPathPrefix) || mount.getMountPoint().starts_with(adbPathPrefix)) {
69 return true;
70 }
71 const auto& fs_type = mount.getFsType();
72 const auto& mnt_src = mount.getMountSource();
73 if (toumount_sources.count(mnt_src)) {
74 return true;
75 }
76 if (fs_type == "overlay") {
77 if (toumount_sources.count(mnt_src)) {
78 return true;
79 }
80 const auto& fm = mount.getMountOptions().flagmap;
81 if (fm.count("lowerdir") && fm.at("lowerdir").starts_with(adbPathPrefix)) {
82 return true;
83 }
84 if (fm.count("upperdir") && fm.at("upperdir").starts_with(adbPathPrefix)) {
85 return true;
86 }
87 if (fm.count("workdir") && fm.at("workdir").starts_with(adbPathPrefix)) {
88 return true;
89 }
90 } else if (fs_type == "tmpfs") {
91 if (toumount_sources.count(mnt_src)) {
92 return true;
93 }
94 }
95 return false;
96}
97
98static bool anomaly(const MountRuleParser::MountRule& rule, MountRootResolver mrs, const MountInfo &mount) {
99 const std::string resolvedRoot = mrs.resolveRoot(mount);

Callers 2

unmountFunction · 0.85
preSpecializeMethod · 0.85

Calls 3

resolveRootMethod · 0.80
matchesMethod · 0.80
GetSocketNameMethod · 0.80

Tested by

no test coverage detected