Skip to content

Commit 7ea869e

Browse files
imlk0solohsu
authored andcommitted
fix: replace whale so file to fix crash on x86_64
fix: hook art::OatFileManager::SetOnlyUseSystemOatFiles on AndroidQ
1 parent c677b62 commit 7ea869e

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

Diff for: .gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,12 @@
1212
/release
1313
.externalNativeBuild
1414
elf-cleaner.sh
15+
16+
# vscode
17+
.project
18+
.classpath
19+
.settings/
20+
.vscode/
21+
22+
dalvikdx/bin/
23+
dexmaker/bin/
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
#pragma once
3+
4+
#include "base/object.h"
5+
6+
namespace art {
7+
8+
namespace oat_file_manager {
9+
10+
CREATE_HOOK_STUB_ENTRIES(void, SetOnlyUseSystemOatFiles) {
11+
return;
12+
}
13+
14+
// http://androidxref.com/9.0.0_r3/xref/art/runtime/oat_file_manager.cc#637
15+
static void DisableOnlyUseSystemOatFiles(void *handle, HookFunType hook_func) {
16+
const int api_level = GetAndroidApiLevel();
17+
if (api_level == ANDROID_P) {
18+
HOOK_FUNC(SetOnlyUseSystemOatFiles,
19+
"_ZN3art14OatFileManager24SetOnlyUseSystemOatFilesEv");
20+
21+
}
22+
};
23+
24+
}
25+
26+
}

Diff for: edxp-core/src/main/cpp/main/src/native_hook.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "art/runtime/class_linker.h"
1717
#include "art/runtime/gc/heap.h"
1818
#include "art/runtime/hidden_api.h"
19+
#include "art/runtime/oat_file_manager.h"
1920
#include "framework/fd_utils.h"
2021

2122
namespace edxp {
@@ -88,6 +89,8 @@ namespace edxp {
8889
art::ClassLinker::Setup(art_handle, hook_func);
8990
art::mirror::Class::Setup(art_handle, hook_func);
9091
art::JNIEnvExt::Setup(art_handle, hook_func);
92+
art::oat_file_manager::DisableOnlyUseSystemOatFiles(art_handle, hook_func);
93+
9194
art_hooks_installed = true;
9295
LOGI("ART hooks installed");
9396
}

Diff for: hiddenapi-stubs/libs/framework-stub.jar

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)