From aecef098593c72fb87cee16b0de6a6bc2e3300c7 Mon Sep 17 00:00:00 2001 From: Haocen2004 Date: Wed, 19 Jan 2022 13:14:32 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B7=A8=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E6=89=93=E5=BC=80Activity=20Flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/xyz/hellocraft/portalhook/hook/PortalHook.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/xyz/hellocraft/portalhook/hook/PortalHook.java b/app/src/main/java/xyz/hellocraft/portalhook/hook/PortalHook.java index 1dba143..152bb08 100644 --- a/app/src/main/java/xyz/hellocraft/portalhook/hook/PortalHook.java +++ b/app/src/main/java/xyz/hellocraft/portalhook/hook/PortalHook.java @@ -31,7 +31,7 @@ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { XposedHelpers.findAndHookMethod(clazz, "openGlobalSearch", Context.class, String.class, String.class, new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { - XposedBridge.log("Hook到全局搜索打开,关键词:"+param.args[1].toString()+"来源:"+param.args[2].toString()); + XposedBridge.log("Hook到全局搜索打开,关键词:"+param.args[1].toString()+",来源:"+param.args[2].toString()); try { String targetUrl = "https://www.baidu.com/s?word=" + param.args[1].toString(); // TODO: 自定义搜索引擎 @@ -39,6 +39,7 @@ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { intent.setAction("android.intent.action.VIEW"); Uri uri = Uri.parse(targetUrl); intent.setData(uri); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ((Context) param.args[0]).startActivity(intent); } catch (Exception e) { XposedBridge.log(e);