[MOD] Samsung KeyBoard Swipe Color - Text Editor Changes - (12/16) - Verizon Galaxy Note 3 Android Development

Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Don't take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smali\com\diotek\ime\framework\view\AbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, [B][U][COLOR="Blue"]0xff[/COLOR][/U][/B] [B][COLOR="seagreen"]Change for Alpha Value - "0xff" [/COLOR][/B]
const/4 v1, 0x1
const/4 v3, [B][U][COLOR="Blue"]0x0[/COLOR][/U][/B] [B][COLOR="seaGreen"] - Change for Red Value - "0x0"[/COLOR][/B]
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, [B][U][COLOR="Blue"]0xa5[/COLOR][/U][/B] [COLOR="seagreen"]- Change for Green Value - "0xa5"[/COLOR]
const/16 v2, [B][U][COLOR="Blue"]0xf3[/COLOR][/U][/B] [COLOR="seagreen"] - Change for Blue Value - "0xf3"[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
So what it boils down to is that the Swipe Color is what we call RGB color coding. I suggest a site like this to see values you can use:
Hex to RGB Color converter
Thats it folks.. swipe color squashed!!!!
A Little clarification on Instructions.
I was swamped with questions on how to edit and such.. So with @strongsteve help we dug more and here is an easier way to get your colors instead of trying to use RGB values..
Note III - Edits
change code:
Code:
const/16 v1, 0xa5
const/16 v2, 0xf3
to
Code:
const v3, 0x33
const v1, 0x66
const v2, 0xcc
Note II - Edits
change code:
Code:
const/16 v1, 0xff
const/16 v2, 0xa5
const/16 v3, 0xf3
change to:
Code:
const/16 v1, 0xff
const v2, 0x66
const v3, 0xcc
const v4, 0x33
Then just use any normal Hex Color code you would normally use!!!
In the above example I used 3366cc which is DarkHorse Blue..
I hope that helps
Text Color in Text Editor(Second Screen Shot)
Note III
Search for
Code:
constructor <init>(Lcom/visionobjects/textwidget/e/a;Landroid/util/DisplayMetrics;)V
and then look for:
Code:
const/high16 v1, -0x100 <--- Black Text Color Previous Typed Word
const v2, -0xcc4a1b <--- Last Typed Word
Change Black Text to a Smali Color Code
Change Last Typed Word to Smali Color code (-0xcc4a1b)
For example:
3366cc converts to -0xCC9934 for smali color codes
Thx to @EMSpilot for pointing out the Black Text Line... Thank you!!!

This has been long sought after....thanks for this and great work my friend! :highfive::good:
ALL Users must be reminded to give credit for this share, as, unless I am mistaken, it is not too many other places!

Sick
Sent from my SM-N900V using Tapatalk

Naddict said:
This has been long sought after....thanks for this and great work my friend! :highfive::good:
ALL Users must be reminded to give credit for this share, as, unless I am mistaken, it is not too many other places!
Click to expand...
Click to collapse
Nice work on this!!
Sent from my SPH-L710 using xda app-developers app

Nice Job Michael!

Swipe Color
Nice work!!
Thanks Michael!!!

OP Updated with more edits

Congrats again michael, made it to the portal !
http://www.xda-developers.com/android/how-to-finally-alter-a-samsung-keyboards-swipe-trail-color/ :good:

sbreen94 said:
Congrats again michael, made it to the portal !
http://www.xda-developers.com/android/how-to-finally-alter-a-samsung-keyboards-swipe-trail-color/ :good:
Click to expand...
Click to collapse
Thank you very much sir
Sent from my SCH-I545 using Xparent BlueTapatalk 2

Little bit of an older thread, still a great job. I'll be adding these to the keyboards I make. And of course I'll throw you in my OP along with the rest of the great guys I've met.
Question about the second mod, what is that? It refers to a second screen shot and I only see one.
I'm not sure what color it's changing. It's my bad, I haven't tried it yet to see, just figured I'd ask if anyone has done it yet.
Sent from my SM-G900T using Tapatalk 2

cbucz24 said:
Little bit of an older thread, still a great job. I'll be adding these to the keyboards I make. And of course I'll throw you in my OP along with the rest of the great guys I've met.
Question about the second mod, what is that? It refers to a second screen shot and I only see one.
I'm not sure what color it's changing. It's my bad, I haven't tried it yet to see, just figured I'd ask if anyone has done it yet.
Sent from my SM-G900T using Tapatalk 2
Click to expand...
Click to collapse
Buc is the man

@Gunthermic
I wanted to thank you for this.
While your directions didnt exactly work for me, I was still able to get it to work on my Tmobile SamsungIME
On my N900t the info was here:
Look for:
smali\com\diotek\ime\framework\trace\KeyboardTrace.smali
Search for -> .method public initTracePaint()V
Code:
.method public initTracePaint()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 174
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardTraceLine;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 175
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardTraceLine;->mTracePaint:Landroid/graphics/Paint;
.line 177
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/trace/KeyboardTrace;->mDrawingTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 178
iget-object v0, p0, Lcom/diotek/ime/framework/trace/KeyboardTrace;->mDrawingTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 180
iget-object v0, p0, Lcom/diotek/ime/framework/trace/KeyboardTrace;->mDrawingTracePointTimeStamp:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 184
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/trace/KeyboardTrace;->mDrawingTracePointCount:S
.line 185
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardTraceLine;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 186
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardTraceLine;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 187
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardTraceLine;->mTracePaint:Landroid/graphics/Paint;
[COLOR="Blue"]const v3, 0xff
const v1, 0xff
const v2, 0xff[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Using your second method, I changed mine to an easy white just to test.

Ok I got another related question, any idea on where to change the size or thickness of the swipe? I assume it's in the smali somewhere
Sent from my SM-N900T using Tapatalk 2

cbucz24 said:
Ok I got another related question, any idea on where to change the size or thickness of the swipe? I assume it's in the smali somewhere
Sent from my SM-N900T using Tapatalk 2
Click to expand...
Click to collapse
In that same method you could just call the setStrokeWidth method on the mTracePaint variable with the thickness you would like
http://developer.android.com/reference/android/graphics/Paint.html#setStrokeWidth(float)

Ok last question, I only ask this since I looked through every smali I could searching terms and couldn't find it.
http://forum.xda-developers.com/showthread.php?t=2768762
Its a new keyboard I found that lets devs create themes without flashing and has a thumb of the image.
The trace paint is a huge pink line. I can't seem to find it anywhere. I did find a reference to it, but LG must name things different.
Anyone care to take a look an see if they can find something I couldn't? Looks real promising for themers
Sent from my SM-N900T using Tapatalk 2

cbucz24 said:
Ok last question, I only ask this since I looked through every smali I could searching terms and couldn't find it.
http://forum.xda-developers.com/showthread.php?t=2768762
Its a new keyboard I found that lets devs create themes without flashing and has a thumb of the image.
The trace paint is a huge pink line. I can't seem to find it anywhere. I did find a reference to it, but LG must name things different.
Anyone care to take a look an see if they can find something I couldn't? Looks real promising for themers
Sent from my SM-N900T using Tapatalk 2
Click to expand...
Click to collapse
LG G3 keyboard? Uhh let me dig up my files but I found this one a while ago lol. Didn't see your post till now

CNexus said:
LG G3 keyboard? Uhh let me dig up my files but I found this one a while ago lol. Didn't see your post till now
Click to expand...
Click to collapse
Gearandroid said it was shape_writer_color but I didn't find it yet. Haven't seen where the file is yet either I guess for that matter. Lol
Sent from my SM-N900T using Tapatalk 2

cbucz24 said:
Gearandroid said it was shape_writer_color but I didn't find it yet. Haven't seen where the file is yet either I guess for that matter. Lol
Sent from my SM-N900T using Tapatalk 2
Click to expand...
Click to collapse
No, worries, I got it almost as soon as the keyboard was ported...

CNexus said:
No, worries, I got it almost as soon as the keyboard was ported...
Click to expand...
Click to collapse
Cool. Is that name I lists the name of the smali file itself?
I tried contacting another guy. He made the android L keyboard and somehow included the libs it needed. But he didn't answer me back.
If that's possible for this one, everyone could use it a lot easier
Sent from my SM-N900T using Tapatalk 2

cbucz24 said:
Cool. Is that name I lists the name of the smali file itself?
I tried contacting another guy. He made the android L keyboard and somehow included the libs it needed. But he didn't answer me back.
If that's possible for this one, everyone could use it a lot easier
Sent from my SM-N900T using Tapatalk 2
Click to expand...
Click to collapse
Sorry not sure if you made a typo or something but I'm not sure what you mean

Related

[INFO] All about: strings and howto change the Useragent of the stock Browser (XWJP6)

Here is my first post.
I've found some very interesting things in the android stock browser code (BrowserActivity.smali) of the Galaxy S.
Here are all about: strings that you can enter in your address line of your stock browser.
about:blank (shows a blank page. Found near .line 1867)
about:debug (shows in the preferences screen some Javascript options. Found near .line 585)
about:useragent (VERY INTERESTING: You can change the useragent and you can choose between an Android, Iphone, Desktop, Lismore UserAgent or you can enter a custom UA string. Found near .line 610)
Here are the about: strings that I don't know what are they supposed to do:
about:debug.dom (Found near .line 587)
about:debug.dom.file (Found near .line 589)
about:debug.render (Found near .line 591)
about:debug.render.file (Found near .line 593)
about:debug.display (Found near .line 595)
about:debug.drag (Found near .line 597)
I don't know if these commands are working on earlier firmware versions. If you know what the commands are supposed to do post it please here
Nice find, will look into this
Nice find!
I am especially intrested in making sites think I am using desktop PC.
I did change my useragent, but it seems the galaxy also sends a header called "HTTP_X_WAP_PROFILE:" where the phone reveals its a gt-i9000. Some sites seems to listen to this.
Do you think there is a way to change these things more permanently with root access maybe?
you could use my patched browser for example

Possible reason for poor battery life

interesting news about improving battery life:
Lee!!!!
Ive found out where the missing power management options has gone wrong
For some reason HTC misplaced the .apk and put it in /system/bin instead of system/app
You will find it /system/bin/NvCPLSvc.apk and it needs moving to system/app.
For users who already have LeeDroiD installed, use a file manager with root access and move NvCPLSvc.apk from/system/bin to system/app and reboot.
Click to expand...
Click to collapse
LeeDroid said:
No fekkin way! I was just looking into the contents of that apk whilst decompiling a ton of others... I did wonder.. lmao! :-D
@HTC Epic Fail!
Certainly some interesting caps/config
Code:
# static fields
.field private static final TAG:Ljava/lang/String; = "NvPowerMgr"
.field private static final fpsLimitName:Ljava/lang/String; = "NV_FPSLIMIT"
.field private static final mAggressiveness:Ljava/lang/String; = "/sys/devices/tegradc.0/smartdimmer/aggressiveness"
.field private static final mAggressiveness_Balanced:I = 0x1d
.field private static final mAggressiveness_FullPerf:I = 0x18
.field private static final mCPU_User_Cap:Ljava/lang/String; = "/sys/module/cpu_tegra/parameters/cpu_user_cap"
.field private static final mCapLevel_Balanced:I = 0x4b0
.field private static final mCapLevel_FullPerf:I = 0x514
.field private static final mCapState_Balanced:I = 0x1
.field private static final mCapState_FullPerf:I = 0x0
.field private static final mCore_Cap_Level:Ljava/lang/String; = "/sys/kernel/tegra_cap/core_cap_level"
.field private static final mCore_Cap_State:Ljava/lang/String; = "/sys/kernel/tegra_cap/core_cap_state"
.field private static final mEnable_3D_Scaling:Ljava/lang/String; = "/sys/devices/host1x.0/gr3d/enable_3d_scaling"
.field private static final mMaxBoost:Ljava/lang/String; = "/sys/devices/system/cpu/cpufreq/interactive/max_boost"
.field private static final mMaxBoost_Balanced:I = 0x3d090
.field private static final mMaxBoost_FullPerf:I = 0x0
.field private static final mMaxSpeedLoad:Ljava/lang/String; = "/sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load"
.field private static final mMaxSpeedLoad_Balanced:I = 0x5f
.field private static final mMaxSpeedLoad_FullPerf:I = 0x55
.field private static final mScaling_Balanced:I = 0x1
.field private static final mScaling_FullPerf:I = 0x0
.field private static final mUserCap_Balanced:I = 0x124f80
.field private static final mUserCap_FullPerf:I = 0x0
.field private static final sysfsFileName:Ljava/lang/String; = "NV_SYSFSFN"
.field private static final sysfsName:Ljava/lang/String; = "NV_SYSFSWRITE"
.field private static final sysfsValueName:Ljava/lang/String; = "NV_SYSFSVALUE"
Click to expand...
Click to collapse
Nice! Can we just install that apk?
Sent from my HTC One X using XDA
na u need root access
Gold stuff man. We should messagge htc and tell them to change it
Sent From My HTC sensation (desire with rcmix s )

Trying and failing for a 3g/1x mod on LJ7.

I've been going through the NetworkController.smali in LJ7 trying to find the right "if-nez~" to # out to get a legit 3G/1X mod. Unfortunately there are 21 different instances of the bolded line below. I've compiled 21 different SystemUI.apk's to find the right one. In the area I live I generally don't have 3g which should make it easy for me to find which line is the right one. It's not... Not one of the ones I've flashed have given me the results I am looking for.
To any other dev out there, am I missing something or have I gotten it and just have really been on 3g all this time? (lol?) If anyone else has had success, would you mind telling me the ".line ####" to look for?
Code:
iget-boolean v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mShowAtLeastThreeGees:Z
if-nez v0, :cond_8
.line 2777
[B]sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_1X:[[I[/B]

[Q] Need to Suppress Wireless Charging Notification

There are some threads on this for other models, but I am looking for info on how to remove wireless charging notification for my Sprint version. I assume this will require root and I have no problem with that.
Here's the scenario. I modified my Sprint phone to accept the Verizon wireless charging rear cover, while preserving NFC. (Email me if you want the link cuz I don't have sufficient privileges to post it).
Placing the phone on the charger gives a pop-up notification and tone that wireless charging has begun. Then wireless charging is complete (100%) and charging stops. Then the phone sits on the charger for a few minutes, drops to 99% full and wireless charging begins again, meaning another beep. This is an endless cycle and the constant beeps are driving me crazy.
I have turned off all volumes, all notifications, placed on silent, etc., but the "Starting Wireless Charging" tone and notification is still present.
Really would like to get this fixed as inductive charging is awesome, but not if the phone is gonna beep every few minutes.
Does it bulge the battery cover slightly?
Just look for the mod to remove full charge notification, I believe all the different charging notis are housed in the same location. The VZW disable mod *should* also work as long as you do it manually and don't flash any zips with their updater script included.
I like to break stuff!
@freeza: I did a 10 minute mod to the Sprint phone using cooper conductive tape, so no soldering or opening the phone. Now it accepts the Verizon Wireless Charging back cover. So the cover is stock, its just Verizon, not Sprint. I can't post the link to my how-to (XDA rules), but just Google for "How to EASILY Add Inductive/Wireless Charging to your Sprint Phone Using Verizon Cover & Keeping NFC" and it is the first link.
@EViL-KoNCEPTz: I just successfully rooted today, never had the motivation before now but I absolutely have to get rid of this notification.
In researching this, I found the post quoted below -- by Freeza coincidentally. So now I just need to learn how to: (1) Get to the /com directory (that directory doesn't seem to be listed in my root explorer app); (2) learn how to compile; (3) learn how to push the compiled file to the phone and (4) learn how to change permissions. Of course, I'll also have to locate the "wireless charging begin" file, which is hopefully in the same location as you predict.
Lots to learn. Sucks being such a noob.
7/17/12: Remove battery full notification:
Navigate to /com/android/systemui/power/PowerUI$1.smali
LOOK FOR:
Code:
iget v14, v14, Lcom/android/systemui/power/PowerUI;->mBatteryStatus:I
if-ne v13, v14, :cond_1b3
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/systemui/power/PowerUI$1;->this$0:Lcom/android/systemui/power/PowerUI;
invoke-virtual {v13}, Lcom/android/systemui/power/PowerUI;->notifyFullBatteryNotification()V
:cond_da
:goto_da
const/4 v13, 0x4
REMOVE:
Code:
invoke-virtual {v13}, Lcom/android/systemui/power/PowerUI;->notifyFullBatteryNotification()V
Save & Close
Compile, push to /system/app/ and change permissions to 644 and reboot or create flashable zip to flash in recovery.
Click to expand...
Click to collapse
Actually, I'm not overly concerned with the pop-up message (""WIRELESS CHARGING: You have placed the device within range. Now charging wirelessly."). I really just need to suppress the corresponding alert tone.
With my new found root access, I looked around (system/media/audio/ui) and found many audio files, but not the one that is triggered when wireless charging begins. Should I be looking somewhere else or does this tone not use an ogg sound file?
SOLVED
I feel a little stupid, but will post this anyway in case someone else has the same problem. The beep was coming from the wireless charging pad, not the phone. Who knew? Opened up the pad, pulled the tiny speaker, put it back together and problem solved.
Note that you do have to delete charger_connection.ogg from /system/media/audio/ui to get rid of the phone sounds, or simply turn down the volume on notifications.
Many thanks to freeza who helped me back channel; he was the one who figured this out. He also created a mod to suppress the "wireless charging has begun" pop-up.
I had the same problem
I recently came across the XPosed framework and have developed a module for it that:
Prevents the screen from turning on when a charger is connected
Disables the wireless charging popup
Disables the beep when a charger is connected
Prevents the screen from turning on when the battery is full
I will post a module once I've got past the min 10 post limit on dev threads
In the meantime I hope this helps...
Code:
public class DisableWirelessChargingPopup implements IXposedHookLoadPackage
{
volatile PowerManager mPowerMgr;
volatile boolean mWakeUpEnabled = true;
[user=439709]@override[/user]
public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable
{
if (lpparam.packageName.equals("android"))
{
XposedBridge.log("handleLoadPackage: " + lpparam.packageName);
try
{
Class localClass = XposedHelpers.findClass("com.android.server.PowerManagerService$BatteryReceiver", lpparam.classLoader);
Object[] parameterTypesAndCallbackPower = new Object[3];
parameterTypesAndCallbackPower[0] = Context.class;
parameterTypesAndCallbackPower[1] = Intent.class;
parameterTypesAndCallbackPower[2] = XC_MethodReplacement.DO_NOTHING;
XposedHelpers.findAndHookMethod(localClass, "onReceive", parameterTypesAndCallbackPower);
XposedBridge.log("Hooked: PowerManagerService$BatteryReceiver");
}
catch (Exception e)
{
XposedBridge.log(e.toString());
}
}
if (lpparam.packageName.equals("com.android.systemui"))
{
XposedBridge.log("handleLoadPackage: " + lpparam.packageName);
try
{
Object[] parameterTypesAndCallbackWireless = new Object[2];
parameterTypesAndCallbackWireless[0] = Integer.TYPE;
parameterTypesAndCallbackWireless[1] = XC_MethodReplacement.DO_NOTHING;
//XposedHelpers.findAndHookMethod("com.android.systemui.power.PowerUI", lpparam.classLoader, "showWirelessChargingNotice", arrayOfObject);
XposedHelpers.findAndHookMethod("com.android.systemui.power.PowerUI",
lpparam.classLoader, "showWirelessChargeDialog", parameterTypesAndCallbackWireless);
XposedBridge.log("Hooked: " + lpparam.packageName + " showWirelessChargeDialog");
}
catch (Exception e)
{
XposedBridge.log(e.toString());
}
try
{
Object[] parameterTypesAndCallbackPlaySound = new Object[2];
parameterTypesAndCallbackPlaySound[0] = Integer.TYPE;
parameterTypesAndCallbackPlaySound[1] = XC_MethodReplacement.DO_NOTHING;
XposedHelpers.findAndHookMethod("com.android.systemui.power.PowerUI",
lpparam.classLoader, "playSound", parameterTypesAndCallbackPlaySound);
XposedBridge.log("Hooked: " + lpparam.packageName + " playSound");
}
catch (Exception e)
{
XposedBridge.log(e.toString());
}
try
{
XposedHelpers.findAndHookMethod("com.android.systemui.power.PowerUI",
lpparam.classLoader, "notifyFullBatteryNotification",
XC_MethodReplacement.DO_NOTHING);
}
catch (Exception e)
{
XposedBridge.log(e.toString());
}
}
}
}

Disable end call beep

The end call beep is EXTREMELY loud when connected via bluetooth to a car or headset I haven't measured but I'd have to say it is in the 80-90 db range on my cars. Anyone know how to disable it? I've done a google search and while the question is common, the answer seems elusive. I've seen one solution that was a modified Phone.apk file. I went looking for the M9's Phone.apk but haven't found it in system/app or priv-app. Some older android version seem to have a setting option to turn it off but it is sporadic and no where to be found on the M9. Others have suggested a play store app but the app only adds an end call notification, it doesn't stop the existing one.
I believe I've located the offending piece of code. It is in the telephony.apk. Who can modify the attached apk to remove the beep? I'm guessing you would be able to simply set the TONE_CALL_ENDED integer to 0. The apk is from @andybones stock deodexed rom.
l7777 said:
I believe I've located the offending piece of code. It is in the telephony.apk. Who can modify the attached apk to remove the beep? I'm guessing you would be able to simply set the TONE_CALL_ENDED integer to 0. The apk is from @andybones stock deodexed rom.
Click to expand...
Click to collapse
I don't see "TONE_CALL_ENDED" in integers.xml
Well that's no good. I was hoping it would be an easy change. Found an online decompliler and fed it the telephony.apk. The TONE_CALL_ENDED variable was defined in the CallNotifier.java file. I'm learning as I go here so I'm not sure I'm giving useful info. Just found apkstudio and am now poking through it to see what I can find.
I have the telephony.apk decompiled and found the variable definition in:
smali/com/android/phone/CallNotifier$InCallTonePlayer
I must be missing something trying to recompile though. I get told there are some missing resources.
l7777 said:
I have the telephony.apk decompiled and found the variable definition in:
smali/com/android/phone/CallNotifier$InCallTonePlayer
I must be missing something trying to recompile though. I get told there are some missing resources.
Click to expand...
Click to collapse
What changes did you make in that smali? I'll check it out when home in a few hours.
andybones said:
What changes did you make in that smali? I'll check it out when home in a few hours.
Click to expand...
Click to collapse
There is a variable defined named TONE_CALL_ENDED with a value of 0x5. I just changed it to 0x0 to match TONE_NONE.
I did finally get it to compile but when I replaced the original I had no service, didn't look like it even loaded the replacement apk. Not sure what happened there.
l7777 said:
There is a variable defined named TONE_CALL_ENDED with a value of 0x5. I just changed it to 0x0 to match TONE_NONE.
I did finally get it to compile but when I replaced the original I had no service, didn't look like it even loaded the replacement apk. Not sure what happened there.
Click to expand...
Click to collapse
I'm back on m8 ATM, but I'll give same method a try on m8 and If I get it port over to m9.
andybones said:
I'm back on m8 ATM, but I'll give same method a try on m8 and If I get it port over to m9.
Click to expand...
Click to collapse
If you get it to work on the M8 I'll test it too. It'll make my wife happy. She has the same complaint. Where do I look to see why it didn't like my recomplied apk? I didn't see anything obvious in the logcat.
l7777 said:
If you get it to work on the M8 I'll test it too. It'll make my wife happy. She has the same complaint. Where do I look to see why it didn't like my recomplied apk? I didn't see anything obvious in the logcat.
Click to expand...
Click to collapse
I believe it had something to do in the last method of the smali file ".method public stopTone()V", but not too sure, i tried changing a few things but couldn't get it, sorry my friend.
andybones said:
I believe it had something to do in the last method of the smali file ".method public stopTone()V", but not too sure, i tried changing a few things but couldn't get it, sorry my friend.
Click to expand...
Click to collapse
Figures it wouldn't be easy. I can't believe no one at google or HTC thought that a loud tone at the end of every call would be a good idea.
Potential progress. If I comment
Code:
invoke-virtual {v1, v3}, Landroid/media/ToneGenerator;->startTone(I)Z
or
Code:
[STRIKE]invoke-direct {v1, p0}, Lcom/android/phone/CallNotifier$InCallTonePlayer$1;-><init>(Lcom/android/phone/CallNotifier$InCallTonePlayer;)V[/STRIKE]
in the CallNotifier$InCallTonePlayer.smali, the tone does not play. I have noticed that the speaker phone selection does not get reset now when I end a call. Not sure what else may be going on yet. It looks like commenting startTone prevents the tone from playing and doesn't cause any other side effects. I haven't tested yet but I'm guessing it will also not play call waiting tones. I will report once I test it.
l7777 said:
Potential progress. If I comment
Code:
invoke-virtual {v1, v3}, Landroid/media/ToneGenerator;->startTone(I)Z
or
Code:
[STRIKE]invoke-direct {v1, p0}, Lcom/android/phone/CallNotifier$InCallTonePlayer$1;-><init>(Lcom/android/phone/CallNotifier$InCallTonePlayer;)V[/STRIKE]
in the CallNotifier$InCallTonePlayer.smali, the tone does not play. I have noticed that the speaker phone selection does not get reset now when I end a call. Not sure what else may be going on yet. It looks like commenting startTone prevents the tone from playing and doesn't cause any other side effects. I haven't tested yet but I'm guessing it will also not play call waiting tones. I will report once I test it.
Click to expand...
Click to collapse
Confirmed, no call waiting tones either. Ideally we'd need an if statement and only invoke startTone when something other than the end call tone is selected. My smali skills are not up to that yet. I also can't seem to get things to output to the debug log to see what v1 and v3 are. If I can work that out then it should be possible.
Nice work my friend . :good:
Solution
Got it. If anyone wants to implement it, here's how I did it. I modified the run method of the CallNotifier$InCallTonePlayer class. The tone id for my M9 is to be 27. I got this by spitting the tone ids out to the debug log. For reference the call waiting tone is 22.
To start I bumped the .locals by 1 so I didn't have to worry about clobbering another register that was in use. This was on line 269 for me.
Code:
.method public run()V
.locals 13
#Was locals 12, upped to disable the end call tone
.prologue
const/16 v4, 0x25
const/4 v10, 0x2
const/4 v5, 0x1
const/4 v2, 0x0
const/16 v0, 0x50
The rest of the edits are around the call to startTone around line 630
Code:
const/16 v12, 0x1b
if-eq v3, v12, :cond_20
invoke-virtual {v1, v3}, Landroid/media/ToneGenerator;->startTone(I)Z
:cond_20
The code will now skip the startTone call if the tone id (v3) is 27. The resulting apk is attached, feel free to use it. I verified and now get call waiting tones but no end call tone. If you want to use it just replace your existing apk in recovery. Be careful of permissions if you do this.
3.37.605.7 (Marshmallow) has changed things up a bit. The run method starts around line 295 and already has locals a 13 so we bump to 14.
Code:
.method public run()V
.method public run()V
.locals 14
.prologue
.line 2611
# getter for: Lcom/android/phone/CallNotifier;->VDBG:Z
invoke-static {}, Lcom/android/phone/CallNotifier;->access$600()Z
move-result v10
if-eqz v10, :cond_0
The call to startTone is now around line 681 and some variables changed registers.
Code:
.line 2863
const/16 v13, 0x1b
if-eq v8, v13, :cond_20
invoke-virtual {v6, v8}, Landroid/media/ToneGenerator;->startTone(I)Z
:cond_20
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
Modified Telephony.apk attached.
3.37.605.13 added.
Could you do another upgrade for the Nougat App?
I do have this deafening End Call tone and it is always ringing out my eardrums.
what is the apk that controls the end call tone in Lineage Os system.
Because there is no telephony.apk file
Yes, if this is fixable in lineage nougat, that would be just awesome!

Categories

Resources