bool TryLoadLibdexfile([[maybe_unused]] std::string* err_msg) { #ifdefined(STATIC_LIB) // Nothing to do here since all function pointers are initialised statically. returntrue; #elifdefined(NO_DEXFILE_SUPPORT)
*err_msg = "Dex file support not available."; returnfalse; #else // Use a plain old mutex since we want to try again if loading fails (to set // err_msg, if nothing else). static std::mutex load_mutex; staticbool is_loaded = false;
std::lock_guard<std::mutex> lock(load_mutex);
if (!is_loaded) { // Check which version is already loaded to avoid loading both debug and // release builds. We might also be backtracing from separate process, in // which case neither is loaded. constchar* so_name = "libdexfiled.so"; void* handle = dlopen(so_name, RTLD_NOLOAD | RTLD_NOW | RTLD_NODELETE); if (handle == nullptr) {
so_name = "libdexfile.so";
handle = dlopen(so_name, RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
} if (handle == nullptr) {
*err_msg = dlerror(); returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.