存档

文章标签 ‘谷歌’

安卓app在提交apk至谷歌google审核的时候被拒绝,提示7071387错误,且WebViewClient.onReceivedSslError错误的话(ssl错误)

2018年1月8日 没有评论

如果我们在提交apk到谷歌google审核的时候,被拒绝,且提示:

This app uses software that contains security vulnerabilities for users or allows the collection of user data without proper disclosure.

你点击邮件的链接,如果是:https://support.google.com/faqs/answer/7071387?hl=zh-Hans

那么恭喜,应该就是:如何处理应用中的 WebView SSL 错误处理程序提醒

那么如何解决这个问题呢,只要重新webview的onReceivedSslError方法即可:例如:

@Override
public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) {
    sslErrorHandler.cancel();
    //super.onReceivedSslError(webView, sslErrorHandler, sslError);
}
或者:
@Override
public void onReceivedSslError(WebView view, android.webkit.SslErrorHandler handler, android.net.http.SslError error) {
   handler.cancel();
   //super.onReceivedSslError(view, handler, error);
}
总之,这个提示是 Webview使用onReceivedSslError方法,apk被Google play rejected 
参考文献:
http://blog.csdn.net/kingoneyun/article/details/54581764
http://bbs.umeng.com/thread-15250-1-1.html
http://www.it1352.com/191247.html
http://blog.csdn.net/u013107656/article/details/51728576
https://stackoverflow.com/questions/36050741/webview-avoid-security-alert-from-google-play-upon-implementation-of-onreceiveds
https://www.zhihu.com/question/47660719/answer/134709164
https://github.com/Azure/azure-mobile-engagement-unity/issues/9

模拟百度、谷歌、搜搜搜搜提示框效果

2015年3月14日 没有评论

仿照百度等搜搜引擎做的下拉提示效果,原创,兼容,支持上下键盘
// JavaScript Document

var lastsearch_wd
var first_wd_li=0;

if(!window.event){
(function (bool) {
//兼容FF获取键盘监控值方法
if (bool) {
window.__defineGetter__(“event”, function () {
//兼容Event对象
var o = arguments.callee;
do {
if (o.arguments[0] instanceof Event) return o.arguments[0];
} while (o = o.caller);
return null;
});

}

})(/Firefox/.test(window.navigator.userAgent));
}

function search_do(){
$id(“wd”).value=$id(“wd”).value.replace(/(^\s*)/g,””);//去掉左空格
if($id(“wd”).value.replace(/(\s*$)/g,””)==lastsearch_wd) return false//去右空格做比较
if($id(“wd”).value!=” && $id(“wd”).value!=’ ‘){
$id(“ajax_search_result”).style.display=”block”
$id(“ajax_search_result_ul”).innerHTML=””
lastsearch_wd=$id(“wd”).value
ajax(“ajax_search_result_ul”,”/inc/ajax.php?act=search_wd”,$id(“wd”).value,”<li>正在搜索…</li>”)
first_wd_li=0
}

}

var writing_timer

function skeydown(){clearTimeout(writing_timer)}//当输入时,自动取消搜索

function skeyup(){//不输入0.3秒之后再ajax搜索
writing_timer=setTimeout(“search_do()”,300)
if($id(“wd”).value==”) {
lastsearch_wd=”
clearTimeout(writing_timer)
hides(event)
}
}

var serach_url=new Array(“/do/search.html”,”/shop/shop.html”,”/shop/product.html”,”/togo/togo.html”,”/info/info.html”,”/shequ/”,”/bmfw/list.html”,”/help/list.html”);

function button_wd(){
if($id(“wd”).value!=” && $id(“wd”).value!=’对不起,请输入搜索关键词’) {
window.location.href=”http://www.s2c.cn/do/search.html?wd=”+encodeURI($id(“wd”).value)
}
else {
$id(“wd”).value=”对不起,请输入搜索关键词”
$id(“wd”).style.color=”blue”
$id(“wd”).focus()
}
}

function start_search(ac){
hides(event);window.location.href=”http://www.s2c.cn”+serach_url[first_wd_li]+’?wd=’+encodeURI($id(“wd”).value)
}

function shownext_downkey(){
if(lastsearch_wd==$id(“wd”).value){
var e = window.event;
if(e) {
if(e.keyCode==13) start_search()
if(e.keyCode==27) hides(event);
}
else {
if(e.which==13) start_search()
if(e.which==27) hides(event);
}
if($id(“ajax_search_result”).style.display==”block”){
for(i=1;i<=7;i++){
$id(“wd_onli”+i).style.background=”none”
}
}
if(e){
if(e.keyCode==40) first_wd_li++
if(e.keyCode==38) first_wd_li–
}
else{
if(e.which==40) first_wd_li++
if(e.which==38) first_wd_li–
}
if(first_wd_li==8) first_wd_li=1
if(first_wd_li==0) first_wd_li=7
if($id(“ajax_search_result”).style.display==”block”) $id(“wd_onli”+first_wd_li).style.background=”#b5c9e1”
}
}

function outsearchvalue(n){
$id(“wd_onli”+n).style.background=”none”
first_wd_li=0
}

function movesearchvalue(n){
for(i=1;i<=7;i++){
$id(“wd_onli”+i).style.background=”none”
}
first_wd_li=n
$id(“wd_onli”+first_wd_li).style.background=”#b5c9e1″
}

function hides(event){
event= event || window.event;
srcobj=event.target || event.srcElement;
if(srcobj.tagName!=”INPUT” || srcobj.tagName!=”LI”) {
$id(“ajax_search_result_ul”).innerHTML=”
$id(“ajax_search_result”).style.display=”none”
}
}
document.onclick=hides

css.php