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

查看:47
本文介绍了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 verify -v 并在输出中查找 Verified using v2 scheme (APK Signature Scheme 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 |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 不是使用 APK 签名方案 v2 签名的.

      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天全站免登陆