[Huawei Ideos X6] CacingKalung:
I want to share this to make everyone know how I port it to our device so I shouldn't share it to just one or two people.

It is based on this proxuser thread, credit goes to him. I just make it details and make it work for our device.

We will make MIUIv4 framework to run on top of CM9/AOSP base. So we should prepare CM9 base and MIUIv4 to port. You can use any MIUIv4 to port but you can try by choosing the one which similar hardware with our device.

- Prepare extracted CM9 base rom in folder A, and extracted MIUIv4 rom in folder B. Copy file framework.jar, framework-res.apk and services.jar at /system/framework from CM9 folder save them in folder C. After here, we will port from folder B to folder A.

- Remove folder /system/framework and /system/app in folder A and replace them from folder B.

- Remove /system/app/nfc.apk, since our device don't have this feature.

- Copy all *.db and *.td at /system/etc from B to A.

- replace media folder in /system/media at folder B to folder A.

- copy content-types.properties file to /system/lib from B to A.

- copy miui-framework.xml at etc/permission

- copy /system/xbin/invoke-as and /system/xbin/su from folder B to A

- copy /system/lib/liblbesecs.so from folder B to A

- add this lines to updater-script file in folder B:

set_perm(0, 0, 06755, "/system/xbin/invoke-as");

set_perm(0, 0, 0755, "/system/lib/liblbesec.so");

- change values from build.prop

ro.build.version.incremental=2.x.x (version number of MIUIv4)

ro.config.ringtone=MI.ogg

ro.config.notification_sound=FadeIn.ogg

ro.config.alarm_alert=GoodMorning.ogg

ro.config.sms_received_sound=FadeIn.ogg

ro.config.sms_delivered_sound=MessageComplete.ogg

Test the new port:

Now pack folder B to zip files and sign it and flash it using CWM. You should prepare the other working rom to get back to previous rom :D.

Use adb logcat to debug, and see the result. If it doesn't shown anything, then we should replace libandroid_runtime.so from MIUIv4, but not in my case, I kept it from CM9.

Our device is based on Qualcomm so with our new CM9 theme engine will affected, it will got hung on boot with unresolved at android/content/res/AssetManager. Just break the logcat when it shown some lines with "died" things and scroll up, you'll find it.

So here is the next step which will take more time. You should able to decompile and recompile jar/apk files, Google it for that, it's very easy to do that. We'll go for smaling and baksmaling here. And for comparing, use an application such as winmerge for windows or Meld for linux.

Remember that we have some files in folder C from CM9 and we'll use that as source for smaling steps.

- find /smali/android/content/res/assetManager.smali from framework.jar on Miuiv4 and compare it with the same file from CM9 one, replace all missing lines.

- copy missing method in /smali/android/hardware/Camera.smali

- copy missing method in /smali/android/os/Power.smali, method SetUnstableMemoryState the important one.

- copy /smali/android/server/BluetoothA2dpService*.smali

- copy /smali/android/content/res/PackageRedirectionMap*.smali

- copy /smali/org/codeaurora/Performance.smali

- copy smali/android/media/MediaRecorder*.smali

- copy /smali/android/view/GLES20Canvas*.smali

- copy /smali/android/net/wifi/WifiNative.smali

- copy /smali/android/graphics/paint*.smali

I found them by watching logcat, fixing one by one error on each boot, so now you can save much time by using this guide.

If still stuck, I look for some lines like this:

E/dalvikvm( 234): ERROR: couldn't find native method

E/dalvikvm( 234): Requested: Lxxxxxxx/xxxxxxx/xxxxxxxx;.yyyyyyyyyyyyy:(Z)I

E/JNIHelp ( 234): RegisterNatives failed for 'xxxxxxx/xxxxxxx/xxxxxxxx', aborting

F/libc ( 234): Fatal signal zzzzzz at 0xdeadbaad (code=1)

Then the problem is in xxxxxxx/xxxxxxx/xxxxxxxx.smali file, try to fix it first by adding missing lines in it if possible or copy xxxxxxx/xxxxxxx/xxxxxxxx*.smali if there is so many different lines.

You should see the MIUIv4 lockscreen if you done fixing all those problem.

After this we can fixing anothers, like 2G/3G data and headset.

To fix headset, it's in WiredServiceObserver.smali in framework-res.apk, find the path string which contain "h2w" word with "headset_sensor" word, remember just paths string, no else. It should be 3 words to replace.

Now to fix 2G/3G data,

replace RIL*.smali and copy LGEQualcommRIL*.smali at path

/smali/com/android/internal/telephony ín framework.jar.

You also need to patch PhoneFactory.smali to construct your class instead of RIL:

find "RIL" word (there will be 2 entries) and replace them to "LGEQualcommRIL".

Fuih..... That what I've learned of porting MIUIv4 guys...

Soon will be born more porters... Great!!!

Happy porting...!!!!