Skip to content

Commit

Permalink
添加跨进程打开Activity Flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Haocen2004 committed Jan 19, 2022
1 parent beacb53 commit aecef09
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ 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: 自定义搜索引擎
Intent intent = new Intent();
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);
Expand Down

0 comments on commit aecef09

Please sign in to comment.