Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] Modify libril.so Android (4.4.2)

OP brok85

6th May 2014, 05:14 PM   |  #1  
OP Junior Member
Flag COLUMBUS
Thanks Meter: 2
 
22 posts
Join Date:Joined: Apr 2014
More
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
6th May 2014, 05:18 PM   |  #2  
LS.xD's Avatar
Senior Member
Lübeck
Thanks Meter: 591
 
1,855 posts
Join Date:Joined: Nov 2013
Donate to Me
More
Question
Quote:
Originally Posted by brok85

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?
The Following User Says Thank You to LS.xD For This Useful Post: [ View ]
6th May 2014, 05:21 PM   |  #3  
OP Junior Member
Flag COLUMBUS
Thanks Meter: 2
 
22 posts
Join Date:Joined: Apr 2014
More
Modify libril.so
Quote:
Originally Posted by LS.xD

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...
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes