如何验证 Android apk 是否使用发布证书进行签名?

发布于 2024-11-30 05:18:59 字数 40 浏览 3 评论 0原文

如何检查 Android apk 是否使用版本签名而不是调试证书?

How can I check that an Android apk is signed with a release and not debug cert?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

祁梦 2024-12-07 05:18:59

使用此命令,(在cmd提示符下转到java < jdk < bin路径)

$ jarsigner -verify -verbose -certs my_application.apk

如果您看到“CN=Android Debug”,这意味着.apk是使用Android SDK生成的调试密钥进行签名的
(意味着它是未签名的),否则你会发现CN的东西。
有关更多详细信息,请参阅:http://developer.android.com/guide/publishing/app-signing.html

Use this command, (go to java < jdk < bin path in cmd prompt)

$ jarsigner -verify -verbose -certs my_application.apk

If you see "CN=Android Debug", this means the .apk was signed with the debug key generated by the Android SDK
(means it is unsigned), otherwise you will find something for CN.
For more details see: http://developer.android.com/guide/publishing/app-signing.html

猥琐帝 2024-12-07 05:18:59

使用控制台命令:

apksigner verify --print-certs application-development-release.apk

您可以在../sdk/build-tools/24.0.3/apksigner.bat中找到apksigner。仅适用于构建工具 v. 24.0.3 及更高版本。

另请阅读谷歌文档: https://developer.android.com/studio/command-行/apksigner.html

Use console command:

apksigner verify --print-certs application-development-release.apk

You could find apksigner in ../sdk/build-tools/24.0.3/apksigner.bat. Only for build tools v. 24.0.3 and higher.

Also read google docs: https://developer.android.com/studio/command-line/apksigner.html

你怎么敢 2024-12-07 05:18:59

最简单的:

keytool -printcert -jarfile file.apk

这使用 Java 内置 keytool 应用程序,不需要提取或安装任何构建工具。

The easiest of all:

keytool -printcert -jarfile file.apk

This uses the Java built-in keytool app and does not require extraction or any build-tools installation.

摇划花蜜的午后 2024-12-07 05:18:59

使用此命令:(Jarsigner 位于您的 Java bin 文件夹中,在 cmd 提示符下转到 java->jdk->bin 路径)

$ jarsigner -verify my_signed.apk

如果 .apk 已正确签名,Jarsigner 会打印“jar verify”

Use this command : (Jarsigner is in your Java bin folder goto java->jdk->bin path in cmd prompt)

$ jarsigner -verify my_signed.apk

If the .apk is signed properly, Jarsigner prints "jar verified"

紫﹏色ふ单纯 2024-12-07 05:18:59

在终端中运行此命令 - 如果您有 Android Studio。

$ /Applications/Android\ Studio.app/Contents/jre/Contents/Home/bin/keytool -printcert -jarfile example.apk
Not a signed jar file

Run this command in Terminal - if you have Android Studio.

$ /Applications/Android\ Studio.app/Contents/jre/Contents/Home/bin/keytool -printcert -jarfile example.apk
Not a signed jar file
魔法唧唧 2024-12-07 05:18:59

使用keytooljarsigner可能不适合您。您需要首先了解签名的工作原理。 请参阅此处

如果您的最小 API 低于 24,v1 签名将包含在 apk 中(在 META_INF 内)。正因为如此,这两个工具将“抛出”您的证书密钥。

如果使用最低 API 24 或更高版本,则将排除 v1 签名(除非您在 build.gradle 中自行启用它)。在这种情况下,keytooljarsigner 不起作用。他们将输出Not asigned jar filejar is unsigned。要验证 v2+ 签名,您应该使用 apksigner 代替。

Using keytool or jarsigner may not work for you. You need to first understand how signing works. See here.

If your min API is lower than 24, v1 signing will be included in apk (inside META_INF). And because of that, these two tools will "poop out" your cert keys.

If using min API 24 or higher, v1 signing will be excluded (unless you enable it on your own in build.gradle). In this case keytool or jarsigner don't work. They will output Not a signed jar file or jar is unsigned. To verify v2+ signature, you should use apksigner instead.

撩动你心 2024-12-07 05:18:59
    1. 解压apk
    1. keytool -printcert -file ANDROID_.RSA 或 keytool -list -printcert -jarfile app.apk 获取哈希 md5
  • keytool -list -v -keystore clave-release.jks
  • 比较 md5

https ://www.eovao.com/en/a/signature%20apk%20android/3/how-to-verify-signature-of-.apk-android-archive

    1. unzip apk
    1. keytool -printcert -file ANDROID_.RSA or keytool -list -printcert -jarfile app.apk to obtain the hash md5
  • keytool -list -v -keystore clave-release.jks
  • compare the md5

https://www.eovao.com/en/a/signature%20apk%20android/3/how-to-verify-signature-of-.apk-android-archive

笑,眼淚并存 2024-12-07 05:18:59

对于 macOS 用户:

cd ~/Library/Android/sdk/build-tools/33.0.1
./apksigner verify --print-certs --verbose path-to-apk.apk

根据计算机上安装的内容更改构建工具版本。

For macOS users:

cd ~/Library/Android/sdk/build-tools/33.0.1
./apksigner verify --print-certs --verbose path-to-apk.apk

Change build-tools version based on what is installed on your machine.

你又不是我 2024-12-07 05:18:59
keytool -printcert -jarfile base.apk
keytool -printcert -jarfile base.apk
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文