[Samsung Epic 4G Touch] nivron:
For the Gingerbread version of this fix, click here!

Greetings and Salutations, Epic 4G Touch 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! It was a bit more difficult than the fix for HTC Sense ROMs as the smali edit was not quite as 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, sextape, sfhub, Other brave folks - For providing the leaked ROMs for me to fiddle with.

Calkulin - (indirectly) helped me find how to fix this for Sense ROMs which I wrote up here.

Samsung - for a relatively good phone. Hopefully the weird auto-brightness and battery life will be fixed next update.

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 Calk's E4GT 2 v1.6 ROM, you can safely use my attached SystemUI.apk file. It may work with other "stock-ish" ROMs, but this is the one I based it on. The attachment will NOT work on stock FF18.

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 Epic 4G Touch ROM ZIP file, or a phone running a Epic 4G Touch 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.3.2.jar and baksmali-1.3.2.jar at the time of this writing) to a new "working" folder where we can do our magic.

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.3.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 .line 751. Edit the line below that is in BOLD.

.line 751
:pswitch_e8
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mShowAtLeastThreeGees:Z

[B]if-nez v3, :cond_103[/B]

5. Change that line to say #if-nez v3, :cond_103 (add the # at the beginning to comment it out)

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.3.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:

adb remount
adb push SystemUI.apk /system/app/SystemUI.apk
adb shell stop
adb shell start

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).

3. Scroll to Others at the bottom of the list.

4. Click on HDR/1X Selection

5. Change from Hybrid 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.

8. Repeat steps 4-7, substituting Hybrid Mode for CDMA Only Mode to switch back.

How I found this: The files in ICS are different than Gingerbread. Looking for 1x led me to NetworkController.smali. There is a lookup called mShowAtLeastThreeGees (which I thought was hilarious). There are 6 locations that reference this boolean value. The correct one is the a couple of lines before a reference to DATA_1X. I wish I noticed that earlier as I was commenting out each one at a time until I found the last one, which coincidentally was right before DATA_1X. That's what happens when you've got too many things going on at once.

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.