diff --git a/.gitignore b/.gitignore index 8ed3597eb..fc2fb6f5a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,12 @@ /release .externalNativeBuild elf-cleaner.sh + +# vscode +.project +.classpath +.settings/ +.vscode/ + +dalvikdx/bin/ +dexmaker/bin/ \ No newline at end of file diff --git a/edxp-common/template_override/system_x86/lib64/libwhale.edxp.so b/edxp-common/template_override/system_x86/lib64/libwhale.edxp.so index 0f7c1eda1..35d9cf8af 100755 Binary files a/edxp-common/template_override/system_x86/lib64/libwhale.edxp.so and b/edxp-common/template_override/system_x86/lib64/libwhale.edxp.so differ diff --git a/edxp-core/src/main/cpp/main/include/art/runtime/oat_file_manager.h b/edxp-core/src/main/cpp/main/include/art/runtime/oat_file_manager.h new file mode 100644 index 000000000..2f10b5b0c --- /dev/null +++ b/edxp-core/src/main/cpp/main/include/art/runtime/oat_file_manager.h @@ -0,0 +1,26 @@ + +#pragma once + +#include "base/object.h" + +namespace art { + + namespace oat_file_manager { + + CREATE_HOOK_STUB_ENTRIES(void, SetOnlyUseSystemOatFiles) { + return; + } + + // http://androidxref.com/9.0.0_r3/xref/art/runtime/oat_file_manager.cc#637 + static void DisableOnlyUseSystemOatFiles(void *handle, HookFunType hook_func) { + const int api_level = GetAndroidApiLevel(); + if (api_level == ANDROID_P) { + HOOK_FUNC(SetOnlyUseSystemOatFiles, + "_ZN3art14OatFileManager24SetOnlyUseSystemOatFilesEv"); + + } + }; + + } + +} 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 0584a8c72..fe3ea4c71 100644 --- a/edxp-core/src/main/cpp/main/src/native_hook.cpp +++ b/edxp-core/src/main/cpp/main/src/native_hook.cpp @@ -16,6 +16,7 @@ #include "art/runtime/class_linker.h" #include "art/runtime/gc/heap.h" #include "art/runtime/hidden_api.h" +#include "art/runtime/oat_file_manager.h" #include "framework/fd_utils.h" namespace edxp { @@ -88,6 +89,8 @@ namespace edxp { art::ClassLinker::Setup(art_handle, hook_func); art::mirror::Class::Setup(art_handle, hook_func); art::JNIEnvExt::Setup(art_handle, hook_func); + art::oat_file_manager::DisableOnlyUseSystemOatFiles(art_handle, hook_func); + art_hooks_installed = true; LOGI("ART hooks installed"); } diff --git a/hiddenapi-stubs/libs/framework-stub.jar b/hiddenapi-stubs/libs/framework-stub.jar index 55e65898a..8d60307d2 100644 Binary files a/hiddenapi-stubs/libs/framework-stub.jar and b/hiddenapi-stubs/libs/framework-stub.jar differ