mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-12 13:17:42 +02:00
fix(native): load config before init
- add native remap apk
This commit is contained in:
@ -147,11 +147,16 @@ class ModContext(
|
||||
_config.loadFromCallback { file ->
|
||||
file.loadFromBridge(bridgeClient)
|
||||
}
|
||||
reloadNativeConfig()
|
||||
}
|
||||
|
||||
fun reloadNativeConfig() {
|
||||
native.loadNativeConfig(
|
||||
NativeConfig(
|
||||
disableBitmoji = config.experimental.nativeHooks.disableBitmoji.get(),
|
||||
disableMetrics = config.global.disableMetrics.get(),
|
||||
hookAssetOpen = config.experimental.disableComposerModules.get().isNotEmpty()
|
||||
hookAssetOpen = config.experimental.disableComposerModules.get().isNotEmpty(),
|
||||
remapApk = config.experimental.nativeHooks.remapApk.get(),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -190,12 +190,14 @@ class SnapEnhance {
|
||||
val libName = param.arg<String>(1)
|
||||
if (libName != "client") return@hook
|
||||
unhook()
|
||||
appContext.native.initOnce()
|
||||
appContext.native.nativeUnaryCallCallback = { request ->
|
||||
appContext.event.post(NativeUnaryCallEvent(request.uri, request.buffer)) {
|
||||
request.buffer = buffer
|
||||
request.canceled = canceled
|
||||
appContext.native.initOnce {
|
||||
nativeUnaryCallCallback = { request ->
|
||||
appContext.event.post(NativeUnaryCallEvent(request.uri, request.buffer)) {
|
||||
request.buffer = buffer
|
||||
request.canceled = canceled
|
||||
}
|
||||
}
|
||||
appContext.reloadNativeConfig()
|
||||
}
|
||||
}.also { unhook = { it.unhook() } }
|
||||
}
|
||||
|
Reference in New Issue
Block a user