how can i rebuild 'libhtcgeneric-ril.so'? - XPERIA X1 Android Development

previous i posted about korean sms.. but no response.
So i can find a way rebuild '.so' file. but i couldnt..
i must add this code in libhtcgeneric-ril.so
msg = new String( inData, "KSC5601" );
'----------------------------------------------------------
void decode_cdma_sms(char *pdu, char *from, char *message, int *is_vm,int *msg_len) {
unsigned int i=1;
int code,length;
strcpy(from,"000000"); // in case something fails
strcpy(message,"UNKNOWN");
if (is_vm)
*is_vm = 0;
while(i*2<strlen(pdu)) {
get_code_and_length(pdu+i*2,&code,&length);
if(code==2) // from
decode_number(pdu+i*2+4,length,from);
if(code==8) // bearer_data
// probably code add. msg = new String( inData, "KSC5601" );
decode_bearer_data(pdu+i*2+4,length,message,is_vm,msg_len); i+=length+2;
}
}
please.. help me.

You need to have an Android source tree to rebuild any components. The xdandroid guide would be the quickest:
http://xdandroid.com/wiki/Getting_the_Source
Any rebuilds of the RIL need to be placed in /lib/froyo/ of the rootfs rather than /system/lib where Android puts it.
BTW htcgeneric-ril.so is C, while the line you want to add is Java. Are you sure thats the right place to patch it?

Thanks Tremere.
Tremere said:
You need to have an Android source tree to rebuild any components. The xdandroid guide would be the quickest:
http://xdandroid.com/wiki/Getting_the_Source
Any rebuilds of the RIL need to be placed in /lib/froyo/ of the rootfs rather than /system/lib where Android puts it.
BTW htcgeneric-ril.so is C, while the line you want to add is Java. Are you sure thats the right place to patch it?
Click to expand...
Click to collapse
i am newbie in C and java.
So i can not figure out this code is wrong.
i am sure that postion of code is right.
but just android source is download and make then compile is complete ?
must compile whole android source but only 'libhtcgeneric-ril.so' ?
that's too difficult to me. i am newbie at linux, C .

Sorry i am totally wrong.
thas is too difficult.
mmmmm......
I am give up..

Related

Development team V2

Hello everyone,
I want to start again with a development team. After miroslav decided to finish the project on his own, I want to try it again. But this time with a real team Only with people who want to participate, and not just type make. Who wants to join?
miroslav_mm said:
So, I opened your eyes and showed real face our "superstar"!?
Ok! Let's stop this stupid discussion and continuous develop ROM.
At this moment I have main part:
Torchscreen +
BT (BT-calling) +
WiFi (need to test) +
Sensor +
GSM (Waiting call) +
Mobile Data +
Audio +
Vibrate +
HW + 3D ??? (need new kernel or port new 3D kernel driver (kgsl) (in progress))
usb storage ??? (only with special app (native in progress))
Camera ??? (in progress)
Video codec ??? (in progress)
Anyone doing something? Maybe fix some stuff?
Click to expand...
Click to collapse
He just want to clean his topic. Send him a PM.
I understand that but there is still no team. He just made his project open for patches. And I think, personally, a team could help the speed on development of a ROM So please join
Sent from my GT540 using Tapatalk
So join his team , and start patching?
wwenigma said:
So join his team , and start patching?
Click to expand...
Click to collapse
Since when does he have a team? What I know about it, is that he just made some kind of open-source project where you can add your own updates and where he gets no credit.
Sent from my GT540 using Tapatalk
I can help you with Java stuff!
I think miroslav_mm wants to release ICS under name of SWIFT-TEAM, with developer names in credits.... may you ask him about it?
Do not split guys...
Miroslav said that it's only him on the team...so i don't see any team there..if we are more than 1 guy in a team we can get faster a daily ROM for our Phones
rexes13 said:
Miroslav said that it's only him on the team
Click to expand...
Click to collapse
Jep, because PCF+MGP join then leave and jasper580 cant make neccessary steps... ask him. All two, ask him about it.
wwenigma said:
Jep, because PCF+MGP join then leave and jasper580 cant make neccessary steps... ask him. All two, ask him about it.
Click to expand...
Click to collapse
I can make nesseccary steps if I want, but I don't want to. I want to start cleaned up. That's why I created this topic. So:
If you want to join: welcome.
If you don't want to: stop spamming
@rexes13 Welcome to the team!
Sent from my GT540 using Tapatalk
Good news.
Yesterday I successfully ported 3d kernel driver (kgsl) from 35, so now we have full functionality kernel with OpenGL ES-CM 1.1.
So HW, 3D and other stuff with support OpenGL working, not excellent but working, need improve source code Surfaceflinger and HardwareDisplay.
Maybe next weak I will make new thread and publish first public test version, but all development moments we can discus here.
Before I need redownload all sources CM9 again. Yesterday I had the same error like in wwenigma and aaa801
Code:
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/power/power.c
arm-linux-androideabi-gcc: ": No such file or directory
<command-line>: warning: missing terminating " character
and I dont know WTF, so delete all source tree. Maybe today will try download again and build again.
hell yeah! im just another non-dev member LOL sry
Need help!
Look on code:
Code:
//static int32_t msm_tscal_scaler = 65536;
static int32_t msm_tscal_xscale = 70046;
static int32_t msm_tscal_xoffset = -4191987;
static int32_t msm_tscal_yscale = 71735;
static int32_t msm_tscal_yoffset = -3004437;
this pointers for torch 320*240. So when I using that I need tap on 2mm high on icon for open something. This pointer need for screen calibration. Need find right pointer.
I can't find a logic in this numbers.
miroslav_mm said:
Need help!
Look on code:
Code:
//static int32_t msm_tscal_scaler = 65536;
static int32_t msm_tscal_xscale = 70046;
static int32_t msm_tscal_xoffset = -4191987;
static int32_t msm_tscal_yscale = 71735;
static int32_t msm_tscal_yoffset = -3004437;
this pointers for torch 320*240. So when I using that I need tap on 2mm high on icon for open something. This pointer need for screen calibration. Need find right pointer.
I can't find a logic in this numbers.
Click to expand...
Click to collapse
The offsets appear to have a ~4:3 ratio. It doesn't make sense though why it's x:y=4:3, and not the other way around, since the screen is usually 3:4(e.g. 320x480 or 240x320). Also, considering our screen is 320x480, which is a ratio of 1,5 and not 1,(3), I think those would be totally wrong for our phone. Maybe try to modify one of the two to match 1,5 ratio. E.g. make xoffset=-4506655. I don't know. :/
Please discuss development on your page. I want to make a dev team here
Sent from my GT540 using Tapatalk
deleted
10 character
This numbers working with this java code together:
]
Code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Read current values
final int xoffset = (readValue("xoffset")*240+480)/960;
final int yoffset = (readValue("yoffset")*320+460)/920;
final int xscale = readValue("xscale");
final int yscale = readValue("yscale");
view = new View(this) {
private int step = 1;
private int rawx1;
private int rawy1;
private int rawx2;
private int rawy2;
private void writeValue(String parameter, int value) {
try {
FileOutputStream fos = new FileOutputStream(new File("/sys/module/msm_touch/parameters/tscal_" + parameter));
fos.write(String.valueOf(value).getBytes());
fos.flush();
fos.getFD().sync();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (ev.getAction() != MotionEvent.ACTION_UP)
return true;
if(step==1) {
rawx1 = ((int)ev.getRawX()*65536-xoffset+32768)/xscale;
rawy1 = ((int)ev.getRawY()*65536-yoffset+32768)/yscale;
if(rawx1<100 && rawy1<100)
step = 2;
} else if(step==2) {
rawx2 = ((int)ev.getRawX()*65536-xoffset+32768)/xscale;
rawy2 = ((int)ev.getRawY()*65536-yoffset+32768)/yscale;
if(rawx2>140 && rawy2>220)
step = 3;
} else {
int distx = rawx2 - rawx1;
int new_xscale = (140*65536 + distx/2)/distx;
int disty = rawy2 - rawy1;
int new_yscale = (220*65536 + disty/2)/disty;
int new_xoffset = 1;
new_xoffset += 50*65536-rawx1*new_xscale;
new_xoffset += 190*65536-rawx2*new_xscale;
new_xoffset /= 2;
new_xoffset = (new_xoffset*960+120)/240;
int new_yoffset = 1;
new_yoffset += 50*65536-rawy1*new_yscale;
new_yoffset += 270*65536-rawy2*new_yscale;
new_yoffset /= 2;
new_yoffset = (new_yoffset*920+160)/320;
// Pass new calibration to kernel
writeValue("xoffset", new_xoffset);
writeValue("yoffset", new_yoffset);
writeValue("xscale", new_xscale);
writeValue("yscale", new_yscale);
// Save calibraiton data to /data/system/pointercal
StringBuilder sb = new StringBuilder();
sb.append(new_xscale);
sb.append(" ");
sb.append(0);
sb.append(" ");
sb.append(new_xoffset);
sb.append(" ");
sb.append(0);
sb.append(" ");
sb.append(new_yscale);
sb.append(" ");
sb.append(new_yoffset);
sb.append(" ");
sb.append(65536);
App + ui input framework + kernel working together.
App - creation poinercal
ui input framework - reading pointercal send correct info to kernel
kernel touch driver - doing move.
Öhm, the touchscreen driver use a virtual square (320*320) to detect touch, stretched to a rectangle(320*480)?
mod: about calibration, http://code.google.com/p/openeve/issues/detail?id=91
jasper580 said:
Please discuss development on your page. I want to make a dev team here
Click to expand...
Click to collapse
I cant understand you! What do you mean? Do you wanna make new dev team? Working on my sources but without me?
I exactly want to ask that. Maybe he start from scratch, his github is near empty.

Theme Chooser themes, Windows, aapt, and uppercase letters in XML filenames

EDIT: A solution has been found, courtesy of XDA member titanic_fanatic, who compiled a Windows version of aapt that accepts uppercase letters in XML filenames! (Read his original message here.) I've attached it to this post. One of the biggest hurdles to effective theme creation in Windows is finally solved!
----------------------------------------------------------------------------------------​
Forgive me if this has already been asked, but I know that it's something that's annoyed theme developers under Windows for a while now. I seem to recall seeing hints about fixing this, but I've done search after search, and can't find it to save my life.
Theme Chooser theme developers under Windows are hobbled by the fact that XML filenames can't contain uppercase letters, which prevents us from theming certain applications (example: com_keramidas_TitaniumBackup.xml would be needed for Titanium Backup). I know that this is a problem related to aapt.exe. Has anyone come up with a workable solution for this issue? If not, I'd like to take a crack at it. I might not get anywhere, but I have nothing to lose.
Obviously, in order to do this, I'll need the source for it. I can do the heavy lifting regarding getting the source and working out how to compile it for Windows, but I need to know where the source is, what to get, and other requirements. If anyone can help and point me in the right direction(s), I'd really appreciate it!
MJPollard said:
Forgive me if this has already been asked, but I know that it's something that's annoyed theme developers under Windows for a while now. I seem to recall seeing hints about fixing this, but I've done search after search, and can't find it to save my life.
T-Mobile/CM7 theme developers under Windows are hobbled by the fact that XML filenames can't contain uppercase letters, which prevents us from theming certain applications (example: com_keramidas_TitaniumBackup.xml would be needed for Titanium Backup). I know that this is a problem related to aapt.exe. Has anyone come up with a workable solution for this issue? If not, I'd like to take a crack at it. I might not get anywhere, but I have nothing to lose.
Obviously, in order to do this, I'll need the source for it. I can do the heavy lifting regarding getting the source and working out how to compile it for Windows, but I need to know where the source is, what to get, and other requirements. If anyone can help and point me in the right direction(s), I'd really appreciate it!
Click to expand...
Click to collapse
Hmm .. + 1 with you .. but the only way is ... ask brut.all ....
Sent from my Galaxy Nexus using XDA App
qazsxdcfv said:
Hmm .. + 1 with you .. but the only way is ... ask brut.all ....
Click to expand...
Click to collapse
Thanks, I guess I'll have to after all (not that I mind doing it). Over 250 views and only one person to respond isn't giving me much hope that someone has an answer.
Have you found a solution for windows ?
Any solution?
Randomly came across this thread looking for info on compiling the aapt binary for Windows. I'm still looking for the answer for that but I do know the change that needs to be made and how to do that part, as I have already done this mod for aapt on Linux. You have to have a full build environment set up, and by that I mean set up to build a full ROM, like CM10 for example. The change to make is in the frameworks source code at frameworks/base/tools/aapt/Resource.cpp.
See this commit for the details:
http://review.cyanogenmod.org/#/c/24204/
Add the parts I highlighted in blue to the two lines below:
Code:
String16 baseName(it.getBaseName());
const char16_t* str = baseName.string();
const char16_t* const end = str + baseName.size();
while (str < end) {
if (!((*str >= 'a' && *str <= 'z')
[COLOR="RoyalBlue"][B]|| (*str >= 'A' && *str <= 'Z')[/B][/COLOR]
|| (*str >= '0' && *str <= '9')
|| *str == '_' || *str == '.')) {
fprintf(stderr, "%s: Invalid file name: must contain only [a-z[COLOR="RoyalBlue"][B]A-Z[/B][/COLOR]0-9_.]\n",
it.getPath().string());
hasErrors = true;
}
str++;
}
m4570d0n said:
Randomly came across this thread looking for info on compiling the aapt binary for Windows. I'm still looking for the answer for that but I do know the change that needs to be made and how to do that part, as I have already done this mod for aapt on Linux. You have to have a full build environment set up, and by that I mean set up to build a full ROM, like CM10 for example. The change to make is in the frameworks source code at frameworks/base/tools/aapt/Resource.cpp.
See this commit for the details:
http://review.cyanogenmod.org/#/c/24204/
Add the parts I highlighted in blue to the two lines below:
Code:
String16 baseName(it.getBaseName());
const char16_t* str = baseName.string();
const char16_t* const end = str + baseName.size();
while (str < end) {
if (!((*str >= 'a' && *str <= 'z')
[COLOR="RoyalBlue"][B]|| (*str >= 'A' && *str <= 'Z')[/B][/COLOR]
|| (*str >= '0' && *str <= '9')
|| *str == '_' || *str == '.')) {
fprintf(stderr, "%s: Invalid file name: must contain only [a-z[COLOR="RoyalBlue"][B]A-Z[/B][/COLOR]0-9_.]\n",
it.getPath().string());
hasErrors = true;
}
str++;
}
Click to expand...
Click to collapse
Thank you for your help but could you tell me where can I find frameworks/base/tools/aapt/Resource.cpp?
I don't understand where to find it?
Sorry to resurrect an old thread, but I've finally come across a Windows version of aapt.exe that accepts uppercase letters in XML filenames, courtesy of XDA user titanic_fanatic. I've modified the first post in the thread with the details. Happy theming!
MJPollard said:
Sorry to resurrect an old thread, but I've finally come across a Windows version of aapt.exe that accepts uppercase letters in XML filenames, courtesy of XDA user titanic_fanatic. I've modified the first post in the thread with the details. Happy theming!
Click to expand...
Click to collapse
That link does seem to work anymore (and the webpage gives malware warning in Norton).
Does anyone else have this file?

XML parsing-best method, general discussion

I am relatively new to programing and have been teaching myself as I go. I am trying to now integrate ESPN's API into my app which outputs XML data. I have done enough research to understand that I need to use an XML parser and that the XML can be displayed as a list view or web view by adding HTML markup.
I would like this thread to become a general discussion for all new developers on what XML parsing is and what it does. How it works, the code behind it etc.
I am currently trying to modify a code snippet from the developer.google.com website.
Android includes built in libraries for XML Parsing.
You can see a minimal use of the library here:
Code:
import java.io.IOException;
import java.io.StringReader;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
public class SimpleXmlPullApp
{
public static void main (String args[])
throws XmlPullParserException, IOException
{
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xpp = factory.newPullParser();
xpp.setInput( new StringReader ( "<foo>Hello World!</foo>" ) );
int eventType = xpp.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if(eventType == XmlPullParser.START_DOCUMENT) {
System.out.println("Start document");
} else if(eventType == XmlPullParser.START_TAG) {
System.out.println("Start tag "+xpp.getName());
} else if(eventType == XmlPullParser.END_TAG) {
System.out.println("End tag "+xpp.getName());
} else if(eventType == XmlPullParser.TEXT) {
System.out.println("Text "+xpp.getText());
}
eventType = xpp.next();
}
System.out.println("End document");
}
}
So essentially, you can grab the xml from ESPN, save it to a file, parse it with that library, and output as desired.
Full details here: http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html
the fastest way I know is the parser written in c/c++ and compiled with ndk.
bitpushr said:
Android includes built in libraries for XML Parsing.
So essentially, you can grab the xml from ESPN, save it to a file, parse it with that library, and output as desired.
Full details here: http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html
Click to expand...
Click to collapse
I will have to try out this code. Because I am learning as I go there are many things in java I don't yet understand which ultimately make it a lot harder to accomplish tasks but I am slowly catching on
If you want to do this in a .NET (Windows x86/64, Windows Mobile, Windows Phone) environment, or a Linux MONO environment then the following will carry out the bare minimum of parsing.
Assuming you have the data in an XML file :- PARAMS.XML in the same folder as the program, created similar to this:
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<PARAMS>
<Library>TESTLIB</Library>
<Source>C:\RetData\</Source>
</PARAMS>
Then the following C# code will read and extract the parameters:
Code:
using System.Xml;
string LibName,RetDir;
XmlReader xrdr = XmlReader.Create(Application.StartupPath+"\\PARAMS.xml");
xrdr.ReadToFollowing("Library");
Libname=xrdr.ReadElementContentAsString();
xrdr.ReadToFollowing("Source");
RetDir = xrdr.ReadElementContentAsString();
xrdr.Close();
After executing this code then:
LibName = "TESTLIB"
RetDir = "C:\RetData\"
CAVEAT:
I mentioned that this is the bare minimum. An XmlReader object is a forward only reader. Also, this code has no error checking.
In this case the elements must be read in the order they occur or the reader will encounter a null element and throw an error.

[SOLVED][Q] field in inner method

Hi all,first thanks to @GermainZ for help.
But now I have another problem:
I have this code:
Code:
public class ClassA {
public int MethodA(Param 1){
....
Boolean B1 = false;
String S1 = "...";
.....}}
I have to have access the field in this method.How can I do this?
Thanks in advance.
You can't directly, but you can recreate the process to get it again.
In the title, you mention an "inner class", but in your example the fields are inside a method. Which one do you mean? Fields in a method can indeed not be accessed.
Sorry I have correct the title.
In what way I can recreate all that method with the one hooked?
EDIT:may I have understand... I will try
Thanks to all,I've found another way to do that.

How to save & load module settings after MODE_WORLD_READABLE is gone?

According to document, trying to use MODE_WORLD_READABLE will crash the module UI with a SecurityException.
I've tried to use a ContentProvider, but unable to get the Context object in handleLoadPackage (Illegal state).
Is there any better way?
Tried to downgrade targetSdkVersion, the app no longer crashes but XSharedPreferences still can't read the file (the preferences file is already world readable)
You can use Remotepreferences (awesome library!). You will need a context however, so it is not suitable for methods in initzigote or where you can't access the context. I think is the only way as of now.
Massi-X said:
You can use Remotepreferences (awesome library!). You will need a context however, so it is not suitable for methods in initzigote or where you can't access the context. I think is the only way as of now.
Click to expand...
Click to collapse
Remotepreferences will complicate things.
The easiest way to do is to remove the below line
Code:
getPreferenceManager().setSharedPreferencesMode(MODE_WORLD_READABLE);
And add the following on class level.
Code:
@Override
public void onPause() {
super.onPause();
// Set preferences permissions to be world readable
// Workaround for Android N and above since MODE_WORLD_READABLE will cause security exception and FC.
final File dataDir = new File(getActivity().getApplicationInfo().dataDir);
final File prefsDir = new File(dataDir, "shared_prefs");
final File prefsFile = new File(prefsDir, getPreferenceManager().getSharedPreferencesName() + ".xml");
if (prefsFile.exists()) {
dataDir.setReadable(true, false);
dataDir.setExecutable(true, false);
prefsDir.setReadable(true, false);
prefsDir.setExecutable(true, false);
prefsFile.setReadable(true, false);
prefsFile.setExecutable(true, false);
}
}
This method will work on any sdk :good:
I tested it myself and it is working fine.
Thanks to @PunchUp @pyler
laura almeida said:
Remotepreferences will complicate things.
The easiest way to do is to remove the below line
Code:
getPreferenceManager().setSharedPreferencesMode(MODE_WORLD_READABLE);
And add the following on class level.
Code:
@Override
public void onPause() {
super.onPause();
// Set preferences permissions to be world readable
// Workaround for Android N and above since MODE_WORLD_READABLE will cause security exception and FC.
final File dataDir = new File(getActivity().getApplicationInfo().dataDir);
final File prefsDir = new File(dataDir, "shared_prefs");
final File prefsFile = new File(prefsDir, getPreferenceManager().getSharedPreferencesName() + ".xml");
if (prefsFile.exists()) {
dataDir.setReadable(true, false);
dataDir.setExecutable(true, false);
prefsDir.setReadable(true, false);
prefsDir.setExecutable(true, false);
prefsFile.setReadable(true, false);
prefsFile.setExecutable(true, false);
}
}
This method will work on any sdk :good:
I tested it myself and it is working fine.
Thanks to @PunchUp @pyler
Click to expand...
Click to collapse
Yeah but it seems an hacky thing. It will work with any Android? With selinux enabled? On custom ROMs? Surely Remotepreferences complicate things but is the best way (also for previous Android versions) of reading the preferences file. Anyway this can be another solution :good:
EDIT: I also found in marshmallow my apps was randomly failing reading the preferences (no real reason) and Remotepreferences solved the problem.
Massi-X said:
Remotepreferences will complicate things.
The easiest way to do is to remove the below line
And add the following on class level.
Yeah but it seems an hacky thing. It will work with any Android? With selinux enabled? On custom ROMs? Surely Remotepreferences complicate things but is the best way (also for previous Android versions) of reading the preferences file. Anyway this can be another solution :highfive:
Click to expand...
Click to collapse
With any android version - Yes
Will it work with previous android version - Yes
On custom ROMs - Yes
With selinux enabled ? - not tested yet. But I think it works.
laura almeida said:
With any android version - Yes
Will it work with previous android version - Yes
On custom ROMs - Yes
With selinux enabled ? - not tested yet. But I think it works.
Click to expand...
Click to collapse
Previous versions: I was speaking about another thing. See edit. Anyway it's another way, 2 is always better than 1.

Categories

Resources