public static String LOGIN = "http://ui.ptlogin2.qq.com/cgi-bin/login?appid=46000101&style=8&lang=&low_login=1&hide_title_bar=1&hide_close_icon=1&daid=6&hln_css=http://mat1.gtimg.com/www/mb/images/logo244x100.png&s_url=http%3A%2F%2Fw.t.qq.com%2Ftouch";
final String tencent_url = LOGIN;
try {
String js = FileUtils.readAssetsFile("oauthfortencent.js", TencentWeiboActivity.this);
js = js.replace("%u%", tAccount).replace("%p%", tPassword);
Document dom = Jsoup.connect(LOGIN).get();
html = dom.toString();
html = html.replace("</head>", js + "</head>")
.replace("action-type=\"submit\"", "action-type=\"submit\" id=\"submit\"");
return html;
} catch (Exception e) {
e.printStackTrace();
}
mWebView.loadDataWithBaseURL("http://open.qq.com/", html, "text/html", "UTF-8", "");
js代码:
function fillAccount(){ document.getElementById("u").value = '%u%'; document.getElementById("p").value = '%p%'; document.getElementById("go").click(); }