- We need Backsmali/smali program to do this method.
- Put SamsungCamera.apk in Backsmali folder and follow its guide to have classout folder in the end.
Adding "Shutter Sound On/Off" option in Camera Menu:
1. Go to classout\com\sec\android\app\camera\resourcedata\ folder and open
CameraSettingsMenuResourceData.smali file.
2. To locate the lines that we will edit, search for"
CscFeature_Camera_ShutterSoundMenu".
3. Now delete all these 6 lines:
Code:
invoke-static {}, Lcom/sec/android/app/CscFeature;->getInstance()Lcom/sec/android/app/CscFeature;
move-result-object v2
const-string v3, "CscFeature_Camera_ShutterSoundMenu"
invoke-virtual {v2, v3}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_f8
Camera can be used with flash in low battery state:
1. Go to classout\com\sec\android\app\camera\ folder and open
AbstractCameraActivity.smali file.
2. Search for "
.method protected handleLowBattery(Z)V" and add the following line (the blue line):
Code:
.method protected handleLowBattery(Z)V
.registers 5
.parameter "temp"
.prologue
.line 2072
[COLOR="Blue"][B]return-void[/B][/COLOR]
const-string v1, "AbstractCameraActivity"
3. Now save changes and go to classout\ com\sec\android\app\camera\ folder and open
Camera.smali file.
4. Search for "
.method private handleBatteryChanged(Landroid/content/Intent;)V" and look for the lines that have "
handleLowBattery(Z)V" and "
handlePluggedLowBattery(Z)V" after this method and delete the whole lines:
Code:
invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->handleLowBattery()V
invoke-direct {p0, v6}, Lcom/sec/android/app/camera/Camera;->handlePluggedLowBattery(Z)V
invoke-direct {p0, v6}, Lcom/sec/android/app/camera/Camera;->handlePluggedLowBattery(Z)V
5. Still in
Camera.smali file, search for "
.method private handlePluggedLowBattery(Z)V" and add the following line (the blue line):
Code:
.method private handlePluggedLowBattery(Z)V
.registers 7
.parameter "temp"
.prologue
const/4 v4, 0x3
const/4 v3, 0x0
.line 6238
[B][COLOR="Blue"]return-void[/COLOR][/B]
const-string v1, "Camera"
Camera focus sound disabled:
1. Go to classout\com\sec\android\app\camera\ folder and open
Camera.smali file.
2. Search for "
.method public playCameraSound(II)V" and add the following line (the blue line):
Code:
.method public playCameraSound(II)V
.registers 12
.parameter "Sound"
.parameter "loop"
.prologue
const/4 v4, 0x0
const/high16 v6, 0x3f80
.line 4870
[B][COLOR="Blue"]return-void[/COLOR][/B]
iget-object v0, p0, Lcom/sec/android/app/camera/Camera;->mSoundPool:Landroid/media/SoundPool;
Camera Volume Up/Down and power buttons as a shutter:
1. Go to classout\com\sec\android\app\camera\ folder and open
Camera.smali file.
2. Search for "
. method public onKeyDown(ILandroid/view/KeyEvent;)Z" and look for "
.sparse-switch" at the end of this method.
3. Here you will see several
:sswitch definitions. See the one for
0x17, it is the touch shutter button and is defined as
:sswitch_??. So simply we need to make
:sswitch that are defined to volume up/down and power buttons to read the same as the one defined to the touch shutter button. Here
0x18 is for volume up;
0x19 is for volume down, and
0x1a is for power button.
4. So now change these
:sswitch for these buttons to read as same as that for the touch shutter button. See example bellow:
Before:
Code:
:sswitch_data_2a0
.sparse-switch
0x4 -> :sswitch_95
[B][COLOR="Blue"]0x17 -> :sswitch_f7[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
[B][COLOR="Red"]0x18 -> :sswitch_238[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
[B][COLOR="Red"]0x19 -> :sswitch_238[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
[B][COLOR="Red"]0x1a -> :sswitch_95[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
0x1b -> :sswitch_f7
0x42 -> :sswitch_f7
0x45 -> :sswitch_238
0x46 -> :sswitch_238
0x50 -> :sswitch_9b
0x52 -> :sswitch_93
0x55 -> :sswitch_98
0x59 -> :sswitch_98
0x5a -> :sswitch_98
0x9c -> :sswitch_238
0x9d -> :sswitch_238
.end sparse-switch
.end method
After:
Code:
:sswitch_data_2a0
.sparse-switch
0x4 -> :sswitch_95
[COLOR="Blue"][B]0x17 -> :sswitch_f7[/B][/COLOR] [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
[B][COLOR="Red"]0x18 -> :sswitch_f7[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
[B][COLOR="Red"]0x19 -> :sswitch_f7[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
[B][COLOR="Red"]0x1a -> :sswitch_f7[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
0x1b -> :sswitch_f7
0x42 -> :sswitch_f7
0x45 -> :sswitch_238
0x46 -> :sswitch_238
0x50 -> :sswitch_9b
0x52 -> :sswitch_93
0x55 -> :sswitch_98
0x59 -> :sswitch_98
0x5a -> :sswitch_98
0x9c -> :sswitch_238
0x9d -> :sswitch_238
.end sparse-switch
.end method
5. Now search for "
. method public onKeyUp(ILandroid/view/KeyEvent;)Z" and look for "
.sparse-switch" at the end of this method.
6. Again you will see several
:sswitch definitions. See the one for
0x17, it is the touch shutter button and is defined as
:sswitch_??. And yes as you can figure out
0x18 is for volume up,
0x19 is for volume down and
0x1a is for power button.
7. So now change these
:sswitch for these buttons to read as same as that for the touch shutter button. See example bellow:
Before:
Code:
.line 2172
.sparse-switch
0x3 -> :sswitch_25f
0x4 -> :sswitch_60
[B][COLOR="Blue"]0x17 -> :sswitch_11e[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
[B][COLOR="Red"]0x18 -> :sswitch_209[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
[B][COLOR="Red"]0x19 -> :sswitch_209[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
[B][COLOR="Red"]0x1a -> :sswitch_209[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
0x1b -> :sswitch_11e
0x42 -> :sswitch_11e
0x50 -> :sswitch_20c
0x52 -> :sswitch_e5
.end sparse-switch
After:
Code:
.line 2172
.sparse-switch
0x3 -> :sswitch_25f
0x4 -> :sswitch_60
[B][COLOR="Blue"]0x17 -> :sswitch_11e[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is the touch shutter button[/COLOR]
[B][COLOR="Red"]0x18 -> :sswitch_11e[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume up button[/COLOR]
[B][COLOR="Red"]0x19 -> :sswitch_11e[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is volume down button[/COLOR]
[B][COLOR="Red"]0x1a -> :sswitch_11e[/COLOR][/B] [COLOR="DarkGreen"]<!-- this is power button[/COLOR]
0x1b -> :sswitch_11e
0x42 -> :sswitch_11e
0x50 -> :sswitch_20c
0x52 -> :sswitch_e5
.end sparse-switch
Camcorder can be used with flash in low battery state:
1. Go to classout\com\sec\android\app\camera\ folder and open
Camcorder.smali file.
2. Search for "
.method protected handleLowBattery(Z)V" and add the following line (the blue one):
Code:
.method protected handleLowBattery(Z)V
.registers 4
.parameter "temp"
.prologue
.line 3267
[B][COLOR="Blue"]return-void[/COLOR][/B]
const-string v0, "Camcorder"
3. Still in
Camcorder.smali file, search for "
.method private handleBatteryChanged(Landroid/content/Intent;)V" and look for lines that have "
handleLowBattery(Z)V" and "
handlePluggedLowBattery(Z)V" after this method and delete the whole lines:
Code:
invoke-virtual {p0}, Lcom/sec/android/app/camera/Camcorder;->handleLowBattery(Z)V
invoke-direct {p0, v7}, Lcom/sec/android/app/camera/Camcorder;->handlePluggedLowBattery(Z)V
invoke-direct {p0, v7}, Lcom/sec/android/app/camera/Camcorder;->handlePluggedLowBattery(Z)V
4. Still in
Camcorder.smali file, search for "
.method private handlePluggedLowBattery(Z)V" and add the following line (the blue one):
Code:
.method private handlePluggedLowBattery(Z)V
.registers 7
.parameter "temp"
.prologue
const/16 v4, 0x67
const/4 v3, 0x0
.line 4351
[B][COLOR="Blue"]return-void[/COLOR][/B]
const-string v1, "Camcorder"
Camcorder Better audio quality and video bitrate:
1. Go to classout\com\sec\android\app\camera\ folder and open
MediaRecorderProfile.smali file.
2. Modify the first 4 arrays to be exactly like the followings (the blue lines only):
Code:
:array_11c
.array-data 0x4
[B][COLOR="Blue"] 0x2t 0x0t 0x0t 0x0t
0x80t 0xc3t 0xc9t 0x1t
0x0t 0x36t 0x6et 0x1t
0x40t 0x66t 0x3t 0x1t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0xeet 0x2t 0x0t
0x2t 0x0t 0x0t 0x0t
0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
.end array-data
:array_134
.array-data 0x4
[B][COLOR="Blue"] 0x2t 0x0t 0x0t 0x0t
0x40t 0x66t 0x3t 0x1t
0x40t 0x5dt 0xc6t 0x0t
0x40t 0x54t 0x89t 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0xeet 0x2t 0x0t
0x2t 0x0t 0x0t 0x0t
0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
.end array-data
:array_14c
.array-data 0x4
[B][COLOR="Blue"] 0x2t 0x0t 0x0t 0x0t
0xa8t 0xa0t 0x34t 0x0t
0x50t 0x3et 0x2bt 0x0t
0x90t 0x10t 0x23t 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0xeet 0x2t 0x0t
0x2t 0x0t 0x0t 0x0t
0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
.end array-data
:array_164
.array-data 0x4
[B][COLOR="Blue"] 0x2t 0x0t 0x0t 0x0t
0x70t 0xf7t 0x2et 0x0t
0xa8t 0xf4t 0x26t 0x0t
0xb8t 0xcet 0x1et 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0xeet 0x2t 0x0t
0x2t 0x0t 0x0t 0x0t
0x80t 0xbbt 0x0t 0x0t[/COLOR][/B]
.end array-data
- Save changes, recompile (smali) your apk. You will get "classes.dex" and with 7-zip, open the archive of the original SamsungCamera.apk. Then drag and drop the classes.dex into SamsungCamera.apk. and push it to your phone.