Switch hooking method to Dobby

- Android 14 QPR2 (currently in Beta and due for Stable in March) breaks ShadowHook libc hooking needed for property spoofing
- there are currently no signs of life over at ShadowHook to resolve this despite my reporting it to them over a month ago

Co-authored-by: Nicholas Bissell <thefreeman193@hotmail.com>
Co-authored-by: chiteroman <98092901+chiteroman@users.noreply.github.com>
This commit is contained in:
osm0sis
2024-01-15 23:05:18 -04:00
parent 802c0a7617
commit 475185c3ee
11 changed files with 46 additions and 66 deletions
+7 -8
View File
@@ -3,7 +3,7 @@
#include <unistd.h>
#include "zygisk.hpp"
#include "shadowhook.h"
#include "dobby.h"
#include "json.hpp"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "PIF/Native", __VA_ARGS__)
@@ -67,18 +67,17 @@ static void my_system_property_read_callback(const prop_info *pi, T_Callback cal
}
static void doHook() {
shadowhook_init(SHADOWHOOK_MODE_UNIQUE, false);
void *handle = shadowhook_hook_sym_name(
"libc.so",
"__system_property_read_callback",
reinterpret_cast<void *>(my_system_property_read_callback),
reinterpret_cast<void **>(&o_system_property_read_callback)
);
void *handle = DobbySymbolResolver(nullptr, "__system_property_read_callback");
if (handle == nullptr) {
LOGD("Couldn't find '__system_property_read_callback' handle");
return;
}
LOGD("Found '__system_property_read_callback' handle at %p", handle);
DobbyHook(
handle,
reinterpret_cast<dobby_dummy_func_t>(my_system_property_read_callback),
reinterpret_cast<dobby_dummy_func_t *>(&o_system_property_read_callback)
);
}
class PlayIntegrityFix : public zygisk::ModuleBase {