[TUTORIAL] Extract Kernel from ROM - Optimus One, P500, V General

This simple tutorial is so easy and powerful
This Tutorial is made from me and it has the Copyright!
1) put the ROM from which you want to extract the kernel into original_update folder (C: \ cygwin \ home \ username \ etc..)
2) Run Cygwin and go into the kitchen
3) Select option 1 and select the ROM you want to extract the kernel
4) Option 20 (boot image tools) and choose w
5) Go into BOOT EXTRACTED folder and take the zImage file
6) Now go to WORKING_NameProject / system / lib / modules and copy all files inside.
7) Take a zip of another kernel and switch the components
DONE!
Easy no?

Related

How to: Create Clockwork Recovery flash files

I have a shutdown sequence and some sounds I would like to turn in to a flashable .zip file. I checked out the CW forums, but that was more painful than informative. I have taken a look at some of the zip files I have found so far, but am not 100% sure about what I'm doing. Can anyone point me to a how-to or even in the general direction of some information to get me started?
Thanks guys!
Edit: Those interested can find all the information needed in the3dman's post and here:
http://www.londatiga.net/it/how-to-create-android-update-zip-package/
http://www.londatiga.net/general/how-to-sign-apk-zip-files/
I'd copy this guy
http://forum.xda-developers.com/showthread.php?t=795459
Thanks for the link. I had actually started there, and it's a great template if I just want to throw in my own files, but I was really looking for a how to so that I had more options for customizing, rather than being stuck with only the shutdown / startup sequence.
Sent from my SGH-T959 using XDA App
First you have to have your folder structure like this in the zip:
Main .zip
{
META-INF { com -> google -> android -> update-script } ( <- these are folders inside the META-INF except update-script this is a script file)
app (if the file you want to flash is an app it goes in this folder)
framework (if the file you want to flash is a framework file it goes in this folder)
system (if the file you want to flash is a system file (start up animations) it goes in this folder also make sure you put the correct subfolder inside this folder ie: if your file goes in system -> media make sure you put the file you wish to flash in a correctly named subfolder other wise it will flash into just the system folder and not into the correct folder within the system folder on your phone.)
}
After your folder structure is set up you must tell clockwork which folder or folders in the zip to flash. To do this open the update-script from the zip with a text editor and modify or add these lines with the correct folders.
copy_dir PACKAGE:framework SYSTEM:framework (use this for the framework folder)
copy_dir PACKAGE:app SYSTEM:app (use this for the app folder)
copy_dir PACKAGE:system SYSTEM:system (use this for the system folder)
Then sign your zip and flash.
Below is a picture of an example folder structure so show what I mean. Also I attached a zip with an example update-script in it.
the3dman said:
First you have to have your folder structure like this in the zip:
Main .zip
{
META-INF { com -> google -> android -> update-script } ( <- these are folders inside the META-INF except update-script this is a script file)
app (if the file you want to flash is an app it goes in this folder)
framework (if the file you want to flash is a framework file it goes in this folder)
system (if the file you want to flash is a system file (start up animations) it goes in this folder also make sure you put the correct subfolder inside this folder ie: if your file goes in system -> media make sure you put the file you wish to flash in a correctly named subfolder other wise it will flash into just the system folder and not into the correct folder within the system folder on your phone.)
}
After your folder structure is set up you must tell clockwork which folder or folders in the zip to flash. To do this open the update-script from the zip with a text editor and modify or add these lines with the correct folders.
copy_dir PACKAGE:framework SYSTEM:framework (use this for the framework folder)
copy_dir PACKAGE:app SYSTEM:app (use this for the app folder)
copy_dir PACKAGE:system SYSTEM:system (use this for the system folder)
Then sign your zip and flash.
Below is a picture of an example folder structure so show what I mean. Also I attached a zip with an example update-script in it.
Click to expand...
Click to collapse
Thank you very much! This was PERFECT for getting me started! This lead me to the following sites for more information on how-to's and even all the available syntax. For anyone looking to get into this (it's not difficult), check out these pages:
http://www.londatiga.net/general/how-to-sign-apk-zip-files/
http://www.londatiga.net/it/how-to-create-android-update-zip-package/

[Q] boot loop after arabic framework.jar

HI
I was running CF-Root-sgs2_XX_OXIKG3-v4.1
then through cwmv4.0.0.2
I have generated a zip file by doing
"Pull /system/framework/framework.jar from your phone and place it in the subfolder framework that you extracted in step 1
If you’re not using a CyanogenMod ROM, then you’ll also need to pull /system/lib/libandroid_runtime.so from your phone and place it in subfolder libandroid_runtime that you extracted in step 1
Double click on commands.exe. Do not close the black cmd screens that will pop up. Once the patch is done, you should get a patched framework.jar in the subfolder generated"
this is for making arabic framework.jar
the files I have pulled were from a super core_1 Kernel with Darkyrom2
then i have changed to CF-Root-sgs2_XX_OXIKG3-v4.1 kernel with cognition_S2-131
I went to cwmv4.0.0.2 and installed the zip file
boot loop happened
how can I fix it
thanks
"1-Download the patch below and extract it to a folder on your computer.
2-Pull /system/framework/framework.jar from your phone and place it in the subfolder framework that you extracted in step 1
3-If you’re not using a CyanogenMod ROM, then you’ll also need to pull /system/lib/libandroid_runtime.so from your phone and place it in subfolder libandroid_runtime that you extracted in step 1
4-Double click on commands.exe. Do not close the black cmd screens that will pop up. Once the patch is done, you should get a patched framework.jar in the subfolder generated
5-Version 0.800 provides a recovery flashable file in folder generated. Place that on your sdcard, reboot into recovery and flash it. If the flashing through recovery didn’t work for some reason, you’ll need to do the following manually:
-Put file generated/framework.jar in your phone at /system/framework/
-Put file generated/libandroid_runtime.so in your phone at /system/lib/ (if this file exists, it shouldn’t if you’re arabizing CM6).
-Put file REQUIRED-IMPORTANT/libicuuc-arabic.so in your phone at /system/lib/ This is extremely important, failing to place this file will result in a boot loop of your device"

[Resolved][Q] How to modify default.prop in nAa Kernel

Hi All,
Due to specific APP requirement, I need to modify some settings in kernel.
Here are all the settings I need to modify in default.prop:
ro.secure=1
ro.debuggable=0
persist.service.adb.enable=0
Here are the methods I already try:
1. Android Kernel; Kitchen 0.3.1 (http://forum.xda-developers.com/showthread.php?t=1659584)
Fail at extract kernel.sin, cannot found RamDisk
2. dsixda's Android Kitchen 0.224 (http://forum.xda-developers.com/showthread.php?t=633246)
Fail at extract kernel.sin, cannot found RamDisk
3. kernel.sin unpacker by DooMLoRD (http://forum.xda-developers.com/showthread.php?t=1262656)
Fail at extract kernel.sin, cannot found RamDisk
4. Tools in Xperia FlashTool
Fail...
The kernel.sin was extract from 2.6.32.61-nAa-jb-06.ftf. (http://forum.xda-developers.com/showthread.php?t=2136471)
I already start studying how to compile nAa kernel...
Is there any easier way to apply this change?
Thanks!
Resolved.
It's because LZ4 compress format.
Here are the steps to Unpack nAa Kernel / Modify default.prop / Repack Kernel FTF
1. Decompress nAaKernel.ftf
You will got Kernel.sin
2. FlashTool => Tools -> Sin Editor => Select Kernel.sin => Extract data
You will got kernel.elf and kernel.partinfo
3. FlashTool => Tools -> Extrators => Elf => Select kernel.elf => Unpack
You will got kernel.elf.2 and kernel.elf.Image
kernel.elf.2 = ramdisk binary which compressed by LZ4!
kernel.elf.Image = zImage
4. Rename kernel.elf.Image to zImage
5. Rename kernel.elf.2 to ramdisk.lz4 and use LZ4 tools to decompress it
You will got a new ramdisk binary which was known as ramdisk.cpio
6. Rename ramdisk which extracted in step.5 to ramdisk.cpio
7. Copy ramdisk.cpio and zImage to ubuntu system.
8. Extract ramdisk.cpio and you will see default.prop
Make any modify you need.
9. Compress ramdisk folder to ramdisk.cpio
Here are the commands:
find . | cpio -o --format=newc > ramdisk.cpio
10. Compress ramdisk.cpio by GZip
Here is the command:
gzip ramdisk.cpio
11. Use Kernel Kitchen to create kernel.sin
Put ramdisk.cpio.gz and zImage in input folder under Kernel Kitchen.
Create kernel.sin by this tools.
12. FlashTool => Tools => Bundle Creation => select kernel.sin and loader.sin => Create your FTF
13. Flash into your device!
Although Puzzle & Dragons still cannot works on X10 mini with MiniCM10...
But I tried and learned something. :laugh:
thanks for explaining the process
it is very useful for me .
ramdisk.gpio decompress & compress
I tried to follow all steps, but isn´t work for me :'(
What I did:
1) decompress E15_2.6.32.60-nAa-05.ftf with 7z under windows: I get kernel.sin and loader.sin (OK)
2) extract data from kernel.sin with flashtool (0.9.16) under windows: I get kernel.elf and kernel.partinfo (OK)
3) extract elf from kernel.elf with flashtool (0.9.16) under windows: I get kernel.elf.2 & kernel.elf.Image (OK)
4) renamed kernel.elf.2 to ramdisk.lz4, and kernel.elf.Image to zImage; both under windows with f2 (OK)
5) decompress ramdisk.lz4 (3662KB) under windows (fastcompression . blogspot.com . es/p/lz4.html): I get ramdisk (4608KB) (it supposed to be renamed, so I expect it´s ok)
6) renamed ramdisk to ramdisk.cpio under windows with f2 (OK). Copy to ubuntu (QUESTION: zImage is used in ubuntu only in kernel kitchen???)
7) extract ramdisk.cpio (4718592- not command in the post): I used cpio -i -F ramdisk.cpio (9216 blocks); 4 new elements> default.prop init (files) android modules (directories)
8) I want to check I can extract & compress ramdisk (and make a "new" kernel), so I don´t do any modification
9) with only those 4 elements in the directory (default.prop init (files) android modules (directories)), I make ramdisk: find . | cpio -o --format=newc > ramdisk.cpio (PROBLEM: alert message "ramdisk.cpio has been increased, 4718080 new bytes has not been copied" other line "27647 blocks")
Original ramdisk.cpio was 4718582, but the new one is 14155264... 3 times more!!! I think the problemis here, but I don´t know how to resolve it
I have done the rest of the manual
10) kernel.sin created with kernel kitchen 0.2.3 under ubuntu (last kitchen version gives me an error, because in despite of choose create kernel.sin from zImage and ramdisk, it tries to do a ftf from kernel -not available- and ramdisk)
11) ftf creation under windows with X10 flashing tool 0.5.0.0 (flashtool 0.9.16 force me to write what device is for, but the cell is blocked, so I cann´t do it) OK
12) I tried to flash it, but it was aborted, so I expect ftf was incorrect
Sorry for wrote all: I thik the problem is extracting and compresing randisk.cpio, but I prefer to write everithing to be sure and be as clear as possible.
Any help will be great!

No Icons after swapping in the system menu root

"Hello all , i post my new guide to change icons without using apktool . This guide is for newbies though other all advance developer may think this useless or may be they known this a very ago.
# Note :-
1) This guide is for all newbies who want to edit there app icons , but dont have apktool or have no knowledge about it .
2) This guide is only applicable for system apps .
3) You should have knoweledge for flashing zips by CWM .
# What is needed ?
1) A must have computer with paint (opptional) [ some phones with Zarchiver app can be used . ]
2) WinRar
3) A flashable zip file supplied by other developer .
4) A icon Set which you want to replace with .
# Procedure :-
1) Make a directory called " stock " .
2) Paste your app in it .
3) Below i have taken SystemUI.apk.
4) Rename that app to SystemUI.zip ( just make .apk to .zip format )
5) Then go to options (press right mouse button) press Extract to SystemUI
6) After extracting go to the extracted folder " SystemUI"
7) Browse to res / drawable-mdpi / you will find all icons there . ( In my case its mdpi , it may be hpdi .)
8) Note that the resolution must be same or it may not look good . [ Expiremental ]
9) Replace the icon which you want to from your icon set .
10) Go back to folder where you will find folders like META-INF , res , & files like AndroidManifest.xml , classes.dex, resources.arsc .
11) Now select that all files and press the right button of the mouse ( the options button) .
12) Select the Add to Archive option .
13) Now keep the same name of the app you are modding and select " zip " .
14) A new zip file is created like " SystemUI.zip" . Rename it to SystemUI.apk ( just from .zip to .apk )
15) Now your modded app is ready .
16) Take the flashable zip provided by other developer .
17) open that zip and replace your file with his . ( in folder system/app/ " replace here ." )
18) Save the zip . And Flash it using CWM !!! Enjoy now you can see your modded icons .!! "
Hello, I do everything according to the manual, but after replacing the app and restart your tablet app disappears from the main mena on the tablet, what I'm doing wrong?
sorry for my english, thang.

Plugin Descriptions (Donate Version)

Plugin Installation:
Open the Plugin Manager
Choose Install a Plugin
Choose the plugin you want to install
Choose Run a Plugin
Choose the Plugin you want to run
Enjoy!
NOTE: The usage instructions in each plugin description below assume you have already installed it. When the instructions end, that's when you run the plugin from the plugin manager.
SuperR's Kitchen Plugin Descriptions
SuperR Maintained Plugins:
add_placeholder
Only for system-as-root devices
Adds placeholder files to all empty directories in your project
add_remove_files
Add all apk files from a directory
Choose apk to import
Choose directory structure to import
Delete files from your ROM based on directory structure
NOTE: To use "Choose directory structure to import" and "Delete files from your ROM based on directory structure", your directory must be set up as the following example:
Code:
your_directory_name/system/anything_you_want
your_directory_name/vendor/anything_you_want
your_directory_name/cache/anything_you_want
your_directory_name/hidden/anything_you_want
your_directory_name/boot.img
The above is only an example. You can add anything you want as long as there is a "system" directory inside another directory. When choosing the directory, choose your_directory_name instead of system or it won't work. Think of the directory structure exactly like the kitchen project directory. When you import directory structure, your directory will be copied into your project directory and files will be overwritten if they already exist. When you remove a directory structure, you will choose your_directory_name again and the plugin will remove the same files it finds from your project directory.
amlogic_unpack
Unpack Amlogic firmware img
apktools
Choose an apk from your current rom directory.
Decompile the apk.
Build apk.
Sign apk with 3 options (use signapk.jar, copy original META-INF to new apk, or copy new classes.dex and resources.arsc to original apk).
Move apk back to where it came from.
Patch smali using .ptch files
Delete META-INF from all apk files
Delete SEC-INF from all apk files
Separate lib directory from all apk files
Zipalign apk files
aroma_install
Install Aroma in your existing ROM.
Create aroma-config using a menu.
Choose apk files to add to the option menu.
Usage:
Extract your ROM normally using ONLY set_metadata or set_perm.
autorom_config
Creates an AutoROM config file to automate the extraction process and many other tasks.
Currently supports perm type, vendor.img, rom name, custom signature, deodexing, root, su.d, and Busybox
buildprop_add
Adds lines from a file to build.prop.
concatimg
Combines partition_*.img files into a single img file
custom_zip
Create a flashable zip of one or more image files as long as you know the partition name where it should be flashed.
Create a flashable patch zip from directories that have matching fs_config and file_contexts3 files
Convert updater-script to update-binary script for use in the mods_install plugin
Usage:
Copy the partition images and/or directories you want in the zip into a new directory in your project.
In the kitchen main menu, choose Plugin Manager > Run a plugin > custom_zip
Choose the new directory from the list.
For img files in by-name devices, type the partition name from your device where it should be flashed (ex. aboot)
For img files in mmcblk devices, choose your block from the list (add it to the device superr_mmc file if needed first).
decrypt_htc
Decrypt ruu.exe and ruu.zip files stored in your current project directory.
Extract system.img & boot.img to the current project directory for extraction.
Usage:
Copy ruu.exe or ruu.zip to current project directory (ruu.zip must be named exactly ruu.zip).
gapps
Downloads and includes Open Gapps in your ROM.
Choice of aroma, super, stock, full, mini, micro, nano, or pico
Detects Android version and architecture from ROM to download the latest available version for your device.
If there is no ROM, it will allow you to choose Android version and architecture.
Remove gapps if it already exists.
gen_set_metadata
Generates set_metadata lines for every file in project directories that have matching fs_config and file_contexts3 files.
img_tools
Allows rebuilding ext4 img files that have been extracted by the kitchen even if there is not a complete ROM in the project.
Convert sparse img to raw img
Convert raw img to sparse img
Build super.img
Resize img
super.img Build Requirements:
All included img files must be built as sparse.
img file names must be either partition.img or partition_new.img.
super.img size must be in 00_project_files/srk.conf.
Example:
supersize=9437184000
The numeric value in the example above is the raw super.img file size in bytes.
The kitchen adds the super.img size when unpacking a super.img. If the kitchen did not unpack the super.img, you can enter the size in srk.conf manually.
Optional values metadata-size and metadata-slots can also be added to srk.conf. Defaults are listed below:
metadata-size=65536
metadata-slots=2
*This plugin will only work in v3.2.1.0 or higher*
lg_tools
Unpack LG kdz files
Removes rctd, ccmd, and triton from LG boot.img.
mods_install
Add any flashable zip to your ROM that uses an update-binary script instead of a updater-script
Remove mods
Shows the kitchen added mods you currently have installed
ozip_decrypt
Decrypt firmware.ozip files
payload_dump
Unpack payload.bin firmware
rockchip_unpack
Unpack Rockchip firmware img files
samsung_tools
Asks one-by-one if you want to add ro.config.tima=0, ro.config.knox=0, ro.securestorage.knox=false, ro.securestorage.support=false, ro.security.mdpp.ux=Disabled, and wlan.wfd.hdcp=disabled to ramdisk default.prop
Create tar.md5 from all img, mbn, ext4, and bin files in your ROM directory.
Create tar.md5 from all the above except system.img, system.img.ext4, boot.img, and recovery.img
Decode OMC/CSC
Deodex patch for Android 8.1+
Pack *_new.img files to lz4
sepolicy_injector
Converts sepolicy denials into allow rules, and optionally patches seplicy with the new rules.
Paste a denial
Read denials from 00_project_files/logcat.log
unsign_mtk_img
Removes MTK signature from img files
updateapp
Extract firmware.zip that contains UPDATE.APP
Extract img files from UPDATE.APP
Usage:
Place a firmware.zip or UPDATE.APP in your rom directory.
xiaomi_patch
Patches several things in Xiaomi firmware.
Usage:
Extract your firmware with the kitchen, then run the plugin.
xperia_unpack
Unpack Xperia firmware
Choose full firmware zip, an ftf file, or a sin file.
When choosing a sin file, all sin files in the project directory will be unpacked.
Respects the partition_extract_list variable from kitchen/tools/srk.conf
User Contributed Plugins:
None
Custom Plugins
The donate version has plugin support. This means you can integrate your own script into the kitchen. Each plugin must have its own directory inside the kitchen plugin directory, and it must be named the same as the plugin script.
Examples:
/kitchen/tools/plugins/example_bash/example_bash.sh (Linux, Mac)
/kitchen/tools/plugins/example_batch/example_batch.bat (Windows)
You can check the example plugins in the kitchen for more details and use them as templates for your own plugin.
There are 3 variables set in the example plugin to take note of:
bd = /path/to/kitchen
rd = /path/to/kitchen/superr_projectname
plugdir = /path/to/kitchen/tools/plugins/pluginname
NOTE: If you would like to contribute a plugin, please PM a link to the plugin for review.
This post contains the last working versions of all plugins that have lost native Windows support.
If you are running the kitchen in WSL, WSL2, Linux, or Mac you should use the kitchen plugin manager to get the latest versions of these plugins.

Categories

Resources