Android N-如何检查APK是否已使用架构v2签名 [英] Android N - how to check if apk is signed with schema v2

查看:187
本文介绍了Android N-如何检查APK是否已使用架构v2签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android N提供了新的apk签名方案v2 ,我如何检查特定的apk是否已使用该新签名进行签名?

Android N provided new apk Signature Scheme v2, how can I check if a specific apk is signed with that new signature?

谢谢

推荐答案

  • 运行 apksigner验证-v< apk> ,并在输出中查找使用v2方案(APK签名方案v2):true 验证的.apksigner可以在Android SDK构建工具24.0.3中找到.apksigner的源代码在这里: https://android.googlesource.com/platform/tools/apksig/.

    • Run apksigner verify -v <apk> and look for Verified using v2 scheme (APK Signature Scheme v2): true in the output. apksigner can be found in Android SDK build tools 24.0.3. apksigner's source code is here: https://android.googlesource.com/platform/tools/apksig/.

      对于Android Nougat上已安装的软件包: adb shell pm dump< package name>|grep apkSigningVersion . 1 表示常规的JAR签名方案, 2 表示APK签名方案v2.

      For an already installed package on Android Nougat: adb shell pm dump <package name> | grep apkSigningVersion. 1 means conventional JAR signing scheme, 2 means APK Signature Scheme v2.

      您还可以运行 grep'APK Sig Block 42'app.apk ,但这可能会有误报.只有在没有匹配项的情况下,才能确定未使用APK签名方案v2对APK进行签名.

      You can also run grep 'APK Sig Block 42' app.apk but this may have false positives. Only if there is no match is it certain that the APK is not signed using APK Signature Scheme v2.

      添加了有关apksigner的信息,该信息在撰写原始答案时尚不可用.

      Added information about apksigner which wasn't yet available when the original answer was written.

      这篇关于Android N-如何检查APK是否已使用架构v2签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆