Recently I have been trying to debug a 3rd party android application using a variery of tools. I have followed the directions in this video. These were the main steps presented in the attached video:
- deassemble the original apk - apktool (2.6.1)
- Change/Add the
android:debugaable='true'property in theAndroidManifest.xmlfile - Manually. - build an unsigned apk using the previous level directory - apktool (2.6.1).
- sign the apk - dex2jar.d2j-apk-sign (2.2-SNAPSHOT)
- Install the app into an emulator on android studio (*emulator stats are described below) - using adb on android sdk.
However, I have faced trouble in signing and installing the apk in the emulator. I have tried a variety of tools and options in order to fix the issue:
Using
d2j-apk-sign- The signing itself seemed to have worked, but the installion didn't.I received the error:
adb: failed to install C:\Users\user\Desktop\Moovit_Stuff\chess_signed.apk: Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary]Using zipalign and apksigner (sdk 33.0.0) - I have used the information on this. accrroding to KJ7LNW's comment there, zipalign should be used and then a different tool named
apksigner. zipalign worked perfectly, but afterwards, apksigner requires a keystore file. I have created one in android studio (jks file), but after using it received the following error.Failed to load signer "signer #1" java.io.IOException: Invalid keystore format at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source) at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source) at sun.security.provider.KeyStoreDelegator.engineLoad(Unknown Source) at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(Unknown Source) at java.security.KeyStore.load(Unknown Source) at com.android.apksigner.SignerParams.loadKeyStoreFromFile(SignerParams.java:362) at com.android.apksigner.SignerParams.loadPrivateKeyAndCertsFromKeyStore(SignerParams.java:248) at com.android.apksigner.SignerParams.loadPrivateKeyAndCerts(SignerParams.java:181) at com.android.apksigner.ApkSignerTool.getSignerConfig(ApkSignerTool.java:419) at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:336) at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:92)I have tried to change the extension to .keystore but it didn't work either.
(2.1) Using r0adkll's comment on this - in order to fix the keystore file. (using
openssl base64, didn't change the result)
if you have reached this point, I want to thank you and I would greatly appreciate it if you could try and assist me.
Thanks in advance!
**Notes:
- apk file that I used - here
- emulator stats - Pixel & android tiramisu (version 33, x86_64)