Packing an APK
Once you have finished your mod you need to pack it back into an apk file
Packing as a zip file
Note you can only do this method if you treated the apk as a zip file during the original unpacking step. If your resources (such as AndroidManifest.xml) have been decoded, you cannot just zip up the contents of the apk.
Select all files and folders inside the extracted APK directory, then compress them into a ZIP archive - do not just compress the outer directory, this will lead to issues.
Pack using Apktool
Apktool can pack the apk as well as re-encode any resources.
See install to install apktool to your system.
Then to pack the APK, the following command can be used:
apktool b path/to/apk_folder -o path/to/output_apk.apk
Replacing path/to/apk_folder with the location of the extracted APK contents.
-o path/to/output_apk.apk is optional, but useful if you want to place the packed files in a specific location (default is dist/name.apk), replacing path/to/output_apk.apk with the location of the path to write the final apk to.
Note that sometimes apktool may fail to pack some resources and so when you build the apk, it may fail to build correctly. If this is the case, you may have to go back to the extracting step and use the --no-res flag.