├── .github └── workflows │ ├── Build KernelSU Next.yml │ ├── Build KernelSU.yml │ └── Build SukiSU Ultra.yml ├── RD.py └── README.md /.github/workflows/Build KernelSU Next.yml: -------------------------------------------------------------------------------- 1 | name: Build OnePlus KernelSU Next 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | CPU: 6 | description: "CPU分支" 7 | required: true 8 | type: choice 9 | options: 10 | - 'sm8650' 11 | - 'sm8550' 12 | - 'sm8450' 13 | - 'sm8475' 14 | - 'sm7675' 15 | default: 'sm8650' 16 | FEIL: 17 | description: "手机型号" 18 | required: true 19 | type: choice 20 | options: 21 | - 'oneplus12_v' 22 | - 'oneplus12_u' 23 | - 'oneplus_ace3_pro_v' 24 | - 'oneplus_ace5' 25 | - 'oneplus_pad2_v' 26 | - 'oneplus_11_v' 27 | - 'oneplus_11_u' 28 | - 'oneplus_11_t' 29 | - 'oneplus_12r_v' 30 | - 'oneplus_ace2pro_v' 31 | - 'oneplus_ace3_v' 32 | - 'oneplus_open_v' 33 | - 'oneplus_10t_v' 34 | - 'oneplus_11r_v' 35 | - 'oneplus_ace2_v' 36 | - 'oneplus_ace_pro_v' 37 | - 'oneplus_10_pro_v' 38 | - 'oneplus_ace_3v_v' 39 | - ' ' 40 | default: 'oneplus12_v' 41 | CPUD: 42 | description: "处理器代号" 43 | required: true 44 | type: choice 45 | options: 46 | - 'pineapple' 47 | - 'kalama' 48 | - 'waipio' 49 | default: 'pineapple' 50 | ANDROID_VERSION: 51 | description: "内核安卓版本" 52 | required: true 53 | type: choice 54 | options: 55 | - 'android14' 56 | - 'android13' 57 | - 'android12' 58 | default: 'android14' 59 | KERNEL_VERSION: 60 | description: "内核版本" 61 | required: true 62 | type: choice 63 | options: 64 | - '6.1' 65 | - '5.15' 66 | - '5.10' 67 | default: '6.1' 68 | 69 | jobs: 70 | build: 71 | name: For ${{ github.event.inputs.FEIL }} 72 | runs-on: ubuntu-latest 73 | env: 74 | CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" 75 | CCACHE_NOHASHDIR: "true" 76 | CCACHE_HARDLINK: "true" 77 | CCACHE_DIR: /home/runner/.ccache 78 | CCACHE_MAXSIZE: 8G 79 | steps: 80 | - name: Maximize build space 81 | uses: easimon/maximize-build-space@master 82 | with: 83 | root-reserve-mb: 8192 84 | temp-reserve-mb: 2048 85 | remove-dotnet: 'true' 86 | remove-android: 'true' 87 | remove-haskell: 'true' 88 | remove-codeql: 'true' 89 | 90 | - name: Configure Git 91 | run: | 92 | git config --global user.name "build" 93 | git config --global user.email "2210077278@qq.com" 94 | 95 | - name: Install dependencies 96 | run: | 97 | sudo apt update && sudo apt upgrade -y 98 | sudo apt install -y python3 git curl 99 | sudo apt install -y python3 git curl ccache 100 | 101 | - name: Restore ccache 102 | uses: actions/cache@v3 103 | with: 104 | path: /home/runner/.ccache 105 | key: ccache-${{ runner.os }}-${{ github.ref }} 106 | restore-keys: | 107 | ccache-${{ runner.os }}- 108 | 109 | - name: Install repo tool 110 | run: | 111 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/repo 112 | chmod a+x ~/repo 113 | sudo mv ~/repo /usr/local/bin/repo 114 | 115 | - name: Initialize repo and sync 116 | run: | 117 | mkdir kernel_workspace && cd kernel_workspace 118 | repo init -u https://github.com/OnePlusOSS/kernel_manifest.git -b refs/heads/oneplus/${{ github.event.inputs.CPU }} -m ${{ github.event.inputs.FEIL }}.xml --depth=1 119 | repo sync 120 | rm kernel_platform/common/android/abi_gki_protected_exports_* || echo "No protected exports!" 121 | rm kernel_platform/msm-kernel/android/abi_gki_protected_exports_* || echo "No protected exports!" 122 | sed -i 's/ -dirty//g' kernel_platform/common/scripts/setlocalversion 123 | sed -i 's/ -dirty//g' kernel_platform/msm-kernel/scripts/setlocalversion 124 | sed -i 's/ -dirty//g' kernel_platform/external/dtc/scripts/setlocalversion 125 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/common/scripts/setlocalversion 126 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/msm-kernel/scripts/setlocalversion 127 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/external/dtc/scripts/setlocalversion 128 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/common/scripts/setlocalversion 129 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/msm-kernel/scripts/setlocalversion 130 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/external/dtc/scripts/setlocalversion 131 | 132 | - name: Set up KernelSU Next 133 | run: | 134 | cd kernel_workspace/kernel_platform 135 | curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next-susfs/kernel/setup.sh" | bash -s next 136 | cd KernelSU-Next 137 | KSU_VERSION=$(expr $(/usr/bin/git rev-list --count HEAD) "+" 10200) 138 | echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV 139 | sed -i "s/DKSU_VERSION=11998/DKSU_VERSION=${KSU_VERSION}/" kernel/Makefile 140 | 141 | - name: Set up SUSFS 142 | run: | 143 | cd kernel_workspace 144 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }} 145 | git clone https://github.com/Xiaomichael/kernel_patches.git 146 | cd kernel_platform 147 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch ./common/ 148 | cp ../kernel_patches/next/syscall_hooks.patch ./common/ 149 | cp ../kernel_patches/next/0001-kernel-patch-susfs-v1.5.7-to-KernelSU-Next-v1.0.7.patch ./KernelSU-Next/ 150 | cp ../kernel_patches/001-lz4.patch ./common/ 151 | cp ../kernel_patches/002-zstd.patch ./common/ 152 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 153 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 154 | 155 | # Apply patches 156 | cd ./KernelSU-Next 157 | patch -p1 < --forward < 0001-kernel-patch-susfs-v1.5.7-to-KernelSU-Next-v1.0.7.patch || true 158 | cd ../common 159 | if [ "${{ github.event.inputs.KERNEL_VERSION }}" == "6.1" ]; then 160 | patch -p1 < 001-lz4.patch || true 161 | patch -p1 < 002-zstd.patch || true 162 | fi 163 | patch -p1 < 50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch || true 164 | cp ../../kernel_patches/69_hide_stuff.patch ./ 165 | patch -p1 -F 3 < 69_hide_stuff.patch 166 | patch -p1 -F 3 < syscall_hooks.patch 167 | 168 | - name: Apply new hook & Add configuration 169 | run: | 170 | cd kernel_workspace/kernel_platform 171 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 172 | echo "CONFIG_KSU_WITH_KPROBES=n" >> ./common/arch/arm64/configs/gki_defconfig 173 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 174 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 175 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 176 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 177 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 178 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 179 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 180 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n" >> ./common/arch/arm64/configs/gki_defconfig 181 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 182 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 183 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 184 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 185 | echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 186 | echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 187 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 188 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./common/arch/arm64/configs/gki_defconfig 189 | sed -i 's/check_defconfig//' ./common/build.config.gki 190 | 191 | - name: Build Kernel 192 | run: | 193 | if [ "${{ github.event.inputs.KERNEL_VERSION }}" == "6.1" ]; then 194 | export PATH="$GITHUB_WORKSPACE/kernel_workspace/kernel_platform/prebuilts/clang/host/linux-x86/clang-r487747c/bin:$PATH" 195 | export PATH="/usr/lib/ccache:$PATH" 196 | sudo apt install libelf-dev 197 | cd kernel_workspace/kernel_platform/common 198 | make -j$(nproc --all) LLVM=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CC=clang RUSTC=../../prebuilts/rust/linux-x86/1.73.0b/bin/rustc PAHOLE=../../prebuilts/kernel-build-tools/linux-x86/bin/pahole LD=ld.lld HOSTLD=ld.lld O=out KCFLAGS+=-O2 gki_defconfig all 199 | else 200 | cd kernel_workspace 201 | LTO=thin ./kernel_platform/oplus/build/oplus_build_kernel.sh ${{ github.event.inputs.CPUD }} gki 202 | fi 203 | 204 | - name: Make AnyKernel3 205 | run: | 206 | git clone https://github.com/Xiaomichael/AnyKernel3 --depth=1 207 | rm -rf ./AnyKernel3/.git 208 | dir1="kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/dist/" 209 | dir2="kernel_workspace/kernel_platform/bazel-out/k8-fastbuild/bin/msm-kernel/${{ github.event.inputs.CPUD }}_gki_kbuild_mixed_tree/" 210 | dir3="kernel_workspace/kernel_platform/out/msm-${{ github.event.inputs.CPUD }}-${{ github.event.inputs.CPUD }}-gki/dist/" 211 | dir4="kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/gki_kernel/common/arch/arm64/boot/" 212 | dir5="kernel_workspace/kernel_platform/out/msm-${{ github.event.inputs.CPUD }}-${{ github.event.inputs.CPUD }}-gki/gki_kernel/common/arch/arm64/boot/" 213 | target1="./AnyKernel3/" 214 | target2="./kernel_workspace/kernel" 215 | 216 | if find "$dir1" -name "Image" | grep -q "Image"; then 217 | image_path="$dir1"Image 218 | elif find "$dir2" -name "Image" | grep -q "Image"; then 219 | image_path="$dir2"Image 220 | elif find "$dir3" -name "Image" | grep -q "Image"; then 221 | image_path="$dir3"Image 222 | elif find "$dir4" -name "Image" | grep -q "Image"; then 223 | image_path="$dir4"Image 224 | elif find "$dir5" -name "Image" | grep -q "Image"; then 225 | image_path="$dir5"Image 226 | else 227 | image_path=$(find "./kernel_workspace/kernel_platform/common/out/" -name "Image" | head -n 1) 228 | fi 229 | 230 | if [ -n "$image_path" ] && [ -f "$image_path" ]; then 231 | mkdir -p "$dir1" 232 | if [ "$(realpath "$image_path")" != "$(realpath "$dir1"Image)" ]; then 233 | cp "$image_path" "$dir1" 234 | else 235 | echo "源文件与目标相同,跳过复制" 236 | fi 237 | cp "$dir1"Image ./AnyKernel3/Image 238 | else 239 | echo "未找到 Image 文件,构建可能失败" 240 | exit 1 241 | fi 242 | 243 | - name: Upload AnyKernel3 lz4 & zstd 244 | if: ${{ github.event.inputs.KERNEL_VERSION == '6.1' }} 245 | uses: actions/upload-artifact@v4 246 | with: 247 | name: AnyKernel3_KernelSU_Next_lz4_zstd_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} 248 | path: ./AnyKernel3/* 249 | 250 | - name: Upload AnyKernel3 251 | if: ${{ github.event.inputs.KERNEL_VERSION != '6.1' }} 252 | uses: actions/upload-artifact@v4 253 | with: 254 | name: AnyKernel3_KernelSU_Next_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} 255 | path: ./AnyKernel3/* 256 | -------------------------------------------------------------------------------- /.github/workflows/Build KernelSU.yml: -------------------------------------------------------------------------------- 1 | name: Build OnePlus KernelSU 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | CPU: 6 | description: "CPU分支" 7 | required: true 8 | type: choice 9 | options: 10 | - 'sm8650' 11 | - 'sm8550' 12 | - 'sm8450' 13 | - 'sm8475' 14 | - 'sm7675' 15 | default: 'sm8650' 16 | FEIL: 17 | description: "手机型号" 18 | required: true 19 | type: choice 20 | options: 21 | - 'oneplus12_v' 22 | - 'oneplus12_u' 23 | - 'oneplus_ace3_pro_v' 24 | - 'oneplus_ace5' 25 | - 'oneplus_pad2_v' 26 | - 'oneplus_11_v' 27 | - 'oneplus_11_u' 28 | - 'oneplus_11_t' 29 | - 'oneplus_12r_v' 30 | - 'oneplus_ace2pro_v' 31 | - 'oneplus_ace3_v' 32 | - 'oneplus_open_v' 33 | - 'oneplus_10t_v' 34 | - 'oneplus_11r_v' 35 | - 'oneplus_ace2_v' 36 | - 'oneplus_ace_pro_v' 37 | - 'oneplus_10_pro_v' 38 | - 'oneplus_ace_3v_v' 39 | - ' ' 40 | default: 'oneplus12_v' 41 | CPUD: 42 | description: "处理器代号" 43 | required: true 44 | type: choice 45 | options: 46 | - 'pineapple' 47 | - 'kalama' 48 | - 'waipio' 49 | default: 'pineapple' 50 | ANDROID_VERSION: 51 | description: "内核安卓版本" 52 | required: true 53 | type: choice 54 | options: 55 | - 'android14' 56 | - 'android13' 57 | - 'android12' 58 | default: 'android14' 59 | KERNEL_VERSION: 60 | description: "内核版本" 61 | required: true 62 | type: choice 63 | options: 64 | - '6.1' 65 | - '5.15' 66 | - '5.10' 67 | default: '6.1' 68 | 69 | jobs: 70 | build: 71 | name: For ${{ github.event.inputs.FEIL }} 72 | runs-on: ubuntu-latest 73 | 74 | steps: 75 | - name: Maximize build space 76 | uses: easimon/maximize-build-space@master 77 | with: 78 | root-reserve-mb: 8192 79 | temp-reserve-mb: 2048 80 | remove-dotnet: 'true' 81 | remove-android: 'true' 82 | remove-haskell: 'true' 83 | remove-codeql: 'true' 84 | 85 | - name: Configure Git 86 | run: | 87 | git config --global user.name "bulid" 88 | git config --global user.email "2210077278@qq.com" 89 | 90 | - name: Install dependencies 91 | run: | 92 | sudo apt update && sudo apt upgrade -y 93 | sudo apt install -y python3 git curl 94 | 95 | - name: Install repo tool 96 | run: | 97 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/repo 98 | chmod a+x ~/repo 99 | sudo mv ~/repo /usr/local/bin/repo 100 | 101 | - name: Initialize repo and sync 102 | run: | 103 | mkdir kernel_workspace && cd kernel_workspace 104 | repo init -u https://github.com/OnePlusOSS/kernel_manifest.git -b refs/heads/oneplus/${{ github.event.inputs.CPU }} -m ${{ github.event.inputs.FEIL }}.xml --depth=1 105 | repo sync 106 | rm kernel_platform/common/android/abi_gki_protected_exports_* || echo "No protected exports!" 107 | rm kernel_platform/msm-kernel/android/abi_gki_protected_exports_* || echo "No protected exports!" 108 | sed -i 's/ -dirty//g' kernel_platform/common/scripts/setlocalversion 109 | sed -i 's/ -dirty//g' kernel_platform/msm-kernel/scripts/setlocalversion 110 | sed -i 's/ -dirty//g' kernel_platform/external/dtc/scripts/setlocalversion 111 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/common/scripts/setlocalversion 112 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/msm-kernel/scripts/setlocalversion 113 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/external/dtc/scripts/setlocalversion 114 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/common/scripts/setlocalversion 115 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/msm-kernel/scripts/setlocalversion 116 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/external/dtc/scripts/setlocalversion 117 | 118 | - name: Set up KernelSU 119 | run: | 120 | cd kernel_workspace/kernel_platform 121 | curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main 122 | cd ./KernelSU 123 | KSU_VERSION=$(expr $(/usr/bin/git rev-list --count main) "+" 10606) 124 | echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV 125 | export KSU_VERSION=$KSU_VERSION 126 | sed -i "s/DKSU_VERSION=16/DKSU_VERSION=${KSU_VERSION}/" kernel/Makefile 127 | 128 | - name: Set up hooks 129 | run: | 130 | cd kernel_workspace 131 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }} 132 | git clone https://github.com/Xiaomichael/kernel_patches.git 133 | cd kernel_platform 134 | 135 | # Copy SUSFS patches 136 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch ./common/ 137 | cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU 138 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 139 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 140 | 141 | cd ./KernelSU 142 | patch -p1 < 10_enable_susfs_for_ksu.patch || true 143 | cd ../common 144 | patch -p1 < 50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch || true 145 | cp ../../kernel_patches/69_hide_stuff.patch ./ 146 | patch -p1 -F 3 < 69_hide_stuff.patch 147 | 148 | - name: Build kernel 149 | run: | 150 | cd kernel_workspace 151 | if [ "${{ github.event.inputs.KERNEL_VERSION }}" == "6.1" ]; then 152 | ./kernel_platform/build_with_bazel.py -t ${{ github.event.inputs.CPUD }} gki 153 | else 154 | LTO=thin ./kernel_platform/oplus/build/oplus_build_kernel.sh ${{ github.event.inputs.CPUD }} gki 155 | fi 156 | 157 | - name: Make AnyKernel3 158 | run: | 159 | git clone https://github.com/Xiaomichael/AnyKernel3 --depth=1 160 | rm -rf ./AnyKernel3/.git 161 | dir1="kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/dist/" 162 | dir2="kernel_workspace/kernel_platform/bazel-out/k8-fastbuild/bin/msm-kernel/${{ github.event.inputs.CPUD }}_gki_kbuild_mixed_tree/" 163 | dir3="kernel_workspace/kernel_platform/out/msm-${{ github.event.inputs.CPUD }}-${{ github.event.inputs.CPUD }}-gki/dist/" 164 | dir4="kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/gki_kernel/common/arch/arm64/boot/" 165 | dir5="kernel_workspace/kernel_platform/out/msm-${{ github.event.inputs.CPUD }}-${{ github.event.inputs.CPUD }}-gki/gki_kernel/common/arch/arm64/boot/" 166 | target1="./AnyKernel3/" 167 | target2="./kernel_workspace/kernel" 168 | 169 | if find "$dir1" -name "Image" | grep -q "Image"; then 170 | image_path="$dir1"Image 171 | elif find "$dir2" -name "Image" | grep -q "Image"; then 172 | image_path="$dir2"Image 173 | elif find "$dir3" -name "Image" | grep -q "Image"; then 174 | image_path="$dir3"Image 175 | elif find "$dir4" -name "Image" | grep -q "Image"; then 176 | image_path="$dir4"Image 177 | elif find "$dir5" -name "Image" | grep -q "Image"; then 178 | image_path="$dir5"Image 179 | else 180 | image_path=$(find "./kernel_workspace/kernel_platform/common/out/" -name "Image" | head -n 1) 181 | fi 182 | 183 | if [ -n "$image_path" ] && [ -f "$image_path" ]; then 184 | mkdir -p "$dir1" 185 | if [ "$(realpath "$image_path")" != "$(realpath "$dir1"Image)" ]; then 186 | cp "$image_path" "$dir1" 187 | else 188 | echo "源文件与目标相同,跳过复制" 189 | fi 190 | cp "$dir1"Image ./AnyKernel3/Image 191 | else 192 | echo "未找到 Image 文件,构建可能失败" 193 | exit 1 194 | fi 195 | 196 | - name: Upload AnyKernel3 lz4 & zstd 197 | if: ${{ github.event.inputs.KERNEL_VERSION == '6.1' }} 198 | uses: actions/upload-artifact@v4 199 | with: 200 | name: AnyKernel3_KernelSU_lz4_zstd_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} 201 | path: ./AnyKernel3/* 202 | 203 | - name: Upload AnyKernel3 204 | if: ${{ github.event.inputs.KERNEL_VERSION != '6.1' }} 205 | uses: actions/upload-artifact@v4 206 | with: 207 | name: AnyKernel3_KernelSU_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} 208 | path: ./AnyKernel3/* 209 | -------------------------------------------------------------------------------- /.github/workflows/Build SukiSU Ultra.yml: -------------------------------------------------------------------------------- 1 | name: Build OnePlus SukiSU Ultra 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | CPU: 6 | description: "CPU分支" 7 | required: true 8 | type: choice 9 | options: 10 | - 'sm8650' 11 | - 'sm8550' 12 | - 'sm8450' 13 | - 'sm8475' 14 | - 'sm7675' 15 | default: 'sm8650' 16 | FEIL: 17 | description: "手机型号" 18 | required: true 19 | type: choice 20 | options: 21 | - 'oneplus12_v' 22 | - 'oneplus12_u' 23 | - 'oneplus_ace3_pro_v' 24 | - 'oneplus_ace5' 25 | - 'oneplus_pad2_v' 26 | - 'oneplus_11_v' 27 | - 'oneplus_11_u' 28 | - 'oneplus_11_t' 29 | - 'oneplus_12r_v' 30 | - 'oneplus_ace2pro_v' 31 | - 'oneplus_ace3_v' 32 | - 'oneplus_open_v' 33 | - 'oneplus_10t_v' 34 | - 'oneplus_11r_v' 35 | - 'oneplus_ace2_v' 36 | - 'oneplus_ace_pro_v' 37 | - 'oneplus_10_pro_v' 38 | - 'oneplus_ace_3v_v' 39 | - ' ' 40 | default: 'oneplus12_v' 41 | CPUD: 42 | description: "处理器代号" 43 | required: true 44 | type: choice 45 | options: 46 | - 'pineapple' 47 | - 'kalama' 48 | - 'waipio' 49 | default: 'pineapple' 50 | ANDROID_VERSION: 51 | description: "内核安卓版本" 52 | required: true 53 | type: choice 54 | options: 55 | - 'android14' 56 | - 'android13' 57 | - 'android12' 58 | default: 'android14' 59 | KERNEL_VERSION: 60 | description: "内核版本" 61 | required: true 62 | type: choice 63 | options: 64 | - '6.1' 65 | - '5.15' 66 | - '5.10' 67 | default: '6.1' 68 | lz4kd: 69 | description: "是否启用lz4kd" 70 | required: true 71 | type: boolean 72 | default: true 73 | 74 | jobs: 75 | build: 76 | name: For ${{ github.event.inputs.FEIL }} 77 | runs-on: ubuntu-latest 78 | env: 79 | CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" 80 | CCACHE_NOHASHDIR: "true" 81 | CCACHE_HARDLINK: "true" 82 | CCACHE_DIR: /home/runner/.ccache 83 | CCACHE_MAXSIZE: 8G 84 | steps: 85 | - name: 🚀 Maximize build space (最大化构建空间) 86 | uses: easimon/maximize-build-space@master 87 | with: 88 | root-reserve-mb: 8192 89 | temp-reserve-mb: 2048 90 | remove-dotnet: 'true' 91 | remove-android: 'true' 92 | remove-haskell: 'true' 93 | remove-codeql: 'true' 94 | 95 | - name: 📦 Configure Git 96 | run: | 97 | git config --global user.name "bulid" 98 | git config --global user.email "2210077278@qq.com" 99 | 100 | - name: 📦 Install dependencies (安装依赖) 101 | run: | 102 | sudo apt update && sudo apt upgrade -y 103 | sudo apt install -y python3 git curl 104 | sudo apt install -y python3 git curl ccache 105 | 106 | - name: 📥 Restore ccache (恢复 ccache 缓存) 107 | uses: actions/cache@v3 108 | with: 109 | path: /home/runner/.ccache 110 | key: ccache-${{ runner.os }}-${{ github.ref }} 111 | restore-keys: | 112 | ccache-${{ runner.os }}- 113 | 114 | - name: 📥 Install repo tool 115 | run: | 116 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/repo 117 | chmod a+x ~/repo 118 | sudo mv ~/repo /usr/local/bin/repo 119 | 120 | - name: 📥 Initialize repo and sync (克隆内核源码) 121 | run: | 122 | mkdir kernel_workspace && cd kernel_workspace 123 | repo init -u https://github.com/OnePlusOSS/kernel_manifest.git -b refs/heads/oneplus/${{ github.event.inputs.CPU }} -m ${{ github.event.inputs.FEIL }}.xml --depth=1 124 | repo sync 125 | rm kernel_platform/common/android/abi_gki_protected_exports_* || echo "No protected exports!" 126 | rm kernel_platform/msm-kernel/android/abi_gki_protected_exports_* || echo "No protected exports!" 127 | sed -i 's/ -dirty//g' kernel_platform/common/scripts/setlocalversion 128 | sed -i 's/ -dirty//g' kernel_platform/msm-kernel/scripts/setlocalversion 129 | sed -i 's/ -dirty//g' kernel_platform/external/dtc/scripts/setlocalversion 130 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/common/scripts/setlocalversion 131 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/msm-kernel/scripts/setlocalversion 132 | sed -i '$i res=$(echo "$res" | sed '\''s/-dirty//g'\'')' kernel_platform/external/dtc/scripts/setlocalversion 133 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/common/scripts/setlocalversion 134 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/msm-kernel/scripts/setlocalversion 135 | sed -i '$s|echo "\$res"|echo "-OKI-xiaoxiaow"|' kernel_platform/external/dtc/scripts/setlocalversion 136 | 137 | - name: ⚙️ Set up SukiSU Ultra (配置 SukiSU Ultra) 138 | run: | 139 | cd kernel_workspace/kernel_platform 140 | curl -LSs "https://raw.githubusercontent.com/ShirkNeko/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-dev 141 | cd ./KernelSU 142 | KSU_VERSION=$(expr $(/usr/bin/git rev-list --count main) "+" 10606) 143 | echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV 144 | export KSU_VERSION=$KSU_VERSION 145 | sed -i "s/DKSU_VERSION=12800/DKSU_VERSION=${KSU_VERSION}/" kernel/Makefile 146 | 147 | - name: 🔧 Set up SUSFS 148 | run: | 149 | cd kernel_workspace 150 | git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }} 151 | git clone https://github.com/Xiaomichael/kernel_patches.git 152 | git clone https://github.com/ShirkNeko/SukiSU_patch.git 153 | cd kernel_platform 154 | # Copy SUSFS patches 155 | cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch ./common/ 156 | cp ../kernel_patches/next/syscall_hooks.patch ./common/ 157 | cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ 158 | cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ 159 | if [ "${{ github.event.inputs.lz4kd }}" == "true" ]; then 160 | # Copy lz4k from ShirkNeko 161 | cp -r ../SukiSU_patch/other/zram/lz4k/include/linux/* ./common/include/linux 162 | cp -r ../SukiSU_patch/other/zram/lz4k/lib/* ./common/lib 163 | cp -r ../SukiSU_patch/other/zram/lz4k/crypto/* ./common/crypto 164 | cp -r ../SukiSU_patch/other/zram/lz4k_oplus ./common/lib/ 165 | fi 166 | 167 | cd ./common 168 | patch -p1 < 50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch || true 169 | cp ../../kernel_patches/69_hide_stuff.patch ./ 170 | patch -p1 -F 3 < 69_hide_stuff.patch 171 | patch -p1 -F 3 < syscall_hooks.patch 172 | if [ "${{ github.event.inputs.lz4kd }}" == "true" ]; then 173 | cp ../../SukiSU_patch/other/zram/zram_patch/${{ github.event.inputs.KERNEL_VERSION }}/lz4kd.patch ./ 174 | patch -p1 -F 3 < lz4kd.patch || true 175 | cp ../../SukiSU_patch/other/zram/zram_patch/${{ github.event.inputs.KERNEL_VERSION }}/lz4k_oplus.patch ./ 176 | patch -p1 -F 3 < lz4k_oplus.patch || true 177 | fi 178 | 179 | - name: 🔧 Add sched_ext 180 | run: | 181 | cd kernel_workspace/kernel_platform/ 182 | git clone https://github.com/HanKuCha/sched_ext.git 183 | cp -r ./sched_ext/* ./common/kernel/sched 184 | rm -rf ./sched_ext/.git 185 | cd common/kernel/sched 186 | 187 | - name: 🔧 Apply new hook & Add configuration 188 | run: | 189 | cd kernel_workspace/kernel_platform 190 | # Add KSU configuration settings 191 | echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig 192 | echo "CONFIG_KPM=y" >> ./common/arch/arm64/configs/gki_defconfig 193 | # Add VFS configuration settings 194 | echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./common/arch/arm64/configs/gki_defconfig 195 | echo "CONFIG_KSU_MANUAL_HOOK=y" >> ./common/arch/arm64/configs/gki_defconfig 196 | # Add SUSFS configuration settings 197 | echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig 198 | echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 199 | echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig 200 | echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 201 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 202 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 203 | echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig 204 | echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n" >> ./common/arch/arm64/configs/gki_defconfig 205 | echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 206 | echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig 207 | echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig 208 | echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig 209 | echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig 210 | echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig 211 | echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig 212 | if [ "${{ github.event.inputs.lz4kd }}" == "true" ]; then 213 | # Add lz4kd 214 | echo "CONFIG_ZSMALLOC=y" >> ./common/arch/arm64/configs/gki_defconfig 215 | echo "CONFIG_CRYPTO_LZ4HC=y" >> ./common/arch/arm64/configs/gki_defconfig 216 | echo "CONFIG_CRYPTO_LZ4K=y" >> ./common/arch/arm64/configs/gki_defconfig 217 | echo "CONFIG_CRYPTO_LZ4KD=y" >> ./common/arch/arm64/configs/gki_defconfig 218 | echo "CONFIG_CRYPTO_842=y" >> ./common/arch/arm64/configs/gki_defconfig 219 | echo "CONFIG_CRYPTO_LZ4K_OPLUS=y" >> ./common/arch/arm64/configs/gki_defconfig 220 | echo "CONFIG_ZRAM_WRITEBACK=y" >> ./common/arch/arm64/configs/gki_defconfig 221 | fi 222 | # Remove check_defconfig 223 | sed -i 's/check_defconfig//' ./common/build.config.gki 224 | 225 | - name: 🔨 Build Kernel (构建内核) 226 | run: | 227 | if [ "${{ github.event.inputs.KERNEL_VERSION }}" == "6.1" ]; then 228 | export PATH="$GITHUB_WORKSPACE/kernel_workspace/kernel_platform/prebuilts/clang/host/linux-x86/clang-r487747c/bin:$PATH" 229 | export PATH="/usr/lib/ccache:$PATH" 230 | sudo apt install libelf-dev 231 | cd kernel_workspace/kernel_platform/common 232 | make -j$(nproc --all) LLVM=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CC=clang RUSTC=../../prebuilts/rust/linux-x86/1.73.0b/bin/rustc PAHOLE=../../prebuilts/kernel-build-tools/linux-x86/bin/pahole LD=ld.lld HOSTLD=ld.lld O=out gki_defconfig all 233 | else 234 | cd kernel_workspace 235 | LTO=thin ./kernel_platform/oplus/build/oplus_build_kernel.sh ${{ github.event.inputs.CPUD }} gki 236 | fi 237 | 238 | - name: 📦 Package kernel to AnyKernel3 (打包内核到 AnyKernel3) 239 | run: | 240 | git clone https://github.com/Xiaomichael/AnyKernel3 --depth=1 241 | rm -rf ./AnyKernel3/.git 242 | dir1="kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/dist/" 243 | dir2="kernel_workspace/kernel_platform/bazel-out/k8-fastbuild/bin/msm-kernel/${{ github.event.inputs.CPUD }}_gki_kbuild_mixed_tree/" 244 | dir3="kernel_workspace/kernel_platform/out/msm-${{ github.event.inputs.CPUD }}-${{ github.event.inputs.CPUD }}-gki/dist/" 245 | dir4="kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/gki_kernel/common/arch/arm64/boot/" 246 | dir5="kernel_workspace/kernel_platform/out/msm-${{ github.event.inputs.CPUD }}-${{ github.event.inputs.CPUD }}-gki/gki_kernel/common/arch/arm64/boot/" 247 | target1="./AnyKernel3/" 248 | target2="./kernel_workspace/kernel" 249 | 250 | if find "$dir1" -name "Image" | grep -q "Image"; then 251 | image_path="$dir1"Image 252 | elif find "$dir2" -name "Image" | grep -q "Image"; then 253 | image_path="$dir2"Image 254 | elif find "$dir3" -name "Image" | grep -q "Image"; then 255 | image_path="$dir3"Image 256 | elif find "$dir4" -name "Image" | grep -q "Image"; then 257 | image_path="$dir4"Image 258 | elif find "$dir5" -name "Image" | grep -q "Image"; then 259 | image_path="$dir5"Image 260 | else 261 | image_path=$(find "./kernel_workspace/kernel_platform/common/out/" -name "Image" | head -n 1) 262 | fi 263 | 264 | if [ -n "$image_path" ] && [ -f "$image_path" ]; then 265 | mkdir -p "$dir1" 266 | if [ "$(realpath "$image_path")" != "$(realpath "$dir1"Image)" ]; then 267 | cp "$image_path" "$dir1" 268 | else 269 | echo "源文件与目标相同,跳过复制" 270 | fi 271 | cp "$dir1"Image ./AnyKernel3/Image 272 | else 273 | echo "未找到 Image 文件,构建可能失败" 274 | exit 1 275 | fi 276 | 277 | - name: 🛠️ KPM Patching Image Files (KPM 修补 Image 文件) 278 | run: | 279 | cd kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/dist 280 | curl -LO https://github.com/ShirkNeko/SukiSU_KernelPatch_patch/releases/download/0.11-beta/patch_linux 281 | chmod +x patch_linux 282 | ./patch_linux 283 | rm -f Image 284 | mv oImage Image 285 | cp Image $GITHUB_WORKSPACE/AnyKernel3/Image 286 | cp Image $GITHUB_WORKSPACE/kernel_workspace/kernel 287 | 288 | - name: 📤 Upload AnyKernel3 with lz4kd 289 | if: ${{ github.event.inputs.lz4kd == 'true' }} 290 | uses: actions/upload-artifact@v4 291 | with: 292 | name: AnyKernel3_SukiSU_Ultra_lz4kd_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} 293 | path: ./AnyKernel3/* 294 | 295 | - name: 📤 Upload AnyKernel3 296 | if: ${{ github.event.inputs.lz4kd != 'true' }} 297 | uses: actions/upload-artifact@v4 298 | with: 299 | name: AnyKernel3_SukiSU_Ultra_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} 300 | path: ./AnyKernel3/* 301 | 302 | - name: 📝 Find zram.ko & crypto_zstdn.ko 303 | if: ${{ github.event.inputs.lz4kd == 'true' }} 304 | run: | 305 | find -name zram.ko 306 | find -name crypto_zstdn.ko 307 | 308 | - name: 📤 Upload zram.ko 309 | if: ${{ github.event.inputs.lz4kd == 'true' }} || ${{ github.event.inputs.KERNEL_VERSION == '6.1' }} 310 | uses: actions/upload-artifact@v4 311 | with: 312 | name: zram.ko 313 | path: ./kernel_workspace/kernel_platform/common/out/drivers/block/zram/zram.ko 314 | -------------------------------------------------------------------------------- /RD.py: -------------------------------------------------------------------------------- 1 | def readme(): 2 | print("this is a project which can release OnePlus Kernel with KernelSU") 3 | readme() 4 | yaap = 'repo init -u https://github.com/RealJohnGalt/opsm8650_kernel_manifest.git -b refs/heads/kplatform -m default.xml --depth=1' 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 求``⭐⭐star⭐⭐`` 2 | 3 | # 觉得好用可以 4 | 5 | ![image](https://github.com/user-attachments/assets/331a44ba-c666-4368-87d6-df55de482b58) 6 | 7 | ### [```OnePlus kernel 开源地址```](https://github.com/OnePlusOSS/kernel_manifest) 8 | 9 | > [!TIP] 10 | > 11 | > 目前暂``不支持`` ``一加6.6系``, 随缘更新 12 | > 13 | > 食用方法: 14 | > 15 | > 以``一加12``为例,打开上面的链接,配置文件中的``_x``后缀是你正在使用系统版本。``_v``是``Android15``、``_u``是``Android14``、``_t``是``Android13``、无后缀一般是一个机型出厂``Android``版本,那么最新的``一加12``配置就是``oneplus12_v`` 16 | > 17 | > ![image](https://github.com/user-attachments/assets/737fcdb5-fce0-473d-8945-f1491db5727a) 18 | > 19 | > 点击``Branches``可以切换处理器分支,然后再寻找你想要的配置即可 20 | > 21 | > ![image](https://github.com/user-attachments/assets/58f31536-b88e-4613-9865-3e0574868928) 22 | > 23 | > 关于``处理器代号``的查看 24 | > 25 | > ![image](https://github.com/user-attachments/assets/fc217103-24ef-45fa-a7e1-f13cfd64f771) 26 | > 27 | > 关于是否启用``lz4kd``, 我的评价是如果跑出来不报错就开着,开了会``省电`` + ``流畅``很多 28 | > 29 | > 最后在运行时选择的配置就会如下 30 | > 31 | >![image](https://github.com/user-attachments/assets/acddcb85-cd80-4a6a-8b56-12abb7f7b83d) 32 | --------------------------------------------------------------------------------