Don't use sandhook on x86 devices
This commit is contained in:
parent
b1bc7200a6
commit
782560ad96
|
|
@ -32,6 +32,7 @@ namespace edxp {
|
||||||
static constexpr auto kLibFwName = "libandroidfw.so";
|
static constexpr auto kLibFwName = "libandroidfw.so";
|
||||||
static constexpr auto kLibWhaleName = "libwhale.edxp.so";
|
static constexpr auto kLibWhaleName = "libwhale.edxp.so";
|
||||||
static constexpr auto kLibSandHookName = "libsandhook.edxp.so";
|
static constexpr auto kLibSandHookName = "libsandhook.edxp.so";
|
||||||
|
static constexpr auto kLibDlName = "libdl.so";
|
||||||
static constexpr auto kLibSandHookNativeName = "libsandhook-native.so";
|
static constexpr auto kLibSandHookNativeName = "libsandhook-native.so";
|
||||||
|
|
||||||
static const auto kLibBasePath = std::string(
|
static const auto kLibBasePath = std::string(
|
||||||
|
|
@ -41,6 +42,7 @@ namespace edxp {
|
||||||
LP_SELECT("/apex/com.android.runtime/bin/linker",
|
LP_SELECT("/apex/com.android.runtime/bin/linker",
|
||||||
"/apex/com.android.runtime/bin/linker64"));
|
"/apex/com.android.runtime/bin/linker64"));
|
||||||
|
|
||||||
|
static const auto kLibDlPath = kLibBasePath + kLibDlName;
|
||||||
static const auto kLibArtLegacyPath = kLibBasePath + kLibArtName;
|
static const auto kLibArtLegacyPath = kLibBasePath + kLibArtName;
|
||||||
static const auto kLibWhalePath = kLibBasePath + kLibWhaleName;
|
static const auto kLibWhalePath = kLibBasePath + kLibWhaleName;
|
||||||
static const auto kLibSandHookPath = kLibBasePath + kLibSandHookName;
|
static const auto kLibSandHookPath = kLibBasePath + kLibSandHookName;
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,13 @@ namespace edxp {
|
||||||
hook_func = reinterpret_cast<HookFunType>(hook_func_symbol);
|
hook_func = reinterpret_cast<HookFunType>(hook_func_symbol);
|
||||||
|
|
||||||
if (api_level >= __ANDROID_API_Q__) {
|
if (api_level >= __ANDROID_API_Q__) {
|
||||||
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
|
ScopedDlHandle dl_handle(kLibDlPath.c_str());
|
||||||
|
void *handle = dl_handle.Get();
|
||||||
|
HOOK_FUNC(mydlopen, "__loader_dlopen");
|
||||||
|
#else
|
||||||
InstallLinkerHooks(kLinkerPath.c_str());
|
InstallLinkerHooks(kLinkerPath.c_str());
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ScopedDlHandle art_handle(kLibArtLegacyPath.c_str());
|
ScopedDlHandle art_handle(kLibArtLegacyPath.c_str());
|
||||||
InstallArtHooks(art_handle.Get());
|
InstallArtHooks(art_handle.Get());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue