Or Continue to Thread: [APP] + [MOD] Enable forced ro…
Find Your Device:
14th August 2010, 03:00 AM   |  #97  
OP Senior Member
Thanks Meter: 152
 
245 posts
Join Date:Joined: Dec 2009
Quote:
Originally Posted by my2cents

That is correct. We can chose between "Home only" and "Automatic" in the system select menu under network settings.

Here is a link to the information that chibucks has provided over at sdx: http://forum.sdx-developers.com/andr...6266/#msg76266

I think it is similar to what he posted here at xda.

Thanks again!!!

Oookay, I finally got a few minutes to look through the Moment code, and I see what is going on here. I've got a few ideas...the easy way that might not work, the other easy way, and the right way (which actually isn't that much more work, it just introduces some new code). The suggested changes are shown below...I copied some tag/line number for reference, and added comments to the lines I added/modified.

The easy (and interesting) way that might not work:

Replace "Home only" with "Roam only". Try changing how the roaming options are defined, nice and easy. You lose the ability to force to Sprint, but does anyone do that?

filename=arrays.xml
Code:
    <string-array name="cdma_system_select_choices">
        <item>Roam only</item> #was "Home only"
        <item>Automatic</item>
    </string-array>
    <string-array name="cdma_system_select_values">
        <item>0</item>
        <item>2</item>
    </string-array>
filename=Settings.smali
Code:
.field private static final CDMA_ROAMING_MODE_AFFILIATED:I = 0x0 #was 0x1

.field private static final CDMA_ROAMING_MODE_ANY:I = 0x2

.field private static final CDMA_ROAMING_MODE_HOME:I = 0x1 #was 0x0
The easy way that should work

Replace "Home only" with "Roam only". Swap 0x0 with 0x1 in the code. You lose the ability to force to Sprint, but does anyone do that? More code changes with this one...

filename=arrays.xml
Code:
    <string-array name="cdma_system_select_choices">
        <item>Roam only</item> #was "Home only"
        <item>Automatic</item>
    </string-array>
    <string-array name="cdma_system_select_values">
        <item>0</item>
        <item>2</item>
    </string-array>
filename=CdmaRoamingListPreference$MyHandler.smali
Code:
    .line 120
    .local v1, settingsRoamingMode:I

    const/4 v3, 0x1 #new
    
    if-eq v2, v3, :cond_0 #modified

    const/4 v3, 0x2

    if-ne v2, v3, :cond_3
filename=CdmaRoamingListPreference.xml
Code:
    .line 81
    const/4 v2, 0x1 #was 0x0
The right way

Add a Roam only option. This way requires more code updates and will require some trial and error on your part.

filename=arrays.xml
Code:
    <string-array name="cdma_system_select_choices">
        <item>Home only</item>
        <item>Roam only</item> #new
        <item>Automatic</item>
    </string-array>
    <string-array name="cdma_system_select_values">
        <item>0</item>
        <item>1</item> #maybe supposed to be 3, i'm not sure, trial and error
        <item>2</item>
    </string-array>
filename=CdmaRoamingListPreference.smali
Code:
    .line 75
    packed-switch v0, :pswitch_data_0

    const/4 v2, 0x1 #new 
    if-eq v0, v2, :goto_0 #new

    .line 81
    const/4 v2, 0x0
filename=CdmaRoamingListPreference$MyHandler.smali
Code:
    .line 120
    .local v1, settingsRoamingMode:I
    if-eqz v2, :cond_0

    const/4 v3, 0x1 #new
    
    if-eq v2, v3, :cond_0 #new

    const/4 v3, 0x2

    if-ne v2, v3, :cond_3
Last edited by MrGreg; 14th August 2010 at 03:18 AM.