Revert faulty code

This commit is contained in:
kotori0 2020-12-10 19:36:19 +08:00
parent 314315180f
commit d49757b5ad
5 changed files with 8 additions and 1 deletions

View File

@ -120,8 +120,10 @@ namespace art {
HOOK_FUNC(FixupStaticTrampolines,
"_ZN3art11ClassLinker22FixupStaticTrampolinesENS_6ObjPtrINS_6mirror5ClassEEE");
// Sandhook will hook ShouldUseInterpreterEntrypoint, so we just skip
// edxp::Context::GetInstance()->GetVariant() will not work here, so we use smh dirty hack
if (api_level >= __ANDROID_API_R__ &&
edxp::Context::GetInstance()->GetVariant() != edxp::Variant::SANDHOOK) {
access(edxp::kLibSandHookNativePath.c_str(), F_OK) == -1) {
LOGD("Not sandhook, installing _ZN3art11ClassLinker30ShouldUseInterpreterEntrypointEPNS_9ArtMethodEPKv");
HOOK_FUNC(ShouldUseInterpreterEntrypoint,
"_ZN3art11ClassLinker30ShouldUseInterpreterEntrypointEPNS_9ArtMethodEPKv");

View File

@ -37,12 +37,15 @@ inline constexpr bool is64 = Is64();
static const auto kLibArtName = "libart.so"s;
static const auto kLibFwName = "libandroidfw.so"s;
static const auto kLibSandHookName = "libsandhook.edxp.so"s;
static const auto kLibDlName = "libdl.so"s;
static const auto kLibSandHookNativeName = "libsandhook-native.so"s;
static const auto kLibBasePath =
LP_SELECT("/system/lib/"s,
"/system/lib64/"s);
static const auto kLibArtLegacyPath = kLibBasePath + kLibArtName;
static const auto kLibSandHookPath = kLibBasePath + kLibSandHookName;
static const auto kLibSandHookNativePath = kLibBasePath + kLibSandHookNativeName;
static const auto kLibFwPath = kLibBasePath + kLibFwName;
inline constexpr const char *const BoolToString(bool b) {

View File

@ -246,6 +246,7 @@ else
ui_print "- Extracting arm libraries"
extract "$ZIPFILE" 'system/lib/libriru_edxp.so' "$MODPATH"
if [[ "${VARIANTS}" == "SandHook" ]]; then
extract "$ZIPFILE" 'system/lib/libsandhook-native.so' "$MODPATH"
extract "$ZIPFILE" 'system/lib/libsandhook.edxp.so' "$MODPATH"
fi
@ -253,6 +254,7 @@ else
ui_print "- Extracting arm64 libraries"
extract "$ZIPFILE" 'system/lib64/libriru_edxp.so' "$MODPATH"
if [[ "${VARIANTS}" == "SandHook" ]]; then
extract "$ZIPFILE" 'system/lib64/libsandhook-native.so' "$MODPATH"
extract "$ZIPFILE" 'system/lib64/libsandhook.edxp.so' "$MODPATH"
fi
fi