YOU ARE TAKING YOUR OWN RISK TO DO THIS. But I succeed and I suppose it will work on others.
My thread in Chinese:
http://tieba.baidu.com/p/5666986960...14141&unique=C1FF2FC2F12BF43C9E62C4918B0688A2
In English:
Just download this modem.img
https://pan.baidu.com/s/1Qu5W_Gw3qCk32M4L4JMecg
IMG is based on 8.1 latest modem. If you are on 8.0/7.1, please try carefully
And flash it to both modem partitions.
fastboot flash modem_a .........\modem.img
fastboot flash modem_b .........\modem.img
And wipe userdata and FRP.
fastboot erase userdata
fastboot erase frp(Optional. To skip setup wizard.)
Then turn the phone up.
Done.
Why?
On initial SIM insertion, Android copies carrier config files into data and then flashes one of them into modemst.
I just changed all mcfg_sw.mbn files into 1+3T's, which supports CT.
Get the single mbn file here:
https://pan.baidu.com/s/1QrDefK44bNu9VWUR8fOjEA
On Pixel 2 this way probably works I think. Anyone going to try?
hv a look into 2XL factory image and there's no mcfg_sw.mbn in modem.img:crying:
Sent from my Pixel 2 XL using XDA Labs
This method can theoretically be used to get functioning 2x CA and 3x CA on the US models in Europe and elsewhere. I have managed to enable 256QAM from the australian modem config file on an US model, this happened by replacing some mbn files (somehow it set it in place without having to wipe anything, not sure how.)
I have not managed to make the CA work yet. Wonder if anyone has a proper modem config for this and if wiping really is necessary for this.
As I understand:
1) mbns go to /firmware/radio/modem_pr/mcfg/configs/mcfg_sw/generic/*
2) If you wipe data, or delete the radio folder in this point, it copies/regenerates the files from point 1 to /data/misc/radio/modem_config/mcfg_sw/generic/*
3) The EFS generates its carrier_policy.xml under policyman from the data partition?
Whatever I do to the carrier_policy.xml it doesnt change anything. The UE EUTRA policy remains the same.
Thanks for your post, this is the best way I can find to enable China Telecom LTE on Pixel.
Based on your post, I did some further checks, and found a way to do this without erasing data partition, and even no need to root.
Successfully tested on my Pixel running Android P.
Same as your method, we will change modem.img and copy mcfg_sw.mbn from 1+3T's image.
From the aosp source code, we can see that the init.radio.sh will copy configs from modem.img if the versions in ver_info.txt is changed.
So we can just simply change the version to another value, and it will copy the new configs.
The following are the detailed steps, we need a Linux environment to mount modem.img:
1. extract modem.img from Pixel factory image.
2. extract NO-HLOS.bin from 1+ 3T factory image (download from oneplus).
3. In order to add new files into modem.img, first need to expand its size:
Code:
dd if=/dev/zero of=modem.img bs=4096 count=100 conv=notrunc oflag=append
This command appends about 400KB to the end of the modem.img.
The total size of CT configs in 1+ 3T is about 230KB, but you can change to a larger count if you need to add more files.
4. mount modem.img:
Code:
mkdir modem
sudo mount -o loop modem.img modem
5. mount NO-HLOS.bin:
Code:
mkdir oneplus
sudo mount -o loop NO-HLOS.bin oneplus
6. create a "china" folder, since we only copy the CT configs, and skip CMCC and CU configs.
Code:
sudo mkdir modem/modem_pr/mcfg/configs/mcfg_sw/generic/china/
7. copy CT configs from oneplus:
Code:
sudo cp -r oneplus/image/modem_pr/mcfg/configs/mcfg_sw/generic/china/ct modem/modem_pr/mcfg/configs/mcfg_sw/generic/china/
8. change the ver_info.txt:
Code:
sudo vim modem/modem_pr/verinfo/ver_info.txt
It is enough to only change the last digit.
9. umount the images:
Code:
sync
umount modem
umount oneplus
10. flash the modem.img:
Code:
fastboot flash modem_a modem.img
fastboot flash modem_b modem.img
fastboot reboot
After reboot, Pixel will be able to use China Telecom LTE.
sbjbs said:
Thanks for your post, this is the best way I can find to enable China Telecom LTE on Pixel.
Based on your post, I did some further checks, and found a way to do this without erasing data partition, and even no need to root.
Successfully tested on my Pixel running Android P.
Same as your method, we will change modem.img and copy mcfg_sw.mbn from 1+3T's image.
From the aosp source code, we can see that the init.radio.sh will copy configs from modem.img if the versions in ver_info.txt is changed.
So we can just simply change the version to another value, and it will copy the new configs.
The following are the detailed steps, we need a Linux environment to mount modem.img:
1. extract modem.img from Pixel factory image.
2. extract NO-HLOS.bin from 1+ 3T factory image (download from oneplus).
3. In order to add new files into modem.img, first need to expand its size:
This command appends about 400KB to the end of the modem.img.
The total size of CT configs in 1+ 3T is about 230KB, but you can change to a larger count if you need to add more files.
4. mount modem.img:
5. mount NO-HLOS.bin:
6. create a "china" folder, since we only copy the CT configs, and skip CMCC and CU configs.
7. copy CT configs from oneplus:
8. change the ver_info.txt:
It is enough to only change the last digit.
9. umount the images:
10. flash the modem.img:
After reboot, Pixel will be able to use China Telecom LTE.
Click to expand...
Click to collapse
Could this work on pixel 3 ? Any idea which mbn files I'd need to get wifi calling? Like, what would I do if I wanted Deutsche Telekom mb files ton replaces What my phone is currently using?
matkwok said:
hv a look into 2XL factory image and there's no mcfg_sw.mbn in modem.img:crying:
Click to expand...
Click to collapse
Yup. They changed filesystems or setup on the 2 and 3 . I saw that they do exist in modem partition on 2 but I haven't seen any of those files in the 3 yet.
TEEEEEEEEED said:
YOU ARE TAKING YOUR OWN RISK TO DO THIS. But I succeed and I suppose it will work on others.
My thread in Chinese:
http://tieba.baidu.com/p/5666986960...14141&unique=C1FF2FC2F12BF43C9E62C4918B0688A2
In English:
Just download this modem.img
https://pan.baidu.com/s/1Qu5W_Gw3qCk32M4L4JMecg
IMG is based on 8.1 latest modem. If you are on 8.0/7.1, please try carefully
And flash it to both modem partitions.
fastboot flash modem_a .........\modem.img
fastboot flash modem_b .........\modem.img
And wipe userdata and FRP.
fastboot erase userdata
fastboot erase frp(Optional. To skip setup wizard.)
Then turn the phone up.
Done.
Why?
On initial SIM insertion, Android copies carrier config files into data and then flashes one of them into modemst.
I just changed all mcfg_sw.mbn files into 1+3T's, which supports CT.
Get the single mbn file here:
https://pan.baidu.com/s/1QrDefK44bNu9VWUR8fOjEA
On Pixel 2 this way probably works I think. Anyone going to try?
Click to expand...
Click to collapse
What's the difference from just moving the mbn to replaces the one in the phone ?
Also, could you do this for my pixel 3? I need mbns from Xperia xx3 I think
Xdevillived666 said:
Could this work on pixel 3 ? Any idea which mbn files I'd need to get wifi calling? Like, what would I do if I wanted Deutsche Telekom mb files ton replaces What my phone is currently using?
Click to expand...
Click to collapse
I can't tell you if it can work on Pixel 3, because I don't have a Pixel 3.
I have checked the modem.img in Pixel 3 factory image, there is no "modem_pr" directory, which contains the config files.
but I have also checked the Pixel3's init.radio.sh, it will check the ver_info.txt and still copys the "modem_pr" directory:
Code:
cp -r /firmware/image/modem_pr/mcfg/configs/* /data/vendor/radio/modem_config
So I guess you can create the directory and copy config files into it. And don't forget to change the ver_info.txt.
This is the structure of Pixel 1 modem.img:
Code:
├── mba.mbn
├── modem.b00
├── modem.b01
├── modem.b02
├── modem.b03
├── modem.b04
├── modem.b05
├── modem.b06
├── modem.b07
├── modem.b08
├── modem.b09
├── modem.b10
├── modem.b11
├── modem.b12
├── modem.b13
├── modem.b15
├── modem.b16
├── modem.b17
├── modem.b18
├── modem.b19
├── modem.b20
├── modem.mdt
├── modem_pr
│ ├── mcfg
│ │ └── configs
│ │ └── mcfg_sw
│ │ └── generic
│ │ ├── apac
│ │ ├── aus
│ │ ├── china
│ │ ├── common
│ │ ├── eu
│ │ └── na
│ └── verinfo
│ └── ver_info.txt
├── qdsp6m.qdb
└── version.cfg
This is the structure of Pixel 3 modem.img:
Code:
├── image
│ ├── mba.mbn
│ ├── modem.b00
│ ├── modem.b01
│ ├── modem.b02
│ ├── modem.b03
│ ├── modem.b04
│ ├── modem.b05
│ ├── modem.b06
│ ├── modem.b07
│ ├── modem.b08
│ ├── modem.b09
│ ├── modem.b10
│ ├── modem.b11
│ ├── modem.b12
│ ├── modem.b13
│ ├── modem.b14
│ ├── modem.b15
│ ├── modem.b16
│ ├── modem.b17
│ ├── modem.b18
│ ├── modem.b19
│ ├── modem.b20
│ ├── modem.b21
│ ├── modem.b22
│ ├── modem.b23
│ ├── modem.b24
│ ├── modem.b25
│ ├── modem.b26
│ ├── modem.b27
│ ├── modem.b28
│ ├── modem.b29
│ ├── modem.mdt
│ ├── modemr.jsn
│ ├── qdsp6m.qdb
│ └── version.cfg
└── verinfo
└── ver_info.txt
I don't know the structure inside the modem_pr directory for Pixel 3. You may try the same structure as Pixel 1, or you can check the existing structure in /data/vendor/radio/modem_config/
sbjbs said:
I can't tell you if it can work on Pixel 3, because I don't have a Pixel 3.
I have checked the modem.img in Pixel 3 factory image, there is no "modem_pr" directory, which contains the config files.
but I have also checked the Pixel3's init.radio.sh, it will check the ver_info.txt and still copys the "modem_pr" directory:
So I guess you can create the directory and copy config files into it. And don't forget to change the ver_info.txt.
This is the structure of Pixel 1 modem.img:
This is the structure of Pixel 3 modem.img:
I don't know the structure inside the modem_pr directory for Pixel 3. You may try the same structure as Pixel 1, or you can check the existing structure in /data/vendor/radio/modem_config/
Click to expand...
Click to collapse
Thanks mate. I know they changed the location for mbn files. I only found it a week ago or so.
Vendor/rfs/msm/mpss/read only/vendor/mbn/mcfg_sw
I'm guessing then that this means I can't use the same method and would have to repack vendor?
How would I change ver_info.txt? Can I modify the existing one ?
And would this be the right one or would I have to do it inside the modem image for ver_info.txt?
Xdevillived666 said:
And would this be the right one or would I have to do it inside the modem image for ver_info.txt?
Click to expand...
Click to collapse
On Pixel 1, the modem.img is mounted read-only on /firmware/radio
On Pixel 3, the modem.img is mounted read-only on /vendor/firmware_mnt, and /firmware is a symlink which links to /vendor/firmware_mnt
If you want to change the ver_info.txt, you can remount /vendor/firmware_mnt for read-write if you have root permission.
you also can change it in modem.img and flash it.
since the location was changed, I don't know when and who will copy config files from "Vendor/rfs/msm/mpss/read only/vendor/mbn/mcfg_sw",
so I'm not sure if this method still works. but you can try it. good luck.
---------- Post added at 06:56 PM ---------- Previous post was at 06:47 PM ----------
Xdevillived666 said:
And would this be the right one or would I have to do it inside the modem image for ver_info.txt?
Click to expand...
Click to collapse
for Pixel 3, the old ver_info.txt is located at:
/data/vendor/radio/ver_info.txt
you may check its content first.
This is part of the content of init.radio.sh for Pixel 3:
Code:
#
# Make modem config folder and copy firmware config to that folder for RIL
#
if [ -f /data/vendor/radio/ver_info.txt ]; then
prev_version_info=`cat /data/vendor/radio/ver_info.txt`
else
prev_version_info=""
fi
cur_version_info=`cat /firmware/verinfo/ver_info.txt`
if [ ! -f /firmware/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then
rm -rf /data/vendor/radio/modem_config
mkdir /data/vendor/radio/modem_config
chmod 770 /data/vendor/radio/modem_config
cp -r /firmware/image/modem_pr/mcfg/configs/* /data/vendor/radio/modem_config
chown -hR radio.radio /data/vendor/radio/modem_config
cp /firmware/verinfo/ver_info.txt /data/vendor/radio/ver_info.txt
chown radio.radio /data/vendor/radio/ver_info.txt
fi
cp /firmware/image/modem_pr/mbn_ota.txt /data/vendor/radio/modem_config
chown radio.radio /data/vendor/radio/modem_config/mbn_ota.txt
echo 1 > /data/vendor/radio/copy_complete
sbjbs said:
On Pixel 1, the modem.img is mounted read-only on /firmware/radio
On Pixel 3, the modem.img is mounted read-only on /vendor/firmware_mnt, and /firmware is a symlink which links to /vendor/firmware_mnt
If you want to change the ver_info.txt, you can remount /vendor/firmware_mnt for read-write if you have root permission.
you also can change it in modem.img and flash it.
since the location was changed, I don't know when and who will copy config files from "Vendor/rfs/msm/mpss/read only/vendor/mbn/mcfg_sw",
so I'm not sure if this method still works. but you can try it. good luck.
---------- Post added at 06:56 PM ---------- Previous post was at 06:47 PM ----------
for Pixel 3, the old ver_info.txt is located at:
/data/vendor/radio/ver_info.txt
you may check its content first.
This is part of the content of init.radio.sh for Pixel 3:
Click to expand...
Click to collapse
Yeah, I'd have to do it at modem level. Can't seem to get it working with a file explorer though I see it , it doesn't say anything. That would require Linux, right ?
I've also tried using a custom built magisk(for pixel2) with a model that allows access to diagnostic mode and opens ports. Using qpst and built in pdc tool, you can flash individual mbn files to enable volte and vowifi. I have native volte support through Bouygues, but vowifi is only allowed on certain phones through my carrier. I get the port open, but pdc keeps giving me a qmi error saying the USB driver isn't correct . Pissing me off.
I also tried the old trick of just using a root explorer , replacing mbn at file level , inserting a different sim card, inserting back own sim card, and rebooting . This did activate volte and wifi sms on first gen pixel but doesn't work after that .
Not sure I can do anything to activate vowifi though I am provisioned for it via sim card/my carrier .
Xdevillived666 said:
Yeah, I'd have to do it at modem level. Can't seem to get it working with a file explorer though I see it , it doesn't say anything. That would require Linux, right ?
I've also tried using a custom built magisk(for pixel2) with a model that allows access to diagnostic mode and opens ports. Using qpst and built in pdc tool, you can flash individual mbn files to enable volte and vowifi. I have native volte support through Bouygues, but vowifi is only allowed on certain phones through my carrier. I get the port open, but pdc keeps giving me a qmi error saying the USB driver isn't correct . Pissing me off.
I also tried the old trick of just using a root explorer , replacing mbn at file level , inserting a different sim card, inserting back own sim card, and rebooting . This did activate volte and wifi sms on first gen pixel but doesn't work after that .
Not sure I can do anything to activate vowifi though I am provisioned for it via sim card/my carrier .
Click to expand...
Click to collapse
I'm sorry I have no experience with what you are doing.
If you want to change the modem.img, you'd better in Linux.
Your phone is a Linux too, if you have root access, you can push the modem.img to a temp directory on you device, and change it.
the mount command is a bit different:
Code:
losetup /dev/block/loop0 modem.img
mkdir modem
mount /dev/block/loop0 modem
From the init.radio.sh, the modem.img/image/modem_pr/mbn_ota.txt seems to be important, there is no such file for Pixel1.
Have you tried changing the mbn_sw.txt in vendor/rfs/msm/mpss/readonly/vendor/mbn/mcfg_sw, and adding your configs to the list?
sbjbs said:
I'm sorry I have no experience with what you are doing.
If you want to change the modem.img, you'd better in Linux.
Your phone is a Linux too, if you have root access, you can push the modem.img to a temp directory on you device, and change it.
the mount command is a bit different:
From the init.radio.sh, the modem.img/image/modem_pr/mbn_ota.txt seems to be important, there is no such file for Pixel1.
Have you tried changing the mbn_sw.txt in vendor/rfs/msm/mpss/readonly/vendor/mbn/mcfg_sw, and adding your configs to the list?
Click to expand...
Click to collapse
Thanks for the reply. I figured I needed Linux for this.
As for the second part, I have some Sony mbn files from xz3. My carrier supports voWifi on this phone, so I nabbed the firmware specific to my phone, extracted the mbns , placed them into the area where mine are, added the necessary text to mcfg_sw.txt but it doesn't activate voWifi as far as I can tell. I've attached said Sony files if ya wanna check them out
https://drive.google.com/file/d/1Rbh5n3zmNfVd1t75OZjbqQ8thcua-XL1/view?usp=drivesdk
I'll take a look at the mbn_ota.txt . What, if anything , could be done with it?
Edit: I losetup and i cant find that file ???
Side note: for some reason, I can't erase modem st1/2 in pixel 3. It's gives me a "remote error " in fastboot.
Xdevillived666 said:
Thanks for the reply. I figured I needed Linux for this.
As for the second part, I have some Sony mbn files from xz3. My carrier supports voWifi on this phone, so I nabbed the firmware specific to my phone, extracted the mbns , placed them into the area where mine are, added the necessary text to mcfg_sw.txt but it doesn't activate voWifi as far as I can tell. I've attached said Sony files if ya wanna check them out
https://drive.google.com/file/d/1Rbh5n3zmNfVd1t75OZjbqQ8thcua-XL1/view?usp=drivesdk
I'll take a look at the mbn_ota.txt . What, if anything , could be done with it?
Side note: for some reason, I can't erase modem st1/2 in pixel 3. It's gives me a "remote error " in fastboot.
Click to expand...
Click to collapse
For adding ChinaTelecom lte and volte on Pixel 3, people just change the mbn_sw.txt and it works.
I'm not sure what the mbn_ota.txt is used for, I'm guessing it has a similar effect as mbn_sw.txt, but it is useless for your current situation.
Thanks for your trust, but I don't think I can help.
sbjbs said:
For adding ChinaTelecom lte and volte on Pixel 3, people just change the mbn_sw.txt and it works.
I'm not sure what the mbn_ota.txt is used for, I'm guessing it has a similar effect as mbn_sw.txt, but it is useless for your current situation.
Thanks for your trust, but I don't think I can help.
Click to expand...
Click to collapse
Thank you for responding as often as you did and trying to help
A few last questions:
Carrierconfig.apk res xml cant be modified, can it?
I saw that it contains bools for vowifi being enabled or not
How do they change the txt, exactly?They just put the location of said mbn that they placed in the txt file?
My carrier config is already in the default mcfg_sw.txt and only allows volte. Maybe I could add the text from the mcfg_sw.txt and mbn files from the xz3 that supports vowifi and volte and delete all others under there? Or does that mbn_ota.txt override that?
I really just wnna force vowifi , lol. voLTE is okay but I miss sms over wifi like I got with my first gen pixel.
In anycse, thanks again for the help! I sincerely appreciate it
Would this thread help me out any? Modifying carrier policy is something I've been looking into ,but doing so at app lever is damned near impossible
http://bbs.gfan.com/android-9204634-1-1.html
Xdevillived666 said:
Thank you for responding as often as you did and trying to help
A few last questions:
Carrierconfig.apk res xml cant be modified, can it?
I saw that it contains bools for vowifi being enabled or not
How do they change the txt, exactly?They just put the location of said mbn that they placed in the txt file?
My carrier config is already in the default mcfg_sw.txt and only allows volte. Maybe I could add the text from the mcfg_sw.txt and mbn files from the xz3 that supports vowifi and volte and delete all others under there? Or does that mbn_ota.txt override that?
I really just wnna force vowifi , lol. voLTE is okay but I miss sms over wifi like I got with my first gen pixel.
In anycse, thanks again for the help! I sincerely appreciate it
Would this thread help me out any? Modifying carrier policy is something I've been looking into ,but doing so at app lever is damned near impossible
http://bbs.gfan.com/android-9204634-1-1.html
Click to expand...
Click to collapse
Yes, you can decompile a apk and change the xml and recompile it by tools like apktool.
For ChinaTelecom lte on Pixel 3, you can refer to this post: http://bbs.gfan.com/android-9535442-1-1.html
they append a line to mbn_sw.txt:
Code:
mcfg_sw/generic/China/CT/Commercial/OpenMkt/mcfg_sw.mbn
if want to enable volte, append another line:
Code:
mcfg_sw/generic/China/CT/Commercial/VoLTE_OpenMkt/mcfg_sw.mbn
and add some properties in build.prop:
Code:
ro.mtk_ims_support=1
ro.mtk_volte_support=1
persist.mtk.volte.enable=1
persist.dbg.volte_avail_ovr=1
persist.dbg.ims_volte_enable=1
persist.dbg.volte_avail_ovr=1
persist.dbg.vt_avail_ovr=1
persist.dbg.wfc_avail_ovr=1
persist.radio.rat_on=combine
persist.radio.data_ltd_sys_ind=1
persist.radio.data_con_rprt=1
persist.radio.calls.on.ims=1
Before the OP‘s method of changing modem.img, people used to change carrier_policy.xml if they want to use ChinaTelecom on Pixel 1.
you can refer to this: http://www.usbmi.com/2281.html
But I only got the Pixel recently, I have never tried that.
IMPORTANT: please don't forget to backup your EFS and related partitions before doing that.
sbjbs said:
Yes, you can decompile a apk and change the xml and recompile it by tools like apktool.
For ChinaTelecom lte on Pixel 3, you can refer to this post: http://bbs.gfan.com/android-9535442-1-1.html
they append a line to mbn_sw.txt:
Code:
mcfg_sw/generic/China/CT/Commercial/OpenMkt/mcfg_sw.mbn
if want to enable volte, append another line:
Code:
mcfg_sw/generic/China/CT/Commercial/VoLTE_OpenMkt/mcfg_sw.mbn
and add some properties in build.prop:
Code:
ro.mtk_ims_support=1
ro.mtk_volte_support=1
persist.mtk.volte.enable=1
persist.dbg.volte_avail_ovr=1
persist.dbg.ims_volte_enable=1
persist.dbg.volte_avail_ovr=1
persist.dbg.vt_avail_ovr=1
persist.dbg.wfc_avail_ovr=1
persist.radio.rat_on=combine
persist.radio.data_ltd_sys_ind=1
persist.radio.data_con_rprt=1
persist.radio.calls.on.ims=1
Before the OP‘s method of changing modem.img, people used to change carrier_policy.xml if they want to use ChinaTelecom on Pixel 1.
you can refer to this: http://www.usbmi.com/2281.html
But I only got the Pixel recently, I have never tried that.
IMPORTANT: please don't forget to backup your EFS and related partitions before doing that.
Click to expand...
Click to collapse
Thanks. I had a look at the threads and it is a great resource, so thanks.
You can also try this in the future:
https://forum.xda-developers.com/pixel-2-xl/how-to/guide-qxdm-port-activation-pixel-2-xl-t3884967
I get all ports on p3 open but cant get pdc tool to connect.
When I had my pixel 1, I used this to get wifi messaging and volte working perfectly:
"You need to do the following Steps: -Check with your Carrier if your subscription is persistently provisioned for VoLTE and not based on the used device -Root your device with magisk and install the VoLTE enabler module (this is for android sw level VoLTE activation) https://forum.xda-developers.com/apps/magisk/module-v4-volte-enabler-t3649613/page1 -Download ES File Explorer with root rights and head to /data/misc/radio/modem_config/mcfg_sw/generic/common/wildcard/wildcard and backup mcfg_sw.mbn to any location for example google drive -Copy mcfg_sw.mbn from /data/misc/radio/modem_config/mcfg_sw/generic/common/eu/dt/commerci/volte to /data/misc/radio/modem_config/mcfg_sw/generic/common/wildcard/wildcard and overwrite the existing mcfg_sw.mbn and set file permission to r-- --- --- (this is really important, if the file rights are not correct, it can cause boot loops. -Enter a SIM card into the device witch has a carrier specific mcfg_sw.mbn file, I did it with a TMUS SIM card. If you don't have one, order one through the internet for example at https://www.reisesim.de/de/prepaid-sim-karte-usa/t-mobile-usa-sim-karten/ -Insert your personal SIM back into the device and do a reboot
This is not a 100% guarantee that it will work, for my carrier it worked. If it is not working, you can also try with the TMUS, Telstra or EE mcfg_sw.mbn.
It's very likely that WiFi Calling will not work, because there's a additional config file which includes the epdg adress which can only modified through EFS explorer from Qualcomm. If WiFi Calling is not working, disable the function!!
"
Thanks again for your help. Hopefully more carriers support pixel natively in the future, otherwise I dont see myself getting another one with such a lack of support and features:-/
sbjbs said:
Thanks for your post, this is the best way I can find to enable China Telecom LTE on Pixel.
Based on your post, I did some further checks, and found a way to do this without erasing data partition, and even no need to root.
Successfully tested on my Pixel running Android P.
Same as your method, we will change modem.img and copy mcfg_sw.mbn from 1+3T's image.
From the aosp source code, we can see that the init.radio.sh will copy configs from modem.img if the versions in ver_info.txt is changed.
So we can just simply change the version to another value, and it will copy the new configs.
The following are the detailed steps, we need a Linux environment to mount modem.img:
1. extract modem.img from Pixel factory image.
2. extract NO-HLOS.bin from 1+ 3T factory image (download from oneplus).
3. In order to add new files into modem.img, first need to expand its size:
Code:
dd if=/dev/zero of=modem.img bs=4096 count=100 conv=notrunc oflag=append
This command appends about 400KB to the end of the modem.img.
The total size of CT configs in 1+ 3T is about 230KB, but you can change to a larger count if you need to add more files.
4. mount modem.img:
Code:
mkdir modem
sudo mount -o loop modem.img modem
5. mount NO-HLOS.bin:
Code:
mkdir oneplus
sudo mount -o loop NO-HLOS.bin oneplus
6. create a "china" folder, since we only copy the CT configs, and skip CMCC and CU configs.
Code:
sudo mkdir modem/modem_pr/mcfg/configs/mcfg_sw/generic/china/
7. copy CT configs from oneplus:
Code:
sudo cp -r oneplus/image/modem_pr/mcfg/configs/mcfg_sw/generic/china/ct modem/modem_pr/mcfg/configs/mcfg_sw/generic/china/
8. change the ver_info.txt:
Code:
sudo vim modem/modem_pr/verinfo/ver_info.txt
It is enough to only change the last digit.
9. umount the images:
Code:
sync
umount modem
umount oneplus
10. flash the modem.img:
Code:
fastboot flash modem_a modem.img
fastboot flash modem_b modem.img
fastboot reboot
After reboot, Pixel will be able to use China Telecom LTE.
Click to expand...
Click to collapse
Hello, can you tell me under which directory I should execute "mkdir modem", "mkdir oneplus" "sudo mkdir modem/modem_pr/mcfg/configs/mcfg_sw/generic/china/"?
I'm doing it under / directory and getting "read-only file system" error.
bonedriven said:
Hello, can you tell me under which directory I should execute "mkdir modem", "mkdir oneplus" "sudo mkdir modem/modem_pr/mcfg/configs/mcfg_sw/generic/china/"?
I'm doing it under / directory and getting "read-only file system" error.
Click to expand...
Click to collapse
I'm sorry to reply so late. On your host machine, you can cd to a 'writable' directory (your HOME directory, for example) to mkdir the mountpoint.
I just verified that this still works on Pixel1 Android 10.
Related
[DEV_TOOL] HTC ROM EXTRACTOR
{
"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"
}
Tools for working with firmware HTC in LINUX
fit Kenny Millington Source kmdm
(HOW TO)
PUSH THE BUTTON
! Requirements (libunshield v0.7 or higher):
Code:
$ sudo apt-get install automake
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
1. Extract from the zip and put the RUUXXXXXXXXX.exe to a folder with the tool;
2. Run in Terminal rom-extractor file and select the option:
MAIN MENU
u - UNRUU EXE TO ZIP - extract from the file rom.zip RUU.exe
d - DECRYPT MENU > DECRYPT MENU ROM.ZIP > OUTPUT.ZIP
r - REPACK MENU > REPACK MENU
e - ENCRYPT MENU >
c - CLEAN TOOL - Unmount and remove temporary files
x - exit
> DECRYPT MENU ROM.ZIP > OUTPUT.ZIP
1 ... 24 - decode the file rom.zip output.zip (select the target device)
> REPACK MENU
e - EXTRACT ZIP ROM - to extract the firmware from the ROM folder output.zip
m - MOUNT SYSTEM (EXT4 ONLY) - mount the partition image system.img in the folder system (you can add \ remove the firmware files)
d - DESPARSE SYSTEM.IMG (EXT4 ONLY) - uncompress the sparse image system.img (depending on the device - some zhaty, some not (determined EXPERIMENTAL)) and mount the partition image system.img in the folder system (you can add \ remove the firmware files)
s - MAKE SPARSE SYSTEM.IMG (EXT4 ONLY) - the creation of a sparse image sistem.img (you must specify the size of the partition XXXXM (device) - for example ONE X = 1280M)
n - UNMOUNT SYSTEM - dismount and delete the folder system
z - ADD SYSTEM.IMG > OUTPUT.ZIP - add new edited system.img into output.zip
> ENCRYPT MENU OUTPUT.ZIP > ROM.ZIP
1 ... 24 - create encrypt new rom.zip from output.zip
Thanks
as i9000 said:
[DEV_TOOL] HTC ROM EXTRACTOR
Tools for working with firmware HTC in LINUX
fit Kenny Millington Source
(HOW TO)
PUSH THE BUTTON
! Requirements (libunshield v0.7 or higher):
Code:
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
1. Extract from the zip and put the firmware. Exe to a folder with the tool;
2. Run in Terminal rom-extractor file and select the option:
u - extract from the file rom.zip RUU.exe
1 ... 21 - decode the file rom.zip output.zip (select the target device)
e - to extract the firmware from the ROM folder output.zip
m - mount the partition image system.img in the folder system (you can add \ remove the firmware files)
n - dismount and delete the folder system
c - Clean all tools
x - exit
d - uncompress the sparse image system.img (depending on the device - some zhaty, some not (determined EXPERIMENTAL)) and mount the partition image system.img in the folder system (you can add \ remove the firmware files)
s - the creation of a sparse image sistem.img (you must specify the size of the partition XXXXM (device) - for example ONE X = 1280M)
Click to expand...
Click to collapse
i can not work and i can not runnig
R: [DEV_TOOL] HTC ROM EXTRACTOR extract RUU & repack system.img
lauri_ylonen said:
i can not work and i can not runnig
Click to expand...
Click to collapse
This is only for linux
Inviato dal mio GT-I9070 con Tapatalk 2
Are there plans to add the One S?
Nm. Just looked at the source.... Oops.
bedwa said:
Are there plans to add the One S?
Nm. Just looked at the source.... Oops.
Click to expand...
Click to collapse
INFO FOR ALL...
If your device is not supported and you would like it supported please open an issue in the tracker with the device name, codename and a link to the most recent hboot file for the device. (Not a link to the full RUU!)
Click to expand...
Click to collapse
Kenny Milington https://github.com/kmdm/ruuveal
anything more?..
I promise to add new binaries in my instrument as we update source
Not as all. The oops was cause I looked at the source and noticed the unpacker was One S supported. Lol.
Fixed a typo in paragraph 21
HTC One VX (tc2) > HTC One S (ville)
add
HTC_ROM-EXTRACTOR_v.0.0.3_x64
it seems that I'm doing something wrong.
[email protected]:~$ git clone https://github.com/kmdm/unshield.git
Cloning into 'unshield'...
remote: Counting objects: 569, done.
remote: Compressing objects: 100% (208/208), done.
remote: Total 569 (delta 370), reused 545 (delta 346)
Receiving objects: 100% (569/569), 116.31 KiB | 204 KiB/s, done.
Resolving deltas: 100% (370/370), done.
[email protected]:~$ cd unshield/
[email protected]:~/unshield$ git checkout -t origin/v18\_wip
Branch v18_wip set up to track remote branch v18_wip from origin.
Switched to a new branch 'v18_wip'
[email protected]:~/unshield$ ./bootstrap
Creating configure.ac...done.
+ aclocal -I m4
./bootstrap: 29: ./bootstrap: aclocal: not found
[email protected]:~/unshield$
Click to expand...
Click to collapse
can anyone help?
Maybe a more step-bystep guide,
Sorry for been noob
andrewschumi said:
it seems that I'm doing something wrong.
can anyone help?
Maybe a more step-bystep guide,
Sorry for been noob
Click to expand...
Click to collapse
sudo apt-get install automake
Added
v.o.o.4
22 - HTC One U (m7_u)
23 - HTC One UL (m7_ul)
24 - HTC Desire SV (magnids)
ADDED v.0.0.5
REBUILD TOOL
ADDED ENCRYPT MENU!!!
as i9000 said:
ADDED v.0.0.5
REBUILD TOOL
ADDED ENCRYPT MENU!!!
Click to expand...
Click to collapse
Could you please help? unruu never completes. It gives me this
Extracting temporary files...
Extracting rom zip files...
./unruu_exe: line 8: 4379 Aborted (core dumped) ./unruu ruu.exe
failed to open source zip: No such file or directory
That last line fails because decrypt is looking for a zip that was never made.
If i do ./unruu ruu.exe , I am given the following
[email protected]:~/Desktop/HTC_ROM-EXTRACTOR_v.0.0.5/tools$ ./unruu ruu.exe
Extracting temporary files...
Extracting rom zip files...
Aborted (core dumped)
Click to expand...
Click to collapse
this was done as root with the same result.
Perhaps I need to switch to all i386 binaries? Ill try that, but i was trying to avoid it, as it will break my current nvidia driver setup. ohwell
Tilde88 said:
Could you please help? unruu never completes. It gives me this
Extracting temporary files...
Extracting rom zip files...
./unruu_exe: line 8: 4379 Aborted (core dumped) ./unruu ruu.exe
failed to open source zip: No such file or directory
That last line fails because decrypt is looking for a zip that was never made.
If i do ./unruu ruu.exe , I am given the following
this was done as root with the same result.
Perhaps I need to switch to all i386 binaries? Ill try that, but i was trying to avoid it, as it will break my current nvidia driver setup. ohwell
Click to expand...
Click to collapse
Did you do this?
! Requirements (libunshield v0.7 or higher):
Code:
$ sudo apt-get install automake
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
Added version 0.0.6 x86-64
25 - HTC One WLS (m7_wls)
26 - HTC One SV (k2_u)
27 - HTC One SV (k2_plc_cl)
as i9000 said:
Did you do this?
! Requirements (libunshield v0.7 or higher):
Code:
$ sudo apt-get install automake
$ git clone https://github.com/kmdm/unshield.git
$ cd unshield/
$ git checkout -t origin/v18\_wip
$ ./bootstrap
$ ./configure --prefix=/usr
$ make
$ sudo make install
Click to expand...
Click to collapse
lol yes of course
Tilde88 said:
lol yes of course
Click to expand...
Click to collapse
OK, try to extract some different rom, may be you has problem from invalid ruu.exe..
and more, what size have your ruu.exe? - x32 systems, can't handle files largest 2GB...
as i9000 said:
OK, try to extract some different rom, may be you has problem from invalid ruu.exe..
and more, what size have your ruu.exe? - x32 systems, can't handle files largest 2GB...
Click to expand...
Click to collapse
im running x64, tried with x64 binaries, and i also tried using 32bit binaries. furthermore, my RUU is onlt 1.15GB. Also, x86 (there is not such thing as x32) can handle 3gb files.
thanks so much for the tool though, everything else workes, I juse used a script I found from another developer to get the .zip, then used your tool for all the other features.
Tilde88 said:
im running x64, tried with x64 binaries, and i also tried using 32bit binaries. furthermore, my RUU is onlt 1.15GB. Also, x86 (there is not such thing as x32) can handle 3gb files.
thanks so much for the tool though, everything else workes, I juse used a script I found from another developer to get the .zip, then used your tool for all the other features.
Click to expand...
Click to collapse
Well then stay one variant - you doesn't installed "Unshield", try run terminal and input 'unsield'
here the correct conclusion:
Code:
~$ unshield
No action provided on command line.
Syntax:
unshield [-c COMPONENT] [-d DIRECTORY] [-D LEVEL] [-g GROUP] [-i VERSION] [-GhlOrV] c|g|l|t|x CABFILE [FILENAME...]
Options:
-c COMPONENT Only list/extract this component
-d DIRECTORY Extract files to DIRECTORY
-D LEVEL Set debug log level
0 - No logging (default)
1 - Errors only
2 - Errors and warnings
3 - Errors, warnings and debug messages
-g GROUP Only list/extract this file group
-h Show this help message
-i VERSION Force InstallShield version number (don't autodetect)
-j Junk paths (do not make directories)
-L Make file and directory names lowercase
-O Use old compression
-r Save raw data (do not decompress)
-V Print copyright and version information
Commands:
c List components
g List file groups
l List files
t Test files
x Extract files
Other:
CABFILE The file to list or extract contents of
FILENAME... Optionally specify names of specific files to extract (wildcards are supported)
hi is there any chance to add the Desire HD. As i am trying to merge a Orange UK RUU for Desire DHD and they never released the last RUU with all the OTA's to make a New RUU with all the OTA's included.
I have made a Nandroid backup after all the OTA's was installed to the phone i even have all the OTA's just need a way to extract the rom.zip (easy from exe file not a issue) add the changed .img files such as radio, system, hboot recovery rcdata lib.img and make a new rom.zip and ruu.exe any way this can be done just tried with your tool and got invalid htc aes encrypted zip.
Thanks in advance
<Making Progress> Compile 2013 Nexus 7 – Flash to device – Stuck a Google boot screen
I am using the following device: 2013 Nexus 7
Android version: 4.3
Kernel version: [email protected]__ #1
Build number: JSS15Q
The problem:
When I try to flash a new boot.img file that contains my own recompiled kernel I am unable to boot the system – it sticks at the Google boot screen (and does not make it to the color X screen)
Below I have detailed out the steps I have taken. Please take a look and tell me if you notice if I am doing something wrong.
The following step were taken while running Ubuntu 12.04 LTS
*******************************************************************************************
Unlocking the 2013 Nexus 7 (Flo=wifi)
Rooting the 2013 Nexus 7 (Flo=wifi)
*** Compile/Recompile the kernel ***
*** Create a new boot.img file ***
….. contains instructions for getting root access
*** Flashing a new boot.img file ***
*******************************************************************************************
Unlocking the 2013 Nexus 7 (Flo=wifi)
Open a terminal and make sure that your system can see the Nexus 7, run:
$ ./adb devices
If you see the Nexus 7, run:
$. /adb reboot bootloader
When the bootloader screen has reappeared, run:
$ sudo ./fastboot devices
-If you can see the Nexus 7, run:
$ sudo ./fastboot oem unlock
-Look at the Nexus 7, a screen should appear asking you if you want to “Unlock the bootloader” – choose Yes.
You will need to use volume up/down to choose a response and press the power button to select.
- The device will flash a new image and exit to prompt
Next, reboot the device:
$ sudo ./fastboot reboot
The device is now unlocked.
*******************************************************************************************
Rooting the 2013 Nexus 7 (Flo=wifi)
*** Compile/Recompile the kernel ***
In the following steps you will be compiling/recompileing a kernel for the Nexus 7.
*Make sure that libncurses5-dev is installed (needed for make menuconfig)
Starting out I am at the following location
[email protected]:/home/user $
In your home directory create a folder named “Razor_Flo”:
$ mkdir Razor_Flo
Move into the new folder:
$ cd Razor_Flo
You should be here – [email protected]:/home/user/Razor_Flo $
In the Razor_Flo directory, create a sub directory named “Kernel”:
$ mkdir Kernel
Move into the new folder:
$ cd Kernel
You should be here – [email protected]:/home/user/Razor_Flo/Kernel $
[----------------- For the next steps, I used the following website to determine what files I needed -----------------]
__http__://source.android.com/source/building-kernels.html
Figuring out which kernel to build
[----------------------------------------------------------------------------------------------------------------------------------------------]
In the Kernel folder, download the following files:
$ git clone __https__://android.googlesource.com/device/asus/flo-kernel
$ cd flo-kernel
You should be here – [email protected]:/home/user/Razor_Flo/Kernel/flo-kernel $
$ git log --max-count=1 kernel
-- Log information will be displayed, under the “flo: prebuilt kernel” you will see a set of numbers and letters that will look like 365a6e0, note that number for future use.
Back out of the flo-kernel folder
$ cd ..
You should be here – [email protected]:/home/user/Razor_Flo/Kernel $
Once you are in the Kernel folder, download the following files:
$ git clone __https__://android.googlesource.com/kernel/msm.git
-- This command will create an msm directory
Move into the msm folder
$ cd msm
You should be here – [email protected]:/home/user/Razor_Flo/Kernel/msm $
[---------------------- For the next step, I used the following website to acquire the files I needed --------------------]
__http__://source.android.com/source/building-kernels.html
On a linux host, if you don't have an Android source tree, you can download the prebuilt toolchain from:
$ git clone __https__://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
[-----------------------------------------------------------------------------------------------------------------------------------------------]
Export the path to the prebuilt gcc files
$ export PATH=$PATH: <link to files>
Additional exports
$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=arm-eabi-
Checkout the correct kernel files
$ git checkout 365a6e0 <-- the number you noted above
Make the Kernel
$ make flo_defconfig
* At this point you can use “make menuconfig” to make any changes to the .config file you need (i.e. kernel modifications)
$ make
* When the make is complete a file named zImage will be created here:
.../arch/arm/boot/zImage <-- Note this, you will need the file later
The kernel compile/recompile is now complete
*** Create a new boot.img file ***
In the following steps you will be taking apart the “Factory boot.img” so that you can create a “Modified boot.img” which will contain your modified and rooted kernel.
You should be here – [email protected]:/home/user/Razor_Flo/Kernel/msm $
Move up two directories
$ cd ../../
You should be here – [email protected]:/home/user/Razor_Flo $
[------------------------------------------------------- Tools need for next step -------------------------------------------------------]
You will need to download the following files.
-- split_bootimg.pl
__http__://code.google.com/p/zen-droid/downloads/detail?name=split_bootimg.pl
-- mkbootimg
__http__://code.google.com/p/zen-droid/downloads/detail?name=mkbootimg
-- 2013 Nexus Factory Images
__https__://dl.google.com/dl/android/aosp/razor-jss15q-factory-4f77b811.tgz
* You will need to copy this file to a unique location so that you can extract the “boot.img” that is located with it.
[------------------------------------------------------------------------------------------------------------------------------------------------]
Create a new folder named Workspace
$ mkdir Workspace
Enter the Workspace directory
You should be here – [email protected]:/home/user/Razor_Flo/Workspace $
Make two new folders in this directory
$ mkdir Original
$ mkdir Hacked
Move into the Hacked folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked $
Create a new folders named Hacked_ramdisk
$ mkdir Hacked_ramdisk
Move up two directories – to the Workspace folder
$ cd ../../
You should be here – [email protected]:/home/user/Razor_Flo/Workspace $
Copy the 2013 Nexus 7 factory boot.img file into the ..Workspace/Original folder
-- can be found within the factory tgz file:
Copy the split_bootimg.pl file to the ..Workspace/Original folder
Copy the mkbootimg file to the ..Workspace/Hacked folder
Move the zIamge file to the ..Workspace/Hacked folder
Move to the Hacked folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked $
Rename the zImage file to boot.img-kernel
Move up one directory - to the Workspace folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace $
Move to the Original folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Original $
Run the following command:
$ ./split_bootimg.pl boot.img
This will create two files, copy the boot.img-kernel and boot.img-ramdisk.gz
Copy the boot.img-ramdisk.gz file to the “Hacked/Hacked_ramdisk” folder
Move to the Hacked/Hacked_ramdisk folder
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked/Hacked_ramdisk $
Run the following command:
$ sudo gzip -cd boot.img-ramdisk.gz | cpio -i
This will extract all the files with in the boot.img-ramdisk.gz file.
Delete the original boot.img-ramdisk.gz file that you just extracted the files from.
Edit the default.prop file
change ro.secure=1 to ro.secure=0
change ro.adb.secure=1 to ro.adb.secure=0
Save changes and close the file.
Run the following command :
$ find .| cpio -o -H newc | gzip > insecure_boot.img-ramdisk.gz
This will create a new file named insecure_boot.img-ramdisk.gz.
Rename the insecure_boot.img-ramdisk.gz. file to boot.img-ramdisk.gz and copy it up one folder in the hierarchy to the “Hacked” folder.
Move up one directory - ../Workspace/Hacked
You should be here – [email protected]:/home/user/Razor_Flo/Workspace/Hacked $
List the files in the ../Workspace/Hacked directory, there should be three files:
(1) boot.img-kernel, (2) boot.img-ramdisk.gz, & (3) mkbootimg
Run the following command from within the “Hacked” folder
$ ./mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel boot.img-kernel --ramdisk boot.img-ramdisk.gz -o mynewimage.img
Rename mynewimage.img to boot.img and flash on the device.
The new boot image is now complete and ready to flash.
*** Flashing a new boot.img file ***
[------------------------------------------------------- Tools need for next step -------------------------------------------------------]
You will need to download the following file.
-- 2013 Nexus Factory Images
__https__://dl.google.com/dl/android/aosp/razor-jss15q-factory-4f77b811.tgz
* You will need to copy this file to a unique location so that you can extract the “system.img” file that is located with it.
--- Android SDK (I used the 64-bit version)
__http__://dl.google.com/android/android-sdk_r22.0.5-linux.tgz
[------------------------------------------------------------------------------------------------------------------------------------------------]
You will need to use both the adb and fastboot utilites that come in the Android SDK application.
You will need two image to complete this task
1. boot.img <--file you just created, located in the ../Workspace/Hacked directory
2. system.img <-- can be found within the factory tgz file:
Starting out I am at the following location
[email protected]:/home/user/android-sdk/platform-tools $
Place both the boot.img and system.img files into the same folder as the adb and fastboot utilites.
Verify that you can see the Nexus 7 device that you are about to flash
$ sudo ./adb devices
*if you cannot see the device, make sure that you have checked the “enable USB Debugging” in the developer options.
Run the following commands
$ sudo ./adb reboot bootloader
$ sudo ./fastboot flash boot boot.img
$ sudo ./fastboot flash system system.img
$ sudo ./fastboot format cache
$ sudo ./fastboot format userdata
$ sudo ./fastboot restart
At this point the system should be unlocked and rooted.
Bump - still looking for help
Post your zImage.
Sent from my Nexus 4 using Tapatalk 4
Here is the zImage I created
Here is the zImage that I created.
I have rename it to chad.img
Thanks
jassycliq said:
Post your zImage.
Sent from my Nexus 4 using Tapatalk 4
Click to expand...
Click to collapse
Hi All
I am still looking for feedback - if anyone has any.
Thanks
Chad
Chady said:
Hi All
I am still looking for feedback - if anyone has any.
Thanks
Chad
Click to expand...
Click to collapse
I used this and I got it working:
http://source.android.com/source/initializing.html
I created the msm directory inside the flo-kernel directory as a place to put the kernel source. I don't know if that is right, or if it even matters, but it works for me. Then I had to move the zImage to out/product/target/flo/kernel before doing the make on the framework. Don't forget to do the "source build/envsetup.sh" and "lunch" before making the framework. Before compiling the kernel, be sure to set ARCH, SUBARCH and CROSS_COMPILE environment variables and make sure your PATH includes the prebuilt cross-compiler.
Making headway
Ok, So I made some headway lastnight.
I have not figured out how to compile the kernel on my own however, I am able to compile and boot an AOSP image for the 2013 Nexus 7
My problem getting the image to boot once compiled centered around drivers. I was under the impression that Android would work like Linux and Windows... meaning that if you did not have device drivers installed the OS would still boot - I was wrong. After installing the drivers (via the provided install .sh files) I then compiled the OS, flashed the device, and the system boot.
Now I am off to figure out how to get a custom kernel running.
Chad
for the benifit of others
Chady said:
Ok, So I made some headway lastnight.
I have not figured out how to compile the kernel on my own however, I am able to compile and boot an AOSP image for the 2013 Nexus 7
My problem getting the image to boot once compiled centered around drivers. I was under the impression that Android would work like Linux and Windows... meaning that if you did not have device drivers installed the OS would still boot - I was wrong. After installing the drivers (via the provided install .sh files) I then compiled the OS, flashed the device, and the system boot.
Now I am off to figure out how to get a custom kernel running.
Chad
Click to expand...
Click to collapse
For the benefit of others who might look at this forum in the future.
This is what is required to be done.
source.android.com/source/building-devices.html#obtaining-proprietary-binaries
I faced the same problem and took time to figure out what it really meant.
Also if it is in an infinite loop after the above procedure. Try doing fastboot flashall -w
-w option did the magic for me when I was stuck in an infinite loop after the above procedure.
I don't know if this thread will help anyone, but it amused me to do it.
A few folks here have accidentally bricked their Nooks without a good backup.
Yes, you can get a new image loaded onto your Nook but you might have lost the /rom partition.
The /rom partition holds all the factory information unique to your Nook.
If you just copy the whole internal memory from someone else, you'll be using the same MAC, serial number and security keys.
Whether that is a big deal or not depends.
I wrote a little utility, it's in the beta test phase.
It can take a ~1.9GB image backup file and extract the files from the /boot, /rom or /media partitions.
It can do that even if the partition table has been trashed.
Run this in an empty directory because it copies all the files in a flat structure.
(Later I'll get around to doing subdirectories.)
Here's an example:
Code:
imagefix.exe C:\mybackup.img 2 /a
# Id Start End Size
-- -- --------- --------- ---------
1 0C 32 155647 155616
2 0C 155648 188415 32768
3 83 188416 577535 389120
4 05 577536 3792895 3215360
5 83 577568 1167359 589792
05 1167360 3792895 2625536
6 0C 1167392 1658879 491488
05 1658880 3792895 2134016
7 83 1658912 2150399 491488
05 2150400 3792895 1642496
8 83 2150432 3792895 1642464
== Partition 2 ==
rom
├──devconf
│ ├──BatteryType
│ ├──BootCnt
│ ├──Bq275020Dffs
│ ├──DateManufactured
│ ├──DeviceAttribute
│ ├──DeviceID
│ ├──EpdVcom
│ ├──EpdWaveform
│ ├──EpdWaveform.backup
│ ├──EpdWaveformOriginalFilename
│ ├──EpdWaveformOriginalFilename.backup
│ ├──EventType
│ ├──HashOfPrivateKey
│ ├──MACAddress
│ ├──MainBoardSN
│ ├──ModelNumber
│ ├──OperatingMode
│ ├──ProductID
│ ├──PublicKey
│ ├──SerialNumber
│ ├──WiFiBackupCalibration
│ └──ean
└──bcb
This will list all the files on the 2nd partition.
The /a flag sorts the files in alphabetic order instead of disk order.
If it barfs, that's because the partitioning table has been trashed. Try:
Code:
imagefix.exe C:\mybackup.img 2 /d /a
That will ignore the partitioning table and use the factory default.
To actually extract the files, add the /w flag (use the /d if you need it).
Code:
imagefix.exe C:\mybackup.img 2 /w /a
imagefix can also work directly on raw devices, like when you have your Nook running noogie.
Let's say you boot your Nook on noogie and /boot appears as H:\
You can then extract files by typing:
Code:
imagefix.exe H: 2 /w /a
(Note that the H ends in colon, not colon backslash.)
Let's say that you trashed your Nook so badly that it doesn't even show up as a drive letter.
You can still use imagefix using the physical device number.
You can go to the Windows Disk Manager and find the Disk Number, for example 3:
Code:
imagefix.exe 3 2 /d /w /a
Even though this program is called "imagefix" it only reads and does not modify the image.
You can even safely call it on your hard disk.
Of course, my favorite way of running noogie is using omaplink.exe
Code:
omaplink.exe omap3_aboot.bin u-boot12.bin uImage-noogie uRamdisk-noogie
Those files can be found in this post: http://forum.xda-developers.com/showpost.php?p=49779966&postcount=285
You could also just put noogie on an SD card and boot up that way.
Any feedback is appreciated.
Warning: Command line usage has changed, see below!
i have met some users on forum lost their rom files partition ... i will try contact them .... thx to U Renate , really i am think about messed up with my nook and try ur new utility
The command line usage has changed from the original post.
To look at the partitioning of a backed up (~1.9GB) image file:
Code:
C:\>imagefix backup.img
Image is partitioned as stock NST
# Id Start End Size Label
── ── ───────── ───────── ───────── ────────────────
1 0C 32 155647 155616 boot
2 0C 155648 188415 32768 rom
3 83 188416 577535 389120 factory
05 577536 3792895 3215360
5 83 577568 1167359 589792
05 1167360 3792895 2625536
6 0C 1167392 1658879 491488 NOOK
05 1658880 3792895 2134016
7 83 1658912 2150399 491488 cache
05 2150400 3792895 1642496
8 83 2150432 3792895 1642464 data
3792896 3823469 30574
To list the files in the /rom partition (the first flag is the letter L):
Code:
C:\>imagefix backup.img /l /a 2
== Partition 2 ==
rom
├──devconf
│ ├──BatteryType
│ ├──BootCnt
│ ├──Bq275020Dffs
│ ├──DateManufactured
│ ├──DeviceAttribute
│ ├──DeviceID
│ ├──EpdVcom
│ ├──EpdWaveform
│ ├──EpdWaveform.backup
│ ├──EpdWaveformOriginalFilename
│ ├──EpdWaveformOriginalFilename.backup
│ ├──EventType
│ ├──HashOfPrivateKey
│ ├──MACAddress
│ ├──MainBoardSN
│ ├──ModelNumber
│ ├──OperatingMode
│ ├──ProductID
│ ├──PublicKey
│ ├──SerialNumber
│ ├──WiFiBackupCalibration
│ └──ean
└──bcb
To extract the files in the /rom partition:
Code:
C:\>imagefix backup.img /x 2
If you have corrupted partition tables and want to try with presumed partitioning:
Code:
C:\>imagefix backup.img /l /a 2 /pnst [b]// for NST or black Glow[/b]
C:\>imagefix backup.img /x 2 /pnst
C:\>imagefix backup.img /l /a 2 /png2 [b]// for white Glow[/b]
C:\>imagefix backup.img /x 2 /png2
imagefix.exe is in the signature.
{
"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"
}
Introduction:-
Hey guys! Here's a complete tutorial for building or porting MIUI to your device! I know there are already some guides for it but I felt none of them were noob-friendly and many were confusing and missing some important instructions. So I decided to share this complete guide which will teach you how to build MIUI from scratch. This is a basic guide in which I have taken building latest MIUI v7 as example. So let's start!
POST 1- Guide to build MIUI using PatchROM Sources
POST 2- Modifying boot.img
POST 3- Guide to port MIUI from another device
Basically,There are two methods by which you can build MIUI ROM for your device.
Build from source using PatchROM Method
Port manually from another device which already has MIUI
Let's start with PatchROM Method:-
Requirements:-
Ubuntu 14.04 64-bit. (Installed as virtual machine like in VMware will also work)
Base ROM for your device.
NOTE- Preferably take pure AOSP built for your device as base ROM rather than CyanogenMod. You'll get less rejects while patching MIUI framework. But CM works too! Your choice..
Apktool. You can use Advanced Apktool by BDFreak. It's easier to use.
Working brain and a lot of patience!!
Prerequisites:-
First of all, take framework-res.apk, framework.jar, framework2.jar, services.jar, android.policy.jar and telephony-common.jar from your base ROM zip.
Now using apktool, decompile all above files.
If you're using advanced apktool then go to 3-Out folder and rename the respective folders to-
PHP:
framework-res
framework.jar.out
framework2.jar.out
services.jar.out
android.policy.jar.out
telephony-common.jar.out
We'll need these folders further for MIUI framework patching.
STEP-1: Preparing build environment
Switch to Ubuntu 14.04. We'll have to prepare ROM building environment.
Next step is to setup android sdk. Follow THIS guide. (Look at 2nd answer graphical image explanation. Follow till step 5.)
Now run the following commands as superuser from terminal-
PHP:
sudo apt-get update
Then after run this-
sudo apt-get install bison build-essential curl flex git git-core gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev unzip lib32readline-gplv2-dev lib32z1-dev make python-networkx zlib1g-dev:i386 phablet-tools
Click to expand...
Click to collapse
All the necessary packages are now installed. Now the next step is to configure repository.
In terminal,run following commands-
PHP:
mkdir -p ~/bin
PHP:
PATH=~/bin:$PATH
PHP:
cd ~/bin
PHP:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
PHP:
chmod a+x ~/bin/repo
PHP:
mkdir ~/patchrom
PHP:
cd ~/patchrom
PHP:
repo init -u git://github.com/MiCode/patchrom.git -b miui-7 -m android-4.4.4.xml
Now you'll have to configure git. Run following commands in terminal-
Code:
git config --global user.email [COLOR="Red"]ENTER_YOUR_EMAIL_ID_HERE[/COLOR]
Code:
git config --global user.name [COLOR="Red"]ENTER_YOUR_REAL_NAME_HERE[/COLOR]
Now it's time to download the MIUI source code! Run the following command in terminal-
PHP:
repo init -u git://github.com/MiCode/patchrom.git -b miui-7 -m android-4.4.4.xml
PHP:
repo sync
Now grab a cup of coffee while the MIUI source gets downloaded. Required time depends on speed of your internet connection. The MIUI source is of size about 600-700 MB (With .repo total is 1.5 GB).
After the source is downloaded,create a new directory in /home. Name it whatever you want. (Preferably codename of your device) In my case, it's taoshan.
PHP:
cd /home/stryder/
PHP:
mkdir taoshan
PHP:
cd taoshan
Now create a makefile for your device. If you want, you can make changes to this my makefile and use.
PHP:
gedit makefile
You can copy the following content in makefile (Don't forget to make changes in it according to your device) and save it.
Code:
#
# Makefile for taoshan
#
# The original zip file, MUST be specified by each product
local-zip-file := stockrom.zip
# The output zip file of MIUI rom, the default is porting_miui.zip if not specified
local-out-zip-file := MIUI7_taoshan.zip
# All apps from original ZIP, but has smali files chanded
local-modified-apps :=
local-modified-priv-apps :=
local-modified-jars :=
# All apks from MIUI
local-miui-removed-apps :=
local-miui-removed-priv-apps :=
local-miui-modified-apps :=
# All apps need to be removed from original ZIP file
local-remove-apps := Gallery2 Exchange2
# Config density for co-developers to use the aaps with HDPI or XHDPI resource,
# Default configrations are HDPI for ics branch and XHDPI for jellybean branch
local-density := XHDPI
PORT_PRODUCT := taoshan
# To include the local targets before and after zip the final ZIP file,
# and the local-targets should:
# (1) be defined after including porting.mk if using any global variable(see porting.mk)
# (2) the name should be leaded with local- to prevent any conflict with global targets
#local-pre-zip := local-pre-zip-misc
#local-after-zip:= local-put-to-phone
# The local targets after the zip file is generated, could include 'zip2sd' to
# deliver the zip file to phone, or to customize other actions
#include phoneapps.mk
include $(PORT_BUILD)/porting.mk
local-pre-zip-misc:
@echo Update boot.img
cp other/boot.img $(ZIP_DIR)/boot.img
@echo Update build.prop
cp other/build.prop $(ZIP_DIR)/system/build.prop
@echo Delete some unneeded files
rm -rf $(ZIP_DIR)/system/etc/.has_su_daemon
rm -rf $(ZIP_DIR)/system/priv-app/Dialer.apk
rm -rf $(ZIP_DIR)/system/priv-app/Keyguard.apk
rm -rf $(ZIP_DIR)/system/priv-app/SystemUI.apk
rm -rf $(ZIP_DIR)/system/priv-app/VoiceDialer.apk
rm -rf $(ZIP_DIR)/system/priv-app/Launcher3.apk
rm -rf $(ZIP_DIR)/system/priv-app/ParanoidOTA.apk
rm -rf $(ZIP_DIR)/system/priv-app/ThemeChooser.apk
rm -rf $(ZIP_DIR)/system/priv-app/ThemesProvider.apk
Explanations:-
'local-zip-file' = Name of your original Base ROM zip
'local-out-zip-file' = Name for your finished MIUI rom
'local-modified-apps' = Apps that will be modified to fit in with the framework. They need to be modified because they contact with the system
'local-remove-apps' = Apps that will be removed from the original ROM
'local-pre-zip' = Refers to code-block that should be executed before the zip is done.
'local-after-zip' = Refers to code-block executed after the zip is completed
'local-zip-misc' = The code-block just described at 'local-pre-zip'. It adds some Google Apps and a build.prop
'local-test' = Another code-block
Now, manually copy the previously decompiled framework folders to your device folder.
PHP:
framework-res
framework.jar.out
framework2.jar.out
services.jar.out
android.policy.jar.out
telephony-common.jar.out
Next,copy your Base ROM zip in your device folder.
Now move to patchrom folder.
PHP:
cd ~/patchrom
PHP:
source build/envsetup.sh
Again move to your device folder and start MIUI framework patching.
PHP:
cd /home/stryder/taoshan
PHP:
make firstpatch
Now a new folder folder temp will be created. In that you'll find the reject folder in which there will be rejects which you have to fix manually. Follow THIS excellent guide by @JavierAlonso to fix rejects. Also see THIS guide.
After fixing all the rejects, type following command to create a flashable zip of your MIUI ROM.
PHP:
make fullota
or you can also use
PHP:
make zipfile
With this, the flashable zip file is built. Now follow the tutorial from next post to modify your boot.img and include this new boot.img in your flashable MIUI ROM zip. Then flash the zip from recovery and enjoy your source built MIUI ROM!
Sometimes, your device might get stuck on bootanimation so in this case, take LOGCAT and look for the error and solve it. You can use some tools like Advanced Logcat Viewer to read the log.
Modifying boot.img
Now, let's modify the boot.img from base ROM zip to it make compatible with our MIUI ROM.
First of all, download any boot image kitchen or editor. I used Android Image Kitchen for Windows.
Assuming you're using the same kitchen, Extract the files from Android Image Kitchen in a separate folder. Copy your base ROM boot.img in that folder.
Now drag and drop the boot.img on unpackimg. The kernel files will be extracted in ramdisk and split_img folder.
We have to modify the ramdisk so move to that. In sbin folder, you'll see the extracted files.
Now there are two chances- First, Your ramdisk is already extracted with various folders and files. In that case ignore the next steps and directly modify in respective files using Notepad++.
While in second case, you'll get the ramdisk as ramdisk.cpio file. If you get this the you'll have to move to Ubuntu again for extracting it.
Now in Ubuntu, copy your ramdisk.cpio in a seperate folder (suppose in stryder folder) in your home directory.
Now, open terminal and run the following command-[No need as superuser]
PHP:
cd stryder
PHP:
cpio -i -F ramdisk.cpio
Some output will be shown in terminal as 2320 blocks or something like that!
Now in your folder, you'll see the extracted ramdisk files.
Now comes the actual modification.
First of all, download attached zip and extract the files in appropriate folders. (If the folder is not present, add that folder).
Open default.prop and edit the lines like this-
PHP:
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.adb.secure=0
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=1
persist.sys.usb.config=mtp,adb
persist.service.adb.enable=1
persist.service.debuggable=1
Save the changes and open init.cm.rc (In case of CyanogenMod) or init.pa.rc (In case of AOSPA). Add # before the import line like this-
PHP:
# Superuser
#import /init.superuser.rc
Save this file and now open init.rc.
At the end of init.rc file, add these lines-
PHP:
#service for shelld
service shelld /system/xbin/shelld
class main
#service for su
service su_daemon /system/xbin/su --daemon
class main
oneshot
service lbesec /system/xbin/lbesec
class main
oneshot
Save this file and then open seapp_contexts.
In that file, add at the end-
PHP:
user=theme seinfo=platform domain=platform_app type=platform_app_data_file
user=backup seinfo=platform domain=platform_app type=platform_app_data_file
user=updater seinfo=platform domain=platform_app type=platform_app_data_file
user=theme_man domain=system_app type=system_data_file
Also modify these lines (if present) to look like this-
PHP:
user=_app domain=untrusted_app type=app_data_file
user=_app seinfo=platform domain=platform_app type=app_data_file
user=_app seinfo=shared domain=shared_app type=app_data_file
user=_app seinfo=media domain=media_app type=app_data_file
user=_app seinfo=release domain=release_app type=app_data_file
Save this file and if present, open init.qcom.rc.
And before this line (at the end)-
PHP:
on property:sys.boot_completed=1
Add these lines-
PHP:
service shelld /system/xbin/shelld
class main
Save the file. Now it's time to repack your ramdisk.
First, move your original ramdisk.cpio from the extracted folder to /home. That is, if your extracted ramdisk is in
PHP:
/home/stryder/
Move original ramdisk.cpio file to-
PHP:
/home/
After that, run this command in terminal-
PHP:
cpio -i -t -F ../ramdisk.cpio | cpio -o -H newc -O ../ramdisk_new.cpio
Now a new file ramdisk_new.cpio will be created. Take a look if it's of the same size as the original one just a few bytes difference.
Also open this ramdisk_new.cpio and make sure you have the newly added files in it. (Ex. otad in bin folder etc.)
Now move this ramdisk_new.cpio to previously extracted Android Image kitchen ramdisk/sbin/ directory.
Delete the original ramdisk.cpio from it and rename the ramdisk_new.cpio to ramdisk.cpio.
Now come back and directly run repackimg. The modified image_new will be generated. Rename it to boot and include this modified boot.img in your MIUI ROM zip. Now you can proceed to flash your MIUI ROM!
Special Thanks- @Zenamp
Port MIUI from another device
Requirements:-
7-zip, Winrar or similar software
Notepad++
Instructions:-
First of all, make 2 folders- 1. BASE ROM 2. PORT ROM
What is Base ROM: It is the ROM which is built for your device. (AOSP or CM etc.)
What is Port ROM: MIUI ROM of other device which you want to port to your device.
NOTE- It's better if the port device and your device has same CPU architecture and specifications. If you couldn't find same specification device then try the device having almost similar specification of your device.
Now extract the Base ROM zip in BASE ROM folder and Port ROM zip in PORT ROM folder.
Next, Delete addon.d (If present), app, framework, fonts, media and priv-app folder in System folder of BASE ROM.
Now copy addon.d (If present), app, framework, fonts, media and priv-app folder from system folder of PORT ROM to system folder of BASE ROM.
Now open etc folder in both ROMs folder. Go to init.d folder of PORT and copy and replace any extra files except 00banner to init.d of BASE ROM.
Now open permissions folder in etc of both ROMs and copy and replace all the permissions files from PORT ROM to your BASE ROM folder except handheld_core_hardware.xml and platform.xml. (In case of CM based BASE ROM, also don't replace org.cyanogenmod.hardware.xml).
Also copy any extra folder available in PORT ROM etc/ to BASE ROM etc/ e.g. miui_feature folder.
Now open your system_fonts.xml in etc folder of BASE ROM and copy this before </familyset> end of file
PHP:
<family>
<nameset>
<name>miui</name>
</nameset>
<fileset>
<file>Miui-Regular.ttf</file>
<file>Miui-Bold.ttf</file>
</fileset>
</family>
<family>
<nameset>
<name>miuiex</name>
</nameset>
<fileset>
<file>MiuiEx-Regular.ttf</file>
<file>MiuiEx-Bold.ttf</file>
</fileset>
</family>
<family>
<nameset>
<name>miuiex-light</name>
</nameset>
<fileset>
<file>MiuiEx-Light.ttf</file>
</fileset>
</family>
Now copy all the extra files from PORT ROM bin, lib and xbin folder to BASE ROM respective folders. Remember, DO NOT REPLACE anything. Just copy and paste and skip the files with same name.
Now, open build.prop of BASE ROM. You can change these value to anything you like-
PHP:
ro.build.id=
ro.build.display.id=
ro.build.date=
ro.build.date.utc=
ro.product.locale.language=en
ro.product.locale.region=US
ro.cm.version=
ro.modversion=
Now copy paste these values at the end of your BASE ROM build.prop. You can edit the fields but keep the structure same.You can look at PORT ROM build.prop for reference.
PHP:
ro.build.description=devicename-user 4.4.2 yourname C2104XXUCNG1 release-keys
ro.build.fingerprint=devicemanufacturer/devicemodel/device:4.4.2/yourname/C2104XXUCNG1:user/release-keys
ro.product.model=Xperia L
ro.product.device=taoshan
ro.build.characteristics=default
#MIUI_Features
ro.miui.has_real_blur=0
ro.miui.has_handy_mode_sf=1
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg
ro.product.manufacturer=Xiaomi
ro.config.elder-ringtone=Angel.mp3
persist.sys.mitalk.enable=true
ro.miui.ui.version.code=5
ro.miui.ui.version.name=V7
persist.sys.strictmode.disable=true
ro.product.mod_device=yourdevice
Change these fields in BASE ROM build.prop according to PORT ROM build.prop-
PHP:
ro.config.notification_sound=
ro.config.alarm_alert=
ro.config.ringtone=
If your device has On-screen buttons, then add this value at the end of BASE ROM build.prop-
PHP:
qemu.hw.mainkeys=0
Now we're done with build.prop.
Next, open META-INF/com/google/android/updater-script from BASE ROM using Notepad++ and change, compare and replace all the symlink and set_metadata lines in updater-script according to PORT ROM updater-script.If some extra lines are there in BASE ROM updater-script, keep it as it is.
NOTE:-I have attached one sample updater-script with this post. Look below. You can refer from that if you feel any difficulty.
Add these before unmount("/system"); at the end of updater-script-
PHP:
set_perm(0, 1000, 06750, "/system/xbin/shelld");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
package_extract_file("META-INF/com/miui/relink", "/tmp/relink");
set_perm(0, 0, 0555, "/tmp/relink");
run_program("/tmp/relink");
delete("/tmp/relink");
set_perm_recursive(1000, 1000, 0755, 0644, "/data/miui");
set_metadata("/system/bin/debuggerd", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/bin/debuggerd_vendor", "uid", 0, "gid", 2000, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:debuggerd_exec:s0");
set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:su_exec:s0");
delete_recursive("/data/miui/preinstall_apps");
delete_recursive("/data/miui/cust/preinstall_apps");
ui_print("Installation finished...Enjoy!");
unmount("/data");
Also copy META-INF/com/miui and data folder to BASE ROM from PORT ROM.
Now modify your BASE ROM boot.img using the tutorial from previous post and put that new boot.img in BASE ROM folder.
Finally, select META-INF, system, boot.img, file_contexts(If present) and data folder in BASE ROM.
Right click and select Add to Archive. Select Zip. Type the name of zip. (Don't delete ".zip" at the end!) Click OK.
Now you're ready to flash this zip from recovery.
Sometimes, your device might get stuck on bootanimation so in this case, take LOGCAT and look for the error and solve it. You can use some tools like Advanced Logcat Viewer to read the log. Look HERE for fixing bootloop.
I hope you guys understood how to build and port MIUI. I wish you good luck! If you get stuck anywhere, If you become successful building MIUI, feel free to post here. Also if you succeed, I'll appreciate if you give me credits and add link to this thread in your ROM thread on XDA.
Frequently Asked Questions
Shepard62700FR said:
The PatchROM technique (post #1 tutorial) works for Android 4.4 KitKat, meaning that you have to find a KitKat AOSP or CyanogenMod 11 ROM for your device as a base, STRYDER said that he doesn't recommend the OEM Stock ROM as a base due to vendor stuff that might cause more rejects (and I think if the stock ROM is not deodexed, it's worse).So preferably take aosp kitkat rom as base. Patchrom method won't work for Android 5.0 Lollipop and higher.
If you want to port a MIUI Lollipop/Marshmallow ROM to a Lollipop/Marshmallow based device, you will have to do the "port from other device" technique (post #3), which is to find MIUI ROM for another device with the same Android version, chipset, screen resolution and follow the port method. Use this guide for porting to qualcomm and broadcom devices preferably. For mediatek devices, I suggest following porting guides from MIUI forums. Though this guide might work as well.
Click to expand...
Click to collapse
Question:- Can I port MIUI to XXX device?
Answer:- You'll never know if you don't try!
Question:- Can you please port/help porting MIUI to XXX device?
Answer:- Sorry, I won't port. It's not possible for me to accept port requests, that's why I wrote this guide so that you can port it yourself and test it out on the device you own! About helping, post your issues/logs here in this thread. Me or any other members will help you as they can.
Its awesome bro.
Thanks for sharing with us.....
wolfmannight said:
Its awesome bro.
Thanks for sharing with us.....
Click to expand...
Click to collapse
You're welcome bro!
A perfect guide! Many Thanks!
abhatia1435 said:
A perfect guide! Many Thanks!
Click to expand...
Click to collapse
You're welcome bro! It's the most simplified guide you'll ever find...You can try porting MIUI 7 to your Xperia M!
Heyyy Bro, sorry for the noob questions but will all our Sony stuffs like XReality, DSEE HX HD audio, headphone settings will be lost or not, can we mix MIUI with Sony's stuffs
STRYDER~007 said:
You're welcome bro! It's the most simplified guide you'll ever find...You can try porting MIUI 7 to your Xperia M!
Click to expand...
Click to collapse
Yes bro. Was thinking of that only Can I use the method mentioned in 3rd post? Using XL's ROM for porting to XM? Have you released it for XL?
Black Plague said:
Heyyy Bro, sorry for the noob questions but will all our Sony stuffs like XReality, DSEE HX HD audio, headphone settings will be lost or not, can we mix MIUI with Sony's stuffs
Click to expand...
Click to collapse
Well some features may be lost but i have seen my friend @gamzekal has built MIUI with Sony stuffs HERE..So yeah..Probably we can include those stuffs..I'm not sure though!
abhatia1435 said:
Yes bro. Was thinking of that only Can I use the method mentioned in 3rd post? Using XL's ROM for porting to XM? Have you released it for XL?
Click to expand...
Click to collapse
Yeah you can use any method..I have not yet released MIUI for XL..There are some issues with RIL which I'm fixing now..But you can take any other device and port from it..Visit MIUI site and download latest v7! Try taking the device which has similar specification with your XM.. But not necessarily..I ported the one from HTC One S and it still worked!!
Sad but true, I tried to ask him about how he do that stuff but xda won't allow me to send message zzz coz his inbox if full
Black Plague said:
Sad but true, I tried to ask him about how he do that stuff but xda won't allow me to send message zzz coz his inbox if full
Click to expand...
Click to collapse
Yeah I know! Probably he's too lazy to delete his old msgs!!
@STRYDER~007 You did it again bro!!! Thanks for sharing this with us!
sebastiandg7 said:
@STRYDER~007 You did it again bro!!! Thanks for sharing this with us!
Click to expand...
Click to collapse
Happy to share bro! Enjoy!
This is a nice guide... But only for 4.4.4, correct @STRYDER~007?
repo init -u git://github.com/MiCode/patchrom.git -b miui-7 -m android-4.4.4.xml
Click to expand...
Click to collapse
I wan't to port this for eagle (D2303), but all 4.4.4 AOSP / CM / Omni roms are fuc*** up, none of them works properly to be used as base, and all devs went directly into CM12.1 / Omni 5.1.1, which work fantastic. Any ideas?
linuxct said:
This is a nice guide... But only for 4.4.4, correct @STRYDER~007?
I wan't to port this for eagle (D2303), but all 4.4.4 AOSP / CM / Omni roms are fuc*** up, none of them works properly to be used as base, and all devs went directly into CM12.1 / Omni 5.1.1, which work fantastic. Any ideas?
Click to expand...
Click to collapse
Yep.. Only for 4.4 since MIUI 7 patchrom source is based on 4.4.. Try to find base ROM which will be somewhat stable to be used as base.. There's no alternative to that!
Thanks for giving this guide bro.. I am trying your second method, I am using V7.0.5.0.KXDMICI (MIUI7) (downloaded from official site)(for Mi3) rom as a port rom, but i noticed that there is no init.d folder in the etc folder, Am i selected the wrong rom to port? or there is another problem?
dineshkumareswaran said:
Thanks for giving this guide bro.. I am trying your second method, I am using V7.0.5.0.KXDMICI (MIUI7) (downloaded from official site)(for Mi3) rom as a port rom, but i noticed that there is no init.d folder in the etc folder, Am i selected the wrong rom to port? or there is another problem?
Click to expand...
Click to collapse
For which device are you porting? What is your base rom?(You can find it in build.prop) Explain in detail..Also if there's no init.d, it doesn't matter..Go ahead with further procedure..
STRYDER~007 said:
For which device are you porting? What is your base rom?(You can find it in build.prop) Explain in detail..Also if there's no init.d, it doesn't matter..Go ahead with further procedure..
Click to expand...
Click to collapse
I am trying it for xperia L, I am using nyx rom as my base rom(if you recommend any other i can go with it), I am noob in porting (i can't find init.d in build prop, i try further steps and inform you and thanks
Hi guys, since i got mi max (hydrogen) i noticed that there is few custom ROMs for helium, even the two devices is nearly same. but helium is using different camera firmware and need some edits to enable 2 big cores. so let's go !
You'll need some tools:
- ROM kitchen, i prefer superr's kitchen. :good:
- Boot image Extractor, you can use Android Image Kitchen
- APKTool, get it here
- Any text editor, Notepad++ is good choice for windows users.
Part 0: Preparing:
1- Open superr's kitchen and create new project, then copy hydrogen ROM to project folder and Extract zip using kitchen (option 4). [when it asks for perm type choose sparse_dat]
2- Copy boot.img to Android Image Kitchen folder and run unpackimg.sh / unpackimg.bat (You can also drag and drop boot to unpackimg.bat if you're using windows).
Part 1: System files:
Due to difference in camera firmware and cpu configuration as i explained you'll need to copy these files to "system" folder in kitchen.
Code:
.
├── etc
│** ├── cpu
│** │** └── cpu.conf
│** └── firmware
│** ├── venus.b00
│** ├── venus.b01
│** ├── venus.b02
│** ├── venus.b03
│** ├── venus.b04
│** ├── venus.mbn
│** ├── venus.mdt
│** ├── venus-v1.b00
│** ├── venus-v1.b01
│** ├── venus-v1.b02
│** ├── venus-v1.b03
│** ├── venus-v1.b04
│** ├── venus-v1.mbn
│** └── venus-v1.mdt
├── lib
│** ├── hw
│** │** └── camera.msm8952.so
│** ├── libcamera2ndk.so
│** ├── libcamera_client.so
│** ├── libcameraservice.so
│** ├── libmmcamera_interface.so
│** ├── libmmjpeg_interface.so
│** └── libmm-qcamera.so
├── lib64
** ├── libcamera2ndk.so
** ├── libcamera_client.so
** └── libcameraservice.so
You can get this files from any working helium ROM or from my Github Repo Here
Part 2: Editing Boot.img :
After unpacking hydrogen boot.img using Android Image Kitchen You'll need to copy Helium zImage and edit init.qcom.power.rc
* i prefer editing init.qcom.power.rc even you can just copy it from helium boot.img *
- Copy Helium zImage to "split_img" and make sure it's renamed as "boot.img-zImage"
- Open init.qcom.power.rc and edit the following lines:
Change:
Code:
write /dev/cpuset/foreground/cpus 0-2,4-5
write /dev/cpuset/foreground/boost/cpus 4-5
write /dev/cpuset/background/cpus 0
write /dev/cpuset/system-background/cpus 0-2
write /dev/cpuset/top-app/cpus 0-5
To:
Code:
write /dev/cpuset/foreground/cpus 0-2,4-7
write /dev/cpuset/foreground/boost/cpus 4-7
write /dev/cpuset/background/cpus 0
write /dev/cpuset/system-background/cpus 0-2
write /dev/cpuset/top-app/cpus 0-7
And
Code:
# Bring up all cores online
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu5/online 1
To:
Code:
# Bring up all cores online
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu5/online 1
write /sys/devices/system/cpu/cpu6/online 1
write /sys/devices/system/cpu/cpu7/online 1
And
Code:
# Bring CPUs offline
write /sys/devices/system/cpu/cpu1/online 0
write /sys/devices/system/cpu/cpu2/online 0
write /sys/devices/system/cpu/cpu3/online 0
write /sys/devices/system/cpu/cpu4/online 0
write /sys/devices/system/cpu/cpu5/online 0
To:
Code:
# Bring CPUs offline
write /sys/devices/system/cpu/cpu1/online 0
write /sys/devices/system/cpu/cpu2/online 0
write /sys/devices/system/cpu/cpu3/online 0
write /sys/devices/system/cpu/cpu4/online 0
write /sys/devices/system/cpu/cpu5/online 0
write /sys/devices/system/cpu/cpu6/online 0
write /sys/devices/system/cpu/cpu7/online 0
- then Repack boot and copy image-new.img to superr's kitchen project folder then rename it to boot.img
You can get these files from any helium boot.img or from my Github Repo Here
Zimage - init.qcom.power.rc
Part 3: Editing Framework-res.apk :
Make sure you've installed apktool then copy system/framework/framework-res.apk to new folder (apktool folder for windows users) and:
- install framework-res.apk using command:
Code:
apktool if framework-res.apk
- decompile framework-res.apk using command:
Code:
apktool d framework-res.apk
- Copy this power_profile.xml to framework-res/res/xml folder in apktool.
- Now recompile framework-res apk using command:
Code:
apktool b -f framework-res
- You'll find the edited apk in framework-res/build/apk folder, copy it to "system/framework/" in superr's kitchen project folder.
Part 4: Finalizing :
Now you've finished porting hydrogen ROM to helium, but you need to repack ROM into zip to be able to use it.
- Open superr's kitchen, choose 8) ROM Tools Menu then 7) Build Menu and finally 1) Build full ROM Zip
- Wait till it finishes (when it asks for sign zip press "y") then you'll have to edit META-INF/com/google/android/updater-script inside ROM Zip, so open ROM zip and head to META-INF/com/google/android/ to open updater-script file using text editor then change script to:
Code:
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
show_progress(0.200000, 10);
set_progress(1.000000);
And Congratulations You've finished porting hydrogen ROM to your helium
Special Thanks:
SuperR. for his great kitchen
osm0sis for amazing image tools script
iBotPeaches for apktool
@nijel8 for helium device tree
@Davehimself for helium vendor
@Ahmed Hady & @androidlover5842 my great friends & helpers
And me for typing this guide :good:
Reversed 1
Reversed 2
Thanks
Sent from my Mi Max using XDA-Developers Legacy app
ardas said:
Thanks
Click to expand...
Click to collapse
Welcome, hope we'll see more helium roms soon
Brother im trying to port miui to mi a1.
Mi 5x and mi a1 both device is same only diffrence is mi a1 running on asop by android one project with a/b partition layout and mi5x with miui.
In mi5x xda forum developers are able to port the mia1 pure android rom to their mi5x.
They use exact same system.img file without any changes i compared they are able to boot exact same system.img file for mia1 to mi5x.
I tried same but im not able to port it
Dont know system partition table are not able to boot the system or im missing some thing on boot.img.
Every time i tried to port miui from mi5x failed can u please help me port.
Eargely waiting for ur reply..