Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

[GUIDE | TUT | HACK] Remove Android 4.2.x safe volume message

$
0
0
Hey XDA community! :)

I received the Android 4.2.1 update for my Asus Transformer TF300T tablet and after using it for awhile i noticed when headphones are plugged into the device, and you increase the volume past (10 for my tablet) you will get a message saying that it is unsafe to use headphones at high volumes. Well I'm sorry. If people really need that message because they do not have the common sense to figure it out, well i have no comment.




So since this message is awfully annoying, i decided to go forth and remove it.

After hours of Google not helping, only finding other people on Nexus 7 devices and the like, seriously annoyed with it as i was. I knew i had to write this guide.

So here we go! :)

Firstly, there are two methods i discovered to remove this. First method, and prolly the easiest for people, is to:

1. Grab your framework-res.apk file from /system/framework/framework-res.apk using either adb or root explorer on your device
2. Using APKTool decompile framework-res.apk
3. Once decompiled directory.
4. Navigate to the file framework-res.apk/res/values/integers.xml YOU MUST USE NOTEPAD++ DO NOT USE MS NOTEPAD (Linux users need not worry)
5. Find the following "<integer name="config_safe_media_volume_index">10</integer>"
6. Change the "10" to a "20"
7. Save the changes to the xml file
8. Recompile the framework-res.apk with APKTool
9. Using adb or a flashable zip, put the framework-res.apk back to your device by:

adb remount

adb push <path to newly compiled apk> /system/framework/framework-res.apk

adb shell chmod 644 /system/framework/framework-res.apk

10. Reboot device and test :)






The second method is a little more tricky as it deals with smali code. Some people have no idea what smali code is but for those who do, this is the mod i personally use.

1. Grab your framework.jar file from /system/framework/framework.jar directory
2. Using either apktool, or baksmali, decompile framework.jar
3. Once decompiled, find the file framework.jar/smali/android/media/AudioService$AudioHandler.smali
4. YOU MUST USE NOTEPAD++ AGAIN! (Linux users again need not worry :) )
5. Once opened, find the following.

Code:

:pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_3
        :pswitch_5
        :pswitch_6
        :pswitch_7
        :pswitch_9
        :pswitch_a
        :pswitch_8
        :pswitch_b
        :pswitch_c
        :pswitch_f
        :pswitch_d
        :pswitch_e
        :pswitch_1
        :pswitch_4
        :pswitch_12
        :pswitch_13
        :pswitch_14
        :pswitch_15
        :pswitch_b
        :pswitch_10
        :pswitch_11
        :pswitch_16
        :pswitch_17
        :pswitch_18
        :pswitch_19
        :pswitch_19
    .end packed-switch


6. at the bottom, you will see
Code:

:pswitch_19
(hoping this is the same for all devices) and comment out
Code:

:pswitch_19
(i have two i dont know why, if you also have two, comment both out)

Should look like this:

Code:

:pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_3
        :pswitch_5
        :pswitch_6
        :pswitch_7
        :pswitch_9
        :pswitch_a
        :pswitch_8
        :pswitch_b
        :pswitch_c
        :pswitch_f
        :pswitch_d
        :pswitch_e
        :pswitch_1
        :pswitch_4
        :pswitch_12
        :pswitch_13
        :pswitch_14
        :pswitch_15
        :pswitch_b
        :pswitch_10
        :pswitch_11
        :pswitch_16
        :pswitch_17
        :pswitch_18
    #  :pswitch_19
    #  :pswitch_19
    .end packed-switch

7. Once edited, save the file.
8. Using APKTool or smali, recompile framework.jar
9. Using adb or a flashable zip, push the file back to your device

adb remount

adb push <path to newly compiled framework.jar file> /system/framework/framework.jar

adb shell chmod 644 /system/framework/framework.

adb reboot recovery

10. Once in recovery, wipe dalvik cache and cache.

11. Reboot and test :)






I have a zip attached for those who wish to use a zip.

Just OPEN the zip using 7zip, you will see two folders (META-INF, system) open system folder, open framework folder, and place your newly compiled file in there. Put the zip to your device, and flash in recovery.


ROM devs, feel free to use this! Just give credit :) Thanks

Guys dont hesitate to hit that thanks button! Can even donate to me as well :) Thanks everyone!

Attached Files
File Type: zip ZipFlasher.zip - [Click for QR Code] (216.9 KB)

Viewing all articles
Browse latest Browse all 3614


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>