Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,814,166 Members 46,069 Now Online
XDA Developers Android and Mobile Development Forum

[TUT] Implementing EPRJ RIL in Custom Roms by Yourself

Tip us?
 
Flying_Bear
Old
(Last edited by Flying_Bear; 11th June 2014 at 02:23 PM.)
#1  
Flying_Bear's Avatar
Senior Member - OP
Thanks Meter 766
Posts: 1,797
Join Date: Jan 2011
Default [TUT] Implementing EPRJ RIL in Custom Roms by Yourself

A. Why change RIL?

Hey, everyone.

As a user that's been using custom roms since our bootloader was unlocked, I'm aware that some of us have some issue with telephony & mobile data (in short, RIL) - occasionally IMEI wouldn't be read on boot, which would lead to device not being registred on network. Sometimes, the network would "die" in a way - you'd get an error when trying to dial a number, and when someone would call you, they'll hear the ringing tone while your cell phone would not ring at all.

The cause of the problem seems to be some lazy coding by official CM developers/maintainers for our device. This was picked up by a developer named kholk, so he did his best to recode it properly, however it was never included into official CM device tree for reasons unknown to me (more info about the issue can be found here: http://review.cyanogenmod.org/#/c/47980/).

Kholk did include his own custom RIL into his EPRJ roms, but the roms are kinda old and have iffy baseband (which seems to be kernel issue, as he's using his own, 3.4 kernel instead of CM's 3.1 kernel in other custom roms).

So, with the help of Adam77Root, I've learned a way on how to implement EPRJ RIL into other custom roms (since I still had RIL issue with default CM RIL in 4.3 roms even) - so far I've tested it with Vanir 4.3, Carbon 4.3, Carbon 4.3.1, and few 4.2.2 roms, and I havent had ANY issues I had in CM RIL.

So, this is a tutorial to show you how you can import EPRJ RIL to any custom rom you'd like, in case you have issues with cell connection.


-this should work on any kernel and any custom rom (4.2.2+)! Tested so far, as far as kernel goes, are iodak 8/8.5, WWJB8/8b, Optimus Prime several versions, Optimus Play! 2.53.
-KK roms tested are P.A. by @dcos which has eprj ril by default, official CM nightlies and several others

-some KK roms, for some reason, don't have x3ril.smali file in their telephony-common.jar. To implement EPRJ RIL in these roms, follow the tutorial up to point 5, and skip that one, since you don't have anything to delete. After point 13, you need to do one additional thing - you need to edit ROM's build.prop settings, look for this line: "#ro.telephony.ril_class=X3RIL", and delete "#" so this line would be included in build.prop. After that, you're ready to flash. Thanks goes to @gerciolisz for the tip on the build.prop settings.
-/As of 24.01.2014. i've added another zip file which contains x3ril.smali taken from P.A. port by dcos - i'd recommend using this one for 4.4.2 roms/
-as of 11.06.2014., I've added x3ril.smali (it's in omni-v1.rar) made by adam, which is based on omni's RIL but has eprj RIL recovery. if you're on 4.4.3 kitkat rom and have issues, i suggest you give this file a try first before others


B. What's needed?


First off, you'll need a few things:

- Android Multitool from http://forum.xda-developers.com/show....php?t=2326604, many thanks to @Flextrick
- Read the linked topic - it's the instruction on how to use it, and in case you encounter any errors, that's the place to search for solutions
- Attached is a RAR with two files in it, X3RIL_old.smali and X3RIL_new.smali. You need only one of those - but more info about them will be in the other steps.
- Custom ROM you want to edit
- Common sense
- WinRAR & JAVA



C. How to change RIL?

Steps:



1. First step is to open the .zip of your custom ROM you want to edit, and search for system/framework/telephony-common.jar

2. Extract it to AndroidMultitool/Files, and after extract is done, delete it from .zip

3. Open Android Multitool, under Decompiling select .jar, then select telephony-common.jar in AndroidMultitool/Files, click "decompile"

4. After you're done, check if there were any errors in the Log, in AndroidMultitool main window



5. Head over to AndroidMultitool/Decompiled_jar/telephony-common/com/android/internal/telephony and look for X3RIL.smali. This is CM's RIL implemented in custom roms, which we dont need anymore, so delete it

6. Now, you need to decide wether to use X3RIL_old.smali, which is RIL from EPRJ CM10.2 built on 20130813, or X3RIL_new.smali which is RIL from EPRJ CM10.2 built on 20131007. I'm using 20131007 atm, and it's working without issues

7. When you've decided, move it back into AndroidMultitool/Decompiled_jar/telephony-common/com/android/internal/telephony and rename it to X3RIL.smali

8. Back in AndroidMultitool, under Compilin, select jar, and for folder select AndroidMultitool/Decompiled_jar/telephony-common, press "compile", and check for errors in Log

9. Output should be classes.dex file under AndroidMultitool/Compiled_jar



10. Open telephony-common.jar in AndroidMultitool/Files with WinRar - you should see META-INF folder, with classes.dex file

11. Delete classes.dex file in WinRAR

12. Move classes.dex file from AndroidMultitool/Compiled_jar to telephony-common.jar opened in WinRAR

13. Paste telephony-common.jar into system/framework inside the custom rom .zip file

14. You now have modified ROM ready to flash on our device!




D. Thank You's

Thank you's go out to @kholk for his RIL programming, @dcos for first implementing EPRJ RIL into a rom (his P.A. unofficial port for our device) different than EPRJCM10.2, @Adam77Root for his tutorial that I basically beutified and made sure is easier to understand & his modification of x3ril.smali from omni, @gerciolisz for the tip about build.prop settings, @Flextrick for his Multitool with neat GUI to extract .jar files, and all the other devs of p880 making our device worth every dime I've spent on it.
Attached Files
File Type: rar EPRJ RIL.rar - [Click for QR Code] (8.4 KB, 405 views)
File Type: zip x3ril p.a. 4.4.2.zip - [Click for QR Code] (4.3 KB, 357 views)
File Type: rar omni-v1.rar - [Click for QR Code] (4.3 KB, 103 views)
To install custom roms on O4x:

1. upgrade to jb
2. root
3. unlock bootloader
4. flash custom recovery (cwm)
5. flash roms
6. if you encounter any issues, search, they've been answered already.

Got issues with RIL/IMEI/BASEBAND on custom 4.2, 4.3 or 4.4 ROMs on p880? Click me for possible solution!
The Following 27 Users Say Thank You to Flying_Bear For This Useful Post: [ Click to Expand ]
 
penguin449
Old
(Last edited by Toledo_JAB; 24th October 2013 at 10:39 PM.)
#2  
Account currently disabled
Thanks Meter 1,430
Posts: 655
Join Date: Feb 2013
Location: Littlepport ~ Cambridge
Quote:
Originally Posted by Flying_Bear View Post
Kholk did include his own custom RIL into his EPRJ roms, but the roms are kinda old and have iffy baseband (which seems to be kernel issue, as he's using his own, 3.4 kernel instead of CM's 3.1 kernel in other custom roms).
Dude, i think you missed out the clarification for the users on whether or not they need to use the EPRJ Kernel and if anykernel will still work or normal kernels will work etc. Because your bound to have the first person to ask a question will either be, "How do i declare java paths" and "Will 'kernel name here' work with it", this isnt me asking, more of an fyi post (Y)

I do apologize about it, but saves you the time and effort of answering the question every day

MOD EDIT: watch your language please.
The Following User Says Thank You to penguin449 For This Useful Post: [ Click to Expand ]
 
Flying_Bear
Old
(Last edited by Toledo_JAB; 24th October 2013 at 10:41 PM.)
#3  
Flying_Bear's Avatar
Senior Member - OP
Thanks Meter 766
Posts: 1,797
Join Date: Jan 2011
Quote:
Originally Posted by penguin449 View Post
Dude, i think you missed out the clarification for the users on whether or not they need to use the EPRJ Kernel and if anykernel will still work or normal kernels will work etc. Because your bound to have the first person to ask a question will either be, "How do i declare java paths" and "Will 'kernel name here' work with it", this isnt me asking, more of an fyi post (Y)

I do apologise about it, but saves you the time and effort of answering the question every day
np, thanks for the tip. i'll add in OP that it works with any kernel

MODERATOR EDIT: @penguin449 watch your language
To install custom roms on O4x:

1. upgrade to jb
2. root
3. unlock bootloader
4. flash custom recovery (cwm)
5. flash roms
6. if you encounter any issues, search, they've been answered already.

Got issues with RIL/IMEI/BASEBAND on custom 4.2, 4.3 or 4.4 ROMs on p880? Click me for possible solution!
The Following 2 Users Say Thank You to Flying_Bear For This Useful Post: [ Click to Expand ]
 
sir_fz
Old
#4  
Senior Member
Thanks Meter 10
Posts: 103
Join Date: Aug 2009
I flashed Vanir nightly 171013 with Optimus Prime 2.70 kernel and telephony was completely disabled. I was not able to find or register to the mobile network. I tried modifying the RIL file as explained in this post; initially with the "new" file which didn't seem to solve the problem (still didn't get signal) but I didn't wait I immediately tried flashing the ROM with the "old" RIL instead. Initially there was no signal although I was able to find networks, but after a reboot the phone finally managed to connect to the mobile network.

I'm not sure whether it would've worked after a reboot with the "new" but I'm guessing if it's working with the "old" RIL I got nothing to worry about right?
 
Flying_Bear
Old
#5  
Flying_Bear's Avatar
Senior Member - OP
Thanks Meter 766
Posts: 1,797
Join Date: Jan 2011
Vanir is 4.3.1 while OP is for 4.3, i think thats your problem. Different RIL would not help in that case. Flash Anykernel version of OP, or find a version repacked with 4.3.1 ramdisk. Good luck!
To install custom roms on O4x:

1. upgrade to jb
2. root
3. unlock bootloader
4. flash custom recovery (cwm)
5. flash roms
6. if you encounter any issues, search, they've been answered already.

Got issues with RIL/IMEI/BASEBAND on custom 4.2, 4.3 or 4.4 ROMs on p880? Click me for possible solution!
 
sir_fz
Old
#6  
Senior Member
Thanks Meter 10
Posts: 103
Join Date: Aug 2009
Quote:
Originally Posted by Flying_Bear View Post
Vanir is 4.3.1 while OP is for 4.3, i think thats your problem. Different RIL would not help in that case. Flash Anykernel version of OP, or find a version repacked with 4.3.1 ramdisk. Good luck!
As far as I understood, the 171013 version did not have the RamDisk issue so I figured the CM10.2 version of Optimus Prime kernel should've worked correctly?

So I get it from you that if I flash the original rom with the AnyKernel version of OP it should work fine? (no need for any RIL modifications?)
 
Flying_Bear
Old
#7  
Flying_Bear's Avatar
Senior Member - OP
Thanks Meter 766
Posts: 1,797
Join Date: Jan 2011
Yep, anykernel versions of all our kernels xcept iodaks should work on any android version without any modifications.
To install custom roms on O4x:

1. upgrade to jb
2. root
3. unlock bootloader
4. flash custom recovery (cwm)
5. flash roms
6. if you encounter any issues, search, they've been answered already.

Got issues with RIL/IMEI/BASEBAND on custom 4.2, 4.3 or 4.4 ROMs on p880? Click me for possible solution!
The Following 2 Users Say Thank You to Flying_Bear For This Useful Post: [ Click to Expand ]
 
MilkyJoePD
Old
#8  
MilkyJoePD's Avatar
Senior Member
Thanks Meter 168
Posts: 911
Join Date: Oct 2011
Is there a way to do this with Linux?
If not, how about uploading modified telephony-common.jar for CM ROMs?
I tried just replacing the whole telephony-common.jar file but I couldn't send or receive any messages. Everything else seemed to work though.

Sent from my LG-P880 using Tapatalk
 
{fd}ware
Old
#9  
{fd}ware's Avatar
Senior Member
Thanks Meter 774
Posts: 954
Join Date: Dec 2012
Location: Gelsenkirchen

 
DONATE TO ME
Quote:
Originally Posted by MilkyJoePD View Post
Is there a way to do this with Linux?
If not, how about uploading modified telephony-common.jar for CM ROMs?
I tried just replacing the whole telephony-common.jar file but I couldn't send or receive any messages. Everything else seemed to work though.

Sent from my LG-P880 using Tapatalk
Maybe try it in Wine (or Vine, I don't know xD). It's like a Windows application emulator, so you can run .exe files etc.
I've used it only on Ubuntu BTW
Regards,
{fd}ware

Current work in progress:
Protos 3:
The app, scripts, UI, UX, whatever.

Maybe a random app?

 
Flying_Bear
Old
#10  
Flying_Bear's Avatar
Senior Member - OP
Thanks Meter 766
Posts: 1,797
Join Date: Jan 2011
Quote:
Originally Posted by MilkyJoePD View Post
Is there a way to do this with Linux?
If not, how about uploading modified telephony-common.jar for CM ROMs?
I tried just replacing the whole telephony-common.jar file but I couldn't send or receive any messages. Everything else seemed to work though.

Sent from my LG-P880 using Tapatalk
not sure really, since i havent worked on linux systems.

and i dont think telephony-common.jar is universal for all roms (i might be mistaken though), so there's no use to upload it. however, if you want, upload your original telephony-common.jar file here and i'll do my best to mod it for you!
To install custom roms on O4x:

1. upgrade to jb
2. root
3. unlock bootloader
4. flash custom recovery (cwm)
5. flash roms
6. if you encounter any issues, search, they've been answered already.

Got issues with RIL/IMEI/BASEBAND on custom 4.2, 4.3 or 4.4 ROMs on p880? Click me for possible solution!

The Following User Says Thank You to Flying_Bear For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes