简体   繁体   English

更新Android系统应用程序,带/不带平台签名

[英]Update of Android system app, with/without platform signature

I have a system app that the OEM installs with the system image, but is signed by me. 我有一个系统应用程序,OEM安装系统映像,但由我签名。 If I upload an updated apk to the market, will the market app silently install this update automatically? 如果我将更新的apk上传到市场,市场应用程序是否会自动安装此更新?

If my system app is instead signed with the platform signature instead of mine, this means any updates also have to be signed with the platform signature, correct? 如果我的系统应用程序使用平台签名而不是我的签名,这意味着任何更新也必须使用平台签名进行签名,对吗? Can a platform-signed apk be updated from the market? 可以从市场更新平台签名的apk吗?

Lets first of all clarify the difference between all types of apps. 让我们首先澄清所有类型的应用程序之间的差异。

System apps are those that are located in the /system/app folder. 系统应用程序是位于/system/app文件夹中的/system/app These applications have a flag ApplicationInfo.FLAG_SYSTEM set. 这些应用程序具有一个标志ApplicationInfo.FLAG_SYSTEM集。 In an ordinary device the partition /system is mounted for read-only access. 在普通设备中,安装分区/system以进行只读访问。 Thus, a system application cannot be updated because it is located in the read-only location. 因此,系统应用程序无法更新,因为它位于只读位置。 These applications can be updated only as a part of OTA update. 这些应用程序只能作为OTA更新的一部分进行更新。

Ordinary apps are located on the /data partition which is read-write. 普通应用程序位于/ data分区,它是可读写的。 Thus, these applications can be updated by a system. 因此,这些应用程序可以由系统更新。

Now lets talk about signatures. 现在让我们谈谈签名。 Some Android components are protected with permissions of signature type. 某些Android组件受签名类型的权限保护。 This means that if you want to have access to a component protected with this type of permission, your application must be signed with the same certificate as a protected component. 这意味着,如果要访问受此类权限保护的组件,则必须使用与受保护组件相同的证书对应用程序进行签名。 This is true not only for Android system, but also for Android applications, ie in your application you can have a component that is protected with a signature permission, thus, only applications that have the same signature will have access to this component. 这不仅适用于Android系统,也适用于Android应用程序,即在您的应用程序中,您可以拥有受签名权限保护的组件,因此,只有具有相同签名的应用程序才能访问此组件。

The third thesis which we require to answer your question is that Android prohibits the installation of the packages that have the same package name but different signatures. 我们要回答你问题的第三个问题是Android禁止安装具有相同包名但签名不同的包。

Thus, 从而,

I have a system app that the OEM installs with the system image, but is signed by me. 我有一个系统应用程序,OEM安装系统映像,但由我签名。 If I upload an updated apk to the market, will the market app silently install this update automatically? 如果我将更新的apk上传到市场,市场应用程序是否会自动安装此更新?

If my system app is instead signed with the platform signature instead of mine, this means any updates also have to be signed with the platform signature, correct? 如果我的系统应用程序使用平台签名而不是我的签名,这意味着任何更新也必须使用平台签名进行签名,对吗? Can a platform-signed apk be updated from the market? 可以从市场更新平台签名的apk吗?

The answer is no. 答案是不。 Although the apps that are located in /system/app can be signed with a certificate that differs from the platform one, the update of these applications is possible only with system update. 虽然位于/ system / app中的应用程序可以使用不同于平台的证书进行签名,但只有系统更新才能更新这些应用程序。

To solve your problem you can change the packagename of your application, sign it with your (if the application does not require to have access to protected Android components) or platform (if the application should have access to protected components and if you have access to this signature) and put this application into market. 要解决您的问题,您可以更改应用程序的软件包名称,使用您的应用程序进行签名(如果应用程序不需要访问受保护的Android组件)或平台(如果应用程序应该可以访问受保护的组件,并且您有权访问这个签名)并将此应用程序推向市场。 Then, you'll receive the updates of your application through the market. 然后,您将通过市场收到应用程序的更新。

除非signatur与/ system / ap中的一个匹配,否则系统不会将/ data / app中的apk视为更新

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

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