From 11e25d9d84aabe15d10e935233f7cb3dc9fb5d81 Mon Sep 17 00:00:00 2001 From: solohsu Date: Sat, 15 Jun 2019 00:44:11 +0800 Subject: [PATCH] Fix nullptr crash --- edxp-core/build.gradle | 2 +- .../main/cpp/main/include/art/runtime/mirror/class.h | 10 +--------- edxp-core/src/main/cpp/main/src/native_hook.cpp | 2 +- edxp-core/template_override/common/util_functions.sh | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/edxp-core/build.gradle b/edxp-core/build.gradle index 40a56c64..bcdb23c5 100644 --- a/edxp-core/build.gradle +++ b/edxp-core/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'com.android.library' version "v0.4.4.4_alpha" ext { - versionCode = "4440" + versionCode = "4441" module_name = "EdXposed" jar_dest_dir = "${projectDir}/template_override/system/framework/" is_windows = OperatingSystem.current().isWindows() diff --git a/edxp-core/src/main/cpp/main/include/art/runtime/mirror/class.h b/edxp-core/src/main/cpp/main/include/art/runtime/mirror/class.h index 5fcf72f3..38d6122c 100644 --- a/edxp-core/src/main/cpp/main/include/art/runtime/mirror/class.h +++ b/edxp-core/src/main/cpp/main/include/art/runtime/mirror/class.h @@ -19,14 +19,6 @@ namespace art { return GetDescriptorSym(thiz, storage); } - - CREATE_ORIGINAL_ENTRY(bool, IsInSamePackage, void *thiz, void *that) { - if (IsInSamePackageBackup) { - return IsInSamePackageBackup(thiz, that); - } - return false; - } - CREATE_HOOK_STUB_ENTRIES(bool, IsInSamePackage, void *thiz, void *that) { std::string storage1, storage2; const char *thisDesc = GetDescriptor(thiz, &storage1); @@ -45,7 +37,7 @@ namespace art { || strstr(thatDesc, "android/content/res/XResources$XTypedArray") != nullptr) { return true; } - return IsInSamePackage(thiz, that); + return IsInSamePackageBackup(thiz, that); } public: diff --git a/edxp-core/src/main/cpp/main/src/native_hook.cpp b/edxp-core/src/main/cpp/main/src/native_hook.cpp index 56a0eede..0584a8c7 100644 --- a/edxp-core/src/main/cpp/main/src/native_hook.cpp +++ b/edxp-core/src/main/cpp/main/src/native_hook.cpp @@ -32,7 +32,7 @@ namespace edxp { CREATE_HOOK_STUB_ENTRIES(void *, mydlopen, const char *file_name, int flags, const void *caller) { void *handle = mydlopenBackup(file_name, flags, caller); - if (std::string(file_name).find(kLibArtName) != std::string::npos) { + if (file_name != nullptr && std::string(file_name).find(kLibArtName) != std::string::npos) { InstallArtHooks(handle); } return handle; diff --git a/edxp-core/template_override/common/util_functions.sh b/edxp-core/template_override/common/util_functions.sh index c7328d3b..99ef6b28 100644 --- a/edxp-core/template_override/common/util_functions.sh +++ b/edxp-core/template_override/common/util_functions.sh @@ -1,6 +1,6 @@ #!/system/bin/sh -EDXP_VERSION="0.4.4.4_alpha (4440)" +EDXP_VERSION="0.4.4.4_alpha (4441)" ANDROID_SDK=`getprop ro.build.version.sdk` BUILD_DESC=`getprop ro.build.description` PRODUCT=`getprop ro.build.product`