[Galaxy Tab 2 7" Android Development] hkjr:
- Use apktool to decompile android.policy.jar, framework.jar, services.jar, and framework-res.apk for each rom. You only need android.policy.jar if you want to do reboot options.

- Use Meld (I use LinuxMint) to compare the framework-res.apks. Specific xmls to look at are in values folder (arrays-anything after the mobile networks section, bools, and integers) and in xml folder (eri, power_profiles, and storage_list). Merge the CM10.1 values into the MIUI one. (don't just do the whole files...merge the contents....prevents recompile errors)

- Use meld to compare the framework.jar. Items you want to look for are Camera.smali (look at the native methods), as well as any RIL smalis. Compare the services.jars and see if in the InputManager.smali in the CM10.1 there is a SetStylus method. If there IS, you need to put that method into the MIUI version of the file

- Recompile the framework-res.apk. From the NEW file you made, you need to extract the resources.arsc as well as the eri.xml, power_profiles.xml, and storage_list.xml. These must be put into your OLD framework-res.apk (one that came with the MIUI rom) to avoid messing up your system

- Recompile the framework.jar. This file can be used directly. Same thing with the services.jar

- Now that you have that recompiled, open Meld and diff the entire MIUI and CM10.1 folders.

- Copy over the apps from MIUI into the CM10.1 rom. You will need to leave some of the apks from CM10.1 in there for certain services. Don't use NFC.apk unless your device has those capabilities (like my xperia TL)

- Copy over the frameworks from MIUI into the CM10.1 rom. Let it overwrite the existing ones. Do NOT use the NFC one unless you have NFC capability on your device

- In bin, pull the following:bugmailer, makeext4fs, setupfs, and sendbug

- In etc, pull the license folder, as well as in the permissions folder, pull everything that your device will use. You also need to pull telelocation, yellowpages, and unicode_py

- copy over any fonts that are different

- In libs, if you're using MIUIAndroid, be sure to grab the lib files that are needed for Gapps

- In vendor folder, grab the gpsd from bin and gps.xml from etc

- In xbin, grab Invoke-as and su

- In build.prop, edit the items that identify the rom as Cyanogenmod, replacing them with the MIUI counterparts. Add in the following lines:

# ADB Debugging

ro.debuggable=1

persist.service.adb.enable=1

- In updater-script, you need to add in the following 2 lines of permissions near the bottom (I would put them just before the kernel flash)

set_perm(0, 0, 0644, "/system/vendor/etc/gps.xml");

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

- Now, repackage the zip. You may need to run it through dsixda kitchen and re-sign the apks in it. For some reason, when MIUI does their edits, they mess up the signatures. I still run it through the kitchen to Zipalign and sign the zip.

- Now, flash it and see what happens

Since JB wont allow for logcat apps, you need adb for that. If you come across a major error (phone bootanimation loops), you will see the large section of red lines. 99% of the time, the top line tells you the place of the error. You look for that smali, diff it against the CM10.1, go to the line indicated by the "java" number. Merge the info from the CM10.1 version to the MIUI version, save and recompile the framework, then adb push it to your phone and try again. Sometimes, it can take 5 or 10 or 25 tries to get it booting.

This should help you as the instructions were provided to me by an awesome dev (Bill). I attempted to port this about a year ago but never finished it. Good luck!