[Samsung Epic 4G Touch] nivron:
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: People were asking about removing the ascending ringtone volume. I don't really care either way, personally, but there is demand.

Thankfully, the fix is quite simple!

Credits

the_ozyrys - One of the first posts I saw this in.

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 Phone.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 Phone.apk file, so using my file IS NOT RECOMMENDED.

If you are using the Calkulin's E4GT ROM v1.5a ROM, you can safely use my attached Phone.apk file. It may work with other "stock" ROMs, but this is the one I based it on. Make sure to rename it to Phone.apk

What you need to perform this mod:

1. An Epic 4G Touch ROM ZIP file, or a phone running a Epic 4G Touch ROM.

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.2.8.jar and baksmali-1.2.8.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 PHONE.APK FILE, just in case!

Android is case-sensitive, so ensure that your file is named Phone.apk, and not phone.apk.

Instructions:

1. Put your phone in AIRPLANE MODE (hold Power->Airplane Mode)

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

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

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

3. Go to a command prompt in your "working" folder and run the following command: java -jar baksmali-1.2.8.jar -o Phone/ Phone.apk

4. Browse to your "working" folder and see that there is now an Phone folder inside, with other subfolders. Browse to Phone\smali\com\android\phone.

5. Edit the file called Ringer$1.smali with your favorite UNIX-format compatible text editor and look for the following text. The key is to search for setStreamVolume. There should be two results. Comment the line below that is in BOLD by adding a hash (#) in front of it.

.line 394
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;

iget-object v1, v1, Lcom/android/phone/Ringer;->mAudioManager:Landroid/media/AudioManager;

[B]invoke-virtual {v1, v3, v5, v4}, Landroid/media/AudioManager;->setStreamVolume(III)V[/B]

6. Change that line to say #invoke-virtual {v1, v3, v5, v4}, Landroid/media/AudioManager;->setStreamVolume(III)V

7. Save Ringer$1.smali

8. Go back to your command prompt, change to your "working" folder and issue the following command: java -jar smali-1.2.8.jar Phone/ -o classes.dex

9. Open Phone.apk in your favorite archiver.

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

11. Run the following commands to get the file on your phone:

adb remount
adb push Phone.apk /system/app/Phone.apk
adb reboot

IF ADB REBOOT DOESN'T WORK, REBOOT YOUR PHONE MANUALLY. YOU MAY HAVE TO PULL YOUR BATTERY. ANDROID DOES NOT LIKE REPLACING THE PHONE APK WHILE RUNNING.

Your phone should reboot and now have one volume level when the phone rings.

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.