Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,769,248 Members 39,321 Now Online
XDA Developers Android and Mobile Development Forum

[MOD][Camera][JB/ICS][v8][10/01] Power and Volume buttons as a shutter and more

Tip us?
 
jobnik
Old
(Last edited by jobnik; 10th January 2013 at 04:35 PM.)
#1  
jobnik's Avatar
Senior Member - OP
Thanks Meter 526
Posts: 125
Join Date: Mar 2010
Location: Tel-Aviv

 
DONATE TO ME
Camera [MOD][Camera][JB/ICS][v8][10/01] Power and Volume buttons as a shutter and more

Hi,

This is my first MOD

Latest update 10/01/2013
  • ICS version updated to v8 and based on 4.0.4 UHLPY firmware.
  • Volume and Power keys as a shutter.
  • Volume keys as shutter in Camcorder as follows: Volume Up start recording, Volume Down stop recording.
  • Power key as shutter in Camcorder will just start recording.
  • Shutter sound should be off/on in all cases in Camera according to menu selection, let me know if it doesn't work.
update 26/12/2012
  • JB version updated to v8 and based on latest S2 JB 4.1.2 XWLSJ firmware.
  • Volume and Power keys as a shutter (no burst shot with volume/power keys).
  • Volume keys as shutter in Camcorder as follows: Volume Up start recording, Volume Down stop recording.
  • Power key as shutter in Camcorder will just start recording.
  • Shutter sound will be off/on in all cases in Camera according to menu selection.
Notes:
  • It's only for Samsung Stock / Custom JB/ICS ROMs
  • To make it run on ODEXED JB ROMs, backup and remove the SamsungCamera.odex file from system/app (the script should do it automatically).
  • To make it run on ODEXED ICS ROMs, backup and remove the Camera.odex file from system/app (the script should do it automatically).
  • Using power button as a shutter will show the power menu as well, but it will take a picture / start recording, just wait until it vibrates
  • DO NOT install JB mod on ICS ROM and vice-versa! it simply won't work
What's inside?:
  1. Camera "Unable to start while in a call" Alert Disabled
  2. Camera "Low Battery" Alert Disabled
  3. Camera "Can't use flash on low battery" Alert Disabled
  4. Camera Power and Volume keys as a shutter (The Power menu will popup as well, but it will take a picture, just wait until it vibrates.)
  5. Camera Enable "Shutter Sound On/Off" permanently
  6. Camera "Action shot" shooting mode Volume keys as a shutter
  7. Camera "Panorama" shooting mode Volume keys as a shutter
  8. Camera "Timer" shooting mode Volume keys as a shutter (JB)
  9. Camera "Self-shot" shooting mode Volume keys as a shutter (ICS)
  10. Camcorder "Unable to record while in a call" Alert Disabled
  11. Camcorder "Can't use flash on low battery" Alert Disabled
  12. Camcorder "Low Battery" Alert Disabled
  13. Camcorder Volume and Power keys as a shutter (The Power menu will popup as well, but it will start recording, just wait until it vibrates.)
  14. Camcorder Better audio quality/video bitrate
    • Video Quality:
      1080p: Normal - 17MBit / Fine - 24MBit / Superfine - 30MBit
      720p: Normal - 9MBit / Fine - 13MBit / Superfine - 17MBit
    • Sound Quality:
      192 kbit/s
      48000 KHz
JB SamsungCamera app
Quote:
Download CWM recovery file and install:
http://www.jobnik.org/files/apk/s2/j...MOD_v8_cwm.zip

Or

Download SamsungCamera.apk and push it to system/app, then change permissions to 644
http://www.jobnik.org/files/apk/s2/SamsungCamera.apk

Having problems recording in 1080p format? Use this one, that uses the default MediaRecorderProfile.smali
http://www.jobnik.org/files/apk/s2/j..._media_cwm.zip

For those who want to restore to original version, that comes with ROM:
http://www.jobnik.org/files/apk/s2/r..._S2_JB_cwm.zip
Changes I've made in smali files are:
Code:
Camera MOD v8 by jobnik (Arthur):
---------------------------------
Files to be changed:
	com\sec\android\app\camera\AbstractCameraActivity.smali
	com\sec\android\app\camera\Camcorder.smali
	com\sec\android\app\camera\Camera.smali
	com\sec\android\app\camera\CameraEngine$AutoFocusCallback.smali
	com\sec\android\app\camera\CameraEngine.smali
	com\sec\android\app\camera\CameraSettings.smali
	com\sec\android\app\camera\MediaRecorderProfile.smali
	com\sec\android\app\camera\glwidget\TwGLActionMenu.smali
	com\sec\android\app\camera\glwidget\TwGLPanoramaMenu.smali
	com\sec\android\app\camera\glwidget\TwGLTimerMenu.smali
	com\sec\android\app\camera\resourcedata\CameraSettingsMenuResourceData.smali
	com\sec\android\app\camera\resourcedata\EditableResourceDataBase.smali	

----------------
 Camera
----------------

1. Camera "Unable to start while in a call" Alert Disabled
   -------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\AbstractCameraActivity.smali
		com\sec\android\app\camera\CameraEngine.smali
	* METHOD:
		.method protected checkCameraDuringCall()V
		.method public doTakePictureAsync()V
		.method public getShutterSoundEnable()Z
		.method public setShutterSoundEnable(Z)V
	* REMOVED these lines or similar in all files and methods above:
		invoke-static {}, Lcom/sec/android/app/CscFeature;->getInstance()Lcom/sec/android/app/CscFeature;

		move-result-object v1

		const-string v2, "CscFeature_Camera_EnableCameraDuringCall"

		invoke-virtual {v1, v2, v0}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;Z)Z

		move-result v1

		if-eqz v1, :cond_29
	* WHERE?:
	* EXPLANATION:
		Remove "if" condition, that check if "CscFeature_Camera_EnableCameraDuringCall" is enabled in "system/csc/others.xml" or "system/csc/features.xml"
		That way we permanently enable Camera and disable shutter sound during Call.

2. Camera "Low Battery" Alert Disabled
   -----------------------------------
	* FILE:
		com\sec\android\app\camera\AbstractCameraActivity.smali
	* METHOD:
		.method protected handleLowBattery(Z)V
	* ADDED new line:
		return-void
	* WHERE?:
		.prologue
		.line 2013
		return-void
		const-string v1, "AbstractCameraActivity"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method

3. Camera "Can't use flash on low battery" Alert Disabled
   ------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camera.smali
	* METHOD:
		.method private handlePluggedLowBattery(Z)V
	* ADDED new line:
		return-void
	* WHERE?:
		.line 5983
		return-void
		const-string v1, "Camera"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method

4. Camera Power and Volume keys as a shutter
   -----------------------------------------
	* FILE:
		com\sec\android\app\camera\Camera.smali
	* METHOD:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
	* MODIFIED switch case:
		:sswitch_data_2a8
		.sparse-switch
			0x4 -> :sswitch_95
			0x17 -> :sswitch_f7
				0x18 -> :sswitch_f7
				0x19 -> :sswitch_f7
				0x1a -> :sswitch_f7
			0x1b -> :sswitch_f7
			0x42 -> :sswitch_f7
			0x45 -> :sswitch_240
			0x46 -> :sswitch_240
			0x50 -> :sswitch_9b
			0x52 -> :sswitch_93
			0x55 -> :sswitch_98
			0x59 -> :sswitch_98
			0x5a -> :sswitch_98
			0x9c -> :sswitch_240
			0x9d -> :sswitch_240
		.end sparse-switch
	* EXPLANATION:
		0x18 is volume up key, 0x19 is volume down key, 0x1a is a power key.
		We are telling this switch cases to link to "sswitch_f7" and act the same as shutter key, that is 0x17.
	----------
	* METHOD:
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* MODIFIED switch case:
		:sswitch_data_278
		.sparse-switch
			0x4 -> :sswitch_60
			0x17 -> :sswitch_11e
				0x18 -> :sswitch_11e
				0x19 -> :sswitch_11e
				0x1a -> :sswitch_11e
			0x1b -> :sswitch_11e
			0x42 -> :sswitch_11e
			0x50 -> :sswitch_21e
			0x52 -> :sswitch_e5
		.end sparse-switch
	* EXPLANATION:
		0x18 is volume up key, 0x19 is volume down key, 0x1a is a power key.
		We are telling this switch cases to link to "sswitch_11e" and act the same as shutter key, that is 0x17.

5. Camera Enable "Shutter Sound On/Off" permanently
   ------------------------------------------------
	* FILES:
		com\sec\android\app\camera\Camera.smali
		com\sec\android\app\camera\CameraEngine$AutoFocusCallback.smali
		com\sec\android\app\camera\CameraEngine.smali
		com\sec\android\app\camera\CameraSettings.smali
		com\sec\android\app\camera\resourcedata\CameraSettingsMenuResourceData.smali
		com\sec\android\app\camera\resourcedata\EditableResourceDataBase.smali
	* METHODS:
		.method public playCameraSound(II)V
		.method public onAutoFocus(ILcom/sec/android/seccamera/SecCamera;)V
		.method public initialize()V
		.method private resetCameraGlobalSettings()V
		.method public setDefaultCameraEditableShortcutOrder()V
		.method private initCommandIdList(Lcom/sec/android/app/camera/AbstractCameraActivity;)V
		.method public resetOrder(Ljava/lang/String;)V
	* REMOVED these lines or similar in all files and methods above:
		invoke-static {}, Lcom/sec/android/app/CscFeature;->getInstance()Lcom/sec/android/app/CscFeature;

		move-result-object v0

		const-string v1, "CscFeature_Camera_ShutterSoundMenu"

		invoke-virtual {v0, v1}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;)Z

		move-result v0

		if-eqz v0, :cond_9d
	* WHERE?:
	* EXPLANATION:
		Remove "if" condition, that check if "CscFeature_Camera_ShutterSoundMenu" is enabled in "system/csc/others.xml" or "system/csc/features.xml"
		That way we permanently enable "Shutter Sound On/Off" feature.

6. Camera "Action shot" shooting mode Volume keys as a shutter
   -----------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\glwidget\TwGLActionMenu.smali
	* METHODS:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED new line:
		goto :cond_c
	* WHERE?:
		.line 213
		goto :cond_c
		const/16 v1, 0x18
		if-eq p1, v1, :cond_b

		const/16 v1, 0x19
		if-ne p1, v1, :cond_c
	* EXPLANATION:
		Jump below "if" conditions that check if volume keys are pressed

7. Camera "Panorama" shooting mode Volume keys as a shutter
   --------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\glwidget\TwGLPanoramaMenu.smali
	* METHODS:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED new line:
		goto :cond_c
	* WHERE?:
		.line 450
		goto :cond_c
		const/16 v1, 0x18
		if-eq p1, v1, :cond_b

		const/16 v1, 0x19
		if-ne p1, v1, :cond_c
	* EXPLANATION:
		Jump below "if" conditions that check if volume keys are pressed

8. Camera "Timer" shooting mode Volume keys as a shutter
   -----------------------------------------------------
	* FILE:
		com\sec\android\app\camera\glwidget\TwGLTimerMenu.smali
	* METHODS:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED new line:
		goto :cond_a
	* WHERE?:
		.line 114
		goto :cond_a
		const/16 v1, 0x18
		if-eq p1, v1, :cond_9

		const/16 v1, 0x19
		if-ne p1, v1, :cond_a
	* EXPLANATION:
		Jump below "if" conditions that check if volume keys are pressed

-----------
 Camcorder
-----------

9. Camcorder "Unable to record while in a call" Alert Disabled
   -----------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camcorder.smali
	* METHOD:
		.method protected checkCameraDuringCall()V
	* MODIFIED boolean from 0x0 (false) to 0x1 (true):
		const/4 v0, 0x1
	* WHERE?:
		.prologue
		.line 4448
		const/4 v0, 0x1
	* EXPLANATION:
		This function will set "mEnableDuringCall" variable always to "true".
		That way it is possible now to record video during call (but not if you're recording your call).

10. Camcorder "Can't use flash on low battery" Alert Disabled
    ---------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camcorder.smali
	* METHOD:
		.method private handlePluggedLowBattery(Z)V
	* ADDED new line:
		return-void
	* WHERE?:
		.line 4285
		return-void
		const-string v1, "Camcorder"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method

11. Camcorder "Low Battery" Alert Disabled
    --------------------------------------
	* FILE:
		com\sec\android\app\camera\Camcorder.smali
	* METHOD:
		.method protected handleLowBattery(Z)V
	* ADDED new line:
		return-void
	* WHERE?:
		.prologue
		.line 3205
		return-void
		const-string v0, "Camcorder"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method
		
12. Camcorder Volume and Power keys as a shutter
    --------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camcorder.smali
	* METHOD:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
	* MODIFIED switch case:
		:sswitch_data_f4
		.sparse-switch
			0x4 -> :sswitch_4f
				0x18 -> :sswitch_4f
				0x19 -> :sswitch_4f
			0x1a -> :sswitch_4f
			0x45 -> :sswitch_53
			0x46 -> :sswitch_53
			0x4f -> :sswitch_51
			0x50 -> :sswitch_cd
			0x52 -> :sswitch_4d
			0x55 -> :sswitch_51
			0x7e -> :sswitch_51
			0x7f -> :sswitch_51
			0x9c -> :sswitch_53
			0x9d -> :sswitch_53
		.end sparse-switch
	* EXPLANATION:
		0x18 is volume up key, 0x19 is volume down key.
		We are telling this switch cases to link to "sswitch_4f" and do nothing when pressed.
	----------
	* METHOD:
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED new lines:
		const/16 v4, 0x19
		if-eq p1, v4, :cond_143
	* WHERE?:
		.line 1759
		:cond_12f

		const/16 v4, 0x19
		if-eq p1, v4, :cond_143

		invoke-virtual {p0}, Lcom/sec/android/app/camera/Camcorder;->processBack()V
	* EXPLANATION:
		This will add new "if" condition for 0x19 (volume down) key.
		Becasue I've linked 0x19 (volume down) key to "sswitch_ec" switch case, that uses by 0x4 (back button) key,
		this will skip from Camera to exit when volume down is pressed and will just stop recording.
	----------
	* MODIFIED and ADDED switch case:
		:sswitch_data_176
		.sparse-switch
			0x4 -> :sswitch_ec
			0x17 -> :sswitch_71
				0x18 -> :sswitch_71
				0x19 -> :sswitch_ec
				0x1a -> :sswitch_71
			0x1b -> :sswitch_71
			0x42 -> :sswitch_71
			0x50 -> :sswitch_138
			0x52 -> :sswitch_56
		.end sparse-switch
	* EXPLANATION:
		0x18 is volume up key and it's linked to "sswitch_71" the same as shutter key 0x17.
		0x19 is volume down key and it's linked to "sswitch_ec" the same as back button 0x4 (see above info).
		added 0x1a (power key) switch case to be linked to "sswitch_71" the same as shutter key 0x17.

13. Camcorder Better audio quality/video bitrate
    --------------------------------------------
	FILE:
		com\sec\android\app\camera\MediaRecorderProfile.smali
	INFO FROM:
		http://forum.xda-developers.com/showthread.php?t=1832472
	VIDEO QUALITY:
		1080p: Normal - 17MBit / Fine - 24MBit / Superfine - 30MBit
		720p : Normal - 9MBit  / Fine - 13MBit / Superfine - 17MBit
	SOUND QUALITY:
		192kbit/s
		48000 Khz
	MODIFIED Arrays:
		:array_11c
		.array-data 0x4
			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
		.end array-data

		:array_134
		.array-data 0x4
			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
		.end array-data

		:array_14c
		.array-data 0x4
			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
		.end array-data

		:array_164
		.array-data 0x4
			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
		.end array-data
ICS Camera app
Quote:
Download CWM recovery file and install:
http://www.jobnik.org/files/apk/s2/j...MOD_v8_cwm.zip

Or

Download Camera.apk and push it to system/app, then change permissions to 644
http://www.jobnik.org/files/apk/s2/Camera.apk

Having problems recording in 1080p format? Use this one, that uses the default MediaRecorderProfile.smali
http://www.jobnik.org/files/apk/s2/j..._media_cwm.zip

For those who want to restore to original version, that comes with ROM:
http://www.jobnik.org/files/apk/s2/r...era_S2_cwm.zip
Changes I've made in smali files are:
Code:
Camera MOD v8 by jobnik (Arthur):
---------------------------------
Files to be changed:
	com\sec\android\app\camera\AbstractCameraActivity.smali
	com\sec\android\app\camera\Camcorder.smali
	com\sec\android\app\camera\Camera.smali
	com\sec\android\app\camera\MediaRecorderProfile.smali
	com\sec\android\app\camera\SelfShotView.smali
	com\sec\android\app\camera\glwidget\TwGLActionMenu.smali
	com\sec\android\app\camera\glwidget\TwGLPanoramaMenu.smali
	com\sec\android\app\camera\resourcedata\CameraSettingsMenuResourceData.smali

----------------
 Camera
----------------
1. Camera / Camcorder "Unable to start/record while in a call" Alert Disabled
   --------------------------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\AbstractCameraActivity.smali
	* METHOD:
		.method public checkCameraStartCondition_Call()Z
	* ADDED:
		return v2
	* WHERE?:
		.prologue
		const/4 v2, 0x0
		return v2
	* EXPLANATION:
		We are telling this method to return "false" and exit, as "v2" variable already set to "0x0" (false)

2. Camera "Low Battery" Alert Disabled
   -----------------------------------
	* FILE:
		com\sec\android\app\camera\AbstractCameraActivity.smali
	* METHOD:
		.method protected handleLowBattery()V
	* ADDED new line:
		return-void
	* WHERE?:
		.prologue
		.line 1569
		return-void

		const-string v1, "AbstractCameraActivity"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method

3. Camera "Can't use flash on low battery" Alert Disabled
   ------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camera.smali
	* METHOD:
		.method private handlePluggedLowBattery(Z)V
	* ADDED new line:
		return-void
	* WHERE?:
		.line 4629
		return-void

		const-string v1, "Camera"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method

4. Camera Power and Volume keys as a shutter
   -----------------------------------------
	* FILE:
		com\sec\android\app\camera\Camera.smali
	* METHOD:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
	* MODIFIED switch case:
		:sswitch_data_204
		.sparse-switch
			0x4 -> :sswitch_38
			0x17 -> :sswitch_90
				0x18 -> :sswitch_90
				0x19 -> :sswitch_90
			0x1a -> :sswitch_38
			0x1b -> :sswitch_90
			0x42 -> :sswitch_90
			0x50 -> :sswitch_3a
			0x52 -> :sswitch_36
		.end sparse-switch
	* EXPLANATION:
		0x18 is volume up key, 0x19 is volume down key.
		We are telling this switch cases to link to "sswitch_90" and act the same as shutter key, that is 0x17.
	----------
	* METHOD:
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED:
		goto :cond_d2
	* WHERE?
		.line 1727
		:sswitch_cd
		goto :cond_d2
		if-eqz p2, :cond_d2
	* MODIFIED switch case:
		:sswitch_data_184
		.sparse-switch
			0x4 -> :sswitch_3d
			0x17 -> :sswitch_cd
				0x18 -> :sswitch_cd
				0x19 -> :sswitch_cd
				0x1a -> :sswitch_cd
			0x1b -> :sswitch_cd
			0x42 -> :sswitch_cd
			0x50 -> :sswitch_146
			0x52 -> :sswitch_96
		.end sparse-switch
	* EXPLANATION:
		At first there's a jump condition to "cond_d2", to skip "if" that can prevent from power key to act as a shutter.
		0x18 is volume up key, 0x19 is volume down key, 0x1a is a power key.
		We are telling this switch cases to link to "sswitch_cd" and act the same as shutter key, that is 0x17.

5. Camera "Self-shot" shooting mode Volume keys as a shutter
   ---------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camera.smali
	* METHODS:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* REMOVED these lines:
		const/16 v0, 0x18
		if-eq p1, v0, :cond_c

		const/16 v0, 0x19
		if-eq p1, v0, :cond_c
	* WHERE?:
		.line 43 and .line 53
		const/16 v0, 0x18
		if-eq p1, v0, :cond_c

		const/16 v0, 0x19
		if-eq p1, v0, :cond_c

		const/16 v0, 0x50
		if-ne p1, v0, :cond_e
	* EXPLANATION:
		0x18 is volume up key, 0x19 is volume down key
		These are "if" conditions to check if volume keys are pressed

6. Camera Enable "Shutter Sound On/Off" in menu
   --------------------------------------------
	* FILE:
		com\sec\android\app\camera\resourcedata\CameraSettingsMenuResourceData.smali
	* METHOD:
		.method private initCommandIdList()V
	* ADDED these lines:
		iget-object v0, p0, Lcom/sec/android/app/camera/resourcedata/CameraSettingsMenuResourceData;->mCommandIdList:Ljava/util/ArrayList;

		const/16 v1, 0x15

		invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

		move-result-object v1

		invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
	* WHERE?:
		.line 67
		iget-object v0, p0, Lcom/sec/android/app/camera/resourcedata/CameraSettingsMenuResourceData;->mCommandIdList:Ljava/util/ArrayList;

		const/16 v1, 0x14

		invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

		move-result-object v1

		invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
	* EXPLANATION:
		0x15 item is a "Shutter sound On/Off" and it's missing in ICS app.
		That way we permanently enable "Shutter Sound On/Off" menu item in menu array.

7. Camera "Action shot" shooting mode Volume keys as a shutter
   -----------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\glwidget\TwGLActionMenu.smali
	* METHODS:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED new line:
		goto :cond_c
	* WHERE?:
		.line 271 and .line 293
		goto :cond_c
		const/16 v1, 0x18
		if-eq p1, v1, :cond_b

		const/16 v1, 0x19
		if-ne p1, v1, :cond_c
	* EXPLANATION:
		Jump below "if" conditions that check if volume keys are pressed

8. Camera "Panorama" shooting mode Volume keys as a shutter
   --------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\glwidget\TwGLPanoramaMenu.smali
	* METHODS:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED new line:
		goto :cond_c
	* WHERE?:
		.line 337 and .line 361
		goto :cond_c
		const/16 v1, 0x18
		if-eq p1, v1, :cond_b

		const/16 v1, 0x19
		if-ne p1, v1, :cond_c
	* EXPLANATION:
		Jump below "if" conditions that check if volume keys are pressed

-----------
 Camcorder
-----------

9. Camcorder "Can't use flash on low battery" Alert Disabled
   ---------------------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camcorder.smali
	* METHOD:
		.method private handlePluggedLowBattery(Z)V
	* ADDED new line:
		return-void
	* WHERE?:
		.line 2897
		return-void

		const-string v1, "Camcorder"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method

10. Camcorder "Low Battery" Alert Disabled
    --------------------------------------
	* FILE:
		com\sec\android\app\camera\Camcorder.smali
	* METHOD:
		.method protected handleLowBattery()V
	* ADDED new line:
		return-void
	* WHERE?:
		.line 2166
		return-void

		const-string v0, "Camcorder"
	* EXPLANATION:
		We are telling this method to return, exit, as it's just a "void" method
		
11. Camcorder Volume and Power keys as a shutter
    --------------------------------------------
	* FILE:
		com\sec\android\app\camera\Camcorder.smali
	* METHOD:
		.method public onKeyDown(ILandroid/view/KeyEvent;)Z
	* MODIFIED switch case:
		:sswitch_data_9c
		.sparse-switch
			0x4 -> :sswitch_30
			0x17 -> :sswitch_27
				0x18 -> :sswitch_30
				0x19 -> :sswitch_30
			0x1a -> :sswitch_30
			0x1b -> :sswitch_27
			0x4f -> :sswitch_2c
			0x50 -> :sswitch_7a
			0x52 -> :sswitch_2e
			0x55 -> :sswitch_30
			0x57 -> :sswitch_30
			0x58 -> :sswitch_30
			0x59 -> :sswitch_30
			0x5a -> :sswitch_30
			0x7e -> :sswitch_30
			0x7f -> :sswitch_30
		.end sparse-switch
	* EXPLANATION:
		0x18 is volume up key, 0x19 is volume down key.
		We are telling this switch cases to link to "sswitch_30" and do nothing when pressed.
	----------
	* METHOD:
		.method public onKeyUp(ILandroid/view/KeyEvent;)Z
	* ADDED new lines:
		const/16 v1, 0x19
		if-eq p1, v1, :cond_cd
	* WHERE?:
		.line 1429
		:cond_b9

		const/16 v1, 0x19
		if-eq p1, v1, :cond_cd

		invoke-virtual {p0}, Lcom/sec/android/app/camera/Camcorder;->processBack()V
	* EXPLANATION:
		This will add new "if" condition for 0x19 (volume down) key.
		Becasue I've linked 0x19 (volume down) key to "sswitch_8d" switch case, that uses by 0x4 (back button) key,
		this will skip from Camera to exit when volume down is pressed and will just stop recording.
	----------
	* MODIFIED and ADDED switch case:
		:sswitch_data_fc
		.sparse-switch
			0x4 -> :sswitch_8d
			0x17 -> :sswitch_57
				0x18 -> :sswitch_57
				0x19 -> :sswitch_8d
				0x1a -> :sswitch_57
			0x1b -> :sswitch_57
			0x42 -> :sswitch_57
			0x4f -> :sswitch_f9
			0x50 -> :sswitch_c2
			0x52 -> :sswitch_3e
		.end sparse-switch
	* EXPLANATION:
		0x18 is volume up key and it's linked to "sswitch_57" the same as shutter key 0x17.
		0x19 is volume down key and it's linked to "sswitch_8d" the same as back button 0x4 (see above info).
		added 0x1a (power key) switch case to be linked to "sswitch_57" the same as shutter key 0x17.

12. Camcorder Better audio quality/video bitrate
    --------------------------------------------
	FILE:
		com\sec\android\app\camera\MediaRecorderProfile.smali
	INFO FROM:
		http://forum.xda-developers.com/showthread.php?t=1832472
	VIDEO QUALITY:
		1080p: Normal - 17MBit / Fine - 24MBit / Superfine - 30MBit
		720p : Normal - 9MBit  / Fine - 13MBit / Superfine - 17MBit
	SOUND QUALITY:
		192kbit/s
		48000 Khz
	MODIFIED Arrays:
		:array_c4
		.array-data 0x4
			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
		.end array-data

		:array_dc
		.array-data 0x4
			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
		.end array-data

		:array_f4
		.array-data 0x4
			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
		.end array-data

		:array_10c
		.array-data 0x4
			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
		.end array-data
I've also modified Camera app for Galaxy S3, Galaxy Note and Galaxy Note 2:
Galaxy S3 mod: http://forum.xda-developers.com/show....php?t=1883192
Galaxy Note mod: http://forum.xda-developers.com/show....php?t=1863362
Galaxy Note 2 mod: http://forum.xda-developers.com/show....php?t=1965801

Credits:
zxz0O0 - Camcorder Better audio quality/video bitrate
xavierjohn22 - AutoAPKTool2.0.4a
Tungstwenty - Backup/Restore CWM script

*** Don't forget to give me Credit and link to this XDA thread if you're using my modifications or SamsungCamera.apk / Camera.apk in your ROM ***

This mod found working fine on ROMs based for JB: LSJ , for ICS: LPY/X/U/T/O/G/S/I

* You're using this mod on your own risk. I'm not responsible for any damage of use or misuse of this fixed application SamsungCamera.apk / Camera.apk

Liked it? Please make a donation


* Don't want to donate? Then at least hit Thanks button! (from hundred of downloads, only a few dozens say thanks).

Thank you!

Have fun!
The Following 123 Users Say Thank You to jobnik For This Useful Post: [ Click to Expand ]
 
zxz0O0
Old
#2  
zxz0O0's Avatar
Senior Member
Thanks Meter 1006
Posts: 804
Join Date: Apr 2011

 
DONATE TO ME
Hi,

This is great, I have made a similiar one http://forum.xda-developers.com/show....php?t=1832472 but as I have poor java/smali knowledge I didn't have a clue on how to remap the hardware buttons as shutter. Thanks to you, you have documented your changes

Great job!
The Following User Says Thank You to zxz0O0 For This Useful Post: [ Click to Expand ]
 
jobnik
Old
#3  
jobnik's Avatar
Senior Member - OP
Thanks Meter 526
Posts: 125
Join Date: Mar 2010
Location: Tel-Aviv

 
DONATE TO ME
I've released a new version, please check the 1st post

Quote:
Originally Posted by zxz0O0 View Post
Hi,

This is great, I have made a similiar one http://forum.xda-developers.com/show....php?t=1832472 but as I have poor java/smali knowledge I didn't have a clue on how to remap the hardware buttons as shutter. Thanks to you, you have documented your changes

Great job!
Thank you! I've used your sound and video settings in new version
The Following 4 Users Say Thank You to jobnik For This Useful Post: [ Click to Expand ]
 
FakeMobile
Old
#4  
Member
Thanks Meter 4
Posts: 55
Join Date: Aug 2012
Default Finaly!

thanks you, it all what i was need !!
 
zxz0O0
Old
#5  
zxz0O0's Avatar
Senior Member
Thanks Meter 1006
Posts: 804
Join Date: Apr 2011

 
DONATE TO ME
Quote:
Originally Posted by jobnik View Post
I've released a new version, please check the 1st post



Thank you! I've used your sound and video settings in new version
Cool. Do you happen to know if it's also possible to remap power button? I tried but it didn't work, screen goes out
 
jobnik
Old
#6  
jobnik's Avatar
Senior Member - OP
Thanks Meter 526
Posts: 125
Join Date: Mar 2010
Location: Tel-Aviv

 
DONATE TO ME
I'll see what I can do
The Following 2 Users Say Thank You to jobnik For This Useful Post: [ Click to Expand ]
 
jobnik
Old
(Last edited by jobnik; 21st August 2012 at 05:41 PM.)
#7  
jobnik's Avatar
Senior Member - OP
Thanks Meter 526
Posts: 125
Join Date: Mar 2010
Location: Tel-Aviv

 
DONATE TO ME
Wooohoooo!!! I did it!
Using the Power button as a shutter!!!

but the power menu will come as well...
The Following User Says Thank You to jobnik For This Useful Post: [ Click to Expand ]
 
shoman94
Old
#8  
shoman94's Avatar
Recognized Contributor
Thanks Meter 12178
Posts: 8,422
Join Date: Mar 2009
Location: Maine

 
DONATE TO ME
Quote:
Originally Posted by jobnik View Post
Wooohoooo!!! I did it!
Using the Power button as a shutter!!!

but the power menu will come as well...
hmmm... does it only work with a long press?
IRC: freenode|#shostock


Asus Transformer Prime[32gb]
CROMBi-kk-4.4.2

Asus Transformer[16gb]
KatKiss-4.4.2
 
Aereonautico
Old
#9  
Aereonautico's Avatar
Junior Member
Thanks Meter 0
Posts: 8
Join Date: Apr 2011
Location: Italy

 
DONATE TO ME
Thanks

Inviato dal mio GT-I9100 con Tapatalk 2
 
jobnik
Old
#10  
jobnik's Avatar
Senior Member - OP
Thanks Meter 526
Posts: 125
Join Date: Mar 2010
Location: Tel-Aviv

 
DONATE TO ME
You're all welcome!

Quote:
Originally Posted by shoman94 View Post
hmmm... does it only work with a long press?
for now

The Following User Says Thank You to jobnik For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes