-1

Last week I passed from a Android 10 phone to Android 12. I had some apks decompiled/recompiled with apktool and autosigned with jarsigner, and in Android 10 I could installed them, but in Android 12 it just shows me the apk is invalid when I try to install them at the phone. If I just decompile one and compile again, and then signed it gives me the same error. I also tryed to install it via adb install with the same result. I also get the same doing it with Apk Edit app in the phone, so I asume with Android 12 google restringed the apk installations in the phone, but not for all of them, because I installed some apk that I had for more than 5 years and they were installed fine. Could it be some attribute in the manifest? I will appreciatte some light to the topic. Regards

macbeto
  • 115
  • 9
  • You should edit your question and include the error message you gat when installing the APK file using `adb install`. – Robert Oct 23 '22 at 12:14

2 Answers2

1

You problem is jarsigner. Jarsigner creates an Android APK signature v1 which is no longer accepted on modern devices.

If you want to resign an app you have to use apksigner from Android SDK as it is capable of creating an APK signature v2 and v3. It is included in build tools for each platform, for example build tools for platform API 30.

Apksigner is a Java program so it doesn't mater if you download Linux, MacOS or Windows version:

  1. Download build-tools_r30.0.1-windows.zip
  2. Extract from the downloaded ZIP file android-11/lib/apksigner.jar
  3. Execute java -jar apksigner to execute Apksigner.

For a full list of commands how to generate the necessary signing keys and sign an APK please refer to this answer: https://android.stackexchange.com/a/226152/2241

Robert
  • 39,162
  • 17
  • 99
  • 152
0

Since play store started to accept AAB upload, APKs are started to build for spesific ABIs and OS versions by play store. Your problem may be caused from this situation.

For example; you can't install an apk that build for armeabi-v7a to your arm64-v8a based phone.

if this is the problem you can download appropriate apk variation from apkmirror.

ycannot
  • 1,807
  • 1
  • 9
  • 20