EasyClick 指定浏览器打开网页

2023-07-07 14:52:49 浏览数 (1)

1111

代码语言:javascript复制
var url = "www.baidu.com";
var Activity = {
    "chrome": "com.android.chrome/com.google.android.apps.chrome.IntentDispatcher",
    "360": "com.qihoo.browser/.BrowserActivity",
    "QQ": "com.tencent.mtt.x86/.MainActivity",
    "海豚": "com.dolphin.browser.xf/mobi.mgeek.TunnyBrowser.MainActivity",
    "欧朋": "com.oupeng.browser/com.opera.android.OperaMainActivity",
    "傲游": "com.mx.browser/.MxBrowserActivity",
    "UC": "com.UCMobile/com.uc.browser.InnerUCMobile"
};
var openurl = shell.execCommand("am start -n "   Activity["chrome"]   " -d "   url);
logd(openurl);

shell.execCommand 执行Shell命令

  • 执行Shell命令,会自动区分代理还是root
  • @param command 命令,例如安装App : pm install /sdcard/app.apk
  • @return 命令执行后返回的字符串结果

代码语言:javascript复制
function main(){
    var result = shell.execCommand("pm install /sdcard/app.apk");
}
main();

0 人点赞