From 9c9e8bdcd2984bfec73e5f04c56eec848cb18563 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sat, 26 Feb 2022 13:39:46 +0100 Subject: [PATCH] sm8250-common: Unlock gc5035 camera This change lets us use gc5035 camera, which was blocked by OnePlus long time ago after people discovered its *magic* capabilities. By default only `com.oem.autotest` can use it, however if we replace the first character with a NULL byte, then strncmp returns 0, and thus we pass the check and allow everyone to use it. You can see the logs below that led me to discover that behavior. [DEBUG ] JIANJIA.cpp:89 PretendOpenCamera() logicalCameraId 4, m_ClientPackageName 0 [DEBUG ] STELLA.cpp:1445 informKernel() force: -1 value: 6 buf: 5 [DEBUG ] chxextensionmodule.cpp:1005 ExtendOpen() You shall not pass 0 [DEBUG ] chxextensioninterface.cpp:298 chi_extend_open() [OP_EXT] OPEN_CAMERA X [ERROR][HAL ] camxhal3module.cpp:772 ProcessCameraOpen() Camera Open failed with error status = CamxResultEInvalidArg Change-Id: I9b3e4e55f07cef40886e09941f7ed0523cdf8cfa --- extract-files.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extract-files.sh b/extract-files.sh index bc0bdaf..596b11b 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -63,6 +63,9 @@ function blob_fixup() { system_ext/lib64/libwfdnative.so) sed -i "s/android.hidl.base@1.0.so/libhidlbase.so\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/" "${2}" ;; + vendor/lib64/hw/com.qti.chi.override.so) + sed -i "s/com.oem.autotest/\x00om.oem.autotest/" "${2}" + ;; esac }