1010 workflow_dispatch :
1111 inputs :
1212 ksu_type :
13- description : ' KernelSU分支(SukiSU Ultra/KernelSU Next,默认SukiSU Ultra)'
13+ description : ' KernelSU分支(SukiSU Ultra/KernelSU Next/MKSU/KernelSU(原版) ,默认SukiSU Ultra)'
1414 required : true
1515 type : choice
1616 default : ' sukisu'
1717 options :
1818 - ' sukisu'
1919 - ' ksunext'
20- hook_method :
21- description : hook模式(大部分情况manual即可,少数需切换sus su模式的场景才需要kprobes钩子, 若新版manual钩子出现问题可尝试syscall)
22- required : true
23- type : choice
24- default : ' manual'
25- options :
26- - ' manual'
27- - ' kprobes'
28- - ' syscall'
20+ - ' mksu'
21+ - ' ksu'
2922 kpm_enable :
3023 description : ' 是否开启kpm(仅对sukisu生效; 可能轻微增加耗电,不需要可保持默认关闭)'
3124 required : true
@@ -241,14 +234,30 @@ jobs:
241234 grep -A10 "REPO_OWNER" kernel/Makefile # 检查插入点后的内容
242235 grep "KSU_VERSION_FULL" kernel/Makefile # 确认版本定义存在
243236 echo "SukiSU版本号: v${KSU_API_VERSION}-${GIT_COMMIT_HASH}@cctv18"
244- else
237+ elif [[ ${{ github.event.inputs.ksu_type }} == "ksunext" ]]; then
245238 echo "正在配置KernelSU Next..."
246239 curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/next-susfs/kernel/setup.sh" | bash -s next-susfs
247240 cd KernelSU-Next
248241 KSU_VERSION=$(expr $(curl -sI "https://api.github.com/repos/pershoot/KernelSU-Next/commits?sha=next&per_page=1" | grep -i "link:" | sed -n 's/.*page=\([0-9]*\)>; rel="last".*/\1/p') "+" 10200)
249242 echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
250243 echo "ksuver=$KSU_VERSION" >> $GITHUB_OUTPUT
251244 sed -i "s/DKSU_VERSION=11998/DKSU_VERSION=${KSU_VERSION}/" kernel/Makefile
245+ elif [[ ${{ github.event.inputs.ksu_type }} == "mksu" ]]; then
246+ echo "正在配置 MKSU (5ec1cff/KernelSU)..."
247+ curl -LSs "https://raw.githubusercontent.com/5ec1cff/KernelSU/refs/heads/main/kernel/setup.sh" | bash -s main
248+ cd ./KernelSU
249+ KSU_VERSION=$(expr $(curl -sI "https://api.github.com/repos/5ec1cff/KernelSU/commits?sha=main&per_page=1" | grep -i "link:" | sed -n 's/.*page=\([0-9]*\)>; rel="last".*/\1/p') "+" 20000)
250+ echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
251+ echo "ksuver=$KSU_VERSION" >> $GITHUB_OUTPUT
252+ sed -i "s/DKSU_VERSION=16/DKSU_VERSION=${KSU_VERSION}/" kernel/Makefile
253+ else
254+ echo "正在配置原版 KernelSU (tiann/KernelSU)..."
255+ curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/refs/heads/main/kernel/setup.sh" | bash -s main
256+ cd ./KernelSU
257+ KSU_VERSION=$(expr $(curl -sI "https://api.github.com/repos/tiann/KernelSU/commits?sha=main&per_page=1" | grep -i "link:" | sed -n 's/.*page=\([0-9]*\)>; rel="last".*/\1/p') "+" 20000)
258+ echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
259+ echo "ksuver=$KSU_VERSION" >> $GITHUB_OUTPUT
260+ sed -i "s/DKSU_VERSION=16/DKSU_VERSION=${KSU_VERSION}/" kernel/Makefile
252261 fi
253262
254263 - name : 应用 KernelSU & SUSFS 补丁
@@ -261,53 +270,72 @@ jobs:
261270 cp ./susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch ./common/
262271 cp ./susfs4ksu/kernel_patches/fs/* ./common/fs/
263272 cp ./susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
264- if [[ ${{ github.event.inputs.hook_method }} == "manual" ]]; then
265- cp ./SukiSU_patch/hooks/scope_min_manual_hooks_v1.6.patch ./common/
266- fi
267- if [[ ${{ github.event.inputs.hook_method }} == "syscall" ]]; then
268- cp ./SukiSU_patch/hooks/syscall_hooks.patch ./common/
269- fi
270273 cp ./SukiSU_patch/69_hide_stuff.patch ./common/
271274 cd ./common
272275 patch -p1 < 50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch || true
273276 #临时修复 undeclared identifier 'vma' 编译错误:把vma = find_vma(...)替换为struct vm_area_struct *vma = find_vma(...),解决部分版本源码中vma定义缺失的问题
274277 sed -i 's|vma = find_vma(mm|struct vm_area_struct *&|' ./fs/proc/task_mmu.c
275- if [[ ${{ github.event.inputs.hook_method }} == "manual" ]]; then
276- patch -p1 < scope_min_manual_hooks_v1.6.patch || true
277- fi
278- if [[ ${{ github.event.inputs.hook_method }} == "syscall" ]]; then
279- patch -p1 < syscall_hooks.patch || true
280- fi
281278 patch -p1 < 69_hide_stuff.patch || true
282- else
279+ elif [[ ${{ github.event.inputs.ksu_type }} == "ksunext" ]]; then
283280 echo "正在添加KernelSU Next补丁..."
284281 git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}
282+ #由于KernelSU Next尚未更新并适配susfs 2.0.0,故回退至susfs 1.5.12
283+ cd susfs4ksu && git checkout a162e2469d0b472545e5e46457eee171c0975fb0 && cd ..
285284 git clone https://github.com/WildKernels/kernel_patches.git
286285 cp ./susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch ./common/
287286 cp ./susfs4ksu/kernel_patches/fs/* ./common/fs/
288287 cp ./susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
289- if [[ ${{ github.event.inputs.hook_method }} == "manual" ]]; then
290- cp ./kernel_patches/next/scope_min_manual_hooks_v1.5.patch ./common/
291- fi
292- if [[ ${{ github.event.inputs.hook_method }} == "syscall" ]]; then
293- cp ./kernel_patches/next/syscall_hooks.patch ./common/
294- fi
288+ cp ./kernel_patches/next/scope_min_manual_hooks_v1.5.patch ./common/
295289 cp ./kernel_patches/69_hide_stuff.patch ./common/
296290 cd ./common
297291 patch -p1 < 50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch || true
298292 #临时修复 undeclared identifier 'vma' 编译错误:把vma = find_vma(...)替换为struct vm_area_struct *vma = find_vma(...),解决部分版本源码中vma定义缺失的问题
299293 sed -i 's|vma = find_vma(mm|struct vm_area_struct *&|' ./fs/proc/task_mmu.c
300- if [[ ${{ github.event.inputs.hook_method }} == "manual" ]]; then
301- patch -p1 -N -F 3 < scope_min_manual_hooks_v1.5.patch || true
302- fi
303- if [[ ${{ github.event.inputs.hook_method }} == "syscall" ]]; then
304- patch -p1 -N -F 3 < syscall_hooks.patch || true
305- fi
294+ patch -p1 -N -F 3 < scope_min_manual_hooks_v1.5.patch || true
306295 patch -p1 -N -F 3 < 69_hide_stuff.patch || true
307296 #为KernelSU Next添加WildKSU管理器支持
308297 cd ./drivers/kernelsu
309298 wget https://github.com/WildKernels/kernel_patches/raw/refs/heads/main/next/susfs_fix_patches/v1.5.12/fix_apk_sign.c.patch
310299 patch -p2 -N -F 3 < fix_apk_sign.c.patch || true
300+ elif [[ ${{ github.event.inputs.ksu_type }} == "mksu" ]]; then
301+ echo "正在为 MKSU (5ec1cff/KernelSU)添加补丁..."
302+ git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}
303+ git clone https://github.com/ShirkNeko/SukiSU_patch.git
304+ cp ./susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/
305+ cp ./susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch ./common/
306+ cp ./susfs4ksu/kernel_patches/fs/* ./common/fs/
307+ cp ./susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
308+ cp ./SukiSU_patch/69_hide_stuff.patch ./common/
309+ cd ./KernelSU
310+ #为MKSU修正susfs 2.0.0补丁
311+ sed -i 's/@@ -13,6 +13,10 @@/@@ -13,7 +13,11 @@/' 10_enable_susfs_for_ksu.patch
312+ sed -i '/ #include <linux\/uaccess\.h>/ { N; s| #include <linux/uaccess\.h>\n #include <linux/version\.h>|&\n #include <linux/pid.h>| }' 10_enable_susfs_for_ksu.patch
313+ patch -p1 < 10_enable_susfs_for_ksu.patch || true
314+ wget https://github.com/cctv18/oppo_oplus_realme_sm8650/raw/refs/heads/main/other_patch/fix_umount.patch
315+ patch -p1 < fix_umount.patch || true
316+ cd ../common
317+ patch -p1 < 50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch || true
318+ #临时修复 undeclared identifier 'vma' 编译错误:把vma = find_vma(...)替换为struct vm_area_struct *vma = find_vma(...),解决部分版本源码中vma定义缺失的问题
319+ sed -i 's|vma = find_vma(mm|struct vm_area_struct *&|' ./fs/proc/task_mmu.c
320+ patch -p1 -N -F 3 < 69_hide_stuff.patch || true
321+ else
322+ echo "正在为原版 KernelSU (tiann/KernelSU)添加补丁..."
323+ git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}
324+ git clone https://github.com/ShirkNeko/SukiSU_patch.git
325+ cp ./susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/
326+ cp ./susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch ./common/
327+ cp ./susfs4ksu/kernel_patches/fs/* ./common/fs/
328+ cp ./susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
329+ cp ./SukiSU_patch/69_hide_stuff.patch ./common/
330+ cd ./KernelSU
331+ patch -p1 < 10_enable_susfs_for_ksu.patch || true
332+ wget https://github.com/cctv18/oppo_oplus_realme_sm8650/raw/refs/heads/main/other_patch/fix_umount.patch
333+ patch -p1 < fix_umount.patch || true
334+ cd ../common
335+ patch -p1 < 50_add_susfs_in_gki-${{ env.ANDROID_VERSION }}-${{ env.KERNEL_VERSION }}.patch || true
336+ #临时修复 undeclared identifier 'vma' 编译错误:把vma = find_vma(...)替换为struct vm_area_struct *vma = find_vma(...),解决部分版本源码中vma定义缺失的问题
337+ sed -i 's|vma = find_vma(mm|struct vm_area_struct *&|' ./fs/proc/task_mmu.c
338+ patch -p1 -N -F 3 < 69_hide_stuff.patch || true
311339 fi
312340
313341 - name : 应用lz4 1.10.0 & zstd 1.5.7补丁
@@ -347,16 +375,6 @@ jobs:
347375 if [[ ${{ github.event.inputs.kpm_enable }} == 'true' && ${{ github.event.inputs.ksu_type }} == "sukisu" ]]; then
348376 echo "CONFIG_KPM=y" >> ./common/arch/arm64/configs/gki_defconfig
349377 fi
350- if [ "${{ github.event.inputs.hook_method }}" == "kprobes" ]; then
351- echo "正在开启kprobes钩子..."
352- echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig
353- echo "CONFIG_KSU_MANUAL_HOOK=n" >> ./common/arch/arm64/configs/gki_defconfig
354- echo "CONFIG_KSU_KPROBES_HOOK=y" >> ./common/arch/arm64/configs/gki_defconfig
355- else
356- echo "正在开启manual/syscall钩子..."
357- echo "CONFIG_KSU_MANUAL_HOOK=y" >> ./common/arch/arm64/configs/gki_defconfig
358- echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./common/arch/arm64/configs/gki_defconfig
359- fi
360378 echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig
361379 echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig
362380 echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig
@@ -644,8 +662,12 @@ jobs:
644662 fi
645663 if [[ ${{ github.event.inputs.ksu_type }} == "sukisu" ]]; then
646664 KSU_TYPENAME="SukiSU"
647- else
665+ elif [[ ${{ github.event.inputs.ksu_type }} == "ksunext" ]]; then
648666 KSU_TYPENAME="KSUNext"
667+ elif [[ ${{ github.event.inputs.ksu_type }} == "mksu" ]]; then
668+ KSU_TYPENAME="MKSU"
669+ else
670+ KSU_TYPENAME="KSU"
649671 fi
650672 if [[ "${{ github.event.inputs.lz4_enable }}" == "2" || "${{ github.event.inputs.lz4_enable }}" == "3" ]]; then
651673 wget https://raw.githubusercontent.com/cctv18/oppo_oplus_realme_sm8750/refs/heads/main/zram.zip
@@ -744,7 +766,6 @@ jobs:
744766 - 编译时间: ${{ env.TIME_FORM }}
745767 - 机型:欧加真骁龙8Elite 6.6.30 Android 15内核通用(基于一加13 6.6.30 版官方OKI源码)
746768 - 特性:${{ env.KSU_BRANCH }} + SUSFS + 风驰内核
747- - hook模式:${{ github.event.inputs.hook_method }}
748769 - KPM支持 (仅对sukisu生效):${{ github.event.inputs.kpm_enable }}
749770 - LZ4KD支持:${{ env.lz4kd_enable }}
750771 - LZ4支持:${{ env.lz4_zstd_enable }}
0 commit comments