[GUIDE][DYI] How to Create your own Flashable Zips. - Nexus 4 General

Here is an in depth guide on how to create a flashable zip for Recoveries, Kernels, Fonts, System Apps, Bootanimations etc. I will go straight to the point and show everything that needs to be done. Just follow the instructions and you'll be fine.
Pre requisites:
- Basic knowledge on zipping/archiving files
- Basic knowledge on Unix Scripts
- Win rar
- Notepad++
Let's start!
+Bootanimation
- first create two types of folder one for "system" and one for "META-INF."
- then go inside the system folder that you created and create a folder named "media"
- inside "media" save your current boot animation and save it there.
- then let's go to the META-INF folder
- create this folders "com/google/android" so first create "com" then inside "com" create "google" then inside "google" create "android".
- then inside android you need to create a update-binary file and updater-script file (Don't worry I'll attach the specific files at the bottom.)
- then after putting the two files inside the android folder you need to zip the two folders: system and META-INF
- zip those two together not zipping both of them inside a folder. Highlight the 2 Folders right click and add to archive or compress, choose the zip format.
- after that place it in your sdcard and boot to recovery and flash it.
For Updater Script:
run_program("/sbin/mount", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/umount", "/system");
+System Apps of fixes to Certain System Apps:
- first create two types of folder one for "system" and one for "META-INF."
- then go inside the system folder that you created and create a folder named "app"
- inside "app" save your current app or fix for an app located inside the system/app folder of your device and save it there.
- then let's go to the META-INF folder
- create this folders "com/google/android" so first create "com" then inside "com" create "google" then inside "google" create "android".
- then inside android you need to create a update-binary file and updater-script file (Don't worry I'll attach the specific files at the bottom.)
- then after putting the two files inside the android folder you need to zip the two folders: system and META-INF
- zip those two together not zipping both of them inside a folder. Highlight the 2 Folders right click and add to archive or compress, choose the zip format.
- after that place it in your sdcard and boot to recovery and flash it.
For Updater Script:
run_program("/sbin/mount", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/umount", "/system");
+FONTS
- first create two types of folder one for "fonts" and one for "META-INF."
- inside "fonts" save your current fonts and save it there.
- then let's go to the META-INF folder
- create this folders "com/google/android" so first create "com" then inside "com" create "google" then inside "google" create "android".
- then inside android you need to create a update-binary file and updater-script file (Don't worry I'll attach the specific files at the bottom.)
- then after putting the two files inside the android folder you need to zip the two folders: fonts and META-INF
- zip those two together not zipping both of them inside a folder. Highlight the 2 Folders right click and add to archive or compress, choose the zip format.
- after that place it in your sdcard and boot to recovery and flash it.
For Updater Script:
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("fonts", "/system/fonts");
run_program("/sbin/busybox", "umount", "/system");
+Kernel
- first create a folder for "META-INF along with the "boot.img" (You will not create a folder for boot.img the only folder you'll create is for META-INF."
- then let's go to the META-INF folder
- create this folders "com/google/android" so first create "com" then inside "com" create "google" then inside "google" create "android".
- inside META-INF along side the "com" folder there should be files such as CERT.SF, CERT.RSA and MANIFEST.MF (Dont worry its included in the files that'll I attach.)
- then inside android you need to create a update-binary file and updater-script file (Don't worry I'll attach the specific files at the bottom.)
- then after putting the two files inside the android folder you need to zip the two files: boot.img and META-INF
- zip those two together not zipping both of them inside a folder. Highlight the 2 files right click and add to archive or compress, choose the zip format.
- after that place it in your sdcard and boot to recovery and flash it.
For Updater Script:
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
set_progress(1.000000);
This updater script is for N4 kernels, as you can see "/dev/block/platform/msm_sdcc.1/by-name/boot" this is for this certain device. If you have another device you should know the command line for that.
+Recovery
- first create a folder for "META-INF along with the "recovery.img" (You will not create a folder for recovery.img the only folder you'll create is for
META-INF.)"
- then let's go to the META-INF folder
- create this folders "com/google/android" so first create "com" then inside "com" create "google" then inside "google" create "android".
- now let's go inside META-INF folder
- then inside android you need to create a update-binary file and updater-script file (Don't worry I'll attach the specific files at the bottom.)
- then after putting the two files inside the android folder you need to zip the two files: recovery.img and META-INF
- zip those two together not zipping both of them inside a folder. Highlight the 2 files right click and add to archive or compress, choose the zip format.
- after that place it in your sdcard and boot to recovery and flash it.
For Updater Script:
assert(package_extract_file("recovery.img", "/tmp/recovery.img"), run_program("/sbin/busybox", "dd", "if=/tmp/recovery.img", "of=/dev/block/platform/msm_sdcc.1/by-name/recovery"), delete("/tmp/recovery.img"));
There you go now go create your own flashable zips!!!
Download for flashable zip folders:
Here
Don't forget to RATE THE THREAD and press the THANKS button!!

Reserved

thanks! i was looking for one of these

Good job, I think it's very helpful for a lot off people
Tapatalk Nexus 4

Wow, been browsing my subscribed threads and landed on this one. Never knew I made a guide like this before. Lol!

Related

[Q] creating task bar

how would i edit the task bar in asopmod rom i searched through google i found nothing can someone plz help
First you need to read up on theming but in short all those png's reside in the system/framework/framework-res.apk. In that apk if you goto res/drawable-hdpi folder you'll see all of the png's that make up the task bar.
You'll need apkManager and a paint program.
Simmons - I was trying to do something similar but was having no luck -
I wanted to pull the 4G icons out of an Evo rom and put them in place of the 3G icons on CM6 - i thought it would be a riot -
I extracted the 4G's and renamed them to their 3G counterparts names and have them saved on my desktop - but I dont know the right way to extract framework-res.apk, then put in my new icons, then, and probably most importantly, zip it back up so it will flash right !
any thoughts?
Simple how to theme.
Vandelay007 said:
Simmons - I was trying to do something similar but was having no luck -
I wanted to pull the 4G icons out of an Evo rom and put them in place of the 3G icons on CM6 - i thought it would be a riot -
I extracted the 4G's and renamed them to their 3G counterparts names and have them saved on my desktop - but I dont know the right way to extract framework-res.apk, then put in my new icons, then, and probably most importantly, zip it back up so it will flash right !
any thoughts?
Click to expand...
Click to collapse
heres the How to
An apk is really just a zip file... apk stands for android package (if i remember correctly). So treat it like a standard zip file.
You'll need apk manager this will allow you to sign zips which makes them flashable. get that here
Now get your favorite Rom and make a folder. In that folder make 2 folders one called packed the other called packed. Take your rom and unzip it in the unpacked folder. and then take the original zip and move it to the packed folder.
Next go into the unpacked folder and nav to system/framework.framework-res.apk take this apk and unzip it in this folder and then make a copy of the apk and move the copy to the packed folder.
Now when you want to make a change to the framework-res.apk use the unpacked as a reference. us the packed as the change dir, you do this by opening but not unzipping the apk you want to change and just dragging the files you are replacing into the apk, this will replace them. You might want to make a a 3rd folder sorta of a master copy if you ever mess up the packed roms.
Now that you have an altered framework-res.apk you can just push it to system/framework folder (i think) and reboot and your changes are in. I never do this since flashable is easier to manage I make a flashable.
A flashable is like a but allot smaller, so d/l one of my themes and take the zip file and place in in a folder next to the packed and unpacked folder call it something like staging. now unzip apk manager into the top dir next to 3 other folders you just made.
Now my theme zip can be renamed to whatever you want your going to use it as a place holder for signing flashable zips. go into the theme zip and delete ever thing in the system folder except the framework folder then go into the frame work folder and delete everything.
Your flashable zip folder should only have a a meta-inf folder and a system folder, the system folder should only have a framework folder. Now drag your altered framework-res.apk into the flashable zip folder you just cleaned out.
Ok now you have to sign it copy that flashable zip to the place-apk-here-for-signing folder, this should have shown up when you unzipped apk manager into the folder the also contains unpacked and packed folders.
Now click on the script.bat and you'll see a bunch of option you can do option 16 to sign your zip. it takes a second or two and the date should get updated on the flashable.zip file in the place-apk-here-for-signing folder.
Now you have your new them ready to install. if your changing something else find the apk and replace framework-res.apk in these instruction and it works the same. note that most app reside in system/app so you next to take that into account.
Edit: Maybe I should have made a new thread.
creating task bar
thanks simmons i will let u know how bad i mess up but yes thanks alot man

[Q] building a rom

I have builded my rom I've zipaligned it and deodexed. I've packed rom with cygwin and tried to flash it via CWM but it won't flash. does anybody knows how to pack a rom?
Not sure if i am understanding you correct .
Rezip and sign a rom i use . signing -zip posted here sorry cannot find the link .
jje
Details
his script has 2 main uses:
1. Modify an update.zip
2. Create an update.zip
For #1 - You just extract the contents of an update.zip into the placehere folder, modify its contents, and run the script stating to create an update.zip
For #2 - So far these are the options i have in there for create the update-script
1. Copy directories
2. Copy files
3. Create Symlinks
4. Delete file
5. Delete directory
6. Flash boot image
7. Set permissions for file
8. Set permissions for directory
New Features in 2.0 :
- Set java heap size / compression level for zip
- New drag/drop mode.
>>> - If you drag a folder onto the script's icon (as in Script.bat) it will compress the contents of the folder into a zip and sign it.
>>> - If u drag a zip onto the script's icon (as in Script.bat) it will sign the zip for you.
So this script guides u as u select each option, and adds the appropriate command to the update-script file. Then u exit that sub-menu and create update.zip
I've fixed it already anyway thanks for help
Sent from my GT-I9000 using XDA Premium App

Tutorial for creating own lock screen for gingerbread

1. Kindly read my post at
http://forum.xda-developers.com/showthread.php?t=1078446
2. Download this file
http://dl.dropbox.com/u/28960469/Lalit lock.zip
3. Download these trial icon files
http://dl.dropbox.com/u/28960469/256x256.rar
4. Download a free tool Paint.net (google...its free for windows).
5. Patience is required only once then onceu r done..u'll remember all on fingertips
- Make two separate folders and copy icon files in one.
- Open the downloaded zip file with winrar and extract the contents to another folder (do not mess around with original zip always make a backup copy)
- In extracted files you will have three folders
data
meta-inf
system
- open system then app u will find htclockscreen.apk ..Extract this file in different place so that u can view it separately.
- when you have extracted htclockscreen.apk (winrar can do it) go to folder htclockscreen.apk>res>drawable-hdpi folder.
6. Now you will see all the icon files used by lockscreen.. And you will easily identify the icons used by me in my lock screen.(screenshots)
7. Now either use your own collection or the demo icons provided by me open each file you want to edit with paint.net and edit the file as per your
requirement and play around with icons as you like.
8. Now u have a new set of icons in drawable-hdpi folder.
9. Important
Open the lalit lock.zip (do not extract jst keep clicking in winrar in sequense
lalit lock.zip>system>app>htclockscreen.apk>res>drawable-hdpi
copy the icons you edited here via drag and drop (do not destroy the directory or file structure)
10. Let it recompile zip if it asks.
11. Do backup and jst shoot ur zip and u will have ur lockscreen
Happy modding

miui lockscreen editing help

hey guys so i found this miui lockscreen that i really like but would like to add some color to the icons so far here is wat i have done downloaded the mtz file
made a new folder inside the folder in my .mtz file i made a copy of my .mtz file and chage the extension to .zip---i extrated the zip file and inside of it theres a previiew folder, a wallpaper folder, description.xml file and a LOCKSCREEN FILE.
ok i made a copy of the LOCKSCREEN FILE and once again add .zip extension to extrated, once extrated theres a advance folder and theme_value.xml
i went inside the advance folder and added color to some icons and all
now im trying to rezip my folder to a .mtz file to be able to install it on my phone any help
Usually, in Lockscreen files, there is "Themes_values" and an "Advanced" folder.
Select the two, right click, then "Add archive...," OK.
Name it "lockscreen" then select ZIP and then "Store" under Archive method.
Then double click the zip and it should open in winrar (depending on which unzipping tool you use), then I double click the "..." folder where you see the lockscreen.zip. rename it, by taking off the extension. Then it should be just a file.
Then select the file, along with the other folders that are in the mtz.
I believe they are Preview, Wallpaper and "description" xml.
Archive those the same way and follow the steps again, except rename it to .mtz.
That's my method.
God! said:
Usually, in Lockscreen files, there is "Themes_values" and an "Advanced" folder.
Select the two, right click, then "Add archive...," OK.
Name it "lockscreen" then select ZIP and then "Store" under Archive method.
Then double click the zip and it should open in winrar (depending on which unzipping tool you use), then I double click the "..." folder where you see the lockscreen.zip. rename it, by taking off the extension. Then it should be just a file.
Then select the file, along with the other folders that are in the mtz.
I believe they are Preview, Wallpaper and "description" xml.
Archive those the same way and follow the steps again, except rename it to .mtz.
That's my method.
Click to expand...
Click to collapse
thanks gonna give it a try and ill post some feedback and see if it works
UPDATE: i got the "themes_value.xml" file and the "advance" folder highlight both of them and right click add to archive change the name to lockscreen selected .zip as the extension and choose "store" as method....now i have my lockscreen.zip folder
i right click "lockscreen.zip" and took of the .zip extension and it became "lockscreen" but when i put my mouse over it on file type is says "winrar zip archive"

[MOD][TEMPLATE] APK-Patcher Lite

APK-Patcher Lite
Flashable Zip Template for Modifying System APKs On-Device
Based on APK-Patcher by @osm0sis​
Information
This is a modified version of APK-Patcher that will delete / inject files into System APK files instead of using a baksmali / apktool method.
The method used here is a similar method used in my ROMs to patch files, where instead of having to have like for example 4 SystemUI files, I only needed to keep the actual files that were changed.
This method could also be used quite easily to apply OTA updates or addons on already pre-modified APK files.
LINK TO GITHUB (STANDARD): https://github.com/djb77/APK-Patcher-Lite
LINK TO GITHUB (MAGISK): https://github.com/djb77/APK-Patcher-Lite_Magisk
Usage
Copy your pre-compiled resource files (including .dex files) to the patch folder, removing the .apk part of the filename (ie: SystemUI)
Create a file in scripts with the same name (ie: SystemUI.sh) if you want to delete any existing files from the APK
Make edits to envvar.sh, and also to extracmd.sh if needed
Properties / Variables (envvar.sh)
banner="";
apklist="";
apkbak=/data/media/0/APK-Backup;
backup=1;
cleanup=1;
banner is the name of your patch zip, usually suggestive of what it does, to be displayed at the beginning of the zip flash. You should include your name/handle here like "by osm0sis @ xda-developers" for credit purposes.
apklist is a string containing the list of APKs to be patched included in the patch zip, separated by spaces between the quotes. Each APK is automatically found recursively in /system, then copied to the working directory to be decompiled and acted on, then copied back to /system.
apkbak is the location to place backups of the untouched APKs in apklist if backup=1 is set.
backup=1 will store backups of the untouched APKs in the location specified in apkbak.
cleanup=0 will keep the zip from removing it's working directory in /tmp/apkpatcher - this can be useful if trying to debug in adb shell whether the patches worked correctly. cleanup=1 is necessary on multi-APK patching zips, so it's recommended each APK to be patched be tested on their own with cleanup=0 before combining into a single zip.
envvar.sh
Modify the envvar.sh to add your banner, apklist, backup and cleanup options
Multiple files can be patched, put a space between the filenames (ie: apklist="file1.apk file2.apk"
extracmd.sh
Modify the extracmd.sh to add any additional commands to be performed at the end of the patching process that aren't patch-related (/data file changes,
scripts/$apkname.sh
fileremove="";
$apkname is the name of the folder that you put your resources files in. Copy scripts_sample.sh and rename it to your APK (ie: SystemUI.sh)
Multiple files can be deleted, put a space between the paths (ie: fileremove="/res/drawable/file1.png /res/drawable/file1.png"
For me returned error bellow
Code:
local entry crc does not match

Categories

Resources