<!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://www.liubo.xyz/res/img/favicon.ico">
    <link rel="apple-touch-icon-precomposed" href="https://www.liubo.xyz/res/img/apple-touch-icon-precomposed.png">
    <div id="wx_pic" style="margin:0 auto;display:none;">
      <img src="https://www.liubo.xyz/res/img/apple-touch-icon-precomposed.png"/>
    </div>

    <title>LIMITLESS POSTER</title>

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

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

  <body class="text-center" onload="PR.prettyPrint()">

    <div class="cover-container d-flex h-100 p-3 flex-column">
      <header class="masthead mb-auto">
        <div class="inner">
          <h3 class="masthead-brand">LIMITLESS POSTER</h3>
          <nav class="nav nav-masthead justify-content-center">
            <a class="nav-link active" href="https://www.liubo.xyz">主页</a>
            <a class="nav-link" target="_blank" href="https://blog.liubo.xyz">博客</a>
            <a class="nav-link" target="_blank" href="https://www.liubo.xyz/qr_codes">生成二维码</a><a class="nav-link" target="_blank" href="https://www.liubo.xyz/pinyin">汉字转拼音</a><a class="nav-link" target="_blank" href="https://www.liubo.xyz/dict">字典</a>
          </nav>
        </div>
      </header>

      <main role="main" class="inner cover">
        <h3 class="cover-heading"><a href="https://blog.liubo.xyz/2019/12/30/wechat-login.html" target="_blank">应用无法拉起微信登录的异常排除</a></h3><div class="blog-post" style="text-align:left"><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><h3 class="cover-heading"><a href="https://blog.liubo.xyz/2018/12/17/find-apk-target-sdk-version.html" target="_blank">获取APK的targetSdkVersion及minSdkVersion</a></h3><div class="blog-post" style="text-align:left"><p>1.使用aapt工具：</p>

<pre class="prettyprint">
    aapt list -a app.apk | grep SdkVersion
</pre>
显示的结果为16进制
<br/>
<br/>
或：

<pre class="prettyprint">
      aapt dump badging app.apk|grep Version
</pre>

<p>2.使用apktool：</p>

<pre class="prettyprint">
      java -jar apktool.jar d app.apk
</pre>

<p>然后查看生成的apktool.yml文件的sdkInfo字段即可</p>
</div>
        <p class="lead">
          <a href="https://blog.liubo.xyz" class="btn btn-lg btn-secondary">了解更多</a>
        </p>
        <p class="lead">
          <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAACEAQMAAABrihHkAAAABlBMVEUAAAD///+l2Z/dAAAAAnRSTlP//8i138cAAAAJcEhZcwAADE0AAAxNAdLOrU4AAAD+SURBVEiJxZZRDsIwDEN9A9//lr5BiNMyVfzNA9FJW/eQQtwkBtTnwp8JAJYvrW1KWEX1a4ne5gTkIM32EZGf/A5plc/IyCOgOrTfJz7uvY5a3CdePjHx7I37xMm5EWDGnLj+EtSfUEt7RLyjb+4q5KTDTtTO0Ipjsl67AK3UYlPirNTEA7eUhkRrVPrYtSNHZGrXnYARXTHpaC2UXUNha4+Iw3VTOUOKOZnBHzdqrJx0YtsceSlNyPjHdIInJiczrTYmTa4xcW7YNgvlxHYGO8n+npgsh5VPjdcvSEbcluBbaU7cCZaLekCsdJwE20kyMie/HjpqcZv87h9IQl5Kitbp7DTbLwAAAABJRU5ErkJggg=="/>
        </p>
      </main>

      <footer class="mastfoot mt-auto">
        <div class="inner">
          <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://www.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>
        </div>
      </footer>
    </div>


    <!-- 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://www.liubo.xyz/res/js/vendor/jquery-slim.min.js"><\/script>')</script>
    <script src="https://www.liubo.xyz/res/js/vendor/popper.min.js"></script>
    <script src="https://www.liubo.xyz/res/js/bootstrap.min.js"></script>
  </body>
</html>
