[Q] How to create an flashable .zip file - HD2 Android Q&A, Help & Troubleshooting and Genera

Hello all,
I am looking for a good comprehensive guide to creating my own .zip files to flash certain changes I like to make when flashing a rom or just adding files.
Now I have found a few good guides here on XDA but they seem to no longer apply as the update script needs to be in edify and not amend. This is the issue I am having so if anyone can point me to a walk through that explains this type of thing I would appreciate it.

Anyone?

lol, i dont think developers/people-with-knowledge would go into a Q&A sub-forum .
I'm neither on of them, however here is my would-be-successful attempt p) :
1- Make all your modifications and finalize them, the root folder must be /system/ .
2- use apktool to recompile as an apk (apktool b system)
3- sign that .apk.
4- rename extension to zip and violla
theoretically, it should work.

Not shure if this can help you, but i created a zip (original Script is from dungphp) to replace files on my device from CWM:
http://forum.xda-developers.com/showthread.php?t=1241244

Related

Looking for a tutorial: how to cook a ROM?

I'm looking for a guide which tells how to make a own custom ROM from another one
I mean:
1. How to add/replace/remove apps in /system/app/?
1. a) Do they need to have special permission?
2. How to replace boot screen?
3. How to add custom kernel?
4. How to add Desire lockscreen/flip clock?
5. How to add transparent notofication area?
6. How to add Power menu?
I've been serching forum, but didn't find such tutorial. Would be very thanful to get this knowledge.
I think that will be very useful for maaaany android maniacs
1. Simple delete/copy apks in .zip file using 7-Zip or any other.
2. I belive you need to put bootanimation.zip in /data/local/ folder.
3. Idk
4. For Desire lockscreen you need edited HtcLockScreen.apk; for flip clock - HtcClockWidget.apk
5. Edited /system/framework-res.apk or /system/framework/com.htc.resources.apk. I'm not sure
6. You need edited /system/framework/android.policy.jar
69. Resign your zip file using Auto Sign
Attachment doesn't load, but I know about resigning ROM after everything is done
Ad. 1. As I thought, but do the need special permissions? And I also wonder one thing. Are they installed while flashing? Cuz they need to be in system registry, I think...
I have found this: http://wiki.android.com.pl/wiki/Kon...iana_instalowanych_aplikacji_razem_z_systemem
No any permissions etc.
Found this, too. Thanks.
to add a custom kernel you have to unpack the boot image and edit the ramdisk manually, although i think there is an option in dsixda's kitchen to unpack and repack the boot.img
I've got two more questions:
1. When signing, three files are created in folder META-INF: CERT.RSA, CERT.SF, MANIFEST.SF. But in other packages I see also com/google/android/update-script in META-INF. How to make it? Is it necessary?
2. If I want to make only flashable update file which changes one app or another file, eg. framework-res.apk, I have to create folder structure: system/framework/framework-res.apk, add it to zip archive (no compression?) and sing using Auto-sing. Am I right?
Edit:
Found nice guide there: update-script syntax
tomekk_nt said:
I've got two more questions:
1. When signing, three files are created in folder META-INF: CERT.RSA, CERT.SF, MANIFEST.SF. But in other packages I see also com/google/android/update-script in META-INF. How to make it? Is it necessary?
2. If I want to make only flashable update file which changes one app or another file, eg. framework-res.apk, I have to create folder structure: system/framework/framework-res.apk, add it to zip archive (no compression?) and sing using Auto-sing. Am I right?
Click to expand...
Click to collapse
The most important part of a recovery update zip is the update script. It will tell the recovery what to do. If you want an example of a basic update package, which replaces one file in the /system/framework (although a different one) can found here. Open this and read the META-INF/com/google/android/updater-script (or whatever its called). The syntax is pretty straight forward and I think its easiest to learn from the examples of updater scripts found here on XDA. For the simple case, of only replacing/adding files to the /system partition you can leave the updater script from the above example as is and only change the files under the /system directory in the zip.
Note, that the above example uses the newer upader-script (I hope I am writing this correctly, I am writing from memory) which also has a binary file in the same directory. Some update zips use the older "update-script" lone text script. For these kind of scripts, you can find a guide here.
Personally, I use RA recovery, and for this recovery you need to sign the update zips (last thing you do of course). At least for RA recovery, both the older "update-script" and the newer "updater-script" work fine, so its up to your personal preference which do you prefer.
Thanks. Found a guide you mentioned a couple of minutes ago and read it.
The more I know, the more questions it brings So one more thing. If I'd like to use the newer version of syntax: "updater-script", I need also to put this binary file in this folder. But I create/edit only "updater-script", binary file is the same for all packages, or do I need to edit it, too?
I built a kernel tool long time ago, very easy to use (only for linux)
1: unzip the file, place it where you want it eg your desktop
2: place boot.img in the working directory
3: double-click the menu icon or launch from terminal
4: it creates a new directory named BOOT-EXTRACT,edit what you want in there or change the kernel etc.. and repack it again via the kernel tool
see screenshot. here for those how want the tool >>> http://www.elelinux.se/tools/kernel_tool.zip
Edit: Only for Hero
tomekk_nt said:
Thanks. Found a guide you mentioned a couple of minutes ago and read it.
The more I know, the more questions it brings So one more thing. If I'd like to use the newer version of syntax: "updater-script", I need also to put this binary file in this folder. But I create/edit only "updater-script", binary file is the same for all packages, or do I need to edit it, too?
Click to expand...
Click to collapse
Only the updater-script. The binary is a replacement of the script-interpreter I think, but thats just an assumption.
elelinux said:
I built a kernel tool long time ago, very easy to use (only for linux)
Click to expand...
Click to collapse
And that's a good reason to install newest Ubuntu Thanks!
riemervdzee said:
Only the updater-script. The binary is a replacement of the script-interpreter I think, but thats just an assumption.
Click to expand...
Click to collapse
That's mine assuption, too, but would like to know it for 100%
Edit: I see you use it in your kernel update package. So you write only updater-script and place also update-binary next to it?
LOL, you've got help from every well known hero dev on xda, I'm sure you'll have all the info you need now to start building rom's. Good Luck!
Found an app called Easy Flashable zip Builder on this thread. Will test it soon.
tomekk_nt said:
Found an app called Easy Flashable zip Builder on this thread. Will test it soon.
Click to expand...
Click to collapse
But it is for MS Windows, or saw I wrong ? I have also built a tool to javasign files,but should probably write a manual first,it is easy to use but some dependencies maybe not so easy for a beginner with Linux.
tomekk_nt said:
That's mine assuption, too, but would like to know it for 100%
Edit: I see you use it in your kernel update package. So you write only updater-script and place also update-binary next to it?
Click to expand...
Click to collapse
Correcto

[How To] Create a custom firmware for SmartQ Ten3 T15

These are the steps explaining you how to create a custom firmware based on the SmartQ firmware releases.
Warning : Creating a firmware and changing the files may cause your device to stop working, I won't be held responsible for any damage caused by this.
Creating a firmware file is actually very easy, not much is involved and nothing more than some basic software is required to create the files. If you don't understand the steps below than maybe you shouldn't fiddle around with this and wait for other members to create these.
There is nothing explained here about the flashing itself, as I will create a seperate How-To about that with pictures explaining the steps of the recovery.
Also there is nothing explained about kernel building itself, I have no clue how to do that and I'll leave that up to SmartQ.
Use the instructions below to make your own Firmware file with the software you want in it and make all configuration changes you want.
1. If you haven't already download the latest official firmware from SmartQ.
2. Extract the zip file. You then have 2 files, a Chinese .txt file with the release notes. And a file called "SmartQT15".
3. Rename the file "SmartQT15" to "SmartQT15.zip". Accept any warning about making the file useless, as in fact you are making it useful.
4. Extract the zip file. Then you end up with 4 new folders :
"boot" - This will be the files required for booting the OS. And possibly the recovery.
"data" - The user apps and data are in this folder.
"META-INF" - The certificate SmartQ used is in this folder and also the update script that manages the update process.
"system" - The actual Android OS.Stay clear of the boot folder, unless you are 100% sure about what you are doing, this may cause a bricked device without the possibility to reflash.
Add apps to the app subfolder in the data folder. Make sure if you do add apps to set the permissions in the update script file and make changes accordingly. The data-extra.tar file is extracted during the update process.
In the "META-INF\com\google\android" folder you can find the updater-script file, you can edit this with Notepad++. This file tells the CWM based recovery what to do and in this file the permissions are set for apps. Also is it required to edit this if you want to create a pre-rooted firmware.
Be carefull what to change in the system folder it can cause your OS not to boot, but it should be no problem to revert back to another build that did work previously as you didn't touch the boot folder and the recovery should work normally.
Once you have made all the changes you wanted to do. You follow the steps back.
5. zip the 4 folders backup using Winzip or WinRAR, whatever suits you best (You can use compression, I tried out Fast, Normal, Good compression in WinRAR and the firmware flashed without problems). Make sure you have the 4 folders in the "root" of your zip file. Use for filename "SmartQT15.zip"
6. Rename the "SmartQT15.zip" file to "SmartQT15" and accept any warning again about changing the extension of your file.
You have now created a flashable firmware file for the SmartQ Ten3 T15.
Copy his file to the root of an empty microSD card and follow my How-To about flashing Custom Firmwares.
Don't use the guide to flash original SmartQ firmwares as this won't work, by changing the firmware package you break the firmware signature and the recovery will check for this during flashing.
Signature checking can be disabled though in the recovery as I will explain in the new How-To.
If you have any questions feel free to post below and I'll do my best to answer them, all the above is based on my experience and from what I could find out on the Internet.

[Q] CWM backup-->flashable rom?

I'm a new developer and have applied all my tweaks and edits via root explorer so far. is there a way to change a CWM backup into a flashable rom file for other users to flash? I searched around a bit, but couldn't seem to find anything about it.
Goto this thread here
follow all the setup to install cygwin & kitchen
once it's all setup you can plug your phone in and create a rom
follow the guide (second method) for creating the rom system files by extracting the system folders from your phone (rom you are using)
you can then turn it into a flashable rom zip
I think you just basically extract the CWM backup, then repackage them in 1 zip file (except for the androidsecure backup).
9steele9 said:
I'm a new developer and have applied all my tweaks and edits via root explorer so far. is there a way to change a CWM backup into a flashable rom file for other users to flash? I searched around a bit, but couldn't seem to find anything about it.
Click to expand...
Click to collapse
YOU CAN USE THE CWM BACKUP IN KITCHEN YO MAKE A CUSTOM ROM.BUT YOU CAN'T ABLE TO USE THE BACKUP FILE DIRECTLY AS A CUSTOM ROM.
OTHER HAND YOU CAN MAKE ALSO THIS BACKUP AS A DEODEXED STOCK ROM BY DEODEXING THIS BACKUP FILES.
YOU CAN FIND KICHEN GUIDE HERE-http://forum.xda-developers.com/showthread.php?t=1801690
YOU CAN FIND DEODEXING GUIDE HERE-http://forum.xda-developers.com/showthread.php?t=2230337
PRESS THANKS IF I HAVE A BIT SUCCESS TO HELPING YOU.....:thumbsup:
Hmm thats how i make roms that i dont post here though....
In tthe cwm backup u have system.rfs.tar
Extract it using 7zip
U get system.img or u might get a system folder....
Extract the img file using Magic Iso
Open magic iso
In menu..
File>open
Select ur system.img
On the left side pane right click on the disk icon and click extract.select ur destination
Once the files are all extracted copy all of them in a folder named "system"
Now get a meta-inf folder from a custom rom and zip
Meta-Inf and system folder together
U have ur rom...
Ill create a video tutorial for this tomorrow as many people ask this question in different threads of devices....
Sent from my GT-S5360 using xda app-developers app

how can i install . help me my brothers

my rom is stock odex i used universal deodexer and deodexed my.system/app and system/framework folders . now my question.
how can i install that app and framework folders to my phone ??(i tried replace with root explorer but it does not .(
how can i make thats to a flashable zip?
but
my problem is not that . i can make a flashable zip . its working fine but after i flashed old .odex files doesnt delete. how can i add it to meta inf for when flashing delete app and replace new app and same for framework
No need to create any kind of meta inf you just need to find any flashable zip may be of some kind of theme or update package of your rom if available and just edid it using zarchiver(android) or winrar(windows) simply delete eveything inside the system folder inside the zip except the app folder then delete everything inside app folder then put the apk you want to replace in the app folder. And you are done. Its recommended to sign the zip using apktool(windows) or zipsigner(android) but you can skip this step. Thats about making a flashable zip.
But as far as i know you need to have deodnexed rom to make any changes to system.
Anyways this thread should have been posted in q&a section.

[Guide] 3Min Battery Mod(Step By Step Instructions) using BatchApkTool

Hi guys, i really love the 3Min battery Mod from @gharrington Tyvm bro. There is a lot of threads of how to make it yourself but i think most of them are not too detailed and cover everything. So since i use these instructions my self i thought of sharing them in case someone may benefit from it.
Preparation: :
1. Download the latest BatchApkTool .
2. Tools needed and how to extract System.img.
3. Recommended tools needed: Notepad ++, 7zip or Winrar
Instructions::
A.
1. Download the latest BatchApkTool unzip it and move the need files to their designated folders explained in the next step.
2. We need to get SystemUI folder and framework folder(Inside it Framework_res.apk and arm64 folder is needed) either from a System.img in that case use the guide in the preparation section on how to extract it or import them from your device using any file manager with root.
3. Put SystemUI folder in _priv-app folder, and framework folder in to _framework folder.
B.
Open BatchApkTool select your language make sure that all the settings match your rom, enter the following numbers for changes:
83. Smali(By default it's the latest "2.2 latest when writing this" so just check it in case)
84. Api level: ------------- select 23( for Marshmallow)
85. Apktool(By default it's the latest stable version "it was 2.2.0 when writing this" just make sure it is)
C.
1. Under Smali section select '01 Deodex all apks and jars'(In case your rom isn't deodexed yet if it is skip this step). If your rom is stock then your SystemUi.apk needs to be deodexed for this to work. (For Nexus 6p select Arm64 when asked)
2.Under Smali section select '02' to move the deodexed files to _Input_Apk folder.
*Make a backup of META-INF folder and AndroidManifest.xml after extracting them from the deodexed SystemUI.apk file using Winrar or 7zip.
3.Under ApkTool section select '1' to decompile Apks.
4. After that go to _Input_Apk folder and open the decompiled SystemUI folder, navigate to res/layout/system_icons.xml and open with notepad ++
5. Find:
Code:
android:layout_width="9.5dip"
and
Code:
android:layout_height="14.5dip"
Note: These values may not be an exact match, doesn't matter
Change both values to
Code:
android:layout_width="0.0dip"
and
Code:
android:layout_height="0.0dip"
6. Hit enter and directly underneath that line add the following:
Code:
<com.android.systemui.statusbar.policy.MinitBattery android:layout_width="wrap_content" android:layout_height="wrap_content" />
7. Save your work and close notepad ++
8. You now need to navigate to smali/com/android/systemui/statusbar/policy folder
** Download the latest Modfiles package(3MinitBatterySettings, MinitBatteryResources, 3 Smali files) needed from here or main website.
9. Copy the 3 smali files(files that end with .smali) into that policy folder.
10. Time to recompile the SystemUI.apk. Under ApkTool section select '3 recompile apks' in Batchapktool.
11. Once recompiling of SystemUI.apk is complete go to it in _OUT_APK you will find it there, open it with 7zip or Winrar and Don't Extract.
12. Delete META-INF folder and AndroidManifest.xml from newly recompiled SystemUI.apk and replace them with the original backup we took in step C.2.
13. Download the 3MinitBattery_Template1.zip(will remove original SystemUi.apk and replace it) or 3Minit_Battery_Template2.zip(Will not remove the original SystemUi.apk and will leave it for you to remove it manually in case you want to back it up).
14. Use one of the template zips then open it don't extract it just open it with Winrar or 7zip and drop 3MinitBatterySettings, MinitBatteryResources that we got in step C.8 to their respective folders in the zip file. Drop the newly recompiled SystemUI.apk to SystemUI folder if you choose template 1 and if you choose template 2 put it in priv-app folder.
P.s: If you choose template 2 after flashing it go to system/priv-app/SystemUI folder in your device and with any file manger with root delete SystemUi.apk after you back it up to where ever you choose then reboot the device.
15. After this make a backup of your rom and flash the zip.
16. To use 3minBattery app open it and choose your customization then reboot you should see the changes after that. Good luck! :good:
Credits go to:
- @gharrington for his Mod&Guide.
- bursoft for Batch ApkTool.
- @bdorr1105 for his Thread.
- https://androidmtk.com for the Guide&Tools.
Awesome tutorial.. I am looking to add it into a modified stock rom for a Samsung tablet that I have.. Do you know of any easy to follow tutorials for that? i am very new to this part of android..lol.. i am usually on the flashing end and now i am trying to help out for this tab because it has no custom roms until mine. Again, awesome tutorial.
glockman4519 said:
Awesome tutorial.. I am looking to add it into a modified stock rom for a Samsung tablet that I have.. Do you know of any easy to follow tutorials for that? i am very new to this part of android..lol.. i am usually on the flashing end and now i am trying to help out for this tab because it has no custom roms until mine. Again, awesome tutorial.
Click to expand...
Click to collapse
Ty much appreciated. It has been a while since I created this thread since then I have stopped using this mod because it's kind of a headache to do it for every update add to that since Google already enabled the battery percentage inside the battery there was no need any more for the mod. Anyway it's still great to be able to change from time to time. Regarding the tutorial I am sorry to say I haven't tried to create a custom ROM so I can't help you much with that but I am sure there are a lot of tutorials but will require some time to search. Good luck with your project.

Categories

Resources