Skip to content

Commit

Permalink
Remove useless hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveSy committed Nov 23, 2020
1 parent 2c314ab commit 9f3d4b5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 60 deletions.
7 changes: 0 additions & 7 deletions edxp-core/src/main/cpp/main/include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace edxp {
static const auto kSandHookNeverCallClassName = "com.swift.sandhook.ClassNeverCall"_str;

static const auto kLibArtName = "libart.so"_str;
static const auto kLibFwkName = "libandroid_runtime.so"_str;
static const auto kLibFwName = "libandroidfw.so"_str;
static const auto kLibWhaleName = "libwhale.edxp.so"_str;
static const auto kLibSandHookName = "libsandhook.edxp.so"_str;
Expand All @@ -39,16 +38,10 @@ namespace edxp {
static const auto kLibBasePath = std::string(
LP_SELECT("/system/lib/",
"/system/lib64/"));
static const auto kLinkerPath = std::string(
LP_SELECT("/apex/com.android.runtime/bin/linker",
"/apex/com.android.runtime/bin/linker64"));

static const auto kLibDlPath = kLibBasePath + kLibDlName;
static const auto kLibArtLegacyPath = kLibBasePath + kLibArtName;
static const auto kLibSandHookPath = kLibBasePath + kLibSandHookName;
static const auto kLibSandHookNativePath = kLibBasePath + kLibSandHookNativeName;
static const auto kLibFwPath = kLibBasePath + kLibFwName;
static const auto kLibFwkPath = kLibBasePath + kLibFwkName;

inline constexpr const char *const BoolToString(bool b) {
return b ? "true" : "false";
Expand Down
38 changes: 0 additions & 38 deletions edxp-core/src/main/cpp/main/include/framework/fd_utils.h

This file was deleted.

15 changes: 0 additions & 15 deletions edxp-core/src/main/cpp/main/src/native_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@
#include "art/runtime/gc/heap.h"
#include "art/runtime/hidden_api.h"
#include "art/runtime/oat_file_manager.h"
#include "framework/fd_utils.h"

std::vector<soinfo_t> linker_get_solist(); // Dobby but not in .h

namespace edxp {

static volatile bool installed = false;
static volatile bool art_hooks_installed = false;
static volatile bool fwk_hooks_installed = false;
static HookFunType hook_func = nullptr;

void InstallArtHooks(void *art_handle);

void InstallFwkHooks(void *fwk_handle);

void InstallInlineHooks() {
if (installed) {
LOGI("Inline hooks have been installed, skip");
Expand Down Expand Up @@ -72,9 +68,6 @@ namespace edxp {
ScopedDlHandle art_handle(kLibArtLegacyPath.c_str());
InstallArtHooks(art_handle.Get());
}

ScopedDlHandle fwk_handle(kLibFwkPath.c_str());
InstallFwkHooks(fwk_handle.Get());
}

void InstallArtHooks(void *art_handle) {
Expand All @@ -94,13 +87,5 @@ namespace edxp {
art_hooks_installed = true;
LOGI("ART hooks installed");
}

void InstallFwkHooks(void *fwk_handle) {
if (fwk_hooks_installed) {
return;
}
android::FileDescriptorWhitelist::Setup(fwk_handle, hook_func);
}

}

0 comments on commit 9f3d4b5

Please sign in to comment.