From b19c2c815d46d8b2c038160484c2ccf178c45160 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 --- .../vendor/lib64/hw/com.qti.chi.override.so | Bin 3494368 -> 3494368 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/proprietary/vendor/lib64/hw/com.qti.chi.override.so b/proprietary/vendor/lib64/hw/com.qti.chi.override.so index a36626b084871a349c84e0cfc919b794287c6941..632ecc3a5b2867da27ad71b1442341b866b1862d 100644 GIT binary patch delta 215 zcmV~$NlsJ&002=Nv1L$Z5JW}+nL*%u6&F9LgY*?hyoX8e`vBC63;5n_G9Aq()6t({ zG|UYjhxy^t>-de)2V-n}HWrLUW64-Hz8GJP6=T&{GuDj_W7F6&wv8R*o3U%`8Q+b4 zm2qv{7`Miqac?{rkH&A~$$0)7FYo{U10b?& Au>b%7 delta 215 zcmV~$*-cad06@_U!m!FJ2+E@DDj+Bw(Z`J+FS&(G3ncVGGXGNm_lpKRXEvFRW|QgY z-!K~Hh7ZI1u<$&7WAtQ#-_1lY#TeqCu7&xGd>&p#)0w0 z_-Y&)N5-*nVtg~c8>hyZac*1~m&TQGZTv8P8o!Ji