yashsingh1/xdaforums huggingface dataset:
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
MIUI SPECIFICS

This ROM, by far, is the hardest to port from any device. Mainly because it's unlike any other AOSP/AOKP ROM out there. There are certain binaries that you need and without them, your port WILL NOT boot, period.

First, pick what ROM yore porting. SENSE base MIUI or a NON-SENSE MIUI.
If you decide to use a SENSE based MIUI, use a stock SENSE ROM.
If you choose a NON-SENSE MIUI, use an AOSP/AOKP base.
It will work with either one.
If you're porting from another device to EVITA,
use cm10 for AOSP or Rohans AOKP.

If you decide to port MIUI, work through the first part of my guide. Then follow what's below.

Navigate to /system/bin

Pull the installd binary from MIUI and put it in your base

Navigate to /system/xbin

pull the shelld binary from MIUI and put it in your base

same with the invoke-as binary

Navigate to /system/lib

There are 4 libs that are specific for MIUI, make sure you have them in your base.

-content-types.properties, needed for themes
-liblbesec.so, LBE Guard, MIUI su
-liblocSDK_2.2.so, prevents network location service FC
[COLOR="Red"]JellyBean-only:[/COLOR]
-libjni_resource_drm.so, needed for themes as well

Navigate to /system/etc

yellowpage.db, if you want to have phone calls... You'll need this
telocation.td, also could be named as telocation.db, location provider service

Navigate to /system/etc/permissions

Add to your base:

com.nxp.mifare.xml, nfc
MIUI-framework.xml, activates the framework.jar
com.google.android.media.effects.xml, needed for Gallery
com.google.widevine.software.drm.xml, could effect Playstore
com.google.android.maps.xml, Gmaps

BUILD.PROP EDITS

Along with what's needed in the first part, these are needed as well to have a true MIUI port.

ro.config.ringtone=
ro.config.notification_sound=
ro.config.alarm_alert=
ro.config.sms_received_sound=
ro.config.sms_delivered_sound=

UPDATER-SCRIPT

Any release/port of MIUI should have this line:

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

Example so you know what I mean:

set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
[B]set_perm(0, 0, 06755, "/system/xbin/invoke-as");[/B]
set_perm(0, 0, 06755, "/system/xbin/tcpdump");

Probelms with the SU binary?

Remember I told you not to mess with symlinks? Well.. You need to if you have SU problems...

put this line into your Updater-script

symlink("/system/xbin/su", "/system/bin/su");

paste it somewhere after

symlink("busybox"[B][big code bunch like "/system/xbin/etc][/B]

but before

Unmount("/system")

Logcat showing something to the effect of "failed to initialize shell service?

That would be a shelld problem..

Use the Android kitchen to break down your boot.img in your base into the ramdisk and zImage(kernel)

In the ramdisk there is a file called init.rc

Open with a text editor

At the very bottom, paste these lines:

service shelld /system/xbin/shelld
class main

Then...

/dance.

You now have a working MIUI port, bugs are your only issue now. :p

​
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Downloads

ADB/Fastboot -

FOR LINUX ONLY

Smali/Baksmali​
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
How to Obtain a Logcat

Download my adb/fastboot zip

Once downloaded, open cmd prompt in the adb dir. If using win7, hold shift+right click - If you're on Ubuntu CTRL + ALT + T

Type: adb devices - your serial number should show in cmd prompt.

Then type: adb logcat > logcat.txt - this will spawn a .txt file in your adb folder.

Recreate the error while you're running above cmd.

Press Ctrl+C to stop logcat.

Post logcat.txt contents into www.pastebin.com (make sure expire option is on the never option)​
[AT&T, Rogers HTC One X, Telstra One XL] BreatheHT:
OMG... I love you man!!! Great stuff
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
I do believe I left a few things out but I can't remember what.. an hr and a half of straight typing has me a little confused... lol
[AT&T, Rogers HTC One X, Telstra One XL] nbunn:
Oh goodness I see a lot of bricks in the Evita's future. Haha. Good stuff though man!
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
In no way will your phone brick if you mess with system files. Now.. the boot.img on the other hand....
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
Patients should be "patience"

Sorry man that caught my eye Lol :p
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Fail... Thanks for that. I knew I would probably mess something up.. lol
[AT&T, Rogers HTC One X, Telstra One XL] Venomtester:
Very Nice!
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
Lol sorry man. I gave it another shot last night and it acts like it flashes... Then says failed. But it'll let me reboot system. (It usually says no OS when something fails) when I reboot it'll go to the ROMs boot animation. But never gets past that. I'll grab a log cat this afternoon, it was late last night and I work extremely early. Your guide is the way I've been doing them and they always worked. Don't know what's up with this one.

Carbon, black bean, and deviantxone I was able to literally swap apps, framework, media, fonts... Then swap permissions.. Then set perm lines in updater script and those 3 worked perfectly. This one won't wtf lol
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Flash again but before you reboot after the fail,

Type adv pull /tmp/recovery.log

That will tell you why it failed in twrp
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
Adv or adb
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Adb damn auto correct on my phone...
[AT&T, Rogers HTC One X, Telstra One XL] Shandness:
Yeah. Waiting for this.

I try to port miui v5 and stuck on boot logo.

Maybe u can help me :beer:
[AT&T, Rogers HTC One X, Telstra One XL] AdhvanIt:
Good job on the tutorial. :)
[AT&T, Rogers HTC One X, Telstra One XL] :
Thanks man!
[AT&T, Rogers HTC One X, Telstra One XL] avery.0:
Was really hoping someone was going to port this :) If not i was even tempted to give it a try!
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Glad to hear. If you need anything else, my PMs are open and so is this thread.
[AT&T, Rogers HTC One X, Telstra One XL] rdannar:
Good beginner tutorial. It would probably be helpful if you and others came up with specific libs and bin files that must stay as the base, then you take those few files and swap them over instead of always comparing files.

I have done a similar tutorial on the x10 that specified certain files. Also did it for the Motorola bravo. Once you pinpoint the files it makes porting a lot easier. Hope the link below helps guide what I am asking about for files. It has helped many others back in the day of x10, arc, atrix, bravo, and quite a few other devices.

Great to see a thread like this.

---------- Post added at 12:57 PM ---------- Previous post was at 12:53 PM ----------

http://xdaforums.com/showthread.php?p=13484770
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
.....Thanks. As you see it's not 100% complete.
[AT&T, Rogers HTC One X, Telstra One XL] rdannar:
Post wasn't directed towards Myrder but others trying to help this thread. I've got nothing but love for you starting this thread.
[AT&T, Rogers HTC One X, Telstra One XL] jjames1136:
man i wish i had a copy of the parinod 3, hoping some one will port att sense 5 rom instead of the one from sprint because that one is full of errors and phontom battery drains. and service issues.
[AT&T, Rogers HTC One X, Telstra One XL] Protogon:
Hmm, I feel like giving this a shot. What would I use for the base, though? The current Sense 5 port? A Sense 4 ROM?
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
For PA, use a 4.2.2 aokp base. Its explained in my guide...
[AT&T, Rogers HTC One X, Telstra One XL] Protogon:
I was referring to the ATT HTC One Sense 5 ROM...
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
The current sense 5 port is awesome. Its what I'm running and I haven't had any issues.

Don't bad mouth a ROM unless you've flashed it.
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Its a bit late seeing it was you posting this but thanks! You've seriously taught me everything I know.

Everyone, this guy right here... He is an example of true altruism.
[AT&T, Rogers HTC One X, Telstra One XL] jjames1136:
I would get one the basic rom from the htc one froum and then work on porting it over.
[AT&T, Rogers HTC One X, Telstra One XL] Heisenberg:
Myrder's right, that ROM is awesome. It's running perfectly for me.
[AT&T, Rogers HTC One X, Telstra One XL] jjames1136:
i just put it back this time with the v2.5 and its alot faster and smoother
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
For those of you who ported a ROM and end up releasing it to the community, please post with a link to the thread so I can put it OP

Tuesday, for those of you looking to port MIUI, I will be upping the tricks to it.
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Guide has been made a little more "clean" and updated with the specifics to MIUI porting.

HAPPY PORTING!
[AT&T, Rogers HTC One X, Telstra One XL] tyessen:
This thread makes me happy I decided to slap Ubuntu onto my laptop... Now to begin the eye-burning file comparing!
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
I'll add this to OP but in the mean time..

Just select all files in /system/lib and copy over to you base. If it asks to replace and what not, don't. Check apply all in the prompt and click skip.

Take note of what you copy over and make a template if you plan on continuing dev on your port. That way you don't have to do this whole process 20,000 times.
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
hey myrder, would you mind looking over a logcat for me? I still dont know how to read them that great :o
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
android.util.ExtendedPropertiesUtils.readFile:(Ljava/lang/String;)Ljava/lang/String;[\B]

Framework.jar

/android/util/ExtendedPropertiesUtils.smali sans bolded code.

meaning search the above smali for the bolded string and bring the missing code over from your port. Or to make it easier, because sometime Meld can be a little weird search for "readFile". might take a bit longer, but it can work.
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
Eh I don't know what to edit. I'll keep poking around but I feel like I'm trying to decipher chinese
[AT&T, Rogers HTC One X, Telstra One XL] ImagioX1:
Lol I feel like that sometimes too lol

Sent from my HTC Evita running Sense 5 RX ALPHA
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
In Meld, it will be a GREEN code block that you need to add over from your port to your base.
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
So to use meld or edit the strings you seen I would have to have Linux.. Hmmm I just uninstalled it 2 days ago when I upgraded to windows 7 lol. I'll try to put it back on there for that though... I'd rather do it the correct way
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Meld isn't just for Linux. It's for When-doze as well. Sorry for that, I guess I need to add that to OP. lol

Porting can be done on either OS, I just prefer Linux because it's just a little easier for me. It's what I started on. I only use When-doze for college stuff.
[AT&T, Rogers HTC One X, Telstra One XL] Daxxer2007:
Linux also works faster.
[AT&T, Rogers HTC One X, Telstra One XL] :
You mean Win-doze.

I think you forgot one thing in this tutorial. and thats how to fix MMS. I taught you better than that!
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Ehh.. This is just the basics. The main question I got from everyone who was trying to port MIUI was, "why isn't this booting? The logcat says something like 'trying to initiate shell service but, it fails every time.'" So I decided to put that in here. MIUI v5, now that it's 4.2.2 has a shelld problem hardcore. So far, that's the only to get the shelld working.
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
I know there are still a few things that I need to add to this guide. But does anyone have any requests on what to add or need a detailed explination of what anything is?

Things I will be adding:

How to use APKtool

Anything that's requested that I feel relates to porting.
[AT&T, Rogers HTC One X, Telstra One XL] ImagioX1:
One thing I would like to see is a good guide on modifing the boot.img to work with ports from different phones. Very few kernel modding guides out there. I understand that this might actually be quite a complicated guide to write though LOL:p
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
To be very honest with you, I'm quite ignorant on kernel porting/modding. Just because I'm not too familiar with what files in the boot.img contain and/or do.

I will look into this for you, though.
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
Dang. Myrder.. Tried hunting down the causes for my port not to get past animation. No success. But I wanted to ask you. Im porting an aosp rom WITHOUT the 3.4 kernel, but using a rom WITH 3.4 kernel as base. Incompatible maybe?
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
There is a big chance the 3.4 kernel is your problem. What's your logcat say..? If your logcat doesn't have any errors then try this:

from terminal:

adb shell

system_server

You may have to input SU after the shell cmd.

Lmk what the system_server is saying.
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
Sorry to be "that guy"... But do I need to run those commands while its on the boot animation?
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
This thread is meant to be an informative/help thread. There are no "stupid questions" here, just remember that.

Boot the phone up with the ROM you're wanting to get working.

-plug into the computer

-open a terminal/cmd prompt

-type:

adb shell(press enter)
system_server(press enter)

If you're not given an output from system_server, this could be why:

adb shell
[B][U]su[/U][/B]
system_server

If you're ever stuck and the logcat doesn't show any errors with smali code, system_server is helpful.

You also might look at getting a dmesg or k-something.. I forget the name of the log that starts with k but, it's dealing with kernel stuff. I'm sure you can search around and find out how to obtain that log. If not, I'll poke around and find it for you. :)
[AT&T, Rogers HTC One X, Telstra One XL] thinhletien:
If you dont mind, just port a latest MIUI rom for us haha, i am so noob to do that, really true story T_T, i can donate for latest MIUI v5 rom for 1xl :(((
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
There is a v5 sense base miui in original dev section
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
This is a guide to teach you how to do it. Someone will port it. I just don't have the time to maintain a ROM like MIUI
[AT&T, Rogers HTC One X, Telstra One XL] thinhletien:
Ye, port from 1S, i knew that. But that project stopped working already. No update any more if im not wrong :crying:
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
You're incorrect.

I know something going on behind the scenes.

Also, I will be editing some of this guide to give a better idea of what I few things are/what they do/why the are needed. Along with APKTool info/how-to and troubleshooting information. Most of this will be done tomorrow. APKTool will be over the next few days, OR I might just do a picture guide and post it in General for a better idea of what steps to take. Only because that tool alone will cause you a ton of headaches. It has me until I learned how to use it properly.
[AT&T, Rogers HTC One X, Telstra One XL] ImagioX1:
If you don't mind me making a suggestion why don't you use virtous ten studios instead. All in one tool that can do everything dsixda kitchen can do for Windows users.

Sent from my HTC One XL using Xparent Red Tapatalk 2
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
I've never used VTS before.

Everything I used is Linux compatible.
[AT&T, Rogers HTC One X, Telstra One XL] Notorious:
nice guide m8 but your missing a lib libimageutilities_jni.so needed in MIUI V5
[AT&T, Rogers HTC One X, Telstra One XL] InflatedTitan:
Myrder can you look over something fir me? Is it pin-pointable or just a clusterfluck of fatal errors... It's hanging on boot ani

https://www.dropbox.com/s/2rc33qln8ec9hd8/Log2.txt
[AT&T, Rogers HTC One X, Telstra One XL] dktblade:
[PC][Guide] MIUI Ultimate Porting Tutorial

Read more: http://en.miui.com/thread-5432-1-1.html
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
E/JNIHelp ( 811): Native registration unable to find class 'com/android/internal/os/RuntimeInit', aborting

F/libc ( 811): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 811 (zygote)

Grep services for 'com/android/internal/is/RuntimeInit'

Let me know what it says
[AT&T, Rogers HTC One X, Telstra One XL] cemanie:
[MENTION=4927184]Myrder[/MENTION] you said

download my smali/baksmali package.

where i can get it,i'm try to port miui one s 3.7.12 and stuckon here..

I can not find that as you say smali.jar,thanks
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
In the quote is my smali/baksmali package

Please make sure you have read the entire thread, my downloads post was the last one.
[AT&T, Rogers HTC One X, Telstra One XL] cemanie:
Thanks brother [MENTION=4927184]Myrder[/MENTION], i've done it.. Miui 3.7.12 is on my hand. You are the best..

Stiller try on bug, hope you can help..

I port it from miui one s 3.7.12

With Base miui 3.5.3 [MENTION=3026199]pspunderground[/MENTION].

Thanks for ur attention to keep me carefully.

My One XL miui 3.7.12
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Well done! Glad you have a working port!

My advice is instead of using an MIUI port as a base, take one of the stock rooted XL bases we have and port it onto it. With you porting onto our MIUI that gives you all the bugs from it(MMS, and a few minor bugs) and bugs from your porting process.

Again, it is your ROM you do what you wish. ;)
[AT&T, Rogers HTC One X, Telstra One XL] cemanie:
Oke, i'll try it Again as you mean, One XL rooted as base and put MIUI onto it.

Can i use cm 10.1 as base (4.2.2) ?

Please advice me, thanks for your support.

My One XL miui 3.7.12
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
If you're porting the sense MIUI use a stock sense base, if you're porting AOSP miui cm10.1 would be okay. As long as the MIUI version is 4.2.2
[AT&T, Rogers HTC One X, Telstra One XL] MDMonster:
I would assume this is similar with other devices too? If so, I want to port a MIUIv5 4.2.2 ROM to the Atrix 2. There already is one, but does not work on the AT&T variant of the Atrix 2. My question is, how would I go about porting with a kexec kernel working? Any extra steps? Or would I just have the base ROM be kexec based?
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Base ROM needs to be kexec as well. This guide will work and I will be able to help you along the way if you need it.
[AT&T, Rogers HTC One X, Telstra One XL] MDMonster:
Okay. I'm on Linux also, if that matters much.

EDIT: Nvm about Linux. So do they both have to be of the same version? I'm wanting to port a MIUI v4 4.1.2 based kexec to the Atrix 2. It'll be my 'practice' ROM. The base kexecs for my phone are all 4.2.2, would that matter too?

EDIT EDIT: Nvm, I finally noticed the part where you say that it wouldn't work. I'll try to find a 4.2.2 port of something else.
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Because I'm lazy, would you mind posting the link to your forum? I'll give a look and give you suggestions for a base.

Edit: if worst comes to worst, you might just go ahead with 4.1.2 MIUI and when you get a 4.2.2 ROM port 4.2.2.

This guide needs an overhaul update for notes on 4.2.2, though. Its much harder to port than 4.1.2. The binaries operate differently.
[AT&T, Rogers HTC One X, Telstra One XL] MDMonster:
http://xdaforums.com/forumdisplay.php?f=1376- for my phone, the atrix 2. (BASE ROMs)

http://xdaforums.com/forumdisplay.php?f=1363- The phone I am porting ROMs from.(PORT ROMs)
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
You have a wide selection of base ROMs to choose from. Personally, I would choose Carbon as base for stability.
[AT&T, Rogers HTC One X, Telstra One XL] MDMonster:
But how do I go about porting? Is there anything special I have to do? With them being kexec and all.

EDIT: The big thing I want is MIUI, the main reason I wanna try porting ROMs, I want us, atrix 2 community, to have a kexec based MIUI.

http://xdaforums.com/showthread.php?t=1756659

This seems to be the most stable on the razr to port, but it is not kexec based. Any special things I'd have to do to get it kexec'd and ported?
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Shouldn't be anything special or require extra work. Then again, I could be wrong. Just follow my guide and get a logcat. I'll take a look and evaluate from there.

I've sent you a PM to get a more rapid response from me.

Good luck and happy porting!
[AT&T, Rogers HTC One X, Telstra One XL] Slimegod:
Trying to port a Verizon s3 MIUI rom to my Sprint s3. Heres my logcat. My homescreen date/time widget isn't loading, my themes aren't downloading and my nav bar still says Verizon wireless instead of Sprint. Thanks for the help and this thread.
[AT&T, Rogers HTC One X, Telstra One XL] Th3ArchAngel:
Thanks much for the tut. Can't wait to get my miui port going.
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
Themes could be because a missing lib file.

Widget, I need to search further into but im certain it's because "W/ScreenElementRoot( 791): scale not initialized!". Check you /bin folder to make sure that's in.

Navbar issue mihgt be build.prop but could also be something else.

Check for those things and get back with me.
[AT&T, Rogers HTC One X, Telstra One XL] Slimegod:
These lines are where the issues are...

E/BatteryService(26335): wirelessOnlinePath not found

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

E/dalvikvm(26335): Requested: Lcom/android/server/location/GpsLocationProvider;.

native_agps_set_ref_location_cellid:(IIIIII)V

E/dalvikvm(26335): Candidate: Lcom/android/server/location/GpsLocationProvider;.

native_agps_set_ref_location_cellid:(IIIII)V

E/JNIHelp (26335): RegisterNatives failed for 'com/android/server/location/GpsLo

cationProvider', aborting

F/libc * *(26335): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2633

5 (system_server)[/QUOTE]

I was able to get that fixed. This is a new logcat. Using a fresh base cm 10.1.3. Porting the same Verizon to Sprint s3. Stuck on boot animation.
[AT&T, Rogers HTC One X, Telstra One XL] Myrder:
I was able to get that fixed. This is a new logcat. Using a fresh base cm 10.1.3. Porting the same Verizon to Sprint s3. Stuck on boot animation.

I have bolded what you need to look for.

Open services.jar and copy that method over from base to port.

Also, just out of curiosity could you send me the 10 lines before and after that fatal signal 11?
[AT&T, Rogers HTC One X, Telstra One XL] Slimegod:
Have a question. I'm trying to recompile a jar file and it tells me it can't fine the resource with a "W" next to it. Don't know if the methods I took were right. The jar file with what I wanted I decompiled it pulled it to the side. Replaced that that jar with the one I wanted it to be at, decompiled it, replaced it and recompiled and that's where I got my error.
[AT&T, Rogers HTC One X, Telstra One XL] :
[MENTION=4927184]Myrder[/MENTION]

Can you explain a little more with step number 7. When you say to open and compare both build.prop files, what exactly are you recommending based on your experience? Are we taking away, adding without removing 'diffing', or making the base look identical to port? Thanks. Just needing clarification bro. Awesome tutorial.