I disassembled the app using apktool and further reassembled it.
After I signed it with signapk, but the app did not install on my Android 11 phone, although it did install on my Android 9 emulator. I decided to look at the logs in logcat and saw the following error:
Scanning Failed.
PackageManager: com.android.server.pm.PackageManagerException: No signature found in package of version 2 or newer for package com.<application>
After googling, I found a solution: use zipalign. I used zipalign both before and after signing the application - nothing changed and the error remained. Next, I decided to sign the application with my own key via apksigner. The result is the same.
jarsigner:
jarsigner -verbose -keystore <keystore>.keystore <apk>.apk <alias>
I also tried:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <keystore>.keystore <apk>.apk <alias>
zipalign:
zipalign -p -f -v 4 <input>.apk <output>.apk
How to solve this problem?