Copy and paste the below script and sabve it as a py file and then execute. There are some modifications that you might require to do are like giving path to the apktool, keytool , jarsigner, zipalign in the script, Also there are some pre requisites that need to be…