4th November 2011, 07:40 AM
Junior Member -
OP
Thanks Meter
19
Posts: 3
Join Date: Jun 2007
[HOWTO] Finally! a REAL solution to disable noise reduction
I searched a solution to disable NR in the beginning of the call. I had an echo problem in my phone, and the only way to fix it was to disable the NR.
The problem - each time you place or answer a call we need to go to menu and disable it.
All the codes that posted here didn't disable the NR. they only disabled the menu.
After digging for a few days in the smali of the Phone.apk I found the solution -
You need to edit CallNotifier.smali -
Search for - turnOnNoiseSuppression and rem the line
In my case it looks like this.
Code:
.line 957
.local v3, noise_reduction:Z
iget-object v8, p0, Lcom/android/phone/CallNotifier;->mApplication:Lcom/android/phone/PhoneApp;
const/4 v9, 0x1
# invoke-static {v8, v3, v9}, Lcom/android/phone/PhoneUtils;->turnOnNoiseSuppression(Landroid/content/Context;ZZ)V
And in PhoneApp$PhoneAppBroadcastReceiver.smali (not all APk's needs it)-
Code:
.line 1930
sget-object v1, Lcom/android/phone/PhoneUtils$AMRState;->WB:Lcom/android/phone/PhoneUtils$AMRState;
invoke-static {v1}, Lcom/android/phone/PhoneUtils;->setAMRCodec(Lcom/android/phone/PhoneUtils$AMRState;)V
.line 1940
:goto_9
iget-object v1, p0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;->this$0:Lcom/android/phone/PhoneApp;
invoke-virtual {v1}, Lcom/android/phone/PhoneApp;->getApplicationContext()Landroid/content/Context;
move-result-object v1
invoke-static {v1}, Lcom/android/phone/PhoneUtils;->isSupportedNoiseReductionInWBMode(Landroid/content/Context;)Z
move-result v1
if-nez v1, :cond_21
if-ne v0, v5, :cond_21
iget-object v0, p0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;->this$0:Lcom/android/phone/PhoneApp;
invoke-virtual {v0}, Lcom/android/phone/PhoneApp;->getApplicationContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lcom/android/phone/PhoneUtils;->isNoiseSuppressionOn(Landroid/content/Context;)Z
move-result v0
if-ne v0, v5, :cond_21
.line 1943
iget-object v0, p0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;->this$0:Lcom/android/phone/PhoneApp;
invoke-virtual {v0}, Lcom/android/phone/PhoneApp;->getApplicationContext()Landroid/content/Context;
move-result-object v0
# invoke-static {v0, v4, v4}, Lcom/android/phone/PhoneUtils;->turnOnNoiseSuppression(Landroid/content/Context;ZZ)V
Different apk's versions may have different line number and variables numbers.
This change will make the phone starts calls with NR off. (may not work in the first call after the phone boots up - looking for a fix)
you can still turn it on if you want, during the call
Enjoy!
The Following 19 Users Say Thank You to drorsi For This Useful Post: [ Click to Expand ]
aDEO (4th November 2011),
aquariuzism (19th December 2011),
bcool15 (5th November 2011),
CalilouOuvaha (4th November 2011),
ctomgee (15th November 2011),
elady58 (23rd June 2012),
eseregin (16th November 2011),
fibrook (16th November 2011),
GadgetCheck (15th November 2011),
hgroove (16th November 2011),
leon0602 (23rd April 2012),
mohcivil (20th December 2011),
neboy (24th April 2012),
newHere:) (29th November 2011),
ronnbon (4th December 2011),
sangosnip69 (14th December 2011),
turnado (26th January 2012),
x625 (21st April 2012),
yay1974 (14th November 2011)
14th November 2011, 08:03 PM
Senior Member
Thanks Meter
894
Posts: 3,540
Join Date: Dec 2010
This is driving me insane.
I cannot, for the life of me, get a smali folder when I decompile Phone.apk. I've tried using APKManager 4.9, and directly using APKTool.
Using APKManager, I set my project, decompile with dependencies, drag twframework-res.apk when asked.
Using APKTool, I type:
apktool d Phone.apk
Both methods, all I get are a res folder, AndroidManifest.xml, and apktool.yml.
Is there something I am missing?
14th November 2011, 08:07 PM
Recognized Developer
Thanks Meter
1565
Posts: 1,597
Join Date: Mar 2010
Location: Athens
DONATE TO ME
Quote:
Originally Posted by
ctomgee
This is driving me insane.
I cannot, for the life of me, get a smali folder when I decompile Phone.apk. I've tried using APKManager 4.9, and directly using APKTool.
Using APKManager, I set my project, decompile with dependencies, drag twframework-res.apk when asked.
Using APKTool, I type:
apktool d Phone.apk
Both methods, all I get are a res folder, AndroidManifest.xml, and apktool.yml.
Is there something I am missing?
Yeah, you're missing the fact that your ROM is probably odexed and not deodexed.
The Following User Says Thank You to petsasj For This Useful Post: [ Click to Expand ]
14th November 2011, 08:13 PM
(Last edited by ctomgee; 14th November 2011 at 08:15 PM .)
Senior Member
Thanks Meter
894
Posts: 3,540
Join Date: Dec 2010
Quote:
Originally Posted by
petsasj
Yeah, you're missing the fact that your ROM is probably odexed and not deodexed.
Such a simple answer... *sigh*
You are correct. So how can I edit the .smali file of an odexed Phone.apk?
EDIT: Nevermind... I supposed I can just find a deodexed Phone.apk to make the change on, yeah?
14th November 2011, 08:18 PM
Recognized Developer
Thanks Meter
1565
Posts: 1,597
Join Date: Mar 2010
Location: Athens
DONATE TO ME
Quote:
Originally Posted by
ctomgee
Such a simple answer... *sigh*
You are correct. So how can I edit the .smali file of an odexed Phone.apk?
EDIT: Nevermind... I supposed I can just find a deodexed Phone.apk to make the change on, yeah?
Finding a deodexed Phone.apk is probably easiest fo you. I don't think you're accustomed to smali/baksmali deodexing procedures? There's a nice How-To by sicopat, but still, get a deodexed Phone.apk
The Following User Says Thank You to petsasj For This Useful Post: [ Click to Expand ]
14th November 2011, 08:21 PM
(Last edited by ctomgee; 14th November 2011 at 08:36 PM .)
Senior Member
Thanks Meter
894
Posts: 3,540
Join Date: Dec 2010
Quote:
Originally Posted by
petsasj
Finding a deodexed Phone.apk is probably easiest fo you. I don't think you're accustomed to smali/baksmali deodexing procedures? There's a nice How-To by sicopat, but still, get a deodexed Phone.apk
Just started learning about deodexing, yeah. I think I've found a deodexed Phone.apk for my ROM version, thanks for your help.
14th November 2011, 08:26 PM
Senior Member
Thanks Meter
272
Posts: 1,162
Join Date: Jun 2011
Location: Darkness
thanks but what about MIUI and CM7 roms?
i have echo problem in these roms!
cheers,
SX
14th November 2011, 09:22 PM
Senior Member
Thanks Meter
227
Posts: 1,522
Join Date: Dec 2009
Location: Wellington
DONATE TO ME
Quote:
Originally Posted by
SignalX
thanks but what about MIUI and CM7 roms?
i have echo problem in these roms!
cheers,
SX
Have you looked to see if that same line is in the file?
---
Spelling essentials:
1) There is NO SUCH WORD as "alot " - It's "a lot "
2) The shortened form of You are is You're - NOT Your
3) Loosing & Loose have completely different meanings to Losing & Lose .
The Following User Says Thank You to knightnz For This Useful Post: [ Click to Expand ]
14th November 2011, 09:26 PM
Senior Member
Thanks Meter
21
Posts: 207
Join Date: Aug 2011
Anyone can confirm it really works?
Thank you for the solution but can anyone post deodexed phone.apk with this solution here (xxki4 or xwkj3)?
14th November 2011, 10:39 PM
Senior Member
Thanks Meter
894
Posts: 3,540
Join Date: Dec 2010
Quote:
Originally Posted by
yay1974
Thank you for the solution but can anyone post deodexed phone.apk with this solution here (xxki4 or xwkj3)?
I can confirm that it DOES work. I was able to edit a deodexed Phone.apk from XXKI3, and now it defaults NR to being OFF during calls. (though, as drorsi states in the OP, it is still on for the first call after the phone boots). You still have the option of turning it on during the call if you wish.
You can find what you need to know on how to decompile/recompile .apk files at
http://forum.xda-developers.com/showthread.php?t=695701 .
Thread Tools
Search this Thread
Display Modes
Linear Mode
Most Thanked In This Thread
5 Most ROM have a slightly
different … 3 update for ics 4.0.3 (quote) for ICS …3 (quote)
Guys, there's
too many … 2 (quote)
The answer has
already been … 2 (quote)
I made the
changes, using …