This Guide is also applicable in porting other ROMs like Color OS, Flyme OS, Sense and more... and this guide has been updated for MIUI 10 as well.
ROM porting is not an easy task for a newbie and porting a highly customizable ROM like MIUI is a way tougher. When I was porting MIUI v7 Lollipop for a Qualcomm Snapdragon device I did not find a definitive guide for porting the latest MIUI versions. So, porting MIUI became a very tough task since I was a newbie in porting ROMs. I learnt porting through experience. Then I also ported MIUI 8, MIUI 9 and MIUI 10. Hence I am writing this guide to help the new MIUI porters so that they don’t face the problems which I faced.
Not much history now, let’s move on to our actual task i.e. how to port MIUI ROMs (Updated for latest MIUI 10 as well)
DISCLAIMER: This guide is written to help the emerging devs. Soft bricking is common in porting ROMs. But, I am not responsible if you somehow hard-brick your device. Do it at your own risk.
Prerequisites
Things required for porting:- Device for which the ROM is being ported
- Port ROM i.e. the ROM of other device which you want to port (here we have MIUI 7)
- Base ROM i.e. the Rom which is exclusively made for your device (CyanogenMod is preferable but if it is not available then Stock ROM may be used)
- PC with Windows + Ubuntu (either in dual boot or through Virtualbox)
- Rom Deodexer (optional) [for Winidows - TOAD or Unified Deodexer and for Linux - SuperR's Kitchen (recommended)] [For Android 6.0 Marshmallow ROMs use this tool to deodex: SuperR's Kitchen]
- Android Image Kitchen to modify boot.img
- Notepad++ to edit scripts
- Meld to compare files and folders
- Winrar or 7zip
- Apktool (for advanced tasks only)
- And some common sense
Common Information
- This guide will teach you to port ROMs from devices with similar hardware specs and same Qualcomm Snapdragon chipset.
- The Port ROM and the Base ROM should have the same android version.
- ROMs containing DAT files should be properly unpacked. For base ROM you can easily do it by flashing the ROM and taking the TWRP backup of ‘system’ and extracting the resultant file with Winrar/7zip. For Port ROM follow this guide: [DEV] Lollipop/Marshmallow DAT files or you can use SuperR's Kitchen for the same.
- ROMs should be properly deodexed before porting (SuperR's Kitchen worked better in deodexing MIUI 7 Lollipop) if your device's /system partition size is smaller than Port ROMs system files. (deprecated because deodexed official firmware no longer boots) OR Download unoffical MIUI builds from (recommended):
- The size of the system folder of your Port ROM should be lesser than that of the system partition of your device, else you'll not be able to flash the ROM. To decrease the size you need to deodex your ROM and you may further need to debloat you Port ROM which is discussed later.
- I am writing this guide on the basis of this configuration:
- Base device: YU Yureka (ARM64)(MSM8939)
- Base ROM: CyanogenMod 12.0
- Android Version: 5.0.2 Lollipop
- Port device: MI4i (ARM64)(MSM8939)
- Port ROM: MIUI v7 Lollipop (but the guide works for MIUI v8, v9 and v10 as well)
Preparing Porting Environment
- Make sure you have plenty of hard-disk space in your PC.
- Make a folder named MIUI-PORTING-PROJECT (you may take any other name)
- Inside that folder create two folders: (i) BOOT-EDITING (ii) ROM-PORTING
- In ROM-PORTING folder create two folders named BASE and PORT (this is the main working folder)
- Similarly inside the BOOT-EDITING folder create two folders named BOOT-BASE and BOOT-PORT
- Now place the extracted deodexed Port ROM (i.e. MIUI v7) in PORT folder and Base ROM (i.e. CM 12.0) in BASE folder.
- Similarly place the MIUI boot.img in BOOT-PORT folder and CM12(or LOS 13/14/15/16 as per requirement) boot.img in BOOT-BASE folder.
Cleaning up:
Just delete some unwanted files (like .mbn files) and keep only ‘META-INF’ folder, ‘data’ folder (if available), ‘system’ folder, ‘boot.img’ file and ‘file_contexts’ file (if available) in PORT folder.
Now let’s do some work to make the Port ROM boot.
META-INF editing
- Open the updater-script file in PORT/META-INF/com/google/android/ with Notepad++.
- Delete the first line containing “get_device_compatible(….” or “assert(getprop….” which restricts the flashing process to other devices.
- Then delete the lines containing scripts for flashing radio image, modem image etc. which are not required for our base device.
boot.img editing
1. Use Android Image Kitchen to unpack the base and port boot.img in BOOT-BASE and BOOT-PORT folder.2. Replace the files boot.img-zImage, boot.img-dtb in BOOT-PORT/split_img/ with that of BOOT-BASE/split_img.
Replacing boot.img files |
Editing fstab.qcom using Meld: Step 1 |
Editing fstab.qcom using Meld: Step 2 |
After this repack your boot.img and place it in your port ROM folder (i.e. PORT) and create a flashable zip. You will be able to boot this time. But, you may face sensors, sound, camera, ext sd-card etc. issues. So let us move on to fix those issues through boot.img first.
4. If the port device doesn’t support external sd-card but your base device does then you make the following changes to your BOOT-PORT/ramdisk/init.qcom.rc file:
Remove ‘#’ from the lines containing scripts for mounting or fusing ‘sdcard1’. You can do this simply by comparing the port init.qcom.rc with that of base through Meld application. (Note: You may also need to add some lines if missing in the port init.qcom.rc)
5. After sd-card, let’s move towards fixing camera, led, sensors etc. issues. For that we need to edit the init.rc and init.target.rc files.
=> Editing init.rc file:
Following lines should be added to init.rc file:
#Add all these lines under 'on post-fs-data' in appropriate places
on post-fs-data
#Add all these lines under 'on boot' in appropriate places
on boot
=> Editing init.target.rc file:
Following lines should be added to init.target.rc file:
#Add all these lines under 'on post-fs-data' in appropriate places
on post-fs-data
#Add all these lines under 'on boot' in appropriate places
on boot
6. Even after doing the above steps you may find that sensors are not working. So for that you have to do the following step –
Compare the port ueventd.qcom.rc in BOOT-PORT/ramdisk folder with that of base and add the missing lines to the port. This will fix your sensors issue.
7. Similarly compare other BOOT-PORT files like uneventd.rc, file_contexts etc. with that of BOOT-BASE and use your brain to replace required lines.
8. To fix other issues use your common sense.
9. If you are doing boot.img editing at the beginning of your project, then some of you may find that even after doing all these steps, sensors, led, camera etc. are not working. But don’t lose heart, for that you have to start your ROM Porting.
ROM Porting
Before starting ROM porting, your base and port ROM should have all the files in place. If you have correctly edited the boot.img then the following steps will help you to solve your bugs.1. Debloating Port ROM: Just delete unwanted apps or bloatwares from your port ROM. You will find them in /data/, /system/app/ and /system/priv-app/ folders.
2. According to my previous instructions you should have placed your port ROM to PORT folder and base ROM to BASE folder.
3. Adding missing files and folders: You may add missing files from BASE/system/bin/ to PORT/system/bin/. For this you can just copy all the files from BASE/system/bin/ to your PORT/system/bin/ without replacing any file.
Similarly you can do the same process in system/xbin/, system/fonts/, system/etc/, system/usr/ etc. and their sub-folders.
But always use your brain to decide which files you should add and which you should not.
You may also add some missing folders from your base ROM to your port ROM, e.g. system/tts folder, system/etc/init.d if you think it's needed.
4. Fixing permission related issues: Now you have to work on system/etc/permissions folder. Just compare handheld_core_hardware.xml and platform.xml of port ROM with that of base and add or replace some lines if required.
You can do the same for some other permission files if required, but as I am always saying use your common sense.
5. Replacing files: Copy and replace files in system/etc/firmware and in system/etc/wifi from base to port.
Copy and replace the files goodix.kl (name can be different for different devices), gpio-keys.kl, Generic.kl in system/usr/keylayout/ from base to port.
We will discuss more about replacing files in bug-fixing section.
6. Open system/framework/framework-res.apk of both base and port with Winrar in two different windows but don’t extract. Then navigate to framework-res.apk/res/xml/ of base and copy storage_list.xml and power_profile (optional) and paste to the Winrar window of port framework-res.apk/res/xml/ and replace the existing files. Then close the Winrar window.
Now let’s move on to our bug-fixing section.
Bug-Fixing
If you have properly edited the boot.img then only these fixes will help you.Copy and replace the following files from Base (ROM-PORTING/BASE) to Port (ROM-PORTING/PORT) to solve the given issues:
No sound bug:
system/lib/hw/
- audio.primary.msm****.so
- audio.primary.default.so
- audio.primary.msm****.so
- audio.primary.default.so
(You may also check system/etc/mixer_paths.xml and system/etc/acdbdata folder)
Sound working in speaker but not working through headphones or vice-versa:
system/etc/- mixer_paths.xml (you can also try patching it with the base)
Distorted Outgoing Sound during Phone call or Partial Sound:
system/etc/acdbdata/MTP/
- MTP_***.acdb (all files)
Home or any other button not working:
system/usr/keylayout/
- goodix.kl
- gpio-keys.kl (important)
- Generik.kl
External sd-card not showing:
Follow the Step 6 in ROM Porting section.
Video hw encoding/decoding not working:
system/etc/firmware/
- venus.*** (all files starting with ‘venus’)
- system/lib/hw/sensors.msm****.so (or sensors.lsm6db0.so)
- system/lib64/hw/sensors.msm****.so (or sensors.lsm6db0.so)
- system/lib/libsensorservice.so
- system/lib64/libsensorservice.so
- system/vendor/etc/calmodule.cfg
- system/vendor/lib/libcalmodule_****.so
- system/vendor/lib64/libcalmodule_****.so
Led notification not working:
- system/lib/hw/lights.msm****.so
- system/lib64/hw/lights.msm****.so
Vibration not working:
- system/lib/libhardware_legacy.so
- system/lib64/libhardware_legacy.so
FM not working:
- system/lib/qcomfm_jni.so
- system/lib64/qcomfm_jni.so
Wifi not working:
- system/lib/modules/wlan.ko
In some phones (e.g. YU Yuphoria) you may not find wlan.ko file. In that case you may try replacing these files (thanks @Divyansh747):
- system/lib/libwcnss_qmi.so
- system/lib64/libwcnss_qmi.so
And also these files (thanks @D Rohan):
- system/lib/libhardware_legacy.so
- system/lib64/libhardware_legacy.so
For slow WiFi network and other WiFi related issues replace these files:
- system/etc/wifi/ -- all files
- system/etc/firmware/wlan/ -- all files
Camera and flash not working:
system/vendor/lib/
- libactuator_***.so (all files starting with ‘libactuator’)
- libchromatix_***.so (all files starting with ‘libchromatix’)
- libmmcamera_***.so (all files starting with ‘libmmcamera’)
- liboemcamera.so
system/lib/
- libmm-qcamera.so
- libmmcamera_interface.co
system/lib/hw/
- camera.msm****.so
WARNING: Do not replace any file unnecessarily, because it may give rise to new bugs in place of solving it. Always be specific!
build.prop Editing
You can edit required parts of build.prop to reflect the brand, model no. etc. according to your preference. You may also add some tweaks and other things to save battery and to add features.(But in MIUI according to my experience changing the ro.product.manufacturer gives rise to issue in video recording through third-party apps and changing the ro.product.device trims some features from the ROM. However, you can get through this by reverse engineering the respective apps using Apktool.)
Now your Porting Project is ready to be flashed and to be reviewed. Congrats!
Giving Credits
Last but not least when you successfully port your ROM, always give credits to the Port and Base Rom developers. Also give credits to the people from whom you took help. Always be generous in giving credits because it will not take anything from you, on the other hand it will increase your reputation and strengthen people’s faith in your work.If you are taking help from this guide in your ROM Porting then don't forget to give some credit to me too.
My profile
XDA Forums: nitesh9MIUI Forums: nitesh9
My works
MIUI v7 Lollipop Global and China Beta for YU Yureka: XDA Forums | MIUI ForumsMIUI 8 Global and China Beta ROM for Yureka and Yureka Plus: OS Busters | XDA Forums
For any queries or discussion please comment below...
You're already a rockstar in YU forums and xda.. Thank you!
ReplyDeleteYou should go for Android 5.0 Stock or Base ROM, else you may get bootloops or RIL issues. If you tell me the device for which you are porting the ROM than I can help you in choosing the Base/Stock ROM.
ReplyDeleteEmmm,we are trying to port FlymeOS(5.1.1) from Yu Yureka to the Idol 3 5.5. The rom boots,but there is no signal(RIL is dead?),wifi doesn't work,etc.
ReplyDeleteWe tried with the above mentioned files,but without success...
We used files from CM12.1.
First I will not recommend to use other ported ROMs for your new ports since bugs will be inherited and may cause other problems since system files are highly modified to make compatible with Yureka.
DeleteI will recommend you to search Flyme OS ROM for Coolpad F2. You may get it from some Chinese forums (I found two at http://bit.ly/1RLktoK and http://bit.ly/1RLkuZV). And use that for your porting. You may also find other portable Coolpad F2 ROMs here: http://bit.ly/1R1fYol
And for Wifi issue use the wlan.ko file from your base ROM or you can flash any custom kernel for your device.
Hello Nitesh, nice to meet you.
ReplyDeleteI try, like marionette, to port MIUI from MI4I on our Idol3 (6045).
But, i allways have a bootloop with stock modded boot.img. I've doing all you mention on your guide, but no success. Can i send you the stock boot.img ?
thanks
Modify the port boot.img from the files from stock. The Port ROM will not boot with your stock boot.img since bootclasspath is different. Please follow the boot.img editing part carefully.
Deletei want to port miuiv7 for motorola 3rd generation currnetly it is 5.1.1 ...
ReplyDeletethere are cyanogenmod 12.1 available as a base rom !
but im confused about port rom can you help me out ?
i really like miui rom
Currently no compatible MIUI 7 available for sd410. But keep looking for lollipop update on Redmi 2.
DeleteBut currently you can try porting vibe ui from A6000 or Funtouch OS 2.1 from Vivo v1. But the android version of port ROM should match your Android version ie 5.1.1 or use a cm 12.0 base ROM for you device.
okay thanks for the reply !
ReplyDeleteso can i port miui v6 for the motorola moto g3 !?
If you find a MIUI 6 Lollipop for Redmi 2 then you can port, which I think is not available.
DeleteNice to meet you Nitesh. I have the same question but it seems that Xiaomi is never going to release lollipop update for Redmi2 as the MIUI7 update for Redmi2 is still based on Kitkat. Is there any alternative to port MIUI to Moto g 3rd gen? how difficult is the cross android version porting as I'm not able to find port ROM for the similar device (chipset & resolution etc..) at the same android version ?
DeleteCross Android version porting is not possible in my opinion. Miui 7 Lollipop or Marshmallow will soon release for Redmi 2. Till then you can try porting other UI's like Vibe UI, Zen UI etc. etc.
DeleteHello.
ReplyDeleteYou say "2. Replace the files boot.img-zImage, boot.img-dtb, boot.img-ramdisk.cpio.gz in BOOT-PORT/split_img/ with that of BOOT-BASE/split_img."
But, in the screen shot, it's inverted ! what is good ?
Thanks for pointing out. The screenshot has been updated.
DeleteThen I think currently MIUI 7 is not possible for your device. You can go for other ROMs like EMUI, Funtouch OS, Nubia ROM etc. which are available in android 5.1.1.
ReplyDeleteHi Nitesh,
ReplyDeleteI want to port your miui rom on my yureka 5.1.1, is it possible to upgrade ?
Yes, you can use Miui 7 Android 5.0 on your Yureka Android 5.1.1.
DeleteFor porting Miui 7 choose CM 12.0 as base.
Hello Nitesh.
ReplyDeleteIs there a way to use CM12.1 as base rom ? (Idol3 5.5")
thanks
If you want to use CM 12.1 as base then choose a port ROM based on Android 5.1.1. Some examples are CoolUI 6.0, Color OS 2.1.0 etc.
DeleteI tried to port flymeos for yuphoria but it does not booted.
ReplyDeletePM me all the details of your Port and Base ROM through YU Forums then only I can help you.
Deletewhat is ur user name on yu forum
DeleteNitesh Prasad
DeleteQualcomm is cross porting right ? MSM8916 TO MSM8939 Will Work ?
ReplyDeleteNo. It should not work.
Deletehello Please i want help to Port Rom For my Lenovo Vibeshot
ReplyDeletei want Rom MIUI 7 and Nubia UI 3.0 Please
For MIUI 7 you can go for Xiaomi Mi4i ROM (MIUI 7 Global Edition) and for Nubia UI you can choose ZTE Nubia Z9 Mini.
Deletei need vibeshot base rom and Nubia UI base rom please i'am Search on it from month ago please if you have time make it or tell me where can Download it because i'am Don't find it
DeleteYou can get Vibeshot Base ROM either from your device or from XDA. And for Nubia UI download you head over here.
Deletemy Bro tired to try Really
Deleteand i don't find Custom Recovery to install any Rom
PLease find MiFlash Please Can you Help me
i need Use Nubia UI it's Really Go Please
Can You Make to me Rom ?
Please Make to Me Rom
DeleteSorry cannot work on any project nowadays due to exams.
DeleteYou can go for MIUI 7 from Mi4i, Color OS 2.1 from Oppo R7 Lite/Plus etc.
ReplyDeletemi4i having msm8939 while my device have msm8916, will porting works ?
ReplyDeleteI can port MIUI 7 for my Nubia Z5 from z5s mini or Nexus 4? I have the Stock Rom (4.4) and CM 12.0 and 12.1 for use as Base, which is better to port?
ReplyDeleteYou should choose Z5s Mini and use your Stock ROM (4.4) as base.
DeleteOh sorry, I mistook msm8916 for msm8939. You should go for Vibe UI from Lenovo A6000 Plus, Flyme OS from Lenovo A6000 Plus etc.
ReplyDeleteplease elaborate 3rd point in boot editing, which values we need to add or delete ?
ReplyDeletemy modified boot image boots but stuck at boot animations.
You have to add those lines which are missing, from base to port. You also have to check the lines containing mount points for different things like 'system', 'data' etc. in your port fstab.qcom to match with that of base. If it doesn't match then you have to replace the lines from the base.
DeleteScreenshots are also given there for better understanding.
I did everything well but the process is restarted in bootanimation
ReplyDeleteWhich ROM are you trying to port? This guide is full for MIUI ROMs but for other ROMs you have to do some extra things.
DeleteYou can try taking logcat to uderstand the issue.
the phone is Xiaomi redmi2 and I want it port for huawei G620s
DeleteI've done everything he puts in tutorial and not nothing.
Thanks in advance
This is just a basic tutorial written on my experiences. I am trying to improve it as I am getting more and more experienced in ROM porting.
DeleteYour issue seems to look like a boot.img issue. Check the file contexts, service contexts files in boot.img.
Hello, I reviewed the boot.img, but it's all right, you think that it may be because the libs?
DeleteBest Regards
Maybe. Anything can be the cause. The best way to get an idea about the cause to take a logcat.
DeleteBro I want to port miui 7 for moto e xt1022. Which device have the same chipset as moto e xt1022 ? And Plz provide me the link for miui 7 for that device
ReplyDeleteHey
ReplyDeletei have some troubles porting wifi and audio
in port i have qca_cld_wlan.ko and qca/qca_cld_wlan.ko
in base wlan.ko and qca/qca_cld_wlan.ko
also your soltion for audio didnt work, any other suggestion?
device:oneplus2
base:oxygen
port:MIUI NotePro
Rename base wlan.ko to qca_cld_wlan.ko and copy it to port.
DeleteFor audio you can try replacing the audio libs in lib/hw/ and lib64/hw/ from base to port.
Hi!
ReplyDeleteAre there any opportunities on porting MIUI to Galaxy S6 at the moment?
Sorry no port device available.
DeleteHi,
ReplyDeleteDo you know how to convert a 64 bit ROM to 32 bit ?
My device doens't have a 64 bit kernel, just 32 bit lollipop (even kernel source is 32 bit).
It's ZTE Blade S6 :)
I tried to port Nubia UI 3.0 from ZTE Nubia Z9 Mini, but I got a reboot loop. I then checked and saw that that device comes with a 64 bit kernel, so 64 bit rom too.
Thanks in advance!
I think it's not possible to convert a 64 bit ROM to 32 bit. You should go for a 32 bit ROM.
DeleteHi Nitesh!
ReplyDeleteI was trying to port MIUI v7 based on MM from Mi4 to OnePlus X using CM13 as a base. When I tried to flash the zip I made, TWRP gives an error which just says error flashing miui.zip. P.S. the error text isn't in red colour which seemed a bit strange.
Thanks in advance!
You need to remove useless lines from updater-script as given in the guide.
DeleteAnd also the size of MIUI system folder should not be greater than the system partition of your device. For that you can try deodexing the MIUI 7 ROM.
Hi Nitesh!
ReplyDeleteI modified the boo.img as told by you. Also the deodexing tool wasn't working so I manually deleted some system apps to reduce /system size of miui to be similar to my base /system. But the problem still persists, it's stuck at the mi logo forever. Also I'm not able to take a logcat,adb refused to detect phone while booting. Could deleting system apps have caused an issue? Could there be a problem in SElinux? Please help.
Try replacing other audio libs in lib/hw and also check audio profile in system/etc.
ReplyDeleteFor camera try replacing camera libs in lib/hw and also check system/bin if you have already replaced camera libs in vendor/lib. You can also try changing the kernel once.
MIUI ROM V7 For Asus Zenfone 2 Laser Ze550kl ?
ReplyDeleteYou may need to wait for MIUI 7 for your device since Xiaomi has not yet released MIUI 7 based on Lollipop for Redmi 2 Prime. But it will be released soon...
DeleteHi
ReplyDeleteIwant port cm13 for galuxy grand quattro from moto e duel same chipset and confrigation I can yous this tutoria for port cm13
Yeah you can give it a try. It should work.
Deletehi nitesh...great guide...trying to port roms for yureka through your method...so first question in a handful of questions to come later, is I unpacked the boot.img but cldnt find split_img..just a folder named boot.img-ramdisk and zImage...so I slh juz replace the zImage right ???
ReplyDeleteYes you can just replace the zImage.
DeleteBut which ROM are you porting and which tool are you using?
ported china version miui7 of mi4i...while flashing the rom, error - error executing update binary in zip :(...can u help ??
ReplyDeleteTry changing the update binary file. You can also try removing some unimportant lines from the updater script.
DeleteHi Nitesh,
ReplyDeleteActually I'm trying to port MIUI v7 based on marshmallow from Xiaomi Mi4 to OnePlus X but the ROM is not booting it'sit's stuck on Mi logo forever. Moreover I'm not able to get a logcat and also last_kmsg method is not working in order to know what's wrong.Can you please help? Thanks.
If you have deleted any system file then you need to revert it to its original condition. Try to port Global MIUI 7 ROM or sMIUI 7. And deodex it using the latest SuperR's Kitchen.
DeleteYou may delete some unimportant gapps like PlusOne, GMail, GMaps, Chrome, Music2, Hangouts etc. from system/app/ folder to reduce the size.
And edit the boot.img as directed.
Hi Nitesh,
ReplyDeleteI am trying to port MIUI v7.0 for my YU4711 a.k.a Yu Yunique... I need your help!! Reply as soon as you see this... :) and I appreciate your for writing this helpful guide. ^_^
You will need a MIUI 7 Lollipop to be able to port on your device. If your are taking Redmi 2 as port device then you may need to wait since MIUI 7 Lollipop is not yet released for this device.
DeleteI think MIUI Team will skip Lollipop update for Redmi 2 and it will directly get marshmallow. ;)
Hello Nitesh.
ReplyDeleteWhen i try to extract system.new.dat from your LewaOS7 port (yureka), extraction work but files are corrupted ?! (i use SystemExtractor 5.1)
Follow the DAT extraction guide provided under "Common Information" section above.
Deletesorry, same result. files are extracted but corrupted.
Deletei try this:
i flash with twrp 3.0.0 (idol3) and immediatly make a backup. extract backup = files are corrupted too. very strange .....
Hi Nitesh, is is possible to port MIUI 7 to Zte Nubia z7 max? Which rom should I use as base?
ReplyDeleteYou should use Xiaomi Mi4 MIUI7 as Port and your stock ROM as base.
DeleteHi Nitesh, I managed to find the ZTE Nubia Z7 max rom, MIUI 7 but its based on kitkat. (http://en.miui.com/download-259.html) How do I update the same to lollipop? My base rom is 5.1.1 lollipop and the Xiaomi Mi4 rom is also lollipop. Is there a way to update/replace any specific files without now porting the entire rom?
DeleteI porting also we add/replace some specific files to make the port ROM work. So if you want to use Mi4 Lollipop MIUI ROM then the only way is to port the ROM. You may find already ported MIUI 7 Lollipop ROM for your device on some chinese forums.
DeleteHi Nitesh. Is it possible to port Redmi2 Prime's ROM to Wileyfox Swift? In last update they upgraded Redmi2's Android version to 5.1.1. If it possible, can you tell me how can I do? This method didn't work for Wileyfox Swift. Sorry for my bad English.
ReplyDeleteYes, it can be ported. Just follow the given method. And use the base ROM as directed. Also don't forget to deodex the MIUI 7 ROM. All the best.
Deletetake 32bit base then port redmi 2 prime miui
DeleteBro will 32 bit miui boot on 64bit yuphoria or will it brick the phone
ReplyDeleteIt will not brick the phone, but it won't boot also.
DeleteBut the stock aosp ROM of yuphoria is 32bit and it boots
Delete??
Then first you have to flash the fastboot images of 32bit stock AOSP firmware. Then you may port MIUI 32 bit and it will boot.
DeleteHello I have Wifi problem only.
ReplyDeleteNo file in lib/modules folder (Stock Rom)
Stock Rom: CyanogenMod 12.1
Port Rom: Color OS 2.1 - Api5.1.1
Qualcomm Snapdragon 410 Msm8916
Then try replacing these files:
Delete{*} lib/libwcnss_qmi.so
{*} lib64/libwcnss_qmi.so
Also the Wifi bug-fix has been updated above. Just review once.
Thanks but it didn't work.
DeleteWifi problem On Log /Sender: WifiHW, XTWiFiLP, WifiStateMachine
WifiHW connected libhardware_legacy.so libs.
When I change (lib+lib64) "libhardware_legacy.so" it doesn't boot ROM.
I solved like this Flyme OS wifi problem but it didn't work on this ROM
Then first try replacing the wifi/wlan/wcnss related binary files in bin folder and also in etc folder.
DeleteHello! It's possible now to make a porting to galaxy s6 from xiaomi mi5 rom?
ReplyDeleteThey have both ARMv8 processors and both android 6.0...
But both have different chipsets. Cross-firmware porting is very difficult but you may try once.
DeleteIt will be much easier through MIUI Patchrom. But it has not been released either for lollipop or for marshmallow.
my devise is Huawei G8 (Rio-L01 dual sim). I used Mi4i for porting. But the device stuck on mi logo. Huawei is android 5.1.1 but I cannot find android 5.1 for mi4i. Please help
ReplyDeleteI ported miui 7 to my device and it successfully booted but after booting battery saver has stopped and xiaomi service framework has error is coming and the device reboots how to fix it
ReplyDeleteThe problem may be in boot.img or kernel. Try flashing any custom kernel. If not fixed then take a logcat.
DeleteI'm planning to port MIUI 7 to a Lenovo Vibe Z2 Pro (K920 CN), I have the stocks roms from KK (4.4.2) and LP (5.0.2) also I have the kernel source from both versions. Which version and which device do you recommend to port (mi note?) I'm concerned about the differences in the camera module and the display resolution. Thanks in advance.
ReplyDeleteYou can use your stock ROM (Kitkat) as base and port ROM from Xiaomi Mi Note MIUI 7 Global Stable edition (Kitkat). Camera and display should not matter much, just give it a try.
DeleteI have a serious doubt. Why is my boot.IMG getting more compressed than actual? Say the port device's kernel is 19 MB, after editing and stuff its coming to 8 MB! How? Is it bad?
ReplyDeleteWhat is the size of your Port kernel and Base kernel?
Deletemaybe your stock rom is 32bit and port rom is 64bit ;)
DeleteNo. It's 64-bit confirmed. @Nitesh, both are approximately what I said in the above comment
DeleteI was ported but when I was flashing it says error 6 how to solve
ReplyDeleteSeems a issue of mounting. Check your updater script once, especially the lines regarding mounting system, data etc.
DeleteAlso check that the size of extracted ROM should not exceed the size of system partition of your device.
Can i port this rom to my Samsung Galaxy A8(A800F) 5.1.1?
ReplyDeleteYes, if your device has TWRP recovery.
DeleteAt META-INF editing you said we should delete some lines. But how do they look like? I am trying to port from Redmi 2 5.1.1
ReplyDeletecan i take yu yunique stock rom as base rom for redmi 2?
ReplyDeleteIf you want to port Redmi 2 MIUI ROM for Yunique then take Yunique Stock ROM as base and Redmi 2 MIUI 7 ROM as port.
Deletei am working on port flyme os from coolpad f2 to vodafone smart ultra 6,following your post, all work except camera app,it dont apear on app drawer....what can i do??
ReplyDeleteMaybe your camera app is corrupt. Try any other camera app or use any ported flyme camera app.
Deleteis common in every camera app but now camera open and after 1 seg crash,with "cant conect to the camera" message
DeleteNo bro. I want to port fom for Redmi 2. Can i take yu yunique stock rom as a port rom and cm 12.1 as base rom? And also bro i have very much doubts in porting the rom. How can i contact you personally?
ReplyDeleteYes, you can take.
DeleteFor contacting pm me on my YU forums account.
I have xiaomi mi4(cancro) and I want to use cynogenmod as base ROM and official miui 7.2 ROM as port ROM which is already made by miui team.Do I need to port the boot.IMG file too?
ReplyDeleteBasically I need a ROM with multi window and doze support.so I thought installing cynogenmod ROM with miui UserinterfaceUseliace(I love iit) present.Plz answer whether I need to port boot.IMG too?
Yes, you need to port the boot.img.
DeleteI'm trying to port Marshmallow MIUI from MI Note or MI3 on my Oppo Find7a (snapdragon801).
ReplyDeleteIt starts and goes in bootanimation, but It bootloop :(
Can you help me, please ?
I've ART and mmcamera errors...
Try replacing system/lib,lib64/
Deletelibart-compiler.so
libart.so
libsigchain.so
And for camera follow camera bugfix method above.
hey bro. I have a "Galaxy Tab Pro 8.4 T320 Snapdragon 800" and I want to make a port of miui 7 "Nexus 5 Snapdragon 800" will be that I'll be able to start the rom? or patch me another device that is more compatible
ReplyDeleteParasgrover492
ReplyDeleteCan i port touch wiz from samsung j5 to redmi 2 by your method?
You can try but I am not sure about it.
DeleteA radio image which lines, modem image?
ReplyDeleteI dont found split-image, i use other tool to unpack boot.img
So i do this without remplace de files Of split and i get a bootlogo
i port the rom to moto x, but the bootanimation dont load. just load the logo and afther shutdown. why?
ReplyDeleteEdit boot.img correctly and use the tool suggested.
DeleteWhen i repack the boot imagen give me two files, new-boot.img and ramdisk.gpio.gz. Why? What i have to do With randisk.gpio.gz?
ReplyDeleteYou have to do nothing with ramdisk.gpio.gz.You just have to use the new-boot.img.
DeleteHey! I am trying to port this to the LG G4 (international). I am using stock ROM 5.1 lollipop as base and MIUI lollipop 5.1.1 for Xiaomi Mi 4S because it has the same CPU, RAM and GPU.
ReplyDeleteHowever, I did all of the steps but I can't get it to boot, it doesn't get past the LG logo. Are you able to help me please? I would really appreciate it! :D
Most probably a boot.img issue. Check fstab.qcom in ramdisk of boot image and edit it correctly as mentioned in the guide. You can also try replacing lib,lib64/libart.so, libart-compiler.so, libart-dissembler.so and libsigchain.so.
Deletei have camera and sound issue how to fix it my call works but external sound not working and camera will not start it crashes .
DeleteFor Sound Issue:
DeleteIf you have already tried replacing the audio libs then replace system/etc/acdbdata/ files and system/etc/mixer-paths.xml.
For Camera Issue:
Replace all the libs related to camera in lib, lib64, vendor/lib, vendor/lib64, bin folders.
my phone bootloop when i replace libcameraservice.so what to do i only have two bugs in my custom rom now.
DeleteTry replacing lib,lib64/hw/camera.msm8916.so also.
Deletei am having issues with my rom i port the phone is showing dead bbattery and turning off by it self how to fix.
ReplyDeleteTry replacing boot.img/ramdisk/sbin/healthd from base. Also try replacing system/lib, lib64/hw/power.default.so and power.qcom.so. If doesn't work try calibrating the battery.
ReplyDeletebro followed every steps ....after flashing it shows like this
ReplyDeletewhen i hit reboot option
zuk z1 logo> screen off >zuk z1 logo>screen off>come back to TWRP recovery
Most probably an issue with fstab file or kernel. Check boot.img for errors. you can also try replacing system/lib,lib64/
Deletelibart-compiler.so
libart.so
libsigchain.so
now showing miui boot animation .....continuously so took logcat here it is
Deletehttp://pastebin.com/ZTWDMNPW
thanks but i have one more issue the camera is not working i try your guide but it seems to work at first but after i try to switch camera it crash and when i open it it switch the camera
ReplyDeleteHI, i tried porting cyanogenos 11 from yu yureka to redmi 2...and its booted and its working fine...I know both of them have different chipsets but it booted.and stable after fixes....and now i wanna port cyanogen os 12 nut all rom seems to to be having lib64 where as redmi 2 is 32 bit only......any solution for this
ReplyDeleteYou may need to wait for ARM 64 upgrade of Redmi 2 or look for any other port device with sd410.
DeleteThis guide is for qualcomm based but I have meditek 6752 and notification light not work.. When lunching cit and test lights it's not blink my device support red and green light how fix this plzz tell me.. Thanks..
ReplyDeleteCheck system/lib/hw and try to find lights.****.so file. If such file is there replace it with base.
Deletethanks for this great tutorial on how to port qualcomm rom. i most concede u rock. plz i need your help.i was able to port coolpad 8675 fhd rom to my tcl m2l but i always come across this same issues, no sound, camera force close and cant play video but i was able to fix the video issue by replacing files from system-etc, system-etc-fameware, system-etc-permission, & system-lib, but cant seem to find a fix for camera and sound. my phone use to bootloop whenever i replace libcamera-client file from system-lib and libaudios lib files from system-lib. what should i do next?
ReplyDeleteYou don't need to replace libcamera-client.so. The post have been updated with new bug fixes. Check the bug fixes section.
Deletehave fix sound bug by replacing all the mixer-path and audio files from system-etc. but theres still camera bug and wifi bug. wifi is optional to me. i can still do witbout wifi but camerA is something i cant do without.
ReplyDeleteTry replacing the camera related files also check the boot.img for anything missed related to camera.
DeleteWhen you say that we need to compare fstab.qcom With meld . we just press the arrow ? so we must have to let both files in the same form
DeleteYou can either replace fstab.qcom or edit it. Sometimes replacing works and some times editing. You can try both one by one. ;)
Deletenitesh i Am using xolo black(Snap.615) and i port miui 6 from mi4i but one biggest problems in porting in my device have dual camera (13+2) so in miui 6 in my device camera is not working and all other small bugs i can solved them my own but pls help me to poting camera you my last hope pls help me
ReplyDeleteRefer to Bug-Fixes section. The Camera fix provided above should work.
DeleteI have error 7 when I try install it. I have deleted the lines on updater script :(
ReplyDeleteYou must have done some mistake in updater script. Most common mistake is missing ";" at the end of each line. Check for it. Also delete "assert(getprop....." line if you have not already deleted it.
Deletethanks for all your help my rom is very stable thank to you but there bare bugs with my phone when i charge without turning on the phone it first looks normal until 19 seconds pass it start to reboot and it repeat over and over so how to fix this bug on miui7 rom
Deleteand 3g data is not working how to fix that
DeleteOffline charging issue is really a well known bug of MIUI 7 Ports. You can check charging related lines in ramdisk/init.RC or init.qcom.rc.
DeleteAnd for 3g data edit the "ro.telephony.default_network" in build.prop according to your base ROM.
How to fix camera con not connect with switching camera from front to back.
DeleteThanks
ReplyDeleteBut can i ask u a question?
Can i port the rom to my device (s2 plus)
good work you help me alot but i have one issue my divices is sd410 sd mean snap_drogan soc410 i was wondering where i can get roms from to port because the miui7 rom i port is not fixed for offline charging but i want to sometimes turn my phone off while charging.
ReplyDeleteYou can try porting ColorOS 3.0 from Oppo A37.
DeleteHi Nitesh...
DeleteI have ported MIUI7stable for Coolpad 8297L100..Everything is perfectly working. But at charging Battery light should be red as default but it is glowing yellow. and turns green at 89% (means Before 100&)............................
As well trying to add option for home button double tap sleep and wakeup.and default app install in sd card.
But when trying to decompile system.apk and other syst apks its done with errors...means decompiling incomplete..due to its not compiling again.
i am using win7 32bt tryed apk tool advance apk tool and such more but its not working...used basic procedures already.
Handset is Coolpad dazen18297L-I00
qualcomm msm8916
1.2Gh..kitkat4.4.4
pls help to fix these things
Yellow Charging LED is a system feature and is not a bug. ;)
DeleteAnd for decompiling apks you should use Jbart tool (google it) or use the aapt from that tool. And always use latest apktool.
Thanks a lot...
DeleteAnd what about the led turns green before 100%
(It is turning green at 89%)
It is not a big problem. It actually turns green at 90%, but 1% doesn't matter. But you can try calibrating your battery. And Green LED at 90% is set by MIUI devs so nothing much can be done from our sides.
DeleteThanks a lot..
DeleteIs it possible to port Samsung note prime KitKat rom to CP8297..same config.
Already tried but sim cards are not detecting.
Try replacing etc/firmware/ files. This may fix the sim detecting issue.
DeleteTrying to decompile Settings.apk of MIUI7.3.1.0 global stable rom.and used advanced apktool,Android multitool, the error is-skipping"android"package group-tryed jBART also with latest apktool.
DeleteTry uninstalling Java 8 from your PC (use jdk 7) and use aapt from jBART while decompiling and compiling apks. And install app/miui.apk, miuisystem.apk, framework/framework-res.apk and framework-ext-res.apk as apktool framework using "apktool if " command. Follow this link for more: http://en.miui.com/thread-162639-1-1.html
DeleteUninstalled java and installed java jdk and used aapt from jBART (with latest apktool)....but not working...same error again.its decompiling but not recompiling.
DeleteITS only with settings.apk other apps working great.MIUI6.2.8 settings is compiling but 6.7 ...7.2..and 7.3 stable global settings.apk is having issue.also tried jBART ,but same,
expecting solution for it
There must be some problem in settings.apk. Try porting xiaomi.eu MIUI ROMs.
DeleteWhich device would you recommend I use for moto x? I use mi2 but not boot
ReplyDeleteYou are using the correct port device. Just edit the boot.img correctly and replace the etc/firmware/ files with that of base.
Deletewhere can i find ColorOS 3.0 from Oppo A37 and how to fix random reboots when i turn screen brightness done to max low this issue is it reboot to defualt brightness and also when phone display turn off it is reboot as soon as screen turn off
Deletewhile charging offline every time screen turn off and on i port the miui7 rom from yuphoria because every rom was 32bit and my kernal supports 64bit.
You can get ColorOS 3.0 here: http://www.oppo.com/in/downloads/.
DeleteAnd for light sensor try changing kernel or replacing light and sensor libs.
how to make the system folder more smaller for color os try to remove some aps but when i flash the rom it got stuck on setup not going to home screen. i use META-INF buti do not thing that is the issue.
DeleteYou must have deleted some core apps. Try to find what you deleted and check by flashing the apps one by one whether it boots or not.
DeleteMy stock rom was archived as dat format but my base ROM no archives what would I do my mobile was moto g3
ReplyDeleteI was tried this whole process another website in XDA and miui forms with our archiving .bat it was not working in moto g3
What would I do please help me
Follow this method: http://forum.xda-developers.com/android/software-hacking/how-to-conver-lollipop-dat-files-to-t2978952
Deletecan i try this method on moto e 1st gen with samsung galaxy grand quttro rom as base
ReplyDeleteYeah, you can try if they have same chipset.
DeleteI can use this miui rom for moto x? Port this rom mi2
ReplyDeletehttp://en.miui.com/forum.php?mod=viewthread&tid=306444&extra=page%3D1%26filter%3Dtypeid%26typeid%3D415%26typeid%3D415&mobile=2
Yeah you can give it a try.
DeleteFastboot or recovery zip?
DeleteRecovery zip.
DeletePlease suggest me base rom and port rom, for Oppo R7 plus, i want to port MIUI 8 for R7 plus device, which has the same processor as Yurekha, and IT has Cm13 official Support to, shall I use Stock Color OS, as base or CM13, (Note: Stock Color os is based on lollipop 5.1.1) please advise...
ReplyDeleteYou can use Mi4i MIUI 8 as port ROM. And you can use CM 12.0 as base ROM (if you have) or you can try Color OS 2.0 based on Android 5.0 as base.
DeleteWhy we need ubuntu?
ReplyDeleteIt's required to use SuperR's Android Kitchen which can deodex ROMs and makes ROM porting a lot easier. But it's not compulsory if you are porting an odexed ROM.
DeleteThanks ....
ReplyDeleteIn the MIUI7beta rom from XDA for CPdazen1....there is a option in settings "Advanced settings" in that option we can install apps direct to SD card...and on great feature also that is doubletapp HOME button to sleep and wakeup device..
I found one app in system/priv-app/stocksettings.apk is used for these all feature.
pls suggest how to Add this in my poreted rom.
and also i want to remove "child mode"..."Lite mode" from settings.
need your help
Try replacing the settings.apk with the other one. Or you may try modding settings.apk by decompiling it using apktool. You can find related posts in miui forums. Just search for that.
Deletehi nitesh..im from indonesia,can i port this rom to my device which is msm8929 sd415..my device is rebranding from hisense l676..if this cant..so can you tell me which miui8 that i can port to my device
ReplyDeletesorry for my bad english
You can try porting it from Redmi 2 which has the same chipset.
Deletebut i read from gsmarena.com redmi 2 is sd410 msm8916 and my device is sd415..so far i know that sd410 using 32bit but 415 using 64bit..correct me if im wrong
ReplyDeletewhile deodexding cm 12 i got error boot.oat not found deoxdexding
ReplyDeleteCM 12 ROMs are already deodexed, you don't need to deodex them. LOL!
DeleteHey Nitesh, you have even marked ramdisk.cpio.gz to move from base to port and in the text you haven't mentioned about ramdisk.
ReplyDeleteAnd I had some questions to you, can't we just use the ramdisk of MIUI? Can I use GPe as my base to port MIUI 8? My device: Butterfly 2, Port Device: Mi4
No need to replace ramdisk.cpio.gz. There's a mistake in the SS. I will correct it asap.
DeleteYes you can use the Ramdisk of MIUI but you have to modify it if required.
Yes you can use GPE ROM as base.
And can HTC sense zImage be used?
DeleteYes.
DeleteCan MIUI 8 of mi5 be ported to OnePlus 3? They have Same snapdragon processor 820 but different speeds.
ReplyDeleteYeah. You should try.
DeleteDifferent speeds don't matter, HTC One M8 has MSM8974AB at 2.3 GHz and HTC Butterfly 2 has MSM8974AC at 2.5 GHz and we don't do anything special to port from M8 to B2, just fix camera, NFC, Wi-Fi and create a working boot.img.
Deletehey, i have ported a rom and apparently the rom boots but it shows nothing on the display, i can hear sounds on the boot animation as well as the initialization setup sound,but on the dispay it shows only black screen .Can you lead me for some kind of a fix?
ReplyDeletecan delete META-INF\com\miui and delete it META-INF\com\google\android\updater-script
ReplyDeletehi i'm AlekDev -developer i want to port to Alcatel idol 3 on Android 6.0.1...Can i try to port from your miui8 from Yureka?
ReplyDeletei need your help I'm trying to port color os 2.1 to xiaomi mi4 device but dont boot only it stays in bootanimation can you helpme please. I use a cover rom from one plus x
ReplyDelete