使用调试密钥手动签署未签名的 APK [英] Sign unsigned APK with debug key manually

查看:27
本文介绍了使用调试密钥手动签署未签名的 APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从 CI 管道中获取的 APK.CI 管道以发布模式构建,但仅生成未签名的 APK.

I have an APK which I got out of a CI pipeline. The CI pipeline builds in release mode but only generates unsigned APKs.

为了在真实设备上测试生成的 APK,我想用我的调试密钥对其进行签名.(我安装了该 APK 的早期版本,在本地构建并使用我的调试密钥签名,并希望保留数据.)

In order to test the generated APK on a real device, I would like to sign it with my debug key. (I have an earlier version of that APK installed, built locally and signed with my debug key, and would like to keep the data.)

这可能吗?如何从命令行执行此操作?

Is that possible? How do I do that from the command line?

推荐答案

假设你有一个调试键,试试这个命令 -

Assumig you have a debug key, try this command -

 jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android path/to/my.apk androiddebugkey

(默认密钥库位于 ~/.android/debug.keystore,两个密码都是 android,要使用的密钥别名是 androiddebugkey.)

(The default key store resides in ~/.android/debug.keystore, both passphrases are android, and the key alias to use is androiddebugkey.)

然后,接下来验证其签名使用

And, next to verify its signature use

jarsigner -verify -verbose -certs app-release-unsigned.apk 

注意APK会被修改;如果您不想要,可以复印一份.

Note that the APK will be modified; work on a copy if you don’t want that.

这篇关于使用调试密钥手动签署未签名的 APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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