mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-04 09:45:19 +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) {
|
internal fun injectModuleAppResources(hostResources: Resources) {
|
||||||
if (YukiHookBridge.hasXposedBridge) runCatching {
|
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)
|
hostResources.assets.current(ignored = true).method { name = "addAssetPath"; param(StringClass) }.call(moduleAppFilePath)
|
||||||
}.onFailure {
|
}.onFailure {
|
||||||
yLoggerE(msg = "Failed to inject module resources into [$hostResources]", e = it)
|
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?) {
|
internal fun registerModuleAppActivities(context: Context, proxy: Any?) {
|
||||||
if (isActivityProxyRegistered) return
|
if (isActivityProxyRegistered) return
|
||||||
if (YukiHookBridge.hasXposedBridge.not()) return yLoggerW(msg = "You can only register Activity Proxy in Xposed Environment")
|
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 {
|
runCatching {
|
||||||
ActivityProxyConfig.apply {
|
ActivityProxyConfig.apply {
|
||||||
proxyIntentName = "${YukiHookBridge.modulePackageName}.ACTIVITY_PROXY_INTENT"
|
proxyIntentName = "${YukiHookBridge.modulePackageName}.ACTIVITY_PROXY_INTENT"
|
||||||
|
Reference in New Issue
Block a user