Porting MIUI | On your device



Rep: (532)
Porting MIUIv5 (Android 4.1.2./4.2.2)


Attached Image


The topic cap has been rewritten; we start the discussion of new information withthis post


Owners of devices on the MTK pass by - you have other ways of porting

Owners of devices with ArmV6 - also by, on this architecture, MIUIv5 will not work

Due to the fact that I started to come a lot of questions about porting miui, I'll tell you about one of the ways of porting miui v5 .


Brief Universal Instructions (I recommend to read)


BASIC INSTRUCTION aka porting "pens"
And so, we will need :
* The presence of CyanogenMod 10 / 10.1 on your device, because We will use cyanogenmod as a base.
*Apktool, jBart... in general, see for yourself what you prefer to work with.
* A program to compare files, for exampleMerge, Beyond Compareor analogues.
* Installed adb drivers and ability to use LogCat. (Here is a list of how to use it all. ;))
* A little patience and perseverance.



Training :
The first, and probably the most difficult, is the choice of donor’s firmware (from whom we will port)
I will explain a little what criteria you should pay attention to:
Because Official MIUIv5 are based on stock / aosp firmware - they do not suit us. We are looking for unofficial firmware based on cyanogenmod 10 / 10.1 too. Make sure that the donor firmware is based on CM is very simple - download the firmware, look at build.prop or disassemble boot.img and look at ramdisk. A huge number of such firmware can be found on the site.en.miui.com(The easiest way is to go to system / etc / and look for the file "CHANGELOG-CM.txt." If there is a file, then the firmware is uniquely based on cm (but there are cases that developers delete this file ...)
We do not pay special attention to processors, we pay more attention to the screen resolution. But again, the more similar the device, the easier it will be for you :).


Getting started (a lot of text :)):
* And so, we downloaded miui (donor), prepared CM10 / 10.1 (base) or whatever you have :), unpack the donor firmware (miui) in some folder, next to we put the archive with your base (the basic firmware does not unpack need, everything will be added directly to the archive).

* First of all we take the files
framework-res.apk
framework.jar
services.jar
telephony-common.jar

(lie in the system / framework /) from your base firmware and decomeply them, we place the decompiled files in a secluded place.


*1.We decrypt framework-res.apk from the donor’s firmware, go to framework-res.apk / res / values ​​/ and compare the arrays.xml file with the file from the decompiled framework of the base firmware.
We are interested in the values

<string-array name = "config_tether_usb_regexs">
<string-array name = "config_tether_wifi_regexs">
and if there is<string-array name = "config_tether_bluetooth_regexs">


Attached Image

We replace the values ​​with the values ​​from the base framework (this is necessary for the access points to work).
Next, take the framework-res.apk / res / xml / storage_list.xml file from the base framework and replace it with the file in the donor framework (the drive mounting paths are written in the file, without replacement you most likely will not see the SD card, the PC will not be mounted Yes, and just do the firmware may not boot).
We compile the revised framework-res.apk
2.Open build.prop from your base firmware, look for the line in it
ro.telephony.ril_class = xxxxxxxxx

where xxxxxxx is your ril. We are looking for this file in the previously parsed telephony-common.jar along the path \ smali \ com \ android \ internal \ telephony \
We parse the telephony-common.jar file from the donor’s firmware and add (replace) this file from the base firmware, assemble the framework back.
3.We take the edited files
framework-res.apk
telephony-common.jar

and put them in the system / framework / donor folder.

* Delete the folder from the base
system / app /
system / fonts /
system / framework /
system / media /
.
We put the same folders from the donor’s firmware into the database.
P.S.I recommend to leave the file system / app / Gallery2.apk from your CM10 / 10.1 - otherwise there may be problems with the camera (not always, but it happens)


* Go to the system / xbin folder of the donor, take the files
busybox
shelld
su

and add / replace them in the xbin database.


* Go to the donor's system / bin folder, take the file
installd

and replace them in the bin folder of the base.


* Go to the system / lib / donor folder, take the files
content-types.properties
libaudiofp.so
libdigit_ocr.so
libDmplayer.so
libembed_thunder.so
libembed_thunder_manager.so
libffmpeg_armv7_neon.so
libffmpeg_xm.so
libffplayer_jni.so
libfile_scanner.so
libFreqFilter.so
libimageprocessor_jni.so
libimageutilities_jni.so
libjni_resource_drm.so
libjni_resource_patcher.so
libkeygen_jni.so
liblbesec.so
liblocSDK3.so
liblocSDK_2_5OEM.so
libMiuiGalleryJNI.so
libmp3lame.so
libNativeApi.so
libpatcher_jni.so
libphotocli.so
libPlayer_jni_armv7_neon.so
libshell.so
libshell_jni.so
libshellservice.so
libxl_common.so
libxldpbrothers.so
libmiui_security.so
libmiui_chromium_support.so
add them to the lib folder of the database.
P.S. Libraries can change, so see the exact list on the githaba:
For 4.1https://github.com/MiCode/patchrom_miui/tree/jellybean/HDPI/system/lib
For 4.2https://github.com/MiCode/patchrom_miui/tree/jellybean42/HDPI/system/lib


* Go to the system / etc / donor folder, take the files
Folder "license"
huangli.idf
mdb_pub.key
mdbversion
permission_config.json
pinyinindex.idf
telocation.idf
yellowpage

add them to the base etc folder.
From the system / etc / permissions / folder we take files
com.google.android.media.effects.xml
com.google.widevine.software.drm.xml
com.google.android.maps.xml

add to the database.


* Open the build.prop base CM looking for strings
ro.build.version.incremental = enter the version of MIUI here, for example 4.1.24
ro.config.ringtone = delete
ro.config.notification_sound = delete
ro.config.alarm_alert = delete

Add to the end of build.prop
ro.miui.ui.version.code = 3
ro.miui.ui.version.name = V5
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



* Unpack your boot.img, look for the init.rc file and add the shelld service to the end of the file


service shelld / system / xbin / shelld
class main

(Before class main there should be a tab -in notepad ++ press "tab", then we write class main)

Attention!If you are working with Android 4.2.2, then you need to fix the bootclasspatch. We are looking for a string in init.rc
export BOOTCLASSPATH

and add to it
/system/framework/framework_ext.jar:

We collect boot.img back.


* Open the file \ META-INF \ com \ google \ android \ updater-script and add, almost to the very end of the line
set_perm (0, 1000, 06750, "/ system / xbin / shelld");

It turns out like this:
set_perm (0, 0, 06755, "/ system / xbin / procmem");
set_perm (0, 0, 06755, "/ system / xbin / procrank");
set_perm (0, 1000, 06750, "/ system / xbin / shelld");
set_perm (0, 0, 06755, "/ system / xbin / su");
show_progress (0.200000, 0);
show_progress (0.200000, 10);



At this, the manipulations with the database archive end and the most interesting begins :)



* We flash the received archive, turn on the phone, connect it to the PC and launch LogCat. If the phone boots up - you are incredibly lucky :), but this happens rarely.
In general, the situation is this: the phone does not load, it fell into the so-called bootloop. We look carefully at the logcat and look for an error, this error will be repeated cyclically. For clarity:


Attached Image

This is the error itself:
E / JNIHelp (709): RegisterNatives failed for 'android / view / GLES20DisplayList', aborting

We will correct the situation :)

* We decompile framework.jar from the resulting firmware, follow the path specified in the "framework.jar / android / view /" error and look for the GLES20DisplayList.smali file and compare it with the file from the framework.jar of our base firmware (remember, we decompiled it into the beginning).
Attached Image

Now add the missing lines from the base firmware file to our port file
IMPORTANT !!!: Add only the missing lines, no need to replace the lines !!!


More important !!!
Everything is said figuratively, because it is unreal to explain all the nuances.
I strongly recommend to get acquainted withby thispost and try to understand a little bit what and how it works!


* We compile the edited framework, flash it into the phone. To simplify the task, here is the archive for CWMAttached filetest.zip(191.63 KB)
We put the compiled framework.jar in the archive along the desired path, we drop it on the memory card, we flash through CWM. Next, turn on the phone, connect to the PC, run LogCat and watch again. If the phone started up - lucky, if not, then again we are looking for a recurring error, decoupling the already fixed framework and correct this error by the same principle. We continue until the device starts.


* I think the overall picture is more or less clear, then I will try to paint some dirty tricks.



P.S Starting with Android 4.2.2, adb requires authorization. Therefore, when you first start the firmware, you will not see any Logcat. This is not good, because the firmware with a 95% probability on the first attempt will not start. There are several ways out, perhaps the easiest:
First of all, we install our CM10.1, boot up, enable USB debugging, authorize the device. Next, without any wipes we roll your firmware port - we look at Logcat.



Automatic porting (What technology reached)
ATTENTION! Port using the program does not give you any 100% certainty, because things can always go wrong
As a "base"desirable CyanogenMod with SELinux disabled
>>>>>>>>>Download utility <<<<<<<<<
Instruction:
1. Unzip the archive to hard disk
2. Make sure the folder isdonor The proper files from miui are lying (! necessarily the same version of the android!) [Copy the stock Storagelist.xml / powerprofile.xml that are in / res / xml (you can open framework-res.apk just as an archive)]
3. [TickDRM Patch if you do not want to patch the kernel yourself and Remove NFC if your device does not support it]
4. SelectDPI
5. Apply Patches - I think I don’t need to translate
6. Magic. You can pick up the parcel inbase
Note buttonwipe will bring everything to its original form
---
For the program, thanks to the wonderful man Tquetski @ miuicom


Please do not turn the topic in the order table. The topic discusses the errors received and how to solve them.


There is no curator in the subject. For questions about filling caps, please contact the section moderators via the "Complaint" button under the messages to which you want to add links.
If there is a user in the subject who wants to become a Curator and the correspondingRequirements for candidates, he can apply in the topicI want to be curator(after having studied the topic header and all materials for curators).


Post has been editedNatacha - 09.07.15, 16:18
Reason for editing: A small addition)



Rep: (20)
Anyone familiar with this topic? I have a lot of errors in the "assembly".
Applications (Which by the way were normally decompiled)
framework.jar , framework-res.apk , SystemUI.apk
Give heaps of errors when compiling.
I also tried to build a standard example. Similar situation ...



Rep: (45)
a great topic, whoever else would have ported the thread to Galaxy Tab 2, I think it will not be very different from the first one, but it has already been around for a long time ...



Rep: (20)
It turned out to port. While a bunch of glitches. Just a stunning bunch of glitches :)



Rep: (2027)
rushack
Launched - great. Now go to the stage of editing framework.jar :)



Rep: (567)
Question:

MIUI v4 is updated every week. If to collect patchRom th, what version will gather? Actual? Where does MIUI draw resources from?



Rep: (12)
Is it possible to make miui on alwiner a10?



Rep: (20)
Devil2890 / fix port. Can.



Rep: (0)
Hello I want to make rum under the A10 processor.
The question is what can beat problems?
Will the rum run according to the patchrom-assembly instructions?



Rep: (41)
Hello, as I understand it, if you port miui in the third way, then you do not need to drive through any programs. And the whole way is to simply copy the files?
And yet, what are the risks if ported is not correct?

Post has been editedZigizmundzav - 26.12.12, 15:29



Rep: (338)
Here is the problem ... The port is working all the rules, but the themes and decorations do not apply, if the ROM is supplied from a device similar, will it work?



Rep: (20)
Dudek @ 12.26.2012, 17:15*
Port worker all the rules, but the themes and decorations do not apply

See the FAQ to MUIU, it is written about it (cant with rights)

Dudek @ 12.26.2012, 17:15*
If ROM is delivered from a similar device

It all depends onsimilarity device, and even more so no one will answer this question. It happens on the same devices the same firmware does not get up ... Download, flash, try.



Rep: (8)
Hello. After porting, the sensor stopped working, who faced this?) Repeated flashing does not help)



Rep: (338)
rushack on the site miui added n
The firmware for your device .. we still have silence with the update ..



Rep: (57)
Ported miui, but when loading it gets on the boot animation? There are suggestions how to fix it?



Rep: (2027)
AfGkoLoL @ 01/23/2013, 10:06 PM*
Ported miui, but when loading it gets on the boot animation? There are suggestions how to fix it?

See LogCat, look for errors and fix them.



Rep: (59)
Guys, I tried to transfer MIUI and ... almost got
The firmware is loaded, but the launcher does not start ... Can anyone in the topic? Dopilit, so to speak ...
The basis was firmware FXP203-cm-10-20130119-UNOFFICIAL-jlo

Link



Rep: (338)
Blackbxr and pull with another Xperia does not drive or what? They all have almost the same resources .. on the miui website there are about a dozen of them



Rep: (59)
Dudek
You want to say that you just need to take a launcher from another version of the firmware with miui and try to stick it into mine?



Rep: (338)
Yeah .. exactly.



Rep: (59)
Dudek
Unfortunately, it did not help, but thanks anyway for your help.


Full version    

Help     rules

Time is now: 22/04/20, 21:49