diff --git a/native/jni/init/getinfo.cpp b/native/jni/init/getinfo.cpp index 3a2812c6a..dda89c6a4 100644 --- a/native/jni/init/getinfo.cpp +++ b/native/jni/init/getinfo.cpp @@ -186,5 +186,5 @@ bool check_two_stage() { return true; // If we still have no indication, parse the original init and see what's up auto init = raw_data::mmap_ro("/.backup/init"); - return init.find("selinux_setup"); + return init.contains("selinux_setup"); } diff --git a/native/jni/init/init.cpp b/native/jni/init/init.cpp index 82b28ca6b..663a6e447 100644 --- a/native/jni/init/init.cpp +++ b/native/jni/init/init.cpp @@ -40,7 +40,7 @@ int data_holder::patch(str_pairs list) { return count; } -bool data_holder::find(string_view pattern) { +bool data_holder::contains(string_view pattern) { for (uint8_t *p = buf, *eof = buf + sz; p < eof; ++p) { if (memcmp(p, pattern.data(), pattern.length() + 1) == 0) return true; diff --git a/native/jni/init/init.hpp b/native/jni/init/init.hpp index efdfb931d..43df4c518 100644 --- a/native/jni/init/init.hpp +++ b/native/jni/init/init.hpp @@ -21,7 +21,7 @@ struct data_holder { size_t sz = 0; using str_pairs = std::initializer_list>; int patch(str_pairs list); - bool find(std::string_view pattern); + bool contains(std::string_view pattern); protected: void consume(data_holder &other); };