From 99524173c31a8a73de38535e16c133b33a59a9e0 Mon Sep 17 00:00:00 2001
From: Salih <91677076+DeliUstaTM@users.noreply.github.com>
Date: Mon, 23 Dec 2024 20:01:11 +0300
Subject: [PATCH] Update build.sh

---
 build.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/build.sh b/build.sh
index 2deaf64..78a392d 100644
--- a/build.sh
+++ b/build.sh
@@ -89,10 +89,14 @@ sed -i "s/DUMMY1/$AOSP_CLANG_VERSION/g" $WORK_DIR/common/build.config.common
 ZIP_NAME=$(echo "$ZIP_NAME" | sed "s/KVER/$KERNEL_VERSION/g")
 
 ## Download Clang
-wget https://apt.llvm.org/llvm.sh
-chmod +x llvm.sh
-sudo ./llvm.sh 20 all
-sudo apt-get install clang llvm lld
+rm -rf $WORK_DIR/prebuilts-master
+mkdir -p $WORK_DIR/prebuilts-master/clang/host/linux-x86/clang-$AOSP_CLANG_VERSION
+wget -O $WORK_DIR/clang.tar.gz https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/refs/heads/main/clang-$AOSP_CLANG_VERSION.tar.gz
+tar -xf $WORK_DIR/clang.tar.gz -C $WORK_DIR/prebuilts-master/clang/host/linux-x86/clang-$AOSP_CLANG_VERSION
+rm -f $WORK_DIR/clang.tar.gz
+
+COMPILER_STRING=$("$WORK_DIR/prebuilts-master/clang/host/linux-x86/clang-${AOSP_CLANG_VERSION}/bin/clang" -v 2>&1 | head -n 1 | sed 's/(https..*//' | sed 's/ version//')
+
 ## KSU
 if [ "${USE_KSU_NEXT}" == "yes" ]; then
         # Enable SUS🤨FS by default