如何使用'原始'签署apk键

时间:2015-05-04 17:05:09

标签: android apk apktool

嘿伙计们我正在搞乱apktools,但我有一点问题:

我可以反编译并重新编译apk但是当我想在我的设备上安装它时,我会收到一个无法安装的错误。

我用新的替换了旧apk的resources.arcs,但是我得到了同样的错误。

然后我辞职了apk并且可以将它安装在我的设备上,但在我安装之前我必须在我的手机上卸载原始应用程序,因为我的手机上存在具有相同包但不同密钥的应用程序。

有没有办法可以修改apk并使用它的旧密钥,这样我就可以安装修改过的应用程序,而无需卸载旧的'它的版本?

2 个答案:

答案 0 :(得分:0)

Long story short : no, you can't. In order to sign an app (or sign anything, in fact) you need a private key. In your case, the original developer's private key, the one he used to sign the app. Unless he gives you access to it, there's no way you can get it which implies there's no way you can sign your modified app.

If it was possible, imagine the problems it would cause. I could take the Gmail app, add a malware, sign it and pretend to be Google, causing users to trust that i am Google. This would be terrible.

答案 1 :(得分:0)

You can sign an unsigned APK with a different key from the original, but you will not be able to upload it to the Play Store, nor will you be able to install it on a device that has the same app installed unless the package name (application ID) has been changed.

The Play Store doesn't allow two apps with the same application ID to be uploaded, that are signed with different keys. In addition, the Play Store doesn't allow uploading an app with the same application ID, signed with the original key, unless the version is higher than the one currently on the store.

Is there a way I can modify an apk and use the old key of it [to sign the app]

Not unless you have access to the original key.