gta4xl-common: Use libcrypto from VNDK33 for keymaster

* Google broke asn1 structs in https://github.com/google/boringssl/commit/9211b80f1e4d66982b17134b61f11db1b8a8a192
  by changing types from long to int making the struct used by the blob mismatch new libcrypto

Change-Id: I8b110e9841bd9b50ea482aa98c0963567a69f6fc
diff --git a/common.mk b/common.mk
index 226f22b..c86d3a8 100644
--- a/common.mk
+++ b/common.mk
@@ -151,6 +151,7 @@
 # Keymaster
 PRODUCT_PACKAGES += \
     android.hardware.keymaster@4.0-service.samsung \
+    libcrypto-v33 \
     libkeymaster4_1support.vendor:64
 
 # Lineage Health
diff --git a/extract-files.sh b/extract-files.sh
index 89af173..9e3552a 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -63,6 +63,9 @@
         vendor/lib*/libsensorlistener.so)
             "${PATCHELF}" --add-needed libshim_sensorndkbridge.so "${2}"
             ;;
+        vendor/lib*/libskeymaster4device.so)
+            "${PATCHELF}" --replace-needed libcrypto.so libcrypto-v33.so "${2}"
+            ;;
     esac
 }
 
diff --git a/vndk/Android.bp b/vndk/Android.bp
new file mode 100644
index 0000000..e7ca6a3
--- /dev/null
+++ b/vndk/Android.bp
@@ -0,0 +1,27 @@
+//
+// Copyright (C) 2023 The LineageOS Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_prebuilt_library_shared {
+    name: "libcrypto-v33",
+    target: {
+        android_arm64: {
+            srcs: ["libcrypto-v33.so"],
+        },
+    },
+    compile_multilib: "64",
+    check_elf_files: false,
+    vendor: true,
+}
diff --git a/vndk/libcrypto-v33.so b/vndk/libcrypto-v33.so
new file mode 120000
index 0000000..9f8a0be
--- /dev/null
+++ b/vndk/libcrypto-v33.so
@@ -0,0 +1 @@
+../../../../prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-core/libcrypto.so
\ No newline at end of file