[Android Software/Hacking General [Developers Only]] sunilpaulmathew:
This thread will not be maintained anymore. The source code will be still available and updated. So, anyone interested can still download and use this script from here.

F-zip: Universal recovery flashable zip generator for Linux & android

/* What is F-zip about? */

"F-zip is a universal shell script designed to make recovery flashable zip files with a few simple steps“

/* For those it is helpful? */

Anyone (devs/newbies) who has something (boot.img/apps/libs) to flash and do not want to do all the work to make a recovery zip manually.

/* Background */

After encountered several errors while flashing manually made recovery zips, I made several scripts for my personal use. Now I decided to combine all and share as a universal script for generating recovery flashable zip for various purposes including

Flashing “boot.img”. (Caution: This feature is by default optimized for Samsung Galaxy S5 (kltexxx). Proper modification in the “fzip.sh” (line# 30) will be required for other devices. Don’t worry, you can easily find such details from any other working ROM/Kernel zip).

Flashing app(s) to “/system/app” & “/system/priv-app” (up to a maximum of 5 folders is presently supported though it is infinite without separate folder(s). That is directly as “.apk”).

Flashing "framework-res.apk", into “/system/framework/”

Flashing "bootanimation.zip" (only for aosp ROMs) to the "/system/media".

Flashing infinite number of library (typically “.so”) files into “/system/lib”.

Flashing infinite number of frameworks (typically “.jar”) files into “/system/framework”.

/* Where it works? */

It will works on any Linux and Linux based operating systems including android. The Linux system might be native or with in a virtual box or even the bash inside Windows 10.

/* DISCLAIMER!! */

I am not responsible for any damage to your device. Everything you are doing on your device is on your own risk.
You have all the chances to mess up your apps (and very rarely the entire ROM), in case if you did some stupid mistakes on this script. Use this script on your own risk.
Please note that flashing anything will mostly void your warranty.

/* How-to-use? */

1. clone or download f-zip repo into your Linux PC or Android device.

2. copy "boot.img", if any, into the root folder. Caution: Don’t forget to modify “fzip.sh” (line# 30), if your device is anything other than Samsung Galaxy S5 (kltexxx).

3. copy the app folder(s) in to "/system/priv-app/" or/and "system/app/". You may also copy the “.apk” file(s) directly to “/system/app/” or/and “/system/priv-app/” (without folder) if your app/ROM supports to do so.

4. copy library (typically “.so”) file(s), if any, into “/system/lib/”

5. copy modules (typically “.ko”) file(s), if any, into “/system/lib/modules/”

6. copy framework (typically “.jar”) file(s), if any, into “/system/framework/”

7. copy "framework-res.apk", if any, into “/system/framework/”

8. copy "bootanimation.zip" (only for aosp ROMs) file, if any, into “/system/media/”

9. modify fzip.sh accordingly (please see instructions below)

10. open terminal and cd to the root folder of f-zip

11. run ". fzip.sh" (in Linux) or “sh fzip.sh” (in android).

12. The recovery flashable zip file will be generated in the root folder.​

How-to-modify shell script?

More information can be found here.

/* Video Tutorial (Android mobile) */

A video demonstrating the use of this script in an Android mobile is available in this YouTube link.

/* F.A.Q */

Qn. Will this script works on windows native cmd?

Ans. No.

Qn. Is this script will work on the Bash inside Windows 10?

Ans. Yes. It will work on all the Linux and linux based (either native or virtual) environments.

Qn. I’m a Windows fanboy. I don’t have any working Linux environment at all, and too lazy to do these things in my android device. Is it still possible to use this script?

Ans. Yes. You can use your windows to add the necessory files/folders and also for editing “fzip.sh” (always use “gedit” or “Notepad++” for editing “fzip.sh”). Once you done, simply copy the folder into your android device and follow the remaining instructions.

Qn. Is it possible to make a flashable “boot.img” to “XXX” device using this script?

Ans. Yes. However, proper modification in the "fzip.sh" (line# 30) is required.

Qn. Can you make a similar script for Windows?

Ans. No. I don’t have enough knowledge to do that. Sorry.

XDA:DevDB Information

F-Zip, Tool/Utility for all devices (see above for details)

Contributors

sunilpaulmathew

Source Code: https://github.com/SmartPack/

Version Information

Status: Beta

Beta Release Date: 2017-09-08

Created 2017-06-14

Last Updated 2017-09-08