mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 01:35:17 +08:00
Modify add an error warning for injectModuleAppResources and registerModuleAppActivities functions in AppParasitics
This commit is contained in:
@@ -275,6 +275,8 @@ internal object AppParasitics {
|
||||
*/
|
||||
internal fun injectModuleAppResources(hostResources: Resources) {
|
||||
if (YukiHookBridge.hasXposedBridge) runCatching {
|
||||
if (YukiHookAppHelper.currentPackageName() == YukiHookBridge.modulePackageName)
|
||||
return yLoggerE(msg = "You cannot inject module resources into yourself")
|
||||
hostResources.assets.current(ignored = true).method { name = "addAssetPath"; param(StringClass) }.call(moduleAppFilePath)
|
||||
}.onFailure {
|
||||
yLoggerE(msg = "Failed to inject module resources into [$hostResources]", e = it)
|
||||
@@ -294,6 +296,7 @@ internal object AppParasitics {
|
||||
internal fun registerModuleAppActivities(context: Context, proxy: Any?) {
|
||||
if (isActivityProxyRegistered) return
|
||||
if (YukiHookBridge.hasXposedBridge.not()) return yLoggerW(msg = "You can only register Activity Proxy in Xposed Environment")
|
||||
if (context.packageName == YukiHookBridge.modulePackageName) return yLoggerE(msg = "You cannot register Activity Proxy into yourself")
|
||||
runCatching {
|
||||
ActivityProxyConfig.apply {
|
||||
proxyIntentName = "${YukiHookBridge.modulePackageName}.ACTIVITY_PROXY_INTENT"
|
||||
|
Reference in New Issue
Block a user