[Galaxy S 4 Q&A, Help & Troubleshooting] luizfeliperj:
A look into the code

What you get back from smali is a regular jar, not an odexed one. When you run backsmali with '-x' argument, you tell backsmali to deodex the source file. So, Maybe, that was the problem.

But there are other points in the code we should pay attention. For your need, I don't think that you need to change anything in the original framework. You need that the MIN_MATCH variable set to 0x7. As far as I could understand from the smali code, if you change the sales code, you can accomplish that. And, as far as I know, sales code is a configuration directive, from one or more of the many xmls available in the /system directory.

I will substantiate what I said this some code snippets.

The MIN_MATCH* variables are defined as:

.field static final MIN_MATCH:I = 0x7

.field static final MIN_MATCH_CHINA:I = 0xb

.field static final MIN_MATCH_HK:I = 0x8

.field static final MIN_MATCH_TW:I = 0x9

In CompareLoosely method, there is a check for the sales_code "CHN" "CHU" "CHM" "CTC" "CHC"

.method public static compareLoosely(Ljava/lang/String;Ljava/lang/String;)Z

(...)

const-string v11, "ro.csc.sales_code"

(...)

.local v9, "salesCode":Ljava/lang/String;

const-string v11, "CHN"

(...)

const-string v11, "CHU"

(...)

const-string v11, "CHM"

(...)

const-string v11, "CTC"

(...)

const-string v11, "CHC"

So, here is what I think. If CSC is defined as CHN (the default for this firmware), the MIN_MATCH_CHINA (0xb (11)) will be used, and that is really what is happening.

So we need test those others sales codes to check which one trigger which MIN_MATCH* variable. My guest is if you select any CSC not listed in the above list, the default case of 0x7 will be used. To change the CSC (I mean change the 'ro.csc.sales_code' property), we can use the method described by: http://www.geekzone.co.nz/forums.asp?forumid=97&topicid=109787.

UPDATE:

I misunderstood the smali code, the corresponding java code from the smali code follows:

String s2 = SystemProperties.get("ro.csc.sales_code");

if (!"CHN".equals(s2) && !"CHU".equals(s2) && !"CHM".equals(s2) && !"CTC".equals(s2) && !"CHC".equals(s2))

{

if (!"FET".equals(s2) && !"TWM".equals(s2) && !"CWT".equals(s2) && !"BRI".equals(s2))

{

if ("TGY".equals(s2))

{

So, if your sales code is not listed in any of the if's, you will use the the getMinMatch method, the corresponding java code follows.

public static int getMinMatch()

{

if (CscFeature.getInstance().getInteger("CscFeature_RIL_CallerIdMatchingDigit") == -1)

return 7;

else

return CscFeature.getInstance().getInteger("CscFeature_RIL_CallerIdMatchingDigit");

}

This CscFeature_RIL_CallerIdMatchingDigit is know and is located in the /system/csc/others.xml. What we need is a way to change the sales_code. I suppose that, if we change the /system/csc/sales_code.dat with any other unlisted code, like XEU, we would be fine.

UPDATE 2:

Changing the sales_code.dat did the trick, but now I have problems in dialer, I can't dial anyone, there is no button to press, they dissapeared. :)

Here what I did.

Edited the sales_code.dat, now it is XEU.

Reboot

Opened Config->Manage Apps->Contacts Stores->Cleaned everything (this will wipe all your contacts, back it up)

Reboot

Resynced my contacts with google, All my sms senders are now recognized!!! But I can't dial anyone...

UPDATE 3:

Modified the the smali code, recompiled, odexed using these instructions: http://xdaforums.com/showthread.php?t=1208320

Result, no luck, will try again later.

UPDATE 4:

Did it!!! Works for me!

* Updated framework.odex [ Attached to this post ]

* Opened Config->Manage Apps->Contacts Store->Cleaned everything (this will wipe all your contacts, back it up)

* Reboot

Senders are now recognized !!

UPDATE 5:

To use this patched framework.odex you need to:

* Change the /system/framework/framework.odex with the one provided in the zip file

* Change the <CscFeature_RIL_CallerIdMatchingDigit> parameter inside the /system/csc/others.xml, remove the default value (11) and insert the desired one(ex. 8).

* Clean Contacts Store by opening Config->Manage Apps->Contacts Store and press the buttons destinated to clean everything.

* Reboot

* Resync contacts or restore Contacts from TitaniumBackup.

PS: There is no need to change sales_code.dat file, keep it intact.

SMS senders should now be recognized.