From fe0faf4c587c3de915310b7bbb7e4cfee93820f1 Mon Sep 17 00:00:00 2001 From: Sebastiano Barezzi Date: Tue, 12 Oct 2021 18:41:32 +0200 Subject: [PATCH] haydn: Patch xiaomi camera libraries The modified library NOPs out the instruction to change binder threadpool, allowing the library to load and camera to work on S. Extend the pattern for cameraperf since "7c 00 00 94" occurs twice to only NOP the configureRpcThreadpool call. Output of llvm-objdump: ``` 3ad0: 7c 00 00 94 bl 0x3cc0 <_ZdlPv@plt> 3b10: 7c 00 00 94 bl 0x3d00 <_ZN7android8hardware22configureRpcThreadpoolEmb@plt> ``` Change-Id: I1ef0ed29e4a2eb820826e5d7df1fa53c9e3df584 --- extract-files.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extract-files.sh b/extract-files.sh index 07a852e..f39b605 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -13,6 +13,12 @@ function blob_fixup() { vendor/lib64/hw/camera.qcom.so) sed -i "s/\x73\x74\x5F\x6C\x69\x63\x65\x6E\x73\x65\x2E\x6C\x69\x63/\x63\x61\x6D\x65\x72\x61\x5F\x63\x6E\x66\x2E\x74\x78\x74/g" "${2}" ;; + vendor/lib64/hw/camera.xiaomi.so) + "${SIGSCAN}" -p "52 07 00 94" -P "1F 20 03 D5" -f "${2}" + ;; + vendor/lib64/vendor.xiaomi.hardware.cameraperf@1.0-impl.so) + "${SIGSCAN}" -p "21 00 80 52 7c 00 00 94" -P "21 00 80 52 1F 20 03 D5" -f "${2}" + ;; esac }