Edit or Modify the AAB file

Edit or modify the aab file

This process will convert the apk into aab file

There is no way to edit or modify the file in aab because all file get encoded with protocol-buffers but we can edit the apk and modify it easily. So this process will convert modify apk into aab file

Windows-Method

Windows-exe

Download APK2AAB
Requirements - Java 8 & add to system variable
Download .Net 6.0 runtime only Download .NET 6.0 (Linux, macOS, and Windows)

Exe file found in APK2AAB\Windows-exe\APK2AAb.exe

Selected apk & out put aab path should not contain any space in directory path
Min-sdk , target sdk , version name & code should be same as your apk have in AndroidManifest.xml
You need to sign the generated aab file with your keystore in order to publish the application in play store

You can use jarsigner for signing aab file

Android-Method-(You don't need a pc if you follow this method)

Android-Tool-APK2AAB

Apk file found in APK2AAB\Android-Tool\APK2AAb.apk

Download the application and install it
Pick the apk and select output path for aab file
Your file generate in output path
You need to sign the generated aab file with your keystore in order to publish the application in play store

You can follow another guide to sign aab on android device

Manual-way

Tools are required

Bundletool.jar Releases · google/bundletool · GitHub

Apktool.jar GitHub - iBotPeaches/Apktool: A tool for reverse engineering Android apk files

Aapt2.exe https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.2.1-7147631/aapt2-4.2.1-7147631-windows.jar

Android.jar Get the ANDROID SDK: $ANDROID_SDK/platforms/android-$latestVersion/android.jar

Jave 8 Java Archive Downloads - Java SE 8 | Oracle India
Add to system variable https://www.java.com/en/download/help/path.html

Unzip the apk

Put all tool files in one folder
Open your command prompt in current directory
Decompile the apk through apktool.jar

execute below command in command line

java -jar apktool_2.5.0.jar d test.apk -s -o decompile_apk -f

Compile the resource

Compile the resources using aapt2

aapt2.exe compile --dir decompile_apk\res -o res.zip

After that you will see a res.zip will generate in your current directory

Link the resources

execute below command in command line

aapt2.exe link --proto-format -o base.zip -I android.jar --manifest decompile_apk\AndroidManifest.xml --min-sdk-version $version --target-sdk-version $version --version-code $version --version-name $version -R res.zip --auto-add-overlay

$version should be replace with your apk version for example my apk have min-sdk is 7 , target-sdk is 30 , version-code is 1 , verison-name is 1.0 . So my command will be →

aapt2.exe link --proto-format -o base.zip -I android.jar --manifest decompile_apk\AndroidManifest.xml --min-sdk-version 7 --target-sdk-version 30 --version-code 1 --version-name 1.0 -R res.zip --auto-add-overlay

After that you will see a base.zip will generate in your current directory

Unzip the base.zip

Directory structure:

base/
/AndroidManifest.xml
/res
/resources.pb

Copy the files
Take base folder as your main folder for now !
Create a folder manifest name folder inside base folder and move your base/AndroidManifest.xml to manifest/AndroidManifest.xml
copy whole assets folder from decompile_apk/assets and paste to base/assets
copy lib folder from decompile_apk/lib and paste to base/lib
copy all files inside unknown folder from decompile_apk/unknown and paste to base/root
copy whole kotlin folder from decompile_apk/kotlin and paste to base/root/kotlin

Final directory structure

base/
/assets
/dex
/lib
/manifest
/res
/root
/resources.pb

Create a zip

Open your command prompt in /base directory

we are going to create a zip using cmd or you can use any software like Winrar & 7zip

execute below command in command line

jar cMf base.zip manifest dex res root lib assets resources.pb

It will create base.zip in current directory now copy the base.zip and paste where you put all tool file (.jars , .exe)

Compile aab
Open your command prompt in /tools directory

execute below command in command line

java -jar bundletool.jar build-bundle --modules=base.zip --output=base.aab

base.aab file will generate in current folder
You need to sign the generated aab file with your keystore in order to publish the application in play store

I hope you guys will like it :+1:

Old errors will not come as i changed the whole process of creating AAB file.

New repository APK2AAB

Support

If you liked my work, you can support me - paypal.me

48 Likes
Kodular API (30) When Uptade?
Kodular and API Level 30
From 1 Aug 2021 targetSdkVerion = 30 (Android 11) for new apps!
Minimum SDK problem
How to add asset and sign aab file (Android only)
Steps to sign, update and publish your application in Google Play Store, Api 30 Android 11
When can expect Android 11 (API-30)? is there any method to upload API 29 Apps on playstore?
App Upload Or Update Problem In Google Play store Because Of Android 11
[Guide] How to disable split screen in your app!
[Guide] Force to disable dark mode in your app!
[Guide] How to remove the app from recent tab
(Solved) Indian Servers Sdk Problem Not Show The Sdk 30
How do I get geolocation or GPS on the webview?
When ? Kodular will release the next update for API level 30?
I am not able to publish my app because of API 30
When kodular release its new update
Your app currently target API level 29 and Must target API level 30
Bug on WriteExternalStorage Permission - Not Working
How to edit aab file
This question is only for a kodular moderator
Trying to set ViewPager to downcase but not working
Dex mod : Remove a.gray.inventor.a virus from apk
Setting One Signal Small Icon - Google Play
App links extension
Android:exported=“true” missing in manifest
Play store rejected my app
[HOW TO] easily remove permissions from aab
Edit the aab format manifest?
I don't want to request network permission even when my components want them
Remove permission LOCATION from AAB file
How to make a screen overshoot from the previous screen
Disable split screen
Pre lunch ClearText traffic error
Google Play Services Library Error OneSignal - Kodular Fenix 1.5.2 (Question)
One Signal Subscribed Users Not Added and Push Notification Set Subscription Block is Not Working
[Guide] Solve navigation bar is not fully transparent problem in Android 11
[Guide] Add adaptive icon in your app easily!

Lets try this out :grinning_face_with_smiling_eyes:

Great Guide @Shreyaa :heart::fire:
I’ll surely check this :grin: :blush:

1 Like

thank you :grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes:

1 Like
D:\User\Downloads\apk_to_aab>python run.py -i "D:\User\Downloads\apk_to_aab\neww_copy.apk" -o "D:\User\Downloads\apk_to_aab\OutPutFolder\test.aab"
---Environment_&_parameter_verification
[Current_system]:Windows
[Current_system_JAVA_version]#####:
[Enter_apk]:D:\User\Downloads\apk_to_aab\neww_copy.apk
[Output_aab]:D:\User\Downloads\apk_to_aab\OutPutFolder\test.aab
[sign]:D:\User\Downloads\apk_to_aab\libs\key.jks,storepass:123456789,alias:123456789,keypass:123456789
##################################################
Window_does_not_check_to_avoid_libraries_without_openssl
##################################################
[apktool]:D:\User\Downloads\apk_to_aab\libs\apktool-2.5.2-fixed.jar
[apktool_version_number]:#####
[aapt2]:D:\User\Downloads\apk_to_aab\libs\aapt2\Windows\aapt2
[aapt2_version_number]:#####
[android]:D:\User\Downloads\apk_to_aab\libs\android_sdk.jar
[bundletool]:D:\User\Downloads\apk_to_aab\libs\bundletool-all-1.8_fix.jar
[bundletool_version_number]:#####
----time_consuming :0.07627701759338379 Environment_&_parameter_verification status:-2 msg:success
task Environment_&_parameter_verification Execution_exception_status:-2 msg:success

can you help me. it just shows up like this. it doesn’t output aab

check your “D:\User\Downloads\apk_to_aab\OutPutFolder\test.aab”
your aab is located in your out put path

2 Likes

i checked but the folder is empty

post your full out put here that was half out put

1 Like

that’s all

did you install the requirements ?? without that software can’t run

show me your python version

1 Like
D:\User\Downloads\apk_to_aab>pip install -r requirements.txt
Collecting PyYAML==5.4.1
  Downloading PyYAML-5.4.1-cp39-cp39-win_amd64.whl (213 kB)
     |████████████████████████████████| 213 kB 6.8 MB/s
Installing collected packages: PyYAML
Successfully installed PyYAML-5.4.1
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the 'c:\users\user\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.

D:\User\Downloads\apk_to_aab>python run.py -i "Path\neww_coppy.apk" -o "path\OutPutFolder\test.aab"
---Environment_&_parameter_verification
[Current_system]:Windows
[Current_system_JAVA_version]#####:
[Enter_apk]:D:\User\Downloads\apk_to_aab\Path\neww_coppy.apk
----time_consuming :0.02094292640686035 Environment_&_parameter_verification status:-1 msg:The_entered_apk_does_not_exist:D:\User\Downloads\apk_to_aab\Path\neww_coppy.apk
task Environment_&_parameter_verification Execution_exception_status:-1 msg:The_entered_apk_does_not_exist:D:\User\Downloads\apk_to_aab\Path\neww_coppy.apk

D:\User\Downloads\apk_to_aab>python run.py -i "\neww_coppy.apk" -o "\OutPutFolder\test.aab"
---Environment_&_parameter_verification
[Current_system]:Windows
[Current_system_JAVA_version]#####:
[Enter_apk]:D:\neww_coppy.apk
----time_consuming :0.012965917587280273 Environment_&_parameter_verification status:-1 msg:The_entered_apk_does_not_exist:D:\neww_coppy.apk
task Environment_&_parameter_verification Execution_exception_status:-1 msg:The_entered_apk_does_not_exist:D:\neww_coppy.apk

D:\User\Downloads\apk_to_aab>python run.py -i "D:\User\Downloads\apk_to_aab\neww_copy.apk" -o "D:\User\Downloads\apk_to_aab\OutPutFolder\test.aab"
---Environment_&_parameter_verification
[Current_system]:Windows
[Current_system_JAVA_version]#####:
[Enter_apk]:D:\User\Downloads\apk_to_aab\neww_copy.apk
[Output_aab]:D:\User\Downloads\apk_to_aab\OutPutFolder\test.aab
[sign]:D:\User\Downloads\apk_to_aab\libs\key.jks,storepass:123456789,alias:123456789,keypass:123456789
##################################################
Window_does_not_check_to_avoid_libraries_without_openssl
##################################################
[apktool]:D:\User\Downloads\apk_to_aab\libs\apktool-2.5.2-fixed.jar
[apktool_version_number]:#####
[aapt2]:D:\User\Downloads\apk_to_aab\libs\aapt2\Windows\aapt2
[aapt2_version_number]:#####
[android]:D:\User\Downloads\apk_to_aab\libs\android_sdk.jar
[bundletool]:D:\User\Downloads\apk_to_aab\libs\bundletool-all-1.8_fix.jar
[bundletool_version_number]:#####
----time_consuming :0.1087944507598877 Environment_&_parameter_verification status:-2 msg:success
task Environment_&_parameter_verification Execution_exception_status:-2 msg:success

D:\User\Downloads\apk_to_aab>

D:\User\Downloads\apk_to_aab>

D:\User\Downloads\apk_to_aab>python run.py -i "D:\User\Downloads\apk_to_aab\neww_copy.apk" -o "D:\User\Downloads\apk_to_aab\OutPutFolder\test.aab"
---Environment_&_parameter_verification
[Current_system]:Windows
[Current_system_JAVA_version]#####:
[Enter_apk]:D:\User\Downloads\apk_to_aab\neww_copy.apk
[Output_aab]:D:\User\Downloads\apk_to_aab\OutPutFolder\test.aab
[sign]:D:\User\Downloads\apk_to_aab\libs\key.jks,storepass:123456789,alias:123456789,keypass:123456789
##################################################
Window_does_not_check_to_avoid_libraries_without_openssl
##################################################
[apktool]:D:\User\Downloads\apk_to_aab\libs\apktool-2.5.2-fixed.jar
[apktool_version_number]:#####
[aapt2]:D:\User\Downloads\apk_to_aab\libs\aapt2\Windows\aapt2
[aapt2_version_number]:#####
[android]:D:\User\Downloads\apk_to_aab\libs\android_sdk.jar
[bundletool]:D:\User\Downloads\apk_to_aab\libs\bundletool-all-1.8_fix.jar
[bundletool_version_number]:#####
----time_consuming :0.07627701759338379 Environment_&_parameter_verification status:-2 msg:success
task Environment_&_parameter_verification Execution_exception_status:-2 msg:success

D:\User\Downloads\apk_to_aab>

D:\User\Downloads\apk_to_aab>

Yes. I followed your instructions exactly, but I don’t know where the error is. Thank you for your support

send me your apk in my pm @Uyen_Chau

the problem is with python version

1 Like

bundle tool jar was corrupted

i just download the new from here simple125345/APK_TO_AAB (github.com)
i just checked now

@Uyen_Chau you can download the tool from here simple125345/APK_TO_AAB (github.com)

i will update the post within 5 min and your apk was success and generated aab

2 Likes

I’m dealing with the same issue. I have downloaded the zip from github and tried again but output is same

C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab>python run.py -i “C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\Bachat_Bazaar.apk” -o “C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\output\Bachat_Bazaar.aab”
—Environment_&parameter_verification
[Current_system]:Windows
[Current_system_JAVA_version]#####:
[Enter_apk]:C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\Bachat_Bazaar.apk
[Output_aab]:C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\output\Bachat_Bazaar.aab
[sign]:C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\libs\key.jks,storepass:123456789,alias:123456789,keypass:123456789
##################################################
Window_does_not_check_to_avoid_libraries_without_openssl
##################################################
[apktool]:C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\libs\apktool-2.5.2-fixed.jar
[apktool_version_number]:#####
[aapt2]:C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\libs\aapt2\Windows\aapt2
[aapt2_version_number]:#####
[android]:C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\libs\android_sdk.jar
[bundletool]:C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab\libs\bundletool-all-1.8_fix.jar
[bundletool_version_number]:#####
----time_consuming :0.0688486099243164 Environment
&parameter_verification status:-2 msg:success
task Environment
&_parameter_verification Execution_exception_status:-2 msg:success

C:\Users\Xavier\Desktop\apk_to_aab\apk_to_aab>

1 Like

invalid commands
-i path\your.apk and -o path\test.aab

1 Like

I have entered the same command as you did.
C:\Users\amd\Desktop\apk_to_aab\apk_to_aab>python run.py -i “C:\Users\amd\Desktop\apk_to_aab\apk_to_aab\abbtest.apk” -o “C:\Users\amd\Desktop\apk_to_aab\apk_to_aab\OutPutFolder\myaab.aab”

1 Like

I have downloaded and tried many times still not working. it’s still the same as before. can you help me check again. Thank you very much

wait i will make an video this will help all

4 Likes

APK_TO_AAB-main file corrupted please help me

here is an video

in this video i used apk given by @udai_veer and it successfully generated aab file shown in video

everything is working

6 Likes