简体   繁体   中英

Release apk install/update app from google play

The following is the situation:

I have an app, that I have published to the Google Play store (version code: 100, version name 1.100). I want to add feature allow people to update the app using an apk(release) from a website instead of from the Play Store.

BUT during testing I found the following problem:

  • Download current app from store(v - 100)
  • after that try to install(update) using the APK I compile
  • result - "App not installed."

But if I

  • install a hand created old APK (exactly the same as was uploaded to the Store)
  • try to install a handcreated APK update that was uploaded to the store
  • everything works fine

CAN you please describe there're some limits additional checkers for security or something wrong on my side ?

You are probably signed into Google Play App Signing .

Every Android app is signed with a key . When the phone tries to install an update, the update must be signed with the same key as the original app. This is for the security of the user. This stops a fake version of WhatsApp or Facebook (or your app) being created and users tricked into installing it. A bad developer can create an app with the same package name, but doesn't have access to the key, so this protects the users.

When you deliver through Google Play App Signing, Google removes the signature with your key (the "upload key") and signs it with a new Google Play key. This is a good thing. It protects you if you lose your upload key, without this there would be nothing Google could do to help you.

But this is why the upgrade doesn't happen. The app you hand create is signed with your upload key, so it won't update the app installed from Google Play.

This is a good thing. You don't want users who installed from one source (eg Google Play) to update from another source, like a download from a website. It would put them at serious risk of harmful fake apps.

However, if you really want to do this, you need to not use Google Play App Signing.

An alternative solution:

You can upload your signed apk on google play console then download the new signed apk and put it on your website or anywhere else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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