Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,785,614 Members 44,155 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Modify libril.so Android (4.4.2)

Tip us?
 
brok85
Old
#1  
Junior Member - OP
Thanks Meter 2
Posts: 22
Join Date: Apr 2014
Location: COLUMBUS
Phone [Q] Modify libril.so Android (4.4.2)

Dear everyone,
here is my problem. I am trying to modify the libril.so library of Android for my project. To do so, I have downloaded, built, and flashed on my Samsung Galaxy S3 the last version of cyogenmod (CM11).

To start with some modifications and check if everything works, I tried to create a file and write something. The code lines that I have inserted are something like:

File *f=fopen("/storage/emulated/0/file.txt","a+");
if (f!=NULL)
{
fputs("mod working\n",f);
fflush(f);
fclose(f);
}

I have inserted these lines in the "eventloop()" function of "/hardware/ril/libril/ril.cpp" and built again the system. Once flashed however, the file is never created. This is strange since that eventloop() function should be called very frequently by Android. I tried also to comment everything in the eventloop() but everything still works perfectly. Therefore, I have three questions:

1) What am I doing wrong?

2) Why I cannot see any of the changes I made on the phone?

3) How may I insert logs or printouts to such library files?

Thanks for any suggestion
 
LS.xD
Old
#2  
LS.xD's Avatar
Senior Member
Thanks Meter 585
Posts: 1,854
Join Date: Nov 2013
Location: Lübeck

 
DONATE TO ME
Quote:
Originally Posted by brok85 View Post
Dear everyone,
here is my problem. I am trying to modify the libril.so library of Android for my project. To do so, I have downloaded, built, and flashed on my Samsung Galaxy S3 the last version of cyogenmod (CM11).

To start with some modifications and check if everything works, I tried to create a file and write something. The code lines that I have inserted are something like:

File *f=fopen("/storage/emulated/0/file.txt","a+");
if (f!=NULL)
{
fputs("mod working\n",f);
fflush(f);
fclose(f);
}

I have inserted these lines in the "eventloop()" function of "/hardware/ril/libril/ril.cpp" and built again the system. Once flashed however, the file is never created. This is strange since that eventloop() function should be called very frequently by Android. I tried also to comment everything in the eventloop() but everything still works perfectly. Therefore, I have three questions:

1) What am I doing wrong?

2) Why I cannot see any of the changes I made on the phone?

3) How may I insert logs or printouts to such library files?

Thanks for any suggestion

Whats the point of your modification?
HTC One S @ PAC-man 4.4.2 [ALPHA1] [12/5/2014] + IceCode Kernel v4.0 // HBoot 2.15 - unlocked BL - S-OFF - NO "tampered & warning text" // TWRP mod 2.7.0.8

Samsung Galaxy W @ ParanoidAndroid 4.3 [BETA3] [6/5/2014] + KhaN Kernel v2.0 // Base: I8150XXLMI // PhilZ CWM 6.01.4

"REVIVED" HTC Wildfire S @ CyanogenMod 11(AWESOME!!!) [6/5/2014] //HBoot 1.09 - unlocked BL // TWRP 2.7.0.0


It won't hurt you to press "thanks" if me or someone other helped you...
The Following User Says Thank You to LS.xD For This Useful Post: [ Click to Expand ]
 
brok85
Old
#3  
Junior Member - OP
Thanks Meter 2
Posts: 22
Join Date: Apr 2014
Location: COLUMBUS
Default Modify libril.so

Quote:
Originally Posted by LS.xD View Post
Whats the point of your modification?
Well, before doing something more advanced, I wanna check if my modifications are actually built correctly. I mean, I just want to do something to check if that modification is considered when I flash the whole system on the phone. That is why I simply create a file...
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes