简体   繁体   English

使用密钥库生成签名的APK

[英]Using keystore to generate signed APK

Should I set a new Keystore for each app I build or I can use the same one existing for many apps ? 我应该为我构建的每个应用程序设置一个新的密钥库,还是可以将相同的密钥库用于许多应用程序? I created many keys when building my apps and now I'm confused either creating other ones or using old ones. 在构建应用程序时,我创建了许多密钥,但现在却困惑于创建其他密钥或使用旧密钥。

You can use the same keystore for n number of applications. 您可以将相同的密钥库用于n个应用程序。

As you might know Android identifies each app with an UID. 如您所知,Android使用UID识别每个应用程序。 If all your apps are signed by the same certificate you can request android to assign same user id more than one app and inturn make them run in a single process and share the data. 如果您所有的应用程序都使用相同的证书签名,则可以请求android为多个应用程序分配相同的用户ID,然后依次使它们在单个进程中运行并共享数据。

From android doc android:sharedUserId 来自android doc android:sharedUserId

android:sharedUserId 机器人:sharedUserId

The name of a Linux user ID that will be shared with other applications. 将与其他应用程序共享的Linux用户ID的名称。 By default, Android assigns each application its own unique user ID. 默认情况下,Android为每个应用程序分配其自己的唯一用户ID。 However, if this attribute is set to the same value for two or more applications, they will all share the same ID — provided that they are also signed by the same certificate. 但是,如果为两个或多个应用程序将此属性设置为相同的值,则它们都将共享相同的ID(前提是它们也由同一证书签名)。 Application with the same user ID can access each other's data and, if desired, run in the same process 具有相同用户ID的应用程序可以访问彼此的数据,并且如果需要,可以在同一进程中运行

A Keystore is just an encrypted repository for your signing credentials. 密钥库只是用于您的签名凭据的加密存储库。 You can use the same Keystore for multiple apps if you prefer simplicity. 如果您更喜欢简单性,可以将同一密钥库用于多个应用程序。

More about signing your app can be found in the Android documentation . 可以在Android文档中找到有关对应用程序签名的更多信息。

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

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