This is device specific but you can use this to port to another device, just use the proper stuffs. This is a help for the new users who wants to collaborate and learn a bit, I can't promise you that doing this ypur rom will boot easy, I didn't ported v5 yet but the process is closer to v4 porting so reading, researching and using the head, maybe, you will make a bootable port.. Just give it a shot and try. More people involved on the same project will make more easy everything so work together and respect each other, don't be a noob/kanger/idiot..
This will cover from kernel built to framework patch. So you will:
• Build CM kernel for MIUI
• Port MIUI diffing and patching the 'framework' and copying the propper files to make it bootable
• Learn a bit about how Android works
• Learn how to debug and make/use reverse enginnearing
• Spend more time porting than being with a girl and friends? C'mon, get a life..
O.S.:
• Windows 7 - You will use it for almost everything
• Ubuntu 13.04 (x64 bit) (Yes, use this one just because I say it) - You will use it for kernel building
Software (Windows only):
• Notepad++ - For 'build.prop'
• WinMerge - For smalis diff., I don't care if Notepad++ have 'compare' plugin, WinMerge is the best for methods blocks compare
• Smali/Baksmali tool - The best in this case to decompile the framework
• WinRAR or 7zip - Seriously? C'mon, I don't need to tell you why you will use this..
• Android SDK - For 'adb' tool
Done!! You're ready to start with this, so buy a Coke or a beer or whatever you want, buy cigarrs and time, you will need a looot of time, this is not hard but takes to much time testing, fixing, pushing, testing again, fixing again, reading and paying attention..
This is a 'Work In Progress' guide 'cus I am at work rite nao, so I can't make all the guide now but I will continue this as soon as possible.. I will do the guide first and then I will add some pic's and examples to make it more easy to understand the whole proccess so stay tuned..
Credits:
@frapeti, @diego-ch and Team Canjica for supporting me, staying with me, teaching me, for everything I learned whit them. This were nothing without them, for real!!
@Lens_flare for the 'How to port..' bible he made of MIUI, this were nothing without him too, you guys should thanks him!!
@xboxfanj for teaching me a lot too in a lot of MIUI related stuff and other things too
And for everyone who was in my way of MIUI porting 'school', teaching me, helping me, guideing me, for everything!! Sorry if I forgott some one, tell me and I will be glad to add it here.
ⓣⓐⓟⓐⓣⓐⓛⓚ
Building the kernel:
MIUI can boot with CM or AOSP kernel but you will need to change/add a few lines in it for MIUI. You have 2 ways to do those changes, unpacking the kernel or build it. Just because I am so nice and want you guys to take the most harder way because is the best way to learn and understand moaar all this I will tell you how to build the kernel from source, beside that is better this than unpacking and repacking the kernel. Let's start initializing the environment:
• Install the Android SDK and set it up (the instructions are on his own web page so I will not explain this)
• Open a 'Shell' (is the same as 'Terminal Emulator' on Android) and copy/pasta this:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
This step will install the Java JDK. After that, you will have to install a couple packages, so, again, copy/pasta this:
Code:
$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
After the required packages were installed, will be time to install 'repo', so copy/pasta this:
Code:
$ mkdir -p ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
'CCACHE' (this will speed a lot the build proccess!!)
-TO BE ADDED-
Reboot your PC and boot again in Ubuntu. Now is time to sync the source, so open a 'Shell' again and copy/pasta this:
Code:
$ mkdir -p ~/android/system/
$ cd ~/android/system/
$ repo init https://github.com/TeamCanjica/android.git -b cm-10.1
$ repo sync -j4
$ ./vendor/cm/get-prebuilts
$ . build/envsetup.sh
$ cd frameworks/av
$ git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_av refs/changes/21/46421/3
$ git cherry-pick FETCH_HEAD
$ cd ../..
$ cd system/core
$ git fetch http://review.cyanogenmod.org/CyanogenMod/android_system_core refs/changes/32/45032/3
$ git cherry-pick FETCH_HEAD
$ cd ../..
At this point you will be able to build just the kernel or a fully CM10.1 rom. Maybe, when syncing and cherry picking ends, you wanna do again:
Code:
$ repo sync
Just to be sure that the entire source is fine.. Now, let's make some changes in the kernel. We will need to add the 'shelld' service, add 'framework_ext.jar' and make adb insecure:
* 'shelld' service and 'framework_ext.jar'
We will need to add this service (without this, Theme manager will not work or the launcher will FC, in example..) into the 'init.rc'. Watch the source https://github.com/TeamCanjica/android_system_core/blob/cm-10.1/rootdir/init.rc, that is the 'init.rc', now pay attention to the path of that file "android_system_core/rootdir/init.rc", that shows you where the file is, so in your PC will be on "android/system/core/rootdir/init.rc", that's the file we will use to add this service so open it scroll down to the bottom and add this at the end:
Code:
service shelld /system/xbin/shelld
class main
Now we will add 'framework_ext.jar' so press on the keyboard 'Ctrl+F' (search tool) and find 'export BOOTCLASSPATH', you will find something like this:
Code:
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
Done? Fine, now to you have to add
Code:
:/system/framework/framework_ext.jar
between ':/system/framework/framework.jar' and ':/system/framework/telephony-common.jar', so the entire line should be:
Code:
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar[B]:/system/framework/framework_ext.jar[/B]:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
Got it? Nice, that's all in the 'init.rc', now we can make it insecure or just build the kernel as 'eng' flag (Why 'eng' and not 'userdebug'? 'cus 'eng' will always be insecure), but if you wanna make it insecure just do this:
-TO BE ADDED-
Whitout this step, you will never be able to do logcats so you will never know why keeps bootlooping.. Interesting rigth? Jejeje
Now, fiiinaallyyy, let's build the kernel. Open a Shell and more copy/pasta:
Code:
$ cd ~/system/android/
$ . build/envsetup.sh
$ lunch cm_janice-eng
$ mka bootimage
Done, leave it building.. Could take 10~30 min. or even more.. You can pick the product on '/out' folder, the Shell will tell you where the file is anyway. Pick the kernel and copy to Windows partition through explorer (Why? You will need it and will not be able to pick it from Windows due to unsupported 'extx' partition from Windows).
Done with Ubuntu, time to get hands on Windows, so boot it up. The next step is the base of this 'cruzade' (LOL).
Our device, Advance or Janice or GT-I9070 (whatever), have a HDPI density so we will need to work with HDPI roms. First of all, we will use 2 roms:
* CM as base for port(called 'base' from now)
* MIUI as rom to port, obviouslly xD (called 'port' from now)
Download both of those roms, most newer CM build and MIUI. For MIUI, download most newer rom of any HDPI device based on 4.2.2 (yes, 4.2.2, so no place here for any CM10 build, CM10.1 only allowed). In MIUI v4 port I used 'crespo' (or better known as 'Nexus S') MIUI rom 'cus that device and the Advance have the same screen and density but the main issue is that I found just one MIUI rom for Nexus S based on 4.2 and I was unable to make it boot (I didn't worked hard anyway, just focused on the kernel only and minnor changes) so I can't be sure if that MIUI will be bootable, anyway if you find any other MIUI rom or wanna try with another rom is fine, but I recommend same screen and density. If you choose, in example, a XHDPI rom to port be prepared to face some oversized UI, but if you can deal with that then is fine for me, just be sure that is 4.2.2 based, no 4.1.2. I found this MIUI, maybe is the best shot:
http://en.miui.com/download-4.html
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
'Developer' version (not in the image case, that dev. version are v4, the third are v5.. Nevermind, the image is just illustrative) will be better 'cus MIUI came with his native root admin but in the 'stable' version they sometimes deactivate that, in 'developers' no, so you will not face any root headache.. =P
Let's see what we already did:
* Installed all the tools for Windows
* Installed Android SDK
* Installed Java
* Installed all the needed packages
* Synced the CM source for the kernel
* Modded and built the kernel
* Downloaded latest stable CM10.1 for base and MIUI for port
* Donated a beer to me and my awesome Canjica crew
* Sent me your credit card number
Nah, just kidding in the latest 2 points. I'm trying to make you laugh, this make this heavy work more funny instead of boring. Did you realized all the stuffs you did? Be proud that you already made too much and hope you learn a bit more about all this Android world, not about coding, just about necessary tools, how to set it up, the proccess, etc..
Now that we already have the kernel ready and we have the base rom and the port rom we will start with the most simple proccess, copy/pasta the necessary files. As @Lens_flare shared to everyone in his excellent guide (trust me, you will use more that guide than this one, here you have a more detailed proccess for one specific device, there you have a more detailed fixes of almost every 'framework' issue, so he really deserves a hugh thanks guys). Take the CM zip file and unpack it on a new folder (I always make a new folder on desktop called 'MIUI v'x' - 'device', in example: 'MIUI v5 - Advance', got it? Great!). We will basically drag and drop some files from port zip file into base project folder (the 'project folder' will be the folder you made and where you unpacked the base rom to work with it). Now you will have 2 folders, 'META-INF' and 'system', and 1 kernel, 'boot.img'.
Let's talk about it:
* 'META-INF' folder have the necessary files to make it flashable through CWM/TWRP recovery, the most important is the 'updater-script' because it have the 'instructions' and 'how will install' the rom
* 'system' folder, hmm, well, this have the system, should I have to explain something about this folder? =P
* 'boot.img' file is the kernel so no need to explain anything about it too
Now that you have those 3 folders/file, let's continue with the copy/pasta of neccessary files:
* Delete 'boot.img'
* Open 'system' folder and delete 'apps', 'fonts', 'framework' and 'media' folders
We will need those folders but the MIUI ones, so take those folders from port rom zip file and paste in 'system' of the project folder. Do not overwrite those folders, just remove the CM ones and add the MIUI ones.
Now, in the port rom zip file, go to '/system/etc' and copy this files:
* telocation.idf
* yellowpage.db
* secomxregistry
* pinyinindex.idf
* unicode_py_index.td
* permission_config.json
* spn-config.xml
And paste it on '/system/etc' folder in the project folder. Now you can overwrite those files and if you can't find any of the listed files in the port rom, just ignore it.
Now, '/system/etc/permissions' of port rom zip file. Some users, me too for v4, took this files:
* com.nxp.mifare.xml
* com.google.android.media.effects.xml
* com.google.widevine.software.drm.xml
* com.google.android.maps.xml
And placed in '/system/etc/permissions' of the project folder. The main issue is that I never saw those files in MIUI v5, that's why some users directly copy all the files from that folder, so let's try this, copy all files from '/system/etc/permissions' in port rom zip file except:
* handheld_core_hardware.xml
* platform.xml
Do the same with the '/system/lib' folder, copy this files:
* content-types.properties
* libFreqFilter.so
* libaudiofp.so
* libffmpeg_xm.so
* libffplayer_jni.so
* libimageutilites_jni.so
* libjni_resource_drm.so
* liblbesec.so
* liblocSDK_2.5OEM.so
* liblocSDK_2_5OEM.so
* libmp3lame.so
* libpatcher_jni.so
* libphotocli.so
* libshell*.so
And paste in '/system/lib' folder. Again, if you have to overwrite any of those files, do it and if you can't find any oh those files in the port rom zip file then just ignore it.
Now, in the port rom zip file go to '/system/xbin' and take this two files:
* shelld
* su
Like before, drag and drop in '/system/xbin' on the project folder and overwrite it. Done? Excellent, now we are going to work with the 'build.prop' located in '/system' on the project folder. Open it with 'Notepad++' and search this lines:
* ro.build.id
* ro.build.display.id
* ro.build.version.incremental
* ro.config.ringtone
* ro.config.notification_sound
* ro.config.alarm_alert
We need to set these lines with proper values:
Code:
ro.build.id=MIUI
ro.build.display.id=MIUI
ro.build.version.incremental=x.x.x
ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
'x.x.x': this value can be setted with your birthday if you want it but will be better if we set the proper value to remember what MIUI build was used to port. To be more clear, watch the image I posted a couple lines up near of the red 'PORTED ROM', below the author you will see this: 'Version 3.12.6 ( V5 )'. The '3.12.6' is the incremental number and means this:
* '3' -> 2013
* '12' -> December
* '6' -> Day 6 of the current month
Got it? Great. Now you know how to set that value, the rest leave it like I posted.
Now, pick the 'boot.img' already compiled on Ubuntu and place it on the project folder. Done? Great, now you can select 'META-INF', 'system' and 'boot.img' files and compress it in a '.zip' file with WinRAR. Remember to select it as a zip file and Normal compression. Name that zip file as you want it, I always named as "MIUI vx - Test 1".
Finally you have the zip file, of course will booloop 'cus the framework were not diffed and patched, here is when 'adb' is crucial, from now we will work with 'smali'backsmali' and 'adb' tools.
To fix it step by step, you have 2 methods, one of them is flash the rom and make logs looking the error that cause the bootloop or patch the commons smali's first and then look the errors that cause the bootloop. Those smali's are inside of 'framework.jar' and 'services,jar' located on '/system/framework'. So, create 2 folders, the first one called 'CM' and the second one called 'MIUI'. Now open the original CM zip file and extract 'framework.jar' and 'services.jar' on CM folder. Do the same with the original MIUI zip file, pick those 2 files and extract it but on MIUI folder. Now we need to put a copy of 'smali' and 'baksmali' tools files on both folders. Done? Ok, now let's decompile the 'framework.jar' first opening the CM folder and a cmd window (just press 'Mayus' on keyboard and left click on any clean space on CM folder and select 'Open a command prompt here...' or go to 'Start' and write 'cmd' on search toolbox, open it and use 'cd' command to go to the CM folder). Now on the 'cmd' run this command:
Code:
java -jar baksmali.jar -b framework.jar -o framework.jar.out
Leave it finish and you will have a new folder called 'framework.jar.out', open it and you will find all the smalis in those folders. Do the same with the MIUI framework, open the folder, open a cmd and run that command. Ok, now it's time to overwritte the common smali files from CM folder to MIUI. Those common smali's files are this:
* android/content/res/PackageRedirectionMap*.smali
* android/hardware/Camera*.smali
* android/media/AudioFormat.smali
* android/net/wifi/wifichannel.smali
* android/net/wifi/wifinative.smali
* android/os/SystemProperties.smali
* android/view/Gles20*.smali
* android/view/inputmethod/inputmethodinfo*.smali
* android/webkit/html5*.smali
* android/webkit/selectactionmodecallback.smali
* com/android/internal/app/ActivityTrigger.smali
You can just take those smali's and overwritte it. The next step will be add/patch missing 'methods' (the 'methods' are blocks of code), you only need to add the missing methods, not modify anything, I mean, if 'x' are not present in the MIUI smali, you will have to add it, here is where Winmerge gets in. The smalis you will have to patch are:
* android/content/res/AssetManager.smali
* android/media/AudioFormat.smali
* android/webkit/WebSettingsClassic.smali
So compare those files with the CM ones and add from CM smalis to MIUI smalis always. That's all with 'framework.jar', now we will patch 'services.jar', so again, overwrite from CM smali files to MIUI files this files:
* com/android/server/input/InputManagerService*.smali
After that you will have to patch 'PowerManagerService.smali' located at 'com/android/server/power'. Search the block '.method private static native nativeCpuBoost(I)V' and add it from CM to MIUI one. Done? Nice, now compile 'framework.jar' and 'services.jar' doing this from a Shell (or cmd or whatever you call it):
Code:
java -jar smali.jar framework.jar.out
and
Code:
java -jar smali.jar services.jar.out
Running those commands you will compile both files again and you will have as result a file called 'out.dex', that file will have to replace the 'classes.dex' inside of both '.jar' files (framework and services). So, to make it easyer, compile 'framework.jar', rename 'out.dex' result to 'classes.dex', open 'framework.jar' and drag and drop 'classes.dex' from folder to 'framework.jar' zip file overwritting the one inside, then do the same with 'services.jar'. Done? Great, now pick 'framework.jar' and 'services.jar' and paste in the rom in 'framework' folder. Excellent, now is time to flash the rom and start making logs. This is the most heavy step 'cus you will have to test, find the error (for sure will be a smali framework error), patch it and then flash it, agaain, test, search the error in logs, patch it too, and flash it, that's why is heavy, is a repetitive proccess. You will have to do that one, two, three, four, five times until properlly boot.
ⓣⓐⓟⓐⓣⓐⓛⓚ
And this too (=
ⓣⓐⓟⓐⓣⓐⓛⓚ
so...
sinan5858 said:
so...
Click to expand...
Click to collapse
Do you have any idea what you just said??
Be respectful and thankful to him for creating that thread to help the noobs to develope MIUI..:good::good:
Fed , im waiting
I know you guys are waiting this but I was out the past weekend and this week I will be really busy, in fact, my job is killing me, tomorrow gotta go sooner than always because I have to do a lot of stuffs but I promise I will finish this this week.. Sorry guys for making you wait too much but, please, understand me!! =(
Enviado desde mi C6602 mediante Tapatalk
fedevd said:
I know you guys are waiting this but I was out the past weekend and this week I will be really busy, in fact, my job is killing me, tomorrow gotta go sooner than always because I have to do a lot of stuffs but I promise I will finish this this week.. Sorry guys for making you wait too much but, please, understand me!! =(
Enviado desde mi C6602 mediante Tapatalk
Click to expand...
Click to collapse
Ahha , No problem dude
Take Ur Time <3
Updated 2nd post and still adding some stuffs, gimme a break to take a shower and rest in my bed now xD
EDIT: A bit more info added..
EDIT2: More info added..
Enviado desde mi C6602 mediante Tapatalk
Ehm... to download / test it?? Sorry for the question
Cyanogenmod 10.2
giec said:
Ehm... to download / test it?? Sorry for the question
Cyanogenmod 10.2
Click to expand...
Click to collapse
Download/test it what????
giec said:
Ehm... to download / test it?? Sorry for the question
Cyanogenmod 10.2
Click to expand...
Click to collapse
Do you even read? This is a GUIDE how to port MIUI.
I have will to do it, but do not have enought time to do it like it should. I work rom 12 - 8 monday-friday by PC, and after that I do not have such concentration to continue with development. So Fedevd decided to make guide on our forum, that we could work together.
shut_down said:
Do you even read? This is a GUIDE how to port MIUI.
I have will to do it, but do not have enought time to do it like it should. I work rom 12 - 8 monday-friday by PC, and after that I do not have such concentration to continue with development. So Fedevd decided to make guide on our forum, that we could work together.
Click to expand...
Click to collapse
Kids, moar kids everywhere!! =P
Added more info on 2nd post, still incomplete anyway, still toooooo much info to add =/
Hope you guys work togheter if you want MIUI v5, like I did with my great Team Canjica, 5 heads are better than 1, so...
I have some experience (little, but better than nothing ) in compiling and I already have cm10.1 sources in my pc :good: so I could try, maybe next weekor before christmas
Sent from my iPad using Tapatalk
Thst will be good.. I am doing this for anyone who wanna port it, knowing or not knowing about it.. (=
Enviado desde mi C6603 mediante Tapatalk
Thx -.-
Cyanogenmod 10.2
Finished the basics steps to port MIUI, still have to add some images, make more clear some steps, add minnor stuffs, explain a bit more some minnor stuffs and correct some symbols but with this you can now start porting. If someone do not understand something or some step are difficult, just leave comments here and I will try to help you. 3rd post is reserved for common logs errors to make it more easier later for other new users. So, let's start porting this great ROM and I wish lucky for all of you with this heavy and lazy work =P
I failed :/
phone had been connected to abd for 20 minutes and all i got is this
--------- beginning of /dev/log/system
[ 12-24 08:37:30.830 1802: 1802 I/Vold ]
Vold 2.1 (the revenge) firing up
[ 12-24 08:37:30.830 1802: 1802 D/Vold ]
Volume sdcard0 state changing -1 (Initializing) -> 0 (No-Media)
[ 12-24 08:37:30.830 1802: 1802 D/Vold ]
Volume sdcard1 state changing -1 (Initializing) -> 0 (No-Media)
[ 12-24 08:37:30.830 1802: 1802 D/Vold ]
Volume usbdisk0 state changing -1 (Initializing) -> 0 (No-Media)
[ 12-24 08:37:30.860 1802: 1827 D/Vold ]
Volume sdcard0 state changing 0 (No-Media) -> 2 (Pending)
[ 12-24 08:37:30.860 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 1, PARTN 1
[ 12-24 08:37:30.860 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 2, PARTN 2
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 3, PARTN 3
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 4, PARTN 4
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 5, PARTN 5
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 6, PARTN 6
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 7, PARTN 7
[ 12-24 08:37:30.870 1802: 1827 D/Vold ]
Volume sdcard0 state changing 2 (Pending) -> 1 (Idle-Unmounted)
[ 12-24 08:37:30.870 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 8, PARTN 8
[ 12-24 08:37:30.870 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 9, PARTN 9
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 10, PARTN 10
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 11, PARTN 11
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 12, PARTN 12
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 13, PARTN 13
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 14, PARTN 14
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 15, PARTN 15
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 16, PARTN 16
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 17, PARTN 17
[ 12-24 08:37:30.880 1802: 1827 E/DirectVolume ]
Invalid 'PARTN' value
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 W/Vold ]
Duplicate state (1)
[ 12-24 08:37:30.880 1802: 1827 D/Vold ]
Volume sdcard1 state changing 0 (No-Media) -> 2 (Pending)
[ 12-24 08:37:30.880 1802: 1827 D/DirectVolume ]
DirectVolume::handlePartitionAdded -> MAJOR 179, MINOR 97, PARTN 1
Try this, run:
Code:
adb logcat -c
and then
Code:
adb logcat >nameoflog.txt
and see if now the log works better..
Enviado desde mi C6603 mediante Tapatalk
Can anybody help me please?
I want to Copy this in Terminal emulator in windows but it doesn't work
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
I made this thread so all those trying to compile twrp for op6t can come together.
We can share ideas. What we have and have not got to work. What will work and what won't work.
Basically a thread where all information regarding twrp can be found in one location.
###########
#Please pm me #
##########
If using open source built roms and you have issues with twrp we may need to modify source in the rom or our twrp source.
Please report to rom maker as well.
Things to include.
What source 9.0 or 8.1
Compiling errors.
Post #2
Is where the download links are kept and updated.
Post #3 is where the other variations of twrp for source built roms or ports will be available to download if needed.
New test. twrp-op6t-test-0.3.img TEST ONLY!
@Dameon87 & myself have been working on this recovery for a while. We think it will get better. There are still bugs and issues with twrp. We would like your feedback.
Thanks
I am not responsible for anything that can happen to your device.
Rebuilt and fully working mke2fs
Decryption works
Storage works.
Please test and let us know what works and what doesn't.
twrp-op6t-test-0.2.img
https://www.androidfilehost.com/?fid=11410963190603862182
Updated twrp
Added more functionality ability to flash all zips and Ota's
Backup and restore all partitions including data.
Twrp-op6t-test-0.3.img
https://www.androidfilehost.com/?fid=11410963190603871199
New test twrp-unified-0.4.img
Everything working as usual
Cleaned up source and added @mauronofrio notch theme
Twrp-0.4.img
https://www.androidfilehost.com/?fid=11410963190603875438
Twrp installer thanks to @mauronofrio
https://www.androidfilehost.com/?fid=11410963190603876589
Updated twrp to decrypt 9.0.10
Twrp-0.5.img
https://www.androidfilehost.com/?fid=11410963190603879261
Twrp installer
https://www.androidfilehost.com/?fid=11410963190603879262
New test
Fixed screenshot color when taking screen shots in recovery.
Fixed touch vibration.
Please test and report back.
Twrp-0.6.img
https://www.androidfilehost.com/?fid...63190603880512
Twrp installer
https://www.androidfilehost.com/?fid...63190603880513
Device source
https://github.com/TWINNFAMOUS/android_device_oneplus_fajita
Bootable recovery source
https://github.com/OP6T-TWRP/android_bootable_recovery
Hope you all enjoy
This is where I will keep other twrp variations if needed for all source built roms and ports for our device. When available these will only be meant for testing. Thanks
twinnfamous said:
I made this thread so all those trying to compile twrp for op6t can come together.
We can share ideas. What we have and have not got to work. What will work and what won't work.
Basically a thread where all information regarding twrp can be found in one location.
Things to include.
What source 9.0 or 8.1
Compiling errors.
Click to expand...
Click to collapse
You're from the HTC u11 life! You made that phone awesome while I had it. Good to see you here!
I'm trying to build with 8.1 source and I get errors so build doesn't finish.
Is there anyone that's building successfully with 8.1?
Me, can you explain what are you doing exactly? Which source are you using?
mauronofrio said:
Me, can you explain what are you doing exactly? Which source are you using?
Click to expand...
Click to collapse
I'm trying with full omni source on 8.1. I've used the device source from both op6 & op6t without modifying just to see if it would be and it fails. I'll post output error soon as I can.
I don't have issues building with 9.0 source after I modify device source but it won't boot to twrp just stock recovery like it's not selecting the rite slot
twinnfamous said:
I'm trying to build with 8.1 source and I get errors so build doesn't finish.
Is there anyone that's building successfully with 8.1?
Click to expand...
Click to collapse
Make sure if you're using a newer version of Ubuntu with GCC 7+ you do: export LC_ALL=C
That should get you past the initial build errors.
Dameon87 said:
Make sure if you're using a newer version of Ubuntu with GCC 7+ you do: export LC_ALL=C
That should get you past the initial build errors.
Click to expand...
Click to collapse
Thanks for the info. I upgraded to linuxmint19 Recently. Guess I didn't pay attention to the changelog.
You also need to change two lines in the build/tools/buildinfo.sh :
echo "ro.build.version.release=$PLATFORM_VERSION"
echo "ro.build.version.security_patch=$PLATFORM_SECURITY_PATCH"
to:
echo "ro.build.version.release_orig=$PLATFORM_VERSION"
echo "ro.build.version.security_patch_orig=$PLATFORM_SECURITY_PATCH"
Dameon87 said:
You also need to change two lines in the build/tools/buildinfo.sh :
echo "ro.build.version.release=$PLATFORM_VERSION"
echo "ro.build.version.security_patch=$PLATFORM_SECURITY_PATCH"
to:
echo "ro.build.version.release_orig=$PLATFORM_VERSION"
echo "ro.build.version.security_patch_orig=$PLATFORM_SECURITY_PATCH"
Click to expand...
Click to collapse
And you need to increase the PLATFORM_VERSION to 16.1.0 ( in the new pixel 3 TWRPs is used 16 ) in build/core/version_defaults.mk to override Google's anti-rollback features
Dameon87 said:
You also need to change two lines in the build/tools/buildinfo.sh :
echo "ro.build.version.release=$PLATFORM_VERSION"
echo "ro.build.version.security_patch=$PLATFORM_SECURITY_PATCH"
to:
echo "ro.build.version.release_orig=$PLATFORM_VERSION"
echo "ro.build.version.security_patch_orig=$PLATFORM_SECURITY_PATCH"
Click to expand...
Click to collapse
mauronofrio said:
And you need to increase the PLATFORM_VERSION to 16.1.0 ( in the new pixel 3 TWRPs is used 16 ) in build/core/version_defaults.mk to override Google's anti-rollback features
Click to expand...
Click to collapse
The only issue I found was my lack of awareness. Ive been fighting with the 8.1 source all because the newer os I installed. I'm testing things out.
One thing I know is if the security patch level and date doesn't match what's in the phone then decryption won't work.
So I'm starting there.
I pulled this log from the phone it's only a part of it.
I've been trying everything and this is where it fails at in recovery.
e4crypt_initialize_global_de fail
So I started looking at any logs I can find in the phone and found this. Thought it might be helpful.
All the de folder locations are in the log
Also we use keymaster 4 that shows in The log as well.
I'm still using 8.1 source with 9.0 bootable recovery.
I'm thinking of focusing on trying to get get it to work with 9.0 source.
Log.
Mount system_root for mountting system
[ 1.120382] e4crypt_initialize_global_de
[ 1.120509] Keyring created with id 744456481 in process 530
[ 1.126746] I:List of Keymaster HALs found:
[ 1.126902] I:Keymaster HAL #1: Keymaster HAL: 4 from QTI SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
[ 1.141729] Using Keymaster HAL: 4 from QTI for encryption. Security level:TRUSTED_ENVIRONMENT , HAL: [email protected]::IKeymasterDevice / defaulte4crypt_init_user0
[ 1.147584] Skipping non-de-key .
[ 1.147590] Skipping non-de-key ..
[ 1.152120] I:List of Keymaster HALs found:
[ 1.152266] I:Keymaster HAL #1: Keymaster HAL: 4 from QTI SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
[ 1.160865] Using Keymaster HAL: 4 from QTI for encryption. Security level:TRUSTED_ENVIRONMENT , HAL: [email protected]::IKeymasterDevice / defaultInstalled de key for user 0
[ 1.160871] e4crypt_prepare_user_storage
[ 1.166977] ensure policy /data/system_de/0
[ 1.167599] I:Found policy 8372743e0b3d7924 at /data/system_de/0 which matches expected value
[ 1.167608] ensure policy /data/misc_de/0
[ 1.168197] I:Found policy 8372743e0b3d7924 at /data/misc_de/0 which matches expected value
[ 1.168206] ensure policy /data/user_de/0
[ 1.169338] I:Found policy 8372743e0b3d7924 at /data/user_de/0 which matches expected value
[ 1.358232] I:FBE enable...
[ 1.358334] Unable to locate gatekeeper password file '/data/system/gatekeeper.pattern.key'
[ 1.358412] (4294937945 ticks)(pid:530)[bootable/recovery/oem/src/main/oem.cpp]tree_init:90:efault password, decrept...
[ 1.358454] Unable to locate gatekeeper password file '/data/system/gatekeeper.pattern.key'
[ 1.358516] Skipping non-key .
[ 1.358549] Skipping non-key ..
[ 1.364930] I:List of Keymaster HALs found:
[ 1.365014] I:Keymaster HAL #1: Keymaster HAL: 4 from QTI SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
[ 1.373672] Using Keymaster HAL: 4 from QTI for encryption. Security level:TRUSTED_ENVIRONMENT , HAL: [email protected]::IKeymasterDevice / defaultSuccessfully retrieved key
[ 1.373733] Installed ce key for user 0
[ 1.373765] e4crypt_prepare_user_storage
[ 1.377707] ensure policy /data/system_ce/0
[ 1.378426] I:Found policy d0acf3009500dfb4 at /data/system_ce/0 which matches expected value
[ 1.378462] ensure policy /data/misc_ce/0
[ 1.379037] I:Found policy d0acf3009500dfb4 at /data/misc_ce/0 which matches expected value
[ 1.379069] ensure policy /data/data
[ 1.380547] I:Found policy d0acf3009500dfb4 at /data/data which matches expected value
[ 1.380597] Decrypted Successfully!
twinnfamous said:
I pulled this log from the phone it's only a part of it.
I've been trying everything and this is where it fails at in recovery.
e4crypt_initialize_global_de fail
So I started looking at any logs I can find in the phone and found this. Thought it might be helpful.
All the de folder locations are in the log
Also we use keymaster 4 that shows in The log as well.
I'm still using 8.1 source with 9.0 bootable recovery.
I'm thinking of focusing on trying to get get it to work with 9.0 source.
Log.
Mount system_root for mountting system
[ 1.120382] e4crypt_initialize_global_de
[ 1.120509] Keyring created with id 744456481 in process 530
[ 1.126746] I:List of Keymaster HALs found:
[ 1.126902] I:Keymaster HAL #1: Keymaster HAL: 4 from QTI SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
[ 1.141729] Using Keymaster HAL: 4 from QTI for encryption. Security level:TRUSTED_ENVIRONMENT , HAL: [email protected]::IKeymasterDevice / defaulte4crypt_init_user0
[ 1.147584] Skipping non-de-key .
[ 1.147590] Skipping non-de-key ..
[ 1.152120] I:List of Keymaster HALs found:
[ 1.152266] I:Keymaster HAL #1: Keymaster HAL: 4 from QTI SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
[ 1.160865] Using Keymaster HAL: 4 from QTI for encryption. Security level:TRUSTED_ENVIRONMENT , HAL: [email protected]::IKeymasterDevice / defaultInstalled de key for user 0
[ 1.160871] e4crypt_prepare_user_storage
[ 1.166977] ensure policy /data/system_de/0
[ 1.167599] I:Found policy 8372743e0b3d7924 at /data/system_de/0 which matches expected value
[ 1.167608] ensure policy /data/misc_de/0
[ 1.168197] I:Found policy 8372743e0b3d7924 at /data/misc_de/0 which matches expected value
[ 1.168206] ensure policy /data/user_de/0
[ 1.169338] I:Found policy 8372743e0b3d7924 at /data/user_de/0 which matches expected value
[ 1.358232] I:FBE enable...
[ 1.358334] Unable to locate gatekeeper password file '/data/system/gatekeeper.pattern.key'
[ 1.358412] (4294937945 ticks)(pid:530)[bootable/recovery/oem/src/main/oem.cpp]tree_init:90:efault password, decrept...
[ 1.358454] Unable to locate gatekeeper password file '/data/system/gatekeeper.pattern.key'
[ 1.358516] Skipping non-key .
[ 1.358549] Skipping non-key ..
[ 1.364930] I:List of Keymaster HALs found:
[ 1.365014] I:Keymaster HAL #1: Keymaster HAL: 4 from QTI SecurityLevel: TRUSTED_ENVIRONMENT HAL: [email protected]::IKeymasterDevice/default
[ 1.373672] Using Keymaster HAL: 4 from QTI for encryption. Security level:TRUSTED_ENVIRONMENT , HAL: [email protected]::IKeymasterDevice / defaultSuccessfully retrieved key
[ 1.373733] Installed ce key for user 0
[ 1.373765] e4crypt_prepare_user_storage
[ 1.377707] ensure policy /data/system_ce/0
[ 1.378426] I:Found policy d0acf3009500dfb4 at /data/system_ce/0 which matches expected value
[ 1.378462] ensure policy /data/misc_ce/0
[ 1.379037] I:Found policy d0acf3009500dfb4 at /data/misc_ce/0 which matches expected value
[ 1.379069] ensure policy /data/data
[ 1.380547] I:Found policy d0acf3009500dfb4 at /data/data which matches expected value
[ 1.380597] Decrypted Successfully!
Click to expand...
Click to collapse
Was this taken from the default/stock recovery or just a standard boot? I've been using the twrp-8.1 branch (Which uses android_bootable_recovery 9.0 branch by default now). I've tried a multitude of things, but I simply just get the e4crypt_initialize_global_de fail error as well. I think the way things are done for the Pixel 3/XL are the way to proceed, but aside the device tree we don't have much else to go on.
Dameon87 said:
Was this taken from the default/stock recovery or just a standard boot? I've been using the twrp-8.1 branch (Which uses android_bootable_recovery 9.0 branch by default now). I've tried a multitude of things, but I simply just get the e4crypt_initialize_global_de fail error as well. I think the way things are done for the Pixel 3/XL are the way to proceed, but aside the device tree we don't have much else to go on.
Click to expand...
Click to collapse
Maybe Fstab files need modifying
The recovery.fstab I pulled out of the boot.Img has a data partition labeled f2fs
And a Data partition labeled ext4
twinnfamous said:
Maybe Fstab files need modifying
The recovery.fstab I pulled out of the boot.Img has a data partition labeled f2fs
And a Data partition labeled ext4
Click to expand...
Click to collapse
Already tried that but I didn't really get anything different. There's a few issues that are happening I think.
Dmesg repeats this over and over and over:
<3>[19700123_15:34:23.729788]@4 FG: fg_psy_get_property: unsupported property 27
<14>[19700123_15:34:26.049860]@4 init: starting service 'boot-1-0'...
<11>[19700123_15:34:26.050060]@4 init: property_set("ro.boottime.boot-1-0", "798060609590") failed: property already set
<11>[19700123_15:34:26.050448]@0 init: cannot execve('/sbin/[email protected]'): No such file or directory
<14>[19700123_15:34:26.051342]@4 init: Sending signal 9 to service 'boot-1-0' (pid 762) process group...
<14>[19700123_15:34:26.051372]@4 init: Successfully killed process cgroup uid 0 pid 762 in 0ms
Then just getting this according to the recovery.log:
I:File Based Encryption is present
e4crypt_initialize_global_de returned fail
e4crypt_initialize_global_de returned fail
e4crypt_initialize_global_de returned fail
Dameon87 said:
Already tried that but I didn't really get anything different. There's a few issues that are happening I think.
Dmesg repeats this over and over and over:
<3>[19700123_15:34:23.729788]@4 FG: fg_psy_get_property: unsupported property 27
<14>[19700123_15:34:26.049860]@4 init: starting service 'boot-1-0'...
<11>[19700123_15:34:26.050060]@4 init: property_set("ro.boottime.boot-1-0", "798060609590") failed: property already set
<11>[19700123_15:34:26.050448]@0 init: cannot execve('/sbin/[email protected]'): No such file or directory
<14>[19700123_15:34:26.051342]@4 init: Sending signal 9 to service 'boot-1-0' (pid 762) process group...
<14>[19700123_15:34:26.051372]@4 init: Successfully killed process cgroup uid 0 pid 762 in 0ms
Then just getting this according to the recovery.log:
I:File Based Encryption is present
e4crypt_initialize_global_de returned fail
e4crypt_initialize_global_de returned fail
e4crypt_initialize_global_de returned fail
Click to expand...
Click to collapse
This is probably why it won't even boot twrp built with 9.0
twinnfamous said:
This is probably why it won't even boot twrp built with 9.0
Click to expand...
Click to collapse
Are you doing a minimal build env, or pulling in the entire Omni tree? There is only a twrp-8.1 branch for the minimal manifest, but that does pull in android_bootable_recovery 9.0 branch. I can get both to compile and boot fine.
Dameon87 said:
Are you doing a minimal build env, or pulling in the entire Omni tree? There is only a twrp-8.1 branch for the minimal manifest, but that does pull in android_bootable_recovery 9.0 branch. I can get both to compile and boot fine.
Click to expand...
Click to collapse
Full sources on both 8.1 and 9.0
twinnfamous said:
Full sources on both 8.1 and 9.0
Click to expand...
Click to collapse
Alright I'm doing a full sync of the omni repo and will give that a try next. I had been just using the minimal manifest.