Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
CosmicDan
Old
(Last edited by CosmicDan; 4th July 2012 at 02:28 AM.)
#1  
CosmicDan's Avatar
Senior Member - OP
Thanks Meter 3674
Posts: 3,938
Join Date: Jun 2009
Location: Central Coast

 
DONATE TO ME
Default [KITCHEN][WIN][GUIDE][MIUI] CosmicUI Kitchen (MIUI 2.4.20 on FXP)

Introduction

Here I am releasing the kitchen and a lengthy guide on what makes it special, how it works, et cetera; as my goodbye gift to the X10 forum as I want to keep this knowledge open so others might be able to help. Please be aware that this is not for newbies, I hope that other people still building custom ROM's for X10 will put my research to good use. It is directly (but heavily modified and enhanced) based on the script by erenz1202 and probably has additional credits, I don't know. His original thread is here for your reference.

I hope to keep this kitchen/guide a progressive effort, I will do my best to keep this thread maintained with the help of all contributors. If you have any questions, don't hesitate to ask! But if you're a newbie and don't know anything about development, please don't spam the thread with silly questions... I don't have the time to teach someone how to use a computer

This thread is under construction, I did rush writing it. Please post your suggestions for sections/updates/anything in this thread. I would love to see a good "Team-XDA" effort

If any other MIUI ROM builders want to take my sh!t and use it in their ROM, I really don't care so go for it. LOL. Credit would be nice but I wouldn't be surprised if you don't. But I really hope this doesn't cause a bunch of people to release ROM's based on this MIUI with no real GOOD changes without sharing the knowledge here, the X10 Dev forum is already enough of a popularity-contest



Notable Features

- Automatic APK/JAR injection subroutines (see below for details)
- Full logging of the build script/process
- Unique tweaks/hacks not present in any other MIUI ROM, fully documented and explained (see below for details)



Requirements

- Windows Vista/7 required (Windows XP cannot handle this advanced batch file)
- Java Runtime Environment
- Above-average knowledge of batch files, XML, smali



Downloads

You can find all relevant downloads, including old versions of CosmicUI, in my Mediafire folder - the important stuff is in the 'Kitchen' subfolder.

http://www.mediafire.com/?ksvtupinjw8nd

- Kitchen update for v0.6.x is also added. You still need to original kitchen, download the update ZIP and extract it to your kitchen folder (overwrite all) to update it. The new version brings a pre-build script to inject language files, and also a post-build script to PNG Optimize/zipalign/recompress JAR's and APK's.

Also included as a separate download is a self-extracting EXE of MIUI 2.4.20 for Incredible S (from MIUI UK i.e. miuiandroid.com), which Cosmic UI was based on. FXP-CM7 is not included, you will need download that from the OT too.



Instruction/Guide

Unpack the kitchen.zip archive to a new folder on your Windows Vista/7 PC. Doesn't matter where, just as long as you have full administration rights (and run the batch file as administrator if you have UAC enabled). Here is an explanation of the kitchen contents:

base_cm7source
- Extract FXP-CM7 files here. CosmicUI v0.5 uses FXP-124. Use the /system contents of the flashable ZIP, not the system subfolder (i.e. this is valid - .\base_cm7source\build.prop)
base_miui
- Extract MIUI files here. Note that this folder is modified with every build, I have created a self-extracting EXE of MIUI 2.4.20 for Incredible S from miuiandroid.com and uploaded it to the mediafire folder. Place this in the root kitchen folder and run it if you need to unpack again, it will extract to the base_miui folder. Open the EXE with WinRAR (or 7-Zip) if you want to inspect it. If you want an original ZIP of MIUI 2.4.20 for various devices, check the page here for direct downloads.
base_postmods
- Precompiled stuff for the MIUI build, either replacing original MIUI/FXP files or completely new. Some is unique to CosmicUI, details in next section.
base_postmods_inject
- Source files for automated JAR/APK injection functions, with a specific folder structure and details of each modification included. Details in next section.
base_postmods_inject_obsolete
- As above, but these are no longer used (and excluded from the build script). They were either for older versions of CosmicUI or only ever used in my test builds.
base_postmods_special
- Special injections for use with my automated mods/scripts in CosmicUI, currently used for building Extended Settings APK/JAR and HW-LED fixed framework APK. The build script will show that these injections are not automated like the base_postmods_inject folder.
base_tool
- All the dependencies and tools used for the build script. Includes 7z binary, aapt, apktool and package-signing jar's. Note that I use APKTool for jar files instead of smali/baksmali, because APK tool has some fixes that the original (bak)smali doesn't. So if you manually decompile APK's/JAR's, you will need to use Apktool v1.4.3 to keep smali/xml compatibility with the mods in this kitchen (you will get compile errors if you mix decompiled files from different versions). This folder also contains a custom 'usr' folder from the original kitchen, I never updated it and it is still used by the build script.
CosmicUI Modpack (obsolete since 0.4)
- Just an extracted Flashable-ZIP of the old Modpack for 0.3 (pre-Aroma). Don't use it on new versions
CosmicUI-FixPermissions
- Just an extracted Flashable-ZIP of a little updater-script that fixes all permissions on /system partition, useful when pushing new files via adb in CWR without having to chmod/chown. I originally made it to save time but it's a bit redundant if you use my modified kCernel-v01 since it boots directly to TouchRecovery (which has Fix Permissions in the menu).
CosmicUI-kernel-kCernel_v01
- Just an extracted Flashable-ZIP of my modified kCernel v01. Only differences are (a) the boot graphic and (b) Boot Menu removed and only uses Touch Recovery (saves time).
CosmicUI-v0.4.01.122
CosmicUI-v0.5.01.124
- Templates for CWM-flashable ZIP after building. Move the system folder into this folder, ZIP the contents and flash. Includes all the Aroma install stuff.
~build.bat
- The main magic. This batch file is well commented and has a lot of experimental stuff commented-out. Take a look. If it makes no sense to you at all, you're not experienced enough to use a kitchen! But feel free to ask specific questions about it
~build.txt
- This is the log file (new one created every time) when running the above script. Good for checking errors with the build, especially with APK Tool (de)compiling or missing files. Pretty fancy stuff there!

How to do a quick build to make CosmicUI v0.5.x?
1) Extract contents of FXP-124 .\system\ to base_cm7source
2) Extract MIUIandroid.com's 2.4.20 for Incredible S contents of .\system\ to base_miui
3) Run the ~build.bat file (yes, it takes a while - the JAR/APK injection mainly)
4) Move the new created .\system\ folder to the flashable-CWM ZIP template folder (e.g., .\CosmicUI-v0.5.01.124\)
5) ZIP up the contents of the template folder you used above, and install the update in CWR.



About base_postmods_inject

Inside the folder you will see two others, app and framework - this is pretty self explanatory. If we go inside framework for example, we will see three folders and three files:

framework.jar [folder]
framework-res.apk [folder]
services.jar [folder]
framework.txt
framework-res.txt
services.txt

Let's take a look at framework.jar. The txt file for it just explains what is in there, it's not used in the build script but is for your info. In this case, it details the changed files used for patching-in some WebKit and Net code to eliminate the need for the 2048 read_ahead_kb tweak that most other MIUI ROM's for X10 need to prevent the WLOD's. Anyway, inside the folder is a smali folder - it follows the same directory tree of the original decompiled package (remember - with apktool 1.4.3), but with only the changes necessary for the patch. [FYI, The 'build' folder is re-created with every build, designed to be a cached-compile to speed the build process but it doesnt work right - probably because of changed timestamps. Don't worry about it.]

Anyway, you could use a program like WinMerge to examine the differences of the changed files and find the patches I made. In the case of framework.jar there is a problem with battery drain in the \net\ code (I think), it's a fairly dirty hack that might put the system_server in a constant loop. I don't know. Anyway, that's everything explained about the apk/jar injection feature. I think. If you want to mod another .apk or .jar, remember to compare your changes to the original and then - following the directory tree of existing injection mods as a template - make new folders and move the modified files there.


UNDER CONSTRUCTION, NOT FINISHED. Ideas/suggestions welcome! Peace

XtreamerMobile Developer


My GitHub | My Apps on AppBrain


Goodbye Xperia 2011 scene - on to greater things

Current Community Projects:
Turbo Tools - Developer Preview soon

The Following 19 Users Say Thank You to CosmicDan For This Useful Post: [ Click to Expand ]
 
mcsqwizzys98
Old
#2  
mcsqwizzys98's Avatar
Recognized Contributor
Thanks Meter 1270
Posts: 2,150
Join Date: Nov 2011
Location: kelowna

 
DONATE TO ME
This seems awesome!!!! thanks alot!!
Phone: Xperia T
Rom: Xperia JB
My Work: NA yet
Kernel~ NA
 
z28tovette
Old
#3  
z28tovette's Avatar
Senior Member
Thanks Meter 473
Posts: 823
Join Date: Dec 2011
Location: San Diego,Ca
wow, this is beyond generous....thank you very much.

Sent from my Desire HD using xda premium
 
psycmos
Old
#4  
psycmos's Avatar
Senior Member
Thanks Meter 88
Posts: 285
Join Date: Aug 2011
Location: Mirandela
Tnkz a LOT!!!!!!
THL W5 SN:...M0SBX...
Root THL W5 Android 4.0.4 Thanks a lot for Bin4ry and joebit to shared this info
UNOFFICIAL ROMS with ROOT/CWM/Internal Memory fix By Verevka :
[BASED ON OFFICIAL ROM 4.1.2 FULL]:LINK
[MIUI ROM V4]: LINK
[LEWA ROM V4,1]: LINK
PS: This roms starts in Russ but is easy to change it to ENG(System and A icon)
 
CosmicDan
Old
(Last edited by CosmicDan; 22nd June 2012 at 03:12 AM.)
#5  
CosmicDan's Avatar
Senior Member - OP
Thanks Meter 3674
Posts: 3,938
Join Date: Jun 2009
Location: Central Coast

 
DONATE TO ME
I'll still be working on this, I'm not getting rid of my X10 yet. Current priorities:

(1) Get latest MIUI Camera working
(2) Fix battery drain when data enabled
(3) Make it multilanguage
(4) What else? Ideas welcome.

I am also considering downgrading the MIUI version. The current 2.4.20 was never "stable", it was a development release from Xaomi. MIUI 2.3.7 was the last "stable" MIUI Gingerbread release. I don't know the difference between 2.3.7 and 2.4.20 though, does anyone know?

XtreamerMobile Developer


My GitHub | My Apps on AppBrain


Goodbye Xperia 2011 scene - on to greater things

Current Community Projects:
Turbo Tools - Developer Preview soon

The Following 3 Users Say Thank You to CosmicDan For This Useful Post: [ Click to Expand ]
 
sparxx4
Old
#6  
sparxx4's Avatar
Senior Member
Thanks Meter 135
Posts: 1,060
Join Date: Apr 2011
Location: Somewhere
Dan if you update the rom so update miui version :P not get back to 2.3.7 ( just kidding )

while im looking on miuis thread i'v seen 2.5.11 ( camera updated )
and 2.5.25 i think its more stable than the 2.6.8 version ( that what i see )
so why not to update to a new miui ??
Hit me a thanks if i helped you
 
CosmicDan
Old
#7  
CosmicDan's Avatar
Senior Member - OP
Thanks Meter 3674
Posts: 3,938
Join Date: Jun 2009
Location: Central Coast

 
DONATE TO ME
Quote:
Originally Posted by sparxx4 View Post
Dan if you update the rom so update miui version :P not get back to 2.3.7 ( just kidding )

while im looking on miuis thread i'v seen 2.5.11 ( camera updated )
and 2.5.25 i think its more stable than the 2.6.8 version ( that what i see )
so why not to update to a new miui ??
Sorry, don't know how I missed this reply lol. Well MIUI 2.3.7 is the last stable gingerbread release of MIUI. 2.4.20 was only ever a development release. So I think there may be some bugs in 2.4.20 (but I can't find anything).

MIUI 2.5 and onwards are only for ICS sadly. I do plan to work on MIUI for ICS in some time, but there are already a heap of X10 MIUI ROM's for ICS and MIUI4 is still beta and many things will change.

Looking at the official MIUI download page, they say Latest Version is 2.6.1. But the latest Gingerbread release is 2.3.7c (e.g. for Desire).

And then in the development downloads, the last one listed for Gingerbread is only 2.4.13.

I have dug around for newer MIUI versions for Gingerbread, I am 99% sure that 2.4.20 is the last one. The best I can do is work on porting over some of the newer apps from MiCode project Gingerbread-branch (open-source MIUI repo) because those apps might have some new updates and fixes.

XtreamerMobile Developer


My GitHub | My Apps on AppBrain


Goodbye Xperia 2011 scene - on to greater things

Current Community Projects:
Turbo Tools - Developer Preview soon

The Following User Says Thank You to CosmicDan For This Useful Post: [ Click to Expand ]
 
CosmicDan
Old
#8  
CosmicDan's Avatar
Senior Member - OP
Thanks Meter 3674
Posts: 3,938
Join Date: Jun 2009
Location: Central Coast

 
DONATE TO ME
v0.6 kitchen update added to the folder.

Quote:
- Kitchen update for v0.6.x is also added. You still need to original kitchen, download the update ZIP and extract it to your kitchen folder (overwrite all) to update it. The new version brings a pre-build script to inject language files, and also a post-build script to PNG Optimize/zipalign/recompress JAR's and APK's.

XtreamerMobile Developer


My GitHub | My Apps on AppBrain


Goodbye Xperia 2011 scene - on to greater things

Current Community Projects:
Turbo Tools - Developer Preview soon

The Following User Says Thank You to CosmicDan For This Useful Post: [ Click to Expand ]
 
sparxx4
Old
(Last edited by sparxx4; 16th July 2012 at 02:41 PM.)
#9  
sparxx4's Avatar
Senior Member
Thanks Meter 135
Posts: 1,060
Join Date: Apr 2011
Location: Somewhere
i dont know what im doing ,,,but im trying
Dan on your kitchen you use Incredible s miui rom
but erenz use nexus 1 miui rom
so what the different ?
Hit me a thanks if i helped you
 
Superman
Old
#10  
Superman's Avatar
Senior Member
Thanks Meter 154
Posts: 522
Join Date: May 2012
Any screenshot?? Interesting

Sent from my X10i using xda premium
Using Whatsapp+ by rafalense?
Come and look for themes by me & iExitus

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...