├── .gitignore ├── README.md ├── Sultan ├── build_kernel_release.sh ├── A15_gs201_build_kernel_susfs_release.sh └── A15_zuma_build_kernel_susfs_release.sh ├── Pixel ├── build_kernel_shusky_susfs_release.sh ├── build_kernel_fold_susfs_release.sh └── build_kernel_redbull_susfs_release.sh ├── GKI ├── build_kernel_a13_5.15-lts_susfs_release.sh ├── build_kernel_a13_5.10_susfs_release.sh ├── build_kernel_a14_5.15_susfs_release.sh ├── aio_gki_build_susfs142_release.sh ├── aio_gki_build_susfs142_release_riri.sh ├── aio_gki_build_6.6_release.sh ├── riri_gki_build_kernel_release.sh ├── aio_gki_build_kernel_release.sh └── aio_gki_build_kernel_release_BACKUP.sh ├── OnePlus ├── opopen_a15_build_kernel_susfs_release.sh ├── op12_a15_build_kernel_susfs_release.sh └── nord4_a15_build_kernel_susfs_release.sh ├── Yaap └── build_kernel_a14_5.15_susfs_release.sh ├── Non-GKI ├── build_kernel_4.14_susfs_release.sh └── aio_non_gki_build_kernel_release.sh ├── Xiaomi ├── build_kernel_a14_5.15_susfs_release.sh └── aio_gki_build_kernel_magic_release.sh └── Samsung └── build_kernel_4.14_susfs_release.sh /.gitignore: -------------------------------------------------------------------------------- 1 | **/builds/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | These are old as i moved to github actions so these may be outdated! 2 | -------------------------------------------------------------------------------- /Sultan/build_kernel_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Function to ask a yes/no question with a default answer of 'yes' 4 | ask_question() { 5 | local question="$1" 6 | while true; do 7 | read -p "$question (Y/n): " choice 8 | case "$choice" in 9 | "" | [Yy]* ) return 0;; 10 | [Nn]* ) return 1;; 11 | * ) echo "Please answer y or n.";; 12 | esac 13 | done 14 | } 15 | 16 | # Flags to track user choices 17 | build_pixel8=false 18 | build_pixel7=false 19 | 20 | # Ask if the user wants to build Pixel 8 21 | if ask_question "Do you want to build Pixel 8 (./A15_zuma_build_kernel_susfs_release.sh)?"; then 22 | build_pixel8=true 23 | fi 24 | 25 | # Ask if the user wants to build Pixel 7 26 | if ask_question "Do you want to build Pixel 7 (./A15_gs201_build_kernel_susfs_release.sh)?"; then 27 | build_pixel7=true 28 | fi 29 | 30 | # Execute based on user choices 31 | if [ "$build_pixel8" = true ]; then 32 | echo "Building Pixel 8 (./A15_zuma_build_kernel_susfs_release.sh)..." 33 | chmod +x ./A15_zuma_build_kernel_susfs_release.sh # Make it executable if it's a script 34 | ./A15_zuma_build_kernel_susfs_release.sh 35 | else 36 | echo "Skipping build of Pixel 8." 37 | fi 38 | 39 | if [ "$build_pixel7" = true ]; then 40 | echo "Building Pixel 7 (./A15_gs201_build_kernel_susfs_release.sh)..." 41 | chmod +x ./A15_gs201_build_kernel_susfs_release.sh # Make it executable if it's a script 42 | ./A15_gs201_build_kernel_susfs_release.sh 43 | else 44 | echo "Skipping build of Pixel 7." 45 | fi 46 | -------------------------------------------------------------------------------- /Pixel/build_kernel_shusky_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="Shusky-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b kernel-4.19 24 | git clone https://github.com/TheWildJames/kernel_patches.git 25 | 26 | # Get the kernel 27 | echo "Get the kernel..." 28 | mkdir shusky 29 | cd ./shusky 30 | repo init -u https://android.googlesource.com/kernel/manifest --depth=1 -b android-gs-shusky-6.1-android15-qpr2-beta 31 | repo sync --current-branch --no-tags -j$(nproc) 32 | 33 | # Add KernelSU 34 | cd ./aosp 35 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 36 | 37 | #add susfs 38 | echo "adding susfs" 39 | cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 40 | cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android-6.1.patch ./ 41 | cp ../../susfs4ksu/kernel_patches/fs/susfs.c ./fs/ 42 | cp ../../susfs4ksu/kernel_patches/include/linux/susfs.h ./include/linux/ 43 | cd ./KernelSU-Next/ 44 | patch -p1 -F 3 < 10_enable_susfs_for_ksu.patch || true 45 | cd .. 46 | patch -p1 -F 3 < 50_add_susfs_in_gki-android-6.1.patch || true 47 | 48 | cp ../../../kernel_patches/69_hide_stuff.patch ./ 49 | patch -p1 -F 3 < 69_hide_stuff.patch 50 | cd .. 51 | cp ../kernel_patches/selinux.c_fix.patch ./ 52 | patch -p1 -F 3 < selinux.c_fix.patch 53 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 54 | patch -p1 -F 3 < apk_sign.c_fix.patch 55 | cp ../kernel_patches/Makefile_fix.patch ./ 56 | patch -p1 --fuzz=3 < ./Makefile_fix.patch 57 | 58 | #build Kernel 59 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 60 | sed -i '2s/check_defconfig//' ./common/build.config.gki 61 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/redbull-gki_defconfig 62 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/redbull-gki_defconfig 63 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/redbull-gki_defconfig 64 | cd .. 65 | BUILD_AOSP_KERNEL=1 ./build_shusky.sh 66 | 67 | # Copy Image.lz4 68 | echo "Copying Image.lz4" 69 | cp ./out/android-msm-pixel-4.19/dist/boot.img ./ 70 | cp ./out/android-msm-pixel-4.19/dist/dtbo_barbet.img ./ 71 | cp ./out/android-msm-pixel-4.19/dist/dtbo_redfin.img ./ 72 | cp ./out/android-msm-pixel-4.19/dist/dtbo_bramble.img ./ 73 | cp ./out/android-msm-pixel-4.19/dist/vendor_boot.img ./ 74 | 75 | FILES=($(find ./ -maxdepth 1 -type f -name "*.img")) 76 | 77 | # GitHub Release using gh CLI 78 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 79 | REPO_NAME="Pixel_KernelSU_SUSFS" # Replace with your repository name 80 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 81 | RELEASE_NAME="Redbull With KernelSU & SUSFS" # Updated release name 82 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 83 | 84 | Module: 85 | https://github.com/sidex15/ksu_module_susfs 86 | 87 | Managers: 88 | https://github.com/rifsxd/KernelSU-Next 89 | https://github.com/tiann/KernelSU 90 | 91 | Features: 92 | [+] KernelSU-Next 93 | [+] SUSFS v1.5.3 94 | [+] Maphide LineageOS Detections 95 | [+] Futile Maphide for jit-zygote-cache Detections 96 | [+] Magic Mount 97 | " 98 | 99 | # Create the release using gh CLI (no need to include $ROOT_DIR) 100 | echo "Creating GitHub release for $RELEASE_NAME..." 101 | gh release create "$TAG_NAME" "${FILES[@]}" \ 102 | --repo "$REPO_OWNER/$REPO_NAME" \ 103 | --title "$RELEASE_NAME" \ 104 | --notes "$RELEASE_NOTES" 105 | 106 | # Final confirmation 107 | echo "GitHub release created and zip file uploaded." 108 | echo "Build and packaging process complete." 109 | -------------------------------------------------------------------------------- /GKI/build_kernel_a13_5.15-lts_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="GKI-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android13-5.15 24 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android13-5.15 25 | git clone https://github.com/TheWildJames/lineage_kernel_patches.git 26 | 27 | # Get the kernel 28 | echo "Get the kernel..." 29 | mkdir android13-5.15-lts 30 | cd ./android13-5.15-lts 31 | repo init -u https://android.googlesource.com/kernel/manifest --depth=1 -b android13-5.15-lts 32 | repo sync --current-branch --no-tags -j$(nproc) 33 | 34 | # Add KernelSU 35 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - 36 | 37 | #add susfs 38 | echo "adding susfs" 39 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/ 40 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android13-5.15.patch ./common/ 41 | cp ../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/ 42 | cp ../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/ 43 | cd ./KernelSU/ 44 | patch -p1 < 10_enable_susfs_for_ksu.patch 45 | cd .. 46 | cd ./common 47 | patch -p1 < 50_add_susfs_in_gki-android13-5.10.patch 48 | 49 | #adding lineage patch 50 | cp ../../kernel_patches/69_hide_stuff.patch ./ 51 | patch -p1 < 69_hide_lineage.patch 52 | 53 | #build Kernel 54 | cd .. 55 | sed -i '2s/check_defconfig//' ./common/build.config.gki 56 | sed -i "s/dirty/'Wild-Exclusive+'/g" ./common/scripts/setlocalversion 57 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 58 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 59 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 60 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 61 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 62 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 63 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 64 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 65 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 66 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 67 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./common/arch/arm64/configs/gki_defconfig 68 | LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 69 | 70 | # Copy Image.lz4 71 | echo "Copying Image.lz4" 72 | cp ./out/android13-5.10/dist/Image.lz4 ../AnyKernel3/Image.lz4 73 | 74 | # Navigate to the AnyKernel3 directory 75 | echo "Navigating to AnyKernel3 directory..." 76 | cd ../AnyKernel3 77 | 78 | # Zip the files in the AnyKernel3 directory with a new naming convention 79 | ZIP_NAME="GKI-android13-5.10-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 80 | echo "Creating zip file $ZIP_NAME..." 81 | zip -r "../$ZIP_NAME" ./* 82 | 83 | # Move back to the root directory (assuming you are already in the correct directory) 84 | cd .. 85 | 86 | # GitHub Release using gh CLI 87 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 88 | REPO_NAME="android13-5.15" # Replace with your repository name 89 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 90 | RELEASE_NAME="GKI-android13-5.15-lts With KernelSU & SUSFS" # Updated release name 91 | 92 | # Create the release using gh CLI (no need to include $ROOT_DIR) 93 | echo "Creating GitHub release for $RELEASE_NAME..." 94 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 95 | --repo "$REPO_OWNER/$REPO_NAME" \ 96 | --title "$RELEASE_NAME" \ 97 | --notes "Kernel release" 98 | 99 | # Final confirmation 100 | echo "GitHub release created and zip file uploaded." 101 | echo "Build and packaging process complete." 102 | -------------------------------------------------------------------------------- /Pixel/build_kernel_fold_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="Fold-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android14-5.15 24 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-5.15 25 | git clone https://github.com/TheWildJames/lineage_kernel_patches.git 26 | 27 | # Get the kernel 28 | echo "Get the kernel..." 29 | mkdir ./fold 30 | cd ./fold 31 | repo init -u https://android.googlesource.com/kernel/manifest --depth=1 -b android-gs-felix-5.10-android15-qpr1 32 | repo sync --current-branch --no-tags -j$(nproc) 33 | 34 | # Add KernelSU 35 | cd ./aosp 36 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - 37 | 38 | #add susfs 39 | echo "adding susfs" 40 | cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/ 41 | cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-5.15.patch ./ 42 | cp ../../susfs4ksu/kernel_patches/fs/susfs.c ./fs/ 43 | cp ../../susfs4ksu/kernel_patches/include/linux/susfs.h ./include/linux/ 44 | cp ../../susfs4ksu/kernel_patches/fs/sus_su.c ./fs/ 45 | cp ../../susfs4ksu/kernel_patches/include/linux/sus_su.h ./include/linux/ 46 | cd ./KernelSU/ 47 | patch -p1 -F 3 -f < 10_enable_susfs_for_ksu.patch 48 | cd .. 49 | patch -p1 -F 3 -f < 50_add_susfs_in_gki-android14-5.15.patch 50 | 51 | #adding lineage patch 52 | #cd ../../ 53 | #cp ../lineage_kernel_patches/69_hide_lineage.patch ./android14-5.15 54 | #cd ./fold 55 | #patch -p1 < 69_hide_lineage.patch 56 | 57 | #build Kernel 58 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild-Exclusive+/g" ../build/kernel/kleaf/impl/stamp.bzl 59 | #sed -i '2s/check_defconfig//' ./build.config.gki 60 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/gki_defconfig 61 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/gki_defconfig 62 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/gki_defconfig 63 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/gki_defconfig 64 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/gki_defconfig 65 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/gki_defconfig 66 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/gki_defconfig 67 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/gki_defconfig 68 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/gki_defconfig 69 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/gki_defconfig 70 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/gki_defconfig 71 | cd .. 72 | ./build_felix.sh 73 | 74 | 75 | exit 76 | 77 | # Copy Image.lz4 78 | echo "Copying Image.lz4" 79 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../AnyKernel3/Image.lz4 80 | 81 | # Navigate to the AnyKernel3 directory 82 | echo "Navigating to AnyKernel3 directory..." 83 | cd ../AnyKernel3 84 | 85 | # Zip the files in the AnyKernel3 directory with a new naming convention 86 | ZIP_NAME="GKI-android14-5.15-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 87 | echo "Creating zip file $ZIP_NAME..." 88 | zip -r "../$ZIP_NAME" ./* 89 | 90 | # Move back to the root directory (assuming you are already in the correct directory) 91 | cd .. 92 | 93 | # GitHub Release using gh CLI 94 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 95 | REPO_NAME="android14-5.15" # Replace with your repository name 96 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 97 | RELEASE_NAME="GKI-android14-5.15 With KernelSU & SUSFS" # Updated release name 98 | 99 | # Create the release using gh CLI (no need to include $ROOT_DIR) 100 | echo "Creating GitHub release for $RELEASE_NAME..." 101 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 102 | --repo "$REPO_OWNER/$REPO_NAME" \ 103 | --title "$RELEASE_NAME" \ 104 | --notes "Kernel release" 105 | 106 | # Final confirmation 107 | echo "GitHub release created and zip file uploaded." 108 | echo "Build and packaging process complete." 109 | -------------------------------------------------------------------------------- /OnePlus/opopen_a15_build_kernel_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="OP12-A15-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android14-5.15 24 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-6.1 25 | 26 | # Get the kernel 27 | echo "Get the kernel..." 28 | mkdir oneplus_open_v 29 | cd ./oneplus_open_v 30 | repo init -u https://github.com/TheWildJames/oneplus_kernel_manifest.git -b oneplus/sm8550 -m oneplus_open_v.xml 31 | repo sync -j$(nproc) 32 | 33 | rm -rf ./kernel_platform/common/android/abi_gki_protected_exports_* 34 | 35 | # Add KernelSU 36 | echo "adding ksu" 37 | cd ./kernel_platform 38 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - 39 | cd ./KernelSU/kernel 40 | sed -i 's/ccflags-y += -DKSU_VERSION=16/ccflags-y += -DKSU_VERSION=11989/' ./Makefile 41 | cd ../../ 42 | 43 | #add susfs 44 | echo "adding susfs" 45 | cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/ 46 | cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./common/ 47 | cp ../../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/ 48 | cp ../../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/ 49 | cp ../../susfs4ksu/kernel_patches/fs/sus_su.c ./common/fs/ 50 | cp ../../susfs4ksu/kernel_patches/include/linux/sus_su.h ./common/include/linux/ 51 | cd ./KernelSU/ 52 | patch -p1 -F 3 < 10_enable_susfs_for_ksu.patch 53 | cd ../common 54 | patch -p1 -F 3 < 50_add_susfs_in_gki-android14-6.1.patch 55 | 56 | #build Kernel 57 | cd .. 58 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 59 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 60 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 61 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 62 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 63 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 64 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 65 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 66 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 67 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 68 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 69 | cd .. 70 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./kernel_platform/build/kernel/kleaf/impl/stamp.bzl 71 | sed -i "s/dirty/'Wild+'/g" ./kernel_platform/common/scripts/setlocalversion 72 | sed -i '2s/check_defconfig//' ./kernel_platform/common/build.config.gki 73 | ./kernel_platform/oplus/build/oplus_build_kernel.sh kalama gki 74 | 75 | # Copy Image.lz4 76 | echo "Copying Image" 77 | cp ./out/dist/Image ../AnyKernel3/Image 78 | 79 | # Navigate to the AnyKernel3 directory 80 | echo "Navigating to AnyKernel3 directory..." 81 | cd ../AnyKernel3 82 | 83 | # Zip the files in the AnyKernel3 directory with a new naming convention 84 | ZIP_NAME="Anykernel3-OP-A15-android14-6.1-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 85 | echo "Creating zip file $ZIP_NAME..." 86 | zip -r "../$ZIP_NAME" ./* 87 | 88 | # Move back to the root directory (assuming you are already in the correct directory) 89 | cd .. 90 | 91 | # GitHub Release using gh CLI 92 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 93 | REPO_NAME="OnePlus_KernelSU_SUSFS" # Replace with your repository name 94 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 95 | RELEASE_NAME="OP OPEN A15 KernelSU & SUSFS" # Updated release name 96 | 97 | # Create the release using gh CLI (no need to include $ROOT_DIR) 98 | echo "Creating GitHub release for $RELEASE_NAME..." 99 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 100 | --repo "$REPO_OWNER/$REPO_NAME" \ 101 | --title "$RELEASE_NAME" \ 102 | --notes "Kernel release" 103 | 104 | # Final confirmation 105 | echo "GitHub release created and zip file uploaded." 106 | echo "Build and packaging process complete." 107 | -------------------------------------------------------------------------------- /Yaap/build_kernel_a14_5.15_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="YAAP-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | #git clone https://github.com/TheWildJames/android14-5.15.git 24 | #git clone https://github.com/TheWildJames/AnyKernel3.git -b android14-5.15 25 | #git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-5.15 26 | 27 | # Get the kernel 28 | echo "Get the kernel..." 29 | mkdir yaap 30 | cd ./yaap 31 | repo init -u https://github.com/yaap/manifest.git -b fifteen --git-lfs 32 | repo sync -j$(nproc --all) --no-tags --no-clone-bundle --current-branch 33 | 34 | source build/envsetup.sh 35 | lunch yaap_device-user && m yaap 36 | 37 | exit 38 | 39 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 40 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 41 | 42 | # Add KernelSU 43 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - 44 | 45 | #add susfs 46 | echo "adding susfs" 47 | cd .. 48 | cp ./susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./android14-5.15/KernelSU/ 49 | cp ./susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-5.15.patch ./android14-5.15/common/ 50 | cp ./susfs4ksu/kernel_patches/fs/susfs.c ./android14-5.15/common/fs/ 51 | cp ./susfs4ksu/kernel_patches/include/linux/susfs.h ./android14-5.15/common/include/linux/ 52 | cp ./susfs4ksu/kernel_patches/fs/sus_su.c ./android14-5.15/common/fs/ 53 | cp ./susfs4ksu/kernel_patches/include/linux/sus_su.h ./android14-5.15/common/include/linux/ 54 | cd ./android14-5.15/KernelSU/ 55 | patch -p1 < 10_enable_susfs_for_ksu.patch 56 | cd .. 57 | cd ./common 58 | patch -p1 < 50_add_susfs_in_gki-android14-5.15.patch 59 | 60 | #build Kernel 61 | cd .. 62 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild-Exclusive+/g" ./build/kernel/kleaf/impl/stamp.bzl 63 | sed -i '2s/check_defconfig//' ./common/build.config.gki 64 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 65 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 66 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 67 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 68 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 69 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 70 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 71 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 72 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 73 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 74 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 75 | tools/bazel build --config=fast //common:kernel_aarch64_dist 76 | 77 | # Copy Image.lz4 78 | echo "Copying Image.lz4" 79 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../AnyKernel3/Image.lz4 80 | 81 | # Navigate to the AnyKernel3 directory 82 | echo "Navigating to AnyKernel3 directory..." 83 | cd ../AnyKernel3 84 | 85 | # Zip the files in the AnyKernel3 directory with a new naming convention 86 | ZIP_NAME="GKI-android14-5.15-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 87 | echo "Creating zip file $ZIP_NAME..." 88 | zip -r "../$ZIP_NAME" ./* 89 | 90 | # Move back to the root directory (assuming you are already in the correct directory) 91 | cd .. 92 | 93 | # GitHub Release using gh CLI 94 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 95 | REPO_NAME="android14-5.15" # Replace with your repository name 96 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 97 | RELEASE_NAME="GKI-android14-5.15 With KernelSU & SUSFS" # Updated release name 98 | 99 | # Create the release using gh CLI (no need to include $ROOT_DIR) 100 | echo "Creating GitHub release for $RELEASE_NAME..." 101 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 102 | --repo "$REPO_OWNER/$REPO_NAME" \ 103 | --title "$RELEASE_NAME" \ 104 | --notes "Kernel release" 105 | 106 | # Final confirmation 107 | echo "GitHub release created and zip file uploaded." 108 | echo "Build and packaging process complete." 109 | -------------------------------------------------------------------------------- /Non-GKI/build_kernel_4.14_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | # Check if 'builds' folder exists, create it if not 7 | if [ ! -d "./builds" ]; then 8 | echo "'builds' folder not found. Creating it..." 9 | mkdir -p ./builds 10 | else 11 | echo "'builds' folder already exists removing it." 12 | rm -rf ./builds 13 | mkdir -p ./builds 14 | fi 15 | 16 | # Create the root folder with the current date and time (AM/PM) 17 | cd ./builds 18 | ROOT_DIR="android-4.14-SUSFS-$(date +'%Y-%m-%d-%I-%M-%p')-release" 19 | echo "Creating root folder $ROOT_DIR..." 20 | mkdir -p "$ROOT_DIR" 21 | cd "$ROOT_DIR" 22 | 23 | # Clone the repositories into the root folder 24 | echo "Cloning repositories..." 25 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android-4.14 26 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b kernel-4.14 27 | 28 | mkdir android-4.14-stable 29 | cd ./android-4.14-stable 30 | 31 | # Get the kernel 32 | echo "Get the kernel..." 33 | echo "Initializing and syncing kernel source..." 34 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-android-4.14-stable 35 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common android-4.14-stable) 36 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 37 | 38 | # Check if the branch is deprecated and adjust the manifest 39 | if grep -q deprecated <<< $REMOTE_BRANCH; then 40 | echo "Found deprecated branch: android-4.14-stable" 41 | sed -i "s/\"android-4.14-stable\"/\"deprecated\/android-4.14-stable\"/g" $DEFAULT_MANIFEST_PATH 42 | fi 43 | 44 | repo --version 45 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 46 | 47 | # Add KernelSU 48 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 49 | 50 | #add susfs 51 | echo "adding susfs" 52 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/ 53 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_kernel-4.14.patch ./ 54 | cp ../susfs4ksu/kernel_patches/fs/* ./fs/ 55 | cp ../susfs4ksu/kernel_patches/include/linux/* ./include/linux/ 56 | cd ./KernelSU 57 | patch -p1 -F 3 < 10_enable_susfs_for_ksu.patch 58 | cd .. 59 | patch -p1 -F 3 < 50_add_susfs_in_kernel-4.14.patch 60 | 61 | #add KSU Config 62 | echo "Adding CONFIG_KSU.." 63 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/defconfig 64 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/defconfig 65 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/defconfig 66 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/defconfig 67 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/defconfig 68 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/defconfig 69 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/defconfig 70 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/defconfig 71 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/defconfig 72 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/defconfig 73 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/defconfig 74 | 75 | #build Kernel 76 | echo "Building Kernel.." 77 | make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- defconfig -j$(nproc) 78 | LTO=thin ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- BUILD_CONFIG=common/build.config.aarch64 build/build.sh 79 | 80 | exit 81 | 82 | # Copy Image.lz4 83 | echo "Copying Image.lz4" 84 | cp ./out/android12-5.10/dist/Image.lz4 ../AnyKernel3/Image.lz4 85 | 86 | # Navigate to the AnyKernel3 directory 87 | echo "Navigating to AnyKernel3 directory..." 88 | cd ../AnyKernel3 89 | 90 | # Zip the files in the AnyKernel3 directory with a new naming convention 91 | ZIP_NAME="GKI-android12-5.10-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 92 | echo "Creating zip file $ZIP_NAME..." 93 | zip -r "../$ZIP_NAME" ./* 94 | 95 | # Move back to the root directory (assuming you are already in the correct directory) 96 | cd .. 97 | 98 | # GitHub Release using gh CLI 99 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 100 | REPO_NAME="android12-5.10" # Replace with your repository name 101 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 102 | RELEASE_NAME="GKI android12-5.10 With KernelSU & SUSFS" # Updated release name 103 | 104 | # Create the release using gh CLI (no need to include $ROOT_DIR) 105 | echo "Creating GitHub release for $RELEASE_NAME..." 106 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 107 | --repo "$REPO_OWNER/$REPO_NAME" \ 108 | --title "$RELEASE_NAME" \ 109 | --notes "Kernel release" 110 | 111 | # Final confirmation 112 | echo "GitHub release created and zip file uploaded." 113 | echo "Build and packaging process complete." 114 | -------------------------------------------------------------------------------- /GKI/build_kernel_a13_5.10_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="GKI-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/android13-5.10.git -b 2024-09_r2 24 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android13-5.10 25 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android13-5.10 26 | git clone https://github.com/TheWildJames/lineage_kernel_patches.git 27 | 28 | # Get the kernel 29 | echo "Get the kernel..." 30 | cd ./android13-5.10 31 | repo init -u https://android.googlesource.com/kernel/manifest --depth=1 32 | mv manifest_12401394.xml .repo/manifests 33 | repo init -m manifest_12401394.xml 34 | repo sync --current-branch --no-tags -j$(nproc) 35 | 36 | # Add KernelSU 37 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - 38 | 39 | #add susfs 40 | echo "adding susfs" 41 | cd .. 42 | cp ./susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./android13-5.10/KernelSU/ 43 | cp ./susfs4ksu/kernel_patches/50_add_susfs_in_gki-android13-5.10.patch ./android13-5.10/common/ 44 | cp ./susfs4ksu/kernel_patches/fs/susfs.c ./android13-5.10/common/fs/ 45 | cp ./susfs4ksu/kernel_patches/include/linux/susfs.h ./android13-5.10/common/include/linux/ 46 | cp ./susfs4ksu/kernel_patches/fs/sus_su.c ./android13-5.10/common/fs/ 47 | cp ./susfs4ksu/kernel_patches/include/linux/sus_su.h ./android13-5.10/common/include/linux/ 48 | cd ./android13-5.10/KernelSU/ 49 | patch -p1 < 10_enable_susfs_for_ksu.patch 50 | cd .. 51 | cd ./common 52 | patch -p1 < 50_add_susfs_in_gki-android13-5.10.patch 53 | 54 | #adding lineage patch 55 | cd ../../ 56 | cp ./lineage_kernel_patches/69_hide_lineage.patch ./android13-5.10 57 | cd ./android13-5.10 58 | patch -p1 < 69_hide_lineage.patch 59 | 60 | #build Kernel 61 | #cd .. 62 | sed -i '2s/check_defconfig//' ./common/build.config.gki 63 | sed -i "s/dirty/'Wild-Exclusive+'/g" ./common/scripts/setlocalversion 64 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 65 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 66 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 67 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 68 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 69 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 70 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 71 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 72 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 73 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 74 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 75 | LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 76 | 77 | # Copy Image.lz4 78 | echo "Copying Image.lz4" 79 | cp ./out/android13-5.10/dist/Image.lz4 ../AnyKernel3/Image.lz4 80 | 81 | # Navigate to the AnyKernel3 directory 82 | echo "Navigating to AnyKernel3 directory..." 83 | cd ../AnyKernel3 84 | 85 | # Zip the files in the AnyKernel3 directory with a new naming convention 86 | ZIP_NAME="GKI-android13-5.10-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 87 | echo "Creating zip file $ZIP_NAME..." 88 | zip -r "../$ZIP_NAME" ./* 89 | 90 | # Move back to the root directory (assuming you are already in the correct directory) 91 | cd .. 92 | 93 | # GitHub Release using gh CLI 94 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 95 | REPO_NAME="android13-5.10" # Replace with your repository name 96 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 97 | RELEASE_NAME="GKI-android13-5.10 With KernelSU & SUSFS" # Updated release name 98 | 99 | # Create the release using gh CLI (no need to include $ROOT_DIR) 100 | echo "Creating GitHub release for $RELEASE_NAME..." 101 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 102 | --repo "$REPO_OWNER/$REPO_NAME" \ 103 | --title "$RELEASE_NAME" \ 104 | --notes "Kernel release" 105 | 106 | # Final confirmation 107 | echo "GitHub release created and zip file uploaded." 108 | echo "Build and packaging process complete." 109 | -------------------------------------------------------------------------------- /Xiaomi/build_kernel_a14_5.15_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="Xiaomi12-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | #git clone https://github.com/TheWildJames/android14-5.15.git 24 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android14-5.15 25 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-5.15 26 | 27 | # Get the kernel 28 | echo "Get the kernel..." 29 | mkdir xiaomi-8550-kernel 30 | cd ./xiaomi-8550-kernel 31 | repo init -u https://github.com/xiaomi-sm8550-kernel/kernel_manifest.git -b master 32 | repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags --optimized-fetch --prune 33 | 34 | #rm -rf ./common/android/abi_gki_protected_exports_aarch64 35 | #rm -rf ./common/android/abi_gki_protected_exports_x86_64 36 | 37 | # Add KernelSU 38 | cd ./kernel_platform 39 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - 40 | 41 | #add susfs 42 | echo "adding susfs" 43 | cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/ 44 | cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-5.15.patch ./common/ 45 | cp ../../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/ 46 | cp ../../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/ 47 | cp ../../susfs4ksu/kernel_patches/fs/sus_su.c ./common/fs/ 48 | cp ../../susfs4ksu/kernel_patches/include/linux/sus_su.h ./common/include/linux/ 49 | cd ./KernelSU/ 50 | patch -p1 < 10_enable_susfs_for_ksu.patch 51 | cd .. 52 | cd ./common 53 | patch -p1 < 50_add_susfs_in_gki-android14-5.15.patch 54 | 55 | #Adding ksu and susfs options 56 | echo "Adding KSU and SUSFS options..." 57 | cd .. 58 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 59 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 60 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 61 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 62 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 63 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 64 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 65 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 66 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 67 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 68 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 69 | sed -i '2s/check_defconfig//' ./common/build.config.gki 70 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 71 | cd .. 72 | 73 | echo "Press Enter to continue..." 74 | read # Waits for the user to press Enter 75 | 76 | # Building kernel 77 | echo "Building Kernel..." 78 | ./build.sh kalama fuxi 79 | 80 | exit 81 | 82 | # Copy Image.lz4 83 | echo "Copying Image.lz4" 84 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../AnyKernel3/Image.lz4 85 | 86 | # Navigate to the AnyKernel3 directory 87 | echo "Navigating to AnyKernel3 directory..." 88 | cd ../AnyKernel3 89 | 90 | # Zip the files in the AnyKernel3 directory with a new naming convention 91 | ZIP_NAME="Xiaomi-13-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 92 | echo "Creating zip file $ZIP_NAME..." 93 | zip -r "../$ZIP_NAME" ./* 94 | 95 | # Move back to the root directory (assuming you are already in the correct directory) 96 | cd .. 97 | 98 | # GitHub Release using gh CLI 99 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 100 | REPO_NAME="android_gki_kernel_5.15_common " # Replace with your repository name 101 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 102 | RELEASE_NAME="v24.12.03 GKI-android14-5.15 With KernelSU & SUSFS" # Updated release name 103 | 104 | # Create the release using gh CLI (no need to include $ROOT_DIR) 105 | echo "Creating GitHub release for $RELEASE_NAME..." 106 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 107 | --repo "$REPO_OWNER/$REPO_NAME" \ 108 | --title "$RELEASE_NAME" \ 109 | --notes "Kernel release" 110 | 111 | # Final confirmation 112 | echo "GitHub release created and zip file uploaded." 113 | echo "Build and packaging process complete." 114 | -------------------------------------------------------------------------------- /GKI/build_kernel_a14_5.15_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | #rm -rf ./builds 11 | #mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="GKI-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | #git clone https://github.com/TheWildJames/android14-5.15.git 24 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android14-5.15 25 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-5.15 26 | git clone https://github.com/TheWildJames/lineage_kernel_patches.git 27 | 28 | # Get the kernel 29 | echo "Get the kernel..." 30 | mkdir ./android14-5.15 31 | cp -r ~/android_kernels/android14-5.15-2024-11-r1/* ./android14-5.15 32 | cd ./android14-5.15 33 | #repo init -u https://android.googlesource.com/kernel/manifest --depth=1 34 | #mv manifest_12637676.xml .repo/manifests 35 | #repo init -m manifest_12637676.xml 36 | #repo sync --current-branch --no-tags -j$(nproc) 37 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 38 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 39 | 40 | # Add KernelSU 41 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - 42 | 43 | #add susfs 44 | echo "adding susfs" 45 | cd .. 46 | cp ./susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./android14-5.15/KernelSU/ 47 | cp ./susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-5.15.patch ./android14-5.15/common/ 48 | cp ./susfs4ksu/kernel_patches/fs/susfs.c ./android14-5.15/common/fs/ 49 | cp ./susfs4ksu/kernel_patches/include/linux/susfs.h ./android14-5.15/common/include/linux/ 50 | cd ./android14-5.15/KernelSU/ 51 | patch -p1 < 10_enable_susfs_for_ksu.patch 52 | cd .. 53 | cd ./common 54 | patch -p1 < 50_add_susfs_in_gki-android14-5.15.patch 55 | 56 | #adding lineage patch 57 | cd ../../ 58 | cp ./lineage_kernel_patches/69_hide_lineage.patch ./android14-5.15 59 | cd ./android14-5.15 60 | patch -p1 < 69_hide_lineage.patch 61 | 62 | #build Kernel 63 | #cd .. 64 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild-Exclusive+/g" ./build/kernel/kleaf/impl/stamp.bzl 65 | sed -i '2s/check_defconfig//' ./common/build.config.gki 66 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 67 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 68 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 69 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 70 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 71 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 72 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 73 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 74 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 75 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 76 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 77 | tools/bazel build --config=fast //common:kernel_aarch64_dist 78 | 79 | # Copy Image.lz4 80 | echo "Copying Image.lz4" 81 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../AnyKernel3/Image.lz4 82 | 83 | # Navigate to the AnyKernel3 directory 84 | echo "Navigating to AnyKernel3 directory..." 85 | cd ../AnyKernel3 86 | 87 | # Zip the files in the AnyKernel3 directory with a new naming convention 88 | ZIP_NAME="GKI-android14-5.15-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 89 | echo "Creating zip file $ZIP_NAME..." 90 | zip -r "../$ZIP_NAME" ./* 91 | 92 | # Move back to the root directory (assuming you are already in the correct directory) 93 | cd .. 94 | 95 | # GitHub Release using gh CLI 96 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 97 | REPO_NAME="android14-5.15" # Replace with your repository name 98 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 99 | RELEASE_NAME="GKI-android14-5.15 With KernelSU & SUSFS" # Updated release name 100 | 101 | # Create the release using gh CLI (no need to include $ROOT_DIR) 102 | echo "Creating GitHub release for $RELEASE_NAME..." 103 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 104 | --repo "$REPO_OWNER/$REPO_NAME" \ 105 | --title "$RELEASE_NAME" \ 106 | --notes "Kernel release" 107 | 108 | # Final confirmation 109 | echo "GitHub release created and zip file uploaded." 110 | echo "Build and packaging process complete." 111 | -------------------------------------------------------------------------------- /Pixel/build_kernel_redbull_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="Redbull-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b kernel-4.19 24 | git clone https://github.com/TheWildJames/kernel_patches.git 25 | 26 | # Get the kernel 27 | echo "Get the kernel..." 28 | mkdir redbull 29 | cd ./redbull 30 | repo init -u https://android.googlesource.com/kernel/manifest --depth=1 -b android-msm-redbull-4.19-android14-qpr3 31 | repo sync --current-branch --no-tags -j$(nproc) 32 | 33 | # Add KernelSU 34 | cd ./private/msm-google 35 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s susfs-4.19 36 | 37 | #add susfs 38 | echo "adding susfs" 39 | #cp ../../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 40 | cp ../../../susfs4ksu/kernel_patches/50_add_susfs_in_kernel-4.19.patch ./ 41 | cp ../../../susfs4ksu/kernel_patches/fs/susfs.c ./fs/ 42 | cp ../../../susfs4ksu/kernel_patches/include/linux/susfs.h ./include/linux/ 43 | #cd ./KernelSU-Next/ 44 | #patch -p1 -F 3 < 10_enable_susfs_for_ksu.patch 45 | #cd .. 46 | patch -p1 -F 3 < 50_add_susfs_in_kernel-4.19.patch 47 | 48 | echo "adding hooks patch" 49 | cp ../../../kernel_patches/ksu_hooks_4.14.patch ./ 50 | patch -p1 -F 3 < ksu_hooks_4.14.patch 51 | cp ../../../kernel_patches/69_hide_stuff.patch ./ 52 | patch -p1 -F 3 < 69_hide_stuff.patch 53 | 54 | #echo "adding kernel_comapt.c fix" 55 | #cp ../../../kernel_patches/kernel_compat.c_fix.patch ./ 56 | #patch -p1 --fuzz=3 < ./kernel_compat.c_fix.patch 57 | 58 | #build Kernel 59 | sed -i '2s/check_defconfig//' ./build.config.gki 60 | sed -i "s/dirty/'Wild+'/g" ./scripts/setlocalversion 61 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/redbull-gki_defconfig 62 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/redbull-gki_defconfig 63 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/redbull-gki_defconfig 64 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/redbull-gki_defconfig 65 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/redbull-gki_defconfig 66 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/redbull-gki_defconfig 67 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/redbull-gki_defconfig 68 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/redbull-gki_defconfig 69 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/redbull-gki_defconfig 70 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/redbull-gki_defconfig 71 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./arch/arm64/configs/redbull-gki_defconfig 72 | cd ../../ 73 | BUILD_AOSP_KERNEL=1 ./build_redbull-gki.sh 74 | 75 | # Copy Image.lz4 76 | echo "Copying Image.lz4" 77 | cp ./out/android-msm-pixel-4.19/dist/boot.img ./ 78 | cp ./out/android-msm-pixel-4.19/dist/dtbo_barbet.img ./ 79 | cp ./out/android-msm-pixel-4.19/dist/dtbo_redfin.img ./ 80 | cp ./out/android-msm-pixel-4.19/dist/dtbo_bramble.img ./ 81 | cp ./out/android-msm-pixel-4.19/dist/vendor_boot.img ./ 82 | 83 | FILES=($(find ./ -maxdepth 1 -type f -name "*.img")) 84 | 85 | # GitHub Release using gh CLI 86 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 87 | REPO_NAME="Pixel_KernelSU_SUSFS" # Replace with your repository name 88 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 89 | RELEASE_NAME="Redbull With KernelSU & SUSFS" # Updated release name 90 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 91 | 92 | Module: 93 | https://github.com/sidex15/ksu_module_susfs 94 | 95 | Managers: 96 | https://github.com/rifsxd/KernelSU-Next 97 | https://github.com/tiann/KernelSU 98 | 99 | Features: 100 | [+] KernelSU-Next 101 | [+] SUSFS v1.5.3 102 | [+] Maphide LineageOS Detections 103 | [+] Futile Maphide for jit-zygote-cache Detections 104 | [+] Magic Mount (Must delete /data/adb/ksu/modules.img and /data/adb/modules) 105 | " 106 | 107 | # Create the release using gh CLI (no need to include $ROOT_DIR) 108 | echo "Creating GitHub release for $RELEASE_NAME..." 109 | gh release create "$TAG_NAME" "${FILES[@]}" \ 110 | --repo "$REPO_OWNER/$REPO_NAME" \ 111 | --title "$RELEASE_NAME" \ 112 | --notes "$RELEASE_NOTES" 113 | 114 | # Final confirmation 115 | echo "GitHub release created and zip file uploaded." 116 | echo "Build and packaging process complete." 117 | -------------------------------------------------------------------------------- /Sultan/A15_gs201_build_kernel_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Create the root folder with the current date and time (AM/PM) 6 | if [ ! -d "./builds" ]; then 7 | echo "'builds' folder not found. Creating it..." 8 | mkdir -p ./builds 9 | else 10 | echo "'builds' folder already exists removing it." 11 | rm -rf ./builds 12 | mkdir -p ./builds 13 | fi 14 | 15 | cd ./builds 16 | ROOT_DIR="A15-SultanSU-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/android_kernel_google_gs201 -b 15.0.0-sultan 24 | git clone https://github.com/TheWildJames/AnyKernel3.git -b 15.0.0-sultan-gs201 25 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android13-5.10 26 | git clone https://github.com/TheWildJames/kernel_patches.git 27 | 28 | echo "Applying KernelSU..." 29 | cd ./android_kernel_google_gs201 30 | #curl -LSs "https://raw.githubusercontent.com/backslashxx/KernelSU/magic/kernel/setup.sh" | bash - 31 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 32 | 33 | echo "Applying SUSFS patches..." 34 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 35 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android13-5.10.patch ./ 36 | cp ../susfs4ksu/kernel_patches/fs/susfs.c ./fs/ 37 | cp ../susfs4ksu/kernel_patches/include/linux/susfs.h ./include/linux/ 38 | 39 | # Apply the patches 40 | cd ./KernelSU-Next 41 | #sed -i 's/KSU_EXPECTED_MAGIC_HASH := 7e0c6d7278a3bb8e364e0fcba95afaf3666cf5ff3c245a3b63c8833bd0445cc4/KSU_EXPECTED_MAGIC_HASH := 79e590113c4c4c0c222978e413a5faa801666957b1212a328e46c00c69821bf7/' ./10_enable_susfs_for_ksu.patch 42 | #sed -i 's/KSU_EXPECTED_MAGIC_SIZE := 384/KSU_EXPECTED_MAGIC_SIZE := 998/' ./10_enable_susfs_for_ksu.patch 43 | patch -p1 --fuzz=3 --forward < 10_enable_susfs_for_ksu.patch || true 44 | cd .. 45 | patch -p1 --fuzz=3 < 50_add_susfs_in_gki-android13-5.10.patch || true 46 | cp ../kernel_patches/ksu_hooks.patch ./ 47 | patch -p1 --fuzz=3 < ./ksu_hooks.patch 48 | cp ../kernel_patches/susfs_extra.patch ./ 49 | patch -p1 --fuzz=3 < ./susfs_extra.patch 50 | cp ../kernel_patches/69_hide_stuff.patch ./ 51 | patch -p1 < 69_hide_stuff.patch 52 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 53 | patch -p1 -F 3 < apk_sign.c_fix.patch 54 | 55 | # Add configuration settings for SUSFS 56 | echo "Adding configuration settings to gs201_defconfig..." 57 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/gs201_defconfig 58 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/gs201_defconfig 59 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./arch/arm64/configs/gs201_defconfig 60 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./arch/arm64/configs/gs201_defconfig 61 | 62 | # Compile the kernel 63 | echo "Compiling the kernel..." 64 | make gs201_defconfig -j$(nproc --all) 65 | make -j$(nproc --all) 66 | 67 | # Copy Image.lz4 and concatenate DTB files 68 | echo "Copying Image.lz4 and concatenating DTB files..." 69 | cp ./out/arch/arm64/boot/Image.lz4 ../AnyKernel3/Image.lz4 70 | cat ./out/arch/arm64/boot/dts/google/*.dtb > ../AnyKernel3/dtb 71 | cp ./out/arch/arm64/boot/dts/google/dtbo.img ../AnyKernel3/dtbo.img 72 | 73 | # Navigate to the AnyKernel3 directory 74 | echo "Navigating to AnyKernel3 directory..." 75 | cd ../AnyKernel3 76 | 77 | # Zip the files in the AnyKernel3 directory with a new naming convention 78 | ZIP_NAME="A15_Sultan_KernelSU_SUSFS_GS201_$(date +'%Y_%m_%d_%H_%M_%S').zip" 79 | echo "Creating zip file $ZIP_NAME..." 80 | zip -r "../$ZIP_NAME" ./* 81 | 82 | # Move back to the root directory (assuming you are already in the correct directory) 83 | cd .. 84 | 85 | # GitHub Release using gh CLI 86 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 87 | REPO_NAME="android_kernel_google_gs201" # Replace with your repository name 88 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 89 | RELEASE_NAME="Sultan With KernelSU & SUSFS for GS201" # Updated release name 90 | RELEASE_NOTE="This release contains KernelSU & SUSFS v1.5.3 & Magic Mount 91 | 92 | Module: 93 | https://github.com/sidex15/ksu_module_susfs 94 | 95 | Official Manager: 96 | https://github.com/tiann/KernelSU 97 | Non-Official Managers: 98 | https://github.com/rifsxd/KernelSU-Next 99 | https://github.com/backslashxx/KernelSU 100 | https://github.com/rsuntk/KernelSU 101 | https://github.com/5ec1cff/KernelSU 102 | https://github.com/silvzr/KernelSU 103 | https://github.com/sidex15/KernelSU 104 | 105 | 106 | Features: 107 | [+] KernelSU 108 | [+] SUSFS v1.5.3 109 | [+] Maphide for LineageOS Detections 110 | [+] Futile Maphide for jit-zygote-cache Detections 111 | [+] Magic Mount (Must delete /data/adb/ksu/modules.img and /data/adb/modules)" 112 | 113 | # Create the release using gh CLI (no need to include $ROOT_DIR) 114 | echo "Creating GitHub release for $RELEASE_NAME..." 115 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 116 | --repo "$REPO_OWNER/$REPO_NAME" \ 117 | --title "$RELEASE_NAME" \ 118 | --notes "$RELEASE_NOTE" 119 | 120 | # Final confirmation 121 | echo "GitHub release created and zip file uploaded." 122 | echo "Build and packaging process complete." 123 | -------------------------------------------------------------------------------- /Sultan/A15_zuma_build_kernel_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Create the root folder with the current date and time (AM/PM) 6 | if [ ! -d "./builds" ]; then 7 | echo "'builds' folder not found. Creating it..." 8 | mkdir -p ./builds 9 | else 10 | echo "'builds' folder already exists removing it." 11 | rm -rf ./builds 12 | mkdir -p ./builds 13 | fi 14 | 15 | cd ./builds 16 | ROOT_DIR="A15-SultanSU-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/android_kernel_google_zuma.git -b 15.0.0-sultan 24 | git clone https://github.com/TheWildJames/AnyKernel3.git -b 15.0.0-sultan-zuma 25 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-5.15 26 | git clone https://github.com/TheWildJames/kernel_patches.git 27 | 28 | echo "Applying KernelSU..." 29 | cd ./android_kernel_google_zuma 30 | #curl -LSs "https://raw.githubusercontent.com/backslashxx/KernelSU/magic/kernel/setup.sh" | bash - 31 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 32 | 33 | echo "Applying SUSFS patches..." 34 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 35 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-5.15.patch ./ 36 | cp ../susfs4ksu/kernel_patches/fs/susfs.c ./fs/ 37 | cp ../susfs4ksu/kernel_patches/include/linux/susfs.h ./include/linux/ 38 | 39 | # Apply the patches 40 | cd ./KernelSU-Next 41 | patch -p1 --fuzz=3 --forward < 10_enable_susfs_for_ksu.patch || true 42 | cd .. 43 | patch -p1 --fuzz=3 < 50_add_susfs_in_gki-android14-5.15.patch || true 44 | 45 | cp ../kernel_patches/ksu_hooks.patch ./ 46 | patch -p1 --fuzz=3 < ./ksu_hooks.patch 47 | 48 | cp ../kernel_patches/69_hide_stuff.patch ./ 49 | patch -p1 < 69_hide_stuff.patch 50 | 51 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 52 | patch -p1 -F 3 < apk_sign.c_fix.patch 53 | cp ../kernel_patches/core_hook.c_fix.patch ./ 54 | patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 55 | cp ../kernel_patches/selinux.c_fix.patch ./ 56 | patch -p1 --fuzz=3 < ./selinux.c_fix.patch 57 | 58 | cp ../kernel_patches/sys.c_fix.patch ./ 59 | patch -p1 --fuzz=3 < ./sys.c_fix.patch 60 | 61 | cp ../kernel_patches/mount.h_fix.patch ./ 62 | patch -p1 --fuzz=3 < ./mount.h_fix.patch 63 | cp ../kernel_patches/sched.h_fix.patch ./ 64 | patch -p1 --fuzz=3 < ./sched.h_fix.patch 65 | cp ../kernel_patches/user.h_fix.patch ./ 66 | patch -p1 --fuzz=3 < ./user.h_fix.patch 67 | 68 | sed -i "s/poofed_size: '%u'/poofed_size: '%llu'/g" ./fs/susfs.c 69 | sed -i "s/length of string: %u/length of string: %lu/g" ./fs/susfs.c 70 | 71 | # Add configuration settings for SUSFS 72 | echo "Adding configuration settings to zuma_defconfig..." 73 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/zuma_defconfig 74 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/zuma_defconfig 75 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./arch/arm64/configs/zuma_defconfig 76 | 77 | # Compile the kernel 78 | echo "Compiling the kernel..." 79 | make zuma_defconfig -j$(nproc --all) 80 | make -j$(nproc --all) 81 | 82 | # Copy Image.lz4 and concatenate DTB files 83 | echo "Copying Image.lz4 and concatenating DTB files..." 84 | cp ./out/arch/arm64/boot/Image.lz4 ../AnyKernel3/Image.lz4 85 | cat ./out/google-modules/soc/gs/arch/arm64/boot/dts/google/*.dtb > ../AnyKernel3/dtb 86 | 87 | # Navigate to the AnyKernel3 directory 88 | echo "Navigating to AnyKernel3 directory..." 89 | cd ../AnyKernel3 90 | 91 | # Zip the files in the AnyKernel3 directory with a new naming convention 92 | ZIP_NAME="A15_Sultan_KernelSU_SUSFS_Zuma_$(date +'%Y_%m_%d_%H_%M_%S').zip" 93 | echo "Creating zip file $ZIP_NAME..." 94 | zip -r "../$ZIP_NAME" ./* 95 | 96 | # Move back to the root directory (assuming you are already in the correct directory) 97 | cd .. 98 | 99 | # GitHub Release using gh CLI 100 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 101 | REPO_NAME="android_kernel_google_zuma" # Replace with your repository name 102 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 103 | RELEASE_NAME="Sultan With KernelSU & SUSFS for Zuma" # Updated release name 104 | RELEASE_NOTE="This release contains KernelSU & SUSFS v1.5.3 & Magic Mount 105 | 106 | Module: 107 | https://github.com/sidex15/ksu_module_susfs 108 | 109 | Official Manager: 110 | https://github.com/tiann/KernelSU 111 | Non-Official Managers: 112 | https://github.com/rifsxd/KernelSU-Next 113 | https://github.com/backslashxx/KernelSU 114 | https://github.com/rsuntk/KernelSU 115 | https://github.com/5ec1cff/KernelSU 116 | https://github.com/silvzr/KernelSU 117 | https://github.com/sidex15/KernelSU 118 | 119 | Features: 120 | [+] KernelSU 121 | [+] SUSFS v1.5.3 122 | [+] Maphide for LineageOS Detections 123 | [+] Futile Maphide for jit-zygote-cache Detections 124 | [+] Magic Mount (Must delete /data/adb/ksu/modules.img and /data/adb/modules)" 125 | 126 | # Create the release using gh CLI (no need to include $ROOT_DIR) 127 | echo "Creating GitHub release for $RELEASE_NAME..." 128 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 129 | --repo "$REPO_OWNER/$REPO_NAME" \ 130 | --title "$RELEASE_NAME" \ 131 | --notes "$RELEASE_NOTE" 132 | 133 | # Final confirmation 134 | echo "GitHub release created and zip file uploaded." 135 | echo "Build and packaging process complete." 136 | -------------------------------------------------------------------------------- /OnePlus/op12_a15_build_kernel_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="OP12-A15-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android14-5.15 24 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-6.1 25 | git clone https://github.com/TheWildJames/kernel_patches.git 26 | 27 | # Get the kernel 28 | echo "Get the kernel..." 29 | mkdir oneplus12_v 30 | cd ./oneplus12_v 31 | repo init -u https://github.com/OnePlusOSS/kernel_manifest.git -b oneplus/sm8650 -m oneplus12_v.xml 32 | repo sync -j$(nproc) 33 | 34 | rm -rf ./kernel_platform/common/android/abi_gki_protected_exports_* 35 | 36 | # Add KernelSU 37 | echo "adding ksu" 38 | cd ./kernel_platform 39 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 40 | cd ./KernelSU-Next/kernel 41 | sed -i 's/ccflags-y += -DKSU_VERSION=16/ccflags-y += -DKSU_VERSION=12000/' ./Makefile 42 | cd ../../ 43 | 44 | #add susfs 45 | echo "adding susfs" 46 | cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 47 | cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./common/ 48 | cp ../../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/ 49 | cp ../../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/ 50 | cd ./KernelSU-Next/ 51 | patch -p1 < 10_enable_susfs_for_ksu.patch 52 | cd ../common 53 | patch -p1 < 50_add_susfs_in_gki-android14-6.1.patch || true 54 | cp ../../kernel_patches/69_hide_stuff.patch ./ 55 | patch -p1 -F 3 < 69_hide_stuff.patch || true 56 | cd .. 57 | cp ../kernel_patches/selinux.c_fix.patch ./ 58 | patch -p1 -F 3 < selinux.c_fix.patch 59 | 60 | cp ../kernel_patches/core_hook.c_fix.patch ./ 61 | patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 62 | 63 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 64 | patch -p1 -F 3 < apk_sign.c_fix.patch 65 | 66 | 67 | #build Kernel 68 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 69 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 70 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 71 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 72 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 73 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 74 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 75 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 76 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 77 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 78 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 79 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 80 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 81 | echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 82 | echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 83 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 84 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfigig 85 | cd .. 86 | sed -i '2s/check_defconfig//' ./kernel_platform/common/build.config.gki 87 | ./kernel_platform/oplus/build/oplus_build_kernel.sh pineapple gki 88 | 89 | # Copy Image.lz4 90 | echo "Copying Image" 91 | cp ./out/dist/Image ../AnyKernel3/Image 92 | 93 | # Navigate to the AnyKernel3 directory 94 | echo "Navigating to AnyKernel3 directory..." 95 | cd ../AnyKernel3 96 | 97 | # Zip the files in the AnyKernel3 directory with a new naming convention 98 | ZIP_NAME="Anykernel3-OP-A15-android14-6.1-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 99 | echo "Creating zip file $ZIP_NAME..." 100 | zip -r "../$ZIP_NAME" ./* 101 | 102 | # Move back to the root directory (assuming you are already in the correct directory) 103 | cd .. 104 | 105 | # GitHub Release using gh CLI 106 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 107 | REPO_NAME="OnePlus_KernelSU_SUSFS" # Replace with your repository name 108 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 109 | RELEASE_NAME="OP12 A15 android14-6.1 With KernelSU & SUSFS" # Updated release name 110 | 111 | # Create the release using gh CLI (no need to include $ROOT_DIR) 112 | echo "Creating GitHub release for $RELEASE_NAME..." 113 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 114 | --repo "$REPO_OWNER/$REPO_NAME" \ 115 | --title "$RELEASE_NAME" \ 116 | --notes "Kernel release" 117 | 118 | # Final confirmation 119 | echo "GitHub release created and zip file uploaded." 120 | echo "Build and packaging process complete." 121 | -------------------------------------------------------------------------------- /OnePlus/nord4_a15_build_kernel_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Check if 'builds' folder exists, create it if not 5 | if [ ! -d "./builds" ]; then 6 | echo "'builds' folder not found. Creating it..." 7 | mkdir -p ./builds 8 | else 9 | echo "'builds' folder already exists removing it." 10 | rm -rf ./builds 11 | mkdir -p ./builds 12 | fi 13 | 14 | # Create the root folder with the current date and time (AM/PM) 15 | cd ./builds 16 | ROOT_DIR="Nord4-A15-$(date +'%Y-%m-%d-%I-%M-%p')-release" 17 | echo "Creating root folder $ROOT_DIR..." 18 | mkdir -p "$ROOT_DIR" 19 | cd "$ROOT_DIR" 20 | 21 | # Clone the repositories into the root folder 22 | echo "Cloning repositories..." 23 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android14-6.1 24 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-6.1 25 | git clone https://github.com/TheWildJames/kernel_patches.git 26 | 27 | # Get the kernel 28 | echo "Get the kernel..." 29 | mkdir nord4 30 | cd ./nord4 31 | repo init -u https://github.com/OnePlusOSS/kernel_manifest.git -b oneplus/sm7675 -m oneplus_nord_4_v.xml 32 | repo sync -j$(nproc) 33 | 34 | rm -rf ./kernel_platform/common/android/abi_gki_protected_exports_* 35 | 36 | # Add KernelSU 37 | echo "adding ksu" 38 | cd ./kernel_platform 39 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash - 40 | cd ./KernelSU-Next/kernel 41 | sed -i 's/ccflags-y += -DKSU_VERSION=16/ccflags-y += -DKSU_VERSION=12000/' ./Makefile 42 | cd ../../ 43 | 44 | #add susfs 45 | echo "adding susfs" 46 | cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 47 | cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./common/ 48 | cp ../../susfs4ksu/kernel_patches/fs/* ./common/fs/ 49 | cp ../../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 50 | cd ./KernelSU-Next/ 51 | patch -p1 < 10_enable_susfs_for_ksu.patch 52 | cd ../common 53 | patch -p1 < 50_add_susfs_in_gki-android14-6.1.patch 54 | 55 | cp ../../kernel_patches/69_hide_stuff.patch ./ 56 | patch -p1 -F 3 < 69_hide_stuff.patch 57 | cd .. 58 | 59 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 60 | patch -p1 -F 3 < apk_sign.c_fix.patch 61 | 62 | cp ../kernel_patches/core_hook.c_fix.patch ./ 63 | patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 64 | 65 | cp ../kernel_patches/selinux.c_fix.patch ./ 66 | patch -p1 -F 3 < selinux.c_fix.patch 67 | 68 | #build Kernel 69 | cd .. 70 | echo "Adding configuration settings to gki_defconfig..." 71 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 72 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 73 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 74 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 75 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 76 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 77 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 78 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 79 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 80 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 81 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 82 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 83 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 84 | echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 85 | echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 86 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 87 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfigig 88 | 89 | cd .. 90 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./kernel_platform/build/kernel/kleaf/impl/stamp.bzl 91 | sed -i "s/dirty/'Wild+'/g" ./kernel_platform/common/scripts/setlocalversion 92 | sed -i '2s/check_defconfig//' ./kernel_platform/common/build.config.gki 93 | 94 | sed -i 's/^#\(choose_lto_type \$3\|choose_target_build \$4\|choose_repack_img \$5\)/\1/' ./kernel_platform/oplus/build/oplus_setup.sh 95 | sed -i 's|^source kernel_platform/oplus/build/oplus_setup.sh \$1 \$2|source kernel_platform/oplus/build/oplus_setup.sh \$1 \$2 \$3 \$4 \$5|' ./kernel_platform/oplus/build/oplus_build_kernel.sh 96 | 97 | ./kernel_platform/oplus/build/oplus_build_kernel.sh pineapple gki full all none 98 | 99 | # Copy Image.lz4 100 | echo "Copying Image" 101 | cp ./out/dist/Image ../AnyKernel3/Image 102 | 103 | # Navigate to the AnyKernel3 directory 104 | echo "Navigating to AnyKernel3 directory..." 105 | cd ../AnyKernel3 106 | 107 | # Zip the files in the AnyKernel3 directory with a new naming convention 108 | ZIP_NAME="Anykernel3-OP-A15-android14-6.1-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 109 | echo "Creating zip file $ZIP_NAME..." 110 | zip -r "../$ZIP_NAME" ./* 111 | 112 | # Move back to the root directory (assuming you are already in the correct directory) 113 | cd .. 114 | 115 | # GitHub Release using gh CLI 116 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 117 | REPO_NAME="OnePlus_KernelSU_SUSFS" # Replace with your repository name 118 | 119 | # Get the latest tag from the GitHub repository using the GitHub CLI 120 | LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name') 121 | 122 | # If no tags are found, default to 1.5.3-0 123 | if [ -z "$LATEST_TAG" ]; then 124 | LATEST_TAG="1.5.3-0" 125 | fi 126 | 127 | # Increment the suffix after the dash 128 | NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}') 129 | 130 | TAG_NAME="$NEW_TAG" 131 | RELEASE_NAME="OP Nord 4 A15 android14-6.1 With KernelSU & SUSFS" # Updated release name 132 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 133 | 134 | Module: https://github.com/sidex15/ksu_module_susfs 135 | 136 | Official Manager: 137 | https://github.com/tiann/KernelSU 138 | Non-Official Managers: 139 | https://github.com/rifsxd/KernelSU-Next 140 | https://github.com/backslashxx/KernelSU 141 | https://github.com/rsuntk/KernelSU 142 | https://github.com/5ec1cff/KernelSU 143 | https://github.com/silvzr/KernelSU 144 | https://github.com/sidex15/KernelSU 145 | 146 | Features: 147 | [+] KernelSU-Next 148 | [+] SUSFS v1.5.3 149 | [+] Wireguard Support 150 | [+] Maphide LineageOS Detections 151 | [+] Futile Maphide for jit-zygote-cache Detections 152 | [+] Magic Mount Support 153 | [+] Built With LTO=Full, Optimizations For Improved Performance And Efficiency 154 | " 155 | 156 | # Create the release using gh CLI (no need to include $ROOT_DIR) 157 | echo "Creating GitHub release for $RELEASE_NAME..." 158 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 159 | --repo "$REPO_OWNER/$REPO_NAME" \ 160 | --title "$RELEASE_NAME" \ 161 | --notes "$RELEASE_NOTES" 162 | 163 | # Final confirmation 164 | echo "GitHub release created and zip file uploaded." 165 | echo "Build and packaging process complete." 166 | -------------------------------------------------------------------------------- /Non-GKI/aio_non_gki_build_kernel_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | # Array with configurations (e.g., android-version-kernel-version-date) 26 | BUILD_CONFIGS=( 27 | #"android-4.9" 28 | "android-4.14-stable" 29 | #android-4.19-stable" 30 | #"android11-5.4" 31 | #"android12-5.4" 32 | ) 33 | 34 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 35 | declare -A RELEASE_ZIPS=() 36 | 37 | # Iterate over configurations 38 | build_config() { 39 | CONFIG=$1 40 | CONFIG_DETAILS=${CONFIG} 41 | 42 | # Create a directory named after the current configuration 43 | echo "Creating folder for configuration: $CONFIG..." 44 | mkdir -p "$CONFIG" 45 | cd "$CONFIG" 46 | 47 | # Split the config details into individual components 48 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION STABLE <<< "$CONFIG_DETAILS" 49 | 50 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 51 | if [ "${STABLE:-}" = "stable" ]; then 52 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${STABLE}" 53 | else 54 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}" 55 | fi 56 | 57 | 58 | # Log file for this build in case of failure 59 | LOG_FILE="../${CONFIG}_build.log" 60 | 61 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 62 | # Check if AnyKernel3 repo exists, remove it if it does 63 | if [ -d "./AnyKernel3" ]; then 64 | echo "Removing existing AnyKernel3 directory..." 65 | rm -rf ./AnyKernel3 66 | fi 67 | echo "Cloning AnyKernel3 repository..." 68 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "${ANDROID_VERSION}-${KERNEL_VERSION}" 69 | 70 | # Check if susfs4ksu repo exists, remove it if it does 71 | if [ -d "./susfs4ksu" ]; then 72 | echo "Removing existing susfs4ksu directory..." 73 | rm -rf ./susfs4ksu 74 | fi 75 | echo "Cloning susfs4ksu repository..." 76 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "kernel-${KERNEL_VERSION}" 77 | 78 | # Setup directory for each build 79 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 80 | 81 | # Check if the source directory exists and is a directory 82 | if [ -d "$SOURCE_DIR" ]; then 83 | # Copy the directory to the current working directory 84 | echo "Copying $SOURCE_DIR to ./" 85 | cp -r "$SOURCE_DIR" ./ 86 | echo "Successfully copied $SOURCE_DIR to ./" 87 | else 88 | mkdir -p "$CONFIG" 89 | fi 90 | 91 | cd "$CONFIG" 92 | 93 | # Initialize and sync kernel source with updated repo commands 94 | echo "Initializing and syncing kernel source..." 95 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 96 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 97 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 98 | 99 | # Check if the branch is deprecated and adjust the manifest 100 | if grep -q deprecated <<< $REMOTE_BRANCH; then 101 | echo "Found deprecated branch: $FORMATTED_BRANCH" 102 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 103 | fi 104 | 105 | # Verify repo version and sync 106 | repo --version 107 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 108 | 109 | # Apply KernelSU and SUSFS patches 110 | echo "Adding KernelSU..." 111 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 112 | 113 | echo "Applying SUSFS patches..." 114 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/ 115 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_kernel-${KERNEL_VERSION}.patch ./common/ 116 | cp ../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/ 117 | cp ../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/ 118 | cp ../susfs4ksu/kernel_patches/fs/sus_su.c ./common/fs/ 119 | cp ../susfs4ksu/kernel_patches/include/linux/sus_su.h ./common/include/linux/ 120 | 121 | # Apply the patches 122 | cd ./KernelSU 123 | patch -p1 -f -F 3 < 10_enable_susfs_for_ksu.patch || true 124 | cd ../common 125 | patch -p1 -f -F 3 < 50_add_susfs_in_kernel-${KERNEL_VERSION}.patch || true 126 | cd .. 127 | 128 | # Add configuration settings for SUSFS 129 | echo "Adding configuration settings to defconfig..." 130 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/defconfig 131 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/defconfig 132 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/defconfig 133 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/defconfig 134 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/defconfig 135 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/defconfig 136 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/defconfig 137 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/defconfig 138 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/defconfig 139 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/defconfig 140 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/defconfig 141 | 142 | # Build kernel 143 | echo "Building kernel for $CONFIG..." 144 | #sed -i '2s/check_defconfig//' ./common/build.config.aarch64 145 | #sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 146 | cd ./common 147 | make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- defconfig -j$(nproc) 148 | make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) 149 | #LTO=thin BUILD_CONFIG=common/build.config.aarch64 build/build.sh 150 | 151 | # Copying to AnyKernel3 152 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 153 | cp ./out/${FORMATTED_BRANCH}/dist/Image ../ 154 | gzip -n -k -f -9 ../Image >../Image.gz 155 | gzip -n -k -f -9 ../Image >../Image.lz4 156 | 157 | # Create zip in the same directory 158 | cd ../AnyKernel3 159 | ZIP_NAME="AnyKernel3-${FORMATTED_BRANCH}.zip" 160 | echo "Creating zip file: $ZIP_NAME..." 161 | mv ../Image ./Image 162 | zip -r "../../$ZIP_NAME" ./* 163 | rm ./Image 164 | ZIP_NAME="AnyKernel3-lz4-${FORMATTED_BRANCH}.zip" 165 | echo "Creating zip file: $ZIP_NAME..." 166 | mv ../Image.lz4 ./Image.lz4 167 | zip -r "../../$ZIP_NAME" ./* 168 | rm ./Image.lz4 169 | ZIP_NAME="AnyKernel3-gz-${FORMATTED_BRANCH}.zip" 170 | echo "Creating zip file: $ZIP_NAME..." 171 | mv ../Image.gz ./Image.gz 172 | zip -r "../../$ZIP_NAME" ./* 173 | rm ./Image.gz 174 | cd ../../ 175 | 176 | RELEASE_ZIPS["$FORMATTED_BRANCH"]+="./$ZIP_NAME " 177 | 178 | # Delete the $CONFIG folder after building 179 | echo "Deleting $CONFIG folder..." 180 | rm -rf "$CONFIG" 181 | } 182 | 183 | # Concurrent build management 184 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 185 | # Start the build process in the background 186 | build_config "$CONFIG" & 187 | 188 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 189 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 190 | sleep 1 # Check every second for free slots 191 | done 192 | done 193 | 194 | wait 195 | 196 | echo "Build process complete." 197 | 198 | # Collect all zip and img files 199 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 200 | 201 | # GitHub repository details 202 | REPO_OWNER="TheWildJames" 203 | REPO_NAME="Non_GKI_KernelSU_SUSFS" 204 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" 205 | RELEASE_NAME="Non-GKI Kernels With KernelSU & SUSFS v1.5.2" 206 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.2" 207 | 208 | # Create the GitHub release 209 | echo "Creating GitHub release: $RELEASE_NAME..." 210 | gh release create "$TAG_NAME" "${FILES[@]}" \ 211 | --repo "$REPO_OWNER/$REPO_NAME" \ 212 | --title "$RELEASE_NAME" \ 213 | --notes "$RELEASE_NOTES" 214 | 215 | echo "GitHub release created with the following files:" 216 | printf '%s\n' "${FILES[@]}" 217 | 218 | -------------------------------------------------------------------------------- /Samsung/build_kernel_4.14_susfs_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | # Check if 'builds' folder exists, create it if not 7 | if [ ! -d "./builds" ]; then 8 | echo "'builds' folder not found. Creating it..." 9 | mkdir -p ./builds 10 | else 11 | echo "'builds' folder already exists removing it." 12 | rm -rf ./builds 13 | mkdir -p ./builds 14 | fi 15 | 16 | # Create the root folder with the current date and time (AM/PM) 17 | cd ./builds 18 | ROOT_DIR="android-4.14-SUSFS-$(date +'%Y-%m-%d-%I-%M-%p')-release" 19 | echo "Creating root folder $ROOT_DIR..." 20 | mkdir -p "$ROOT_DIR" 21 | cd "$ROOT_DIR" 22 | 23 | # Clone the repositories into the root folder 24 | echo "Cloning repositories..." 25 | git clone https://github.com/TheWildJames/android_kernel_samsung_exynos9820.git 26 | git clone https://github.com/TheWildJames/AnyKernel3.git -b android12-5.10 27 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b kernel-4.14 28 | 29 | # Get the kernel 30 | echo "Get the kernel..." 31 | cd ./android_kernel_samsung_exynos9820 32 | rm -rf ./KernelSU 33 | 34 | # Add KernelSU 35 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 36 | 37 | #add susfs 38 | echo "adding susfs" 39 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/ 40 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_kernel-4.14.patch ./ 41 | cp ../susfs4ksu/kernel_patches/fs/* ./fs/ 42 | cp ../susfs4ksu/kernel_patches/include/linux/* ./include/linux/ 43 | cd ./KernelSU 44 | patch -p1 -F 3 < 10_enable_susfs_for_ksu.patch 45 | cd .. 46 | patch -p1 -F 3 < 50_add_susfs_in_kernel-4.14.patch 47 | 48 | #add KSU Config 49 | echo "Adding CONFIG_KSU.." 50 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 51 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 52 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 53 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 54 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 55 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 56 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 57 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 58 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 59 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 60 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyond0lte_defconfig 61 | 62 | echo "Adding CONFIG_KSU.." 63 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 64 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 65 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 66 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 67 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 68 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 69 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 70 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 71 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 72 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 73 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyond0lteks_defconfig 74 | 75 | echo "Adding CONFIG_KSU.." 76 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 77 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 78 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 79 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 80 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 81 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 82 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 83 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 84 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 85 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 86 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyond1lte_defconfig 87 | 88 | echo "Adding CONFIG_KSU.." 89 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 90 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 91 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 92 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 93 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 94 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 95 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 96 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 97 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 98 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 99 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyond1lteks_defconfig 100 | 101 | echo "Adding CONFIG_KSU.." 102 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 103 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 104 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 105 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 106 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 107 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 108 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 109 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 110 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 111 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 112 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyond2lte_defconfig 113 | 114 | echo "Adding CONFIG_KSU.." 115 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 116 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 117 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 118 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 119 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 120 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 121 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 122 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 123 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 124 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 125 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyond2lteks_defconfig 126 | 127 | echo "Adding CONFIG_KSU.." 128 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 129 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 130 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 131 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 132 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 133 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 134 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 135 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 136 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 137 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 138 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyondx_defconfig 139 | 140 | echo "Adding CONFIG_KSU.." 141 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 142 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 143 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 144 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 145 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 146 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 147 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 148 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 149 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 150 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 151 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_beyondxks_defconfig 152 | 153 | echo "Adding CONFIG_KSU.." 154 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_d1_defconfig 155 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_d1_defconfig 156 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_d1_defconfig 157 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_d1_defconfig 158 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_d1_defconfig 159 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_d1_defconfig 160 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_d1_defconfig 161 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_d1_defconfig 162 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_d1_defconfig 163 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_d1_defconfig 164 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_d1_defconfig 165 | 166 | echo "Adding CONFIG_KSU.." 167 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 168 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 169 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 170 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 171 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 172 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 173 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 174 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 175 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 176 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 177 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_d1xks_defconfig 178 | 179 | echo "Adding CONFIG_KSU.." 180 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 181 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 182 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 183 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 184 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 185 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 186 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 187 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 188 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 189 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 190 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_d2s_defconfig 191 | 192 | echo "Adding CONFIG_KSU.." 193 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 194 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 195 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 196 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 197 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 198 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 199 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 200 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 201 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 202 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 203 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_d2x_defconfig 204 | 205 | echo "Adding CONFIG_KSU.." 206 | echo "CONFIG_KSU=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 207 | echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 208 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 209 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 210 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 211 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 212 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 213 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 214 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 215 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 216 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./arch/arm64/configs/extreme_d2xks_defconfig 217 | #build Kernel 218 | echo "Building Kernel.." 219 | ./build.sh -m d1 220 | 221 | exit 222 | 223 | # Copy Image.lz4 224 | echo "Copying Image.lz4" 225 | cp ./out/android12-5.10/dist/Image.lz4 ../AnyKernel3/Image.lz4 226 | 227 | # Navigate to the AnyKernel3 directory 228 | echo "Navigating to AnyKernel3 directory..." 229 | cd ../AnyKernel3 230 | 231 | # Zip the files in the AnyKernel3 directory with a new naming convention 232 | ZIP_NAME="GKI-android12-5.10-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" 233 | echo "Creating zip file $ZIP_NAME..." 234 | zip -r "../$ZIP_NAME" ./* 235 | 236 | # Move back to the root directory (assuming you are already in the correct directory) 237 | cd .. 238 | 239 | # GitHub Release using gh CLI 240 | REPO_OWNER="TheWildJames" # Replace with your GitHub username 241 | REPO_NAME="android12-5.10" # Replace with your repository name 242 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" # Unique tag with timestamp to ensure multiple releases on the same day 243 | RELEASE_NAME="GKI android12-5.10 With KernelSU & SUSFS" # Updated release name 244 | 245 | # Create the release using gh CLI (no need to include $ROOT_DIR) 246 | echo "Creating GitHub release for $RELEASE_NAME..." 247 | gh release create "$TAG_NAME" "$ZIP_NAME" \ 248 | --repo "$REPO_OWNER/$REPO_NAME" \ 249 | --title "$RELEASE_NAME" \ 250 | --notes "Kernel release" 251 | 252 | # Final confirmation 253 | echo "GitHub release created and zip file uploaded." 254 | echo "Build and packaging process complete." 255 | -------------------------------------------------------------------------------- /GKI/aio_gki_build_susfs142_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | BUILD_CONFIGS=( 26 | #"android12-5.10-198-2024-01" 27 | #"android12-5.10-205-2024-03" 28 | #"android12-5.10-209-2024-05" 29 | #"android12-5.10-218-2024-08" 30 | #"android12-5.10-X-lts" 31 | 32 | #"android13-5.10-189-2023-11" 33 | #"android13-5.10-198-2024-01" 34 | #"android13-5.10-205-2024-03" 35 | #"android13-5.10-209-2024-05" 36 | #"android13-5.10-210-2024-06" 37 | #"android13-5.10-214-2024-07" 38 | #"android13-5.10-218-2024-08" 39 | #"android13-5.10-X-lts" 40 | 41 | #"android13-5.15-94-2023-05" 42 | "android13-5.15-123-2023-11" 43 | #"android13-5.15-137-2024-01" 44 | #"android13-5.15-144-2024-03" 45 | #"android13-5.15-148-2024-05" 46 | #"android13-5.15-149-2024-07" 47 | #"android13-5.15-151-2024-08" 48 | #"android13-5.15-167-2024-11" 49 | #"android13-5.15-X-lts" 50 | 51 | #"android14-5.15-131-2023-11" 52 | #"android14-5.15-137-2024-01" 53 | #"android14-5.15-144-2024-03" 54 | #"android14-5.15-148-2024-05" 55 | #"android14-5.15-149-2024-06" 56 | #"android14-5.15-153-2024-07" 57 | #"android14-5.15-158-2024-08" 58 | #"android14-5.15-167-2024-11" 59 | #"android14-5.15-X-lts" 60 | 61 | #"android14-6.1-25-2023-10" 62 | #"android14-6.1-43-2023-11" 63 | #"android14-6.1-57-2024-01" 64 | #"android14-6.1-68-2024-03" 65 | #"android14-6.1-75-2024-05" 66 | #"android14-6.1-78-2024-06" 67 | #"android14-6.1-84-2024-07" 68 | #"android14-6.1-90-2024-08" 69 | #"android14-6.1-112-2024-11" 70 | #"android14-6.1-115-2024-12" 71 | #"android14-6.1-X-lts" 72 | 73 | #"android15-6.6-30-2024-08" 74 | ) 75 | 76 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 77 | declare -A RELEASE_ZIPS=() 78 | 79 | # Iterate over configurations 80 | build_config() { 81 | CONFIG=$1 82 | CONFIG_DETAILS=${CONFIG} 83 | 84 | # Create a directory named after the current configuration 85 | echo "Creating folder for configuration: $CONFIG..." 86 | mkdir -p "$CONFIG" 87 | cd "$CONFIG" 88 | 89 | # Split the config details into individual components 90 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION SUB_LEVEL DATE <<< "$CONFIG_DETAILS" 91 | 92 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 93 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${DATE}" 94 | 95 | # Log file for this build in case of failure 96 | LOG_FILE="../${CONFIG}_build.log" 97 | 98 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 99 | echo "Cloning AnyKernel3 repository..." 100 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "${ANDROID_VERSION}-${KERNEL_VERSION}" 101 | echo "Cloning susfs4ksu repository..." 102 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "1.4.2-gki-${ANDROID_VERSION}-${KERNEL_VERSION}" 103 | echo "Cloning kernel_patches repository..." 104 | git clone https://github.com/TheWildJames/kernel_patches.git 105 | 106 | # Setup directory for each build 107 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 108 | 109 | # Check if the source directory exists and is a directory 110 | if [ -d "$SOURCE_DIR" ]; then 111 | # Copy the directory to the current working directory 112 | echo "Copying $SOURCE_DIR to ./" 113 | cp -r "$SOURCE_DIR" ./ 114 | echo "Successfully copied $SOURCE_DIR to ./" 115 | else 116 | mkdir -p "$CONFIG" 117 | fi 118 | 119 | cd "$CONFIG" 120 | 121 | # Initialize and sync kernel source with updated repo commands 122 | echo "Initializing and syncing kernel source..." 123 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 124 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 125 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 126 | 127 | # Check if the branch is deprecated and adjust the manifest 128 | if grep -q deprecated <<< $REMOTE_BRANCH; then 129 | echo "Found deprecated branch: $FORMATTED_BRANCH" 130 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 131 | fi 132 | 133 | # Verify repo version and sync 134 | repo --version 135 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 136 | 137 | # Apply KernelSU and SUSFS patches 138 | echo "Adding KernelSU..." 139 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 140 | 141 | echo "Applying SUSFS patches..." 142 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 143 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch ./common/ 144 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 145 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 146 | cp ../susfs4ksu/kernel_patches/KernelSU/kernel/* ./KernelSU-Next/kernel/ 147 | 148 | # Apply the patches 149 | cd ./KernelSU-Next 150 | patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true 151 | cd ../common 152 | patch -p1 < 50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch || true 153 | cp ../../kernel_patches/69_hide_stuff.patch ./ 154 | patch -p1 -F 3 < 69_hide_stuff.patch 155 | cd .. 156 | 157 | #cp ../kernel_patches/apk_sign.c_fix.patch ./ 158 | #patch -p1 -F 3 < apk_sign.c_fix.patch 159 | 160 | #cp ../kernel_patches/core_hook.c_fix.patch ./ 161 | #patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 162 | 163 | #cp ../kernel_patches/selinux.c_fix.patch ./ 164 | #patch -p1 -F 3 < selinux.c_fix.patch 165 | 166 | # Add configuration settings for SUSFS 167 | echo "Adding configuration settings to gki_defconfig..." 168 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 169 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 170 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 171 | #echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 172 | #echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 173 | #echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 174 | #echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 175 | #echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n" >> ./common/arch/arm64/configs/zuma_defconfig 176 | 177 | # Build kernel 178 | echo "Building kernel for $CONFIG..." 179 | 180 | # Check if build.sh exists, if it does, run the default build script 181 | if [ -e build/build.sh ]; then 182 | echo "build.sh found, running default build script..." 183 | # Modify config files for the default build process 184 | sed -i '2s/check_defconfig//' ./common/build.config.gki 185 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 186 | LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 187 | 188 | # Copying to AnyKernel3 189 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 190 | 191 | # Check if the boot.img file exists 192 | if [ "$ANDROID_VERSION" = "android12" ]; then 193 | mkdir bootimgs 194 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 195 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 196 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 197 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 198 | gzip -n -k -f -9 ../Image >../Image.gz 199 | cd ./bootimgs 200 | 201 | GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${DATE}"_r1.zip 202 | FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip 203 | status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null) 204 | 205 | if [ "$status" = "200" ]; then 206 | curl -Lo gki-kernel.zip "$GKI_URL" 207 | else 208 | echo "[+] $GKI_URL not found, using $FALLBACK_URL" 209 | curl -Lo gki-kernel.zip "$FALLBACK_URL" 210 | fi 211 | 212 | unzip gki-kernel.zip && rm gki-kernel.zip 213 | echo 'Unpack prebuilt boot.img' 214 | unpack_bootimg.py --boot_img="./boot-5.10.img" 215 | 216 | echo 'Building Image.gz' 217 | gzip -n -k -f -9 Image >Image.gz 218 | 219 | echo 'Building boot.img' 220 | mkbootimg.py --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 221 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 222 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 223 | 224 | echo 'Building boot-gz.img' 225 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 226 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 227 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 228 | 229 | echo 'Building boot-lz4.img' 230 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 231 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 232 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 233 | cd .. 234 | 235 | elif [ "$ANDROID_VERSION" = "android13" ]; then 236 | mkdir bootimgs 237 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 238 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 239 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 240 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 241 | gzip -n -k -f -9 ../Image >../Image.gz 242 | cd ./bootimgs 243 | 244 | echo 'Building Image.gz' 245 | gzip -n -k -f -9 Image >Image.gz 246 | 247 | echo 'Building boot.img' 248 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 249 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 250 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 251 | 252 | echo 'Building boot-gz.img' 253 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 254 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 255 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 256 | 257 | echo 'Building boot-lz4.img' 258 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 259 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 260 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 261 | cd .. 262 | fi 263 | else 264 | # Use Bazel build if build.sh exists 265 | echo "Running Bazel build..." 266 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 267 | sed -i '2s/check_defconfig//' ./common/build.config.gki 268 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 269 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 270 | tools/bazel build --config=fast //common:kernel_aarch64_dist 271 | 272 | 273 | # Creating Boot imgs 274 | echo "Creating boot.imgs..." 275 | if [ "$ANDROID_VERSION" = "android14" ]; then 276 | mkdir bootimgs 277 | cp ./bazel-bin/common/kernel_aarch64/Image ./bootimgs 278 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs 279 | cp ./bazel-bin/common/kernel_aarch64/Image ../ 280 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../ 281 | gzip -n -k -f -9 ../Image >../Image.gz 282 | cd ./bootimgs 283 | 284 | echo 'Building Image.gz' 285 | gzip -n -k -f -9 Image >Image.gz 286 | 287 | echo 'Building boot.img' 288 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 289 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 290 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 291 | 292 | echo 'Building boot-gz.img' 293 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 294 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 295 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 296 | 297 | echo 'Building boot-lz4.img' 298 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 299 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 300 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 301 | cd .. 302 | fi 303 | fi 304 | 305 | # Create zip in the same directory 306 | cd ../AnyKernel3 307 | ZIP_NAME="AnyKernel3-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 308 | echo "Creating zip file: $ZIP_NAME..." 309 | mv ../Image ./Image 310 | zip -r "../../$ZIP_NAME" ./* 311 | rm ./Image 312 | ZIP_NAME="AnyKernel3-lz4-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 313 | echo "Creating zip file: $ZIP_NAME..." 314 | mv ../Image.lz4 ./Image.lz4 315 | zip -r "../../$ZIP_NAME" ./* 316 | rm ./Image.lz4 317 | ZIP_NAME="AnyKernel3-gz-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 318 | echo "Creating zip file: $ZIP_NAME..." 319 | mv ../Image.gz ./Image.gz 320 | zip -r "../../$ZIP_NAME" ./* 321 | rm ./Image.gz 322 | cd ../../ 323 | 324 | RELEASE_ZIPS["$ANDROID_VERSION-$KERNEL_VERSION.$SUB_LEVEL"]+="./$ZIP_NAME " 325 | 326 | # Delete the $CONFIG folder after building 327 | echo "Deleting $CONFIG folder..." 328 | rm -rf "$CONFIG" 329 | } 330 | 331 | # Concurrent build management 332 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 333 | # Start the build process in the background 334 | build_config "$CONFIG" & 335 | 336 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 337 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 338 | sleep 1 # Check every second for free slots 339 | done 340 | 341 | echo "Building slowdown starts now:" 342 | for ((i=30; i>0; i--)); do 343 | echo "$i seconds remaining..." 344 | sleep 1 345 | done 346 | 347 | done 348 | 349 | wait 350 | 351 | echo "Build process complete." 352 | 353 | # Collect all zip and img files 354 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 355 | 356 | # GitHub repository details 357 | REPO_OWNER="TheWildJames" 358 | REPO_NAME="GKI_KernelSU_SUSFS" 359 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" 360 | RELEASE_NAME="GKI Kernels With KernelSU & SUSFS v1.4.2" 361 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.4.2 362 | 363 | Module: 364 | https://github.com/sidex15/ksu_module_susfs 365 | 366 | Manager: 367 | https://github.com/rifsxd/KernelSU-Next 368 | 369 | Features: 370 | [+] KernelSU-Next 371 | [+] SUSFS v1.4.2 372 | [+] Wireguard Support 373 | [+] Maphide LineageOS Detections 374 | [+] Futile Maphide for jit-zygote-cache Detections 375 | [+] Magic Mount Support 376 | " 377 | 378 | # Create the GitHub release 379 | echo "Creating GitHub release: $RELEASE_NAME..." 380 | gh release create "$TAG_NAME" "${FILES[@]}" \ 381 | --repo "$REPO_OWNER/$REPO_NAME" \ 382 | --title "$RELEASE_NAME" \ 383 | --notes "$RELEASE_NOTES" 384 | 385 | echo "GitHub release created with the following files:" 386 | printf '%s\n' "${FILES[@]}" 387 | 388 | -------------------------------------------------------------------------------- /GKI/aio_gki_build_susfs142_release_riri.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | BUILD_CONFIGS=( 26 | #"android12-5.10-198-2024-01" 27 | #"android12-5.10-205-2024-03" 28 | #"android12-5.10-209-2024-05" 29 | #"android12-5.10-218-2024-08" 30 | #"android12-5.10-X-lts" 31 | 32 | #"android13-5.10-189-2023-11" 33 | #"android13-5.10-198-2024-01" 34 | #"android13-5.10-205-2024-03" 35 | #"android13-5.10-209-2024-05" 36 | #"android13-5.10-210-2024-06" 37 | #"android13-5.10-214-2024-07" 38 | #"android13-5.10-218-2024-08" 39 | #"android13-5.10-X-lts" 40 | 41 | #"android13-5.15-94-2023-05" 42 | "android13-5.15-123-2023-11" 43 | #"android13-5.15-137-2024-01" 44 | #"android13-5.15-144-2024-03" 45 | #"android13-5.15-148-2024-05" 46 | #"android13-5.15-149-2024-07" 47 | #"android13-5.15-151-2024-08" 48 | #"android13-5.15-167-2024-11" 49 | #"android13-5.15-X-lts" 50 | 51 | #"android14-5.15-131-2023-11" 52 | #"android14-5.15-137-2024-01" 53 | #"android14-5.15-144-2024-03" 54 | #"android14-5.15-148-2024-05" 55 | #"android14-5.15-149-2024-06" 56 | #"android14-5.15-153-2024-07" 57 | #"android14-5.15-158-2024-08" 58 | #"android14-5.15-167-2024-11" 59 | #"android14-5.15-X-lts" 60 | 61 | #"android14-6.1-25-2023-10" 62 | #"android14-6.1-43-2023-11" 63 | #"android14-6.1-57-2024-01" 64 | #"android14-6.1-68-2024-03" 65 | #"android14-6.1-75-2024-05" 66 | #"android14-6.1-78-2024-06" 67 | #"android14-6.1-84-2024-07" 68 | #"android14-6.1-90-2024-08" 69 | #"android14-6.1-112-2024-11" 70 | #"android14-6.1-115-2024-12" 71 | #"android14-6.1-X-lts" 72 | 73 | #"android15-6.6-30-2024-08" 74 | ) 75 | 76 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 77 | declare -A RELEASE_ZIPS=() 78 | 79 | # Iterate over configurations 80 | build_config() { 81 | CONFIG=$1 82 | CONFIG_DETAILS=${CONFIG} 83 | 84 | # Create a directory named after the current configuration 85 | echo "Creating folder for configuration: $CONFIG..." 86 | mkdir -p "$CONFIG" 87 | cd "$CONFIG" 88 | 89 | # Split the config details into individual components 90 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION SUB_LEVEL DATE <<< "$CONFIG_DETAILS" 91 | 92 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 93 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${DATE}" 94 | 95 | # Log file for this build in case of failure 96 | LOG_FILE="../${CONFIG}_build.log" 97 | 98 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 99 | echo "Cloning AnyKernel3 repository..." 100 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "${ANDROID_VERSION}-${KERNEL_VERSION}" 101 | echo "Cloning susfs4ksu repository..." 102 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "1.4.2-gki-${ANDROID_VERSION}-${KERNEL_VERSION}" 103 | echo "Cloning kernel_patches repository..." 104 | git clone https://github.com/TheWildJames/kernel_patches.git 105 | 106 | # Setup directory for each build 107 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 108 | 109 | # Check if the source directory exists and is a directory 110 | if [ -d "$SOURCE_DIR" ]; then 111 | # Copy the directory to the current working directory 112 | echo "Copying $SOURCE_DIR to ./" 113 | cp -r "$SOURCE_DIR" ./ 114 | echo "Successfully copied $SOURCE_DIR to ./" 115 | else 116 | mkdir -p "$CONFIG" 117 | fi 118 | 119 | cd "$CONFIG" 120 | 121 | # Initialize and sync kernel source with updated repo commands 122 | echo "Initializing and syncing kernel source..." 123 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 124 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 125 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 126 | 127 | # Check if the branch is deprecated and adjust the manifest 128 | if grep -q deprecated <<< $REMOTE_BRANCH; then 129 | echo "Found deprecated branch: $FORMATTED_BRANCH" 130 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 131 | fi 132 | 133 | # Verify repo version and sync 134 | repo --version 135 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 136 | 137 | # Apply KernelSU and SUSFS patches 138 | echo "Adding KernelSU..." 139 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 140 | 141 | echo "Applying SUSFS patches..." 142 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 143 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch ./common/ 144 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 145 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 146 | cp ../susfs4ksu/kernel_patches/KernelSU/kernel/* ./KernelSU-Next/kernel/ 147 | 148 | # Apply the patches 149 | cd ./KernelSU-Next 150 | patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true 151 | cd ../common 152 | patch -p1 < 50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch || true 153 | cp ../../kernel_patches/69_hide_stuff.patch ./ 154 | patch -p1 -F 3 < 69_hide_stuff.patch 155 | cd .. 156 | 157 | #cp ../kernel_patches/apk_sign.c_fix.patch ./ 158 | #patch -p1 -F 3 < apk_sign.c_fix.patch 159 | 160 | #cp ../kernel_patches/core_hook.c_fix.patch ./ 161 | #patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 162 | 163 | #cp ../kernel_patches/selinux.c_fix.patch ./ 164 | #patch -p1 -F 3 < selinux.c_fix.patch 165 | 166 | # Add configuration settings for SUSFS 167 | echo "Adding configuration settings to gki_defconfig..." 168 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 169 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 170 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 171 | #echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 172 | #echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 173 | #echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 174 | #echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 175 | #echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n" >> ./common/arch/arm64/configs/zuma_defconfig 176 | 177 | # Build kernel 178 | echo "Building kernel for $CONFIG..." 179 | 180 | # Check if build.sh exists, if it does, run the default build script 181 | if [ -e build/build.sh ]; then 182 | echo "build.sh found, running default build script..." 183 | # Modify config files for the default build process 184 | sed -i '2s/check_defconfig//' ./common/build.config.gki 185 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 186 | LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 187 | 188 | # Copying to AnyKernel3 189 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 190 | 191 | # Check if the boot.img file exists 192 | if [ "$ANDROID_VERSION" = "android12" ]; then 193 | mkdir bootimgs 194 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 195 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 196 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 197 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 198 | gzip -n -k -f -9 ../Image >../Image.gz 199 | cd ./bootimgs 200 | 201 | GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${DATE}"_r1.zip 202 | FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip 203 | status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null) 204 | 205 | if [ "$status" = "200" ]; then 206 | curl -Lo gki-kernel.zip "$GKI_URL" 207 | else 208 | echo "[+] $GKI_URL not found, using $FALLBACK_URL" 209 | curl -Lo gki-kernel.zip "$FALLBACK_URL" 210 | fi 211 | 212 | unzip gki-kernel.zip && rm gki-kernel.zip 213 | echo 'Unpack prebuilt boot.img' 214 | unpack_bootimg.py --boot_img="./boot-5.10.img" 215 | 216 | echo 'Building Image.gz' 217 | gzip -n -k -f -9 Image >Image.gz 218 | 219 | echo 'Building boot.img' 220 | mkbootimg.py --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 221 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 222 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 223 | 224 | echo 'Building boot-gz.img' 225 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 226 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 227 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 228 | 229 | echo 'Building boot-lz4.img' 230 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 231 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 232 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 233 | cd .. 234 | 235 | elif [ "$ANDROID_VERSION" = "android13" ]; then 236 | mkdir bootimgs 237 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 238 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 239 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 240 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 241 | gzip -n -k -f -9 ../Image >../Image.gz 242 | cd ./bootimgs 243 | 244 | echo 'Building Image.gz' 245 | gzip -n -k -f -9 Image >Image.gz 246 | 247 | echo 'Building boot.img' 248 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 249 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 250 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 251 | 252 | echo 'Building boot-gz.img' 253 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 254 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 255 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 256 | 257 | echo 'Building boot-lz4.img' 258 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 259 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 260 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 261 | cd .. 262 | fi 263 | else 264 | # Use Bazel build if build.sh exists 265 | echo "Running Bazel build..." 266 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 267 | sed -i '2s/check_defconfig//' ./common/build.config.gki 268 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 269 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 270 | tools/bazel build --config=fast //common:kernel_aarch64_dist 271 | 272 | 273 | # Creating Boot imgs 274 | echo "Creating boot.imgs..." 275 | if [ "$ANDROID_VERSION" = "android14" ]; then 276 | mkdir bootimgs 277 | cp ./bazel-bin/common/kernel_aarch64/Image ./bootimgs 278 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs 279 | cp ./bazel-bin/common/kernel_aarch64/Image ../ 280 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../ 281 | gzip -n -k -f -9 ../Image >../Image.gz 282 | cd ./bootimgs 283 | 284 | echo 'Building Image.gz' 285 | gzip -n -k -f -9 Image >Image.gz 286 | 287 | echo 'Building boot.img' 288 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 289 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 290 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 291 | 292 | echo 'Building boot-gz.img' 293 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 294 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 295 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 296 | 297 | echo 'Building boot-lz4.img' 298 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 299 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 300 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 301 | cd .. 302 | fi 303 | fi 304 | 305 | # Create zip in the same directory 306 | cd ../AnyKernel3 307 | ZIP_NAME="AnyKernel3-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 308 | echo "Creating zip file: $ZIP_NAME..." 309 | mv ../Image ./Image 310 | zip -r "../../$ZIP_NAME" ./* 311 | rm ./Image 312 | ZIP_NAME="AnyKernel3-lz4-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 313 | echo "Creating zip file: $ZIP_NAME..." 314 | mv ../Image.lz4 ./Image.lz4 315 | zip -r "../../$ZIP_NAME" ./* 316 | rm ./Image.lz4 317 | ZIP_NAME="AnyKernel3-gz-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 318 | echo "Creating zip file: $ZIP_NAME..." 319 | mv ../Image.gz ./Image.gz 320 | zip -r "../../$ZIP_NAME" ./* 321 | rm ./Image.gz 322 | cd ../../ 323 | 324 | RELEASE_ZIPS["$ANDROID_VERSION-$KERNEL_VERSION.$SUB_LEVEL"]+="./$ZIP_NAME " 325 | 326 | # Delete the $CONFIG folder after building 327 | echo "Deleting $CONFIG folder..." 328 | rm -rf "$CONFIG" 329 | } 330 | 331 | # Concurrent build management 332 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 333 | # Start the build process in the background 334 | build_config "$CONFIG" & 335 | 336 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 337 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 338 | sleep 1 # Check every second for free slots 339 | done 340 | 341 | echo "Building slowdown starts now:" 342 | for ((i=30; i>0; i--)); do 343 | echo "$i seconds remaining..." 344 | sleep 1 345 | done 346 | 347 | done 348 | 349 | wait 350 | 351 | echo "Build process complete." 352 | 353 | # Collect all zip and img files 354 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 355 | 356 | # GitHub repository details 357 | REPO_OWNER="TheWildJames" 358 | REPO_NAME="GKI_KernelSU_SUSFS" 359 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" 360 | RELEASE_NAME="GKI Kernels With KernelSU & SUSFS v1.4.2" 361 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.4.2 362 | 363 | Module: 364 | https://github.com/sidex15/ksu_module_susfs 365 | 366 | Manager: 367 | https://github.com/rifsxd/KernelSU-Next 368 | 369 | Features: 370 | [+] KernelSU-Next 371 | [+] SUSFS v1.4.2 372 | [+] Wireguard Support 373 | [+] Maphide LineageOS Detections 374 | [+] Futile Maphide for jit-zygote-cache Detections 375 | [+] Magic Mount Support 376 | " 377 | 378 | # Create the GitHub release 379 | echo "Creating GitHub release: $RELEASE_NAME..." 380 | gh release create "$TAG_NAME" "${FILES[@]}" \ 381 | --repo "$REPO_OWNER/$REPO_NAME" \ 382 | --title "$RELEASE_NAME" \ 383 | --notes "$RELEASE_NOTES" 384 | 385 | echo "GitHub release created with the following files:" 386 | printf '%s\n' "${FILES[@]}" 387 | 388 | -------------------------------------------------------------------------------- /GKI/aio_gki_build_6.6_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | BUILD_CONFIGS=( 26 | #"android12-5.10-198-2024-01" 27 | #"android12-5.10-205-2024-03" 28 | #"android12-5.10-209-2024-05" 29 | #"android12-5.10-218-2024-08" 30 | #"android12-5.10-X-lts" 31 | 32 | #"android13-5.10-189-2023-11" 33 | #"android13-5.10-198-2024-01" 34 | #"android13-5.10-205-2024-03" 35 | #"android13-5.10-209-2024-05" 36 | #"android13-5.10-210-2024-06" 37 | #"android13-5.10-214-2024-07" 38 | #"android13-5.10-218-2024-08" 39 | #"android13-5.10-X-lts" 40 | 41 | #"android13-5.15-94-2023-05" 42 | #"android13-5.15-123-2023-11" 43 | #"android13-5.15-137-2024-01" 44 | #"android13-5.15-144-2024-03" 45 | #"android13-5.15-148-2024-05" 46 | #"android13-5.15-149-2024-07" 47 | #"android13-5.15-151-2024-08" 48 | #"android13-5.15-167-2024-11" 49 | #"android13-5.15-X-lts" 50 | 51 | #"android14-5.15-131-2023-11" 52 | #"android14-5.15-137-2024-01" 53 | #"android14-5.15-144-2024-03" 54 | #"android14-5.15-148-2024-05" 55 | #"android14-5.15-149-2024-06" 56 | #"android14-5.15-153-2024-07" 57 | #"android14-5.15-158-2024-08" 58 | #"android14-5.15-167-2024-11" 59 | #"android14-5.15-X-lts" 60 | 61 | #"android14-6.1-25-2023-10" 62 | #"android14-6.1-43-2023-11" 63 | #"android14-6.1-57-2024-01" 64 | #"android14-6.1-68-2024-03" 65 | #"android14-6.1-75-2024-05" 66 | #"android14-6.1-78-2024-06" 67 | #"android14-6.1-84-2024-07" 68 | #"android14-6.1-90-2024-08" 69 | #"android14-6.1-112-2024-11" 70 | #"android14-6.1-115-2024-12" 71 | #"android14-6.1-X-lts" 72 | 73 | "android15-6.6-30-2024-08" 74 | ) 75 | 76 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 77 | declare -A RELEASE_ZIPS=() 78 | 79 | # Iterate over configurations 80 | build_config() { 81 | CONFIG=$1 82 | CONFIG_DETAILS=${CONFIG} 83 | 84 | # Create a directory named after the current configuration 85 | echo "Creating folder for configuration: $CONFIG..." 86 | mkdir -p "$CONFIG" 87 | cd "$CONFIG" 88 | 89 | # Split the config details into individual components 90 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION SUB_LEVEL DATE <<< "$CONFIG_DETAILS" 91 | 92 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 93 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${DATE}" 94 | 95 | # Log file for this build in case of failure 96 | LOG_FILE="../${CONFIG}_build.log" 97 | 98 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 99 | echo "Cloning AnyKernel3 repository..." 100 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "android14-6.1" 101 | echo "Cloning susfs4ksu repository..." 102 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "gki-android14-6.1" 103 | echo "Cloning kernel_patches repository..." 104 | git clone https://github.com/TheWildJames/kernel_patches.git 105 | 106 | # Setup directory for each build 107 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 108 | 109 | # Check if the source directory exists and is a directory 110 | if [ -d "$SOURCE_DIR" ]; then 111 | # Copy the directory to the current working directory 112 | echo "Copying $SOURCE_DIR to ./" 113 | cp -r "$SOURCE_DIR" ./ 114 | echo "Successfully copied $SOURCE_DIR to ./" 115 | else 116 | mkdir -p "$CONFIG" 117 | fi 118 | 119 | cd "$CONFIG" 120 | 121 | # Initialize and sync kernel source with updated repo commands 122 | echo "Initializing and syncing kernel source..." 123 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 124 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 125 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 126 | 127 | # Check if the branch is deprecated and adjust the manifest 128 | if grep -q deprecated <<< $REMOTE_BRANCH; then 129 | echo "Found deprecated branch: $FORMATTED_BRANCH" 130 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 131 | fi 132 | 133 | # Verify repo version and sync 134 | repo --version 135 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 136 | 137 | # Apply KernelSU and SUSFS patches 138 | echo "Adding KernelSU..." 139 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 140 | 141 | echo "Applying SUSFS patches..." 142 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 143 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./common/ 144 | cp ../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/ 145 | cp ../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/ 146 | 147 | # Apply the patches 148 | cd ./KernelSU-Next 149 | patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true 150 | cd ../common 151 | patch -p1 < 50_add_susfs_in_gki-android14-6.1.patch || true 152 | cp ../../kernel_patches/69_hide_stuff.patch ./ 153 | patch -p1 -F 3 < 69_hide_stuff.patch 154 | sed -i '/obj-\$(CONFIG_KSU_SUSFS_SUS_SU) += sus_su.o/d' ./fs/Makefile 155 | cd .. 156 | cp ../kernel_patches/selinux.c_fix.patch ./ 157 | patch -p1 -F 3 < selinux.c_fix.patch 158 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 159 | patch -p1 -F 3 < apk_sign.c_fix.patch 160 | cp ../kernel_patches/Makefile_fix.patch ./ 161 | patch -p1 --fuzz=3 < ./Makefile_fix.patch 162 | 163 | 164 | # Add configuration settings for SUSFS 165 | echo "Adding configuration settings to gki_defconfig..." 166 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 167 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 168 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./common/arch/arm64/configs/gki_defconfig 169 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 170 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 171 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 172 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 173 | 174 | # Build kernel 175 | echo "Building kernel for $CONFIG..." 176 | 177 | # Check if build.sh exists, if it does, run the default build script 178 | if [ -e build/build.sh ]; then 179 | echo "build.sh found, running default build script..." 180 | # Modify config files for the default build process 181 | sed -i '2s/check_defconfig//' ./common/build.config.gki 182 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 183 | LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 184 | 185 | # Copying to AnyKernel3 186 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 187 | 188 | # Check if the boot.img file exists 189 | if [ "$ANDROID_VERSION" = "android12" ]; then 190 | mkdir bootimgs 191 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 192 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 193 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 194 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 195 | gzip -n -k -f -9 ../Image >../Image.gz 196 | cd ./bootimgs 197 | 198 | GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${DATE}"_r1.zip 199 | FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip 200 | status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null) 201 | 202 | if [ "$status" = "200" ]; then 203 | curl -Lo gki-kernel.zip "$GKI_URL" 204 | else 205 | echo "[+] $GKI_URL not found, using $FALLBACK_URL" 206 | curl -Lo gki-kernel.zip "$FALLBACK_URL" 207 | fi 208 | 209 | unzip gki-kernel.zip && rm gki-kernel.zip 210 | echo 'Unpack prebuilt boot.img' 211 | unpack_bootimg.py --boot_img="./boot-5.10.img" 212 | 213 | echo 'Building Image.gz' 214 | gzip -n -k -f -9 Image >Image.gz 215 | 216 | echo 'Building boot.img' 217 | mkbootimg.py --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 218 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 219 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 220 | 221 | echo 'Building boot-gz.img' 222 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 223 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 224 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 225 | 226 | echo 'Building boot-lz4.img' 227 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 228 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 229 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 230 | cd .. 231 | 232 | elif [ "$ANDROID_VERSION" = "android13" ]; then 233 | mkdir bootimgs 234 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 235 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 236 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 237 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 238 | gzip -n -k -f -9 ../Image >../Image.gz 239 | cd ./bootimgs 240 | 241 | echo 'Building Image.gz' 242 | gzip -n -k -f -9 Image >Image.gz 243 | 244 | echo 'Building boot.img' 245 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 246 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 247 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 248 | 249 | echo 'Building boot-gz.img' 250 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 251 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 252 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 253 | 254 | echo 'Building boot-lz4.img' 255 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 256 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 257 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 258 | cd .. 259 | fi 260 | else 261 | # Use Bazel build if build.sh exists 262 | echo "Running Bazel build..." 263 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 264 | sed -i '2s/check_defconfig//' ./common/build.config.gki 265 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 266 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 267 | tools/bazel build --config=fast //common:kernel_aarch64_dist 268 | 269 | 270 | # Creating Boot imgs 271 | echo "Creating boot.imgs..." 272 | if [ "$ANDROID_VERSION" = "android14" ] || [ "$ANDROID_VERSION" = "android15" ]; then 273 | mkdir bootimgs 274 | cp ./bazel-bin/common/kernel_aarch64/Image ./bootimgs 275 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs 276 | cp ./bazel-bin/common/kernel_aarch64/Image ../ 277 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../ 278 | gzip -n -k -f -9 ../Image >../Image.gz 279 | cd ./bootimgs 280 | 281 | echo 'Building Image.gz' 282 | gzip -n -k -f -9 Image >Image.gz 283 | 284 | echo 'Building boot.img' 285 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 286 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 287 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 288 | 289 | echo 'Building boot-gz.img' 290 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 291 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 292 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 293 | 294 | echo 'Building boot-lz4.img' 295 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 296 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 297 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 298 | cd .. 299 | fi 300 | fi 301 | 302 | # Create zip in the same directory 303 | cd ../AnyKernel3 304 | ZIP_NAME="AnyKernel3-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 305 | echo "Creating zip file: $ZIP_NAME..." 306 | mv ../Image ./Image 307 | zip -r "../../$ZIP_NAME" ./* 308 | rm ./Image 309 | ZIP_NAME="AnyKernel3-lz4-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 310 | echo "Creating zip file: $ZIP_NAME..." 311 | mv ../Image.lz4 ./Image.lz4 312 | zip -r "../../$ZIP_NAME" ./* 313 | rm ./Image.lz4 314 | ZIP_NAME="AnyKernel3-gz-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 315 | echo "Creating zip file: $ZIP_NAME..." 316 | mv ../Image.gz ./Image.gz 317 | zip -r "../../$ZIP_NAME" ./* 318 | rm ./Image.gz 319 | cd ../../ 320 | 321 | RELEASE_ZIPS["$ANDROID_VERSION-$KERNEL_VERSION.$SUB_LEVEL"]+="./$ZIP_NAME " 322 | 323 | # Delete the $CONFIG folder after building 324 | echo "Deleting $CONFIG folder..." 325 | rm -rf "$CONFIG" 326 | } 327 | 328 | # Concurrent build management 329 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 330 | # Start the build process in the background 331 | build_config "$CONFIG" & 332 | 333 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 334 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 335 | sleep 1 # Check every second for free slots 336 | done 337 | 338 | echo "Building slowdown starts now:" 339 | for ((i=30; i>0; i--)); do 340 | echo "$i seconds remaining..." 341 | sleep 1 342 | done 343 | 344 | done 345 | 346 | wait 347 | 348 | echo "Build process complete." 349 | 350 | # Collect all zip and img files 351 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 352 | 353 | # GitHub repository details 354 | REPO_OWNER="TheWildJames" 355 | REPO_NAME="GKI_KernelSU_SUSFS" 356 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" 357 | RELEASE_NAME="GKI Kernels With KernelSU & SUSFS v1.5.3" 358 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 359 | 360 | Module: https://github.com/sidex15/ksu_module_susfs 361 | 362 | Official Manager: 363 | https://github.com/tiann/KernelSU 364 | Non-Official Managers: 365 | https://github.com/rifsxd/KernelSU-Next 366 | https://github.com/backslashxx/KernelSU 367 | https://github.com/rsuntk/KernelSU 368 | https://github.com/5ec1cff/KernelSU 369 | https://github.com/silvzr/KernelSU 370 | https://github.com/sidex15/KernelSU 371 | 372 | Features: 373 | [+] KernelSU-Next 374 | [+] SUSFS v1.5.3 375 | [+] Wireguard Support 376 | [+] Maphide LineageOS Detections 377 | [+] Futile Maphide for jit-zygote-cache Detections 378 | [+] Magic Mount Support 379 | " 380 | 381 | # Create the GitHub release 382 | echo "Creating GitHub release: $RELEASE_NAME..." 383 | gh release create "$TAG_NAME" "${FILES[@]}" \ 384 | --repo "$REPO_OWNER/$REPO_NAME" \ 385 | --title "$RELEASE_NAME" \ 386 | --notes "$RELEASE_NOTES" 387 | 388 | echo "GitHub release created with the following files:" 389 | printf '%s\n' "${FILES[@]}" 390 | 391 | -------------------------------------------------------------------------------- /GKI/riri_gki_build_kernel_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | BUILD_CONFIGS=( 26 | "android13-5.15-123-2023-11" 27 | ) 28 | 29 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 30 | declare -A RELEASE_ZIPS=() 31 | 32 | # Iterate over configurations 33 | build_config() { 34 | CONFIG=$1 35 | CONFIG_DETAILS=${CONFIG} 36 | 37 | # Create a directory named after the current configuration 38 | echo "Creating folder for configuration: $CONFIG..." 39 | mkdir -p "$CONFIG" 40 | cd "$CONFIG" 41 | 42 | # Split the config details into individual components 43 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION SUB_LEVEL DATE <<< "$CONFIG_DETAILS" 44 | 45 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 46 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${DATE}" 47 | 48 | # Log file for this build in case of failure 49 | LOG_FILE="../${CONFIG}_build.log" 50 | 51 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 52 | echo "Cloning AnyKernel3 repository..." 53 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "${ANDROID_VERSION}-${KERNEL_VERSION}" 54 | echo "Cloning susfs4ksu repository..." 55 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "gki-${ANDROID_VERSION}-${KERNEL_VERSION}" 56 | echo "Cloning kernel_patches repository..." 57 | git clone https://github.com/TheWildJames/kernel_patches.git 58 | 59 | # Setup directory for each build 60 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 61 | 62 | # Check if the source directory exists and is a directory 63 | if [ -d "$SOURCE_DIR" ]; then 64 | # Copy the directory to the current working directory 65 | echo "Copying $SOURCE_DIR to ./" 66 | cp -r "$SOURCE_DIR" ./ 67 | echo "Successfully copied $SOURCE_DIR to ./" 68 | else 69 | mkdir -p "$CONFIG" 70 | fi 71 | 72 | cd "$CONFIG" 73 | 74 | # Initialize and sync kernel source with updated repo commands 75 | echo "Initializing and syncing kernel source..." 76 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 77 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 78 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 79 | 80 | # Check if the branch is deprecated and adjust the manifest 81 | if grep -q deprecated <<< $REMOTE_BRANCH; then 82 | echo "Found deprecated branch: $FORMATTED_BRANCH" 83 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 84 | fi 85 | 86 | # Verify repo version and sync 87 | repo --version 88 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 89 | 90 | # Apply KernelSU and SUSFS patches 91 | echo "Adding KernelSU..." 92 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash - 93 | cd ./KernelSU-Next/kernel 94 | sed -i 's/ccflags-y += -DKSU_VERSION=16/ccflags-y += -DKSU_VERSION=12000/' ./Makefile 95 | cd ../../ 96 | echo "Applying SUSFS patches..." 97 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 98 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch ./common/ 99 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 100 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 101 | 102 | # Apply the patches 103 | cd ./KernelSU-Next 104 | patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true 105 | cd ../common 106 | patch -p1 < 50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch || true 107 | cp ../../kernel_patches/69_hide_stuff.patch ./ 108 | patch -p1 -F 3 < 69_hide_stuff.patch 109 | cd .. 110 | 111 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 112 | patch -p1 -F 3 < apk_sign.c_fix.patch 113 | 114 | cp ../kernel_patches/core_hook.c_fix.patch ./ 115 | patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 116 | 117 | cp ../kernel_patches/selinux.c_fix.patch ./ 118 | patch -p1 -F 3 < selinux.c_fix.patch 119 | 120 | # Add configuration settings for SUSFS 121 | echo "Adding configuration settings to gki_defconfig..." 122 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 123 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 124 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 125 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 126 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 127 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 128 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 129 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 130 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 131 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 132 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 133 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 134 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 135 | echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 136 | echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 137 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 138 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 139 | 140 | # Build kernel 141 | echo "Building kernel for $CONFIG..." 142 | 143 | # Check if build.sh exists, if it does, run the default build script 144 | if [ -e build/build.sh ]; then 145 | echo "build.sh found, running default build script..." 146 | # Modify config files for the default build process 147 | sed -i '2s/check_defconfig//' ./common/build.config.gki 148 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 149 | LTO=full BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 150 | 151 | # Copying to AnyKernel3 152 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 153 | 154 | # Check if the boot.img file exists 155 | if [ "$ANDROID_VERSION" = "android12" ]; then 156 | mkdir bootimgs 157 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 158 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 159 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 160 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 161 | gzip -n -k -f -9 ../Image >../Image.gz 162 | cd ./bootimgs 163 | 164 | GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${DATE}"_r1.zip 165 | FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip 166 | status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null) 167 | 168 | if [ "$status" = "200" ]; then 169 | curl -Lo gki-kernel.zip "$GKI_URL" 170 | else 171 | echo "[+] $GKI_URL not found, using $FALLBACK_URL" 172 | curl -Lo gki-kernel.zip "$FALLBACK_URL" 173 | fi 174 | 175 | unzip gki-kernel.zip && rm gki-kernel.zip 176 | echo 'Unpack prebuilt boot.img' 177 | unpack_bootimg.py --boot_img="./boot-5.10.img" 178 | 179 | echo 'Building Image.gz' 180 | gzip -n -k -f -9 Image >Image.gz 181 | 182 | echo 'Building boot.img' 183 | mkbootimg.py --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 184 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 185 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 186 | 187 | echo 'Building boot-gz.img' 188 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 189 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 190 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 191 | 192 | echo 'Building boot-lz4.img' 193 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 194 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 195 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 196 | cd .. 197 | 198 | elif [ "$ANDROID_VERSION" = "android13" ]; then 199 | mkdir bootimgs 200 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 201 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 202 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 203 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 204 | gzip -n -k -f -9 ../Image >../Image.gz 205 | cd ./bootimgs 206 | 207 | echo 'Building Image.gz' 208 | gzip -n -k -f -9 Image >Image.gz 209 | 210 | echo 'Building boot.img' 211 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 212 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 213 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 214 | 215 | echo 'Building boot-gz.img' 216 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 217 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 218 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 219 | 220 | echo 'Building boot-lz4.img' 221 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 222 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 223 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 224 | cd .. 225 | fi 226 | else 227 | # Use Bazel build if build.sh exists 228 | echo "Running Bazel build..." 229 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 230 | sed -i '2s/check_defconfig//' ./common/build.config.gki 231 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 232 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 233 | tools/bazel build --lto=full //common:kernel_aarch64_dist 234 | 235 | 236 | # Creating Boot imgs 237 | echo "Creating boot.imgs..." 238 | if [ "$ANDROID_VERSION" = "android14" ]; then 239 | mkdir bootimgs 240 | cp ./bazel-bin/common/kernel_aarch64/Image ./bootimgs 241 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs 242 | cp ./bazel-bin/common/kernel_aarch64/Image ../ 243 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../ 244 | gzip -n -k -f -9 ../Image >../Image.gz 245 | cd ./bootimgs 246 | 247 | echo 'Building Image.gz' 248 | gzip -n -k -f -9 Image >Image.gz 249 | 250 | echo 'Building boot.img' 251 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 252 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 253 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 254 | 255 | echo 'Building boot-gz.img' 256 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 257 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 258 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 259 | 260 | echo 'Building boot-lz4.img' 261 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 262 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 263 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 264 | cd .. 265 | fi 266 | fi 267 | 268 | # Create zip in the same directory 269 | cd ../AnyKernel3 270 | ZIP_NAME="AnyKernel3-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 271 | echo "Creating zip file: $ZIP_NAME..." 272 | mv ../Image ./Image 273 | zip -r "../../$ZIP_NAME" ./* 274 | rm ./Image 275 | ZIP_NAME="AnyKernel3-lz4-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 276 | echo "Creating zip file: $ZIP_NAME..." 277 | mv ../Image.lz4 ./Image.lz4 278 | zip -r "../../$ZIP_NAME" ./* 279 | rm ./Image.lz4 280 | ZIP_NAME="AnyKernel3-gz-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 281 | echo "Creating zip file: $ZIP_NAME..." 282 | mv ../Image.gz ./Image.gz 283 | zip -r "../../$ZIP_NAME" ./* 284 | rm ./Image.gz 285 | cd ../../ 286 | 287 | RELEASE_ZIPS["$ANDROID_VERSION-$KERNEL_VERSION.$SUB_LEVEL"]+="./$ZIP_NAME " 288 | 289 | # Delete the $CONFIG folder after building 290 | echo "Deleting $CONFIG folder..." 291 | rm -rf "$CONFIG" 292 | } 293 | 294 | # Concurrent build management 295 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 296 | # Start the build process in the background 297 | build_config "$CONFIG" & 298 | 299 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 300 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 301 | sleep 1 # Check every second for free slots 302 | done 303 | 304 | echo "Building slowdown starts now:" 305 | for ((i=30; i>0; i--)); do 306 | echo "$i seconds remaining..." 307 | sleep 1 308 | done 309 | 310 | done 311 | 312 | wait 313 | 314 | echo "Build process complete." 315 | 316 | # Collect all zip and img files 317 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 318 | 319 | # GitHub repository details 320 | REPO_OWNER="TheWildJames" 321 | REPO_NAME="GKI_KernelSU_SUSFS" 322 | 323 | # Get the latest tag from the GitHub repository using the GitHub CLI 324 | LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name') 325 | 326 | # If no tags are found, default to 1.5.3-0 327 | if [ -z "$LATEST_TAG" ]; then 328 | LATEST_TAG="1.5.3-0" 329 | fi 330 | 331 | # Increment the suffix after the dash 332 | NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}') 333 | TAG_NAME="$NEW_TAG" 334 | 335 | #TAG_NAME="v1.5.3-$(date +'%Y.%m.%d-%H.%M.%S')" 336 | RELEASE_NAME="*RIRI BUILD* GKI Kernels With KernelSU & SUSFS v1.5.3 *RIRI BUILD*" 337 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 338 | 339 | Module: https://github.com/sidex15/ksu_module_susfs 340 | 341 | Official Manager: 342 | https://github.com/tiann/KernelSU 343 | Non-Official Managers: 344 | https://github.com/rifsxd/KernelSU-Next 345 | https://github.com/backslashxx/KernelSU 346 | https://github.com/rsuntk/KernelSU 347 | https://github.com/5ec1cff/KernelSU 348 | https://github.com/silvzr/KernelSU 349 | https://github.com/sidex15/KernelSU 350 | 351 | Features: 352 | [+] KernelSU-Next 353 | [+] SUSFS v1.5.3 354 | [+] Wireguard Support 355 | [+] Maphide LineageOS Detections 356 | [+] Futile Maphide for jit-zygote-cache Detections 357 | [+] NO MAGIC MOUNT SUPPORT 358 | [+] Built With LTO=Full, Optimizations For Improved Performance And Efficiency 359 | [+] CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=n 360 | [+] CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=n 361 | [+] CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=n 362 | [+] CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=n 363 | " 364 | 365 | # Create the GitHub release 366 | echo "Creating GitHub release: $RELEASE_NAME..." 367 | gh release create "$TAG_NAME" "${FILES[@]}" \ 368 | --repo "$REPO_OWNER/$REPO_NAME" \ 369 | --title "$RELEASE_NAME" \ 370 | --notes "$RELEASE_NOTES" \ 371 | --prerelease \ 372 | --latest=false 373 | 374 | echo "GitHub release created with the following files:" 375 | printf '%s\n' "${FILES[@]}" 376 | 377 | -------------------------------------------------------------------------------- /GKI/aio_gki_build_kernel_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | BUILD_CONFIGS=( 26 | "android12-5.10-198-2024-01" 27 | "android12-5.10-205-2024-03" 28 | "android12-5.10-209-2024-05" 29 | "android12-5.10-218-2024-08" 30 | "android12-5.10-X-lts" 31 | 32 | "android13-5.10-189-2023-11" 33 | "android13-5.10-198-2024-01" 34 | "android13-5.10-205-2024-03" 35 | "android13-5.10-209-2024-05" 36 | "android13-5.10-210-2024-06" 37 | "android13-5.10-214-2024-07" 38 | "android13-5.10-218-2024-08" 39 | "android13-5.10-X-lts" 40 | 41 | "android13-5.15-94-2023-05" 42 | "android13-5.15-123-2023-11" 43 | "android13-5.15-137-2024-01" 44 | "android13-5.15-144-2024-03" 45 | "android13-5.15-148-2024-05" 46 | "android13-5.15-149-2024-07" 47 | "android13-5.15-151-2024-08" 48 | "android13-5.15-167-2024-11" 49 | "android13-5.15-X-lts" 50 | 51 | "android14-5.15-131-2023-11" 52 | "android14-5.15-137-2024-01" 53 | "android14-5.15-144-2024-03" 54 | "android14-5.15-148-2024-05" 55 | "android14-5.15-149-2024-06" 56 | "android14-5.15-153-2024-07" 57 | "android14-5.15-158-2024-08" 58 | "android14-5.15-167-2024-11" 59 | "android14-5.15-X-lts" 60 | 61 | "android14-6.1-25-2023-10" 62 | "android14-6.1-43-2023-11" 63 | "android14-6.1-57-2024-01" 64 | "android14-6.1-68-2024-03" 65 | "android14-6.1-75-2024-05" 66 | "android14-6.1-78-2024-06" 67 | "android14-6.1-84-2024-07" 68 | "android14-6.1-90-2024-08" 69 | "android14-6.1-112-2024-11" 70 | "android14-6.1-115-2024-12" 71 | "android14-6.1-X-lts" 72 | 73 | #"android15-6.6-30-2024-08" 74 | ) 75 | 76 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 77 | declare -A RELEASE_ZIPS=() 78 | 79 | # Iterate over configurations 80 | build_config() { 81 | CONFIG=$1 82 | CONFIG_DETAILS=${CONFIG} 83 | 84 | # Create a directory named after the current configuration 85 | echo "Creating folder for configuration: $CONFIG..." 86 | mkdir -p "$CONFIG" 87 | cd "$CONFIG" 88 | 89 | # Split the config details into individual components 90 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION SUB_LEVEL DATE <<< "$CONFIG_DETAILS" 91 | 92 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 93 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${DATE}" 94 | 95 | # Log file for this build in case of failure 96 | LOG_FILE="../${CONFIG}_build.log" 97 | 98 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 99 | echo "Cloning AnyKernel3 repository..." 100 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "${ANDROID_VERSION}-${KERNEL_VERSION}" 101 | echo "Cloning susfs4ksu repository..." 102 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "gki-${ANDROID_VERSION}-${KERNEL_VERSION}" 103 | echo "Cloning kernel_patches repository..." 104 | git clone https://github.com/TheWildJames/kernel_patches.git 105 | 106 | # Setup directory for each build 107 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 108 | 109 | # Check if the source directory exists and is a directory 110 | if [ -d "$SOURCE_DIR" ]; then 111 | # Copy the directory to the current working directory 112 | echo "Copying $SOURCE_DIR to ./" 113 | cp -r "$SOURCE_DIR" ./ 114 | echo "Successfully copied $SOURCE_DIR to ./" 115 | else 116 | mkdir -p "$CONFIG" 117 | fi 118 | 119 | cd "$CONFIG" 120 | 121 | # Initialize and sync kernel source with updated repo commands 122 | echo "Initializing and syncing kernel source..." 123 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 124 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 125 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 126 | 127 | # Check if the branch is deprecated and adjust the manifest 128 | if grep -q deprecated <<< $REMOTE_BRANCH; then 129 | echo "Found deprecated branch: $FORMATTED_BRANCH" 130 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 131 | fi 132 | 133 | # Verify repo version and sync 134 | repo --version 135 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 136 | 137 | # Apply KernelSU and SUSFS patches 138 | echo "Adding KernelSU..." 139 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash - 140 | cd ./KernelSU-Next/kernel 141 | sed -i 's/ccflags-y += -DKSU_VERSION=16/ccflags-y += -DKSU_VERSION=12000/' ./Makefile 142 | cd ../../ 143 | echo "Applying SUSFS patches..." 144 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 145 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch ./common/ 146 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 147 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 148 | 149 | # Apply the patches 150 | cd ./KernelSU-Next 151 | patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true 152 | cd ../common 153 | patch -p1 < 50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch || true 154 | cp ../../kernel_patches/69_hide_stuff.patch ./ 155 | patch -p1 -F 3 < 69_hide_stuff.patch 156 | cd .. 157 | 158 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 159 | patch -p1 -F 3 < apk_sign.c_fix.patch 160 | 161 | cp ../kernel_patches/core_hook.c_fix.patch ./ 162 | patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 163 | 164 | cp ../kernel_patches/selinux.c_fix.patch ./ 165 | patch -p1 -F 3 < selinux.c_fix.patch 166 | 167 | # Add configuration settings for SUSFS 168 | echo "Adding configuration settings to gki_defconfig..." 169 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 170 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 171 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 172 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 173 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 174 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 175 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 176 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 177 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 178 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 179 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 180 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 181 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 182 | echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 183 | echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 184 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 185 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 186 | 187 | # Build kernel 188 | echo "Building kernel for $CONFIG..." 189 | 190 | # Check if build.sh exists, if it does, run the default build script 191 | if [ -e build/build.sh ]; then 192 | echo "build.sh found, running default build script..." 193 | # Modify config files for the default build process 194 | sed -i '2s/check_defconfig//' ./common/build.config.gki 195 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 196 | LTO=full BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 197 | 198 | # Copying to AnyKernel3 199 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 200 | 201 | # Check if the boot.img file exists 202 | if [ "$ANDROID_VERSION" = "android12" ]; then 203 | mkdir bootimgs 204 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 205 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 206 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 207 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 208 | gzip -n -k -f -9 ../Image >../Image.gz 209 | cd ./bootimgs 210 | 211 | GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${DATE}"_r1.zip 212 | FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip 213 | status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null) 214 | 215 | if [ "$status" = "200" ]; then 216 | curl -Lo gki-kernel.zip "$GKI_URL" 217 | else 218 | echo "[+] $GKI_URL not found, using $FALLBACK_URL" 219 | curl -Lo gki-kernel.zip "$FALLBACK_URL" 220 | fi 221 | 222 | unzip gki-kernel.zip && rm gki-kernel.zip 223 | echo 'Unpack prebuilt boot.img' 224 | unpack_bootimg.py --boot_img="./boot-5.10.img" 225 | 226 | echo 'Building Image.gz' 227 | gzip -n -k -f -9 Image >Image.gz 228 | 229 | echo 'Building boot.img' 230 | mkbootimg.py --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 231 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key testkey_rsa2048.pem 232 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 233 | 234 | echo 'Building boot-gz.img' 235 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 236 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key testkey_rsa2048.pem 237 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 238 | 239 | echo 'Building boot-lz4.img' 240 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 241 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key testkey_rsa2048.pem 242 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 243 | cd .. 244 | 245 | elif [ "$ANDROID_VERSION" = "android13" ]; then 246 | mkdir bootimgs 247 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 248 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 249 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 250 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 251 | gzip -n -k -f -9 ../Image >../Image.gz 252 | cd ./bootimgs 253 | 254 | echo 'Building Image.gz' 255 | gzip -n -k -f -9 Image >Image.gz 256 | 257 | echo 'Building boot.img' 258 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 259 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key testkey_rsa2048.pem 260 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 261 | 262 | echo 'Building boot-gz.img' 263 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 264 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key testkey_rsa2048.pem 265 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 266 | 267 | echo 'Building boot-lz4.img' 268 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 269 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key testkey_rsa2048.pem 270 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 271 | cd .. 272 | fi 273 | else 274 | # Use Bazel build if build.sh exists 275 | echo "Running Bazel build..." 276 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 277 | sed -i '2s/check_defconfig//' ./common/build.config.gki 278 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 279 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 280 | tools/bazel build --lto=full --stamp //common:kernel_aarch64_dist 281 | 282 | 283 | # Creating Boot imgs 284 | echo "Creating boot.imgs..." 285 | if [ "$ANDROID_VERSION" = "android14" ]; then 286 | mkdir bootimgs 287 | cp ./bazel-bin/common/kernel_aarch64/Image ./bootimgs 288 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs 289 | cp ./bazel-bin/common/kernel_aarch64/Image ../ 290 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../ 291 | gzip -n -k -f -9 ../Image >../Image.gz 292 | cd ./bootimgs 293 | 294 | echo 'Building Image.gz' 295 | gzip -n -k -f -9 Image >Image.gz 296 | 297 | echo 'Building boot.img' 298 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 299 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 300 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 301 | 302 | echo 'Building boot-gz.img' 303 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 304 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 305 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 306 | 307 | echo 'Building boot-lz4.img' 308 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 309 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 310 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 311 | cd .. 312 | fi 313 | fi 314 | 315 | # Create zip in the same directory 316 | cd ../AnyKernel3 317 | ZIP_NAME="AnyKernel3-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 318 | echo "Creating zip file: $ZIP_NAME..." 319 | mv ../Image ./Image 320 | zip -r "../../$ZIP_NAME" ./* 321 | rm ./Image 322 | ZIP_NAME="AnyKernel3-lz4-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 323 | echo "Creating zip file: $ZIP_NAME..." 324 | mv ../Image.lz4 ./Image.lz4 325 | zip -r "../../$ZIP_NAME" ./* 326 | rm ./Image.lz4 327 | ZIP_NAME="AnyKernel3-gz-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 328 | echo "Creating zip file: $ZIP_NAME..." 329 | mv ../Image.gz ./Image.gz 330 | zip -r "../../$ZIP_NAME" ./* 331 | rm ./Image.gz 332 | cd ../../ 333 | 334 | RELEASE_ZIPS["$ANDROID_VERSION-$KERNEL_VERSION.$SUB_LEVEL"]+="./$ZIP_NAME " 335 | 336 | # Delete the $CONFIG folder after building 337 | echo "Deleting $CONFIG folder..." 338 | rm -rf "$CONFIG" 339 | } 340 | 341 | # Concurrent build management 342 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 343 | # Start the build process in the background 344 | build_config "$CONFIG" & 345 | 346 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 347 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 348 | sleep 1 # Check every second for free slots 349 | done 350 | 351 | echo "Building slowdown starts now:" 352 | for ((i=30; i>0; i--)); do 353 | echo "$i seconds remaining..." 354 | sleep 1 355 | done 356 | 357 | done 358 | 359 | wait 360 | 361 | echo "Build process complete." 362 | 363 | # Collect all zip and img files 364 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 365 | 366 | # GitHub repository details 367 | REPO_OWNER="TheWildJames" 368 | REPO_NAME="GKI_KernelSU_SUSFS" 369 | 370 | # Get the latest tag from the GitHub repository using the GitHub CLI 371 | LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name') 372 | 373 | # If no tags are found, default to 1.5.3-0 374 | if [ -z "$LATEST_TAG" ]; then 375 | LATEST_TAG="1.5.3-0" 376 | fi 377 | 378 | # Increment the suffix after the dash 379 | NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}') 380 | TAG_NAME="$NEW_TAG" 381 | 382 | #TAG_NAME="v1.5.3-$(date +'%Y.%m.%d-%H.%M.%S')" 383 | RELEASE_NAME="*TEST BUILD* GKI Kernels With KernelSU & SUSFS v1.5.3 *TEST BUILD*" 384 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 385 | 386 | Module: https://github.com/sidex15/ksu_module_susfs 387 | 388 | Official Manager: 389 | https://github.com/tiann/KernelSU 390 | Non-Official Managers: 391 | https://github.com/rifsxd/KernelSU-Next 392 | https://github.com/backslashxx/KernelSU 393 | https://github.com/rsuntk/KernelSU 394 | https://github.com/5ec1cff/KernelSU 395 | https://github.com/silvzr/KernelSU 396 | https://github.com/sidex15/KernelSU 397 | 398 | Features: 399 | [+] KernelSU-Next 400 | [+] SUSFS v1.5.3 401 | [+] Wireguard Support 402 | [+] Maphide LineageOS Detections 403 | [+] Futile Maphide for jit-zygote-cache Detections 404 | [+] Magic Mount Support 405 | [+] Built With LTO=Full, Optimizations For Improved Performance And Efficiency 406 | " 407 | 408 | # Create the GitHub release 409 | echo "Creating GitHub release: $RELEASE_NAME..." 410 | gh release create "$TAG_NAME" "${FILES[@]}" \ 411 | --repo "$REPO_OWNER/$REPO_NAME" \ 412 | --title "$RELEASE_NAME" \ 413 | --notes "$RELEASE_NOTES" \ 414 | --prerelease \ 415 | --latest=false 416 | 417 | echo "GitHub release created with the following files:" 418 | printf '%s\n' "${FILES[@]}" 419 | 420 | -------------------------------------------------------------------------------- /GKI/aio_gki_build_kernel_release_BACKUP.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | BUILD_CONFIGS=( 26 | "android12-5.10-198-2024-01" 27 | "android12-5.10-205-2024-03" 28 | "android12-5.10-209-2024-05" 29 | "android12-5.10-218-2024-08" 30 | "android12-5.10-X-lts" 31 | 32 | "android13-5.10-189-2023-11" 33 | "android13-5.10-198-2024-01" 34 | "android13-5.10-205-2024-03" 35 | "android13-5.10-209-2024-05" 36 | "android13-5.10-210-2024-06" 37 | "android13-5.10-214-2024-07" 38 | "android13-5.10-218-2024-08" 39 | "android13-5.10-X-lts" 40 | 41 | "android13-5.15-94-2023-05" 42 | "android13-5.15-123-2023-11" 43 | "android13-5.15-137-2024-01" 44 | "android13-5.15-144-2024-03" 45 | "android13-5.15-148-2024-05" 46 | "android13-5.15-149-2024-07" 47 | "android13-5.15-151-2024-08" 48 | "android13-5.15-167-2024-11" 49 | "android13-5.15-X-lts" 50 | 51 | "android14-5.15-131-2023-11" 52 | "android14-5.15-137-2024-01" 53 | "android14-5.15-144-2024-03" 54 | "android14-5.15-148-2024-05" 55 | "android14-5.15-149-2024-06" 56 | "android14-5.15-153-2024-07" 57 | "android14-5.15-158-2024-08" 58 | "android14-5.15-167-2024-11" 59 | "android14-5.15-X-lts" 60 | 61 | "android14-6.1-25-2023-10" 62 | "android14-6.1-43-2023-11" 63 | "android14-6.1-57-2024-01" 64 | "android14-6.1-68-2024-03" 65 | "android14-6.1-75-2024-05" 66 | "android14-6.1-78-2024-06" 67 | "android14-6.1-84-2024-07" 68 | "android14-6.1-90-2024-08" 69 | "android14-6.1-112-2024-11" 70 | "android14-6.1-115-2024-12" 71 | "android14-6.1-X-lts" 72 | 73 | #"android15-6.6-30-2024-08" 74 | ) 75 | 76 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 77 | declare -A RELEASE_ZIPS=() 78 | 79 | # Iterate over configurations 80 | build_config() { 81 | CONFIG=$1 82 | CONFIG_DETAILS=${CONFIG} 83 | 84 | # Create a directory named after the current configuration 85 | echo "Creating folder for configuration: $CONFIG..." 86 | mkdir -p "$CONFIG" 87 | cd "$CONFIG" 88 | 89 | # Split the config details into individual components 90 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION SUB_LEVEL DATE <<< "$CONFIG_DETAILS" 91 | 92 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 93 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${DATE}" 94 | 95 | # Log file for this build in case of failure 96 | LOG_FILE="../${CONFIG}_build.log" 97 | 98 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 99 | echo "Cloning AnyKernel3 repository..." 100 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "${ANDROID_VERSION}-${KERNEL_VERSION}" 101 | echo "Cloning susfs4ksu repository..." 102 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "gki-${ANDROID_VERSION}-${KERNEL_VERSION}" 103 | echo "Cloning kernel_patches repository..." 104 | git clone https://github.com/TheWildJames/kernel_patches.git 105 | 106 | # Setup directory for each build 107 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 108 | 109 | # Check if the source directory exists and is a directory 110 | if [ -d "$SOURCE_DIR" ]; then 111 | # Copy the directory to the current working directory 112 | echo "Copying $SOURCE_DIR to ./" 113 | cp -r "$SOURCE_DIR" ./ 114 | echo "Successfully copied $SOURCE_DIR to ./" 115 | else 116 | mkdir -p "$CONFIG" 117 | fi 118 | 119 | cd "$CONFIG" 120 | 121 | # Initialize and sync kernel source with updated repo commands 122 | echo "Initializing and syncing kernel source..." 123 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 124 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 125 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 126 | 127 | # Check if the branch is deprecated and adjust the manifest 128 | if grep -q deprecated <<< $REMOTE_BRANCH; then 129 | echo "Found deprecated branch: $FORMATTED_BRANCH" 130 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 131 | fi 132 | 133 | # Verify repo version and sync 134 | repo --version 135 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 136 | 137 | # Apply KernelSU and SUSFS patches 138 | echo "Adding KernelSU..." 139 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash - 140 | cd ./KernelSU-Next/kernel 141 | sed -i 's/ccflags-y += -DKSU_VERSION=16/ccflags-y += -DKSU_VERSION=12000/' ./Makefile 142 | cd ../../ 143 | echo "Applying SUSFS patches..." 144 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 145 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch ./common/ 146 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 147 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 148 | 149 | # Apply the patches 150 | cd ./KernelSU-Next 151 | patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true 152 | cd ../common 153 | patch -p1 < 50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch || true 154 | cp ../../kernel_patches/69_hide_stuff.patch ./ 155 | patch -p1 -F 3 < 69_hide_stuff.patch 156 | cd .. 157 | 158 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 159 | patch -p1 -F 3 < apk_sign.c_fix.patch 160 | 161 | cp ../kernel_patches/core_hook.c_fix.patch ./ 162 | patch -p1 --fuzz=3 < ./core_hook.c_fix.patch 163 | 164 | cp ../kernel_patches/selinux.c_fix.patch ./ 165 | patch -p1 -F 3 < selinux.c_fix.patch 166 | 167 | # Add configuration settings for SUSFS 168 | echo "Adding configuration settings to gki_defconfig..." 169 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 170 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 171 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 172 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 173 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 174 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 175 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 176 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 177 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 178 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 179 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 180 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 181 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 182 | echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 183 | echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 184 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 185 | echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig 186 | 187 | # Build kernel 188 | echo "Building kernel for $CONFIG..." 189 | 190 | # Check if build.sh exists, if it does, run the default build script 191 | if [ -e build/build.sh ]; then 192 | echo "build.sh found, running default build script..." 193 | # Modify config files for the default build process 194 | sed -i '2s/check_defconfig//' ./common/build.config.gki 195 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 196 | LTO=full BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 197 | 198 | # Copying to AnyKernel3 199 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 200 | 201 | # Check if the boot.img file exists 202 | if [ "$ANDROID_VERSION" = "android12" ]; then 203 | mkdir bootimgs 204 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 205 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 206 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 207 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 208 | gzip -n -k -f -9 ../Image >../Image.gz 209 | cd ./bootimgs 210 | 211 | GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${DATE}"_r1.zip 212 | FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip 213 | status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null) 214 | 215 | if [ "$status" = "200" ]; then 216 | curl -Lo gki-kernel.zip "$GKI_URL" 217 | else 218 | echo "[+] $GKI_URL not found, using $FALLBACK_URL" 219 | curl -Lo gki-kernel.zip "$FALLBACK_URL" 220 | fi 221 | 222 | unzip gki-kernel.zip && rm gki-kernel.zip 223 | echo 'Unpack prebuilt boot.img' 224 | unpack_bootimg.py --boot_img="./boot-5.10.img" 225 | 226 | echo 'Building Image.gz' 227 | gzip -n -k -f -9 Image >Image.gz 228 | 229 | echo 'Building boot.img' 230 | mkbootimg.py --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 231 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 232 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 233 | 234 | echo 'Building boot-gz.img' 235 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 236 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 237 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 238 | 239 | echo 'Building boot-lz4.img' 240 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 241 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 242 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 243 | cd .. 244 | 245 | elif [ "$ANDROID_VERSION" = "android13" ]; then 246 | mkdir bootimgs 247 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 248 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 249 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 250 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 251 | gzip -n -k -f -9 ../Image >../Image.gz 252 | cd ./bootimgs 253 | 254 | echo 'Building Image.gz' 255 | gzip -n -k -f -9 Image >Image.gz 256 | 257 | echo 'Building boot.img' 258 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 259 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 260 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 261 | 262 | echo 'Building boot-gz.img' 263 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 264 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 265 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 266 | 267 | echo 'Building boot-lz4.img' 268 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 269 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 270 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 271 | cd .. 272 | fi 273 | else 274 | # Use Bazel build if build.sh exists 275 | echo "Running Bazel build..." 276 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 277 | sed -i '2s/check_defconfig//' ./common/build.config.gki 278 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 279 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 280 | tools/bazel build --lto=full //common:kernel_aarch64_dist 281 | 282 | 283 | # Creating Boot imgs 284 | echo "Creating boot.imgs..." 285 | if [ "$ANDROID_VERSION" = "android14" ]; then 286 | mkdir bootimgs 287 | cp ./bazel-bin/common/kernel_aarch64/Image ./bootimgs 288 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs 289 | cp ./bazel-bin/common/kernel_aarch64/Image ../ 290 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../ 291 | gzip -n -k -f -9 ../Image >../Image.gz 292 | cd ./bootimgs 293 | 294 | echo 'Building Image.gz' 295 | gzip -n -k -f -9 Image >Image.gz 296 | 297 | echo 'Building boot.img' 298 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 299 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 300 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 301 | 302 | echo 'Building boot-gz.img' 303 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 304 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 305 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 306 | 307 | echo 'Building boot-lz4.img' 308 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 309 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 310 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 311 | cd .. 312 | fi 313 | fi 314 | 315 | # Create zip in the same directory 316 | cd ../AnyKernel3 317 | ZIP_NAME="AnyKernel3-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 318 | echo "Creating zip file: $ZIP_NAME..." 319 | mv ../Image ./Image 320 | zip -r "../../$ZIP_NAME" ./* 321 | rm ./Image 322 | ZIP_NAME="AnyKernel3-lz4-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 323 | echo "Creating zip file: $ZIP_NAME..." 324 | mv ../Image.lz4 ./Image.lz4 325 | zip -r "../../$ZIP_NAME" ./* 326 | rm ./Image.lz4 327 | ZIP_NAME="AnyKernel3-gz-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 328 | echo "Creating zip file: $ZIP_NAME..." 329 | mv ../Image.gz ./Image.gz 330 | zip -r "../../$ZIP_NAME" ./* 331 | rm ./Image.gz 332 | cd ../../ 333 | 334 | RELEASE_ZIPS["$ANDROID_VERSION-$KERNEL_VERSION.$SUB_LEVEL"]+="./$ZIP_NAME " 335 | 336 | # Delete the $CONFIG folder after building 337 | echo "Deleting $CONFIG folder..." 338 | rm -rf "$CONFIG" 339 | } 340 | 341 | # Concurrent build management 342 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 343 | # Start the build process in the background 344 | build_config "$CONFIG" & 345 | 346 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 347 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 348 | sleep 1 # Check every second for free slots 349 | done 350 | 351 | echo "Building slowdown starts now:" 352 | for ((i=30; i>0; i--)); do 353 | echo "$i seconds remaining..." 354 | sleep 1 355 | done 356 | 357 | done 358 | 359 | wait 360 | 361 | echo "Build process complete." 362 | 363 | # Collect all zip and img files 364 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 365 | 366 | # GitHub repository details 367 | REPO_OWNER="TheWildJames" 368 | REPO_NAME="GKI_KernelSU_SUSFS" 369 | 370 | # Get the latest tag from the GitHub repository using the GitHub CLI 371 | LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name') 372 | 373 | # If no tags are found, default to 1.5.3-0 374 | if [ -z "$LATEST_TAG" ]; then 375 | LATEST_TAG="1.5.3-0" 376 | fi 377 | 378 | # Increment the suffix after the dash 379 | NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}') 380 | TAG_NAME="$NEW_TAG" 381 | 382 | #TAG_NAME="v1.5.3-$(date +'%Y.%m.%d-%H.%M.%S')" 383 | RELEASE_NAME="*TEST BUILD* GKI Kernels With KernelSU & SUSFS v1.5.3 *TEST BUILD*" 384 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 385 | 386 | Module: https://github.com/sidex15/ksu_module_susfs 387 | 388 | Official Manager: 389 | https://github.com/tiann/KernelSU 390 | Non-Official Managers: 391 | https://github.com/rifsxd/KernelSU-Next 392 | https://github.com/backslashxx/KernelSU 393 | https://github.com/rsuntk/KernelSU 394 | https://github.com/5ec1cff/KernelSU 395 | https://github.com/silvzr/KernelSU 396 | https://github.com/sidex15/KernelSU 397 | 398 | Features: 399 | [+] KernelSU-Next 400 | [+] SUSFS v1.5.3 401 | [+] Wireguard Support 402 | [+] Maphide LineageOS Detections 403 | [+] Futile Maphide for jit-zygote-cache Detections 404 | [+] Magic Mount Support 405 | [+] Built With LTO=Full, Optimizations For Improved Performance And Efficiency 406 | " 407 | 408 | # Create the GitHub release 409 | echo "Creating GitHub release: $RELEASE_NAME..." 410 | gh release create "$TAG_NAME" "${FILES[@]}" \ 411 | --repo "$REPO_OWNER/$REPO_NAME" \ 412 | --title "$RELEASE_NAME" \ 413 | --notes "$RELEASE_NOTES" \ 414 | --prerelease \ 415 | --latest=false 416 | 417 | echo "GitHub release created with the following files:" 418 | printf '%s\n' "${FILES[@]}" 419 | 420 | -------------------------------------------------------------------------------- /Xiaomi/aio_gki_build_kernel_magic_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit immediately if a command exits with a non-zero status 4 | set -e 5 | 6 | #DO NOT GO OVER 4 7 | MAX_CONCURRENT_BUILDS=1 8 | 9 | # Check if 'builds' folder exists, create it if not 10 | if [ ! -d "./builds" ]; then 11 | echo "'builds' folder not found. Creating it..." 12 | mkdir -p ./builds 13 | else 14 | echo "'builds' folder already exists removing it." 15 | rm -rf ./builds 16 | mkdir -p ./builds 17 | fi 18 | 19 | cd ./builds 20 | ROOT_DIR="GKI-AIO-$(date +'%Y-%m-%d-%I-%M-%p')-release" 21 | echo "Creating root folder: $ROOT_DIR..." 22 | mkdir -p "$ROOT_DIR" 23 | cd "$ROOT_DIR" 24 | 25 | # Array with configurations (e.g., android-version-kernel-version-date) 26 | BUILD_CONFIGS=( 27 | #"android12-5.10-198-2024-01" 28 | #"android12-5.10-205-2024-03" 29 | #"android12-5.10-209-2024-05" 30 | #"android12-5.10-218-2024-08" 31 | 32 | #"android13-5.10-189-2023-11" 33 | #"android13-5.10-198-2024-01" 34 | #"android13-5.10-205-2024-03" 35 | #"android13-5.10-209-2024-05" 36 | #"android13-5.10-210-2024-06" 37 | #"android13-5.10-214-2024-07" 38 | #"android13-5.10-218-2024-08" 39 | 40 | #"android13-5.15-94-2023-05" 41 | "android13-5.15-123-2023-11" 42 | #"android13-5.15-137-2024-01" 43 | #"android13-5.15-144-2024-03" 44 | #"android13-5.15-148-2024-05" 45 | #"android13-5.15-149-2024-07" 46 | #"android13-5.15-151-2024-08" 47 | #"android13-5.15-167-2024-11" 48 | #"android13-5.15-173-lts" 49 | 50 | #"android14-5.15-131-2023-11" 51 | #"android14-5.15-137-2024-01" 52 | #"android14-5.15-144-2024-03" 53 | #"android14-5.15-148-2024-05" 54 | #"android14-5.15-149-2024-06" 55 | #"android14-5.15-153-2024-07" 56 | #"android14-5.15-158-2024-08" 57 | #"android14-5.15-167-2024-11" 58 | 59 | #"android14-6.1-25-2023-10" 60 | #"android14-6.1-43-2023-11" 61 | #"android14-6.1-57-2024-01" 62 | #"android14-6.1-68-2024-03" 63 | #"android14-6.1-75-2024-05" 64 | #"android14-6.1-78-2024-06" 65 | #"android14-6.1-84-2024-07" 66 | #"android14-6.1-90-2024-08" 67 | #"android14-6.1-112-2024-11" 68 | 69 | #"android15-6.6-30-2024-08" 70 | ) 71 | 72 | # Arrays to store generated zip files, grouped by androidversion-kernelversion 73 | declare -A RELEASE_ZIPS=() 74 | 75 | # Iterate over configurations 76 | build_config() { 77 | CONFIG=$1 78 | CONFIG_DETAILS=${CONFIG} 79 | 80 | # Create a directory named after the current configuration 81 | echo "Creating folder for configuration: $CONFIG..." 82 | mkdir -p "$CONFIG" 83 | cd "$CONFIG" 84 | 85 | # Split the config details into individual components 86 | IFS="-" read -r ANDROID_VERSION KERNEL_VERSION SUB_LEVEL DATE <<< "$CONFIG_DETAILS" 87 | 88 | # Formatted branch name for each build (e.g., android14-5.15-2024-01) 89 | FORMATTED_BRANCH="${ANDROID_VERSION}-${KERNEL_VERSION}-${DATE}" 90 | 91 | # Log file for this build in case of failure 92 | LOG_FILE="../${CONFIG}_build.log" 93 | 94 | echo "Starting build for $CONFIG using branch $FORMATTED_BRANCH..." 95 | # Check if AnyKernel3 repo exists, remove it if it does 96 | if [ -d "./AnyKernel3" ]; then 97 | echo "Removing existing AnyKernel3 directory..." 98 | rm -rf ./AnyKernel3 99 | fi 100 | echo "Cloning AnyKernel3 repository..." 101 | git clone https://github.com/TheWildJames/AnyKernel3.git -b "${ANDROID_VERSION}-${KERNEL_VERSION}" 102 | 103 | # Check if susfs4ksu repo exists, remove it if it does 104 | if [ -d "./susfs4ksu" ]; then 105 | echo "Removing existing susfs4ksu directory..." 106 | rm -rf ./susfs4ksu 107 | fi 108 | echo "Cloning susfs4ksu repository..." 109 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "gki-${ANDROID_VERSION}-${KERNEL_VERSION}" 110 | 111 | # Check if kernel_patches repo exists, remove it if it does 112 | if [ -d "./kernel_patches" ]; then 113 | echo "Removing existing kernel_patches directory..." 114 | rm -rf ./kernel_patches 115 | fi 116 | echo "Cloning kernel_patches repository..." 117 | git clone https://github.com/TheWildJames/kernel_patches.git 118 | 119 | # Setup directory for each build 120 | SOURCE_DIR="/home/james/android_kernels/$CONFIG" 121 | 122 | # Check if the source directory exists and is a directory 123 | if [ -d "$SOURCE_DIR" ]; then 124 | # Copy the directory to the current working directory 125 | echo "Copying $SOURCE_DIR to ./" 126 | cp -r "$SOURCE_DIR" ./ 127 | echo "Successfully copied $SOURCE_DIR to ./" 128 | else 129 | mkdir -p "$CONFIG" 130 | fi 131 | 132 | cd "$CONFIG" 133 | 134 | # Initialize and sync kernel source with updated repo commands 135 | echo "Initializing and syncing kernel source..." 136 | repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} 137 | REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH}) 138 | DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml 139 | 140 | # Check if the branch is deprecated and adjust the manifest 141 | if grep -q deprecated <<< $REMOTE_BRANCH; then 142 | echo "Found deprecated branch: $FORMATTED_BRANCH" 143 | sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH 144 | fi 145 | 146 | # Verify repo version and sync 147 | repo --version 148 | repo --trace sync -c -j$(nproc --all) --no-tags --fail-fast 149 | 150 | # Apply KernelSU and SUSFS patches 151 | echo "Adding KernelSU..." 152 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU/next/kernel/setup.sh" | bash -s next 153 | #curl -LSs "https://raw.githubusercontent.com/backslashxx/KernelSU/magic/kernel/setup.sh" | bash - 154 | #curl -LSs "https://raw.githubusercontent.com/5ec1cff/KernelSU/main/kernel/setup.sh" | bash - 155 | 156 | echo "Applying SUSFS patches..." 157 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ 158 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch ./common/ 159 | cp ../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/ 160 | cp ../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/ 161 | 162 | # Apply the patches 163 | cd ./KernelSU-Next 164 | if [ "${ANDROID_VERSION}" = "android14" ] && [ "${KERNEL_VERSION}" = "5.15" ]; then 165 | sed -i 's/KSU_EXPECTED_MAGIC_HASH := 7e0c6d7278a3bb8e364e0fcba95afaf3666cf5ff3c245a3b63c8833bd0445cc4/KSU_EXPECTED_MAGIC_HASH := 79e590113c4c4c0c222978e413a5faa801666957b1212a328e46c00c69821bf7/' ./10_enable_susfs_for_ksu.patch 166 | sed -i 's/KSU_EXPECTED_MAGIC_SIZE := 384/KSU_EXPECTED_MAGIC_SIZE := 998/' ./10_enable_susfs_for_ksu.patch 167 | fi 168 | patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true 169 | cd ../common 170 | patch -p1 < 50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch || true 171 | 172 | #adding lineage patch 173 | cp ../../kernel_patches/69_hide_stuff.patch ./ 174 | patch -p1 -F 3 < 69_hide_stuff.patch 175 | cp ../../kernel_patches/ksu_hooks.patch ./ 176 | patch -p1 -F 3 < ksu_hooks.patch 177 | 178 | cd .. 179 | if [ "${ANDROID_VERSION}" = "android14" ] && [ "${KERNEL_VERSION}" = "6.1" ]; then 180 | echo "Skipping selinux.c patch fix" 181 | else 182 | cp ../kernel_patches/selinux.c_fix.patch ./ 183 | patch -p1 -F 3 < selinux.c_fix.patch 184 | fi 185 | if [ "${ANDROID_VERSION}" = "android14" ] && [ "${KERNEL_VERSION}" = "5.15" ]; then 186 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/zuma_defconfig 187 | cp ../kernel_patches/apk_sign.c_fix.patch ./ 188 | patch -p1 -F 3 < apk_sign.c_fix.patch 189 | else 190 | echo "Skipping KSU_SUSFS_HAS_MAGIC_MOUNT=y" 191 | echo "Skipping apk_sign.c_fix.patch" 192 | fi 193 | cp ../kernel_patches/kernel_compat.c_fix.patch ./ 194 | patch -p1 --fuzz=3 < ./kernel_compat.c_fix.patch 195 | 196 | sed -i 's/#ifdef CONFIG_KPROBES/#if 0/g' ./KernelSU-Next/kernel/core_hook.c 197 | sed -i 's/#ifdef CONFIG_KPROBES/#if 0/g' ./KernelSU-Next/kernel/ksu.c 198 | sed -i 's/#ifdef CONFIG_KPROBES/#if 0/g' ./KernelSU-Next/kernel/ksud.c 199 | sed -i 's/#ifdef CONFIG_KPROBES/#if 0/g' ./KernelSU-Next/kernel/sucompat.c 200 | 201 | # Add configuration settings for SUSFS 202 | echo "Adding configuration settings to gki_defconfig..." 203 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 204 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 205 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 206 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 207 | echo "KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 208 | echo "KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 209 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 210 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig 211 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 212 | echo "KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=n" >> ./common/arch/arm64/configs/gki_defconfig 213 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 214 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 215 | echo "KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 216 | echo "KSU_SUSFS_SPOOF_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 217 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 218 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./common/arch/arm64/configs/gki_defconfig 219 | 220 | # Build kernel 221 | echo "Building kernel for $CONFIG..." 222 | 223 | # Check if build.sh exists, if it does, run the default build script 224 | if [ -e build/build.sh ]; then 225 | echo "build.sh found, running default build script..." 226 | # Modify config files for the default build process 227 | sed -i '2s/check_defconfig//' ./common/build.config.gki 228 | sed -i "s/dirty/'Wild+'/g" ./common/scripts/setlocalversion 229 | LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh 230 | 231 | # Copying to AnyKernel3 232 | echo "Copying Image.lz4 to $CONFIG/AnyKernel3..." 233 | 234 | # Check if the boot.img file exists 235 | if [ "$ANDROID_VERSION" = "android12" ]; then 236 | mkdir bootimgs 237 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 238 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 239 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 240 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 241 | gzip -n -k -f -9 ../Image >../Image.gz 242 | cd ./bootimgs 243 | 244 | GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${DATE}"_r1.zip 245 | FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip 246 | status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null) 247 | 248 | if [ "$status" = "200" ]; then 249 | curl -Lo gki-kernel.zip "$GKI_URL" 250 | else 251 | echo "[+] $GKI_URL not found, using $FALLBACK_URL" 252 | curl -Lo gki-kernel.zip "$FALLBACK_URL" 253 | fi 254 | 255 | unzip gki-kernel.zip && rm gki-kernel.zip 256 | echo 'Unpack prebuilt boot.img' 257 | unpack_bootimg.py --boot_img="./boot-5.10.img" 258 | 259 | echo 'Building Image.gz' 260 | gzip -n -k -f -9 Image >Image.gz 261 | 262 | echo 'Building boot.img' 263 | mkbootimg.py --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 264 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 265 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 266 | 267 | echo 'Building boot-gz.img' 268 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 269 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 270 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 271 | 272 | echo 'Building boot-lz4.img' 273 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${DATE}" 274 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 275 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 276 | cd .. 277 | 278 | elif [ "$ANDROID_VERSION" = "android13" ]; then 279 | mkdir bootimgs 280 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ./bootimgs 281 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ./bootimgs 282 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image ../ 283 | cp ./out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist/Image.lz4 ../ 284 | gzip -n -k -f -9 ../Image >../Image.gz 285 | cd ./bootimgs 286 | 287 | echo 'Building Image.gz' 288 | gzip -n -k -f -9 Image >Image.gz 289 | 290 | echo 'Building boot.img' 291 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 292 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 293 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 294 | 295 | echo 'Building boot-gz.img' 296 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 297 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 298 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 299 | 300 | echo 'Building boot-lz4.img' 301 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 302 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 303 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 304 | cd .. 305 | fi 306 | else 307 | # Use Bazel build if build.sh exists 308 | echo "Running Bazel build..." 309 | sed -i "/stable_scmversion_cmd/s/-maybe-dirty/-Wild+/g" ./build/kernel/kleaf/impl/stamp.bzl 310 | sed -i '2s/check_defconfig//' ./common/build.config.gki 311 | rm -rf ./common/android/abi_gki_protected_exports_aarch64 312 | rm -rf ./common/android/abi_gki_protected_exports_x86_64 313 | tools/bazel build --config=fast //common:kernel_aarch64_dist 314 | 315 | 316 | # Creating Boot imgs 317 | echo "Creating boot.imgs..." 318 | if [ "$ANDROID_VERSION" = "android14" ]; then 319 | mkdir bootimgs 320 | cp ./bazel-bin/common/kernel_aarch64/Image ./bootimgs 321 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs 322 | cp ./bazel-bin/common/kernel_aarch64/Image ../ 323 | cp ./bazel-bin/common/kernel_aarch64/Image.lz4 ../ 324 | gzip -n -k -f -9 ../Image >../Image.gz 325 | cd ./bootimgs 326 | 327 | echo 'Building Image.gz' 328 | gzip -n -k -f -9 Image >Image.gz 329 | 330 | echo 'Building boot.img' 331 | mkbootimg.py --header_version 4 --kernel Image --output boot.img 332 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 333 | cp ./boot.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot.img 334 | 335 | echo 'Building boot-gz.img' 336 | mkbootimg.py --header_version 4 --kernel Image.gz --output boot-gz.img 337 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 338 | cp ./boot-gz.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-gz.img 339 | 340 | echo 'Building boot-lz4.img' 341 | mkbootimg.py --header_version 4 --kernel Image.lz4 --output boot-lz4.img 342 | avbtool.py add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key /home/james/keys/testkey_rsa2048.pem 343 | cp ./boot-lz4.img ../../../${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}-boot-lz4.img 344 | cd .. 345 | fi 346 | fi 347 | 348 | # Create zip in the same directory 349 | cd ../AnyKernel3 350 | ZIP_NAME="AnyKernel3-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 351 | echo "Creating zip file: $ZIP_NAME..." 352 | mv ../Image ./Image 353 | zip -r "../../$ZIP_NAME" ./* 354 | rm ./Image 355 | ZIP_NAME="AnyKernel3-lz4-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 356 | echo "Creating zip file: $ZIP_NAME..." 357 | mv ../Image.lz4 ./Image.lz4 358 | zip -r "../../$ZIP_NAME" ./* 359 | rm ./Image.lz4 360 | ZIP_NAME="AnyKernel3-gz-${ANDROID_VERSION}-${KERNEL_VERSION}.${SUB_LEVEL}_${DATE}.zip" 361 | echo "Creating zip file: $ZIP_NAME..." 362 | mv ../Image.gz ./Image.gz 363 | zip -r "../../$ZIP_NAME" ./* 364 | rm ./Image.gz 365 | cd ../../ 366 | 367 | RELEASE_ZIPS["$ANDROID_VERSION-$KERNEL_VERSION.$SUB_LEVEL"]+="./$ZIP_NAME " 368 | 369 | # Delete the $CONFIG folder after building 370 | echo "Deleting $CONFIG folder..." 371 | #rm -rf "$CONFIG" 372 | } 373 | 374 | # Concurrent build management 375 | for CONFIG in "${BUILD_CONFIGS[@]}"; do 376 | # Start the build process in the background 377 | build_config "$CONFIG" & 378 | 379 | # Limit concurrent jobs to $MAX_CONCURRENT_BUILDS 380 | while (( $(jobs -r | wc -l) >= MAX_CONCURRENT_BUILDS )); do 381 | sleep 1 # Check every second for free slots 382 | done 383 | done 384 | 385 | wait 386 | 387 | echo "Build process complete." 388 | 389 | exit 390 | 391 | # Collect all zip and img files 392 | FILES=($(find ./ -type f \( -name "*.zip" -o -name "*.img" \))) 393 | 394 | # GitHub repository details 395 | REPO_OWNER="TheWildJames" 396 | REPO_NAME="GKI_KernelSU_SUSFS" 397 | TAG_NAME="v$(date +'%Y.%m.%d-%H%M%S')" 398 | RELEASE_NAME="GKI Kernels With KernelSU & SUSFS v1.5.3" 399 | RELEASE_NOTES="This release contains KernelSU and SUSFS v1.5.3 400 | Note: 6.1 Kernels are still on 1.5.2 401 | 402 | Module: 403 | https://github.com/sidex15/ksu_module_susfs 404 | Note: Use 1.5.2 until 1.5.3 405 | Note: 6.1 Kernels use r10 for best compatibility 406 | 407 | Manager: 408 | https://github.com/rifsxd/KernelSU-Next 409 | https://github.com/rsuntk/KernelSU 410 | 411 | Features: 412 | [+] KernelSU-Next 413 | [+] SUSFS v1.5.3 414 | [+] Built-in sus_su mode 2 (Will say disabled in module) 415 | [+] Wireguard Support 416 | [+] Maphide LineageOS Detections 417 | [+] Futile Maphide for jit-zygote-cache Detections 418 | [+] Magic Mount (Must delete /data/adb/ksu/modules.img and /data/adb/modules) 419 | " 420 | 421 | # Create the GitHub release 422 | echo "Creating GitHub release: $RELEASE_NAME..." 423 | gh release create "$TAG_NAME" "${FILES[@]}" \ 424 | --repo "$REPO_OWNER/$REPO_NAME" \ 425 | --title "$RELEASE_NAME" \ 426 | --notes "$RELEASE_NOTES" 427 | 428 | echo "GitHub release created with the following files:" 429 | printf '%s\n' "${FILES[@]}" 430 | 431 | --------------------------------------------------------------------------------