Merge commit '49190feab6268d64bbb16e332f53d2a66f387d14' as 'Website'
This commit is contained in:
101
Website/docs/zh/config.ts
Normal file
101
Website/docs/zh/config.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import { defineConfig, type DefaultTheme } from 'vitepress'
|
||||
|
||||
export default defineConfig({
|
||||
lang: 'zh-Hans',
|
||||
description: '下一代 Android Root 解决方案 - Android 上的内核级的高级 root 方案',
|
||||
|
||||
themeConfig: {
|
||||
nav: nav(),
|
||||
|
||||
sidebar: {
|
||||
'/zh/': { base: '/zh/', items: sidebar() },
|
||||
},
|
||||
|
||||
search: { options: searchOptions() },
|
||||
editLink: {
|
||||
pattern: 'https://github.com/sukisu-ultra/sukisu-ultra/edit/main/docs/:path',
|
||||
text: '在 GitHub 上编辑此页面',
|
||||
},
|
||||
|
||||
docFooter: {
|
||||
prev: '上一页',
|
||||
next: '下一页',
|
||||
},
|
||||
|
||||
outline: {
|
||||
label: '页面导航',
|
||||
},
|
||||
|
||||
lastUpdated: {
|
||||
text: '最后更新于',
|
||||
},
|
||||
|
||||
notFound: {
|
||||
title: '页面未找到',
|
||||
quote: '抱歉,我们无法找到您要查找的页面。',
|
||||
linkLabel: '前往首页',
|
||||
linkText: '带我回首页',
|
||||
},
|
||||
|
||||
langMenuLabel: '多语言',
|
||||
returnToTopLabel: '回到顶部',
|
||||
sidebarMenuLabel: '菜单',
|
||||
darkModeSwitchLabel: '主题',
|
||||
lightModeSwitchTitle: '切换到浅色模式',
|
||||
darkModeSwitchTitle: '切换到深色模式',
|
||||
skipToContentLabel: '跳转到内容',
|
||||
},
|
||||
})
|
||||
|
||||
function nav(): DefaultTheme.NavItem[] {
|
||||
return [
|
||||
{ text: '首页', link: '/zh/' },
|
||||
{
|
||||
text: '开始使用',
|
||||
items: [
|
||||
{ text: '介绍', link: '/zh/guide/' },
|
||||
{ text: '安装', link: '/zh/guide/installation' },
|
||||
{ text: '集成', link: '/zh/guide/how-to-integrate' },
|
||||
{ text: '兼容性', link: '/zh/guide/compatibility' },
|
||||
{ text: '链接', link: '/zh/guide/links' },
|
||||
{ text: '许可', link: '/zh/guide/license' },
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
function sidebar(): DefaultTheme.SidebarItem[] {
|
||||
return [
|
||||
{
|
||||
text: '开始使用',
|
||||
items: [
|
||||
{ text: '介绍', link: '/guide/' },
|
||||
{ text: '安装', link: '/guide/installation' },
|
||||
{ text: '集成', link: '/guide/how-to-integrate' },
|
||||
{ text: '兼容性', link: '/guide/compatibility' },
|
||||
{ text: '链接', link: '/guide/links' },
|
||||
{ text: '许可', link: '/guide/license' },
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
function searchOptions(): Partial<DefaultTheme.LocalSearchOptions> {
|
||||
return {
|
||||
translations: {
|
||||
button: {
|
||||
buttonText: '搜索文档',
|
||||
buttonAriaLabel: '搜索文档',
|
||||
},
|
||||
modal: {
|
||||
noResultsText: '无法找到相关结果',
|
||||
resetButtonTitle: '清除查询条件',
|
||||
footer: {
|
||||
selectText: '选择',
|
||||
navigateText: '切换',
|
||||
closeText: '关闭',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
23
Website/docs/zh/guide/compatibility.md
Normal file
23
Website/docs/zh/guide/compatibility.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# 兼容性状态
|
||||
|
||||
::: info KernelSU
|
||||
KernelSU(v0.9.5 之前的版本)官方支持 Android GKI 2.0 设备(内核 5.10+)
|
||||
:::
|
||||
|
||||
::: warning 传统内核支持
|
||||
较旧的内核(4.4+)也兼容,但内核必须手动构建
|
||||
:::
|
||||
|
||||
::: tip 扩展兼容性
|
||||
SukiSU-Ultra 可以通过额外的反向移植支持 3.x 内核(3.4-3.18)
|
||||
:::
|
||||
|
||||
## 架构支持
|
||||
|
||||
目前支持以下处理器架构:
|
||||
|
||||
| 架构 | 支持级别 | 备注 |
|
||||
| --------------- | :---------: | -----------: |
|
||||
| **arm64-v8a** | ✅ 完全支持 | 主要目标架构 |
|
||||
| **armeabi-v7a** | ✅ 基础支持 | 最低功能要求 |
|
||||
| **X86_64** | 🟡 部分支持 | 支持部分设备 |
|
||||
94
Website/docs/zh/guide/how-to-integrate.md
Normal file
94
Website/docs/zh/guide/how-to-integrate.md
Normal file
@@ -0,0 +1,94 @@
|
||||
# 集成指导
|
||||
|
||||
SukiSU 可以集成到 GKI 和 non-GKI 内核中,并且已反向移植到 4.14 版本。
|
||||
|
||||
<!-- 应该是 3.4 版本,但 backslashxx 的 syscall manual hook 无法在 SukiSU 中使用-->
|
||||
|
||||
有些 OEM 定制可能导致多达 50% 的内核代码超出内核树代码,而非来自上游 Linux 内核或 ACK。因此,non-GKI 内核的定制特性导致了严重的内核碎片化,而且我们缺乏构建它们的通用方法。因此,我们无法提供 non-GKI 内核的启动映像。
|
||||
|
||||
前提条件:开源的、可启动的内核。
|
||||
|
||||
## Hook 方法
|
||||
|
||||
1. **KPROBES hook:**
|
||||
- GKI kernels 的默认 hook 方法。
|
||||
- 需要 `# CONFIG_KSU_MANUAL_HOOK is not set`(未设定) & `CONFIG_KPROBES=y`
|
||||
- 用作可加载的内核模块 (LKM).
|
||||
|
||||
2. **Manual hook:**
|
||||
|
||||
<!-- - backslashxx's syscall manual hook: https://github.com/backslashxx/KernelSU/issues/5 (v1.5 version is not available at the moment, if you want to use it, please use v1.4 version, or standard KernelSU hooks)-->
|
||||
- 需要 `CONFIG_KSU_MANUAL_HOOK=y`
|
||||
- 需要 [`guide/how-to-integrate.md`](how-to-integrate.md)
|
||||
- 需要 [https://github.com/~](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#manually-modify-the-kernel-source)
|
||||
|
||||
3. **Tracepoint Hook:**
|
||||
- 自 SukiSU commit [49b01aad](https://github.com/SukiSU-Ultra/SukiSU-Ultra/commit/49b01aad74bcca6dba5a8a2e053bb54b648eb124) 引入的 hook 方法
|
||||
- 需要 `CONFIG_KSU_TRACEPOINT_HOOK=y`
|
||||
- 需要 [`guide/tracepoint-hook.md`](tracepoint-hook.md)
|
||||
|
||||
<!-- This part refer to [rsuntk/KernelSU](https://github.com/rsuntk/KernelSU). -->
|
||||
|
||||
如果您能够构建可启动内核,有两种方法可以将 KernelSU 集成到内核源代码中:
|
||||
|
||||
1. 使用 `kprobe` 自动集成
|
||||
2. 手动集成
|
||||
|
||||
## 与 kprobe 集成
|
||||
|
||||
适用:
|
||||
|
||||
- GKI 内核
|
||||
|
||||
不适用:
|
||||
|
||||
- non-GKI 内核
|
||||
|
||||
KernelSU 使用 kprobe 机制来做内核的相关 hook,如果 _kprobe_ 可以在你编译的内核中正常运行,那么推荐用这个方法来集成。
|
||||
|
||||
请参阅此文档 [https://github.com/~](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#integrate-with-kprobe)。虽然标题为“适用于 non-GKI”,但仅适用于 GKI。
|
||||
|
||||
替换 KernelSU 添加到内核源代码树的步骤的执行命令为:
|
||||
|
||||
```sh [bash]
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||
```
|
||||
|
||||
## 手动修改内核源代码
|
||||
|
||||
适用:
|
||||
|
||||
- GKI 内核
|
||||
- non-GKI 内核
|
||||
|
||||
请参考此文档 [https://github.com/~ (non-GKI 内核集成)](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#manually-modify-the-kernel-source) 和 [https://github.com/~ (GKI 内核构建)](https://kernelsu.org/zh_CN/guide/how-to-build.html) 进行手动集成。虽然第一个链接的标题是“适用于 non-GKI”,但它也适用于 GKI。两者都可以正常工作。
|
||||
|
||||
还有另一种集成方法,但是仍在开发中。
|
||||
|
||||
<!-- 这是 backslashxx 的syscall manual hook,但目前无法使用。 -->
|
||||
|
||||
将 KernelSU(SukiSU)添加到内核源代码树的步骤的运行命令将被替换为:
|
||||
|
||||
### GKI 内核
|
||||
|
||||
```sh [bash]
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||
```
|
||||
|
||||
### non-GKI 内核
|
||||
|
||||
```sh [bash]
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
||||
```
|
||||
|
||||
### 带有 susfs 的 GKI / non-GKI 内核(实验)
|
||||
|
||||
```sh [bash]
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-{{branch}}
|
||||
```
|
||||
|
||||
分支:
|
||||
|
||||
- `main` (susfs-main)
|
||||
- `test` (susfs-test)
|
||||
- 版本号 (例如: susfs-1.5.7, 你需要在 [分支](https://github.com/SukiSU-Ultra/SukiSU-Ultra/branches) 里找到它)
|
||||
35
Website/docs/zh/guide/index.md
Normal file
35
Website/docs/zh/guide/index.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# 什么是 SukiSU-Ultra?
|
||||
|
||||
一个 Android 上基于内核的 root 方案,由 [`tiann/KernelSU`](https://github.com/tiann/KernelSU) 分叉而来,添加了一些有趣的变更。
|
||||
|
||||
## 特性
|
||||
|
||||
1. 基于内核的 su 和权限管理。
|
||||
2. 基于 Magic Mount 的模块系统。
|
||||
3. App Profile: 把 Root 权限关进笼子里。
|
||||
4. 支持 non-GKI 与 GKI 1.0。
|
||||
5. KPM 支持
|
||||
6. 可调整管理器外观,可自定义 susfs 配置。
|
||||
|
||||
## 如何安装
|
||||
|
||||
了解如何在您的设备上 **[安装](./installation)** SukiSU-Ultra
|
||||
|
||||
## 如何集成
|
||||
|
||||
阅读 **[集成](./how-to-integrate.md)** 将 SukiSU 集成到你的内核中
|
||||
|
||||
## 了解兼容性
|
||||
|
||||
检查设备 **[兼容性](./compatibility)** 要求
|
||||
|
||||
## 资源获取
|
||||
|
||||
查找其他资源和 **[下载](./links)**
|
||||
|
||||
## 获取支持
|
||||
|
||||
需要帮助?我们在这里为您提供帮助:
|
||||
|
||||
- **错误报告**: [GitHub Issues](https://github.com/SukiSU-Ultra/SukiSU-Ultra/issues)
|
||||
- **直接支持**: 联系开发者处理关键问题
|
||||
149
Website/docs/zh/guide/installation.md
Normal file
149
Website/docs/zh/guide/installation.md
Normal file
@@ -0,0 +1,149 @@
|
||||
# 安装参考
|
||||
|
||||
::: details 将会了解 SukiSU-Ultra 安装过程
|
||||
[[toc]]
|
||||
:::
|
||||
|
||||
::: danger 警告
|
||||
**Root 您的设备可能会使保修失效,如果操作不当可能会造成永久性损坏。**
|
||||
请务必在继续之前创建完整备份,阅读文档确保与您的设备兼容,遵循文档参考,准备好恢复计划
|
||||
:::
|
||||
|
||||
## 通用 GKI
|
||||
|
||||
请**全部**参考 [KernelSU 安装指南](https://kernelsu.org/zh_CN/guide/installation.html)
|
||||
|
||||
1. 适用于 GKI 2.0 设备,如小米、红米、三星等(不包括内核修改的制造商,如魅族、一加、真我和 OPPO)
|
||||
2. 在[更多链接](./links)中查找 GKI 构建。找到设备内核版本,然后下载并使用 TWRP 或内核刷写工具刷入带有 `AnyKernel3` 后缀的
|
||||
zip 文件。
|
||||
3. 无后缀的 `.zip` 档案是未压缩的,`gz` 后缀是特定型号使用的压缩格式。
|
||||
|
||||
## 一加设备
|
||||
|
||||
使用[更多链接](./links)部分提到的链接,用您的设备信息创建自定义构建,然后刷入带有 AnyKernel3 后缀的 zip 文件。
|
||||
|
||||
::: details 展开
|
||||
|
||||
- 只需要填写内核版本的前两部分,如 `5.10`、`5.15`、`6.1` 或 `6.6`。
|
||||
- 请自行搜索处理器代号,通常是不含数字的英文字母。
|
||||
- 可以从一加开源内核仓库中找到分支和配置文件。
|
||||
- 第三方 Recovery(推荐 TWRP)
|
||||
|
||||
:::
|
||||
|
||||
## 开始安装
|
||||
|
||||
### 通用 GKI 安装
|
||||
|
||||
::: tip
|
||||
适用于 GKI 2.0 设备,如小米、红米、三星等(不包括内核修改的制造商,如魅族、一加、真我和 OPPO)
|
||||
:::
|
||||
|
||||
#### 步骤:
|
||||
|
||||
1. 下载 GKI 构建文件
|
||||
|
||||
从我们的[资源部分](./links)查找 GKI 构建。查找您设备的内核版本并下载带有 `AnyKernel3` 后缀的 `zip` 文件。
|
||||
|
||||
2. 通过 Recovery 刷入
|
||||
|
||||
启动到 `TWRP recovery`,选择 **Install**,导航到下载的 `AnyKernel3 zip` 文件,滑动刷入后重启系统
|
||||
|
||||
3. [验证安装](#验证)
|
||||
|
||||
::: details 文件格式说明
|
||||
无后缀的 `.zip` 档案是未压缩的,`gz` 后缀是特定型号使用的压缩格式。
|
||||
:::
|
||||
|
||||
### 一加设备安装
|
||||
|
||||
1. 获取设备信息
|
||||
|
||||
- 内核版本(前两部分,例如 `5.10`、`5.15`、`6.1`、`6.6`)
|
||||
- 处理器代号(通常是不含数字的英文)
|
||||
- 来自一加开源内核仓库的分支和配置文件
|
||||
|
||||
2. 创建自定义构建
|
||||
|
||||
使用我们[资源部分](./links)中提到的链接,用您的设备信息创建自定义构建。
|
||||
|
||||
3. 刷入构建
|
||||
|
||||
下载生成的带有 AnyKernel3 后缀的 zip 文件,启动到 `TWRP recovery`,选择 **Install**,导航到下载的 `AnyKernel3 zip` 文件,滑动刷入后重启系统
|
||||
|
||||
::: tip
|
||||
您只需要填写内核版本的前两部分。自行搜索处理器代号
|
||||
:::
|
||||
|
||||
### 手动内核集成
|
||||
|
||||
面向希望将 SukiSU Ultra 集成到自己内核构建中的高级用户
|
||||
|
||||
#### 主分支(GKI)
|
||||
|
||||
```sh [bash]
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||
```
|
||||
|
||||
#### 非 GKI 分支
|
||||
|
||||
```sh [bash]
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
||||
```
|
||||
|
||||
#### SUSFS-Dev 分支(推荐)
|
||||
|
||||
```sh [bash]
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-dev
|
||||
```
|
||||
|
||||
```bash
|
||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-main
|
||||
```
|
||||
|
||||
::: warning 必需的内核配置
|
||||
为了支持 KPM,添加 `CONFIG_KPM=y`
|
||||
|
||||
对于非 GKI 设备,还要添加 `CONFIG_KALLSYMS=y` 和 `CONFIG_KALLSYMS_ALL=y`
|
||||
:::
|
||||
|
||||
## 安装后设置
|
||||
|
||||
### 系统更新时保持 Root
|
||||
|
||||
> [!IMPORTANT]
|
||||
> 如何在 OTA 更新后保持 root 访问权限:
|
||||
|
||||
#### 步骤:
|
||||
|
||||
1. 系统更新后重启前
|
||||
- OTA 安装后不要立即重启,将 SukiSU Ultra 安装到第二插槽
|
||||
- 打开 SukiSU Ultra 管理器,在**刷入/修补内核**界面选择 **GKI/non_GKI install**,选择您的 `AnyKernel3` 内核 `zip` 文件,选择与当前运行插槽相对的插槽然后刷入重启。
|
||||
|
||||
2. 替代方案:LKM 模式
|
||||
|
||||
使用 [LKM 模式](#通用-gki) 在 OTA 后安装到未使用的插槽。
|
||||
|
||||
::: warning 警告
|
||||
**非 GKI 设备注意事项:** 此方法不支持所有非 GKI 设备。对于非 GKI 设备,使用 TWRP 是最安全的方法。
|
||||
:::
|
||||
|
||||
## 验证
|
||||
|
||||
安装后,验证一切是否正常工作,
|
||||
|
||||
- 打开 SukiSU Ultra 管理器检查 root 工作状态
|
||||
- 使用 root 权限的应用程序来验证 root 访问是否工作正常
|
||||
- 在设置 -> 关于手机中检查内核版本
|
||||
|
||||
## 需要帮助?
|
||||
|
||||
如果在安装过程中遇到问题:
|
||||
|
||||
1. 查看我们的[兼容性指南](./compatibility)了解设备要求
|
||||
2. 访问我们的 [GitHub 仓库](https://github.com/sukisu-ultra/sukisu-ultra)获取支持
|
||||
3. 加入我们的 [Telegram 社区](https://t.me/sukiksu)获取帮助
|
||||
|
||||
::: danger 安全提醒
|
||||
**始终有备用计划!** 保留您的原始 `boot.img/init_boot.img` 并知道如何在出现问题时恢复设备。
|
||||
:::
|
||||
77
Website/docs/zh/guide/license.md
Normal file
77
Website/docs/zh/guide/license.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# 许可证
|
||||
|
||||
## 软件许可
|
||||
|
||||
### 内核组件
|
||||
|
||||
::: info GPL-2.0 许可证
|
||||
"kernel" 目录中的文件采用 GPL-2.0-only 许可证
|
||||
:::
|
||||
|
||||
**许可证:** [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
|
||||
### 应用程序核心
|
||||
|
||||
::: tip GPL-3.0 许可证
|
||||
所有其他部分(除下述特别说明外)采用 GPL-3.0 或更高版本许可证
|
||||
:::
|
||||
|
||||
**许可证:** [GPL-3.0 或更高版本](https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
## 艺术作品与品牌资产
|
||||
|
||||
### 启动器图标与角色艺术
|
||||
|
||||
::: warning 版权声明
|
||||
动画角色艺术作品有特殊许可要求
|
||||
:::
|
||||
|
||||
包含动画角色表情的文件 `ic_launcher(?!.*alt.*).*` 图像有特定的版权条款:
|
||||
|
||||
**版权持有者:**
|
||||
|
||||
- **动画角色艺术:** [怡子曰曰](https://space.bilibili.com/10545509)
|
||||
- **品牌知识产权:** [明风OuO](https://space.bilibili.com/274939213)
|
||||
- **矢量化制作:** @MiRinChan
|
||||
|
||||
**许可要求:**
|
||||
|
||||
1. **知识共享许可证:** [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt)
|
||||
2. **作者授权:** 需要获得两位版权持有者的授权
|
||||
3. **署名要求:** 必须署名上述所有贡献者
|
||||
|
||||
::: details 使用要求
|
||||
在使用这些艺术资产之前,您必须:
|
||||
|
||||
- 遵守知识共享署名-非商业性使用-相同方式共享 4.0 国际许可证
|
||||
- 获得两位原作者对艺术内容使用的授权
|
||||
- 为所有贡献者提供适当的署名
|
||||
:::
|
||||
|
||||
## 摘要
|
||||
|
||||
| 组件 | 许可证 | 备注 |
|
||||
| ---------------- | ------------------------------------------------------------------------- | ----------------------- |
|
||||
| **内核文件** | [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) | `/kernel/` 目录中的文件 |
|
||||
| **应用程序代码** | [GPL-3.0+](https://www.gnu.org/licenses/gpl-3.0.html) | 主要应用程序组件 |
|
||||
| **角色艺术** | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) | + 需要作者授权 |
|
||||
| **品牌资产** | 混合许可 | 查看具体署名要求 |
|
||||
|
||||
## 链接
|
||||
|
||||
- **GPL-2.0:** [完整许可证文本](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
- **GPL-3.0:** [完整许可证文本](https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
- **CC BY-NC-SA 4.0:** [完整许可证文本](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt)
|
||||
|
||||
## 问题
|
||||
|
||||
关于许可证或使用权限的问题:
|
||||
|
||||
1. **代码许可:** 参考相应的 GPL 许可证条款
|
||||
2. **艺术作品使用:** 联系原作者获取授权
|
||||
3. **商业使用:** 查看 CC BY-NC-SA 4.0 限制条款
|
||||
4. **分发:** 确保遵守所有适用的许可证
|
||||
|
||||
::: tip 合规提示
|
||||
在重新分发或修改 SukiSU-Ultra 时,请确保遵守各个组件的所有适用许可证和署名要求。
|
||||
:::
|
||||
71
Website/docs/zh/guide/links.md
Normal file
71
Website/docs/zh/guide/links.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# 更多链接
|
||||
|
||||
## 参与翻译
|
||||
|
||||
::: info 贡献翻译
|
||||
如果您需要为管理器提交翻译,请访问我们的 Crowdin 项目
|
||||
:::
|
||||
|
||||
**翻译平台:** [Crowdin - SukiSU-Ultra](https://crowdin.com/project/SukiSU-Ultra)
|
||||
|
||||
## 项目与构建
|
||||
|
||||
基于 Sukisu 和 susfs 编译的项目:
|
||||
|
||||
### GKI 构建
|
||||
|
||||
::: tip 通用 GKI 支持
|
||||
集成 KernelSU 和 SUSFS 的通用内核映像构建
|
||||
:::
|
||||
|
||||
**仓库:** [GKI_KernelSU_SUSFS](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS)
|
||||
|
||||
### OnePlus 构建
|
||||
|
||||
::: tip 设备特定构建
|
||||
带有 MKSU 和 SUSFS 的自动化 OnePlus 内核构建
|
||||
:::
|
||||
|
||||
**仓库:** [Action_OnePlus_MKSU_SUSFS](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS)
|
||||
|
||||
## 社区与支持
|
||||
|
||||
### Telegram 社区
|
||||
|
||||
> 与其他用户联系,获取支持并保持更新
|
||||
|
||||
**主群组:** [Tg Group](https://t.me/sukiksu)
|
||||
|
||||
### 测试构建
|
||||
|
||||
::: warning 实验性构建
|
||||
测试构建是实验性的,可能不稳定
|
||||
:::
|
||||
|
||||
**测试构建频道:** [最新测试构建](https://t.me/Sukiksu/7114)
|
||||
|
||||
## 下载与发布
|
||||
|
||||
### 官方发布
|
||||
|
||||
> 从我们的 GitHub 发布页面下载最新稳定版本
|
||||
|
||||
**GitHub 发布:** [SukiSU-Ultra 发布](https://github.com/sukisu-ultra/sukisu-ultra/releases)
|
||||
|
||||
### 问题报告
|
||||
|
||||
> 在我们的 GitHub 仓库上报告错误或请求新功能
|
||||
|
||||
**GitHub 问题:** [报告问题](https://github.com/sukisu-ultra/sukisu-ultra/issues)
|
||||
|
||||
## 快速链接汇总
|
||||
|
||||
| 资源 | 链接 | 描述 |
|
||||
| ----------------- | :--------------------------------------------------------------------: | -----------: |
|
||||
| **翻译** | [Crowdin](https://crowdin.com/project/SukiSU-Ultra) | 提交翻译 |
|
||||
| **Telegram 群组** | [t.me/sukiksu](https://t.me/sukiksu) | 社区支持 |
|
||||
| **测试构建** | [测试频道](https://t.me/Sukiksu/7114) | 实验性构建 |
|
||||
| **发布** | [GitHub 发布](https://github.com/sukisu-ultra/sukisu-ultra/releases) | 稳定下载 |
|
||||
| **问题** | [GitHub 问题](https://github.com/sukisu-ultra/sukisu-ultra/issues) | 错误报告 |
|
||||
| **GKI 构建** | [GKI 仓库](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS) | 通用构建 |
|
||||
| **OnePlus 构建** | [OnePlus 仓库](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS) | 设备特定构建 |
|
||||
266
Website/docs/zh/guide/tracepoint-hook.md
Normal file
266
Website/docs/zh/guide/tracepoint-hook.md
Normal file
@@ -0,0 +1,266 @@
|
||||
# Tracepoint Hook 集成
|
||||
|
||||
## 介绍
|
||||
|
||||
自 commit [49b01aad](https://github.com/SukiSU-Ultra/SukiSU-Ultra/commit/49b01aad74bcca6dba5a8a2e053bb54b648eb124) 起,SukiSU 引入了 Tracepoint Hook
|
||||
|
||||
**该 Hook 理论上相比于 Kprobes Hook,性能开销更小,但次于 Manual Hook / Syscall Hook**
|
||||
|
||||
::: warning
|
||||
目前 Tracepoint Hook 在 6.x 设备上并不稳定,请勿使用,否则可能出现无法开机或无法获取 `ROOT` 权限等问题。
|
||||
:::
|
||||
|
||||
> [!NOTE]
|
||||
> 本教程参考了 [backslashxx/KernelSU#5](https://github.com/backslashxx/KernelSU/issues/5) 的 syscall hook v1.4 版本钩子,以及原版 KernelSU 的 [Manual Hook](https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#manually-modify-the-kernel-source)
|
||||
|
||||
## 在内核中放置 TP 钩子
|
||||
|
||||
::: code-group
|
||||
|
||||
```diff[exec.c]
|
||||
--- a/fs/exec.c
|
||||
+++ b/fs/exec.c
|
||||
@@ -78,6 +78,10 @@
|
||||
#include <trace/hooks/sched.h>
|
||||
#endif
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
+
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(task_rename);
|
||||
|
||||
static int bprm_creds_from_file(struct linux_binprm *bprm);
|
||||
@@ -2037,6 +2041,9 @@ static int do_execve(struct filename *filename,
|
||||
{
|
||||
struct user_arg_ptr argv = { .ptr.native = __argv };
|
||||
struct user_arg_ptr envp = { .ptr.native = __envp };
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_execveat_hook((int *)AT_FDCWD, &filename, &argv, &envp, 0);
|
||||
+#endif
|
||||
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
|
||||
}
|
||||
|
||||
@@ -2064,6 +2071,9 @@ static int compat_do_execve(struct filename *filename,
|
||||
.is_compat = true,
|
||||
.ptr.compat = __envp,
|
||||
};
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_execveat_sucompat_hook((int *)AT_FDCWD, &filename, NULL, NULL, NULL); /* 32-bit su */
|
||||
+#endif
|
||||
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
|
||||
}
|
||||
```
|
||||
|
||||
```diff[open.c]
|
||||
--- a/fs/open.c
|
||||
+++ b/fs/open.c
|
||||
@@ -37,6 +37,10 @@
|
||||
#include "internal.h"
|
||||
#include <trace/hooks/syscall_check.h>
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
+
|
||||
int do_truncate(struct user_namespace *mnt_userns, struct dentry *dentry,
|
||||
loff_t length, unsigned int time_attrs, struct file *filp)
|
||||
{
|
||||
@@ -468,6 +472,9 @@ static long do_faccessat(int dfd, const char __user *filename, int mode, int fla
|
||||
|
||||
SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
|
||||
{
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_faccessat_hook(&dfd, &filename, &mode, NULL);
|
||||
+#endif
|
||||
return do_faccessat(dfd, filename, mode, 0);
|
||||
}
|
||||
```
|
||||
|
||||
```diff[read_write.c]
|
||||
--- a/fs/read_write.c
|
||||
+++ b/fs/read_write.c
|
||||
@@ -25,6 +25,10 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
+
|
||||
const struct file_operations generic_ro_fops = {
|
||||
.llseek = generic_file_llseek,
|
||||
.read_iter = generic_file_read_iter,
|
||||
@@ -630,6 +634,9 @@ ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count)
|
||||
|
||||
SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
|
||||
{
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_sys_read_hook(fd, &buf, &count);
|
||||
+#endif
|
||||
return ksys_read(fd, buf, count);
|
||||
}
|
||||
```
|
||||
|
||||
```diff[stat.c]
|
||||
--- a/fs/stat.c
|
||||
+++ b/fs/stat.c
|
||||
@@ -24,6 +24,10 @@
|
||||
#include "internal.h"
|
||||
#include "mount.h"
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* generic_fillattr - Fill in the basic attributes from the inode struct
|
||||
* @mnt_userns: user namespace of the mount the inode was found from
|
||||
@@ -408,6 +412,10 @@ SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename,
|
||||
struct kstat stat;
|
||||
int error;
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_stat_hook(&dfd, &filename, &flag);
|
||||
+#endif
|
||||
+
|
||||
error = vfs_fstatat(dfd, filename, &stat, flag);
|
||||
if (error)
|
||||
return error;
|
||||
@@ -559,6 +567,10 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
|
||||
struct kstat stat;
|
||||
int error;
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_stat_hook(&dfd, &filename, &flag); /* 32-bit su support */
|
||||
+#endif
|
||||
+
|
||||
error = vfs_fstatat(dfd, filename, &stat, flag);
|
||||
if (error)
|
||||
return error;
|
||||
```
|
||||
|
||||
:::
|
||||
通常是要改四个地方:
|
||||
|
||||
1. compat_do_execve,通常位于 `fs/exec.c`
|
||||
2. do_faccessat,通常位于 `/fs/open.c`
|
||||
3. sys_read,通常位于 `fs/read_write.c`
|
||||
4. newfstatat SYSCALL,通常位于 `fs/stat.c`
|
||||
|
||||
如果没有 do_faccessat 方法,可以找 faccessat 的 SYSCALL 定义(对于早于 4.17 的内核)
|
||||
|
||||
```diff
|
||||
--- a/fs/open.c
|
||||
+++ b/fs/open.c
|
||||
@@ -31,6 +31,9 @@
|
||||
#include <linux/ima.h>
|
||||
#include <linux/dnotify.h>
|
||||
#include <linux/compat.h>
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
@@ -369,6 +372,9 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
|
||||
int res;
|
||||
unsigned int lookup_flags = LOOKUP_FOLLOW;
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_faccessat_hook(&dfd, &filename, &mode, NULL);
|
||||
+#endif
|
||||
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
|
||||
return -EINVAL;
|
||||
```
|
||||
|
||||
如果没有 sys_read 方法,并且 4.14 及以下需要修改 read 的 SYSCALL 定义
|
||||
|
||||
```diff
|
||||
--- a/fs/read_write.c
|
||||
+++ b/fs/read_write.c
|
||||
@@ -25,6 +25,11 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/unistd.h>
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
const struct file_operations generic_ro_fops = {
|
||||
.llseek = generic_file_llseek,
|
||||
.read_iter = generic_file_read_iter,
|
||||
@@ -575,6 +580,9 @@ SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
|
||||
|
||||
if (f.file) {
|
||||
loff_t pos = file_pos_read(f.file);
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_sys_read_hook(fd, &buf, &count);
|
||||
+#endif
|
||||
ret = vfs_read(f.file, buf, count, &pos);
|
||||
if (ret >= 0)
|
||||
file_pos_write(f.file, pos);
|
||||
```
|
||||
|
||||
## 安全模式
|
||||
|
||||
要使用 KernelSU 内置的安全模式,你还需要修改 `drivers/input/input.c` 中的 input_handle_event 方法:
|
||||
|
||||
```diff
|
||||
--- a/drivers/input/input.c
|
||||
+++ b/drivers/input/input.c
|
||||
@@ -26,6 +26,10 @@
|
||||
#include "input-compat.h"
|
||||
#include "input-poller.h"
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
+
|
||||
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
|
||||
MODULE_DESCRIPTION("Input core");
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -451,6 +455,10 @@ void input_event(struct input_dev *dev,
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_input_hook(&type, &code, &value);
|
||||
+#endif
|
||||
+
|
||||
if (is_event_supported(type, dev->evbit, EV_MAX)) {
|
||||
|
||||
spin_lock_irqsave(&dev->event_lock, flags);
|
||||
```
|
||||
|
||||
## pm 命令执行失败?
|
||||
|
||||
你需要修改 `drivers/tty/pty.c`
|
||||
|
||||
```diff
|
||||
--- a/drivers/tty/pty.c
|
||||
+++ b/drivers/tty/pty.c
|
||||
@@ -31,6 +31,10 @@
|
||||
#include <linux/compat.h>
|
||||
#include "tty.h"
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+#include <../../drivers/kernelsu/ksu_trace.h>
|
||||
+#endif
|
||||
+
|
||||
#undef TTY_DEBUG_HANGUP
|
||||
#ifdef TTY_DEBUG_HANGUP
|
||||
# define tty_debug_hangup(tty, f, args...) tty_debug(tty, f, ##args)
|
||||
@@ -707,6 +711,10 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
|
||||
{
|
||||
struct tty_struct *tty;
|
||||
|
||||
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||
+ trace_ksu_trace_devpts_hook((struct inode *)file->f_path.dentry->d_inode);
|
||||
+#endif
|
||||
+
|
||||
mutex_lock(&devpts_mutex);
|
||||
tty = devpts_get_priv(file->f_path.dentry);
|
||||
mutex_unlock(&devpts_mutex);
|
||||
```
|
||||
37
Website/docs/zh/index.md
Normal file
37
Website/docs/zh/index.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: 'SukiSU-Ultra'
|
||||
text: '下一代 Android Root 解决方案'
|
||||
tagline: Android 上的内核级的高级 root 方案
|
||||
image:
|
||||
src: /logo.svg
|
||||
alt: SukiSU-Ultra
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 开始使用
|
||||
link: /zh/guide/
|
||||
- theme: alt
|
||||
text: 在 GitHub 上查看
|
||||
link: https://github.com/sukisu-ultra/sukisu-ultra
|
||||
|
||||
features:
|
||||
- title: 内核级的 su 和 root 权限管理
|
||||
details: 在内核进行安全的 root 权限管理。
|
||||
|
||||
- title: 不基于 OverlayFS 的模块系统
|
||||
details: 模块系统基于来自 5ec1cff 的 Magic Mount。
|
||||
|
||||
- title: App Profile
|
||||
details: 把 root 权限关进笼子里。
|
||||
|
||||
- title: 重新支持非 GKI 与 GKI 1.0 内核
|
||||
details: 增强对旧设备的兼容性。
|
||||
|
||||
- title: 更多自定义选项
|
||||
details: 提供广泛的自定义选项。
|
||||
|
||||
- title: 支持 KPM
|
||||
details: 完整的基于 KernelPatch 的 KPM 功能。
|
||||
---
|
||||
Reference in New Issue
Block a user