androidapkkeystoresignatureandroid-keystore

Can an APK be signed with another APK's signature?


I own an Android app but unfortuantely a SSD disk issue happened and I lost all my app's project files.

I have re-coded my app but updates aren't getting pushed to my app users anymore through my app's in-app updater... And if I send them the APK file they get "App not installed".

And it turned out at the end that the issue is that the current users have my app installed with a different signature than the new re-coded app's signature.

So my question: Can I sign the new APK with the old APK's signature? Or is it possible to extract the keystore/signature of the old APK and put it into the new APK?

Note: I know that my app users can uninstall the current app and install the new one, but the app data for each user shouldn't be removed.


Solution

  • If what you want to do was possible, anyone could decompile, modify and redistribute any app therefore it isn't possible. The OS will treat APKs with different signatures like different apps. The only way I know to use a new key for upgrades is if you used App Signing by Google Play. Otherwise, you will have to ask your users to migrate to the new app manually.