mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-28 12:30:12 +02:00
fix: native load
This commit is contained in:
parent
f631989104
commit
9574dba861
@ -675,10 +675,6 @@
|
||||
"disable_bitmoji": {
|
||||
"name": "Disable Bitmoji",
|
||||
"description": "Disables Friends Profile Bitmoji"
|
||||
},
|
||||
"remap_apk": {
|
||||
"name": "Remap APK",
|
||||
"description": "Hides SnapEnhance apk path in /proc/self/maps"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -11,7 +11,6 @@ class Experimental : ConfigContainer() {
|
||||
|
||||
class NativeHooks : ConfigContainer(hasGlobalState = true) {
|
||||
val disableBitmoji = boolean("disable_bitmoji")
|
||||
val remapApk = boolean("remap_apk") { addNotices(FeatureNotice.UNSTABLE) }
|
||||
}
|
||||
|
||||
class E2EEConfig : ConfigContainer(hasGlobalState = true) {
|
||||
|
@ -156,7 +156,6 @@ class ModContext(
|
||||
disableBitmoji = config.experimental.nativeHooks.disableBitmoji.get(),
|
||||
disableMetrics = config.global.disableMetrics.get(),
|
||||
hookAssetOpen = config.experimental.disableComposerModules.get().isNotEmpty(),
|
||||
remapApk = config.experimental.nativeHooks.remapApk.get(),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ typedef struct {
|
||||
bool disable_bitmoji;
|
||||
bool disable_metrics;
|
||||
bool hook_asset_open;
|
||||
bool remap_apk;
|
||||
} native_config_t;
|
||||
|
||||
namespace common {
|
||||
|
@ -16,14 +16,18 @@ void JNICALL init(JNIEnv *env, jobject clazz) {
|
||||
using namespace common;
|
||||
|
||||
native_lib_object = env->NewGlobalRef(clazz);
|
||||
client_module = util::get_module("libclient.so");
|
||||
client_module = util::get_module(("split_config." + std::string(ARM64 ? "arm64_v8a" : "armeabi-v7a") + ".apk").c_str());
|
||||
|
||||
if (client_module.base == 0) {
|
||||
LOGE("libclient not loaded!");
|
||||
return;
|
||||
LOGD("split_config not found, trying libclient.so");
|
||||
client_module = util::get_module("libclient.so");
|
||||
if (client_module.base == 0) {
|
||||
LOGE("can't find libclient.so");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LOGD("libclient.so base=0x%lx, size=0x%zx", client_module.base, client_module.size);
|
||||
LOGD("client_module offset=0x%lx, size=0x%zx", client_module.base, client_module.size);
|
||||
|
||||
AssetHook::init(env);
|
||||
UnaryCallHook::init(env);
|
||||
@ -31,9 +35,7 @@ void JNICALL init(JNIEnv *env, jobject clazz) {
|
||||
SqliteMutexHook::init();
|
||||
DuplexHook::init(env);
|
||||
|
||||
if (native_config->remap_apk) {
|
||||
util::remap_sections(BUILD_PACKAGE);
|
||||
}
|
||||
util::remap_sections(BUILD_PACKAGE);
|
||||
|
||||
LOGD("Native initialized");
|
||||
}
|
||||
@ -46,7 +48,6 @@ void JNICALL load_config(JNIEnv *env, jobject _, jobject config_object) {
|
||||
native_config->disable_bitmoji = GET_CONFIG_BOOL("disableBitmoji");
|
||||
native_config->disable_metrics = GET_CONFIG_BOOL("disableMetrics");
|
||||
native_config->hook_asset_open = GET_CONFIG_BOOL("hookAssetOpen");
|
||||
native_config->remap_apk = GET_CONFIG_BOOL("remapApk");
|
||||
}
|
||||
|
||||
void JNICALL lock_database(JNIEnv *env, jobject _, jstring database_name, jobject runnable) {
|
||||
|
@ -4,5 +4,4 @@ data class NativeConfig(
|
||||
val disableBitmoji: Boolean = false,
|
||||
val disableMetrics: Boolean = false,
|
||||
val hookAssetOpen: Boolean = false,
|
||||
val remapApk: Boolean = false,
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user