0

So I generated an apk using react native expo, and coud not find a way to set target sdk version, so the solution suggested in forums is detaching my app, and this is impossible for our app, it will be ruined, I know that !

So, I am thinking of using apktool to just set the targetVersion! I got a folder from my apk using this command :

apktool d myapk.apk

I made changes in androidmanifest.xml, and ..

I want to get my apk again from this compiled apk. from their documentation, I don't see how they do this! They use the commend with b option, but not on folders !!

Any idea or help woulb be much appreciaed.

TaouBen
  • 1,165
  • 1
  • 15
  • 41

1 Answers1

0

When you do apktool d myapk.apk you will get folder myapk/ which has your entire decompiled apk.

After changing what you need (in this case you actually need to change the targetSdkVersion parameter in apktool.yml, not in AndroidManifest.xml), you need to run apktool b myapk/ (passing that myapk folder), so you will get the recompiled apk in myapk/dist/myapk.apk.

sdkInfo:
  targetSdkVersion: '27' #(or any new desired target version)

After that you still need to sign and zipalign that apk to make it work on your device.

Leo Lamas
  • 178
  • 9