This repository contains two Python scripts that can patch the camera lib of Exynos devices and enable/modify different features:
patch_libexynoscamera3.pyis for older Exynos devices that use the libexynoscamera3.so lib.- Located at
/vendor/lib/and/or/vendor/lib64/. - If both libs are present, I suggest patching the two of them
- Located at
patch_s5e.pyis for newer Exynos devices that use the camera.s5eXXXX.so lib.- Located at
/vendor/lib64/hw/. - The exact file name varies depending on your device. Look for something similar to
camera.s5e8835.so.
- Located at
Both scripts require Python 3.10 or higher.
Make sure to download the whole repository (and not just the patch_*.py script) & install the dependencies too (pip install -r requirements.txt).
If the script fails to patch your lib, open an issue with your device model and attach the lib(s).
Warning
Enabling or modifying something doesn't mean it will work as expected. It's up to you to test everything.
In any case, feel free to open an issue if you encounter any problem.
libexynoscamera3.so
usage: patch_libexynoscamera3.py [-h] [--hardware-level HARDWARE_LEVEL] [--enable-cap CAPABILITY [CAPABILITY ...]]
[--disable-cap CAPABILITY [CAPABILITY ...]] [--skip-depth] [--model MODEL] [--android-version ANDROID_VERSION]
[--version VERSION]
libs [libs ...]
positional arguments:
libs Path(s) of the lib(s) that will be patched
options:
-h, --help show this help message and exit
Lib Modifications:
--hardware-level HARDWARE_LEVEL
The hardware level that will be set
--enable-cap CAPABILITY [CAPABILITY ...]
The capabilities that will be enabled, separated by space.
--disable-cap CAPABILITY [CAPABILITY ...]
The capabilities that will be disabled, separated by space.
--skip-depth Skips modifications on cameras with the "Depth Output" capability. Recommended if your device has a depth camera.
Magisk Module:
If all the following args are provided, a Magisk module with the patched lib(s) will be created
--model MODEL The device the lib comes from (e.g. Galaxy A20)
--android-version ANDROID_VERSION
The Android version the lib comes from (e.g. 11)
--version VERSION The module version (e.g. 1)
- LIMITED - default level on pretty much every lib
- FULL - enables some capabilities, more info below
- LEVEL_3 - the lib doesn't seem to expect this level, it'll probably behave like LIMITED
- These are worse than LIMITED so you shouldn't use them:
Example:
python3 ./patch_lib.py libexynoscamera3.so --hardware-level FULL will set the Hardware Level to FULL on all cameras.
- These are enabled by the lib if the Hardware Level is set to FULL:
- ManualSensor_ReadSensorSettings (MANUAL_SENSOR and READ_SENSOR_SETTINGS)
- ManualPostProcessing (MANUAL_POST_PROCESSING)
- BurstCapture (BURST_CAPTURE)
- Others
- RAW
- If disabled, GCam doesn't work and shows a black screen in photo mode. Enabling it should be enough to make it work on some devices.
- ZSL_PrivateReprocessing (Zero Shutter Lag and PRIVATE_REPROCESSING)
- Enabling this causes issues with some apps on the A20, A20e and A30 since these devices don't support ZSL. You can use this app to test ZSL.
- YUVReprocessing (YUV_REPROCESSING)
- DepthOutput (DEPTH_OUTPUT)
- ConstrainedHighSpeedVideo (CONSTRAINED_HIGH_SPEED_VIDEO)
- MotionTracking (MOTION_TRACKING)
- LogicalMultiCamera (LOGICAL_MULTI_CAMERA)
- SecureImageData (SECURE_IMAGE_DATA)
- RAW
Examples:
python3 ./patch_lib.py libexynoscamera3.so --enable-cap RAW enables the RAW capability on all cameras.
python3 ./patch_lib.py libexynoscamera3.so --enable-cap RAW YUVReprocessing enables the RAW and YUV_REPROCESSING capabilities.
python3 ./patch_lib.py libexynoscamera3.so --disable-cap BurstCapture disables the BURST_CAPTURE capability.
If Android doesn't show show any cameras, it means the lib crashed:
- Try patching with
--skip-depth. Some devices have depth cameras and enabling capabilities on them breaks the lib. - Someone reported they had to move the lib to
/vendor/lib64/hw/. Try it if you see something likedlopen failed: library "libexynoscamera3.so" not foundin the logs.
camera.s5eXXXX.so
usage: patch_s5e.py [-h] [--hardware-level HARDWARE_LEVEL] [--enable-cap CAPABILITY [CAPABILITY ...]]
[--lib-name LIB_NAME] [--model MODEL] [--android-version ANDROID_VERSION] [--version VERSION]
libs [libs ...]
positional arguments:
libs Path(s) of the lib(s) that will be patched
options:
-h, --help show this help message and exit
Lib Modifications:
--hardware-level HARDWARE_LEVEL
The hardware level that will be set
--enable-cap CAPABILITY [CAPABILITY ...]
The capabilities that will be enabled, separated by space.
Magisk Module:
If all the following args are provided, a Magisk module with the patched lib(s) will be created
--lib-name LIB_NAME The name of the lib (e.g. camera.s5e9925.so)
--model MODEL The device the lib comes from (e.g. Galaxy A54)
--android-version ANDROID_VERSION
The Android version the lib comes from (e.g. 15)
--version VERSION The module version (e.g. 1)
Example:
python3 ./patch_lib.py camera.s5e8835.so --hardware-level FULL will set the Hardware Level to FULL on all cameras.
- These are enabled by the lib if the Hardware Level is set to FULL or LEVEL_3:
- ManualSensor_ReadSensorSettings (MANUAL_SENSOR and READ_SENSOR_SETTINGS)
- ManualPostProcessing (MANUAL_POST_PROCESSING)
- BurstCapture (BURST_CAPTURE)
- These are enabled by the lib if the Hardware Level is set to LEVEL_3:
- RAW
- If disabled, GCam doesn't work and shows a black screen in photo mode. Enabling it should be enough to make it work
- Enabling this and spoofing some device model props may be enough to make Expert RAW work
- YUVReprocessing (YUV_REPROCESSING)
- RAW
- Others
- PrivateReprocessing (PRIVATE_REPROCESSING)
- MotionTracking (MOTION_TRACKING)
- LogicalMultiCamera (LOGICAL_MULTI_CAMERA)
- SecureImageData (SECURE_IMAGE_DATA)
- SystemCamera (SYSTEM_CAMERA)
- OfflineProcessing (OFFLINE_PROCESSING)
- ControlZoom (doesn't map to an Android capability)
- LensCal (doesn't map to an Android capability)
- StreamUseCase (STREAM_USE_CASE)
- DynamicRangeTenBit (DYNAMIC_RANGE_TEN_BIT)
- ColorSpaceProfiles (COLOR_SPACE_PROFILES)
Note that some capabilities (specially the ones at the end of the list) may only do something on newer lib versions.
Examples:
python3 ./patch_lib.py camera.s5e8835.so --enable-cap RAW enables the RAW capability on all cameras.
python3 ./patch_lib.py camera.s5e8835.so --enable-cap RAW YUVReprocessing enables the RAW and YUV_REPROCESSING capabilities.
Note: If you test GCam on a device not listed here or get a different result, let me know.
| SoC | Device Name | GCam Works? | Notes |
|---|---|---|---|
| Exynos 1380 (S5E8835) | Galaxy A54 | ✓ | Tested on Android 16 |
| Exynos 1480 (S5E8845) | Galaxy A55 | ✓ | Tested on Android 15 using SGCAM 8.4 v25 |
Most tests were done using BSG's GCam 8.1, as it seems to be the most stable one.
| SoC | Device Name | GCam Works? | Notes | ||||
|---|---|---|---|---|---|---|---|
| Exynos 850 | Galaxy A12 Nacho (A12s) | X |
|
||||
| Exynos 1280 | Galaxy A25 | ✓ |
|
||||
| Exynos 1280 | Galaxy A33 | X |
|
||||
| Exynos 1280 | Galaxy M34 5G | X |
|
||||
| Exynos 7884 | Galaxy A20 | ✓ |
|
||||
| Exynos 7884 | Galaxy A20e | ✓ |
|
||||
| Exynos 7904 | Galaxy A30 | ✓ |
|
||||
| Exynos 7904 | Galaxy A30s | ? |
|
||||
| Exynos 7904 | Galaxy A40 | Partially |
|
||||
| Exynos 9611 | Galaxy A50s | Partially |
|
||||
| Exynos 9611 | Galaxy A51 | Partially |
|
||||
| Exynos 9611 | Galaxy M31 | Partially |
|
||||
| Exynos 9611 | Galaxy M31s | Partially |
|
||||
| Exynos 9825 | Galaxy F62 | Partially |
|
As you can see, GCam is unusable on most devices that use the libexynoscamera3 lib.
On the Exynos 7884/7904 series, the difference in pic quality between the stock camera and GCam is huge. Check it yourself with this comparison of two pics I took with the Galaxy A20.