[Huawei Ideos X6] CacingKalung:
Lets discuss about ROM port guidance for dummies like me. Hope it will help others also who want to port it.

Here is my experience for porting several MIUI in my phone, shall other to make it perfect.

First we must have a source rom to port. Desire HD is my chosen since it has some similar hardware.

I replace the source rom using several files from the previous working MIUI rom.

I never mix framework with any other files from previous miui version, I just patch framework.jar and services.jar (decompile and recompile). And for system app files I let them as is, except for torch.apk taken from 1.11.11 and systemUI.apk with manual patch (decompile and recompile).

I use the same driver modules files in every my port (wifi, sensor, light, gps), the rest drivers are compiled in the kernel so we can't touch them except if we can build from source. I use almost the same library in every port. ( You can see the same files from my 2.2.3 and my 2.3.9)

The other files are came from the source dhd rom and additional apps taken from other rom or any mod as long as they're not accessing the hardware directly.

And for the kernel, lately I use SDKernel and mOCK kernel. I've modified both boot image of them. At 2.3.9 as you knew, I use modded SDKernel, I've change default cpu clock and also bringing up the fm radio service in it. And for my current miui (2.3.16) I'm using mOCK kernel, I've change the default cpu clock also, but not bringing up fm service (since I've not succeded yet using FM radio).

Here are some files I don't use from source rom (replace by following files):

- Torch.apk

- hciattach

- netd

- wpa_supplicant

- liba2dp

- libc****

- libcamera

- libcamera_service

- libffmpeg

- libgemini

- libhardware_legacy

- libmmipl

- libmmjpeg

- liboemcamera

- libril

- librpc

- libskia

- libwebcore

- vold

- vold.stab

- btwlancoex

- compassd

- geomagneticd

hci_qcomm_init

hostapd

hostapd_cli

lightd

load_wifi

modempre

netmgrd

nt_password_hash

oem_rpc_svc

orientationd

port-bridge

proximityd

pwgen

qmuxd

rmt_oeminfo

zipalign

all files from system/etc/firmware/wlan

some files in init.d script, I use just hostapd, tweak sdcard read and zipalign. The rest setting I let the default config.

init.qcom.xxx

loca_parameter.ini

wpa_supplicant.conf

all files from /system/lib/hw and /system/lib/modules from previous port ( taken from 1.11.11 and triumph if I'm not wrong... not exactly remembered)

libaudio***

libauth

libcm

libcommondefs

libdiag

libdll

libdsi_netctrl

libdsm

libdsmutils

libgsd**

libidl

libloc***

libmmgsdilib

libnetmgr

libnv

liboem_rapi

liboncrpc

libOpenVG

libpbmlib

libposteffect

libqdp

libqmi

libqueue

libreference-ril

libril***

libwms**

and also all file in /system/usr/keychars and /system/usr/keylayout

If I'll change kernel, then I'll change wifi lib also which work with it.

And add some addons... not related to the core.

wpa_supplicant.conf, gps.conf, build.prop are changed as needed

I think those files are sufficient to make a new port...

Tools to decompile and recompile apk and jar files is apktool, you can use apkmultitool from apkmultitool.com.

How to fix headset:

Decompile services.jar, use this command line;

apktool d services.jar

You'll find services.jar.out folder as output. Find HeadsetObserver.smali file and replace any "h2w" word with "headset_sensor". Use notepad++ to do it. And recompile using this command line:

apktool b services.jar.out

Find the new compiled file at services.jar.out/dist folder.

How to fix native wifi tether and haptic feedback:

The file need to modify is framework-res.apk. You can do the same to decompile and recompile just like fixing headset. Decompile the file and find array.xml in framework-res.out/res/values. Find "wl.0" replace with "softap.*". You'll easily find the level values pattern for haptic feedback in the same file. The pattern values is "off,on,off,on" format to turn off and turn on vibrate in milisecond. Recompile again.

The new compiled file can not be used yet, you should restore the META-INF folder and AndroidManifest file from the original framework-res.apk file. Use 7zip application to open both old and new framework-res.apk and drag META-INF folder and AndroidManifest file to the new compiled framework-res.apk then it ready to use.

Happy porting......!!!

I'll update this post if there are some more useful...

Any suggestion are welcome...