diff --git a/core/src/main/cpp/.clang-tidy b/core/src/main/cpp/.clang-tidy index 91b1c12c..9734c7e7 100644 --- a/core/src/main/cpp/.clang-tidy +++ b/core/src/main/cpp/.clang-tidy @@ -11,6 +11,7 @@ Checks: > clang-analyzer-*, llvm-include-order, -modernize-use-trailing-return-type, + -readability-implicit-bool-conversion, CheckOptions: - key: readability-identifier-naming.ClassCase @@ -55,9 +56,5 @@ CheckOptions: value: lower_case - key: readability-identifier-naming.IgnoreMainLikeFunctions value: 1 - - key: readability-implicit-bool-conversion.AllowIntegerConditions - value: 1 - - key: readability-implicit-bool-conversion.AllowPointerConditions - value: 1 - key: readability-braces-around-statements.ShortStatementLines value: 1 diff --git a/core/src/main/cpp/main/src/symbol_cache.cpp b/core/src/main/cpp/main/src/symbol_cache.cpp index 577bbf20..70c85244 100644 --- a/core/src/main/cpp/main/src/symbol_cache.cpp +++ b/core/src/main/cpp/main/src/symbol_cache.cpp @@ -41,7 +41,7 @@ namespace lspd { void *sym_set_table_override = nullptr; std::unique_ptr art_img = nullptr; - bool findLibArt() { + bool FindLibArt() { art_img = std::make_unique(kLibArtName); if (!art_img->isValid()) return false; auto api_level = GetAndroidApiLevel(); @@ -67,10 +67,13 @@ namespace lspd { void InitSymbolCache() { if (UNLIKELY(sym_initialized)) return; LOGD("InitSymbolCache"); - sym_initialized = findLibArt(); + sym_initialized = + FindLibArt() && (sym_do_dlopen = SandHook::ElfImg("linker").getSymbAddress( + "__dl__Z9do_dlopenPKciPK17android_dlextinfoPKv")); if (UNLIKELY(!sym_initialized)) { + sym_initialized = false; art_img.reset(); LOGE("Init symbol cache failed"); } } -} +} // namespace lspd