<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="keywords" content="LIMITLESS POSTER,LIMITLESS POSTER">
    <meta name="description" content="LIMITLESS POSTER">
    <meta name="author" content="Brandon">
    <link rel="icon" href="https://blog.liubo.xyz/res/img/favicon.ico">
    <link rel="apple-touch-icon-precomposed" href="https://blog.liubo.xyz/res/img/apple-touch-icon-precomposed.png">
    <div id="wx_pic" style="margin:0 auto;display:none;">
      <img src="https://blog.liubo.xyz/res/img/apple-touch-icon-precomposed.png"/>
    </div>

    <title>LIMITLESS POSTER</title>

    <!-- Bootstrap core CSS -->
    <link href="https://blog.liubo.xyz/res/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="https://blog.liubo.xyz/res/css/blog_font.css" rel="stylesheet">
    <link href="https://blog.liubo.xyz/res/css/blog.css" rel="stylesheet">
    <link href="https://blog.liubo.xyz/res/css/prettify/desert.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="https://blog.liubo.xyz/res/js/prettify/prettify.js"></script>
    
  </head>

  <body onload="PR.prettyPrint()">

    <div class="container">
      <header class="blog-header py-3">
        <div class="row flex-nowrap justify-content-between align-items-center">
          <div class="col-12 text-center">
            <a class="blog-header-logo text-dark" href="https://blog.liubo.xyz">LIMITLESS POSTER</a>
          </div>
        </div>
      </header>

      <div class="nav-scroller py-1 mb-2">
        <nav class="nav d-flex justify-content-start">
          <a class="p-2 text-muted" href="https://www.liubo.xyz">主页</a>
          <a class="p-2 text-muted" href="https://blog.liubo.xyz">博客</a>
        </nav>
      </div>

<!--       <div class="jumbotron p-3 p-md-5 text-white rounded bg-dark">
        <div class="col-md-6 px-0">
          <h1 class="display-4 font-italic">私人属性，乱写乱画乱记录。</h1>
        </div>
      </div> -->
    </div>

    <main role="main" class="container">
      <div class="row">
        <div class="col-md-12 blog-main">
          <div class="blog-post"><h2 class="blog-post-title"><a href="https://blog.liubo.xyz/2019/12/30/wechat-login.html">应用无法拉起微信登录的异常排除</a></h2><p class="blog-post-meta">2019年12月30日 by <a href="https://blog.liubo.xyz">Brandon</a></p><p>最近在华为android 10机型上碰到拉不起微信登录的问题。根据官方常见问题，对以为下几项进行一一排除：</p>

<p>调用wxapi.sendReq接口，返回true，但微信客户端并未启动，请检查以下几项：</p>

<p>1）微信是否安装</p>

<p>2）调用时的Apk包名和签名是否与开放平台填写的一致，签名请使用该工具：点击下载，常发生在安装了debug版本又安装release版本情况，确定包名签名后卸载微信重装或者清除微信数据再做测试</p>

<p>3）检查发送时的缩略图大小是否超过32k</p>

<p>4）能够调起微信到选择好友列表，但是点击发送后无响应，请检查proguard配置是否对微信SDK代码进行了混淆，建议不要对SDK对混淆，参考以下proguard配置：</p>

<pre class="prettyprint">
-keep class com.tencent.mm.opensdk.** {

*;

}

-keep class com.tencent.wxop.** {

*;

}

-keep class com.tencent.mm.sdk.** {

*;

}
</pre>

<p>检查发现，有装微信，不涉及缩略图，没有混淆。</p>

<p>那明显只有第2点符合了。</p>

<p>包名与签名是一致的，因为其它手机可以正常登录。</p>

<p>尝试清除微信数据，无效。</p>

<p>删除微信重装，竟然好了。</p>

<p>到这原以为是微信的锅，但是忽然看到重新安装微信后，系统会提示是否将微信加入华为手机支付保护中心。</p>

<p>因为之前是加入的（加入后右下角会有个角标），于是点加入后再尝试登录，发现又无法登录了，收不到微信回调，关掉后会恢复正常……</p>

<p><strong>结论：华为手机支付保护中心有可能会拦截应用调起微信登录（请求或回调？），导致无法成功登录。</strong></p>

<p>至于拦截的规则，那就不得而知了，只有某些应用会被拦截。</p>
</div>
          <nav class="blog-pagination">
            <a class="btn btn-outline-primary" href="https://blog.liubo.xyz/2018/12/17/find-apk-target-sdk-version.html">上一篇</a>
            <a class="btn btn-outline-secondary disabled" href="#">下一篇</a>
          </nav>
        </div>

        <aside class="col-md-4 blog-sidebar">
          <div class="p-3">
            <h4 class="font-italic">档案</h4>
            <ol class="list-unstyled mb-0">
              <li><a href="https://blog.liubo.xyz/2019/12">2019年12月</a></li><li><a href="https://blog.liubo.xyz/2018/12">2018年12月</a></li><li><a href="https://blog.liubo.xyz/2018/11">2018年11月</a></li><li><a href="https://blog.liubo.xyz/2018/09">2018年09月</a></li><li><a href="https://blog.liubo.xyz/2018/08">2018年08月</a></li><li><a href="https://blog.liubo.xyz/2017/12">2017年12月</a></li><li><a href="https://blog.liubo.xyz/2014/12">2014年12月</a></li><li><a href="https://blog.liubo.xyz/2014/11">2014年11月</a></li>
            </ol>
          </div>
        </aside>
      </div>
    </main>

    <footer class="blog-footer">
      <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEAQMAAABrihHkAAAABlBMVEUAAAD///+l2Z/dAAAAAnRSTlP//8i138cAAAAJcEhZcwAADE0AAAxNAdLOrU4AAAD8SURBVEiJxZbRCQMxDEO1gfbf0hu4lhLo0b8oBw1XCO8jkWzFFP278GcCgE2g9jYl7CZZmDu0zQk4O1TX2t4QfVW8JtVdvCVjD8VBfHg/Jyr3Xo9enBOt6Z6OfWTjnMxpE4OhNUWrnIy7WolSvRiTlUxpXHJTMmGSLtXeSlNSKwQsdzEnkFP7tdSYTMVHGX3ovisiy2OvPlZONEYIJaG304xgalXr7SrqMVHJIY1tkBM/WriR22lG1Dxa4DhmTJxqWl/jgsBPV+o02TomHmfzdpUp/WKigisJnil9RVwqtQC8Is64Cva965y0I142XDnZk9/TiMzJW/833iEfKWbo9Tk0JHwAAAAASUVORK5CYII="/>
      <div style="width:300px;margin:0 auto; padding:20px 0;">
        <p><a target="_blank" href="https://beian.miit.gov.cn" style="color:#939393;">粤ICP备14085956号</a></p>
        <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44030602003540" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
          <img src="https://blog.liubo.xyz/res/img/beian_icon.png" style="float:left;"/>
          <p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">粤公网安备 44030602003540号</p>
        </a>
      </div>
    </footer>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--     <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> -->
    <script>window.jQuery || document.write('<script src="https://blog.liubo.xyz/res/js/vendor/jquery-slim.min.js"><\/script>')</script>
    <script src="https://blog.liubo.xyz/res/js/vendor/popper.min.js"></script>
    <script src="https://blog.liubo.xyz/res/js/bootstrap.min.js"></script>
    <script src="https://blog.liubo.xyz/res/js/vendor/holder.min.js"></script>
    <script>
      Holder.addTheme('thumb', {
        bg: '#55595c',
        fg: '#eceeef',
        text: 'Thumbnail'
      });
    </script>
  </body>
</html>
