简体   繁体   English

如何使用“原始”密钥签署apk

[英]How to sign an apk with 'original' key

Hey guys I am messing around with apktools but I have a little problem: 大家好,我在玩apktools,但我有一个小问题:

I can decompile and recompile an apk but when I want to install it on my device I get an error that it couldn't be installed. 我可以反编译和重新编译apk,但是当我想在设备上安装它时,出现错误,提示无法安装。

I replaced the resources.arcs of the old apk with the new one but I get the same error. 我用新的替换了旧apk的resources.arcs,但是得到了同样的错误。

I then resigned the apk and can install it on my device, but before I can install it i have to uninstall the original app on my phone, since an app with the same package but different key exists on my phone. 然后,我辞职了APK,可以将其安装在我的设备上,但是在安装它之前,我必须先卸载手机上的原始应用,因为手机上存在具有相同软件包但密钥不同的应用。

Is there a way I can modify an apk and use the old key of it, so I can install the modified app without uninstalling the 'old' version of it? 有没有一种方法可以修改apk并使用其旧密钥,因此我可以在不卸载旧版本的情况下安装修改后的应用程序?

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. 我可以使用Gmail应用程序,添加恶意软件,对其进行签名,然后假装为Google,从而使用户相信我是Google。 This would be terrible. 这将是可怕的。

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 . 可以使用与原始密钥不同的密钥对未签名的APK进行签名,但除非将软件包名称命名为(,否则 ,您将无法将其上传到Play商店,也无法将其安装在安装了相同应用的设备上应用程序ID)已更改

The Play Store doesn't allow two apps with the same application ID to be uploaded, that are signed with different keys. Play商店不允许上传具有相同应用程序ID且使用不同密钥签名的两个应用程序。 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. 此外,Play商店不允许上传使用相同应用程序ID(使用原始密钥签名)的应用程序,除非版本高于商店中当前的版本。

Is there a way I can modify an apk and use the old key of it [to sign the app] 有没有一种方法可以修改apk并使用它的旧密钥[对应用程序签名]

Not unless you have access to the original key. 除非您有权访问原始密钥,否则不可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM