This repository contains a Python script that patches the libexynoscamera3.so
camera lib of Exynos devices to enable different features.
Requires Python 3.10 or higher. Make sure to install the dependencies too (pip install -r requirements.txt
).
Usually located at /vendor/lib/libexynoscamera3.so
and/or /vendor/lib64/libexynoscamera3.so
. Some devices have both but only use one, it's suggested to patch both in that case.
Some newer Exynos devices like the Galaxy A55 don't have this library. Those aren't supported by this script at the moment.
If the script fails to patch your lib, open an issue with your device model, Android version and attach the lib.
The following camera features can be enabled or modified.
Keep in mind that enabling them doesn't mean they will work as expected nor that something will change. It's up to you to test the modifications.
- 0 (LIMITED)
- 1 (FULL)
- 2 (LEGACY)
- 3 (LEVEL_3)
- The lib doesn't seem to expect this level, so it will probably behave like LIMITED
- 4 (EXTERNAL)
- These three are automatically enabled by the library if the Hardware Level is set to FULL:
- MANUAL_SENSOR and READ_SENSOR_SETTINGS (2)
- MANUAL_POST_PROCESSING (4)
- BURST_CAPTURE (8)
- If this is disabled, GCam doesn't work and shows a black screen in photo mode. Enabling it is enough to make it work on some devices:
- RAW (16)
- Others
- ZSL (Zero Shutter Lag) and Private Reprocessing (32)
- This causes issues with some apps on the A20, A20e and A30 since they don't support ZSL. You can use this app to check whether it works on your device.
- YUV Reprocessing (64)
- Depth Output (128)
- Constrained High Speed Video (256)
- Motion Tracking (512)
- Logical Multi Camera (1024)
- Secure Image Data (2048)
- ZSL (Zero Shutter Lag) and Private Reprocessing (32)
usage: patch_lib.py [-h] [--hardware-level {0,1,2,3,4}]
[--enable-cap {2,4,8,16,32,64,128,256,512,1024,2048} [{2,4,8,16,32,64,128,256,512,1024,2048} ...]]
[--disable-cap {2,4,8,16,32,64,128,256,512,1024,2048} [{2,4,8,16,32,64,128,256,512,1024,2048} ...]]
[--skip-depth] [--model MODEL] [--android-version ANDROID_VERSION] [--version VERSION]
libs [libs ...]
positional arguments:
libs Path(s) of the libexynoscamera3.so lib(s) to patch
options:
-h, --help show this help message and exit
Lib Modifications:
--hardware-level {0,1,2,3,4}
The hardware level that will be set
--enable-cap {2,4,8,16,32,64,128,256,512,1024,2048} [{2,4,8,16,32,64,128,256,512,1024,2048} ...]
The capabilities that will be enabled, separated by spaces
--disable-cap {2,4,8,16,32,64,128,256,512,1024,2048} [{2,4,8,16,32,64,128,256,512,1024,2048} ...]
The capabilities that will be disabled, separated by spaces
--skip-depth Skips modifications on cameras with the "Depth Output" capability. Recommended if your device
has a depth camera.
Magisk Module:
If the following settings 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)
python3 ./patch_lib.py libexynoscamera3.so --enable-cap 16
will enable the RAW capability. This should be enough to make GCam work.
python3 ./patch_lib.py libexynoscamera3.so --enable-cap 16 32 --hardware-level 1
will enable the RAW & ZSL capabilities and set the hardware level to FULL.
If Android doesn't show show any cameras, this means the camera lib crashed:
- Can happen if your device has a depth camera, try patching with
--skip-depth
. - Someone has reported that they had to move the lib to
/vendor/lib64/hw/
. Try it if you see something likedlopen failed: library "libexynoscamera3.so" not found
in the logcat.
Note: If you test this on a device not listed here or you have any issue/weird behaviour, please let me know.
Most tests were done using BSG's GCam 8.1, as it seems to be the most stable one on Exynos devices that do have GCam working.
Device Name | SoC | GCam Works? | Notes | ||||
---|---|---|---|---|---|---|---|
Galaxy A12 Nacho (A12s) | Exynos 850 | X |
|
||||
Galaxy A20 | Exynos 7884 | ✓ |
|
||||
Galaxy A20e | Exynos 7884 | ✓ |
|
||||
Galaxy A25 | Exynos 1280 | ✓ |
|
||||
Galaxy A30 | Exynos 7904 | ✓ |
|
||||
Galaxy A30s | Exynos 7904 | ? |
|
||||
Galaxy A33 | Exynos 1280 | X |
|
||||
Galaxy A40 | Exynos 7904 | Partially |
|
||||
Galaxy A50s | Exynos 9611 | Partially |
|
||||
Galaxy A51 | Exynos 9611 | Partially |
|
||||
Galaxy F62 | Exynos 9825 | Partially |
|
||||
Galaxy M31 | Exynos 9611 | Partially |
|
||||
Galaxy M31s | Exynos 9611 | Partially |
|
||||
Galaxy M34 5G | Exynos 1280 | X |
|
As it can be seen, GCam only seems to be usable on the Exynos 7884/7904 series. As someone who had an A20, I can say that the difference in quality with the stock camera is huge. You can check that yourself with this comparison of two pics I took a few years ago.