[MOD]/[HOWTO] 1x/3G Mod for S4 (MJA/MF9/MDL/JB)

nivron

Senior Member
Oct 21, 2010
933
773
123
Orlando, Florida
Greetings and Salutations, Sprint Galaxy S4 Owners and other curious parties!

Disclaimer: Just reading this may cause your head to burst, your phone to catch fire, dogs and cats may do the tango! I am not responsible for any bad stuff that happens from you reading or acting on the information in this thread.

If any ROM authors want to use this fix in their ROMs, I'm completely cool with that. A quick kudos in your credits section would be nice, though. :cool:

Background: One of the things that really peeves me off about Sprint is that they want us to think we always have 3G service. I know that I don't have 3G in all of the areas I travel, and I also don't when I am roaming.

Thankfully, the fix is quite simple!

This was my primary reason for rooting my phone, that's how aggravating it is for me. :eek:

Let's change this:


To this:


Credits
Calkulin - for getting me started on the crusade to expose Sprint's 1x evilness.

crawrj - for the stock rooted deodexed MDL/MF9 ROM I developed this on.

CNexus - for the stock rooted deodexed MJA ROM I developed this on.

Samsung - for a much better phone this time around than my previous E4GT.

The brave XDA members who try these instructions and report their success or failure!!!

XDA for being a great source of information!!!

XDA members for thinking outside of the box!!!


The fix:
This fix requires editing your SystemUI.apk file. If you are using one of the fine custom ROMs on XDA, be aware that the you or the author may have already made changes to the SystemUI.apk file, so using my file IS NOT RECOMMENDED.

If you are using the stock, deodexed MDL ROM or the Stock Rooted Deodexed ROM from crawrj, you can use my attached SystemUI.apk.
There are also flashable ZIPs - flash at your own risk. :cowboy: BE SURE TO GET THE CORRECT VERSION FOR WHAT ROM YOU ARE ON! If you use the attached APKs, SystemUI.apk is for MDL, SystemUI-MF9.apk is for MF9, SystemUI-MJA.apk is for MFA. You must make sure the APK is called SystemUI.apk before pushing to your device.

This mod relies on the assumption that your ROM developer has not deleted any of the 1x graphic files in the ROM. The developer CAN theme or otherwise change the images as long as the file names remain the same.

What you need to perform this mod:
1. An Sprint Galaxy S4 ZIP file, or a phone running a Sprint Galaxy S4 ROM -- AOSP ROMs already have the correct indicators.
2. The Java SDK -- So you can run Smali.
3. Smali/Baksmali -- So you can decompile/compile the classes.dex file.
4. Android SDK -- To push/pull files from your phone (adb only).
5. Some sort of archive tool (such as WinRAR, 7zip, etc).
5. A text editor capable of editing UNIX-formatted files. I recommend Notepad++, personally.

Ease Of Use Tips: Install Java SDK first, then Android SDK (if you need adb). Download the smali files (smali-1.4.2.jar and baksmali-1.4.2.jar at the time of this writing) to a new "working" folder where we can do our magic. The beta smali/baksmali also work.

KEEP A COPY OF YOUR PRE-EDITED SYSTEMUI.APK FILE, just in case!

Instructions:
1a. [If you are using a ROM ZIP File]: Use 7zip/WinRAR/WinZip to open the ROM ZIP file. Navigate to system\app and extract SystemUI.apk to your "working" folder.

1b. [If you want to grab SystemUI.apk from your running phone]: Use adb to pull SystemUI.apk to your working folder. Example: adb pull /system/app/SystemUI.apk C:\Working\SystemUI.apk

To avoid problems, ONLY USE adb to pull/push SystemUI.apk. Phone apps may cause unknown issues.

2. Go to a command prompt in your "working" folder and run the following command: java -jar baksmali-1.4.2.jar -o SystemUI/ SystemUI.apk

3. Browse to your "working" folder and see that there is now an SystemUI folder inside, with other subfolders. Browse to SystemUI\com\android\systemui\statusbar\policy.

4. Edit the file called NetworkController.smali with your favorite UNIX-format compatible text editor and look for the following text. The key is to search for updateSPRDataNetType. Edit the line below that is in BOLD.

For MJA:
Code:
    .line 1666
    :pswitch_fc
    [B]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateSPRDataNetType()V[/B]

    goto/16 :goto_d
For MF9:
Code:
    .line 1554
    :pswitch_f2
    [B]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateSPRDataNetType()V[/B]

    goto/16 :goto_d
For MDL:
Code:
    .line 1550
    :pswitch_e3
    [B]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateSPRDataNetType()V[/B]

    goto/16 :goto_d
5. Change that line to say invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateVZWDataNetType()V (change the SPR to VZW)

*** The above change will give you Verizon's data icons -- including their trademarked 4GLTE icon (instead of the default Sprint 4G icon). If you want the "correct" 4G icon, follow steps 5a-5c. If you like Verizon's icon, continue with step 6.

5a. Still in the NetworkController.smali file, look for the following text. The key is to search for DATA_4G_LTE: (please include the colon, because there are other DATA_4G_LTE lines for other carriers. Edit the lines below that are in BOLD.

For MJA:
Code:
    .line 2219
    :pswitch_11f
    [B]sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_4G_LTE:[[I[/B]

    iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I

    aget-object v0, v0, v1

    iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I

    .line 2220
    [B]const v0, 0x7f0200e0[/B]

    iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MF9:
Code:
    .line 1993
    :pswitch_11f
    [B]sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_4G_LTE:[[I[/B]

    iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I

    aget-object v0, v0, v1

    iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I

    .line 1994
    [B]const v0, 0x7f0200d2[/B]

    iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MDL:
Code:
    .line 1980
    :pswitch_11f
    [B]sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_4G_LTE:[[I[/B]

    iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I

    aget-object v0, v0, v1

    iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I

    .line 1981
    [B]const v0, 0x7f0200d6[/B]

    iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
5b. Change the first line to say DATA_4G: instead of DATA_4G_LTE:. For MJA, change the second line to say 0x7f0200de instead of 0x7f0200e0. For MF9, change the second line to say 0x7f0200d0 instead of 0x7f0200d2. For MDL, change the second line to say 0x7f0200d4 instead of 0x7f0200d6.

5c. Your final version should look like this (my changes in BOLD):

For MJA:
Code:
    .line 2219
    :pswitch_11f
    sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->[B]DATA_4G:[/B][[I

    iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I

    aget-object v0, v0, v1

    iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I

    .line 2220
    const v0, [B]0x7f0200de[/B]

    iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MF9:
Code:
    .line 1993
    :pswitch_11f
    sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->[B]DATA_4G:[/B][[I

    iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I

    aget-object v0, v0, v1

    iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I

    .line 1994
    const v0, [B]0x7f0200d0[/B]

    iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MDL:
Code:
    .line 1980
    :pswitch_11f
    sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->[B]DATA_4G:[/B][[I

    iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I

    aget-object v0, v0, v1

    iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I

    .line 1981
    const v0, [B]0x7f0200d4[/B]

    iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
6. Save NetworkController.smali

7. Go back to your command prompt, change to your "working" folder and issue the following command: java -jar smali-1.4.2.jar SystemUI/ -o newclasses.dex

8. If there weren't any errors, go ahead and rename the original classes.dex to classes.old and rename newclasses.dex to classes.dex.

9. Open SystemUI.apk in your favorite archiver (if you closed it earlier).

10. Drag the file called classes.dex from your "working" folder into SystemUI.apk and replace the one already in there.

11. Run the following commands to get the file on your phone:
Code:
adb remount
adb push SystemUI.apk /system/app/SystemUI.apk
adb reboot
You should hear your bootup sound and then the changes should be instantly applied.


To Test:
1. Dial ##DATA# (##3282#) on your phone.
2. Enter your MSL (can be found by typing getprop ril.MSL from Terminal Emulator or adb shell). You may have to dial ##3282# and press "OK" without entering anything first.
3. Scroll to Others at the bottom of the list.
4. Click on HDR/1X Selection
5. Change from LTE + CDMA + EVDO Mode to CDMA Only Mode. This puts your phone in 1X only mode.
6. Press OK.
7. Verify 1X icon comes within 30 seconds, if you have service. Try toggling Airplane Mode if you have issues seeing the 1X icon the first time.
8. Repeat steps 4-7, substituting LTE + CDMA + EVDO for CDMA Only Mode to switch back.

How I found this: Sprint's updateDataNetType doesn't properly identify 1X - it shows up as 3G. I haven't spent enough time dabbling in the file to determine which code block "should" be the 1X -- however, the Verizon updateDataNetType works perfectly for us. On the E4GT, this change was much easier because the code for 1X was easier to work with. I may update this in the future with a "proper" fix. I have tested this on 1x/3G/4G networks while roaming without issue.

Please let me know whether or not this worked for you. I'd like to make a list of ROMs (with applicable mods) this works for or doesn't work for.

I will do whatever I can to help if you are struggling. :) If there's something you don't understand, please let me know. I can update the instructions if I accidentally wrote something wrong.
 

Attachments

Last edited:

myphone12345

Senior Member
Jan 12, 2008
296
80
0
What would happen with an unlocked Sprint S4 if used overseas on GSM carriers? Would it know to display 2G for GSM/GPRS/EDGE and 3G for UMTS/WCDMA/HSPA?
 

nivron

Senior Member
Oct 21, 2010
933
773
123
Orlando, Florida
Great! Did you use the attached APK, or did you try out the tutorial? If you did the tutorial, I had a typo earlier -- the steps 5a-5c said to change the 0x7f0200d6 to 0x7f0200d4, but I forgot to change the 6 to a 4 in my "after" code view. I fixed that this morning. As a FYI, if you don't change the 6 to a 4, it will keep the 4GLTE icon.

Worked perfect on the Stock Deodexed Rom. Many Thanks!!
 

nivron

Senior Member
Oct 21, 2010
933
773
123
Orlando, Florida
Updated for MF9

I haven't tested this yet as I don't have time to install the ROM, but I went ahead and updated it for MF9. Please try it out and let me know how it works.

Also if you cook it in yourself, make sure to realize that there are separate instructions for MF9/MDL in the OP! :victory:
 

nivron

Senior Member
Oct 21, 2010
933
773
123
Orlando, Florida
It should work on odexed if you delete /system/app/SystemUI.odex. I think my ZIP files do that automatically.

Just curious, will this work on either odexed or deodexed?

Nice work. It worked great on MDL and I'm about to try it on MF9.

Sent from my SPH-L720 using Tapatalk 2


Sent from my SPH-L720 using Tapatalk 2
 

copticwalad

Senior Member
Oct 12, 2010
91
57
48
Cleveland, OH
Connected to my Sprint Airave on 1x
uploadfromtaptalk1374658234439.jpg


Connected to my Sprint Airave on 3G

uploadfromtaptalk1374658320479.jpg

On Wifi I get 32 Mbps Down and 13 Mbps Up

Sent from my SPH-L720 using xda app-developers app


**Thanks for this btw, Flashed 1x3G-Mod-jfltespr-MF9.zip in TWRP on my Odexed MF9 Stock Rom and worked perfectly. I was overwhelmed with the directions before seeing the zip, lol.
 
Last edited:
  • Like
Reactions: reverepats
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone