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);