diff --git a/website/.gitignore b/website/.gitignore deleted file mode 100644 index ffedf17c..00000000 --- a/website/.gitignore +++ /dev/null @@ -1,150 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -# from: https://github.com/vuejs/vitepress/blob/main/.gitignore -/coverage -/src/client/shared.ts -/src/node/shared.ts -*.log -*.tgz -.DS_Store -.idea -.temp -.vite_opt_cache -.vscode -dist -cache -examples-temp -node_modules -pnpm-global -TODOs.md - -cache \ No newline at end of file diff --git a/website/docs/.vitepress/config.ts b/website/docs/.vitepress/config.ts deleted file mode 100644 index e2a17ac4..00000000 --- a/website/docs/.vitepress/config.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { defineConfig, SiteConfig } from 'vitepress' -import locales from './locales' -import { readdir, writeFile } from 'fs/promises' -import { resolve } from 'path' - -export default defineConfig( { - base: '/SukiSU-Ultra/', - title: 'KernelSU', - locales: locales.locales, - head: [ - ['script', { - async: 'async', - src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2610070972052494', - crossorigin: 'anonymous', - }], - ], - sitemap: { - hostname: 'https://kernelsu.org' - }, - buildEnd: async (config: SiteConfig) => { - const templateDir = resolve(config.outDir, 'templates'); - const templateList = resolve(templateDir, "index.json"); - let files = []; - try { - files = await readdir(templateDir); - files = files.filter(file => !file.startsWith('.')); - } catch(e) { - // ignore - } - await writeFile(templateList, JSON.stringify(files)); - } -}) diff --git a/website/docs/.vitepress/locales/en.ts b/website/docs/.vitepress/locales/en.ts deleted file mode 100644 index 381a1dc9..00000000 --- a/website/docs/.vitepress/locales/en.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'en-US', - description: 'A kernel-based root solution for Android GKI devices.', - - themeConfig: { - nav: nav(), - - lastUpdatedText: 'Last updated', - - sidebar: { - '/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: 'Released under the GPL3 License.', - copyright: 'Copyright © 2022-present KernelSU developers.' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: 'Edit this page on GitHub' - } - } -}) - -function nav() { - return [ - { text: 'Guide', link: '/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'Guide', - items: [ - { text: 'What is KernelSU?', link: '/guide/what-is-kernelsu' }, - { text: 'Difference with Magisk', link: '/guide/difference-with-magisk' }, - { text: 'Installation', link: '/guide/installation' }, - { text: 'How to build', link: '/guide/how-to-build' }, - { text: 'Intergrate for non-GKI devices', link: '/guide/how-to-integrate-for-non-gki'}, - { text: 'Unofficially supported devices', link: '/guide/unofficially-support-devices.md' }, - { text: 'Module guide', link: '/guide/module.md' }, - { text: 'Module WebUI', link: '/guide/module-webui.md' }, - { text: 'App Profile', link: '/guide/app-profile.md' }, - { text: 'Rescue from bootloop', link: '/guide/rescue-from-bootloop.md' }, - { text: 'FAQ', link: '/guide/faq' }, - { text: 'Hidden features', link: '/guide/hidden-features' }, - ] - } - ] -} diff --git a/website/docs/.vitepress/locales/id_ID.ts b/website/docs/.vitepress/locales/id_ID.ts deleted file mode 100644 index 9a0b05ca..00000000 --- a/website/docs/.vitepress/locales/id_ID.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'id-ID', - description: 'Solusi root kernel-based untuk perangkat Android GKI.', - - themeConfig: { - nav: nav(), - - lastUpdatedText: 'Update Terakhir', - - sidebar: { - '/id_ID/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: 'Rilis Dibawah Lisensi GPL3.', - copyright: 'Copyright © 2022-Sekarang pengembang KernelSU.' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: 'Edit Halaman ini di GitHub' - } - } -}) - -function nav() { - return [ - { text: 'Petunjuk', link: '/id_ID/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'Petunjuk', - items: [ - { text: 'Apa itu KernelSU?', link: '/id_ID/guide/what-is-kernelsu' }, - { text: 'Instalasi', link: '/id_ID/guide/installation' }, - { text: 'Bagaimana cara buildnya?', link: '/id_ID/guide/how-to-build' }, - { text: 'Integrasi untuk perangkat non-GKI', link: '/id_ID/guide/how-to-integrate-for-non-gki'}, - { text: 'Perangkat yang didukung secara tidak resmi', link: '/id_ID/guide/unofficially-support-devices.md' }, - { text: 'Petunjuk module', link: '/id_ID/guide/module.md' }, - { text: 'Antisipasi dari bootloop', link: '/id_ID/guide/rescue-from-bootloop.md' }, - { text: 'FAQ', link: '/id_ID/guide/faq' }, - ] - } - ] -} diff --git a/website/docs/.vitepress/locales/index.ts b/website/docs/.vitepress/locales/index.ts deleted file mode 100644 index 750e321b..00000000 --- a/website/docs/.vitepress/locales/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { defineConfig } from 'vitepress' -import en from './en' -import zh_CN from './zh_CN' -import zh_TW from './zh_TW' -import vi_VN from './vi_VN' -import id_ID from './id_ID' -import ja_JP from './ja_JP' -import ru_RU from './ru_RU' -import pt_BR from './pt_BR' - -export default defineConfig({ - locales: { - root: { - label: 'English', - lang: en.lang, - themeConfig: en.themeConfig, - description: en.description - }, - zh_CN: { - label: '简体中文', - lang: zh_CN.lang, - themeConfig: zh_CN.themeConfig, - description: zh_CN.description - }, - zh_TW: { - label: '繁體中文', - lang: zh_TW.lang, - themeConfig: zh_TW.themeConfig, - description: zh_TW.description - }, - ja_JP: { - label: '日本語', - lang: ja_JP.lang, - themeConfig: ja_JP.themeConfig, - description: ja_JP.description - }, - vi_VN: { - label: 'Tiếng Việt', - lang: vi_VN.lang, - themeConfig: vi_VN.themeConfig, - description: vi_VN.description - }, - id_ID: { - label: 'Bahasa', - lang: id_ID.lang, - themeConfig: id_ID.themeConfig, - description: id_ID.description - }, - ru_RU: { - label: 'Русский', - lang: ru_RU.lang, - themeConfig: ru_RU.themeConfig, - description: ru_RU.description - }, - pt_BR: { - label: 'Português (Brasil)', - lang: pt_BR.lang, - themeConfig: pt_BR.themeConfig, - description: pt_BR.description - } - } -}) diff --git a/website/docs/.vitepress/locales/ja_JP.ts b/website/docs/.vitepress/locales/ja_JP.ts deleted file mode 100644 index 35521ef9..00000000 --- a/website/docs/.vitepress/locales/ja_JP.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'ja-JP', - description: 'Android GKI デバイス向けのカーネルベースの root ソリューション', - - themeConfig: { - nav: nav(), - - lastUpdatedText: '最終更新', - - sidebar: { - '/ja_JP/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: 'GPL3 ライセンスでリリースされています。', - copyright: 'Copyright © 2022-現在 KernelSU 開発者。' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: 'GitHub でこのページを編集' - } - } -}) - -function nav() { - return [ - { text: 'ガイド', link: '/ja_JP/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'ガイド', - items: [ - { text: 'KernelSU とは?', link: '/ja_JP/guide/what-is-kernelsu' }, - { text: 'インストール', link: '/ja_JP/guide/installation' }, - { text: 'ビルドするには?', link: '/ja_JP/guide/how-to-build' }, - { text: '非 GKI デバイスでの実装', link: '/ja_JP/guide/how-to-integrate-for-non-gki' }, - { text: '非公式の対応デバイス', link: '/ja_JP/guide/unofficially-support-devices.md' }, - { text: 'モジュールのガイド', link: '/ja_JP/guide/module.md' }, - { text: 'ブートループからの復旧', link: '/ja_JP/guide/rescue-from-bootloop.md' }, - { text: 'よくある質問', link: '/ja_JP/guide/faq' }, - { text: '隠し機能', link: '/ja_JP/guide/hidden-features' }, - ] - } - ] -} diff --git a/website/docs/.vitepress/locales/pt_BR.ts b/website/docs/.vitepress/locales/pt_BR.ts deleted file mode 100644 index 6e5b969b..00000000 --- a/website/docs/.vitepress/locales/pt_BR.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'pt-BR', - description: 'Uma solução root baseada em kernel para dispositivos Android GKI.', - - themeConfig: { - nav: nav(), - - lastUpdatedText: 'Última atualização', - - sidebar: { - '/pt_BR/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: 'Lançado sob a Licença GPL3', - copyright: 'Copyright © 2022-presente Desenvolvedores do KernelSU.' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: 'Edite esta página no GitHub' - } - } -}) - -function nav() { - return [ - { text: 'Guia', link: '/pt_BR/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'Guia', - items: [ - { text: 'O que é KernelSU?', link: '/pt_BR/guide/what-is-kernelsu' }, - { text: 'Diferenças com Magisk', link: '/pt_BR/guide/difference-with-magisk' }, - { text: 'Instalação', link: '/pt_BR/guide/installation' }, - { text: 'Como compilar', link: '/pt_BR/guide/how-to-build' }, - { text: 'Integração para dispositivos não-GKI', link: '/pt_BR/guide/how-to-integrate-for-non-gki'}, - { text: 'Dispositivos com suporte não oficial', link: '/pt_BR/guide/unofficially-support-devices.md' }, - { text: 'Guias de módulo', link: '/pt_BR/guide/module.md' }, - { text: 'Módulo WebUI', link: '/pt_BR/guide/module-webui.md' }, - { text: 'Perfil do Aplicativo', link: '/pt_BR/guide/app-profile.md' }, - { text: 'Resgate do bootloop', link: '/pt_BR/guide/rescue-from-bootloop.md' }, - { text: 'Perguntas frequentes', link: '/pt_BR/guide/faq' }, - { text: 'Recursos ocultos', link: '/pt_BR/guide/hidden-features' }, - ] - } - ] -} diff --git a/website/docs/.vitepress/locales/ru_RU.ts b/website/docs/.vitepress/locales/ru_RU.ts deleted file mode 100644 index 3059ab96..00000000 --- a/website/docs/.vitepress/locales/ru_RU.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'ru-RU', - description: 'Решение на основе ядра root для устройств Android GKI.', - - themeConfig: { - nav: nav(), - - lastUpdatedText: 'последнее обновление', - - sidebar: { - '/ru_RU/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: 'Выпускается под лицензией GPL3.', - copyright: 'Авторские права © 2022-текущее Разработчики KernelSU.' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: 'Редактировать эту страницу на GitHub' - } - } -}) - -function nav() { - return [ - { text: 'Руководство', link: '/ru_RU/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'Руководство', - items: [ - { text: 'Что такое KernelSU?', link: '/ru_RU/guide/what-is-kernelsu' }, - { text: 'Установка', link: '/ru_RU/guide/installation' }, - { text: 'Как собрать?', link: '/ru_RU/guide/how-to-build' }, - { text: 'Реализация в устройствах, не относящихся к GKI', link: '/ru_RU/guide/how-to-integrate-for-non-gki'}, - { text: 'Неофициально поддерживаемые устройства', link: '/ru_RU/guide/unofficially-support-devices.md' }, - { text: 'Руководство по разработке модулей', link: '/ru_RU/guide/module.md' }, - { text: 'Профиль приложений', link: '/ru_RU/guide/app-profile.md' }, - { text: 'Выход из циклической загрузки', link: '/ru_RU/guide/rescue-from-bootloop.md' }, - { text: 'FAQ', link: '/ru_RU/guide/faq' }, - { text: 'Скрытые возможности', link: '/ru_RU/guide/hidden-features' }, - ] - } - ] -} diff --git a/website/docs/.vitepress/locales/vi_VN.ts b/website/docs/.vitepress/locales/vi_VN.ts deleted file mode 100644 index 15808681..00000000 --- a/website/docs/.vitepress/locales/vi_VN.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'vi-VN', - description: 'Một giải pháp root trực tiếp trên kernel dành cho các thiết bị hỗ trợ GKI.', - - themeConfig: { - nav: nav(), - - lastUpdatedText: 'cập nhật lần cuối', - - sidebar: { - '/vi_VN/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: 'Phát hành dưới giấy phép GPL3.', - copyright: 'Bản Quyền © 2022-nay KernelSU developers.' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: 'Chỉnh sửa trang này trên GitHub' - } - } -}) - -function nav() { - return [ - { text: 'Hướng Dẫn', link: '/vi_VN/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'Hướng Dẫn', - items: [ - { text: 'KernelSU là gì?', link: '/vi_VN/guide/what-is-kernelsu' }, - { text: 'Cách cài đặt', link: '/vi_VN/guide/installation' }, - { text: 'Cách để build?', link: '/vi_VN/guide/how-to-build' }, - { text: 'Tích hợp vào thiết bị không sử dụng GKI', link: '/vi_VN/guide/how-to-integrate-for-non-gki'}, - { text: 'Thiết bị hỗ trợ không chính thức', link: '/vi_VN/guide/unofficially-support-devices.md' }, - { text: 'FAQ - Câu hỏi thường gặp', link: '/vi_VN/guide/faq' }, - ] - } - ] -} diff --git a/website/docs/.vitepress/locales/zh_CN.ts b/website/docs/.vitepress/locales/zh_CN.ts deleted file mode 100644 index bd3c3559..00000000 --- a/website/docs/.vitepress/locales/zh_CN.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'zh-CN', - description: '一个基于内核,为安卓 GKI 准备的 root 方案。', - - themeConfig: { - nav: nav(), - - lastUpdatedText: '最后更新', - - sidebar: { - '/zh_CN/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: '在 GPL3 许可证下发布。', - copyright: 'Copyright © 2022-现在 KernelSU 开发者。' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: '在 GitHub 中编辑本页' - } - } -}) - -function nav() { - return [ - { text: '指南', link: '/zh_CN/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'Guide', - items: [ - { text: '什么是 KernelSU?', link: '/zh_CN/guide/what-is-kernelsu' }, - { text: 'KernelSU 模块与 Magisk 的差异', link: '/zh_CN/guide/difference-with-magisk' }, - { text: '安装', link: '/zh_CN/guide/installation' }, - { text: '如何构建?', link: '/zh_CN/guide/how-to-build' }, - { text: '如何为非 GKI 设备集成 KernelSU', link: '/zh_CN/guide/how-to-integrate-for-non-gki'}, - { text: '非官方支持设备', link: '/zh_CN/guide/unofficially-support-devices.md' }, - { text: '模块开发指南', link: '/zh_CN/guide/module.md' }, - { text: '模块 Web 界面', link: '/zh_CN/guide/module-webui.md' }, - { text: 'App Profile', link: '/zh_CN/guide/app-profile.md' }, - { text: '救砖', link: '/zh_CN/guide/rescue-from-bootloop.md' }, - { text: '常见问题', link: '/zh_CN/guide/faq' }, - { text: '隐藏功能', link: '/zh_CN/guide/hidden-features' }, - ] - } - ] -} diff --git a/website/docs/.vitepress/locales/zh_TW.ts b/website/docs/.vitepress/locales/zh_TW.ts deleted file mode 100644 index b2c23b98..00000000 --- a/website/docs/.vitepress/locales/zh_TW.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { createRequire } from 'module' -import { defineConfig } from 'vitepress' - -const require = createRequire(import.meta.url) -const pkg = require('vitepress/package.json') - -export default defineConfig({ - lang: 'zh-TW', - description: '一個基於核心,適用於 Android GKI 的 Root 解決方案。', - - themeConfig: { - nav: nav(), - - lastUpdatedText: '上次更新', - - sidebar: { - '/zh_TW/guide/': sidebarGuide() - }, - - socialLinks: [ - { icon: 'github', link: 'https://github.com/tiann/KernelSU' } - ], - - footer: { - message: '係依據 GPL3 授權發行。', - copyright: 'Copyright © 2022-目前 KernelSU 開發人員。' - }, - - editLink: { - pattern: 'https://github.com/tiann/KernelSU/edit/main/website/docs/:path', - text: '在 GitHub 中編輯本頁面' - } - } -}) - -function nav() { - return [ - { text: '指南', link: '/zh_TW/guide/what-is-kernelsu' }, - ] -} - -function sidebarGuide() { - return [ - { - text: 'Guide', - items: [ - { text: '什麼是 KernelSU?', link: '/zh_TW/guide/what-is-kernelsu' }, - { text: 'KernelSU 與 Magisk 的差異', link: '/zh_TW/guide/difference-with-magisk' }, - { text: '安裝', link: '/zh_TW/guide/installation' }, - { text: '如何建置?', link: '/zh_TW/guide/how-to-build' }, - { text: '如何為非 GKI 核心整合 KernelSU', link: '/zh_TW/guide/how-to-integrate-for-non-gki'}, - { text: '非官方支援裝置', link: '/zh_TW/guide/unofficially-support-devices.md' }, - { text: '模組指南', link: '/zh_TW/guide/module.md' }, - { text: '模組 WebUI', link: '/zh_TW/guide/module-webui.md' }, - { text: 'App Profile', link: '/zh_TW/guide/app-profile.md' }, - { text: '搶救開機迴圈', link: '/zh_TW/guide/rescue-from-bootloop.md' }, - { text: '常見問題', link: '/zh_TW/guide/faq' }, - { text: '隱藏功能', link: '/zh_TW/guide/hidden-features' }, - ] - } - ] -} diff --git a/website/docs/guide/app-profile.md b/website/docs/guide/app-profile.md deleted file mode 100644 index 4a8fd011..00000000 --- a/website/docs/guide/app-profile.md +++ /dev/null @@ -1,118 +0,0 @@ -# App Profile - -The App Profile is a mechanism provided by KernelSU for customizing the configuration of various apps. - -For apps granted root permissions (i.e., able to use `su`), the App Profile can also be referred to as the Root Profile. It allows customization of the `uid`, `gid`, `groups`, `capabilities`, and `SELinux` rules of the `su` command, thereby restricting the privileges of the root user. For example, it can grant network permissions only to firewall apps while denying file access permissions, or it can grant shell permissions instead of full root access for freeze apps: **keeping the power confined with the principle of least privilege.** - -For ordinary apps without root permissions, the App Profile can control the behavior of the kernel and module system towards these apps. For instance, it can determine whether modifications resulting from modules should be addressed. The kernel and module system can make decisions based on this configuration, such as performing operations akin to "hiding". - -## Root Profile - -### UID, GID, and Groups - -Linux systems have two concepts: users and groups. Each user has a user ID (UID), and a user can belong to multiple groups, each with its own group ID (GID). These IDs are used to identify users in the system and determine which system resources they can access. - -Users with a UID of 0 are known as root users, and groups with a GID of 0 are known as root groups. The root user group generally has the highest system privileges. - -In the case of the Android system, each app functions as a separate user (except in cases of shared UIDs) with a unique UID. For example, `0` represents the root user, `1000` represents `system`, `2000` represents the ADB shell, and UIDs ranging from `10000` to `19999` represent ordinary apps. - -::: info -Here, the UID mentioned isn't the same as the concept of multiple users or work profiles in the Android system. Work profiles are actually implemented by partitioning the UID range. For example, 10000-19999 represents the main user, while 110000-119999 represents a work profile. Each ordinary app among them has its own unique UID. -::: - -Each app can have several groups, with the GID representing the primary group, which usually matches the UID. Other groups are known as supplementary groups. Certain permissions are controlled through groups, such as network access permissions or Bluetooth access. - -For example, if we execute the `id` command in ADB shell, the output might look like this: - -```sh -oriole:/ $ id -uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0 -``` - -Here, the UID is `2000`, and the GID (primary group ID) is also `2000`. Additionally, it belongs to several supplementary groups, such as `inet` (indicating the ability to create `AF_INET` and `AF_INET6` sockets) and `sdcard_rw` (indicating read/write permissions for the SD card). - -KernelSU's Root Profile allows customization of the UID, GID, and groups for the root process after executing `su`. For example, the Root Profile of a root app can set its UID to `2000`, which means that when using `su`, the app's actual permissions are at the ADB shell level. Additionally, the `inet` group can be removed, preventing the `su` command from accessing the network. - -::: tip NOTE -The App Profile only controls the permissions of the root process after using `su` and doesn't control the app's own permissions. If an app has requested network access permission, it can still access the network even without using `su`. Removing the `inet` group from `su` only prevents `su` from accessing the network. -::: - -Root Profile is enforced in the kernel and doesn't rely on the voluntary behavior of root apps, unlike switching users or groups through `su`. Granting `su` permissions is entirely controlled by the user, not the developer. - -### Capabilities - -Capabilities are a mechanism for privilege separation in Linux. - -For the purpose of performing permission checks, traditional `UNIX` implementations distinguish two categories of processes: privileged processes (whose effective user ID is `0`, referred to as superuser or root) and unprivileged processes (whose effective UID is nonzero). Privileged processes bypass all kernel permission checks, while unprivileged processes are subject to full permission checking based on the process's credentials (usually: effective UID, effective GID, and supplementary group list). - -Starting with Linux 2.2, Linux divides the privileges traditionally associated with superuser into distinct units, known as capabilities, which can be independently enabled and disabled. - -Each capability represents one or more privileges. For example, `CAP_DAC_READ_SEARCH` represents the ability to bypass permission checks for file reading, as well as directory read and execute permissions. If a user with an effective UID of `0` (root user) doesn't have the `CAP_DAC_READ_SEARCH` capability or higher, this means that even as root, they cannot freely read files. - -KernelSU's Root Profile allows customization of the capabilities of the root process after executing `su`, thus granting partial "root privileges". Unlike the UID and GID mentioned above, certain root apps require a UID of `0` after using `su`. In such cases, limiting the capabilities of this root user with UID `0` can restrict the operations they're allowed to perform. - -::: tip STRONG RECOMMENDATION -Linux's capability [official documentation](https://man7.org/linux/man-pages/man7/capabilities.7.html) provides detailed explanations of the abilities represented by each capability. If you intend to customize capabilities, it's strongly recommended that you read this document first. -::: - -### SELinux - -SELinux is a powerful Mandatory Access Control (MAC) mechanism. It operates on the principle of **default deny**. Any action not explicitly allowed is denied. - -SELinux can run in two global modes: - -1. Permissive mode: Denial events are logged, but not enforced. -2. Enforcing mode: Denial events are logged and enforced. - -::: warning -Modern Android systems heavily rely on SELinux to ensure overall system security. It's highly recommended not to use any custom systems running in "Permissive mode" since it provides no significant advantages over a completely open system. -::: - -Explaining the full concept of SELinux is complex and beyond the scope of this document. It's recommended to first understand how it works through the following resources: - -1. [Wikipedia](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) -2. [Red Hat: What Is SELinux?](https://www.redhat.com/en/topics/linux/what-is-selinux) -3. [ArchLinux: SELinux](https://wiki.archlinux.org/title/SELinux) - -KernelSU's Root Profile allows customization of the SELinux context of the root process after executing `su`. Specific access control rules can be set for this context, enabling fine-grained control over root permissions. - -In typical scenarios, when an app executes `su`, it switches the process to a SELinux domain with **unrestricted access**, such as `u:r:su:s0`. Through the Root Profile, this domain can be switched to a custom domain, such as `u:r:app1:s0`, and a series of rules can be defined for this domain: - -```sh -type app1 -enforce app1 -typeattribute app1 mlstrustedsubject -allow app1 * * * -``` - -Note that the `allow app1 * * *` rule is used for demonstration purposes only. In practice, this rule shouldn't be used extensively, as it isn't much different from Permissive mode. - -### Escalation - -If the configuration of the Root Profile isn't set properly, an escalation scenario may occur. The restrictions imposed by the Root Profile can unintentionally fail. - -For example, if you grant root permission to an ADB shell user (which is a common case) and then grant root permission to a regular app, but configure its Root Profile with UID 2000 (which is the UID of the ADB shell user), the app can obtain full root access by executing the `su` command twice: - -1. The first execution of `su` will be subject to the App Profile and will switch to UID `2000` (ADB shell) instead of `0` (root). -2. The second execution of `su`, since the UID is `2000` and root access has been granted to UID `2000` (ADB shell) in the configuration, the app will gain full root privileges. - -::: warning NOTE -This behavior is fully expected and isn't a bug. Therefore, we recommend the following: - -If you genuinely need to grant root permissions to ADB (e.g., as a developer), it isn't advisable to change the UID to `2000` when configuring the Root Profile. Using `1000` (system) would be a better choice. -::: - -## Non-root profile - -### Umount modules - -KernelSU provides a systemless mechanism to modify system partitions, achieved through the mounting of OverlayFS. However, some apps may be sensitive to this behavior. In this case, we can unload modules mounted in these apps by setting the "Umount modules" option. - -Additionally, the KernelSU manager's settings interface provides the "Umount modules by default". By default, this option is **enabled**, which means that KernelSU or some modules will unload modules for this app unless additional settings are applied. If you don't prefer this setting or if it affects certain apps, you have the following options: - -1. Keep the "Umount modules by default" option enabled and individually disable the "Umount modules" option in the App Profile for apps requiring module loading (acting as a "whitelist"). -2. Disable the "Umount modules by default" option and individually enable the "Umount modules" option in the App Profile for apps requiring module loading (acting as a "blacklist"). - -::: info -In devices running kernel version 5.10 and above, the kernel performs without any further action the unloading of modules. However, for devices running kernel versions below 5.10, this option is merely a configuration setting, and KernelSU itself doesn't take any action. If you want to use the "Umount modules" option in kernel versions before 5.10 you need to backport the `path_umount` function in `fs/namespace.c`. You can get more information at the end of the [Intergrate for non-GKI devices](https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#how-to-backport-path_umount) page. Some modules, such as Zygisksu, may also use this option to determine if module unloading is necessary. -::: diff --git a/website/docs/guide/difference-with-magisk.md b/website/docs/guide/difference-with-magisk.md deleted file mode 100644 index 1e1cc08b..00000000 --- a/website/docs/guide/difference-with-magisk.md +++ /dev/null @@ -1,28 +0,0 @@ -# Difference with Magisk - -Although KernelSU and Magisk modules have many similarities, there are inevitably some differences due to their completely different implementation mechanisms. If you want your module to work on both Magisk and KernelSU, it's essential to understand these differences. - -## Similarities - -- Module file format: Both use the ZIP format to organize modules, and the module format is practically the same. -- Module installation directory: Both are located at `/data/adb/modules`. -- Systemless: Both support modifying `/system` in a systemless way through modules. -- post-fs-data.sh: Execution time and semantics are exactly the same. -- service.sh: Execution time and semantics are exactly the same. -- system.prop: Completely the same. -- sepolicy.rule: Completely the same. -- BusyBox: Scripts are run in BusyBox with "Standalone Mode" enabled in both cases. - -## Differences - -Before understanding the differences, it's important to know how to identify whether your module is running in KernelSU or Magisk. You can use the environment variable `KSU` to differentiate it in all places where you can run module scripts (`customize.sh`, `post-fs-data.sh`, `service.sh`). In KernelSU, this environment variable will be set to `true`. - -Here are some differences: - -- KernelSU modules cannot be installed in Recovery mode. -- KernelSU modules don't have built-in support for Zygisk, but you can use Zygisk modules through [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext)). -- The method for replacing or deleting files in KernelSU modules is completely different from Magisk. KernelSU doesn't support the `.replace` method. Instead, you need to create a same-named file with `mknod filename c 0 0` to delete the corresponding file. -- The directories for BusyBox are different. The built-in BusyBox in KernelSU is located at `/data/adb/ksu/bin/busybox`, while in Magisk it is at `/data/adb/magisk/busybox`. **Note that this is an internal behavior of KernelSU and may change in the future!** -- KernelSU doesn't support `.replace` files, but it supports the `REMOVE` and `REPLACE` variables to remove or replace files and folders. -- KernelSU adds the `boot-completed` stage to run scripts after the boot process is finished. -- KernelSU adds the `post-mount` stage to run scripts after OverlayFS is mounted. diff --git a/website/docs/guide/faq.md b/website/docs/guide/faq.md deleted file mode 100644 index 5f68397c..00000000 --- a/website/docs/guide/faq.md +++ /dev/null @@ -1,78 +0,0 @@ -# FAQ - -## Does KernelSU support my device? - -First, your devices should be able to unlock the bootloader. If not, then there is unsupported. - -Next, install the KernelSU manager on your device and open it. If it shows `Unsupported`, then your device cannot be supported immediately. However, you can build kernel source and integrate KernelSU to make it work, or use [Unofficially supported devices](unofficially-support-devices). - -## Does KernelSU need to unlock bootloader? - -Certainly, yes. - -## Does KernelSU support modules? - -Yes, check [Module guide](module.md). - -## Does KernelSU support Xposed? - -Yes, you can use LSPosed with [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). - -## Does KernelSU support Zygisk? - -KernelSU has no built-in Zygisk support, but you can use [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). - -## Is KernelSU compatible with Magisk? - -KernelSU's module system conflicts with Magisk's magic mount. If any module is enabled in KernelSU, Magisk will stop working entirely. - -However, if you only use the `su` of KernelSU, it will work well with Magisk. KernelSU modifies the `kernel`, while Magisk modifies the `ramdisk`, allowing both to work together. - -## Will KernelSU substitute Magisk? - -We believe that it isn't, and that isn't our goal. Magisk is good enough for userspace root solution and will have a long life. KernelSU's goal is to provide a kernel interface to users, not substituting Magisk. - -## Can KernelSU support non-GKI devices? - -It's possible. But you should download the kernel source and intergrate KernelSU into the source tree, and compile the kernel yourself. - -## Can KernelSU support devices below Android 12? - -It's the device's kernel that affects KernelSU's compatibility, and it has nothing to do with the Android version. The only restriction is that devices launched with Android 12 must have a kernel version of 5.10+ (GKI devices). So: - -1. Devices launched with Android 12 must be supported. -2. Devices with an older kernel (some devices with Android 12 also have the older kernel) are compatible (you should build kernel yourself). - -## Can KernelSU support old kernel? - -It's possible. KernelSU is backported to kernel 4.14 now. For older kernels, you need to backport it manually, and PRs are always welcome! - -## How to integrate KernelSU for an older kernel? - -Please check the [Intergrate for non-GKI devices](how-to-integrate-for-non-gki) guide. - -## Why my Android version is 13, and the kernel shows "android12-5.10"? - -The kernel version has nothing to do with the Android version. If you need to flash kernel, always use the kernel version; the Android version isn't as important. - -## I'm GKI 1.0, can I use this? - -GKI 1.0 is completely different from GKI 2.0, you must compile kernel by yourself. - -## How can I make `/system` RW? - -We don't recommend that you modify the system partition directly. Please check [Module guide](module.md) to modify it systemlessly. If you insist on doing this, check [magisk_overlayfs](https://github.com/HuskyDG/magic_overlayfs). - -## Can KernelSU modify hosts? How can I use AdAway? - -Of course. But KernelSU doesn't have built-in hosts support, you can install [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) to do it. - -## Why is there a huge 1 TB file? - -The 1 TB `modules.img` file is a disk image file. **Don't worry about its size**; it's a special type of file known as a [sparse file](https://en.wikipedia.org/wiki/Sparse_file). Its actual size is only the size of the module you use, and it will decrease dynamically after you delete the module. In fact, it doesn't occupy 1 TB of disk space (your device might not even have that much space). - -If you really care about the size of this file, you can use the `resize2fs -M` command to make it the actual size. However, the module may not work correctly in this case, and we won't provide any support for this. - -## Why does my device show wrong storage size? - -Certain devices use non-standard methods to calculate the device's storage size, which may lead to inaccurate storage calculations in system apps and menus, especially when dealing with 1 TB sparse files. Although this problem seems to be specific to Samsung devices, affecting only Samsung apps and services, it's important to note that the discrepancy mainly concerns the total storage size, and the free space calculation remains accurate. diff --git a/website/docs/guide/hidden-features.md b/website/docs/guide/hidden-features.md deleted file mode 100644 index a2682fe3..00000000 --- a/website/docs/guide/hidden-features.md +++ /dev/null @@ -1,7 +0,0 @@ -# Hidden features - -## .ksurc - -By default, `/system/bin/sh` loads `/system/etc/mkshrc`. - -You can make su load customized rc file by creating a `/data/adb/ksu/.ksurc` file. diff --git a/website/docs/guide/how-to-build.md b/website/docs/guide/how-to-build.md deleted file mode 100644 index 0260ce2e..00000000 --- a/website/docs/guide/how-to-build.md +++ /dev/null @@ -1,71 +0,0 @@ -# How to build - -First, you should read the official Android documentation for kernel build: - -1. [Build kernels](https://source.android.com/docs/setup/build/building-kernels) -2. [GKI release builds](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -::: warning -This page is for GKI devices, if you use an old kernel, please refer [Intergrate for non-GKI devices](how-to-integrate-for-non-gki). -::: - -## Build kernel - -### Sync the kernel source code - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -The `` file is a manifest that uniquely identifies a build, allowing you to make it reproducible. To do this, you should download the manifest file from [GKI release builds](https://source.android.com/docs/core/architecture/kernel/gki-release-builds). - -### Build - -Please check the [Building kernels](https://source.android.com/docs/setup/build/building-kernels) first. - -For example, to build an `aarch64` kernel image: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` - -Don't forget to add the `LTO=thin` flag; otherwise, the build may fail if your computer has less than 24 GB of memory. - -Starting from Android 13, the kernel is built by `bazel`: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` - -::: info -For some Android 14 kernels, to make Wi-Fi/Bluetooth work, it might be necessary to remove all GKI protected exports: - -```sh -rm common/android/abi_gki_protected_exports_* -``` -::: - -## Build kernel with KernelSU - -If you can successfully build the kernel, adding support for KernelSU will be relatively easy. In the root of kernel source directory, run any of the options listed below: - -::: code-group - -```sh[Latest tag (stable)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -```sh[ main branch (dev)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -```sh[Select tag (such as v0.5.2)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -::: - -Then, rebuild the kernel and you will get a kernel image with KernelSU! diff --git a/website/docs/guide/how-to-integrate-for-non-gki.md b/website/docs/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index 6d119160..00000000 --- a/website/docs/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,377 +0,0 @@ -# Intergrate for non-GKI devices - -KernelSU can be integrated into non-GKI kernels and was backported to 4.14 and earlier versions. - -Due to the fragmentation of non-GKI kernels, we don't have a universal method to build it, so we cannot provide the non-GKI boot.img. However, you can build the kernel with KernelSU integrated on your own. - -First, you should be able to build a bootable kernel from kernel source code. If the kernel isn't open source, then it is difficult to run KernelSU for your device. - -If you're able to build a bootable kernel, there are two ways to integrate KernelSU into the kernel source code: - -1. Automatically with `kprobe` -2. Manually - -## Integrate with kprobe - -KernelSU uses kprobe to do kernel hooks, if kprobe runs well in your kernel, it's recommended to use it this way. - -First, add KernelSU to your kernel source tree: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -::: info -[KernelSU 1.0 and later versions no longer support non-GKI kernels](https://github.com/tiann/KernelSU/issues/1705). The last supported version is `v0.9.5`, so make sure to use the correct version. -::: - -Then, you should check if kprobe is enabled in your kernel config. If it isn't, add these configs to it: - -```txt -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` - -Now, when you re-build your kernel, KernelSU should work correctly. - -If you find that KPROBES is still not enabled, you can try enabling `CONFIG_MODULES`. If that doesn't solve the issue, use `make menuconfig` to search for other KPROBES dependencies. - -However, if you encounter a bootloop after integrating KernelSU, this may indicate that the **kprobe is broken in your kernel**, which means that you should fix the kprobe bug or use another way. - -::: tip HOW TO CHECK IF KPROBE IS BROKEN? -Comment out `ksu_enable_sucompat()` and `ksu_enable_ksud()` in `KernelSU/kernel/ksu.c`, if the device boots normally, then kprobe may be broken. -::: - -::: info HOW TO GET MODULE UMOUNT FEATURE WORKING ON PRE-GKI? -If your kernel is older than 5.9, you should backport `path_umount` to `fs/namespace.c`. This is required to get "Umount module" feature work correctly. If you don't backport `path_umount`, "Umount module" feature won't work. You can get more info on how to achieve this at the end of this page. -::: - -## Manually modify the kernel source - -If kprobe doesn't work on your kernel this may be caused by an upstream bug or if the kernel is below 4.8), then you can try the following: - -First, add KernelSU to your kernel source tree: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -Keep in mind that, on some devices, your defconfig may be located at `arch/arm64/configs` or in other cases, it may be at `arch/arm64/configs/vendor/your_defconfig`. Regardless of the defconfig you're using, make sure to enable `CONFIG_KSU` with `y` to enable or `n` to disable it. For example, if you choose to enable it, your defconfig should contain the following string: - -```txt -# KernelSU -CONFIG_KSU=y -``` - -Next, add KernelSU calls to the kernel source. Below are some patches for reference: - -::: code-group - -```diff[exec.c] -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); -+#endif - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); -+ #endif - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff[open.c] -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff[read_write.c] -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+#ifdef CONFIG_KSU -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); -+#endif - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ #endif -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff[stat.c] -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif -+ - /** - * vfs_statx - Get basic and extra attributes by filename - * @dfd: A file descriptor representing the base dir for a relative filename -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flags); -+ #endif - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` - -::: - -You should find the four functions in kernel source: - -1. `do_faccessat`, usually in `fs/open.c` -2. `do_execveat_common`, usually in `fs/exec.c` -3. `vfs_read`, usually in `fs/read_write.c` -4. `vfs_statx`, usually in `fs/stat.c` - -If your kernel doesn't have the `vfs_statx` function, use `vfs_fstatat` instead: - -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 068fdbcc9e26..5348b7bb9db2 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -87,6 +87,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) - } - EXPORT_SYMBOL(vfs_fstat); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif - int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int flag) - { -@@ -94,6 +96,8 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int error = -EINVAL; - unsigned int lookup_flags = 0; -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flag); -+ #endif -+ - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH)) != 0) - goto out; -``` - -For kernels eariler than 4.17, if you cannot find `do_faccessat`, just go to the definition of the `faccessat` syscall and place the call there: - -```diff -diff --git a/fs/open.c b/fs/open.c -index 2ff887661237..e758d7db7663 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -355,6 +355,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return error; - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif -+ - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -370,6 +373,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif -+ - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` - -### Safe Mode - -To enable KernelSU's built-in Safe Mode, you should modify the `input_handle_event` function in `drivers/input/input.c`: - -::: tip -It's strongly recommended to enable this feature, it's very useful for preventing bootloops! -::: - -```diff -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 45306f9ef247..815091ebfca4 100755 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -367,10 +367,13 @@ static int input_get_disposition(struct input_dev *dev, - return disposition; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_input_hook __read_mostly; -+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value); -+#endif -+ - static void input_handle_event(struct input_dev *dev, - unsigned int type, unsigned int code, int value) - { - int disposition = input_get_disposition(dev, type, code, &value); -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_input_hook)) -+ ksu_handle_input_handle_event(&type, &code, &value); -+ #endif - - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - add_input_randomness(type, code, value); -``` - -::: info ENTERING SAFE MODE ACCIDENTALLY? -If you're using manual integration and don't disable `CONFIG_KPROBES`, the user will be able to trigger Safe Mode by pressing the volume down button after booting! Therefore, if you're using manual integration, it's necessary to disable `CONFIG_KPROBES`! -::: - -### Failed to execute `pm` in terminal? - -You should modify `fs/devpts/inode.c`. Reference: - -```diff -diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c -index 32f6f1c68..d69d8eca2 100644 ---- a/fs/devpts/inode.c -+++ b/fs/devpts/inode.c -@@ -602,6 +602,8 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - return dentry; - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_devpts(struct inode*); -+#endif -+ - /** - * devpts_get_priv -- get private data for a slave - * @pts_inode: inode of the slave -@@ -610,6 +612,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - */ - void *devpts_get_priv(struct dentry *dentry) - { -+ #ifdef CONFIG_KSU -+ ksu_handle_devpts(dentry->d_inode); -+ #endif - if (dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC) - return NULL; - return dentry->d_fsdata; -``` - -### How to backport path_umount - -You can make the "Umount modules" feature work on pre-GKI kernels by manually backporting `path_umount` from 5.9. You can use this patch as reference: - -```diff ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -1739,6 +1739,39 @@ static inline bool may_mandlock(void) - } - #endif - -+static int can_umount(const struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ -+ if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) -+ return -EINVAL; -+ if (!may_mount()) -+ return -EPERM; -+ if (path->dentry != path->mnt->mnt_root) -+ return -EINVAL; -+ if (!check_mnt(mnt)) -+ return -EINVAL; -+ if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ -+ return -EINVAL; -+ if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ return 0; -+} -+ -+int path_umount(struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ int ret; -+ -+ ret = can_umount(path, flags); -+ if (!ret) -+ ret = do_umount(mnt, flags); -+ -+ /* we mustn't call path_put() as that would clear mnt_expiry_mark */ -+ dput(path->dentry); -+ mntput_no_expire(mnt); -+ return ret; -+} - /* - * Now umount can handle mount points as well as block devices. - * This is important for filesystems which use unnamed block devices. -``` - -Finally, build your kernel again, and KernelSU should work correctly. diff --git a/website/docs/guide/installation.md b/website/docs/guide/installation.md deleted file mode 100644 index 47d2cb07..00000000 --- a/website/docs/guide/installation.md +++ /dev/null @@ -1,280 +0,0 @@ -# Installation - -## Check if your device is supported - -Download KernelSU manager from [GitHub Releases](https://github.com/tiann/KernelSU/releases) and install it on your device: - -- If the app shows `Unsupported`, it means that **you should compile the kernel yourself**, KernelSU won't and never provide a boot.img file for you to flash. -- If the app shows `Not installed`, then your device is officially supported by KernelSU. - -::: info -For devices showing `Unsupported`, you can check the list of [Unofficially supported devices](unofficially-support-devices.md). You can compile the kernel yourself. -::: - -## Backup stock boot.img - -Before flashing, it's essential that you back up your stock boot.img. If you encounter any bootloop, you can always restore the system by flashing back to the stock factory boot using fastboot. - -::: warning -Flashing may cause data loss. Make sure to do this step well before proceeding to the next step! You can also back up all the data on your device if necessary. -::: - -## Necessary knowledge - -### ADB and fastboot - -By default, you will use ADB and fastboot tools in this tutorial, so if you don't know them, we recommend using a search engine to learn about them first. - -### KMI - -Kernel Module Interface (KMI), kernel versions with the same KMI are **compatible**, this is what "general" means in GKI; conversely, if the KMI is different, then these kernels aren't compatible with each other, and flashing a kernel image with a different KMI than your device may cause a bootloop. - -Specifically, for GKI devices, the kernel version format should be as follows: - -```txt -KernelRelease := -Version.PatchLevel.SubLevel-AndroidRelease-KmiGeneration-suffix -w .x .y -zzz -k -something -``` - -`w.x-zzz-k` is the KMI version. For example, if a device kernel version is `5.10.101-android12-9-g30979850fc20`, then its KMI is `5.10-android12-9`. Theoretically, it can boot up normally with other KMI kernels. - -::: tip -Note that the SubLevel in the kernel version isn't part of the KMI! This means that `5.10.101-android12-9-g30979850fc20` has the same KMI as `5.10.137-android12-9-g30979850fc20`! -::: - -### Security patch level {#security-patch-level} - -Newer Android devices may have anti-rollback mechanisms that prevent flashing a boot image with an old security patch level. For example, if your device kernel is `5.10.101-android12-9-g30979850fc20`, the security patch level is `2023-11`; even if you flash the kernel corresponding to the KMI, if the security patch level is older than `2023-11` (such as `2023-06`), it may cause a bootloop. - -Therefore, kernels with latest security patch levels are preferred to maintain compatibility with the KMI. - -### Kernel version vs Android version - -Please note: **Kernel version and Android version aren't necessarily the same!** - -If you find that your kernel version is `android12-5.10.101`, but your Android system version is Android 13 or other, don't be surprised, because the version number of the Android system isn't necessarily the same as the version number of the Linux kernel. The version number of the Linux kernel is generally correspondent to the version of the Android system that comes with the **device when it is shipped**. If the Android system is upgraded later, the kernel version will generally not change. So, before flashing anything, **always refer to the kernel version!** - -## Introduction - -Since version [0.9.0](https://github.com/tiann/KernelSU/releases/tag/v0.9.0), KernelSU supports two running modes on GKI devices: - -1. `GKI`: Replace the original kernel of the device with the **Generic Kernel Image** (GKI) provided by KernelSU. -2. `LKM`: Load the **Loadable Kernel Module** (LKM) into the device kernel without replacing the original kernel. - -These two modes are suitable for different scenarios, and you can choose the one according to your needs. - -### GKI mode {#gki-mode} - -In GKI mode, the original kernel of the device will be replaced with the generic kernel image provided by KernelSU. The advantages of GKI mode are: - -1. Strong universality, suitable for most devices. For example, Samsung has enabled KNOX devices, and LKM mode cannot work. There are also some niche modified devices that can only use GKI mode. -2. Can be used without relying on official firmware, and there is no need to wait for official firmware updates, as long as the KMI is consistent, it can be used. - -### LKM mode {#lkm-mode} - -In LKM mode, the original kernel of the device won't be replaced, but the loadable kernel module will be loaded into the device kernel. The advantages of LKM mode are: - -1. Won't replace the original kernel of the device. If you have special requirements for the original kernel of the device, or you want to use KernelSU while using a third-party kernel, you can use LKM mode. -2. It's more convenient to upgrade and OTA. When upgrading KernelSU, you can directly install it in the manager without flashing manually. After the system OTA, you can directly install it to the second slot without manual flashing. -3. Suitable for some special scenarios. For example, LKM can also be loaded with temporary root permissions. Since it doesn't need to replace the boot partition, it won't trigger AVB and won't cause the device to be bricked. -4. LKM can be temporarily uninstalled. If you want to temporarily disable root access, you can uninstall LKM. This process doesn't require flashing partitions, or even rebooting the device. If you want to enable root again, just reboot the device. - -::: tip COEXISTENCE OF TWO MODES -After opening the manager, you can see the current mode of the device on the homepage. Note that the priority of GKI mode is higher than that of LKM. For example, if you use GKI kernel to replace the original kernel, and use LKM to patch the GKI kernel, the LKM will be ignored, and the device will always run in GKI mode. -::: - -### Which one to choose? {#which-one} - -If your device is a mobile phone, we recommend that you prioritize LKM mode. If your device is an emulator, WSA, or Waydroid, we recommend that you prioritize GKI mode. - -## LKM installation - -### Get the official firmware - -To use LKM mode, you need to get the official firmware and patch it based on the official firmware. If you use a third-party kernel, you can use the `boot.img` of the third-party kernel as the official firmware. - -There are many ways to get the official firmware. If your device supports `fastboot boot`, we recommend **the most recommended and simplest** method is to use `fastboot boot` to temporarily boot the GKI kernel provided by KernelSU, then install the manager, and finally install it directly in the manager. This method doesn't require manually downloading the official firmware or manually extracting the boot. - -If your device doesn't support `fastboot boot`, you may need to manually download the official firmware package and extract the boot from it. - -Unlike GKI mode, LKM mode modifies the `ramdisk`. Therefore, on devices with Android 13, it needs to patch the `init_boot` partition instead of the `boot` partition, while GKI mode always operates on the `boot` partition. - -### Use the manager - -Open the manager, click the installation icon in the upper right corner, and several options will appear: - -1. Select a file. If your device doesn't have root privileges, you can choose this option and then select your official firmware. The manager will automatically patch it. After that, just flash this patched file to obtain root privileges permanently. -2. Direct install. If your device is already rooted, you can choose this option. The manager will automatically get your device information, and then automatically patch the official firmware, and flash it automatically. You can consider using `fastboot boot` KernelSU's GKI kernel to get temporary root and install the manager, and then use this option. This is also the main way to upgrade KernelSU. -3. Install to inactive slot. If your device supports A/B partition, you can choose this option. The manager will automatically patch the official firmware and install it to another partition. This method is suitable for devices after OTA, you can directly install it to another partition after OTA, and then restart the device. - -### Use the command line - -If you don't want to use the manager, you can also use the command line to install LKM. The `ksud` tool provided by KernelSU can help you quickly patch the official firmware and then flash it. - -This tool supports macOS, Linux, and Windows. You can download the corresponding version from [GitHub Release](https://github.com/tiann/KernelSU/releases). - -Usage: `ksud boot-patch` you can check the command line help for specific options. - -```sh -oriole:/ # ksud boot-patch -h -Patch boot or init_boot images to apply KernelSU - -Usage: ksud boot-patch [OPTIONS] - -Options: - -b, --boot Boot image path. If not specified, it will try to find the boot image automatically - -k, --kernel Kernel image path to be replaced - -m, --module LKM module path to be replaced. If not specified, the built-in module will be used - -i, --init init to be replaced - -u, --ota Will use another slot if the boot image is not specified - -f, --flash Flash it to boot partition after patch - -o, --out Output path. If not specified, the current directory will be used - --magiskboot magiskboot path. If not specified, the built-in version will be used - --kmi KMI version. If specified, the indicated KMI will be used - -h, --help Print help -``` - -A few options that need to be explained: - -1. The `--magiskboot` option can specify the path of magiskboot. If not specified, ksud will look for it in the environment variables. If you don’t know how to get magiskboot, you can check [here](#patch-boot-image). -2. The `--kmi` option can specify the `KMI` version. If the kernel name of your device doesn't follow the KMI specification, you can specify it using this option. - -The most common usage is: - -```sh -ksud boot-patch -b --kmi android13-5.10 -``` - -## GKI mode installation - -There are several installation methods for GKI mode, each suitable for a different scenario, so please choose accordingly: - -1. Install with fastboot using the boot.img provided by KernelSU. -2. Install with a kernel flash app, such as [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases). -3. Repair the boot.img manually and install it. -4. Install with custom Recovery (e.g., TWRP). - -## Install with boot.img provided by KernelSU - -If your device's `boot.img` uses a commonly used compression format, you can use the GKI images provided by KernelSU to flash it directly. This doesn't require TWRP or self-patching the image. - -### Find proper boot.img - -KernelSU provides a generic boot.img for GKI devices, and you should flash the boot.img to the device's boot partition. - -You can download boot.img from [GitHub Release](https://github.com/tiann/KernelSU/releases). Please note that you should use the correct version of boot.img. If you don't know which file to download, carefully read the description of [KMI](#kmi) and [Security patch level](#security-patch-level) in this document. - -Normally, there are three boot files in different formats for the same KMI and security patch level. They're identical except for the kernel compression format. Please check the kernel compression format of your original boot.img. You should use the correct format, such as `lz4`, `gz`. If you use an incorrect compression format, you may encounter bootloop after flashing boot.img. - -::: info COMPRESSION FORMAT OF BOOT.IMG -1. You can use magiskboot to get the compression format of your original boot.img. Alternatively, you can also ask members or developers in the community who have the same device model. Also, the compression format of the kernel usually doesn't change, so if you boot successfully with a certain compression format, you can try that format later as well. -2. Xiaomi devices usually use `gz` or `uncompressed`. -3. For Pixel devices, follow the instructions below: -::: - -### Flash boot.img to device - -Use `adb` to connect your device, then execute `adb reboot bootloader` to enter fastboot mode, and use this command to flash KernelSU: - -```sh -fastboot flash boot boot.img -``` - -::: info -If your device supports `fastboot boot`, you can first use `fastboot boot boot.img` to try to use boot.img to boot the system first. If something unexpected happens, restart it again to boot. -::: - -### Reboot - -After the flash is completed, you should reboot your device: - -```sh -fastboot reboot -``` - -## Install with Kernel Flasher - -Steps: - -1. Download the AnyKernel3 ZIP. If you don't know which file to download, carefully read the description of [KMI](#kmi) and [Security patch level](#security-patch-level) in this document. -2. Open the Kernel Flasher app, grant necessary root permissions, and use the provided AnyKernel3 ZIP to flash. - -This way requires the Kernel Flasher app to have root permissions. You can use the following methods to achieve this: - -1. Your device is rooted. For example, you have installed KernelSU and want to upgrade to the latest version or you have rooted through other methods (such as Magisk). -2. If your device isn't rooted, but the device supports the temporary boot method of `fastboot boot boot.img`, you can use the GKI image provided by KernelSU to temporarily boot your device, obtain temporary root permissions, and then use the Kernel Flash app to obtain permanent root privileges. - -Some of kernel flashing apps that can be used for this: - -1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases) -2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel) -3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager) - -Note: This method is more convenient when upgrading KernelSU and can be done without a computer (make a backup first). - -## Patch boot.img manually {#patch-boot-image} - -For some devices, the boot.img format isn't as common as `lz4`, `gz`, and `uncompressed`. A typical example is the Pixel, where the boot.img is compressed in the `lz4_legacy` format, while the, ramdisk may be in `gz` or also compressed in `lz4_legacy`. Currently, if you directly flash the boot.img provided by KernelSU, the device may not be able to boot. In this case, you can manually patch the boot.img to achieve this. - -It's always recommended to use `magiskboot` to patch images, there are two ways: - -1. [magiskboot](https://github.com/topjohnwu/Magisk/releases) -2. [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) - -The official build of `magiskboot` can only run on Android devices, if you want to run it on PC, you can try the second option. - -::: tip -Android-Image-Kitchen isn't recommended for now because it doesn't handle the boot metadata (such as security patch level) correctly. Therefore, it may not work on some devices. -::: - -### Preparation - -1. Get your device's stock boot.img. You can get it from your device manufacturers. You may need [payload-dumper-go](https://github.com/ssut/payload-dumper-go). -2. Download the AnyKernel3 ZIP file provided by KernelSU that matches the KMI version of your device. You can refer to [Install with custom Recovery](#install-with-custom-recovery). -3. Unpack the AnyKernel3 package and get the `Image` file, which is the kernel file of KernelSU. - -### Using magiskboot on Android devices {#using-magiskboot-on-Android-devices} - -1. Download latest Magisk from [GitHub Releases](https://github.com/topjohnwu/Magisk/releases). -2. Rename `Magisk-*(version).apk` to `Magisk-*.zip` and unzip it. -3. Push `Magisk-*/lib/arm64-v8a/libmagiskboot.so` to your device by ADB: `adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot` -4. Push stock boot.img and Image in AnyKernel3 to your device. -5. Enter ADB shell and run `cd /data/local/tmp/` directory, then `chmod +x magiskboot` -6. Enter ADB shell and run `cd /data/local/tmp/` directory, execute `./magiskboot unpack boot.img` to unpack `boot.img`, you will get a `kernel` file, this is your stock kernel. -7. Replace `kernel` with `Image` by running the command: `mv -f Image kernel`. -8. Execute `./magiskboot repack boot.img` to repack boot image, and you will get a `new-boot.img` file, flash this file to device by fastboot. - -### Using magiskboot on Windows/macOS/Linux PC {#using-magiskboot-on-PC} - -1. Download the corresponding `magiskboot` binary for your OS from [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci). -2. Prepare stock `boot.img` and `Image` in your PC. -3. Run `chmod +x magiskboot`. -4. Enter the corresponding directory, execute `./magiskboot unpack boot.img` to unpack `boot.img`, you will get a `kernel` file, this is your stock kernel. -5. Replace `kernel` with `Image` by running the command: `mv -f Image kernel`. -6. Execute `./magiskboot repack boot.img` to repack the boot image, and you will get a `new-boot.img` file, flash this file to device by fastboot. - -::: info -Official `magiskboot` can run in `Linux` environments normally, if you're a Linux user, you can use the official build. -::: - -## Install with custom Recovery {#install-with-custom-recovery} - -Prerequisite: Your device must have a custom Recovery, such as TWRP. If there is no custom Recovery available for your device, use another method. - -Steps: - -1. On [GitHub Releases](https://github.com/tiann/KernelSU/releases), download the ZIP package starting with `AnyKernel3` that matches your device's version. For example, if the device's kernel version is `android12-5.10.66`, then you should download the `AnyKernel3-android12-5.10.66_yyyy-MM.zip` file (where `yyyy` is the year and `MM` is the month). -2. Reboot the device into TWRP. -3. Use ADB to place AnyKernel3-*.zip into the device's `/sdcard` location and choose to install it in the TWRP GUI, or you can directly run `adb sideload AnyKernel-*.zip` to install. - -Note: This method is suitable for any installation (not limited to initial installation or subsequent upgrades), as long as you're using TWRP. - -## Other methods - -In fact, all of these installation methods have only one main idea, which is to **replace the original kernel for the one provided by KernelSU**, as long as this can be achieved, it can be installed. The following are other possible methods: - -1. First, install Magisk, get root privileges through Magisk, and then use the Kernel Flasher to flash the AnyKernel3 ZIP from KernelSU. -2. Use any flashing toolkit on PC to flash the kernel provided by KernelSU. - -However, if it doesn't work, please try `magiskboot` approach. diff --git a/website/docs/guide/module-webui.md b/website/docs/guide/module-webui.md deleted file mode 100644 index d1dede01..00000000 --- a/website/docs/guide/module-webui.md +++ /dev/null @@ -1,48 +0,0 @@ -# Module WebUI - -In addition to executing boot scripts and modifying system files, KernelSU's modules also support displaying UI interfaces and interacting directly with users. - -The module can write HTML + CSS + JavaScript pages through any web technology. KernelSU's manager will display these pages through WebView. It also provides some APIs to interact with the system, such as executing shell commands. - -## `webroot` directory - -Web resource files should be placed in the `webroot` subdirectory of the module root directory, and there **MUST** be a file named `index.html`, which is the module page entry. The simplest module structure containing a web interface is as follows: - -```txt -❯ tree . -. -|-- module.prop -`-- webroot - `-- index.html -``` - -::: warning -When installing the module, KernelSU will automatically set the permissions and SELinux context for this directory. If you don't know what you're doing, do not set the permissions for this directory yourself! -::: - -If your page contains CSS and JavaScript, you need to place it in this directory as well. - -## JavaScript API - -If it's just a display page, it will function like a regular web page. However, the most important thing is that KernelSU provides a series of system APIs, allowing the implementation of module-specific functions. - -KernelSU provides a JavaScript library, which is published on [npm](https://www.npmjs.com/package/kernelsu) and can be used in the JavaScript code of your web pages. - -For example, you can execute a shell command to obtain a specific configuration or modify a property: - -```JavaScript -import { exec } from 'kernelsu'; - -const { errno, stdout } = exec("getprop ro.product.model"); -``` - -For another example, you can make the web page display full screen, or display a toast. - -[API documentation](https://www.npmjs.com/package/kernelsu) - -If you find that the existing API doesn't meet your needs or is inconvenient to use, you're welcome to give us suggestions [here](https://github.com/tiann/KernelSU/issues)! - -## Some tips - -1. You can use `localStorage` as usual to store some data, but keep in mind that it will be lost if the manager app is uninstalled. If you need persistent storage, you will need to manually save the data in a specific directory. -2. For simple pages, we recommend using [parceljs](https://parceljs.org/) for packaging. It requires no initial configuration and is extremely easy to use. However, if you're a front-end expert or have your own preferences, feel free to use the tool of your choice! diff --git a/website/docs/guide/module.md b/website/docs/guide/module.md deleted file mode 100644 index 9fcff84f..00000000 --- a/website/docs/guide/module.md +++ /dev/null @@ -1,326 +0,0 @@ -# Module guide - -KernelSU provides a module mechanism that achieves the effect of modifying the system directory while maintaining the integrity of the system partition. This mechanism is commonly known as "systemless". - -The module mechanism of KernelSU is almost the same as that of Magisk. If you're familiar with Magisk module development, developing KernelSU modules is very similar. You can skip the introduction of modules below and just read [Difference with Magisk](difference-with-magisk.md). - -## WebUI - -KernelSU's modules support displaying interfaces and interacting with users. For more details, refer to the [WebUI documentation](module-webui.md). - -## BusyBox - -KernelSU ships with a feature-complete BusyBox binary (including full SELinux support). The executable is located at `/data/adb/ksu/bin/busybox`. KernelSU's BusyBox supports runtime toggle-able "ASH Standalone Shell Mode". What this Standalone Mode means is that when running in the `ash` shell of BusyBox, every single command will directly use the applet within BusyBox, regardless of what is set as `PATH`. For example, commands like `ls`, `rm`, `chmod` will **NOT** use what is in `PATH` (in the case of Android by default it will be `/system/bin/ls`, `/system/bin/rm`, and `/system/bin/chmod` respectively), but will instead directly call internal BusyBox applets. This makes sure that scripts always run in a predictable environment and always have the full suite of commands no matter which Android version it is running on. To force a command _not_ to use BusyBox, you have to call the executable with full paths. - -Every single shell script running in the context of KernelSU will be executed in BusyBox's `ash` shell with Standalone Mode enabled. For what is relevant to 3rd party developers, this includes all boot scripts and module installation scripts. - -For those who want to use this Standalone Mode feature outside of KernelSU, there are 2 ways to enable it: - -1. Set environment variable `ASH_STANDALONE` to `1`
Example: `ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
MaintainerRepositorySupport devices
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
diff --git a/website/docs/guide/what-is-kernelsu.md b/website/docs/guide/what-is-kernelsu.md deleted file mode 100644 index de2c67e9..00000000 --- a/website/docs/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# What is KernelSU? - -KernelSU is a root solution for Android GKI devices, it works in kernel mode and grants root permission to userspace apps directly in kernel space. - -## Features - -The main feature of KernelSU is that it's **kernel-based**. KernelSU works in kernel mode, enabling it to provide a kernel interface that we never had before. For example, it's possible to add hardware breakpoints to any process in kernel mode, access the physical memory of any process invisibly, intercept any system call (syscall) within the kernel space, among other functionalities. - -Additionally, KernelSU provides a module system via OverlayFS, which allows you to load your custom plugin into system. It also provides a mechanism to modify files in `/system` partition. - -## How to use KernelSU? - -Please refer: [Installation](installation) - -## How to build KernelSU? - -Please refer: [How to build](how-to-build) - -## Discussion - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/id_ID/guide/difference-with-magisk.md b/website/docs/id_ID/guide/difference-with-magisk.md deleted file mode 100644 index 5ab39466..00000000 --- a/website/docs/id_ID/guide/difference-with-magisk.md +++ /dev/null @@ -1,26 +0,0 @@ -# Perbedaan dengan Magisk - -Meskipun ada banyak kesamaan antara modul KernelSU dan modul Magisk, pasti ada beberapa perbedaan karena mekanisme implementasinya yang sangat berbeda. Jika Anda ingin modul Anda berjalan di Magisk dan KernelSU, Anda harus memahami perbedaan ini. - -## Kesamaan - -- Format file modul: keduanya menggunakan format zip untuk mengatur modul, dan format modulnya hampir sama -- Direktori pemasangan modul: keduanya terletak di `/data/adb/modules` -- Tanpa sistem: keduanya mendukung modifikasi / sistem dengan cara tanpa sistem melalui modul -- post-fs-data.sh: waktu eksekusi dan semantiknya persis sama -- service.sh: waktu eksekusi dan semantiknya persis sama -- system.prop: sepenuhnya sama -- sepolicy.rule: sama persis -- BusyBox: skrip dijalankan di BusyBox dengan "mode mandiri" diaktifkan di kedua kasus - -## Perbedaan - -Sebelum memahami perbedaannya, Anda perlu mengetahui cara membedakan apakah modul Anda berjalan di KernelSU atau Magisk. Anda dapat menggunakan variabel lingkungan `KSU` untuk membedakannya di semua tempat di mana Anda dapat menjalankan skrip modul (`customize.sh`, `post-fs-data.sh`, `service.sh`). Di KernelSU, variabel lingkungan ini akan disetel ke `true`. - -Berikut beberapa perbedaannya: - -- Modul KernelSU tidak dapat diinstal dalam mode Pemulihan. -- Modul KernelSU tidak memiliki dukungan bawaan untuk Zygisk (tetapi Anda dapat menggunakan modul Zygisk melalui [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). -- Metode untuk mengganti atau menghapus file dalam modul KernelSU sama sekali berbeda dari Magisk. KernelSU tidak mendukung metode `.replace`. Sebagai gantinya, Anda perlu membuat file dengan nama yang sama dengan `mknod filename c 0 0` untuk menghapus file terkait. -- Direktori untuk BusyBox berbeda. BusyBox bawaan di KernelSU terletak di `/data/adb/ksu/bin/busybox`, sedangkan di Magisk terletak di `/data/adb/magisk/busybox`. **Perhatikan bahwa ini adalah perilaku internal KernelSU dan dapat berubah di masa mendatang!** -- KernelSU tidak mendukung file `.replace`; namun, KernelSU mendukung variabel `REMOVE` dan `REPLACE` untuk menghapus atau mengganti file dan folder. diff --git a/website/docs/id_ID/guide/faq.md b/website/docs/id_ID/guide/faq.md deleted file mode 100644 index e54f8ba7..00000000 --- a/website/docs/id_ID/guide/faq.md +++ /dev/null @@ -1,48 +0,0 @@ -# FAQ - -## Apakah KernelSU mendukung perangkat saya? - -Pertama, perangkatmu harus bisa dibuka bootloadernya. Jika tiddak bisa, berarti tidak memungkinkan untuk bekerja. - -Lalu instal aplikasi KernelSU manager di dalam perangkatmu dan buka, jika terlihat `Unsupported` berarti perangkatmu tidak didukung dan tidak akan didukung di kemudian hari. - -## Apakah KernelSU membutuhkan buka-bootloader? - -Ya, seharusnya. - -## Apakah KernelSU mendukung modul? - -Ya, Tetapi masih dalam versi awal, bisa jadi ngebug. Mohon tunggu sampai semuanya stabil :) - -## Apakah KernelSU mendukung Xposed? - -Ya, [Dreamland](https://github.com/canyie/Dreamland) dan [TaiChi](https://taichi.cool) sekarang bekerja sebagian, Dan kita sedang mencoba untuk membuat Xposed Framework lainnya bekerja. - -## Apakah KernelSU kompatibel dengan Magisk? - -Sistem modul KernelSU bertentangan dengan magic mount Magisk, jika ada modul yang diaktifkan di KernelSU, maka seluruh Magisk tidak akan bekerja. - -Tetapi jika Anda hanya menggunakan `su` dari KernelSU, maka KernelSU akan bekerja dengan baik dengan Magisk: KernelSU memodifikasi `kernel` dan Magisk memodifikasi `ramdisk`, keduanya dapat bekerja bersama. - -## Akankah KernelSU menggantikan Magisk? - -Kami rasa tidak dan itu bukan tujuan kami. Magisk sudah cukup baik untuk solusi root userspace dan akan bertahan lama. Tujuan KernelSU adalah untuk menyediakan antarmuka kernel kepada pengguna, bukan untuk menggantikan Magisk. - -## Dapatkah KernelSU mendukung perangkat non GKI? - -Hal ini dimungkinkan. Tetapi Anda harus mengunduh sumber kernel dan mengintegrasikan KernelSU ke source tree dan mengkompilasi kernel sendiri. - -## Dapatkah KernelSU mendukung perangkat di bawah Android 12? - -Kernel perangkatlah yang mempengaruhi kompatibilitas KernelSU dan tidak ada hubungannya dengan versi Android, satu-satunya batasan adalah bahwa perangkat yang diluncurkan dengan Android 12 harus menggunakan kernel 5.10+ (perangkat GKI). Jadi: - -1. Perangkat yang diluncurkan dengan Android 12 harus didukung. -2. Perangkat dengan kernel lama (Beberapa perangkat Android 12 juga memiliki kernel lama) dapat dikompilasi (Anda harus membuat kernel sendiri) - -## Dapatkah KernelSU mendukung kernel lama? - -Ada kemungkinan, KernelSU sudah di-backport ke kernel 4.14 sekarang, untuk kernel yang lebih lama, Anda harus melakukan backport secara manual dan menyambut baik PR darimu! - -## Cara mengintegrasikan KernelSU untuk kernel lama? - -Silakan merujuk ke [guide](how-to-integrate-for-non-gki) diff --git a/website/docs/id_ID/guide/how-to-build.md b/website/docs/id_ID/guide/how-to-build.md deleted file mode 100644 index 945247e7..00000000 --- a/website/docs/id_ID/guide/how-to-build.md +++ /dev/null @@ -1,63 +0,0 @@ -# Bagaimana caranya untuk build KernelSU? - -Pertama, Anda harus membaca dokumen resmi Android untuk membangun kernel: - -1. [Building Kernels](https://source.android.com/docs/setup/build/building-kernels) -2. [GKI Release Builds](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -> Halaman ini untuk perangkat GKI, jika Anda menggunakan kernel lama, silakan lihat [cara mengintegrasikan KernelSU untuk kernel lama](how-to-integrate-for-non-gki) - -## Build Kernel - -### Menyinkronkan source code kernel - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -`` adalah berkas manifes yang dapat menentukan build secara unik, Anda dapat menggunakan manifes tersebut untuk melakukan build yang dapat diprediksikan ulang. Anda harus mengunduh berkas manifes dari [Google GKI release builds](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -### Build - -Silakan periksa [official docs](https://source.android.com/docs/setup/build/building-kernels) terlebih dahulu. - -Sebagai contoh, kita perlu build image kernel aarch64: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` - -Jangan lupa untuk menambahkan flag `LTO=thin`, jika tidak, maka build akan gagal jika memori komputer Anda kurang dari 24GB. - -Mulai dari Android 13, kernel dibuild oleh `bazel`: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` - -## Build Kernel dengan KernelSU - -Jika Anda dapat build kernel dengan sukses, maka build KernelSU sangatlah mudah, jalankan perintah ini di root dir kernel source: - -- Latest tag(stable) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -- main branch(dev) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -- Select tag(Such as v0.5.2) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -Dan kemudian build ulang kernel dan Anda akan mendapatkan image kernel dengan KernelSU! diff --git a/website/docs/id_ID/guide/how-to-integrate-for-non-gki.md b/website/docs/id_ID/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index d26d3c62..00000000 --- a/website/docs/id_ID/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,249 +0,0 @@ -# Bagaimana Caranya untuk mengintegrasikan KernelSU ke kernel non GKI? - -KernelSU dapat diintegrasikan ke kernel non GKI, dan saat ini sudah di-backport ke 4.14, dan juga dapat dijalankan pada kernel di bawah 4.14. - -Karena fragmentasi kernel non GKI, kami tidak memiliki cara yang seragam untuk membangunnya, sehingga kami tidak dapat menyediakan gambar boot non GKI. Tetapi Anda dapat membangun kernel sendiri dengan KernelSU yang terintegrasi. - -Pertama, Anda harus dapat membangun kernel yang dapat di-boot dari kode sumber kernel, jika kernel tersebut tidak open source, maka akan sulit untuk menjalankan KernelSU untuk perangkat Anda. - -Jika Anda dapat membuat kernel yang dapat di-booting, ada dua cara untuk mengintegrasikan KernelSU ke kode sumber kernel: - -1. Secara otomatis dengan `kprobe` -2. Secara manual - -## Integrasikan dengan kprobe - -KernelSU menggunakan kprobe untuk melakukan hook kernel, jika *kprobe* berjalan dengan baik pada kernel Anda, maka disarankan untuk menggunakan cara ini. - -Pertama, tambahkan KernelSU ke dalam berkas kernel source tree: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -:::info -[KernelSU 1.0 dan versi yang lebih baru tidak lagi mendukung kernel non-GKI](https://github.com/tiann/KernelSU/issues/1705). Versi terakhir yang didukung adalah `v0.9.5`, pastikan untuk menggunakan versi yang benar. -::: - -Kemudian, Anda harus memeriksa apakah *kprobe* diaktifkan dalam konfigurasi kernel Anda, jika tidak, tambahkan konfigurasi ini ke dalamnya: - -``` -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` - -Dan build kernel Anda lagi, KernelSU seharusnya bekerja dengan baik. - -Jika Anda menemukan bahwa KPROBES masih belum diaktifkan, Anda dapat mencoba mengaktifkan `CONFIG_MODULES`. (Jika masih belum berlaku, gunakan `make menuconfig` untuk mencari ketergantungan KPROBES yang lain) - -etapi jika Anda mengalami boot loop saat mengintegrasikan KernelSU, itu mungkin *kprobe rusak di kernel Anda*, Anda harus memperbaiki bug kprobe atau menggunakan cara kedua. - -## Memodifikasi sumber kernel secara manual - -Jika kprobe tidak dapat bekerja pada kernel Anda (mungkin karena bug di upstream atau kernel di bawah 4.8), maka Anda dapat mencoba cara ini: - -Pertama, tambahkan KernelSU ke dalam direktori kernel source tree: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -Kemudian, tambahkan panggilan KernelSU ke source kernel, berikut ini adalah patch yang dapat dirujuk: - -```diff -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; - -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; - -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+ - /** - * vfs_statx - Get basic and extra attributes by filename - * @dfd: A file descriptor representing the base dir for a relative filename -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ ksu_handle_stat(&dfd, &filename, &flags); - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` - -Anda harus menemukan empat fungsi dalam kernel source: - -1. do_faccessat, usually in `fs/open.c` -2. do_execveat_common, usually in `fs/exec.c` -3. vfs_read, usually in `fs/read_write.c` -4. vfs_statx, usually in `fs/stat.c` - -Jika kernel anda tidak memiliki `vfs_statx`, maka gunakan `vfs_fstatat` alih-alih: - -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 068fdbcc9e26..5348b7bb9db2 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -87,6 +87,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) - } - EXPORT_SYMBOL(vfs_fstat); - -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+ - int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int flag) - { -@@ -94,6 +96,8 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int error = -EINVAL; - unsigned int lookup_flags = 0; - -+ ksu_handle_stat(&dfd, &filename, &flag); -+ - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH)) != 0) - goto out; -``` - -Untuk kernel lebih awal dari 4.17, jika anda menemukan `do_faccessat`, hanya pergi ke definisi yang sama `faccessat` syscall dan tempatkan pemanggil di sini: - -```diff -diff --git a/fs/open.c b/fs/open.c -index 2ff887661237..e758d7db7663 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -355,6 +355,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return error; - } - -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+ - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -370,6 +373,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; - -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` - -To enable KernelSU's builtin SafeMode, You should also modify `input_handle_event` in `drivers/input/input.c`: - -:::tip -Fitur ini sangat direkomendasikan, serta sangat membantu untuk memulihkan pada saat bootloop! -::: - -```diff -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 45306f9ef247..815091ebfca4 100755 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -367,10 +367,13 @@ static int input_get_disposition(struct input_dev *dev, - return disposition; - } - -+extern bool ksu_input_hook __read_mostly; -+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value); -+ - static void input_handle_event(struct input_dev *dev, - unsigned int type, unsigned int code, int value) - { - int disposition = input_get_disposition(dev, type, code, &value); -+ -+ if (unlikely(ksu_input_hook)) -+ ksu_handle_input_handle_event(&type, &code, &value); - - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - add_input_randomness(type, code, value); -``` - -Terakhir, edit `KernelSU/kernel/ksu.c` dan beri komentar pada `enable_sucompat()` lalu build kernel Anda lagi, KernelSU akan bekerja dengan baik. diff --git a/website/docs/id_ID/guide/installation.md b/website/docs/id_ID/guide/installation.md deleted file mode 100644 index 12de5267..00000000 --- a/website/docs/id_ID/guide/installation.md +++ /dev/null @@ -1,32 +0,0 @@ -# Instalasi - -## Periksa apakah perangkat Anda didukung - -Unduh aplikasi manajer KernelSU dari [github releases](https://github.com/tiann/KernelSU/releases), lalu instal aplikasi ke perangkat dan buka aplikasi: - -- Jika aplikasi menunjukkan `Unsupported`, itu berarti **Anda harus mengkompilasi kernel sendiri**, KernelSU tidak akan dan tidak pernah menyediakan boot image untuk Anda flash. -- Jika aplikasi menunjukkan `Not installed`, maka perangkat Anda secara resmi didukung oleh KernelSU. - -## Temukan boot.img yang tepat - -KernelSU menyediakan boot.img umum untuk perangkat GKI, Anda harus mem-flash boot.img ke partisi boot perangkat Anda. - -Anda dapat mengunduh boot.img dari [github actions for kernel] (https://github.com/tiann/KernelSU/actions/workflows/build-kernel.yml), perlu diketahui bahwa Anda harus menggunakan versi boot.img yang tepat. Sebagai contoh, jika perangkat Anda menunjukkan bahwa kernelnya adalah `5.10.101`, maka Anda harus mengunduh `5.10.101-xxxx.boot.xxx`. - -Dan juga, silakan periksa format boot.img Anda, Anda harus menggunakan format yang tepat, seperti `lz4`、`gz`. - -## Flash boot.img ke perangkat - -Hubungkan perangkat Anda dengan `adb` lalu jalankan `adb reboot bootloader` untuk masuk ke mode fastboot, lalu gunakan perintah ini untuk mem-flash KernelSU: - -```sh -fastboot flash boot boot.img -``` - -## Reboot - -Ketika di-flash, Anda harus menyalakan ulang perangkat Anda: - -```sh -fastboot reboot -``` diff --git a/website/docs/id_ID/guide/module.md b/website/docs/id_ID/guide/module.md deleted file mode 100644 index 6b373309..00000000 --- a/website/docs/id_ID/guide/module.md +++ /dev/null @@ -1,255 +0,0 @@ -# Panduan module - -KernelSU menyediakan mekanisme modul yang mencapai efek memodifikasi direktori sistem dengan tetap menjaga integritas partisi sistem. Mekanisme ini umumnya dikenal sebagai "tanpa sistem". - -Mekanisme modul KernelSU hampir sama dengan Magisk. Jika Anda terbiasa dengan pengembangan modul Magisk, mengembangkan modul KernelSU sangat mirip. Anda dapat melewati pengenalan modul di bawah ini dan hanya perlu membaca [difference-with-magisk](difference-with-magisk.md). - -## Busybox - -KernelSU dikirimkan dengan fitur biner BusyBox yang lengkap (termasuk dukungan penuh SELinux). Eksekusi terletak di `/data/adb/ksu/bin/busybox`. BusyBox KernelSU mendukung "Mode Shell Standalone Shell" yang dapat dialihkan waktu proses. Apa yang dimaksud dengan mode mandiri ini adalah bahwa ketika dijalankan di shell `ash` dari BusyBox, setiap perintah akan langsung menggunakan applet di dalam BusyBox, terlepas dari apa yang ditetapkan sebagai `PATH`. Misalnya, perintah seperti `ls`, `rm`, `chmod` **TIDAK** akan menggunakan apa yang ada di `PATH` (dalam kasus Android secara default akan menjadi `/system/bin/ls`, ` /system/bin/rm`, dan `/system/bin/chmod` masing-masing), tetapi akan langsung memanggil applet BusyBox internal. Ini memastikan bahwa skrip selalu berjalan di lingkungan yang dapat diprediksi dan selalu memiliki rangkaian perintah lengkap, apa pun versi Android yang menjalankannya. Untuk memaksa perintah _not_ menggunakan BusyBox, Anda harus memanggil yang dapat dieksekusi dengan path lengkap. - -Setiap skrip shell tunggal yang berjalan dalam konteks KernelSU akan dieksekusi di shell `ash` BusyBox dengan mode mandiri diaktifkan. Untuk apa yang relevan dengan pengembang pihak ke-3, ini termasuk semua skrip boot dan skrip instalasi modul. - -Bagi yang ingin menggunakan fitur “Standalone Mode” ini di luar KernelSU, ada 2 cara untuk mengaktifkannya: - -1. Tetapkan variabel lingkungan `ASH_STANDALONE` ke `1`
Contoh: `ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
PengelolaRepositoryPerangkat yang didukung
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
diff --git a/website/docs/id_ID/guide/what-is-kernelsu.md b/website/docs/id_ID/guide/what-is-kernelsu.md deleted file mode 100644 index 7ff8f575..00000000 --- a/website/docs/id_ID/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# Apa itu KernelSU? - -KernelSU adalah solusi root untuk perangkat GKI Android, ia bekerja dalam mode kernel dan memberikan izin root ke aplikasi userspace secara langsung di ruang kernel. - -## Fitur - -Fitur utama dari KernelSU adalah **berbasis kernel**. KernelSU bekerja dalam mode kernel, sehingga dapat menyediakan antarmuka kernel yang belum pernah kita miliki sebelumnya. Sebagai contoh, kita dapat menambahkan breakpoint perangkat keras ke proses apa pun dalam mode kernel; Kita dapat mengakses memori fisik dari proses apa pun tanpa diketahui oleh siapa pun; Kita dapat mencegat syscall apa pun di ruang kernel; dll. - -Dan juga, KernelSU menyediakan sistem modul melalui overlayfs, yang memungkinkan Anda untuk memuat plugin kustom Anda ke dalam sistem. KernelSU juga menyediakan mekanisme untuk memodifikasi berkas-berkas pada partisi `/system`. - -## Bagaimana cara menggunakannya - -Silakan merujuk ke: [Installation](installation) - -## Bagaimana cara men-buildnya - -[How to build](how-to-build) - -## Diskusi - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/id_ID/index.md b/website/docs/id_ID/index.md deleted file mode 100644 index 511197c6..00000000 --- a/website/docs/id_ID/index.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: home -title: Sebuah solusi root kernel-based untuk Android - -hero: - name: KernelSU - text: Sebuah solusi root kernel-based untuk Android - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: Permulaan - link: /id_ID/guide/what-is-kernelsu - - theme: alt - text: Lihat di GitHub - link: https://github.com/tiann/KernelSU - -features: - - title: Kernel-based - details: KernelSU bekerja dalam mode Linux kernel, dan mempunyai kelebihan diatas aplikasi userspace. - - title: Kontrol akses daftar putih - details: Hanya aplikasi yang diberikan izin root yang bisa mengakses `su`, aplikasi lain tidak bisa mengakses su. - - title: Dukungan modul - details: KernelSU mendukung modifikasi /system tanpa-sistem dalam overlayfs, bahkan bisa membuat system dapat ditulis. - - title: Sumber terbuka - details: KernelSU adalah projek sumber terbuka dibawah lisensi GPL-3. diff --git a/website/docs/index.md b/website/docs/index.md deleted file mode 100644 index 6f99424f..00000000 --- a/website/docs/index.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: home -title: Home - -hero: - name: KernelSU - text: A kernel-based root solution for Android - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: Get started - link: /guide/what-is-kernelsu - - theme: alt - text: View on GitHub - link: https://github.com/tiann/KernelSU - -features: - - title: Kernel-based - details: As the name suggests, KernelSU works under the Linux kernel giving it more control over userspace apps. - - title: Root access control - details: Only permitted apps may access or see su, all other apps aren't aware of this. - - title: Customizable root privileges - details: KernelSU allows customization of su's uid, gid, groups, capabilities, and SELinux rules, locking up root privileges. - - title: Modules - details: Modules may modify /system systemlessly using OverlayFS providing significant flexibility. diff --git a/website/docs/ja_JP/guide/difference-with-magisk.md b/website/docs/ja_JP/guide/difference-with-magisk.md deleted file mode 100644 index 19ec7390..00000000 --- a/website/docs/ja_JP/guide/difference-with-magisk.md +++ /dev/null @@ -1,26 +0,0 @@ -# Magisk との違い - -KernelSU モジュールと Magisk モジュールには多くの共通点がありますが、実装の仕組みが全く異なるため、必然的にいくつかの相違点が存在します。Magisk と KernelSU の両方でモジュールを動作させたい場合、これらの違いを理解する必要があります。 - -## 似ているところ - -- モジュールファイルの形式:どちらもzip形式でモジュールを整理しており、モジュールの形式はほぼ同じです。 -- モジュールのインストールディレクトリ:どちらも `/data/adb/modules` に配置されます。 -- システムレス:どちらもモジュールによるシステムレスな方法で /system を変更できます。 -- post-fs-data.sh: 実行時間と意味は全く同じです。 -- service.sh: 実行時間と意味は全く同じです。 -- system.prop:全く同じです。 -- sepolicy.rule:全く同じです。 -- BusyBox:スクリプトは BusyBox で実行され、どちらの場合も「スタンドアロンモード」が有効です。 - -## 違うところ - -違いを理解する前に、モジュールが KernelSU で動作しているか Magisk で動作しているかを区別する方法を知っておく必要があります。環境変数 `KSU` を使うとモジュールスクリプトを実行できるすべての場所 (`customize.sh`, `post-fs-data.sh`, `service.sh`) で区別できます。KernelSU では、この環境変数に `true` が設定されます。 - -以下は違いです: - -- KernelSU モジュールは、リカバリーモードではインストールできません。 -- KernelSU モジュールには Zygisk のサポートが組み込まれていません(ただし[ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext)を使うと Zygisk モジュールを使用できます)。 -- KernelSU モジュールにおけるファイルの置換や削除の方法は、Magisk とは全く異なります。KernelSU は `.replace` メソッドをサポートしていません。その代わり、`mknod filename c 0 0` で同名のファイルを作成し、対応するファイルを削除する必要があります。 -- BusyBox 用のディレクトリが違います。KernelSU の組み込み BusyBox は `/data/adb/ksu/bin/busybox` に、Magisk では `/data/adb/magisk/busybox` に配置されます。**これは KernelSU の内部動作であり、将来的に変更される可能性があることに注意してください!** -- KernelSU は `.replace` ファイルをサポートしていません。しかし、KernelSU はファイルやフォルダを削除したり置き換えたりするための `REMOVE` と `REPLACE` 変数をサポートしています。 diff --git a/website/docs/ja_JP/guide/faq.md b/website/docs/ja_JP/guide/faq.md deleted file mode 100644 index 397a322d..00000000 --- a/website/docs/ja_JP/guide/faq.md +++ /dev/null @@ -1,67 +0,0 @@ -# よくある質問 - -## 私のデバイスは KernelSU に対応していますか? - -まず、お使いのデバイスがブートローダーのロックを解除できる必要があります。もしできないのであれば、サポート外です。 - -もし KernelSU アプリで「非対応」と表示されたら、そのデバイスは最初からサポートされていないことになりますが、カーネルソースをビルドして KernelSU を組み込むか、[非公式の対応デバイス](unofficially-support-devices)で動作させることが可能です。 - -## KernelSU を使うにはブートローダーのロックを解除する必要がありますか? - -はい。 - -## KernelSU はモジュールに対応していますか? - -はい。ただし初期バージョンであるためバグがある可能性があります。安定するのをお待ちください。 - -## KernelSU は Xposed に対応していますか? - -はい。[Dreamland](https://github.com/canyie/Dreamland) や [TaiChi](https://taichi.cool) が動作します。LSPosed については、[ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) を使うと動作するようにできます。 - -## KernelSU は Zygisk に対応していますか? - -KernelSU は Zygisk サポートを内蔵していません。[ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) を使ってください。 - -## KernelSU は Magisk と互換性がありますか? - -KernelSU のモジュールシステムは Magisk のマジックマウントと競合しており、KernelSU で有効になっているモジュールがある場合、Magisk 全体が動作しなくなります。 - -しかし、KernelSU の `su` だけを使うのであれば、Magisk とうまく連携することができます。KernelSU は `kernel` を、Magisk は `ramdisk` を修正するため、両者は共存できます。 - -## KernelSU は Magisk の代わりになりますか? - -私たちはそうは思っていませんし、それが目標でもありません。Magisk はユーザ空間の root ソリューションとして十分であり、長く使われ続けるでしょう。KernelSU の目標は、ユーザーにカーネルインターフェースを提供することであり、Magisk の代用ではありません。 - -## KernelSU は GKI 以外のデバイスに対応できますか? - -可能です。ただしカーネルソースをダウンロードし、KernelSU をソースツリーに統合して、自分でカーネルをビルドする必要があります。 - -## KernelSU は Android 12 以下のデバイスに対応できますか? - -KernelSU の互換性に影響を与えるのはデバイスのカーネルであり、Android のバージョンとは無関係です。唯一の制限は、Android 12 で発売されたデバイスはカーネル5.10以上(GKI デバイス)でなければならないことです: - -1. Android 12 をプリインストールして発売された端末は対応しているはずです。 -2. カーネルが古い端末(一部の Android 12 端末はカーネルも古い)は対応可能ですが、カーネルは自分でビルドする必要があります。 - -## KernelSU は古いカーネルに対応できますか? - -KernelSU は現在カーネル4.14にバックポートされていますが、それ以前のカーネルについては手動でバックポートする必要があります。プルリクエスト歓迎です! - -## 古いカーネルに KernelSU を組み込むには? - -[ガイド](../../guide/how-to-integrate-for-non-gki) を参考にしてください。 - -## Android のバージョンが13なのに、カーネルは「android12-5.10」と表示されるのはなぜ? - -カーネルのバージョンは Android のバージョンと関係ありません。カーネルを書き込む必要がある場合は、常にカーネルのバージョンを使用してください。Android のバージョンはそれほど重要ではありません。 - -## KernelSU に-mount-master/global のマウント名前空間はありますか? - -今はまだありませんが(将来的にはあるかもしれません)、グローバルマウントの名前空間に手動で切り替える方法は、以下のようにたくさんあります: - -1. `nsenter -t 1 -m sh` でシェルをグローバル名前空間にします。 -2. `nsenter --mount=/proc/1/ns/mnt` を実行したいコマンドに追加すればグローバル名前空間で実行されます。 KernelSU は [このような使い方](https://github.com/tiann/KernelSU/blob/77056a710073d7a5f7ee38f9e77c9fd0b3256576/manager/app/src/main/java/shirkneko/zako/mksu/ui/util/KsuCli.kt#L115) もできます。 - -## GKI 1.0 なのですが、使えますか? - -GKI1 は GKI2 と全く異なるため、カーネルは自分でビルドする必要があります。 diff --git a/website/docs/ja_JP/guide/hidden-features.md b/website/docs/ja_JP/guide/hidden-features.md deleted file mode 100644 index 29e4b0db..00000000 --- a/website/docs/ja_JP/guide/hidden-features.md +++ /dev/null @@ -1,7 +0,0 @@ -# 隠し機能 - -## .ksurc - -デフォルトでは `/system/bin/sh` は `/system/etc/mkshrc` を読み込みます。 - -`/data/adb/ksu/.ksurc` ファイルを作成することで、カスタマイズした rc ファイルを su に読み込ませられます。 \ No newline at end of file diff --git a/website/docs/ja_JP/guide/how-to-build.md b/website/docs/ja_JP/guide/how-to-build.md deleted file mode 100644 index b4d05513..00000000 --- a/website/docs/ja_JP/guide/how-to-build.md +++ /dev/null @@ -1,58 +0,0 @@ -# KernelSU のビルド方法は? - -まず、Android の公式ドキュメントを読むべきです: - -1. [カーネルをビルドする](https://source.android.com/docs/setup/build/building-kernels) -2. [GKI リリースビルド](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -::: 警告 -このページは GKI デバイス用です。もし古いカーネルを使用している場合は、[古いカーネルへの KernelSU の統合方法](how-to-integrate-for-non-gki)を参照してください。 -::: - -## カーネルビルド - -### カーネルソースコードの同期 - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -`` は、ビルドを一意に決定するマニフェストファイルです。マニフェストを使用して再現可能なビルドを行えます。マニフェストファイルは [Google GKI リリースビルド](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) からダウンロードしてください。 - -### ビルド - -まずは [公式ドキュメント](https://source.android.com/docs/setup/build/building-kernels)を確認してください。 - -たとえば、aarch64 カーネルイメージをビルドする必要があります: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` -`LTO=thin` フラグを追加するのを忘れないでください。それをしないと、コンピュータのメモリが 24Gb 未満の場合にビルドに失敗する可能性があります。 - -Android 13 からは、カーネルは `bazel` によってビルドされます: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` -## KernelSU を使ったカーネルビルド - -もしカーネルを正常にビルドできた場合、KernelSU をビルドするのは簡単です。カーネルソースのルートディレクトリで任意のものを選択して実行します: - -::: code-group -```sh[最新タグ(安定版)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` -```sh[ main ブランチ (開発用)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` -```sh[タグを選択 (例:v0.5.2)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -::: - -その後でカーネルを再ビルドすると、KernelSU が組み込まれたカーネルイメージが得られます! diff --git a/website/docs/ja_JP/guide/how-to-integrate-for-non-gki.md b/website/docs/ja_JP/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index 6e8110f1..00000000 --- a/website/docs/ja_JP/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,303 +0,0 @@ -# 非 GKI カーネルで KernelSU を統合する方法は? - -KernelSU は非 GKI カーネルに統合することが可能であり、4.14 以下のバージョンにバックポートされました。 - -非 GKI カーネルの断片化のため、統一されたビルド方法がありませんので、非 GKI ブートイメージを提供することができません。しかし、KernelSU を統合して自分自身でカーネルをビルドすることができます。 - -まず、カーネルソースコードからブート可能なカーネルをビルドできる能力が必要です。もしカーネルがオープンソースでない場合、あなたのデバイスで KernelSU を実行することは困難です。 - -ブート可能なカーネルをビルドできるなら、カーネルソースコードに KernelSU を統合する方法は二つあります: - -1. `kprobe` で自動的に -2. 手動で - -## kprobe で統合する - -KernelSU は kprobe を使ってカーネルフックを行います。もし *kprobe* があなたのカーネルでうまく動作する場合、この方法を使うことを推奨します。 - -まず、KernelSU をカーネルソースツリーに追加してください: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -次に、*kprobe* がカーネル設定で有効になっているか確認してください。もし有効でなければ、これらの設定を追加してください: - -``` -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` -そしてカーネルを再度ビルドしてください。KernelSU はうまく動作するはずです。 - -KPROBES がまだ有効化されていない場合は、CONFIG_MODULES を有効化して試みることができます。(それでも効果がない場合は、make menuconfig を使って KPROBES の他の依存関係を検索してください) - -しかし、KernelSU を統合した際にブートループに遭遇した場合、それは *kprobe* があなたのカーネルで破損している可能性があります。kprobe のバグを修正するか、二番目の方法を使用するべきです。 - -:::tip kprobe が破損しているかどうかを確認する方法は? - -`KernelSU/kernel/ksu.c` にある `ksu_enable_sucompat()` と `ksu_enable_ksud()` をコメントアウトし、デバイスが正常にブートするか試してください。もし正常にブートするならば、kprobe が破損している可能性があります。 - -## カーネルソースを手動で変更する - -もし kprobe があなたのカーネルで機能しない場合(上流のバグや 4.8 以下のカーネルバグが原因かもしれません)、以下の方法を試すことができます。 - -まず、KernelSU をカーネルソースツリーに追加してください: - -::: code-group -## カーネルソースを手動で変更する - -もし kprobe があなたのカーネルで機能しない場合(上流のバグや 4.8 以下のカーネルバグが原因かもしれません)、以下の方法を試すことができます。 - -まず、KernelSU をカーネルソースツリーに追加してください: - -::: code-group - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -[ main branch(dev)] -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -[Select tag(Such as v0.5.2)] -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - - -::: - -いくつかのデバイスでは、あなたの defconfig が `arch/arm64/configs` にあったり、または他のケースでは `arch/arm64/configs/vendor/your_defconfig` にあることを念頭に置いてください。例えばあなたの defconfig で、`CONFIG_KSU` を y で有効に、または n で無効に設定します。あなたのパスは次のようになるでしょう: -`arch/arm64/configs/...` -``` -# KernelSU -CONFIG_KSU=y -``` -次に、KernelSU の呼び出しをカーネルソースに追加します。こちらは参照のためのパッチです: - -::: code-group - -```diff[exec.c] -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); -+#endif - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); -+ #endif - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff[open.c] -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff[read_write.c] -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+#ifdef CONFIG_KSU -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); -+#endif - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ #endif -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff[stat.c] -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif -+ - /** - * vfs_statx - Get basic and extra attributes by filename - * @dfd: A file descriptor representing the base dir for a relative filename -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flags); -+ #endif - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` -カーネル ソースには 4 つの関数があるはずです。 - -1. do_faccessat、通常は `fs/open.c` にあります -2. do_execveat_common (通常は `fs/exec.c` にあります) -3. vfs_read (通常は `fs/read_write.c` にあります) -4. vfs_statx (通常は「fs/stat.c」にあります) - -カーネルに `vfs_statx` がない場合は、代わりに `vfs_fstatat` を使用してください: - -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 068fdbcc9e26..5348b7bb9db2 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -87,6 +87,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) - } - EXPORT_SYMBOL(vfs_fstat); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif - int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int flag) - { -@@ -94,6 +96,8 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int error = -EINVAL; - unsigned int lookup_flags = 0; -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flag); -+ #endif -+ - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH)) != 0) - goto out; -``` - -4.17 より前のカーネルの場合、`do faccessat` が見つからない場合は、`faccessat` システムコールの定義に移動して、そこで呼び出しを実行します。 - -```diff -diff --git a/fs/open.c b/fs/open.c -index 2ff887661237..e758d7db7663 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -355,6 +355,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return error; - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif -+ - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -370,6 +373,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif -+ - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` - -KernelSU の組み込み SafeMode を有効にするには、`drivers/input/input.c` の `input_handle_event` も変更する必要があります。 - -:::ヒント -この機能を有効にすることを強くお勧めします。ブートループを防ぐのに非常に役立ちます! -::: - -```diff -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 45306f9ef247..815091ebfca4 100755 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -367,10 +367,13 @@ static int input_get_disposition(struct input_dev *dev, - return disposition; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_input_hook __read_mostly; -+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value); -+#endif -+ - static void input_handle_event(struct input_dev *dev, - unsigned int type, unsigned int code, int value) - { - int disposition = input_get_disposition(dev, type, code, &value); -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_input_hook)) -+ ksu_handle_input_handle_event(&type, &code, &value); -+ #endif - - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - add_input_randomness(type, code, value); -``` - -最後に、カーネルを再度ビルドすると、KernelSU が正常に動作するはずです。 - -:::info 誤ってセーフ モードに入ってしまった場合は、 -手動統合を使用し、`CONFIG_KPROBES` を無効にしない場合、ユーザーは起動後に音量を下げるボタンを押してセーフ モードをトリガーする可能性があります。 したがって、手動統合を使用する場合は、`CONFIG_KPROBES` を無効にする必要があります。 -::: diff --git a/website/docs/ja_JP/guide/installation.md b/website/docs/ja_JP/guide/installation.md deleted file mode 100644 index 53bb7c78..00000000 --- a/website/docs/ja_JP/guide/installation.md +++ /dev/null @@ -1,274 +0,0 @@ -# インストール - -## デバイスが対応しているか確認する - -[GitHub Releases](https://github.com/tiann/KernelSU/releases) から KernelSU Manager アプリをダウンロードし、お使いのデバイスにインストールしてください。 - -- アプリが「非対応」と表示した場合は、**自分でカーネルをコンパイルする必要がある**という意味です。KernelSU は書き込むためのブートイメージを提供しません。 -- アプリが「未インストール」と表示した場合、お使いのデバイスは KernelSU に対応しています。 - -::: info ヒント -非対応と表示されているデバイスについては、[非公式の対応デバイス](unofficially-support-devices.md)であればご自身でカーネルをビルドできます。 -::: - -## 純正の boot.img をバックアップ - -書き込む前に、まず純正の boot.img をバックアップする必要があります。ブートループが発生した場合は、fastboot を使用して純正のブートイメージを書き込むことでいつでもシステムを復旧できます。 - -::: warning 警告 -書き込みによりデータ損失を引き起こす可能性があります。次のステップに進む前に、このステップを必ず行うようにしてください!また、可能であればすべてのデータをバックアップしてください。 -::: - -## 必要な知識 - -### ADB と fastboot - -このチュートリアルでは、デフォルトで ADB と fastboot のツールを使用します。ご存じない方は、まず検索エンジンを使って勉強されることをおすすめします。 - -### KMI - -同じ Kernel Module Interface (KMI) のカーネルバージョンは**互換性があります**。これが GKI の「汎用」という意味です。逆に言えば KMI が異なればカーネルには互換性がなく、お使いのデバイスと異なる KMI のカーネルイメージを書き込むと、ブートループが発生する場合があります。 - -具体的には GKI デバイスの場合、カーネルバージョンの形式は以下のようになります: - -```txt -KernelRelease := -Version.PatchLevel.SubLevel-AndroidRelease-KmiGeneration-suffix -w .x .y -zzz -k -something -``` - -`w.x-zzz-k` は KMI のバージョンです。例えば、デバイスのカーネルバージョンが `5.10.101-android12-9-g30979850fc20` である場合、その KMIは `5.10-android12-9` であり、理論的には他の KMI カーネルでも正常に起動できます。 - -::: tip ヒント -カーネルバージョンの SubLevel は、KMI の一部ではないことに注意してください。`5.10.101-android12-9-g30979850fc20` は `5.10.137-android12-9-g30979850fc20` と同じ KMI を持っているということになります。 -::: - -### セキュリティパッチレベル {#security-patch-level} - -新しめの Android 端末には、セキュリティパッチレベルが古い boot イメージのフラッシュを許可しないロールバック防止機構が導入されていることがあります。例えば、もしあなたの端末のカーネルが `5.10.101-android12-9-g30979850fc20` であれば、セキュリティパッチレベルは `2023-11` です。たとえ KMI に対応するカーネルをフラッシュしても、セキュリティパッチレベルが (`2023-06` のように) `2023-11` より低い場合、ブートループを起こす可能性があります。 - -### Kernel バージョンと Android バージョンの違い - -注意: **カーネルバージョンと Android バージョンは必ずしも同じではありません**。 - -カーネルのバージョンは「android12-5.10.101」なのに、Android システムのバージョンは「Android 13」などとなっている場合、驚かないでください。Linux カーネルのバージョン番号は、必ずしも**デバイスの出荷時**にプリインストールされている Android システムのバージョンと一致していません。Android システムが後でアップグレードされた場合、一般的にはカーネルのバージョンは変更されません。書き込む際は、**必ずカーネルバージョンを参照してください**!!! - -## はじめに - -バージョン [0.9.0](https://github.com/tiann/KernelSU/releases/tag/v0.9.0) 以降、KernelSU は GKI 端末において 2 つの動作モードに対応しています。 - -1. `GKI`: 端末本来のカーネルを KernelSU によって提供される **汎用カーネルイメージ** (GKI) で置き換えます。 -2. `LKM`: 端末本来のカーネルを置き換えずに、カーネルに **ローダブルカーネルモジュール** (LKM) を読み込みます。 - -これらの 2 つのモードはそれぞれ異なる状況に適しており、必要に応じてどちらかを選ぶことができます。 - -### GKI モード {#gki-mode} - -GKI モードでは、端末本来のカーネルは KernelSU によって提供される汎用カーネルイメージによって置き換えられます。GKI モードの利点は: - -1. 強い汎用性があり、大部分の端末に適合。例えば、Samsung 端末は KNOX が有効であり、LKM モードは動作できません。また、GKI モードしか使えないニッチな改造を施された端末もあります。 -2. 公式ファームウェアに依存せずに使うことができます。KMI が一致している限り、公式ファームウェアの更新を待つことなく使うことができます。 - -### LKM モード {#lkm-mode} - -LKM モードでは、端末本来のカーネルを置き換えずに、カーネルにローダブルカーネルモジュールを読み込みます。LKM モードの利点は: - -1. 端末本来のカーネルを置き換えません。端末本来のカーネルに特別な要件がある場合や、KernelSU をサードパーティのカーネルと両用したい場合、LKM モードを利用できます。 -2. アップグレードと OTA がより便利です。KernelSU をアップデートする時は、手動でフラッシュすることなくマネージャーから直接インストールできます。システム OTA の後は、手動でフラッシュすることなく非アクティブなスロットに直接インストールすることができます。 -3. いくつかの特殊な状況に適しています。例えば、LKM は一時的な Root 権限を用いて読み込むことができます。boot パーティションを置き換えないので、AVB を動作させず、端末を文鎮化しません。 -4. LKM は一時的にアンインストールすることができます。一時的に root アクセスを無効化したい場合、LKM をアンインストールすることができます。この過程でパーティションをフラッシュすることも、また再起動することさえも必要ありません。root アクセスを再度有効化したい場合は、再起動するだけです。 - -:::tip 2 つのモードの共存 -マネージャーを開くと、ホームで現在の端末の動作モードを確認できます。GKI モードの優先度は LKM モードより高いことに留意してください。例えば、本来のカーネルを GKI カーネルで置き換えたうえで LKM を使って GKI カーネルにパッチしている場合、LKM は無視され、端末は常時 GKI モードで動作します。 -::: - -### どちらを選ぶべきですか? {#which-one} - -端末が携帯電話の場合、LKM モードを優先することを推奨します。端末がエミュレーター、WSA、または Waydroid の場合、GKI モードを優先することを推奨します。 - -## LKM モードのインストール - -### 公式ファームウェアの入手 - -LKM モードを使うためには、公式ファームウェアを入手し、それを基にパッチを当てる必要があります。サードパーティのカーネルを使う場合、その `boot.img` を公式ファームウェアとして利用できます。 - -公式ファームウェアを入手する方法はたくさんあります。端末が `fastboot boot` に対応している場合、`fastboot boot` を使って一時的に KernelSU が提供する GKI カーネルを起動する、 **最も推奨される、最も簡単な** 方法を推奨します。 - -端末が `fastboot boot` に対応していない場合、公式ファームウェアのパッケージを手動でダウンロードし、そこから `boot.img` を展開する必要があります。 - -GKI モードとは異なり、LKM モードは `ramdisk` を展開します。そのため、Android 13 の端末では `boot` パーティションの代わりに `init_boot` パーティションにパッチを当てる必要があります。一方で、GKI モードは常に `boot` パーティションを操作します。 - -### マネージャーを使う - -マネージャーを開き、右上のインストールアイコンをタップすると、いくつかのオプションが現れます: - -1. ファイルを選択しパッチを当てる。端末が Root 権限を持っていない場合、このオプションを選択し、公式ファームウェアを選択すると、マネージャーが自動的にパッチを当てます。恒久的に Root 権限を獲得するには、パッチが当てられたファイルをフラッシュするだけです。 -2. 直接インストール。端末が既に Root 化されている場合、このオプションを選択すると、マネージャーが自動的に端末の情報を取得し、自動的に公式ファームウェアにパッチを当て、それをフラッシュします。`fastboot boot` で KernelSU の GKI を起動し一時的に Root 権限を獲得したうえでこのオプションを利用することもできます。これは KernelSU をアップグレードする主な方法でもあります。 -3. 非アクティブなスロットにインストール。端末が A/B パーティションに対応している場合、このオプションを選択すると、マネージャーが自動的に公式ファームウェアにパッチを当て、もう一方のパーティションにインストールします。この方法は OTA 後の端末に適しており、OTA 後にもう一方のパーティションに直接 KernelSU をインストールし、端末を再起動することができます。 - -### コマンドラインを使う - -マネージャーを使いたくない場合、コマンドラインを使って LKM をインストールできます。KernelSU の提供する `ksud` ツールを使うと、迅速に公式ファームウェアにパッチを当てフラッシュすることができます。 - -このツールは macOS、Linux および Windows に対応しています。[GitHub Release](https://github.com/tiann/KernelSU/releases) から対応するバージョンをダウンロードしてください。 - -使用方法: `ksud bootpatch` コマンドの各オプションのヘルプをコマンドラインから確認できます。 -```sh -oriole:/ # ksud boot-patch -h -Patch boot or init_boot images to apply KernelSU - -Usage: ksud boot-patch [OPTIONS] - -Options: - -b, --boot boot image path, if not specified, will try to find the boot image automatically - -k, --kernel kernel image path to replace - -m, --module LKM module path to replace, if not specified, will use the builtin one - -i, --init init to be replaced - -u, --ota will use another slot when boot image is not specified - -f, --flash Flash it to boot partition after patch - -o, --out output path, if not specified, will use current directory - --magiskboot magiskboot path, if not specified, will use builtin one - --kmi KMI version, if specified, will use the specified KMI - -h, --help Print help -``` - -説明が必要ないくつかのオプション: - -1. `--magiskboot` オプションは magiskboot のパスを指定します。指定されていない場合、ksud は環境変数を参照します。magiskboot の入手方法がわからない場合、[こちら](#patch-boot-image) を参照してください。 -2. `--kmi` オプションは `KMI` バージョンを指定します。端末のカーネル名が KMI の仕様に準拠していない場合は、このオプションで指定することができます。 - -最も一般的な使い方: - -```sh -ksud boot-patch -b --kmi android13-5.10 -``` - -## GKI モードのインストール - -GKI モードのインストール方法はいくつかあり、それぞれ適したシーンが異なりますので、必要に応じて選択してください。 - -1. KernelSU が提供する boot.img を使用し、fastboot でインストールする -2. KernelFlasher などのカーネル管理アプリでインストールする -3. boot.img を手動でパッチしてインストールする -4. カスタムリカバリー(TWRPなど)でインストールする - -## KernelSU が提供する boot.img を使用してインストール - -この方法は TWRP や root 権限を必要としないので、KernelSU を初めてインストールする場合に適しています。 - -### 正しい boot.img を見つける - -KernelSU では、GKI デバイス用の汎用 boot.img を提供しています。デバイスの boot パーティションに boot.img をフラッシュする必要があります。 - -boot.img は、[GitHub Release](https://github.com/tiann/KernelSU/releases) からダウンロードできます。例えば、あなたのデバイスがカーネル `android12-5.10.101` の場合、`android-5.10.101_yyyy-MM.boot-.img`をダウンロードする必要があります。(KMI を同じにしてください!)。 - -``は純正 boot.img のカーネル圧縮形式を指します。純正の boot.img のカーネル圧縮形式を確認してください。間違った圧縮形式を使うと、ブートループするかもしれません。 - -::: info 情報 -1. magiskboot を使えば、元のブートの圧縮形式を知ることができます。もちろん、あなたのデバイスと同じモデルを持つ、より経験豊富な他の人にも聞くこともできます。また、カーネルの圧縮形式は通常変更されないので、ある圧縮形式でうまく起動した場合、後でその形式を試すことも可能です。 -2. Xiaomi デバイスでは通常 `gz` か**無圧縮**が使われます。 -3. Pixel デバイスでは以下の手順に従ってください。 -::: - -### boot.img をデバイスに書き込む - -`adb` でデバイスを接続し、`adb reboot bootloader` で fastboot モードにし、このコマンドで KernelSU を書き込んでください: - -```sh -fastboot flash boot boot.img -``` - -::: info 情報 -デバイスが `fastboot boot` をサポートしている場合、まず `fastboot boot.img` を使えば書き込みせずにシステムを起動できます。予期せぬことが起こった場合は、もう一度再起動して起動してください。 -::: - -### 再起動 - -書き込みが完了したら、デバイスを再起動します: - -```sh -fastboot reboot -``` - -## カーネル管理アプリでインストール - -前提条件:お使いのデバイスが root 化されている必要があります。例えば、Magisk をインストールして root を取得した場合、または古いバージョンの KernelSU をインストールしており、別のバージョンの KernelSU にアップグレードする必要がある場合などです。お使いのデバイスが root 化されていない場合、他の方法をお試しください。 - -手順: - -1. AnyKernel3 ZIP をダウンロードします。ダウンロード方法は、「カスタムリカバリーでインストール」を参照してください。 -2. カーネル管理アプリを開き、AnyKernel3 の ZIP をインストールします。 - -カーネル管理アプリは以下のようなものが人気です: - -1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases) -2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel) -3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager) - -この方法は KernelSU をアップグレードするときに便利で、パソコンがなくてもできます。(まずはバックアップしてください!) - -## boot.img を手動でパッチ {#patch-boot-image} - -デバイスによっては、boot.img のフォーマットが `lz4` でない、`gz` である、無圧縮であるなど、あまり一般的でないことがあります。最も典型的なのは Pixel で、boot.img フォーマットは `lz4_legacy` 圧縮、RAM ディスクは `gz` か `lz4_legacy` 圧縮です。この時、KernelSU が提供した boot.img を直接書き込むとデバイスが起動できなくなる場合があります。その場合は手動で boot.img に対してパッチしてください。 - -常に `magiskboot` を利用してイメージにパッチを当てることが推奨されます。2 つの方法があります: - -1. [magiskboot](https://github.com/topjohnwu/Magisk/releases) -2. [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) - -公式の `magisikboot` ビルドは Android 端末でしか動作しないため、PC で作業したい場合、2 つめの方法を試してください。 - -:::tip -Android-Image-Kitchen は現在非推奨です。セキュリティパッチレベルなどの boot メタデータを正しく扱わないため、一部のデバイスでは動作しない可能性があります。 -::: - -### 準備 - -1. お使いのデバイスの純正 boot.img を入手します。デバイスメーカーから入手できます。[payload-dumper-go](https://github.com/ssut/payload-dumper-go)が必要かもしれません。 -2. お使いのデバイスの KMI バージョンに合った、KernelSU が提供する AnyKernel3 の ZIP ファイルをダウンロードします(*カスタムリカバリーでインストール*を参照してください)。 -3. AnyKernel3 パッケージを展開し、KernelSU のカーネルファイルである `Image` ファイルを取得します。 - -### Android 端末で magiskboot を使う {#using-magiskboot-on-Android-devices} - -1. 最新の Magisk を[リリースページ](https://github.com/topjohnwu/Magisk/releases)からダウンロードしてください。 -2. `Magisk-*(version).apk` を `Magisk-*.zip` に名前を変更して展開してください。 -3. `Magisk-*/lib/arm64-v8a/libmagiskboot.so`を adb でデバイスに転送します:`adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot` -4. 純正 boot.img と AnyKernel3 の中の Image をデバイスに転送します。 -5. adb shell に入り、`cd /data/local/tmp/` し、`chmod +x magiskboot` を実行します。 -6. adb shell に入り、`cd /data/local/tmp/` し、`./magiskboot unpack boot.img` を実行して `boot.img` を抽出します。`kernel` ファイルが純正カーネルです。 -7. `kernel` を `Image` で置き換えます: `mv -f Image kernel` -8. `./magiskboot repack boot.img` を実行してブートイメージをリパックします。出来上がった `new-boot.img` を fastboot でデバイスに書き込んでください。 - -### Windows/macOS/Linux PC で magiskboot を使う {#using-magiskboot-on-PC} - -1. OS に対応する `magiskboot` バイナリを [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) からダウンロードします。 -2. 純正の `boot.img` と `Image` を PC 上に準備します。 -3. `chmod +x magiskboot` を実行します。 -4. 対応するディレクトリに入り、`./magiskboot unpack boot.img` を実行して `boot.img` を展開します。展開された `kernel` ファイルが純正のカーネルです。 -5. 下記のコマンドを実行し、`kernel` を `Image` で置き換えてください: `mv -f Image kernel` -6. `./magiskboot repack boot.img` を実行し、boot イメージを再パックします。作成された `new-boot.img` ファイルを、fastboot を利用して端末にフラッシュします。 - -::: info -公式の `magiskboot` は、`Linux` 環境においては正常に動作します。Linux を使っている場合、公式のビルドを利用できます。 -::: - -## カスタムリカバリーでインストール {#install-with-custom-recovery} - -前提条件:デバイスに TWRP などのカスタムリカバリーがあること。ない場合、または公式リカバリーしかない場合は他の方法を使用してください。 - -手順: - -1. KernelSUの[リリースページ](https://github.com/tiann/KernelSU/releases)から、お使いのデバイスのバージョンにあった AnyKernel3 で始まる ZIP パッケージをダウンロードします。例えば、デバイスのカーネルのバージョンが`android12-5.10. 66`の場合、AnyKernel3-android12-5.10.66_yyyy-MM.zip`(yyyy`は年、`MM`は月)のファイルをダウンロードします。 -2. デバイスを TWRP へ再起動します。 -3. adb を使用して AnyKernel3-*.zip をデバイスの /sdcard に入れ、TWRP GUI でインストールを選択します。または直接`adb sideload AnyKernel-*.zip` でインストールできます。 - -この方法は TWRP を使用できるならどのようなインストール(初期インストールやその後のアップグレード)にも適しています。 - -## その他の方法 - -実はこれらのインストール方法はすべて、**元のカーネルを KernelSU が提供するカーネルに置き換える**という主旨でしかなく、これが実現できれば他の方法でもインストール可能です: - -1. まず Magisk をインストールし、Magisk を通じて root 権限を取得し、カーネル管理アプリで KernelSU の AnyKernel ZIPをインストールする -2. PC 上で何らかの書き込みツールを使用し、KernelSU が提供するカーネルを書き込む - -しかし、これらの方法でうまく行かない場合、`magiskboot` を使う方法を試してみてください。 diff --git a/website/docs/ja_JP/guide/module-webui.md b/website/docs/ja_JP/guide/module-webui.md deleted file mode 100644 index 8148f79d..00000000 --- a/website/docs/ja_JP/guide/module-webui.md +++ /dev/null @@ -1,48 +0,0 @@ -# Module WebUI - -KernelSU のモジュールは、ブートスクリプトの実行やシステムファイルの修正に加えて、UI インターフェースの表示やユーザーとの対話もサポートしています。 - -モジュールは、任意の Web 技術を通じて HTML + CSS + JavaScript のページを作成することができます。KernelSU のマネージャーは WebView を通じてこれらのページを表示します。また、シェルコマンドの実行など、システムと対話するためのいくつかのAPIを提供しています。 - -## `webroot` ディレクトリ - -Web リソースファイルは、モジュールのルートディレクトリの `webroot` サブディレクトリに置かれるべきであり、`index.html` という名前のファイルが必ず存在しなければなりません。これがモジュールページのエントリです。Web インターフェイスを含む最もシンプルなモジュール構造は以下の通りです: - -```txt -❯ tree . -. -|-- module.prop -`-- webroot - `-- index.html -``` - -:::警告 -モジュールをインストールするとき、KernelSU はこのディレクトリのパーミッションと SELinux コンテキストを自動的に設定します。何をしているかわからないのであれば、自分でこのディレクトリのパーミッションを設定しないでください! -::: - -ページに css や JavaScript が含まれている場合は、このディレクトリに配置する必要があります。 - -## JavaScript API - -単なる表示ページであれば、通常の Web ページとの違いはありません。より重要なのは、KernelSU がモジュールの固有機能を実装させるための一連のシステム API を提供することです。 - -KernelSU は JavaScript ライブラリを提供し、[npm で公開しています](https://www.npmjs.com/package/kernelsu)。これを Web ページの JavaScript コードで使用することができます。 - -たとえば、特定の設定を取得したり、プロパティを変更するために、シェルコマンドを実行することができます: - -```JavaScript -import { exec } from 'kernelsu'; - -const { errno, stdout } = exec("getprop ro.product.model"); -``` - -別の例として、Webページをフルスクリーンで表示したり、トーストを表示することができます。 - -[API ドキュメント](https://www.npmjs.com/package/kernelsu) - -既存のAPIがご自身のニーズを満たしていない、または使い勝手が不便である場合、[こちら](https://github.com/tiann/KernelSU/issues)でご提案いただければ幸いです! - -## いくつかのヒント - -1. `localStorage` を通常通りに使用してデータを保存することができますが、Manager アプリをアンインストールした後には失われます。永続的に保存する必要がある場合は、自分でいくつかのディレクトリにデータを書き込むことができます。 -2. シンプルなページには、[parceljs](https://parceljs.org/)を使用することをお勧めします。設定が不要で非常に便利です。しかし、フロントエンドの達人である場合や、自分の好みがある場合は、気に入ったものを選んでください! diff --git a/website/docs/ja_JP/guide/module.md b/website/docs/ja_JP/guide/module.md deleted file mode 100644 index 4f393987..00000000 --- a/website/docs/ja_JP/guide/module.md +++ /dev/null @@ -1,255 +0,0 @@ -# モジュールのガイド - -KernelSU はシステムパーティションの整合性を維持しながら、システムディレクトリを変更する効果を実現するモジュール機構を提供します。この機構は一般に「システムレス」と呼ばれています。 - -KernelSU のモジュール機構は、Magisk とほぼ同じです。Magisk のモジュール開発に慣れている方であれば、KernelSU のモジュール開発も簡単でしょう。その場合は以下のモジュールの紹介は読み飛ばして、[Magisk との違い](difference-with-magisk.md)の内容だけ読めばOKです。 - -## Busybox - -KernelSU には、機能的に完全な Busybox バイナリ (SELinux の完全サポートを含む) が同梱されています。実行ファイルは `/data/adb/ksu/bin/busybox` に配置されています。KernelSU の Busybox はランタイムに切り替え可能な「ASH スタンドアローンシェルモード」をサポートしています。このスタンドアロンモードとは、Busybox の `ash` シェルで実行する場合 `PATH` として設定されているものに関係なく、すべてのコマンドが Busybox 内のアプレットを直接使用するというものです。たとえば、`ls`、`rm`、`chmod` などのコマンドは、`PATH` にあるもの(Android の場合、デフォルトではそれぞれ `/system/bin/ls`, `/system/bin/rm`, `/system/bin/chmod`)ではなく、直接 Busybox 内部のアプレットを呼び出すことになります。これにより、スクリプトは常に予測可能な環境で実行され、どの Android バージョンで実行されていても常にコマンドを利用できます。Busybox を使用しないコマンドを強制的に実行するには、フルパスで実行ファイルを呼び出す必要があります。 - -KernelSU のコンテキストで実行されるすべてのシェルスクリプトは、Busybox の `ash` シェルでスタンドアロンモードが有効な状態で実行されます。サードパーティの開発者に関係するものとしては、すべてのブートスクリプトとモジュールのインストールスクリプトが含まれます。 - -この「スタンドアロンモード」機能を KernelSU 以外で使用したい場合、2つの方法で有効にできます: - -1. 環境変数 `ASH_STANDALONE` を `1` にする
例: `ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
メンテナーリポジトリ対応デバイス
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
\ No newline at end of file diff --git a/website/docs/ja_JP/guide/what-is-kernelsu.md b/website/docs/ja_JP/guide/what-is-kernelsu.md deleted file mode 100644 index 742dc660..00000000 --- a/website/docs/ja_JP/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# KernelSU とは? - -KernelSU は Android GKI デバイスのための root ソリューションです。カーネルモードで動作し、カーネル空間で直接ユーザー空間アプリに root 権限を付与します。 - -## 機能 - -KernelSU の最大の特徴は、**カーネルベース**であることです。KernelSU はカーネルモードで動作するため、今までにないカーネルインターフェイスを提供できます。例えば、カーネルモードで任意のプロセスにハードウェアブレークポイントを追加できる、誰にも気づかれずに任意のプロセスの物理メモリにアクセスできる、カーネル空間で任意のシステムコールを傍受できる、などです。 - -また、KernelSU は OverlayFS によるモジュールシステムを提供しており、カスタムプラグインをシステムに読み込めます。`/system` パーティションを変更する仕組みも提供しています。 - -## 使用方法 - -こちらをご覧ください: [インストール方法](installation) - -## ビルド方法 - -[ビルドするには](../../guide/how-to-build) - -## ディスカッション - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/ja_JP/index.md b/website/docs/ja_JP/index.md deleted file mode 100644 index 22892679..00000000 --- a/website/docs/ja_JP/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -layout: home -title: Android 向けのカーネルベース root ソリューション - -hero: - name: KernelSU - text: Android 向けのカーネルベース root ソリューション - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: はじめる - link: /ja_JP/guide/what-is-kernelsu - - theme: alt - text: GitHub で表示 - link: https://github.com/tiann/KernelSU - -features: - - title: カーネルベース - details: KernelSU は Linux カーネルモードで動作し、ユーザー空間よりも高度な制御が可能です。 - - title: ホワイトリストの権限管理 - details: root 権限を許可したアプリのみが su にアクセスでき、他のアプリは su を見つけられません。 - - title: モジュール対応 - details: KernelSU は OverlayFS により実際のシステムを改変せずに /system を変更できます。書き込み可能にすることさえできます。 - - title: オープンソース - details: KernelSU は GPL-3 でライセンスされたオープンソースプロジェクトです。 - diff --git a/website/docs/pt_BR/guide/app-profile.md b/website/docs/pt_BR/guide/app-profile.md deleted file mode 100644 index 1c2b68d2..00000000 --- a/website/docs/pt_BR/guide/app-profile.md +++ /dev/null @@ -1,118 +0,0 @@ -# Perfil do Aplicativo - -O Perfil do Aplicativo é um mecanismo fornecido pelo KernelSU para personalizar a configuração de vários apps. - -Para apps com privilégios root (ou seja, capazes de usar `su`), o Perfil do Aplicativo também pode ser chamado de Perfil root. Ele permite a customização das regras `uid`, `gid`, `grupos`, `capacidades` e `SELinux` do comando `su`, restringindo assim os privilégios do usuário root. Por exemplo, ele pode conceder permissões de rede apenas para apps de firewall enquanto nega permissões de acesso a arquivos, ou pode conceder permissões de shell em vez de acesso root completo para apps congelados: **mantendo o poder confinado com o princípio do menor privilégio.** - -Para apps comuns sem privilégios root, o Perfil do Aplicativo pode controlar o comportamento do kernel e do sistema de módulos em relação a esses apps. Por exemplo, pode determinar se as modificações resultantes dos módulos devem ser abordadas. O kernel e o sistema de módulos podem tomar decisões com base nesta configuração, como realizar operações semelhantes a "ocultar". - -## Perfil root - -### UID, GID e Grupos - -Os sistemas Linux possuem dois conceitos: usuários e grupos. Cada usuário possui um ID de usuário (UID) e pode pertencer a vários grupos, cada um com seu próprio ID de grupo (GID). Esses IDs são usados ​​para identificar usuários no sistema e determinar quais recursos do sistema eles podem acessar. - -Os usuários com UID 0 são conhecidos como usuários root, e grupos com GID 0 são chamados de grupos root. O grupo de usuários root geralmente tem os privilégios mais altos no sistema. - -No caso do sistema Android, cada app funciona como um usuário separado (exceto em casos de UID compartilhado) e recebe um UID exclusivo. Por exemplo, `0` representa o usuário root, `1000` representa `system`, `2000` ao ADB shell e os UIDs de `10000` a `19999` são atribuídos a apps comuns. - -::: info INFORMAÇÕES -Aqui, o UID mencionado não é o mesmo que o conceito de múltiplos usuários ou perfis de trabalho no sistema Android. Os perfis de trabalho são, na verdade, implementados particionando o intervalo UID. Por exemplo, 10000-19999 representa o usuário principal, enquanto 110000-119999 representa um perfil de trabalho. Cada app comum entre eles possui seu próprio UID exclusivo. -::: - -Cada app pode ter vários grupos, com o GID representando o grupo principal, que geralmente corresponde ao UID. Outros grupos são conhecidos como grupos suplementares. Certas permissões são controladas por meio de grupos, como permissões de acesso à rede ou acesso Bluetooth. - -Por exemplo, se executarmos o comando `id` no ADB shell, a saída pode ser semelhante a esta: - -```sh -oriole:/ $ id -uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0 -``` - -Aqui, o UID é `2000` e o GID (ID do grupo primário) também é `2000`. Além disso, pertence a vários grupos suplementares, como `inet` (indicando a capacidade de criar soquetes `AF_INET` e `AF_INET6`) e `sdcard_rw` (indicando permissões de leitura/gravação para o cartão SD). - -O Perfil root do KernelSU permite personalizar o UID, GID e grupos para o processo root após a execução de `su`. Por exemplo, o Perfil root de um app root pode definir seu UID como `2000`, o que significa que, ao usar `su`, as permissões reais do app estão no nível do ADB shell. Além disso, o grupo `inet` pode ser removido, evitando que o comando `su` tenha acesso à rede. - -::: tip OBSERVAÇÃO -O Perfil do Aplicativo controla apenas as permissões do processo root após usar `su` e não afeta as permissões do próprio app. Se um app solicitou permissão para acessar a rede, ele ainda poderá acessar a rede mesmo sem usar `su`. Remover o grupo `inet` de `su` apenas impede que `su` acesse a rede. -::: - -O Perfil root é aplicado no kernel e não depende do comportamento voluntário de apps root, ao contrário da troca de usuários ou grupos por meio de `su`. A concessão da permissão `su` depende inteiramente do usuário e não do desenvolvedor. - -### Capacidades - -As capacidades são um mecanismo para separação de privilégios no Linux. - -Para realizar verificações de permissão, as implementações tradicionais do `UNIX` distinguem duas categorias de processos: processos privilegiados (cujo ID de usuário efetivo é `0`, referido como superusuário ou root) e processos sem privilégios (cujo UID efetivo é diferente de zero). Os processos privilegiados ignoram todas as verificações de permissão do kernel, enquanto os processos não privilegiados estão sujeitos à verificação completa de permissão com base nas credenciais do processo (geralmente: UID efetivo, GID efetivo e lista de grupos suplementares). - -A partir do Linux 2.2, o Linux divide os privilégios tradicionalmente associados ao superusuário em unidades distintas, conhecidas como capacidades, que podem ser ativadas e desativadas de forma independente. - -Cada capacidade representa um ou mais privilégios. Por exemplo, `CAP_DAC_READ_SEARCH` representa a capacidade de ignorar verificações de permissão para leitura de arquivos, bem como permissões de leitura e execução de diretório. Se um usuário com um UID efetivo `0` (usuário root) não tiver a capacidade `CAP_DAC_READ_SEARCH` ou superiores, isso significa que mesmo sendo root, ele não pode ler arquivos à vontade. - -O Perfil root do KernelSU permite a personalização das capacidades do processo root após a execução de `su`, concedendo assim "privilégios root" de forma parcial. Ao contrário do UID e GID mencionados acima, certos apps root exigem um UID de `0` após usar `su`. Nesses casos, limitar as capacidades deste usuário root com UID `0` pode restringir as operações que ele pode realizar. - -::: tip FORTE RECOMENDAÇÃO -A [documentação oficial](https://man7.org/linux/man-pages/man7/capabilities.7.html) da capacidade do Linux fornece explicações detalhadas das habilidades representadas por cada capacidade. Se você pretende customizar as capacidade, é altamente recomendável que você leia este documento primeiro. -::: - -### SELinux - -SELinux é um poderoso mecanismo do Controle de Acesso Obrigatório (MAC). Ele opera com base no princípio de **negação padrão**. Qualquer ação não explicitamente permitida é negada. - -O SELinux pode ser executado em dois modos globais: - -1. Modo permissivo: Os eventos de negação são registrados, mas não aplicados. -2. Modo de aplicação: Os eventos de negação são registrados e aplicados. - -::: warning AVISO -Os sistemas Android modernos dependem fortemente do SELinux para garantir a segurança geral do sistema. É altamente recomendável não usar nenhum sistema personalizado executado em "Modo permissivo", pois ele não oferece vantagens significativas em relação a um sistema completamente aberto. -::: - -Explicar o conceito completo do SELinux é complexo e está além do objetivo deste documento. Recomenda-se primeiro entender seu funcionamento através dos seguintes recursos: - -1. [Wikipédia](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) -2. [Red Hat: O que é SELinux?](https://www.redhat.com/pt-br/topics/linux/what-is-selinux) -3. [ArchLinux: SELinux](https://wiki.archlinux.org/title/SELinux) - -O Perfil root do KernelSU permite a personalização do contexto SELinux do processo root após a execução de `su`. Regras específicas de controle de acesso podem ser definidas para este contexto, possibilitando um controle refinado sobre os privilégios root. - -Em cenários típicos, quando um app executa `su`, ele alterna o processo para um domínio SELinux com **acesso irrestrito**, como `u:r:su:s0`. Através do Perfil root, esse domínio pode ser mudado para um domínio personalizado, como `u:r:app1:s0`, e uma série de regras podem ser definidas para esse domínio: - -```sh -type app1 -enforce app1 -typeattribute app1 mlstrustedsubject -allow app1 * * * -``` - -Observe que a regra `allow app1 * * *` é usada apenas para fins de demonstração. Na prática, esta regra não deve ser utilizada extensivamente, pois não difere muito do Modo permissivo. - -### Escalação - -Se a configuração do Perfil root não estiver definida corretamente, poderá ocorrer um cenário de escalação. As restrições impostas pelo Perfil root poderão falhar involuntariamente. - -Por exemplo, se você conceder permissão root a um usuário ADB shell (que é um caso comum) e, em seguida, conceder permissão root a um app normal, mas configurar seu Perfil root com o UID 2000 (o UID do usuário ADB shell), o app pode obter acesso root completo ao executar o comando `su` duas vezes: - -1. A primeira execução de `su` será sujeita ao Perfil do Aplicativo, e mudará para o UID `2000` (ADB shell) em vez de `0` (root). -2. A segunda execução de `su`, como o UID é `2000` e você concedeu acesso root ao UID `2000` (ADB shell) na configuração, o app obterá privilégios root completo. - -::: warning OBSERVAÇÃO -Este comportamento é totalmente esperado e não é um bug. Portanto, recomendamos o seguinte: - -Se você realmente precisa conceder privilégios root ao ADB (por exemplo, como desenvolvedor), não é aconselhável alterar o UID para `2000` ao configurar o Perfil root. Usar `1000` (system) seria uma melhor escolha. -::: - -## Perfil não root - -### Desmontar módulos - -O KernelSU fornece um mecanismo sem sistema para modificar partições do sistema, obtido através da montagem do OverlayFS. No entanto, alguns apps podem ser sensíveis a esse comportamento. Nesse caso, podemos descarregar módulos montados nesses apps configurando a opção "Desmontar módulos". - -Além disso, a interface de configurações do gerenciador do KernelSU oferece a opção "Desmontar módulos por padrão". Por padrão, essa opção está **ativada**, o que significa que o KernelSU ou alguns módulos descarregarão módulos para este app, a menos que configurações adicionais sejam aplicadas. Se você não preferir esta configuração ou se ela afetar determinados apps, você terá as seguintes opções: - -1. Manter a opção "Desmontar módulos por padrão" ativada e desative individualmente a opção "Desmontar módulos" no Perfil do Aplicativo para apps que exigem o carregamento do módulo (agindo como uma "lista de permissões"). -2. Desativar a opção "Desmontar módulos por padrão" e ativar individualmente a opção "Desmontar módulos" no Perfil do Aplicativo para apps que exigem o descarregamento do módulo (agindo como uma "lista negra"). - -::: info INFORMAÇÕES -Em dispositivos que utilizam a versão do kernel 5.10 ou superior, o kernel realiza qualquer ação adicional do descarregamento de módulos. No entanto, para dispositivos que executam versões do kernel abaixo de 5.10, essa opção é apenas uma opção de configuração e o próprio KernelSU não executa nenhuma ação. Se você quiser usar a opção "Desmontar módulos" em versões do kernel anteriores a 5.10, é necessário portar a função `path_umount` em `fs/namespace.c`. Você pode obter mais informações no final da página [Integração para dispositivos não-GKI](https://kernelsu.org/pt_BR/guide/how-to-integrate-for-non-gki.html). Alguns módulos, como ZygiskNext, também podem usar essa opção para determinar se o descarregamento do módulo é necessário. -::: diff --git a/website/docs/pt_BR/guide/difference-with-magisk.md b/website/docs/pt_BR/guide/difference-with-magisk.md deleted file mode 100644 index 41cb6511..00000000 --- a/website/docs/pt_BR/guide/difference-with-magisk.md +++ /dev/null @@ -1,28 +0,0 @@ -# Diferenças com Magisk - -Embora os módulos do KernelSU e do Magisk tenham muitas semelhanças, existem inevitavelmente algumas diferenças devido aos seus mecanismos de implementação completamente diferentes. Se você deseja que seu módulo funcione tanto no Magisk quanto no KernelSU, é essencial compreender essas diferenças. - -## Semelhanças - -- Formato de arquivo do módulo: Ambos usam o formato ZIP para organizar os módulos, e o formato dos módulos é praticamente o mesmo. -- Diretório de instalação do módulo: Ambos estão localizados em `/data/adb/modules`. -- Sem sistema: Ambos suportam a modificação de `/system` de forma sem sistema por meio de módulos. -- post-fs-data.sh: O tempo de execução e a semântica são exatamente os mesmos. -- service.sh: O tempo de execução e a semântica são exatamente os mesmos. -- system.prop: Completamente o mesmo. -- sepolicy.rule: Completamente o mesmo. -- BusyBox: Os scripts são executados no BusyBox com o "Modo Autônomo" ativado em ambos os casos. - -## Diferenças - -Antes de entender as diferenças, é importante saber como identificar se o seu módulo está sendo executado no KernelSU ou no Magisk. Você pode usar a variável de ambiente `KSU` para diferenciá-lo em todos os locais onde você pode executar os scripts do módulo (`customize.sh`, `post-fs-data.sh`, `service.sh`). No KernelSU, essa variável de ambiente será definida como `true`. - -Aqui estão algumas diferenças: - -- Os módulos KernelSU não podem ser instalados no modo Recovery. -- Os módulos KernelSU não oferece suporte nativo ao Zygisk, mas você pode usar módulos Zygisk através do [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). -- O método para substituir ou excluir arquivos nos módulos do KernelSU é completamente diferente do Magisk. O KernelSU não suporta o método `.replace`. Em vez disso, você deve criar um arquivo com o comando `mknod filename c 0 0` para excluir o arquivo correspondente. -- Os diretórios do BusyBox são diferentes. O BusyBox integrado no KernelSU está localizado em `/data/adb/ksu/bin/busybox`, enquanto no Magisk está em `/data/adb/magisk/busybox`. **Observe que este é um comportamento interno do KernelSU e pode mudar no futuro!** -- O KernelSU não suporta arquivos `.replace`, mas oferece suporte às variáveis ​​`REMOVE` e `REPLACE` para remover ou substituir arquivos e pastas. -- O KernelSU adiciona o estágio `boot-completed` para executar scripts após a inicialização ser concluída. -- O KernelSU adiciona o estágio `post-mount` para executar scripts após o OverlayFS ser montado. diff --git a/website/docs/pt_BR/guide/faq.md b/website/docs/pt_BR/guide/faq.md deleted file mode 100644 index dbe5f472..00000000 --- a/website/docs/pt_BR/guide/faq.md +++ /dev/null @@ -1,78 +0,0 @@ -# Perguntas frequentes - -## KernelSU oferece suporte ao meu dispositivo? - -Primeiro, seu dispositivo deve ser capaz de desbloquear o bootloader. Se não, então não há suporte. - -Em seguida, instale o gerenciador do KernelSU no seu dispositivo e abra-o. Se aparecer `Sem suporte` então seu dispositivo não pode ser suportado imediatamente. No entanto, você pode compilar a fonte do kernel e integrar o KernelSU para fazê-lo funcionar ou usar [Dispositivos com suporte não oficial](unofficially-support-devices). - -## Para usar o KernelSU precisa desbloquear o bootloader? - -Certamente, sim. - -## KernelSU suporta módulos? - -Sim, verifique [Guias de módulo](module.md). - -## KernelSU suporta Xposed? - -Sim, você pode usar LSPosed com [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). - -## KernelSU suporta Zygisk? - -KernelSU não tem suporte integrado ao Zygisk, mas você pode usar [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). - -## KernelSU é compatível com o Magisk? - -O sistema de módulos do KernelSU está em conflito com a montagem mágica do Magisk. Se houver algum módulo ativado no KernelSU, todo o Magisk deixará de funcionar. - -No entanto, se você usar apenas o `su` do KernelSU, ele funcionará bem com o Magisk. O KernelSU modifica o `kernel`, enquanto o Magisk modifica o `ramdisk`, permitindo que ambos trabalhem juntos. - -## KernelSU substituirá o Magisk? - -Acreditamos que não, e esse não é o nosso objetivo. O Magisk é bom o suficiente para solução root do espaço do usuário e terá uma longa vida. O objetivo do KernelSU é fornecer uma interface de kernel aos usuários, não substituindo o Magisk. - -## KernelSU oferece suporte a dispositivos não-GKI? - -É possível. Mas você deve baixar o código-fonte do kernel e integrar o KernelSU à árvore do código-fonte e compilar o kernel você mesmo. - -## KernelSU oferece suporte a dispositivos abaixo do Android 12? - -É o kernel do dispositivo que afeta a compatibilidade do KernelSU e não tem nada a ver com a versão do Android. A única restrição é que os dispositivos lançados com Android 12 devem ser kernel 5.10+ (dispositivos GKI). Então: - -1. Os dispositivos lançados com Android 12 devem ser compatíveis. -2. Dispositivos com kernel antigo (alguns dispositivos com Android 12 também têm o kernel antigo) são compatíveis (você mesmo deve compilar o kernel). - -## KernelSU suporta kernel antigo? - -É possível, o KernelSU é portado para o kernel 4.14 agora. Para kernels mais antigo, você precisa portar manualmente e PRs são sempre bem-vindas! - -## Como integrar o KernelSU para um kernel antigo? - -Por favor, verifique o guia [Integração para dispositivos não-GKI](how-to-integrate-for-non-gki). - -## Por que a minha versão do Android é 13 e o kernel mostra "android12-5.10"? - -A versão do Kernel não tem nada a ver com a versão do Android. Se você precisar fazer o flash do kernel, use sempre a versão do kernel, a versão do Android não é tão importante. - -## Eu sou GKI 1.0, posso usar isso? - -GKI 1.0 é completamente diferente do GKI 2.0, você deve compilar o kernel sozinho. - -## Como posso fazer `/system` RW? - -Não recomendamos que você modifique a partição do sistema diretamente. Por favor, verifique [Guias de módulo](module.md) para modificá-lo sem sistema. Se você insiste em fazer isso, verifique [magisk_overlayfs](https://github.com/HuskyDG/magic_overlayfs). - -## KernelSU pode modificar hosts? Como posso usar AdAway? - -Claro. Mas o KernelSU não tem suporte a hosts integrados, você pode instalar [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) para fazer isso. - -## Por que existe um enorme arquivo de 1 TB? - -O arquivo `modules.img` de 1 TB é um arquivo de imagem de disco. **Não se preocupe com seu tamanho**; ele é um tipo especial de arquivo conhecido como [arquivo esparso](https://en.wikipedia.org/wiki/Sparse_file). Seu tamanho real é apenas o tamanho do módulo que você usa e diminuirá dinamicamente após a exclusão do módulo. Na verdade, ele não ocupa 1 TB de espaço em disco (seu celular pode não ter tanto espaço). - -Se você realmente se incomodar com o tamanho desse arquivo, você pode usar o comando `resize2fs -M` para ajustá-lo ao tamanho real. Porém, o módulo pode não funcionar corretamente nesse caso, e não forneceremos suporte para isso. - -## Por que meu dispositivo mostra o tamanho de armazenamento errado? - -Certos dispositivos usam métodos não padrão para calcular o tamanho de armazenamento do dispositivo, o que pode levar a cálculos imprecisos nos apps e menus do sistema, especialmente ao lidar com arquivos esparsos de 1 TB. Embora esse problema pareça ser específico para os dispositivos Samsung, afetando principalmente os apps e serviços da Samsung, é importante observar que a discrepância está principalmente no tamanho total do armazenamento, enquanto o cálculo do espaço livre permanece preciso. diff --git a/website/docs/pt_BR/guide/hidden-features.md b/website/docs/pt_BR/guide/hidden-features.md deleted file mode 100644 index 25ae2c1f..00000000 --- a/website/docs/pt_BR/guide/hidden-features.md +++ /dev/null @@ -1,7 +0,0 @@ -# Recursos ocultos - -## .ksurc - -Por padrão, `/system/bin/sh` carrega `/system/etc/mkshrc`. - -Você pode fazer su carregar um arquivo rc personalizado criando um arquivo `/data/adb/ksu/.ksurc`. diff --git a/website/docs/pt_BR/guide/how-to-build.md b/website/docs/pt_BR/guide/how-to-build.md deleted file mode 100644 index 8fc71bff..00000000 --- a/website/docs/pt_BR/guide/how-to-build.md +++ /dev/null @@ -1,71 +0,0 @@ -# Como compilar - -Primeiro, você deve ler a documentação oficial do Android para compilação do kernel: - -1. [Como criar kernels](https://source.android.com/docs/setup/build/building-kernels) -2. [Builds de versão de imagem genérica do kernel (GKI)](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -::: warning AVISO -Esta página é para dispositivos GKI, se você usa um kernel antigo, consulte [Integração para dispositivos não-GKI](how-to-integrate-for-non-gki). -::: - -## Compilar o kernel - -### Sincronize o código-fonte do kernel - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -O arquivo `` é um manifesto que pode determinar exclusivamente uma compilação, permitindo que você a torne reprodutível. Para isso, você deve baixar o arquivo de manifesto em [Builds de versão de imagem genérica do kernel (GKI)](https://source.android.com/docs/core/architecture/kernel/gki-release-builds). - -### Construir - -Por favor, verifique [Como criar kernels](https://source.android.com/docs/setup/build/building-kernels) primeiro. - -Por exemplo, para compilar uma imagem de kernel `aarch64`: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` - -Não se esqueça de adicionar o sinalizador `LTO=thin`, caso contrário a compilação poderá falhar se a memória do seu computador for inferior a 24 GB. - -A partir do Android 13, o kernel é compilado pelo `bazel`: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` - -::: info INFORMAÇÕES -Para alguns kernel do Android 14, para fazer o Wi-Fi/Bluetooth funcionar, pode ser necessário remover todas as exportações protegidas pelo GKI: - -```sh -rm common/android/abi_gki_protected_exports_* -``` -::: - -## Compilar o kernel com KernelSU - -Se você conseguir compilar o kernel com sucesso, adicionar suporte ao KernelSU será relativamente simples. Na raiz do diretório de origem do kernel, execute qualquer uma das opções listadas abaixo: - -::: code-group - -```sh[Tag mais recente (estável)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -```sh[Branch principal (dev)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -```sh[Selecionar tag (como v0.5.2)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -::: - -Então, reconstrua o kernel e você obterá uma imagem do kernel com o KernelSU! diff --git a/website/docs/pt_BR/guide/how-to-integrate-for-non-gki.md b/website/docs/pt_BR/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index 6cda5213..00000000 --- a/website/docs/pt_BR/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,377 +0,0 @@ -# Integração para dispositivos não-GKI - -O KernelSU pode ser integrado a kernels não-GKI e foi portado para 4.14 e versões anteriores. - -Devido à fragmentação dos kernels não-GKI, não temos um método universal para construí-lo, portanto, não podemos fornecer o boot.img não-GKI. No entanto, você pode compilar o kernel com o KernelSU integrado por conta própria. - -Primeiro, você deve ser capaz de compilar um kernel inicializável a partir do código-fonte do kernel. Se o kernel não for de código aberto, será difícil executar o KernelSU para o seu dispositivo. - -Se você puder compilar um kernel inicializável, existem duas maneiras de integrar o KernelSU ao código-fonte do kernel: - -1. Automaticamente com `kprobe` -2. Manualmente - -## Integrar com kprobe - -O KernelSU usa kprobe para fazer ganchos do kernel, se o kprobe funcionar bem em seu kernel, é recomendado usar desta forma. - -Primeiro, adicione o KernelSU à árvore de origem do kernel: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -::: info INFORMAÇÕES -[KernelSU 1.0 e versões posteriores não suportam mais kernels não-GKI](https://github.com/tiann/KernelSU/issues/1705). A última versão suportada é a `v0.9.5`, portanto, certifique-se de usar a versão correta. -::: - -Então, você deve verificar se o kprobe está ativado na configuração do seu kernel. Caso não esteja, adicione estas configurações a ele: - -```txt -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` - -Agora, ao recompilar seu kernel, o KernelSU deve funcionar corretamente. - -Se você descobrir que o KPROBES ainda não está ativado, pode tentar ativar `CONFIG_MODULES`. Se isso não resolver, use `make menuconfig` para procurar outras dependências do KPROBES. - -Porém, se você entrar em um bootloop após integrar o KernelSU, isso pode indicar que o **kprobe está quebrado no seu kernel**, o que significa que você precisará corrigir o bug do kprobe ou usar outra maneira. - -::: tip COMO VERIFICAR SE O KPROBE ESTÁ QUEBRADO? -Comente `ksu_enable_sucompat()` e `ksu_enable_ksud()` em `KernelSU/kernel/ksu.c`, se o dispositivo inicializar normalmente, então o kprobe pode estar quebrado. -::: - -::: info COMO FAZER COM QUE O RECURSO DE DESMONTAR MÓDULOS FUNCIONE NO PRÉ-GKI? -Se o seu kernel for inferior a 5.9, você deve portar `path_umount` para `fs/namespace.c`. Isso é necessário para que o recurso "Desmontar módulos" funcione corretamente. Caso você não porte `path_umount`, o recurso "Desmontar módulos" não funcionará. Você pode obter mais informações sobre como conseguir isso no final desta página. -::: - -## Modifique manualmente a fonte do kernel - -Se o kprobe não funcionar no seu kernel (isso pode ser causado por um bug no upstream ou do kernel abaixo de 4.8), então você pode tentar o seguinte: - -Primeiro, adicione o KernelSU à árvore de origem do kernel: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -Tenha em mente que, em alguns dispositivos, seu defconfig pode estar localizado em `arch/arm64/configs` ou em outros casos pode estar em `arch/arm64/configs/vendor/your_defconfig`. Independentemente do defconfig que você estiver usando, certifique-se de ativar `CONFIG_KSU` com `y` para ativa-lo ou `n` para desativa-lo. Por exemplo, se optar por ativá-lo, seu defconfig deverá conter a seguinte linha: - -```txt -# KernelSU -CONFIG_KSU=y -``` - -Em seguida, adicione chamadas do KernelSU à fonte do kernel. Abaixo estão alguns patches para referência: - -::: code-group - -```diff[exec.c] -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); -+#endif - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); -+ #endif - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff[open.c] -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif - /* - * access() precisa usar o uid/gid real, não o uid/gid efetivo. - * Fazemos isso limpando temporariamente todos os recursos relacionados ao FS e -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff[read_write.c] -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+#ifdef CONFIG_KSU -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); -+#endif - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ #endif -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff[stat.c] -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif -+ - /** - * vfs_statx - Obtenha atributos básicos e extras por filename - * @dfd: Um descritor de arquivo que representa o diretório base para um filename relativo -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flags); -+ #endif - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` - -::: - -Você deve encontrar as quatro funções no código-fonte do kernel: - -1. `do_faccessat`, geralmente em `fs/open.c` -2. `do_execveat_common`, geralmente em `fs/exec.c` -3. `vfs_read`, geralmente em `fs/read_write.c` -4. `vfs_statx`, geralmente em `fs/stat.c` - -Se o seu kernel não tiver a função `vfs_statx`, use `vfs_fstatat`: - -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 068fdbcc9e26..5348b7bb9db2 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -87,6 +87,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) - } - EXPORT_SYMBOL(vfs_fstat); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif - int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int flag) - { -@@ -94,6 +96,8 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int error = -EINVAL; - unsigned int lookup_flags = 0; -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flag); -+ #endif -+ - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH)) != 0) - goto out; -``` - -Para kernels anteriores ao 4.17, se você não conseguir encontrar `do_faccessat`, basta ir até a definição do syscall `faccessat` e fazer a chamada lá: - -```diff -diff --git a/fs/open.c b/fs/open.c -index 2ff887661237..e758d7db7663 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -355,6 +355,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return error; - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif -+ - /* - * access() precisa usar o uid/gid real, não o uid/gid efetivo. - * Fazemos isso limpando temporariamente todos os recursos relacionados ao FS e -@@ -370,6 +373,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif -+ - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` - -### Modo de Segurança - -Para ativar o Modo de Segurança integrado do KernelSU, você deve modificar a função `input_handle_event` em `drivers/input/input.c`: - -::: tip DICA -É altamente recomendável ativar este recurso, é muito útil para evitar bootloops! -::: - -```diff -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 45306f9ef247..815091ebfca4 100755 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -367,10 +367,13 @@ static int input_get_disposition(struct input_dev *dev, - return disposition; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_input_hook __read_mostly; -+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value); -+#endif -+ - static void input_handle_event(struct input_dev *dev, - unsigned int type, unsigned int code, int value) - { - int disposition = input_get_disposition(dev, type, code, &value); -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_input_hook)) -+ ksu_handle_input_handle_event(&type, &code, &value); -+ #endif - - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - add_input_randomness(type, code, value); -``` - -::: info ENTRANDO NO MODO DE SEGURANÇA ACIDENTALMENTE? -Se você estiver usando a integração manual e não desativar `CONFIG_KPROBES`, o usuário poderá acionar o Modo de Segurança pressionando o botão de diminuir volume após a inicialização! Portanto, se estiver usando a integração manual, é necessário desativar `CONFIG_KPROBES`! -::: - -### Falha ao executar `pm` no terminal? - -Você deve modificar `fs/devpts/inode.c`. Referência: - -```diff -diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c -index 32f6f1c68..d69d8eca2 100644 ---- a/fs/devpts/inode.c -+++ b/fs/devpts/inode.c -@@ -602,6 +602,8 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - return dentry; - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_devpts(struct inode*); -+#endif -+ - /** - * devpts_get_priv -- get private data for a slave - * @pts_inode: inode of the slave -@@ -610,6 +612,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - */ - void *devpts_get_priv(struct dentry *dentry) - { -+ #ifdef CONFIG_KSU -+ ksu_handle_devpts(dentry->d_inode); -+ #ifdef CONFIG_KSU - if (dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC) - return NULL; - return dentry->d_fsdata; -``` - -### Como portar path_umount - -Você pode fazer com que o recurso "Desmontar módulos" funcione em kernels pré-GKI portando manualmente `path_umount` da versão 5.9. Você pode usar este patch como referência: - -```diff ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -1739,6 +1739,39 @@ static inline bool may_mandlock(void) - } - #endif - -+static int can_umount(const struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ -+ if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) -+ return -EINVAL; -+ if (!may_mount()) -+ return -EPERM; -+ if (path->dentry != path->mnt->mnt_root) -+ return -EINVAL; -+ if (!check_mnt(mnt)) -+ return -EINVAL; -+ if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ -+ return -EINVAL; -+ if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ return 0; -+} -+ -+int path_umount(struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ int ret; -+ -+ ret = can_umount(path, flags); -+ if (!ret) -+ ret = do_umount(mnt, flags); -+ -+ /* não devemos chamar path_put() pois isso limparia mnt_expiry_mark */ -+ dput(path->dentry); -+ mntput_no_expire(mnt); -+ return ret; -+} - /* - * Agora o umount pode lidar com pontos de montagem e também com dispositivos bloqueados. - * Isto é importante para filesystems que usam dispositivos bloqueados sem nome. -``` - -Finalmente, compile seu kernel novamente e o KernelSU deverá funcionar corretamente. diff --git a/website/docs/pt_BR/guide/installation.md b/website/docs/pt_BR/guide/installation.md deleted file mode 100644 index 367209e2..00000000 --- a/website/docs/pt_BR/guide/installation.md +++ /dev/null @@ -1,280 +0,0 @@ -# Instalação - -## Verifique se o seu dispositivo é compatível - -Baixe o gerenciador do KernelSU em [GitHub Releases](https://github.com/tiann/KernelSU/releases) e instale-o no seu dispositivo: - -- Se o app mostrar `Sem suporte`, significa que **você precisará compilar o kernel por conta própria**. O KernelSU não fornecerá e nunca fornecerá um arquivo boot.img para você instalar. -- Se o app mostrar `Não instalado`, então seu dispositivo é oficialmente suportado pelo KernelSU. - -::: info INFORMAÇÕES -Para dispositivos que mostram `Sem suporte`, você pode conferir a lista de [Dispositivos com suporte não oficial](unofficially-support-devices.md). Você mesmo pode compilar o kernel. -::: - -## Backup padrão do boot.img - -Antes de fazer o flash, é essencial que você faça o backup do seu boot.img padrão. Se encontrar algum bootloop, você sempre pode restaurar o sistema voltando ao boot padrão de fábrica usando o fastboot. - -::: warning AVISO -O flash pode causar perda de dados. Certifique-se de executar esta etapa bem antes de prosseguir para a próxima! Se necessário, também é recomendável fazer backup de todos os dados do seu dispositivo. -::: - -## Conhecimento necessário - -### ADB e fastboot - -Por padrão, você usará as ferramentas ADB e fastboot neste tutorial, portanto, se você não as conhece, recomendamos pesquisar para aprender sobre elas primeiro. - -### KMI - -Kernel Module Interface (KMI), versões de kernel com o mesmo KMI são **compatíveis**, isso é o que "geral" significa no GKI. Por outro lado, se o KMI for diferente, então esses kernels não são compatíveis entre si, e atualizar uma imagem do kernel com um KMI diferente do seu dispositivo pode causar um bootloop. - -Especificamente, para dispositivos GKI, o formato da versão do kernel deve ser a seguinte: - -```txt -KernelRelease := -Version.PatchLevel.SubLevel-AndroidRelease-KmiGeneration-suffix -w .x .y -zzz -k -alguma coisa -``` - -`w.x-zzz-k` é a versão KMI. Por exemplo, se a versão do kernel de um dispositivo for `5.10.101-android12-9-g30979850fc20`, então seu KMI será `5.10-android12-9`. Teoricamente, ele pode inicializar normalmente com outros kernels KMI. - -::: tip DICA -Observe que o SubLevel na versão do kernel não faz parte do KMI! Isso significa que `5.10.101-android12-9-g30979850fc20` tem o mesmo KMI que `5.10.137-android12-9-g30979850fc20`! -::: - -### Nível do patch de segurança {#security-patch-level} - -Dispositivos Android mais recentes podem ter mecanismos anti-rollback que impedem o flash de um boot.img com um nível de patch de segurança antigo. Por exemplo, se o kernel do seu dispositivo for `5.10.101-android12-9-g30979850fc20`, o patch de segurança será `2023-11`, mesmo se você atualizar o kernel correspondente ao KMI do kernel, se o nível do patch de segurança for anterior a `2023-11` (como `2023-06`), isso pode causar um bootloop. - -Portanto, kernels com os níveis de patch de segurança mais recentes são preferidos para manter a compatibilidade com o KMI. - -### Versão do kernel vs Versão do Android - -Por favor, observe: **A versão do kernel e a versão do Android não são necessariamente iguais!** - -Se você descobrir que a versão do seu kernel é `android12-5.10.101`, mas a versão do seu sistema Android é Android 13 ou outra, não se surpreenda, pois o número da versão do sistema Android não é necessariamente igual ao número da versão do kernel Linux. O número da versão do kernel Linux geralmente é correspondente à versão do sistema Android que acompanha o **dispositivo quando ele é enviado**. Se o sistema Android for atualizado posteriormente, a versão do kernel geralmente não será alterada. Então, antes de flashar qualquer coisa, **consulte sempre a versão do kernel!** - -## Introdução - -Desde a versão [0.9.0](https://github.com/tiann/KernelSU/releases/tag/v0.9.0), o KernelSU suporta dois modos de execução em dispositivos GKI: - -1. `GKI`: Substitue o kernel original do dispositivo pelo **Generic Kernel Image** (GKI) fornecido pelo KernelSU. -2. `LKM`: Carregue o **Loadable Kernel Module** (LKM) no kernel do dispositivo sem substituir o kernel original. - -Esses dois modos são adequados para diferentes cenários, e você pode escolher o mais adequado conforme suas necessidades. - -### Modo GKI {#gki-mode} - -No modo GKI, o kernel original do dispositivo será substituído pela imagem genérica do kernel fornecida pelo KernelSU. As vantagens do modo GKI são: - -1. Forte universalidade, adequada para a maioria dos dispositivos. Por exemplo, a Samsung ativou dispositivos KNOX, e o modo LKM não pode funcionar. Existem também alguns dispositivos modificados de nicho que só podem usar o modo GKI. -2. Pode ser usado sem depender de firmware oficial, e não há necessidade de esperar por atualizações oficiais de firmware, desde que o KMI seja consistente, ele pode ser usado. - -### Modo LKM {#lkm-mode} - -No modo LKM, o kernel original do dispositivo não será substituído, mas o módulo do kernel carregável será carregado no kernel do dispositivo. As vantagens do modo LKM são: - -1. Não substituirá o kernel original do dispositivo. Se você tiver os requisitos especiais para o kernel original do dispositivo ou quiser usar o KernelSU enquanto usa um kernel de terceiros, poderá usar o modo LKM. -2. É mais conveniente atualizar o OTA. Ao atualizar o KernelSU, você pode instalá-lo diretamente no gerenciador sem flashar manualmente. Após o sistema OTA, você pode instalá-lo diretamente no segundo slot sem flashar manualmente. -3. Adequado para alguns cenários especiais. Por exemplo, o LKM também pode ser carregado com privilégios root temporários. Como não é necessário substituir a partição boot, ele não acionará o AVB e não causará o bloqueio do dispositivo. -4. O LKM pode ser desinstalado temporariamente. Se você deseja desativar temporariamente o acesso root, você pode desinstalar o LKM. Este processo não requer o flash de partições, nem mesmo a reinicialização do dispositivo. Se quiser ativar o root novamente, basta reiniciar o dispositivo. - -::: tip COEXISTÊNCIA DE DOIS MODOS -Após abrir o gerenciador, você pode ver o modo atual do dispositivo na página inicial. Observe que a prioridade do modo GKI é maior que a do LKM. Por exemplo, se você usar o kernel GKI para substituir o kernel original e usar LKM para corrigir o kernel GKI, o LKM será ignorado e o dispositivo sempre será executado no modo GKI. -::: - -### Qual escolher? {#which-one} - -Se o seu aparelho for um celular, recomendamos que você priorize o modo LKM. Se o seu dispositivo for um emulador, WSA ou Waydroid, recomendamos que você priorize o modo GKI. - -## Instalação do LKM - -### Obtenha o firmware oficial - -Para usar o modo LKM, você precisa obter o firmware oficial e corrigi-lo com base no firmware oficial. Se você usar um kernel de terceiros, poderá usar o `boot.img` do kernel de terceiros como firmware oficial. - -Existem muitas maneiras de obter o firmware oficial. Se o seu dispositivo suportar `fastboot boot`, então recomendamos **o método mais simples e indicado**, que consiste em usar `fastboot boot` para inicializar temporariamente o kernel GKI fornecido pelo KernelSU, depois instalar o gerenciador e, finalmente, instalá-lo diretamente pelo gerenciador. Este método não exige o download manual do firmware oficial nem a extração manual do boot. - -Se o seu dispositivo não suportar `fastboot boot`, pode ser necessário baixar manualmente o pacote de firmware oficial e extrair o boot dele. - -Ao contrário do modo GKI, o modo LKM modifica o `ramdisk`. Portanto, em dispositivos com Android 13, ele precisa corrigir a partição `init_boot` em vez da partição `boot`, enquanto o modo GKI sempre opera sobre a partição `boot`. - -### Use o gerenciador - -Abra o gerenciador, clique no ícone de instalação no canto superior direito e diversas opções aparecerão: - -1. Selecione um arquivo. Se o seu dispositivo não tiver privilégios root, você pode escolher esta opção e, em seguida, selecionar o seu firmware oficial. O gerenciador corrigirá automaticamente o firmware. Após isso, basta fazer o flash deste arquivo corrigido para obter privilégios root permanentemente. -2. Instalação direta. Se o seu dispositivo já estiver rooteado, você pode escolher esta opção. O gerenciador obterá automaticamente as informações do seu dispositivo, corrigirá o firmware oficial e realizará o flash automaticamente. Você também pode usar o comando `fastboot boot` junto com o kernel GKI do KernelSU para obter root temporário e instalar o gerenciador, e então usar esta opção. Esta também é a principal forma de atualizar o KernelSU. -3. Instalar no slot inativo. Se o seu dispositivo suportar partição A/B, você pode escolher esta opção. O gerenciador corrigirá automaticamente o firmware oficial e o instalará em outra partição. Esse método é adequado para dispositivos após o OTA, você pode instalá-lo diretamente em outra partição após o OTA e, em seguida, reiniciar o dispositivo. - -### Use a linha de comando - -Se não quiser usar o gerenciador, você também pode usar a linha de comando para instalar o LKM. A ferramenta `ksud` fornecida pelo KernelSU pode ajudá-lo a corrigir rapidamente o firmware oficial e depois fazer o flash. - -Esta ferramenta oferece suporte ao macOS, Linux e Windows. Você pode baixar a versão correspondente em [GitHub Release](https://github.com/tiann/KernelSU/releases). - -Uso: `ksud boot-patch` você pode verificar a ajuda da linha de comando para opções específicas. - -```sh -oriole:/ # ksud boot-patch -h -Patch boot ou imagens init_boot para aplicar o KernelSU - -Uso: ksud boot-patch [OPTIONS] - -Opções: - -b, --boot Caminho da imagem boot. Se não especificado, tentará encontrar a imagem boot automaticamente - -k, --kernel Caminho da imagem do kernel a ser substituída - -m, --module Caminho do módulo LKM a ser substituído. Se não especificado, usará o módulo integrado - -i, --init init a ser substituído - -u, --ota Usará outro slot se a imagem boot não for especificada - -f, --flash Flash para a partição boot após o patch - -o, --out Caminho de saída. Se não especificado, usará o diretório atual - --magiskboot Caminho do magiskboot. Se não especificado, usará a versão integrada - --kmi Versão do KMI. Se especificada, usará o KMI indicado - -h, --help Imprimir ajuda -``` - -Algumas opções que precisam ser explicadas: - -1. A opção `--magiskboot` pode especificar o caminho do magiskboot. Se não for especificado, o ksud irá procurá-lo nas variáveis ​​de ambiente. Se você não souber como obter o magiskboot, você pode verificar [aqui](#patch-boot-image). -2. A opção `--kmi` pode especificar a versão do `KMI`. Se o nome do kernel do seu dispositivo não seguir a especificação KMI, você poderá especificá-lo através desta opção. - -O uso mais comum é: - -```sh -ksud boot-patch -b --kmi android13-5.10 -``` - -## Instalação no modo GKI - -Existem vários métodos de instalação para o modo GKI, cada um adequado para um cenário diferente, portanto escolha conforme necessário. - -1. Instalar com fastboot usando o boot.img fornecido pelo KernelSU. -2. Instalar com um app kernel flash, como o [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases). -3. Corrigir manualmente o boot.img e instalá-lo. -4. Instalar com Recovery personalizado (por exemplo, TWRP). - -## Instalar com o boot.img fornecido pelo KernelSU - -Se o `boot.img` do seu dispositivo usa um formato de compactação comumente usado, você pode usar as imagens GKI fornecidas pelo KernelSU para atualizá-lo diretamente. Não requer TWRP ou autocorreção da imagem. - -### Encontre o boot.img adequado - -O KernelSU fornece um boot.img genérico para dispositivos GKI, e você deve fazer o flash do boot.img na partição boot do dispositivo. - -Você pode baixar o boot.img em [GitHub Release](https://github.com/tiann/KernelSU/releases). Por favor, observe que você deve usar a versão correta do boot.img. Se você não sabe qual arquivo baixar, leia atentamente a descrição do [KMI](#kmi) e [Nível do patch de segurança](#security-patch-level) neste documento. - -Normalmente, existem três arquivos de inicialização em formatos diferentes para o mesmo KMI e nível de patch de segurança. Eles são idênticos, exceto pelo formato de compactação do kernel. Por favor, verifique o formato de compactação do kernel de seu boot.img original. Você deve usar o formato correto, como `lz4` ou `gz`. Se você usar um formato de compactação incorreto, poderá encontrar bootloop após o flash do boot.img. - -::: info FORMATO DE COMPACTAÇÃO DO BOOT.IMG -1. Você pode usar o magiskboot para obter o formato de compactação do seu boot.img original. Alternativamente, você também pode perguntar a membros ou desenvolvedores da comunidade que possuam o mesmo modelo de dispositivo. Além disso, o formato de compactação do kernel geralmente não muda, portanto, se você inicializar com êxito com um determinado formato de compactação, poderá tentar esse formato mais tarde. -2. Dispositivos Xiaomi geralmente usam `gz` ou `uncompressed`. -3. Para dispositivos Pixel, siga as instruções abaixo: -::: - -### Flash o boot.img para o dispositivo - -Use o `adb` para conectar seu dispositivo, execute `adb reboot bootloader` para entrar no modo fastboot e use este comando para flashar o KernelSU: - -```sh -fastboot flash boot boot.img -``` - -::: info INFORMAÇÕES -Se o seu dispositivo suportar `fastboot boot`, você pode usar primeiro `fastboot boot boot.img` para tentar usar o boot.img para inicializar o sistema primeiro. Se algo inesperado acontecer, reinicie-o novamente para inicializar. -::: - -### Reiniciar - -Após a conclusão do flash, você deve reiniciar o dispositivo: - -```sh -fastboot reboot -``` - -## Instalar com Kernel Flasher - -Etapa: - -1. Baixe o ZIP AnyKernel3. Se você não sabe qual arquivo baixar, leia atentamente a descrição do [KMI](#kmi) e [Nível do patch de segurança](#security-patch-level) neste documento. -2. Abra o app Kernel Flasher, conceda as permissões de root necessárias e use o ZIP AnyKernel3 fornecido para fazer o flash. - -Dessa forma, é necessário que o app Kernel Flasher tenha privilégios root. Você pode usar os seguintes métodos para conseguir isso: - -1. Seu dispositivo está rooteado. Por exemplo, você instalou o KernelSU e deseja atualizar para a versão mais recente ou fez o root por meio de outros métodos (como Magisk). -2. Se o seu dispositivo não estiver rooteado, mas suportar o método de inicialização temporária como `fastboot boot boot.img`, você pode usar a imagem GKI fornecida pelo KernelSU para inicializar temporariamente o seu dispositivo, obter privilégios root temporário e, em seguida, usar o Kernel Flasher para obter privilégios root permanente. - -Aqui estão alguns apps que podem ser usados para realizar o flash do kernel: - -1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases) -2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel) -3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager) - -Observação: Este método é mais conveniente ao atualizar o KernelSU e pode ser feito sem um computador (faça um backup primeiro). - -## Corrigir boot.img manualmente {#patch-boot-image} - -Para alguns dispositivos, o formato boot.img não é tão comum como `lz4`, `gz` e `uncompressed`. Um exemplo típico é o Pixel, cujo boot.img é compactado no formato `lz4_legacy`, enquanto o ramdisk pode estar em `gz` ou também comprimido em `lz4_legacy`. Atualmente, se você flashar diretamente o boot.img fornecido pelo KernelSU, o dispositivo pode não conseguir inicializar. Nesse caso, é necessário corrigir manualmente o boot.img para conseguir isso. - -É sempre recomendado usar `magiskboot` para corrigir imagens, existem duas maneiras: - -1. [magiskboot](https://github.com/topjohnwu/Magisk/releases) -2. [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) - -A versão oficial do `magiskboot` só pode ser executada em dispositivos Android, se você quiser rodar no PC, você pode tentar a segunda opção. - -::: tip DICA -Android-Image-Kitchen não é recomendado por enquanto, porque ele não lida corretamente com os metadados de inicialização (como o nível do patch de segurança). Portanto, pode não funcionar em alguns dispositivos. -::: - -### Preparação - -1. Obtenha o boot.img padrão do dispositivo. Você pode obtê-lo com os fabricantes do seu dispositivo. Talvez você precise do [payload-dumper-go](https://github.com/ssut/payload-dumper-go). -2. Baixe o arquivo ZIP AnyKernel3 fornecido pelo KernelSU que corresponde à versão KMI do seu dispositivo. Você pode consultar [Instalar com Recovery personalizado](#install-with-custom-recovery). -3. Descompacte o pacote AnyKernel3 e obtenha o arquivo `Image`, que é o arquivo do kernel do KernelSU. - -### Usando o magiskboot em dispositivos Android {#using-magiskboot-on-Android-devices} - -1. Baixe o Magisk mais recente em [GitHub Releases](https://github.com/topjohnwu/Magisk/releases). -2. Renomeie o `Magisk-*(versão).apk` para `Magisk-*.zip` e descompacte-o. -3. Envie `Magisk-*/lib/arm64-v8a/libmagiskboot.so` para o seu dispositivo por ADB: `adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot`. -4. Envie o boot.img padrão e Image em AnyKernel3 para o seu dispositivo. -5. Entre no ADB shell e execute o diretório `cd /data/local/tmp/`, em seguida, `chmod +x magiskboot`. -6. Entre no ADB shell e execute o diretório `cd /data/local/tmp/`, execute `./magiskboot unpack boot.img` para descompactar `boot.img`, você obterá um arquivo `kernel`, este é o seu kernel padrão. -7. Substitua `kernel` por `Image` executando o comando: `mv -f Image kernel`. -8. Execute `./magiskboot repack boot.img` para reembalar o boot.img, e você obterá um arquivo `new-boot.img`, faça o flash deste arquivo para o dispositivo por fastboot. - -### Usando o magiskboot no PC Windows/macOS/Linux {#using-magiskboot-on-PC} - -1. Baixe o `magiskboot` adequado para o seu sistema operacional em [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci). -2. Prepare o `boot.img` padrão e `Image` em seu PC. -3. Execute `chmod +x magiskboot`. -4. Entre no diretório apropriado, execute `./magiskboot unpack boot.img` para descompactar `boot.img`. Você obterá um arquivo `kernel`, este é o seu kernel padrão. -5. Substitua `kernel` por `Image` executando o comando: `mv -f Image kernel`. -6. Execute `./magiskboot repack boot.img` para reembalar o boot.img, e você obterá um arquivo `new-boot.img`, faça o flash deste arquivo para o dispositivo por fastboot. - -::: info INFORMAÇÕES -O `magiskboot` oficial pode executar o dispositivo `Linux` normalmente. Se você for um usuário Linux, você pode usar a versão oficial. -::: - -## Instalar com Recovery personalizado {#install-with-custom-recovery} - -Pré-requisito: Seu dispositivo deve ter um Recovery personalizado, como TWRP. Se não houver Recovery personalizado disponível para o seu dispositivo, use outro método. - -Etapas: - -1. Em [GitHub Releases](https://github.com/tiann/KernelSU/releases), baixe o pacote ZIP começando com AnyKernel3 que corresponde à versão do seu dispositivo. Por exemplo, a versão do kernel do dispositivo é `android12-5.10.66`, então você deve baixar o arquivo `AnyKernel3-android12-5.10.66_yyyy-MM.zip` (onde `yyyy` é o ano e `MM` é o mês). -2. Reinicie o dispositivo no TWRP. -3. Use o ADB para colocar AnyKernel3-*.zip no dispositivo em `/sdcard` e escolha instalá-lo na interface do TWRP, ou você pode diretamente executar `adb sideload AnyKernel-*.zip` para instalar. - -Observação: Este método é adequado para qualquer instalação (não limitado à instalação inicial ou atualizações subsequentes), desde que você use o TWRP. - -## Outros métodos - -Na verdade, todos esses métodos de instalação têm apenas uma ideia principal, que é **substituir o kernel original pelo fornecido pelo KernelSU**, desde que isso possa ser alcançado, ele pode ser instalado. A seguir estão outros métodos possíveis: - -1. Primeiro instale o Magisk, obtenha privilégios root através do Magisk e então use o Kernel Flasher para fazer o flash no ZIP AnyKernel3 do KernelSU. -2. Use algum kit de ferramentas de flash em PC para flashar no kernel fornecido pelo KernelSU. - -No entanto, se não funcionar, por favor, tente o método `magiskboot`. diff --git a/website/docs/pt_BR/guide/module-webui.md b/website/docs/pt_BR/guide/module-webui.md deleted file mode 100644 index 97de5f7f..00000000 --- a/website/docs/pt_BR/guide/module-webui.md +++ /dev/null @@ -1,48 +0,0 @@ -# Módulo WebUI - -Além de executar scripts de inicialização e modificar arquivos do sistema, os módulos do KernelSU também suportam a exibição de interfaces da UI e à interação direta com os usuários. - -O módulo pode escrever páginas HTML + CSS + JavaScript através de qualquer tecnologia web. O gerenciador do KernelSU exibirá essas páginas através do WebView. Ele também fornece algumas APIs para interagir com o sistema, como executar comandos shell. - -## Diretório `webroot` - -Os arquivos de recursos da web devem ser colocados no subdiretório `webroot` do diretório raiz do módulo, e **DEVE** haver um arquivo chamado `index.html`, que é a entrada da página do módulo. A estrutura do módulo mais simples contendo uma interface web é a seguinte: - -```txt -❯ tree . -. -|-- module.prop -`-- webroot - `-- index.html -``` - -::: warning AVISO -Ao instalar o módulo, KernelSU definirá automaticamente as permissões e o contexto do SELinux deste diretório. Se você não sabe o que está fazendo, não defina você mesmo as permissões deste diretório! -::: - -Se sua página contém CSS e JavaScript, você também precisa colocá-la neste diretório. - -## API JavaScript - -Se for apenas uma página de exibição, ela funcionará como uma página web comum. No entanto, o mais importante é que o KernelSU oferece uma série de APIs de sistema, permitindo a implementação de funções exclusivas do módulo. - -O KernelSU disponibiliza uma biblioteca JavaScript, que está publicada no [npm](https://www.npmjs.com/package/kernelsu) e pode ser usada no código JavaScript das suas páginas web. - -Por exemplo, você pode executar um comando shell para obter uma configuração específica ou modificar uma propriedade: - -```JavaScript -import { exec } from 'kernelsu'; - -const { errno, stdout } = exec("getprop ro.product.model"); -``` - -Para outro exemplo, você pode fazer com que a página web seja exibida em tela inteira ou exibir um dica. - -[Documentação da API](https://www.npmjs.com/package/kernelsu) - -Se você achar que a API existente não atende às suas necessidades ou é inconveniente de usar, fique à vontade para nos dar sugestões [aqui](https://github.com/tiann/KernelSU/issues)! - -## Algumas dicas - -1. Você pode usar `localStorage` normalmente para armazenar alguns dados, mas tenha em mente que eles serão perdidos caso o app gerenciador seja desinstalado. Se precisar de armazenamento persistente, será necessário gravar os dados manualmente em algum diretório. -2. Para páginas simples, recomendamos o uso do [parceljs](https://parceljs.org/) para empacotamento. Ele não exige configuração inicial e é extremamente prático de usar. No entanto, se você é um especialista em front-end ou possui suas próprias preferências, sinta-se à vontade para usar a ferramenta de sua escolha! diff --git a/website/docs/pt_BR/guide/module.md b/website/docs/pt_BR/guide/module.md deleted file mode 100644 index b7f4e359..00000000 --- a/website/docs/pt_BR/guide/module.md +++ /dev/null @@ -1,326 +0,0 @@ -# Guias de módulo - -O KernelSU fornece um mecanismo de módulo que consegue modificar o diretório do sistema enquanto mantém a integridade da partição do sistema. Esse mecanismo é conhecido como "sem sistema". - -O mecanismo de módulos do KernelSU é quase o mesmo do Magisk. Se você já está familiarizado com o desenvolvimento de módulos Magisk, o desenvolvimento de módulos KernelSU é muito semelhante. Você pode pular a introdução dos módulos abaixo e só precisa ler [Diferenças com Magisk](difference-with-magisk.md). - -## WebUI - -Os módulos do KernelSU suportam a exibição de interfaces e a interação com os usuários. Para mais detalhes, consulte a [documentação do WebUI](module-webui.md). - -## BusyBox - -O KernelSU vem com um recurso binário BusyBox completo (incluindo suporte completo ao SELinux). O executável está localizado em `/data/adb/ksu/bin/busybox`. O BusyBox do KernelSU suporta "ASH Standalone Shell Mode" alternável em tempo de execução. O que este Modo Autônomo significa é que ao executar no shell `ash` do BusyBox, cada comando usará diretamente o miniaplicativo dentro do BusyBox, independentemente do que estiver definido em `PATH`. Por exemplo, comandos como `ls`, `rm`, `chmod` **NÃO** usarão o que está em `PATH` (no caso do Android, por padrão será `/system/bin/ls`, `/system/bin/rm` e `/system/bin/chmod` respectivamente), mas em vez disso chamará diretamente os miniaplicativos internos do BusyBox. Isso garante que os scripts sempre sejam executados em um ambiente previsível e sempre tenham o conjunto completo de comandos, independentemente da versão do Android em que estão sendo executados. Para forçar um comando a **NÃO** usar o BusyBox, você deve chamar o executável com caminhos completos. - -Cada script shell executado no contexto do KernelSU será executado no shell `ash` do BusyBox com o Modo Autônomo ativado. Para o que é relevante para desenvolvedores terceirizados, isso inclui todos os scripts de inicialização e scripts de instalação de módulos. - -Para aqueles que desejam usar o recurso Modo Autônomo fora do KernelSU, existem 2 maneiras de ativá-los: - -1. Definir a variável de ambiente `ASH_STANDALONE` como `1`.
Exemplo: `ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
MantenedorRepositórioDispositivos suportados
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
diff --git a/website/docs/pt_BR/guide/what-is-kernelsu.md b/website/docs/pt_BR/guide/what-is-kernelsu.md deleted file mode 100644 index 6fd30023..00000000 --- a/website/docs/pt_BR/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# O que é KernelSU? - -O KernelSU é uma solução root para dispositivos Android GKI, funciona no modo kernel e concede privilégios root para apps do espaço do usuário diretamente no espaço do kernel. - -## Características - -A principal característica do KernelSU é que ele é baseado em kernel. O KernelSU funciona no modo kernel, portanto pode fornecer uma interface de kernel que nunca tivemos antes. Por exemplo, é possível adicionar pontos de interrupção de hardware a qualquer processo no modo kernel, acessar a memória física de qualquer processo de forma invisível, interceptar qualquer chamada de sistema (syscall) no espaço do kernel, entre outras funcionalidades. - -E também, o KernelSU fornece um sistema de módulos via OverlayFS, que permite carregar seu plugin personalizado no sistema. Ele também fornece um mecanismo para modificar arquivos na partição `/system`. - -## Como usar o KernelSU? - -Por favor, consulte: [Instalação](installation) - -## Como compilar o KernelSU? - -Por favor, consulte: [Como compilar](how-to-build) - -## Discussão - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/pt_BR/index.md b/website/docs/pt_BR/index.md deleted file mode 100644 index b3730f25..00000000 --- a/website/docs/pt_BR/index.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: home -title: Início - -hero: - name: KernelSU - text: Uma solução root baseada em kernel para Android - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: Iniciar - link: /pt_BR/guide/what-is-kernelsu - - theme: alt - text: Ver no GitHub - link: https://github.com/tiann/KernelSU - -features: - - title: Baseado em kernel - details: Como o nome sugere, KernelSU funciona no kernel Linux, dando-lhe mais controle sobre os apps do espaço do usuário. - - title: Controle de acesso root - details: Somente apps permitidos podem acessar ou ver su, todos os outros apps não estão cientes disso. - - title: Privilégios root personalizáveis - details: KernelSU permite a personalização de su, uid, gid, grupos, capacidades e regras do SELinux, bloqueando privilégios root. - - title: Módulos - details: Os módulos podem modificar /system sem sistema usando OverlayFS proporcionando flexibilidade significativa. diff --git a/website/docs/public/ads.txt b/website/docs/public/ads.txt deleted file mode 100644 index 1cc2b879..00000000 --- a/website/docs/public/ads.txt +++ /dev/null @@ -1 +0,0 @@ -google.com, pub-2610070972052494, DIRECT, f08c47fec0942fa0 diff --git a/website/docs/public/favicon.ico b/website/docs/public/favicon.ico deleted file mode 100644 index 99954ac0..00000000 Binary files a/website/docs/public/favicon.ico and /dev/null differ diff --git a/website/docs/public/logo.png b/website/docs/public/logo.png deleted file mode 100644 index cddff920..00000000 Binary files a/website/docs/public/logo.png and /dev/null differ diff --git a/website/docs/public/templates/.gitkeep b/website/docs/public/templates/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/website/docs/public/templates/adaway.root b/website/docs/public/templates/adaway.root deleted file mode 100644 index 5b78b3d3..00000000 --- a/website/docs/public/templates/adaway.root +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id":"adaway.root", - "name":"Adaway Root", - "author":"JohnRTitor", - "description":"Only essential permissions to let Adaway modify hosts file and operate a web server.", - "uid":0, - "gid":0, - "groups":[ - "ROOT" - ], - "capabilities":[ - "CAP_DAC_OVERRIDE", - "CAP_NET_BIND_SERVICE", - "CAP_SYS_PTRACE" - ], - "context":"u:r:su:s0", - "namespace":"INHERITED", - "locales": { - "zh_TW": { - "name": "Adaway Root", - "description": "僅允許 Adaway 修改 hosts 和執行 Web 伺服器的必要權限" - }, - "bn": { - "name": "অ্যাডঅ্যাওয়ে রুট", - "description": "অ্যাডঅ্যাওয়ে সিস্টেমের হোস্ট ফাইল পরিবর্তন এবং ওয়েবসার্ভার চালু করতে কমপক্ষে যা অনুমতি লাগে।" - }, - "pt_BR": { - "name": "Adaway Root", - "description": "Apenas permissões essenciais para permitir que Adaway modifique o arquivo hosts e opere um servidor web." - }, - "tr": { - "name": "Adaway Root", - "description": "Adaway'in hosts dosyasını değiştirmesine ve bir web sunucusunu çalıştırmasına izin vermek için gerekli izinler." - }, - "it_IT": { - "name": "Adaway Root", - "description": "Concede le autorizzazioni essenziali affinché Adaway possa modificare il file host e gestire un server web. " - } - } -} diff --git a/website/docs/public/templates/adb b/website/docs/public/templates/adb deleted file mode 100644 index b03c8f09..00000000 --- a/website/docs/public/templates/adb +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id":"adb", - "name":"Adb", - "author":"kernelsu.org", - "description":"Minimal rules required by most apps using ADB privilege.", - "uid":2000, - "gid":2000, - "groups":[ - "ADB" - ], - "locales": { - "bn": { - "name": "এডিবি", - "description": "নূন্যতম অনুমতি যার দ্বারা এডিবি স্বচ্ছন্দে কাজ করতে পারে।" - }, - "zh_CN": { - "name": "Adb 模版", - "description": "大多数使用 ADB 权限应用所需要的最小权限" - }, - "zh_TW": { - "name": "Adb", - "description": "大多數使用 ADB 權限應用程式所需要的最低權限" - }, - "tr": { - "name": "Adb", - "description": "ADB ayrıcalığını kullanan çoğu uygulama için gereken minimum kurallar." - }, - "pt_BR": { - "name": "Adb", - "description": "Regras mínimas exigidas pela maioria dos apps que usam privilégio ADB." - }, - "ja": { - "name": "Adb", - "description": "ほとんどのアプリが使用するために必要な最小限のルール ADB." - }, - "it_IT": { - "name": "Adb", - "description": "Autorizzazioni minime richieste dalla maggior parte delle app che usano i privilegi di ADB." - } - } -} diff --git a/website/docs/public/templates/cemiuiler.readproc b/website/docs/public/templates/cemiuiler.readproc deleted file mode 100644 index bdf2c7d7..00000000 --- a/website/docs/public/templates/cemiuiler.readproc +++ /dev/null @@ -1,47 +0,0 @@ -{ - "id":"cemiuiler.readproc", - "name":"Cemiuiler", - "author":"refined-fish", - "description":"Grant Cemiuiler the minimum permissions to work properly-to restart the application.", - "namespace":"INHERITED", - "uid":10000, - "gid":10000, - "groups":[ - "READPROC" - ], - "capabilities":[ - "CAP_KILL" - ], - "context":"u:r:su:s0", - "rules":"", - "locales": { - "bn": { - "name": "সিমিউলার", - "description": "নূন্যতম অনুমতি যার দ্বারা সিমিউলার আবার কাজে বহাল হতে পারে।" - }, - "zh_CN": { - "name": "西米露Cemiuiler", - "description": "授予Cemiuiler能正常工作——重启作用域应用的最小限度权限。" - }, - "zh_TW": { - "name": "Cemiuiler", - "description": "授予Cemiuiler能正常運作-重啟作用域應用程式的最低權限" - }, - "tr": { - "name": "Cemiuiler", - "description": "Cemiuiler uygulamasına düzgün çalışması için minimum izinleri verin." - }, - "pt_BR": { - "name": "Cemiuiler", - "description": "Conceda ao Cemiuiler as permissões mínimas para funcionar corretamente para reiniciar o app." - }, - "ja": { - "name": "Cemiuiler", - "description": "Cemiuiler に適切に動作するための最小限の権限を付与し、アプリケーションを再起動します。" - }, - "it_IT": { - "name": "Cemiuiler", - "description": "Concedi a Cemiuiler le autorizzazioni minime per riavviare correttamente l'applicazione." - } - } -} diff --git a/website/docs/public/templates/incompetent.root b/website/docs/public/templates/incompetent.root deleted file mode 100644 index 67e42dbf..00000000 --- a/website/docs/public/templates/incompetent.root +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id":"incompetent.root", - "name":"Incompetent root", - "author":"kernelsu.org", - "description":"A incompetent root user without any capability.", - "uid":0, - "gid":0, - "groups":[ - "ROOT" - ], - "locales": { - "bn": { - "name": "অযোগ্য রুট ইউজার", - "description": "অযোগ্য রুট ইউজার যার কোনো স্পেশাল ক্ষমতা নেই।" - }, - "zh_CN": { - "name": "无能的 Root", - "description": "无任何权能的 root 用户。" - }, - "zh_TW": { - "name": "無能的 Root", - "description": "無任何權限的 root" - }, - "tr": { - "name": "Yetersiz root", - "description": "Herhangi bir özelliği olmayan yetersiz bir root kullanıcısı." - }, - "pt_BR": { - "name": "Root incompetente", - "description": "Um usuário root incompetente sem qualquer capacidade." - }, - "ja": { - "name": "無能な root", - "description": "権限のない root ユーザー。" - }, - "it_IT": { - "name": "Root incompetente", - "description": "Un utente root senza nessuna capacità." - } - } -} diff --git a/website/docs/public/templates/kernelmanager.root b/website/docs/public/templates/kernelmanager.root deleted file mode 100644 index 3973dd1d..00000000 --- a/website/docs/public/templates/kernelmanager.root +++ /dev/null @@ -1,50 +0,0 @@ -{ - "id":"kernelmanager.root", - "name":"Kernel Manager", - "author":"Rem01Gaming", - "description":"Commonly used in Kernel managers such as FKM and SmartPack.", - "uid":0, - "gid":0, - "groups":[ - "ROOT", - "READPROC" - ], - "capabilities":[ - "CAP_KILL", - "CAP_SYSLOG", - "CAP_SYS_BOOT", - "CAP_DAC_OVERRIDE" - ], - "context":"u:r:su:s0", - "namespace":"INHERITED", - "locales": { - "bn": { - "name": "কার্নেল ম্যানেজার", - "description": "এফ কে এম বা স্মার্টপ্যাক কার্নেল ম্যানেজারের যে অনুমতি লাগে।" - }, - "zh_TW": { - "name": "核心管理器", - "description": "常用於 FKM 和 SmartPack 等核心管理器" - }, - "in": { - "name": "Kernel Manager", - "description": "Umumnya digunakan pada Kernel manager seperti FKM dan SmartPack." - }, - "tr": { - "name": "Kernel Yöneticisi", - "description": "FKM ve SmartPack gibi Kernel Yöneticilerinde yaygın olarak kullanılır." - }, - "pt_BR": { - "name": "Gerenciador de Kernel", - "description": "Comumente usado em gerenciadores de Kernel como FKM e SmartPack." - }, - "ja": { - "name": "Kernel マネージャー", - "description": "FKM や SmartPack などの XXX マネージャーでよく使用されます。" - }, - "it_IT": { - "name": "Gestore Kernel", - "description": "Autorizzazioni comunemente richieste in applicazioni per gestire il Kernel come FKM e SmartPack." - } - } -} diff --git a/website/docs/public/templates/nethunter.root b/website/docs/public/templates/nethunter.root deleted file mode 100644 index fea93cd0..00000000 --- a/website/docs/public/templates/nethunter.root +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "nethunter.root", - "name": "Kali NetHunter", - "author": "cachiusa", - "description": "Required permissions for Kali NetHunter app to chroot.", - "namespace": "INHERITED", - "uid": 0, - "gid": 0, - "groups": [ - "ROOT" - ], - "capabilities": [ - "CAP_DAC_OVERRIDE", - "CAP_DAC_READ_SEARCH", - "CAP_SYS_CHROOT", - "CAP_SYS_PTRACE", - "CAP_SYS_ADMIN", - "CAP_SETGID" - ], - "context": "u:r:su:s0", - "locales": { - "bn": { - "name": "কালি নেটহানটার", - "description": "কালি নেটহানটার অ্যাপের কার্যকলাপের জন্য যে অনুমতিগুলি লাগে।" - }, - "zh_TW": { - "name": "Kali NetHunter", - "description": "提供Kali NetHunter使用chroot" - }, - "pt_BR": { - "name": "Kali NetHunter", - "description": "Permissões necessárias para o app Kali NetHunter fazer chroot." - }, - "it_IT": { - "name": "Kali NetHunter", - "description": "Autorizzazioni richieste per il chroot dell'applicazione Kali NetHunter." - } - } -} diff --git a/website/docs/public/templates/rootexploler.root b/website/docs/public/templates/rootexploler.root deleted file mode 100644 index 22f4bc09..00000000 --- a/website/docs/public/templates/rootexploler.root +++ /dev/null @@ -1,48 +0,0 @@ -{ - "id":"rootexploler.root", - "name":"Root Explorer", - "author":"Rem01Gaming", - "description":"File manager with Root capabilities.", - "uid":0, - "gid":0, - "groups":[ - "ROOT" - ], - "capabilities":[ - "CAP_DAC_READ_SEARCH", - "CAP_DAC_OVERRIDE", - "CAP_SYS_ADMIN" - ], - "context":"u:r:su:s0", - "namespace":"INHERITED", - "locales": { - "bn": { - "name": "রুট এক্সপ্লোরার", - "description": "রুট অনুমতি যুক্ত ফাইল ম্যানেজার।" - }, - "zh_TW": { - "name": "Root Explorer", - "description": "具有根目錄讀寫權限的檔案管理器" - }, - "in": { - "name": "Root Explorer", - "description": "File manager dengan kemampuan Root." - }, - "tr": { - "name": "Root Dosya Tarayıcı", - "description": "Root özelliklerine sahip dosya yöneticisi." - }, - "pt_BR": { - "name": "Explorador Root", - "description": "Gerenciador de arquivos com recursos root." - }, - "ja": { - "name": "Root ブラウザ", - "description": "Root 機能を備えたファイル マネージャー。" - }, - "it_IT": { - "name": "Gestore file root", - "description": "Gestore file con permessi root." - } - } -} diff --git a/website/docs/public/templates/shizuku.root b/website/docs/public/templates/shizuku.root deleted file mode 100644 index b07efeef..00000000 --- a/website/docs/public/templates/shizuku.root +++ /dev/null @@ -1,43 +0,0 @@ -{ - "id":"shizuku.root", - "name":"Shizuku Service", - "author":"Rem01Gaming & JohnRTitor", - "description":"Only essential permissions to start Shizuku service.", - "uid":0, - "gid":0, - "groups":[ - "SHELL" - ], - "capabilities":[ - "CAP_DAC_OVERRIDE", - "CAP_CHOWN" - ], - "context":"u:r:su:s0", - "namespace":"INHERITED", - "locales": { - "zh_TW": { - "name": "Shizuku", - "description": "只有啟動 Shizuku 服務所需的權限" - }, - "bn": { - "name": "শিজুকু সার্ভিস", - "description": "শিজুকু চালানোর জন্য শুধু যে অনুমতি গুলি লাগে।" - }, - "tr": { - "name": "Shizuku", - "description": "Shizuku servisini başlatmak için yalnızca gerekli izinler." - }, - "pt_BR": { - "name": "Shizuku", - "description": "Apenas permissões essenciais para iniciar o serviço Shizuku." - }, - "ja": { - "name": "Shizuku", - "description": "Shizuku サービスを開始するために必要な権限のみ。" - }, - "it_IT": { - "name": "Shizuku", - "description": "Permessi essenziali per avviare il servizio Shizuku." - } - } -} diff --git a/website/docs/public/templates/system b/website/docs/public/templates/system deleted file mode 100644 index 77f063a8..00000000 --- a/website/docs/public/templates/system +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id":"system", - "author":"kernelsu.org", - "name":"System", - "description":"The permission level at which the Android system runs without any capability.", - "uid":1000, - "gid":1000, - "groups":[ - "SYSTEM" - ], - "locales": { - "bn": { - "name": "সিস্টেম", - "description": "অ্যান্ড্রয়েড সিস্টেম যে অনুমতিগুলি নিয়ে কাজ করে।" - }, - "zh_CN": { - "name": "Android 系统", - "description": "Android 系统运行的权限级别,但没有任何权能。" - }, - "zh_TW": { - "name": "Android 系統", - "description": "Android 系統運作的權限級別,但沒有任何權能" - }, - "tr": { - "name": "Sistem", - "description": "Android sisteminin herhangi bir yetenek olmadan çalıştığı izin düzeyi." - }, - "pt_BR": { - "name": "Sistema", - "description": "O nível de permissão no qual o sistema Android é executado sem qualquer capacidade." - }, - "ja": { - "name": "System", - "description": "Android システムが実行される許可レベルですが、機能はありません。" - }, - "it_IT": { - "name": "Sistema", - "description": "Il livello di permessi con il quale viene eseguito il sistema operativo Android senza alcuna capacità." - } - } -} diff --git a/website/docs/public/templates/wireguard.root b/website/docs/public/templates/wireguard.root deleted file mode 100644 index bec290c0..00000000 --- a/website/docs/public/templates/wireguard.root +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id":"wireguard.root", - "name":"Wireguard kernel module function", - "author":"hotfur", - "description":"Essential permissions for a working Wireguard kernel module backend. The optional Wireguard command line tools installation requires DAC_OVERRIDE for writing binaries to /system/bin. Because it is optional for operation, DAC_OVERRIDE is not granted here but you can grant the capability temporarily then revoke it after the app installed the command line binaries.", - "uid":0, - "gid":0, - "groups":[ - "ROOT" - ], - "capabilities":[ - "CAP_DAC_READ_SEARCH", - "CAP_NET_ADMIN", - "CAP_NET_RAW" - ], - "context":"u:r:su:s0", - "namespace":"INHERITED", -} diff --git a/website/docs/repos.json b/website/docs/repos.json deleted file mode 100644 index 455c9e65..00000000 --- a/website/docs/repos.json +++ /dev/null @@ -1,723 +0,0 @@ -[ - { - "maintainer": "diphons", - "maintainer_link": "https://github.com/diphons", - "kernel_name": "kernel_xiaomi_sm8250", - "kernel_link": "https://github.com/diphons/kernel_xiaomi_sm8250/tree/main", - "devices": "Poco F3: alioth | Poco F4: munch | MI10T/PRO: Apollo" - }, - { - "maintainer": "diphons", - "maintainer_link": "https://github.com/diphons", - "kernel_name": "D8G_Kernel_SM8150", - "kernel_link": "https://github.com/diphons/D8G_Kernel_SM8150/tree/13", - "devices": "Poco X3 Pro: Vayu | Bhima" - }, - { - "maintainer": "diphons", - "maintainer_link": "https://github.com/diphons", - "kernel_name": "kernel_xiaomi_sdm845", - "kernel_link": "https://github.com/diphons/kernel_xiaomi_sdm845/tree/main", - "devices": "Poco F1" - }, - { - "maintainer": "diphons", - "maintainer_link": "https://github.com/diphons", - "kernel_name": "kernel_xiaomi_sm8350", - "kernel_link": "https://github.com/diphons/kernel_xiaomi_sm8350/tree/15", - "devices": "MI11T Pro: vili" - }, - { - "maintainer": "diphons", - "maintainer_link": "https://github.com/diphons", - "kernel_name": "D8G_Kernel_Marble", - "kernel_link": "https://github.com/diphons/D8G_Kernel_Marble/tree/op", - "devices": "Poco F5 | Redmi Note 12 Turbo | Marble" - }, - { - "maintainer": "diphons", - "maintainer_link": "https://github.com/diphons", - "kernel_name": "kernel_xiaomi_sm8635", - "kernel_link": "https://github.com/diphons/kernel_xiaomi_sm8635/tree/main", - "devices": "Poco F6: peridot" - }, - { - "maintainer": "th1nhhdk", - "maintainer_link": "https://github.com/th1nhhdk", - "kernel_name": "android_kernel_sony_sm8250-kernelsu", - "kernel_link": "https://github.com/th1nhhdk/android_kernel_sony_sm8250-kernelsu", - "devices": "Sony Xperia 1 II | Sony Xperia 5 II" - }, - { - "maintainer": "akash07k", - "maintainer_link": "https://github.com/akash07k", - "kernel_name": "nexus_kernel_xiaomi_sm8250", - "kernel_link": "https://github.com/akash07k/nexus_kernel_xiaomi_sm8250/tree/lychee", - "devices": "Poco F4: munch" - }, - { - "maintainer": "Hadad", - "maintainer_link": "https://xdaforums.com/m/hadad.8351572/", - "kernel_name": "android_kernel_xiaomi_onc", - "kernel_link": "https://github.com/hadadarjt/android_kernel_xiaomi_onc/tree/los21-KSU/local-non-gerrit-review", - "devices": "Redmi 7: onclite | Redmi Y3: onc" - }, - { - "maintainer": "HMTheBoy154", - "maintainer_link": "https://github.com/hmtheboy154", - "kernel_name": "Darkmatter-kernel", - "kernel_link": "https://github.com/hmtheboy154/Darkmatter-kernel", - "devices": "Generic x86_64 devices running Android-x86" - }, - { - "maintainer": "Asuka-mio", - "maintainer_link": "https://github.com/asuka-mio", - "kernel_name": "android_kernel_xiaomi_cas", - "kernel_link": "https://github.com/AcmeUI-Devices/android_kernel_xiaomi_cas", - "devices": "Mi 10 Ultra: cas" - }, - { - "maintainer": "xiaoleGun", - "maintainer_link": "https://github.com/xiaoleGun", - "kernel_name": "Miku_kernel_xiaomi_wayne", - "kernel_link": "https://github.com/Diva-Room/Miku_kernel_xiaomi_wayne", - "devices": "wayne" - }, - { - "maintainer": "SakuraNotStupid", - "maintainer_link": "https://github.com/SakuraKyuo", - "kernel_name": "android_kernel_xiaomi_sdm710", - "kernel_link": "https://github.com/SakuraKyuo/android_kernel_xiaomi_sdm710", - "devices": "Xiaomi MI 8 SE(sirius/xmsirius)" - }, - { - "maintainer": "zlm324", - "maintainer_link": "https://github.com/zlm324", - "kernel_name": "android_kernel_xiaomi_msm8998", - "kernel_link": "https://github.com/zlm324/android_kernel_xiaomi_msm8998_ksu", - "devices": "MI 6 (sagit) and MIX 2 (chiron) for LineageOS" - }, - { - "maintainer": "SlackerState", - "maintainer_link": "https://github.com/SlackerState", - "kernel_name": "android_kernel_xiaomi_sm6150", - "kernel_link": "https://github.com/SlackerState/android_kernel_xiaomi_sm6150", - "devices": "Redmi K30 4G (phoenix)" - }, - { - "maintainer": "RooGhz720", - "maintainer_link": "https://github.com/RooGhz720", - "kernel_name": "kernel_xiaomi_sm6150", - "kernel_link": "https://github.com/RooGhz720/kernel_xiaomi_sm6150", - "devices": "REDMI NOTE 10 PRO (sweet)" - }, - { - "maintainer": "OnlyTomInSecond", - "maintainer_link": "https://github.com/onlyTomInSecond/", - "kernel_name": "android_kernel_xiaomi_sdm845", - "kernel_link": "https://github.com/OnlyTomInSecond/android_kernel_xiaomi_sdm845", - "devices": "Mi 8 (dipper) for LineageOS" - }, - { - "maintainer": "Rohail33", - "maintainer_link": "https://github.com/Rohail33", - "kernel_name": "RealKing Kernel", - "kernel_link": "https://github.com/Rohail33/Realking_kernel_sm8250", - "devices": "Apollo(Redmi K30S Ultra/Mi 10T/Mi 10T Pro)\uff0cAlioth(Redmi K40/POCO F3/Mi 11X)\uff0cMunch(Redmi K40S/POCO F4), both MIUI and AOSP." - }, - { - "maintainer": "Sreeshankar K", - "maintainer_link": "https://github.com/sreeshankark", - "kernel_name": "NeverSettle Kernel", - "kernel_link": "https://github.com/sreeshankark/android_kernel_oneplus_avicii", - "devices": "OnePlus Nord (avicii)" - }, - { - "maintainer": "PSavarMattas", - "maintainer_link": "https://github.com/psavarmattas", - "kernel_name": "PSM Kernel", - "kernel_link": "https://github.com/psavarmattas/android_kernel_oneplus_sm7250-WKSU", - "devices": "OnePlus Nord (avicii)" - }, - { - "maintainer": "Molyuu", - "maintainer_link": "https://github.com/Molyuu", - "kernel_name": "neko_kernel_xiaomi_gauguin", - "kernel_link": "https://github.com/Molyuu/neko_kernel_xiaomi_gauguin", - "devices": "Redmi Note 9 Pro/ Mi 10T Lite/ Mi 10i " - }, - { - "maintainer": "guh0613", - "maintainer_link": "https://github.com/guh0613", - "kernel_name": "android_kernel_oppo_sm8150", - "kernel_link": "https://github.com/guh0613/android_kernel_oppo_sm8150", - "devices": "OPPO Reno Ace (OP4A89)" - }, - { - "maintainer": "LeviMarvin", - "maintainer_link": "https://github.com/LeviMarvin", - "kernel_name": "android_kernel_xiaomi_alioth", - "kernel_link": "https://github.com/LeviMarvin/android_kernel_xiaomi_alioth", - "devices": "Redmi K40 / POCO F3" - }, - { - "maintainer": "cibimo", - "maintainer_link": "https://github.com/cibimo", - "kernel_name": "kernel_xiaomi_raphael_ksu", - "kernel_link": "https://github.com/cibimo/kernel_xiaomi_raphael_ksu", - "devices": "Xiaomi Redmi K20 Pro / Mi 9T Pro (raphael)" - }, - { - "maintainer": "EndCredits", - "maintainer_link": "https://github.com/EndCredits", - "kernel_name": "kernel_xiaomi_sm7250", - "kernel_link": "https://github.com/EndCredits/kernel_xiaomi_sm7250", - "devices": "Redmi K30 5G ( picasso ) , Redmi K30i 5G ( picasso_48m)" - }, - { - "maintainer": "msnx", - "maintainer_link": "https://github.com/msnx", - "kernel_name": "android-msm-coral-4.14-android13", - "kernel_link": "https://github.com/msnx/KernelSU-Pixel4XL", - "devices": "Pixel 4 XL" - }, - { - "maintainer": "SoDebug", - "maintainer_link": "https://github.com/SoDebug", - "kernel_name": "kernel_xiaomi_raphael", - "kernel_link": "https://github.com/SoDebug/KernelSU_Kernel_Raphael", - "devices": "Xiaomi Redmi K20 Pro / Mi 9T Pro (raphael)" - }, - { - "maintainer": "H1mJT", - "maintainer_link": "https://github.com/H1mJT", - "kernel_name": "kernel_realme_RMX1901", - "kernel_link": "https://github.com/H1mJT/kernel_realme_RMX1901", - "devices": "Realme X (RMX1901/RMX1901CN)" - }, - { - "maintainer": "SonalSingh18", - "maintainer_link": "https://github.com/SonalSingh18", - "kernel_name": "android_kernel_xiaomi_sm6250", - "kernel_link": "https://github.com/SonalSingh18/android_kernel_xiaomi_sm6250", - "devices": "Miatoll [curtana, excalibur, gram, joyeuse]" - }, - { - "maintainer": "RooGhz720", - "maintainer_link": "https://github.com/RooGhz720", - "kernel_name": "kernel_xiaomi_lavender", - "kernel_link": "https://github.com/RooGhz720/kernel_xiaomi_lavender", - "devices": "Redmi Note 7 (Lavender)" - }, - { - "maintainer": "JunASAKA", - "maintainer_link": "https://github.com/JunASAKA", - "kernel_name": "kernel_google_msm-4.9_KernelSU", - "kernel_link": "https://github.com/JunASAKA/kernel_google_msm-4.9_KernelSU", - "devices": "Google Pixel 3a & 3a XL (sargo & bonito)" - }, - { - "maintainer": "RooGhz720", - "maintainer_link": "https://github.com/RooGhz720", - "kernel_name": "kernel_asus_X01BD", - "kernel_link": "https://github.com/RooGhz720/kernel_asus_X01BD", - "devices": "Asus Zenfone Max Pro M1/M2" - }, - { - "maintainer": "Evans Mike", - "maintainer_link": "https://github.com/etnperlong", - "kernel_name": "kernel_xiaomi_raphael_bool-x", - "kernel_link": "https://github.com/etnperlong/kernel_xiaomi_raphael_bool-x", - "devices": "Xiaomi Redmi K20 Pro / Mi 9T Pro (raphael)" - }, - { - "maintainer": "easterNday", - "maintainer_link": "https://github.com/DogDayAndroid", - "kernel_name": "KSU_Thyme_BuildBot", - "kernel_link": "https://github.com/DogDayAndroid/KSU_Thyme_BuildBot", - "devices": "Xiaomi 10S" - }, - { - "maintainer": "tedomi2705", - "maintainer_link": "https://github.com/tedomi2705", - "kernel_name": "kernel_xiaomi_sdm660", - "kernel_link": "https://github.com/tedomi2705/kernel_xiaomi_sdm660", - "devices": "Xiaomi Redmi Note 6 Pro (tulip)" - }, - { - "maintainer": "RyuujiX", - "maintainer_link": "https://github.com/RyuujiX", - "kernel_name": "android_kernel_asus_sdm660-4.19", - "kernel_link": "https://github.com/RyuujiX/android_kernel_asus_sdm660-4.19", - "devices": "Asus Zenfone Max Pro M1 (X00TD)/ M2 (X01BD) (Linux 4.19)" - }, - { - "maintainer": "liqidecg", - "maintainer_link": "https://github.com/liqidecg", - "kernel_name": "android_kernel_xiaomi_sdm710", - "kernel_link": "https://github.com/liqidecg/android_kernel_xiaomi_sdm710", - "devices": "Mi 8 SE (sirius) (Linux 4.9)" - }, - { - "maintainer": "Abdelhay-Ali", - "maintainer_link": "https://github.com/Abdelhay-Ali", - "kernel_name": "android_kernel_huawei_hi6250", - "kernel_link": "https://github.com/Abdelhay-Ali/android_kernel_huawei_hi6250_KernelSU", - "devices": "Huawei P20 lite (hi6250) (Linux 4.9)" - }, - { - "maintainer": "reocat", - "maintainer_link": "https://github.com/reocat", - "kernel_name": "android_kernel_nokia_sdm660_ksu", - "kernel_link": "https://github.com/reocat/android_kernel_nokia_sdm660_ksu", - "devices": "Nokia 6.1 (2018)" - }, - { - "maintainer": "Tuan Anh", - "maintainer_link": "https://github.com/log1cs", - "kernel_name": "kernel_nokia_msm8998", - "kernel_link": "https://github.com/log1cs/kernel_nokia_msm8998", - "devices": "Nokia 8 (Repartitioned)/8 Sirocco (NLA/A1N)" - }, - { - "maintainer": "bggRGjQaUbCoE", - "maintainer_link": "https://github.com/bggRGjQaUbCoE", - "kernel_name": "android_kernel_samsung_sm8250", - "kernel_link": "https://github.com/bggRGjQaUbCoE/android_kernel_samsung_sm8250-mohammad92", - "devices": "Samsung Galaxy S20+ 5G (y2q)" - }, - { - "maintainer": "SOVIET-ANDROID", - "maintainer_link": "https://github.com/SOVIET-ANDROID", - "kernel_name": "kernel_xiaomi_raphael", - "kernel_link": "https://github.com/SOVIET-ANDROID/kernel_xiaomi_raphael", - "devices": "XK20 Pro Raphael DSP & A only SAR support " - }, - { - "maintainer": "dabao1955", - "maintainer_link": "https://github.com/dabao1955", - "kernel_name": "android_kernel_OPPO_PEQM00", - "kernel_link": "https://github.com/dabao1955/android_kernel_OPPO_PEQM00", - "devices": "MediaTek devices in the OPPO Reno series on ColorOS13.x" - }, - { - "maintainer": "Aflaungos", - "maintainer_link": "https://github.com/Aflaungos", - "kernel_name": "android_kernel_motorola_msm8998", - "kernel_link": "https://github.com/Aflaungos/android_kernel_motorola_msm8998", - "devices": "Moto G6 Plus (evert)" - }, - { - "maintainer": "TheNoFace", - "maintainer_link": "https://github.com/TheNoFace", - "kernel_name": "kernel_oneplus_msm8998", - "kernel_link": "https://github.com/TheNoFace/kernel_oneplus_msm8998/tree/pe-13-ksu", - "devices": "OnePlus 5/5T (cheeseburger/dumpling)" - }, - { - "maintainer": "Nipin NA (Joker-V2)", - "maintainer_link": "https://github.com/Joker-V2", - "kernel_name": "Xcalibur kernel (violet)", - "kernel_link": "https://github.com/Joker-V2/kernel_xiaomi_violet/tree/kernelsu", - "devices": "Xiaomi Redmi Note 7 Pro (violet)" - }, - { - "maintainer": "Sr-Han", - "maintainer_link": "https://github.com/Sr-Han", - "kernel_name": "kernel_xiaomi_mojito", - "kernel_link": "https://github.com/Sr-Han/kernel_xiaomi_mojito", - "devices": "Redmi Note 10 (Sunny/Mojito)" - }, - { - "maintainer": "rushiranpise", - "maintainer_link": "https://github.com/rushiranpise", - "kernel_name": "android_kernel_samsung_exynos9610_mint", - "kernel_link": "https://github.com/rushiranpise/android_kernel_samsung_exynos9610_mint", - "devices": "Kernel 4.14.194 exynos9610 Non-GKI Device, Added KernelSu using manual method" - }, - { - "maintainer": "CN-Scars", - "maintainer_link": "https://github.com/CN-Scars", - "kernel_name": "pixel_experience_kernel_xiaomi_sm8250_kernelSU", - "kernel_link": "https://github.com/CN-Scars/pixel_experience_kernel_xiaomi_sm8250_kernelSU", - "devices": "Pixel Experience Kernel 4.19.282 for Xiaomi Redmi K40S / Xiaomi Poco F4 (munch)" - }, - { - "maintainer": "exer", - "maintainer_link": "https://github.com/ekkusa", - "kernel_name": "Miyo Toku", - "kernel_link": "https://github.com/Miiyo/android_kernel_sony_sdm845/tree/KSU/Toku", - "devices": "Sony Tama (akari, apollo, aurora, akatsuki) (Linux 4.9)" - }, - { - "maintainer": "likkai", - "maintainer_link": "https://github.com/likkai", - "kernel_name": "Quicksilver Kernel", - "kernel_link": "https://github.com/likkai/ksu_kernel_xiaomi_lisa", - "devices": "Xiaomi 11 Lite 5G NE (lisa)" - }, - { - "maintainer": "awakened1712", - "maintainer_link": "https://github.com/awakened1712", - "kernel_name": "android_kernel_samsung_exynos9820", - "kernel_link": "https://github.com/awakened1712/android_kernel_samsung_exynos9820", - "devices": "Samsung S10/N10" - }, - { - "maintainer": "awakened1712", - "maintainer_link": "https://github.com/awakened1712", - "kernel_name": "android_kernel_oneplus_sm8350", - "kernel_link": "https://github.com/awakened1712/android_kernel_oneplus_sm8350", - "devices": "Oneplus 9/9Pro" - }, - { - "maintainer": "siimsek", - "maintainer_link": "https://github.com/siimsek", - "kernel_name": "Lightning Kernel", - "kernel_link": "https://github.com/siimsek/Lightning-Kernel", - "devices": "Xiaomi Redmi Note 8/8T (ginkgo/willow)" - }, - { - "maintainer": "GiovanYCringe", - "maintainer_link": "https://github.com/GiovanYCringe", - "kernel_name": "kernel_a50", - "kernel_link": "https://github.com/GiovanYCringe-Experiments/kernel_a50", - "devices": "Galaxy A50 (A505f,fn,g,gn,gt)" - }, - { - "maintainer": "Asriadi Rahim", - "maintainer_link": "https://github.com/asriadirahim", - "kernel_name": "android_kernel_google_wahoo", - "kernel_link": "https://github.com/Google-Pixel2-2XL/kernel_google_wahoo", - "devices": "Google Pixel 2/2XL" - }, - { - "maintainer": "DawfukFR", - "maintainer_link": "https://github.com/DawfukFR", - "kernel_name": "kernel_oneplus_sm8250 (Stellaris-Kernel)", - "kernel_link": "https://github.com/DawfukFR/kernel_oneplus_sm8250", - "devices": "Oneplus 8 (Instantnoodle), Oneplus 8T (Kebab), Oneplus 8 Pro (Instantnoodlep), Oneplus 9R (lemonades) [msm-4.19]" - }, - { - "maintainer": "Tejas Singh", - "maintainer_link": "https://github.com/tejas101k", - "kernel_name": "kernel_xiaomi_ginkgo (Cuh Kernel)", - "kernel_link": "https://github.com/tejas101k/Cuh-KerneL", - "devices": "Xiaomi Redmi Note 8/8T (ginkgo/willow)" - }, - { - "maintainer": "Abdul Wahid Khan", - "maintainer_link": "https://github.com/Wahid7852", - "kernel_name": "kernel_xiaomi_begonia", - "kernel_link": "https://github.com/Nova-Kernels/kernel_xiaomi_mt6785", - "devices": "Redmi Note 8 Pro (Begonia/Begoniain)" - }, - { - "maintainer": "zfdx123", - "maintainer_link": "https://github.com/zfdx123", - "kernel_name": "kernel_xiaomi_alioth", - "kernel_link": "https://github.com/zfdx123/kernel_xiaomi_alioth", - "devices": "Redmi K40 (alioth)" - }, - { - "maintainer": "Bot-wxt1221", - "maintainer_link": "https://github.com/Bot-wxt1221", - "kernel_name": "android_kernel_oneplus_sdm845", - "kernel_link": "https://github.com/Bot-wxt1221/android_kernel_oneplus_sdm845", - "devices": "Oneplus 6 (enchilada) | Oneplus 6T (fajita) with Retrofit Dynamic Partitions Only with crdroid" - }, - { - "maintainer": "zlm324", - "maintainer_link": "https://github.com/zlm324", - "kernel_name": "android_kernel_xiaomi_msm8998_ksu", - "kernel_link": "https://github.com/zlm324/android_kernel_xiaomi_msm8998_ksu", - "devices": "a lineage kernel forked from LineageOS official repository, version 4.4.302, added ksu." - }, - { - "maintainer": "zlm324", - "maintainer_link": "https://github.com/zlm324", - "kernel_name": "android_kernel_xiaomi_msm8953_ksu", - "kernel_link": "https://github.com/zlm324/android_kernel_xiaomi_msm8953_ksu", - "devices": "Xiaomi 5X (tiffany)" - }, - { - "maintainer": "Vincent4440", - "maintainer_link": "https://github.com/Vincent4440", - "kernel_name": "android_kernel_xiaomi_sm8250", - "kernel_link": "https://github.com/Vincent4440/android_kernel_xiaomi_sm8250", - "devices": "Poco F4: munch" - }, - { - "maintainer": "tiandoufayale", - "maintainer_link": "https://github.com/tiandoufayale", - "kernel_name": "android_kernel_samsung_sm8250", - "kernel_link": "https://github.com/tiandoufayale/android_kernel_samsung_sm8250", - "devices": "Samsung Tab S7 WIFI(T870)" - }, - { - "maintainer": "starmoe", - "maintainer_link": "https://github.com/bro-xun", - "kernel_name": "android_kernel_oneplus_msm8998", - "kernel_link": "https://github.com/Bro-Xun/kernel_op5t_ksu", - "devices": "Oneplus 5/5T, kernel version 4.4.302" - }, - { - "maintainer": "supechicken", - "maintainer_link": "https://github.com/supechicken", - "kernel_name": "kernel_xiaomi_sm8350", - "kernel_link": "https://github.com/supechicken/kernel_xiaomi_sm8350", - "devices": " Xiaomi 11T Pro (vili)" - }, - { - "maintainer": "Vaz15k", - "maintainer_link": "https://github.com/Vaz15k", - "kernel_name": "kernelSU-A70q", - "kernel_link": "https://github.com/Vaz15k/kernelSU-A70q", - "devices": "Samsung Galaxy A70 ( A705MN / A705FN )" - }, - { - "maintainer": "whyakari", - "maintainer_link": "https://github.com/whyakari", - "kernel_name": "android_kernel_xiaomi_ginkgo", - "kernel_link": "https://github.com/whyakari/android_kernel_xiaomi_ginkgo", - "devices": "Xiaomi Redmi Note 8/8T (ginkgo/willow)" - }, - { - "maintainer": "wulan17", - "maintainer_link": "https://github.com/wulan17", - "kernel_name": "android_kernel_xiaomi_mt6765", - "kernel_link": "https://github.com/Mayuri-Chan/android_kernel_xiaomi_mt6765/tree/10-ksu", - "devices": "Redmi 6/6A (cereus/cactus)" - }, - { - "maintainer": "officialputuid", - "maintainer_link": "https://github.com/officialputuid", - "kernel_name": "android_kernel_realme_mt6785", - "kernel_link": "https://github.com/psionicprjkt/android_kernel_realme_mt6785", - "devices": "Realme 6/6i(Indian)/6s/7/Narzo/Narzo 20 Pro/Narzo 30 4G (RM6785)" - }, - { - "maintainer": "liquidprjkt", - "maintainer_link": "https://github.com/liquidprjkt", - "kernel_name": "liquid_kernel_realme_even", - "kernel_link": "https://github.com/liquidprjkt/liquid_kernel_realme_even", - "devices": "Realme C25/s and Narzo50A (even)" - }, - { - "maintainer": "Tonklaistonton", - "maintainer_link": "https://github.com/Tonklaistonton", - "kernel_name": "NEXGatokernel", - "kernel_link": "https://github.com/Tonklaistonton/android_kernel_oneplus_sm6375", - "devices": "Realme 9 pro 5g | Oneplus nord ce 2 lite " - }, - { - "maintainer": "CoolestEnoch", - "maintainer_link": "https://github.com/CoolestEnoch", - "kernel_name": "kernel-su-huawei-nova2", - "kernel_link": "https://github.com/CoolestEnoch/kernel-su-huawei-nova2", - "devices": "Huawei nova 2 (pic)" - }, - { - "maintainer": "RisenID", - "maintainer_link": "https://github.com/RisenID", - "kernel_name": "kernel_samsung_ascendia_sm7325", - "kernel_link": "https://github.com/RisenID/kernel_samsung_ascendia_sm7325", - "devices": "Samsung Galaxy A52s 5G (a52sxq)" - }, - { - "maintainer": "RisenID", - "maintainer_link": "https://github.com/RisenID", - "kernel_name": "kernel_samsung_ascendia_sm7125", - "kernel_link": "https://github.com/RisenID/kernel_samsung_ascendia_sm7125", - "devices": "Samsung Galaxy A52 4G (a52q)" - }, - { - "maintainer": "RisenID", - "maintainer_link": "https://github.com/RisenID", - "kernel_name": "kernel_samsung_ascendia_sm7125", - "kernel_link": "https://github.com/RisenID/kernel_samsung_ascendia_sm7125", - "devices": "Samsung Galaxy A72 (a72q)" - }, - { - "maintainer": "RisenID", - "maintainer_link": "https://github.com/RisenID", - "kernel_name": "kernel_samsung_ascendia_sm7325", - "kernel_link": "https://github.com/RisenID/kernel_samsung_ascendia_sm7325", - "devices": "Samsung Galaxy M52 5G (m52xq)" - }, - { - "maintainer": "A-JiuA", - "maintainer_link": "https://github.com/A-JiuA", - "kernel_name": "sirius_Kernel", - "kernel_link": "https://github.com/A-JiuA/sirius_Kernel", - "devices": "Xiaomi MI 8 SE(MIUI12/12.5)" - }, - { - "maintainer": "picasso09", - "maintainer_link": "https://github.com/picasso09", - "kernel_name": "KernelSU-RM6765R", - "kernel_link": "https://github.com/picasso09/RMX2189R/tree/c05-ksu", - "devices": "Realme C11 12 15 (RM6765)" - }, - { - "maintainer": "josedelinux", - "maintainer_link": "https://github.com/josedelinux", - "kernel_name": "kernel_google_msm-4.9", - "kernel_link": "https://github.com/josedelinux/kernel_google_msm-4.9", - "devices": "Google Pixel 3a & 3a XL (sargo & bonito)" - }, - { - "maintainer": "Lonelystar9x", - "maintainer_link": "https://github.com/lonelystar9x", - "kernel_name": "Kernel_xiaomi_sdm845", - "kernel_link": "https://github.com/lonelystar9x/android_kernel_xiaomi_sdm845", - "devices": "Poco F1 | MI8 | MiMix2S | MiMix3" - }, - { - "maintainer": "iceBear67", - "maintainer_link": "https://github.com/iceBear67", - "kernel_name": "android_kernel_exynos9810_kernelsu", - "kernel_link": "https://github.com/iceBear67/android_kernel_exynos9810_kernelsu", - "devices": "Galaxy Note 9(N960N/F)" - }, - { - "maintainer": "BlackMesa123", - "maintainer_link": "https://xdaforums.com/t/kernel-a546b-e-kernelsu-v0-7-5-for-galaxy-a54-5g.4607539/", - "kernel_name": "android_kernel_samsung_s5e8835", - "kernel_link": "https://github.com/BlackMesa123/android_kernel_samsung_s5e8835", - "devices": "Samsung Galaxy A54 5G (a54x)" - }, - { - "maintainer": "Fede2782", - "maintainer_link": "https://github.com/Fede2782", - "kernel_name": "android_kernel_samsung_a34x", - "kernel_link": "https://github.com/Fede2782/android_kernel_samsung_a34x/", - "devices": "Samsung Galaxy A34 5G (a34x)" - }, - { - "maintainer": "SnowWolf725 ", - "maintainer_link": "https://github.com/snowwolf725", - "kernel_name": "android_kernel_oneplus_sm8150", - "kernel_link": "https://github.com/snowwolf725/android_kernel_oneplus_sm8150", - "devices": "Oneplus 7(guacamoleb)/7 Pro(guacamole)/7T(hotdog)/7TPro (hotdogb)" - }, - { - "maintainer": "Fede2782", - "maintainer_link": "https://github.com/Fede2782", - "kernel_name": "android_kernel_samsung_gta4xl", - "kernel_link": "https://github.com/Fede2782/android_kernel_samsung_gta4xl", - "devices": "Galaxy Tab S6 Lite LTE (gta4xl)" - }, - { - "maintainer": "ArchVisions", - "maintainer_link": "https://github.com/ArchVisions", - "kernel_name": "android_kernel_samsung_gts9fewifi", - "kernel_link": "https://github.com/ArchVisions/android_kernel_samsung_gts9fewifi", - "devices": "Samsung Tab S9 FE (gts9fewifi) | Exynos 1380" - }, - { - "maintainer": "ravindu644", - "maintainer_link": "https://github.com/ravindu644", - "kernel_name": "android_kernel_beyondx_lpos", - "kernel_link": "https://github.com/ravindu644/android_kernel_beyondx_lpos", - "devices": "Galaxy S10 5G (KOR)" - }, - { - "maintainer": "ravindu644", - "maintainer_link": "https://github.com/ravindu644", - "kernel_name": "android_kernel_beyond1_lpos", - "kernel_link": "https://github.com/ravindu644/android_kernel_beyond1_lpos", - "devices": "Galaxy S10" - }, - { - "maintainer": "ravindu644", - "maintainer_link": "https://github.com/ravindu644", - "kernel_name": "android_kernel_beyond2", - "kernel_link": "https://github.com/ravindu644/android_kernel_beyond2", - "devices": "Galaxy S10+" - }, - { - "maintainer": "ravindu644", - "maintainer_link": "https://github.com/ravindu644", - "kernel_name": "android_kernel_beyond0", - "kernel_link": "https://github.com/ravindu644/android_kernel_beyond0", - "devices": "Galaxy S10e" - }, - { - "maintainer": "Rofikkernel", - "maintainer_link": "https://github.com/Rofikkernel", - "kernel_name": "kernel_lgv600tm_4.19", - "kernel_link": "https://github.com/Rofikkernel/kernel_lgv600tm_4.19", - "devices": "LG V60 timelm" - }, - { - "maintainer": "Dawid2849", - "maintainer_link": "https://github.com/Dawid2849", - "kernel_name": "android_kernel_lge_sm8150", - "kernel_link": "https://github.com/Dawid2849/android_kernel_lge_sm8150", - "devices": "LG G8 (alphaplus) / LG G8s (betalm) / LG G8X (mh2mml)" - }, - { - "maintainer": "lyc8503", - "maintainer_link": "https://github.com/lyc8503", - "kernel_name": "kernel_xiaomi_chopin", - "kernel_link": "https://github.com/ChopinKernels/kernel_xiaomi_chopin_android_S", - "devices": "Redmi Note 10 Pro 5G (chopin) / Poco X3 GT (choping)" - }, - { - "maintainer": "Fede2782", - "maintainer_link": "https://github.com/Fede2782", - "kernel_name": "android_kernel_motorola_sdm632", - "kernel_link": "https://github.com/Fede2782/android_kernel_motorola_sdm632", - "devices": "Motorola Moto G7 (river)" - }, - { - "maintainer": "EmanuelCN", - "maintainer_link": "https://github.com/EmanuelCN", - "kernel_name": "N0Kernel", - "kernel_link": "https://github.com/EmanuelCN/kernel_xiaomi_sm8250", - "devices": "Poco F3 (alioth) | Mi 10T/Pro (apollo) | Poco F4 (munch)" - }, - { - "maintainer": "kvsnr113", - "maintainer_link": "https://github.com/kvsnr113", - "kernel_name": "NOVA Kernel", - "kernel_link": "https://github.com/kvsnr113/xiaomi_sm8250_kernel", - "devices": "Poco F3 (alioth) | Mi 10T/Pro (apollo) | Poco F4 (munch)" - }, - { - "maintainer": "anVzdGFtb25", - "maintainer_link": "https://github.com/anVzdGFtb25", - "kernel_name": "android_kernel_xiaomi_mt6768", - "kernel_link": "https://github.com/anVzdGFtb25/android_kernel_xiaomi_mt6768", - "devices": "Redmi 9 ( lancelot )" - }, - { - "maintainer": "rifsxd", - "maintainer_link": "https://github.com/rifsxd", - "kernel_name": "android_kernel_realme_RMX3511", - "kernel_link": "https://github.com/rifsxd/android_kernel_realme_RMX3511", - "devices": "Realme C35 (RMX3511)" - }, - { - "maintainer": "qlAD", - "maintainer_link": "https://github.com/qlAD", - "kernel_name": "kernel_oneplus_sdm845", - "kernel_link": "https://github.com/qlAD/kernel_oneplus_sdm845", - "devices": "OnePlus 6 (enchilada) with PixelExperience " - }, - { - "maintainer": "rsuntkOrgs", - "maintainer_link": "https://github.com/rsuntkOrgs", - "kernel_name": "android_kernel_samsung_a05", - "kernel_link": "https://github.com/rsuntkOrgs/android_kernel_samsung_a05", - "devices": "Samsung Galaxy A05 (a05m) | SM-A055F/M | MT6768" - }, - { - "maintainer": "itejo443", - "maintainer_link": "https://github.com/itejo443", - "kernel_name": "android_kernel_samsung_sm7225", - "kernel_link": "https://github.com/itejo443/android_kernel_samsung_sm7225", - "devices": "Samsung Galaxy F23 and M23 (m23xq)" - } -] diff --git a/website/docs/ru_RU/guide/app-profile.md b/website/docs/ru_RU/guide/app-profile.md deleted file mode 100644 index b9c0b678..00000000 --- a/website/docs/ru_RU/guide/app-profile.md +++ /dev/null @@ -1,118 +0,0 @@ -# Профиль приложений - -Профиль приложений - это механизм, предоставляемый KernelSU для настройки конфигурации различных приложений. - -Для приложений, получивших права root (т.е. имеющих возможность использовать `su`), App Profile может также называться Root Profile. Он позволяет настраивать правила `uid`, `gid`, `groups`, `capabilities` и `SELinux` команды `su`, тем самым ограничивая привилегии пользователя root. Например, она может предоставлять сетевые права только приложениям межсетевого экрана, отказывая в праве доступа к файлам, или предоставлять права shell вместо полного root-доступа для приложений freeze: **сохранение власти в рамках принципа наименьших привилегий*. - -Для обычных приложений, не имеющих прав root, App Profile может управлять поведением ядра и системы модулей по отношению к этим приложениям. Например, он может определять, следует ли обращать внимание на модификации, возникающие в результате работы модулей. На основе этой конфигурации ядро и система модулей могут принимать решения, например, выполнять операции, аналогичные "скрытию". - -## Корневой профиль - -### UID, GID и группы - -В системах Linux существуют два понятия: пользователи и группы. Каждый пользователь имеет идентификатор пользователя (UID), а пользователь может принадлежать к нескольким группам, каждая из которых имеет свой идентификатор группы (GID). Эти идентификаторы используются для идентификации пользователей в системе и определяют, к каким системным ресурсам они могут получить доступ. - -Пользователи с UID, равным 0, называются корневыми пользователями, а группы с GID, равным 0, - корневыми группами. Группа пользователей root, как правило, обладает самыми высокими системными привилегиями. - -В случае системы Android каждое приложение является отдельным пользователем (исключая сценарии с общим UID) с уникальным UID. Например, `0` представляет пользователя root, `1000` - `system`, `2000` - ADB shell, а UID в диапазоне от 10000 до 19999 - обычные приложения. - -:::info -Здесь упомянутый UID не совпадает с концепцией нескольких пользователей или рабочих профилей в системе Android. На самом деле рабочие профили реализуются путем разделения диапазона UID. Например, 10000-19999 представляет собой основного пользователя, а 110000-119999 - рабочий профиль. Каждое обычное приложение среди них имеет свой уникальный UID. -::: - -Каждое приложение может иметь несколько групп, причем GID представляет собой основную группу, которая обычно совпадает с UID. Другие группы называются дополнительными. Определенные разрешения контролируются через группы, например, разрешения на доступ к сети или доступ к Bluetooth. - -Например, если мы выполним команду `id` в оболочке ADB, то результат может выглядеть следующим образом: - -```sh -oriole:/ $ id -uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0 -``` - -Здесь UID равен `2000`, а GID (идентификатор основной группы) также равен `2000`. Кроме того, он входит в несколько дополнительных групп, таких как `inet` (указывает на возможность создания сокетов `AF_INET` и `AF_INET6`) и `sdcard_rw` (указывает на права чтения/записи на SD-карту). - -Корневой профиль KernelSU позволяет настраивать UID, GID и группы для корневого процесса после выполнения команды `su`. Например, в корневом профиле корневого приложения можно установить его UID на `2000`, что означает, что при использовании `su` фактические разрешения приложения будут находиться на уровне оболочки ADB. Группа `inet` может быть удалена, что не позволит команде `su` получить доступ к сети. - -:::tip Примечание -Профиль приложений контролирует только разрешения корневого процесса после использования `su`; он не контролирует разрешения самого приложения. Если приложение запросило разрешение на доступ к сети, оно может получить доступ к сети даже без использования `su`. Удаление группы `inet` из `su` только предотвращает доступ `su` к сети. -::: - -Корневой профиль реализуется в ядре и не зависит от добровольного поведения root-приложений, в отличие от переключения пользователей или групп через `su`, предоставление прав `su` полностью зависит от пользователя, а не от разработчика. - -### Привилегии - -Привилегии - это механизм разделения привилегий в Linux. - -В традиционных реализациях UNIX для проверки прав доступа выделяются две категории процессов: привилегированные процессы (эффективный идентификатор пользователя равен 0 и называется суперпользователем или root) и непривилегированные процессы (эффективный UID которых не равен нулю). Привилегированные процессы обходят все проверки прав ядра, в то время как непривилегированные процессы подвергаются полной проверке прав на основе учетных данных процесса (обычно: эффективный UID, эффективный GID и список дополнительных групп). - -Начиная с версии Linux 2.2, в Linux привилегии, традиционно ассоциируемые с суперпользователем, разделены на отдельные единицы, называемые возможностями, которые могут быть независимо включены и выключены. - -Каждая способность представляет собой одну или несколько привилегий. Например, `CAP_DAC_READ_SEARCH` представляет собой возможность обхода проверок прав на чтение файлов, а также прав на чтение и выполнение каталогов. Если пользователь с эффективным UID `0` (пользователь root) не имеет возможности `CAP_DAC_READ_SEARCH` или более высоких возможностей, это означает, что, хотя он и является пользователем root, он не может читать файлы по своему усмотрению. - -Корневой профиль KernelSU позволяет настраивать возможности корневого процесса после выполнения `su`, тем самым добиваясь частичного предоставления "прав root". В отличие от вышеупомянутых UID и GID, некоторые root-приложения после использования `su` требуют UID, равный `0`. В таких случаях ограничение возможностей данного root-пользователя с UID `0` может ограничить их разрешенные операции. - -:::tip Настоятельная рекомендация -В документе привелегий Linux [официальной документации](https://man7.org/linux/man-pages/man7/capabilities.7.html) дается подробное объяснение возможностей, представленных каждой привелегией. Если вы собираетесь настраивать привелегии, настоятельно рекомендуется сначала прочитать этот документ. -::: - -### SELinux - -SELinux - это мощный механизм обязательного контроля доступа (MAC). Он работает по принципу **запрет по умолчанию**: любое действие, не разрешенное в явном виде, запрещается. - -SELinux может работать в двух глобальных режимах: - -1. Разрешительный режим: События запрета регистрируются, но не выполняются. -2. Принудительный режим: События запрета регистрируются и выполняются. - -:::warning Предупреждение -Современные системы Android в значительной степени опираются на SELinux для обеспечения общей безопасности системы. Настоятельно не рекомендуется использовать пользовательские системы, работающие в "разрешительном режиме", поскольку это не дает существенных преимуществ перед полностью открытой системой. -::: - -Объяснение полной концепции SELinux является сложным и выходит за рамки данного документа. Рекомендуется сначала разобраться в его работе с помощью следующих ресурсов: - -1. [Wikipedia](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) -2. [Red Hat: Что такое SELinux?](https://www.redhat.com/en/topics/linux/what-is-selinux) -3. [ArchLinux: SELinux](https://wiki.archlinux.org/title/SELinux) - -Корневой профиль KernelSU позволяет настраивать SELinux-контекст корневого процесса после выполнения команды `su`. Для этого контекста могут быть заданы специальные правила управления доступом, позволяющие осуществлять тонкий контроль над правами root. - -В типичных сценариях, когда приложение выполняет команду `su`, оно переключает процесс на домен SELinux с **неограниченным доступом**, например `u:r:su:s0`. С помощью профиля Root Profile этот домен может быть переключен на пользовательский домен, например `u:r:app1:s0`, и для него может быть определен ряд правил: - -```sh -type app1 -enforce app1 -typeattribute app1 mlstrustedsubject -allow app1 * * * -``` - -Обратите внимание, что правило `allow app1 * * *` используется только в демонстрационных целях. На практике это правило не должно широко использоваться, поскольку оно мало чем отличается от разрешительного режима. - -### Эскалация - -При неправильной настройке корневого профиля может возникнуть сценарий эскалации: ограничения, накладываемые корневым профилем, могут непреднамеренно не сработать. - -Например, если предоставить права root пользователю ADB shell (что является обычным случаем), а затем предоставить права root обычному приложению, но настроить его профиль root с UID 2000 (это UID пользователя ADB shell), то приложение может получить полный доступ root, выполнив команду `su` дважды: - -1. При первом выполнении команды `su` будет применен профиль App Profile и произойдет переход на UID `2000` (adb shell) вместо `0` (root). -2. При втором выполнении команды `su`, поскольку UID равен `2000`, а в конфигурации вы предоставили доступ root к UID `2000` (adb shell), приложение получит полные привилегии root. - -:::warning Примечание -Такое поведение вполне ожидаемо и не является ошибкой. Поэтому мы рекомендуем следующее: - -Если вам действительно необходимо предоставить права root в ADB (например, как разработчику), не рекомендуется изменять UID на `2000` при настройке корневого профиля. Лучше использовать `1000` (система). -::: - -## Некорневой профиль - -### Размонтирование модулей - -KernelSU предоставляет бессистемный механизм модификации системных разделов, реализуемый через монтирование overlayfs. Однако некоторые приложения могут быть чувствительны к такому поведению. Поэтому мы можем выгрузить модули, смонтированные в этих приложениях, установив опцию "размонтирование модулей". - -Кроме того, в интерфейсе настроек менеджера KernelSU имеется переключатель "размонтирование модулей по умолчанию". По умолчанию этот переключатель **включен**, что означает, что KernelSU или некоторые модули будут выгружать модули для данного приложения, если не будут применены дополнительные настройки. Если вам не нравится эта настройка или если она влияет на определенные приложения, у вас есть следующие возможности: - -1. Оставить переключатель "размонтирование модулей по умолчанию" и индивидуально отключить опцию "размонтирование модулей" в профиле приложений для приложений, требующих загрузки модулей (действует как "белый список"). -2. Отключить переключатель "размонтирование модулей по умолчанию" и индивидуально включить опцию "размонтирование модулей" в App Profile для приложений, требующих выгрузки модулей (действует как "черный список"). - -:::info -В устройствах, использующих ядро версии 5.10 и выше, выгрузку модулей выполняет само ядро. Однако для устройств с ядром версии ниже 5.10 этот переключатель является лишь опцией конфигурации, и KernelSU сам по себе не предпринимает никаких действий. Некоторые модули, например, Zygisksu, могут использовать этот переключатель для определения необходимости выгрузки модулей. -::: diff --git a/website/docs/ru_RU/guide/difference-with-magisk.md b/website/docs/ru_RU/guide/difference-with-magisk.md deleted file mode 100644 index 3d6ef44b..00000000 --- a/website/docs/ru_RU/guide/difference-with-magisk.md +++ /dev/null @@ -1,26 +0,0 @@ -# Различия с Magisk {#title} - -Несмотря на большое количество сходств между модулями KernelSU и модулями Magisk, неизбежно возникают и различия, обусловленные совершенно разными механизмами их реализации. Если вы хотите, чтобы ваш модуль работал как на Magisk, так и на KernelSU, вы должны понимать эти различия. - -## Сходства {#similarities} - -- Формат файлов модулей: оба используют формат zip для организации модулей, и формат модулей практически одинаков -- Каталог установки модулей: оба расположены в `/data/adb/modules`. -- Бессистемность: оба поддерживают модификацию /system бессистемным способом через модули -- post-fs-data.sh: время выполнения и семантика полностью совпадают -- service.sh: время выполнения и семантика полностью совпадают -- system.prop: полностью совпадает -- sepolicy.rule: полностью совпадает -- BusyBox: скрипты запускаются в BusyBox с включенным "автономным режимом" в обоих случаях - -## Различия {#differences} - -Прежде чем разбираться в различиях, необходимо знать, как отличить, в каком режиме работает ваш модуль - KernelSU или Magisk. Для этого можно использовать переменную окружения `KSU` во всех местах, где можно запустить скрипты модуля (`customize.sh`, `post-fs-data.sh`, `service.sh`). В KernelSU эта переменная окружения будет установлена в значение `true`. - -Вот некоторые отличия: - -- Модули KernelSU не могут быть установлены в режиме Recovery. -- Модули KernelSU не имеют встроенной поддержки Zygisk (но вы можете использовать модули Zygisk через [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). -- Метод замены или удаления файлов в модулях KernelSU полностью отличается от Magisk. KernelSU не поддерживает метод `.replace`. Вместо этого необходимо создать одноименный файл с помощью команды `mknod filename c 0 0` для удаления соответствующего файла. -- Каталоги для BusyBox отличаются. Встроенный BusyBox в KernelSU находится в каталоге `/data/adb/ksu/bin/busybox`, а в Magisk - в каталоге `/data/adb/magisk/busybox`. **Обратите внимание, что это внутреннее поведение KernelSU и в будущем оно может измениться!** -- KernelSU не поддерживает файлы `.replace`; однако KernelSU поддерживает переменные `REMOVE` и `REPLACE` для удаления или замены файлов и папок. diff --git a/website/docs/ru_RU/guide/faq.md b/website/docs/ru_RU/guide/faq.md deleted file mode 100644 index f28dbc61..00000000 --- a/website/docs/ru_RU/guide/faq.md +++ /dev/null @@ -1,67 +0,0 @@ -# FAQ - -## Поддерживает ли KernelSU мое устройство? - -Во-первых, ваше устройство должно быть способно разблокировать загрузчик. Если не может, значит, устройство не поддерживается. - -Затем установите на устройство приложение KernelSU manager App и откройте его, если оно покажет `Unsupported`, то ваше устройство не поддерживается из коробки, но вы можете собрать исходный код ядра и интегрировать KernelSU, чтобы заставить его работать, или использовать [неофициально-поддерживаемые-устройства](unofficially-support-devices). - -## Нужно ли для KernelSU разблокировать загрузчик? - -Безусловно, да. - -## Поддерживает ли KernelSU модули? - -Да, но это ранняя версия, она может быть глючной. Пожалуйста, подождите, пока она станет стабильной :) - -## Поддерживает ли KernelSU Xposed? - -Да, [Dreamland](https://github.com/canyie/Dreamland) и [TaiChi](https://taichi.cool) работают. Что касается LSPosed, то его можно заставить работать с помощью [Zygisk на KernelSU](https://github.com/Dr-TSNG/ZygiskNext) - -## Поддерживает ли KernelSU Zygisk? - -KernelSU не имеет встроенной поддержки Zygisk, но вы можете использовать [Zygisk на KernelSU](https://github.com/Dr-TSNG/ZygiskNext). - -## Совместим ли KernelSU с Magisk? - -Система модулей KernelSU конфликтует с магическим монтированием Magisk, если в KernelSU включен какой-либо модуль, то весь Magisk не будет работать. - -Но если вы используете только `su` из KernelSU, то он будет хорошо работать с Magisk: KernelSU модифицирует `kernel`, а Magisk - `ramdisk`, они могут работать вместе. - -## Заменит ли KernelSU Magisk? - -Мы так не считаем, и это не является нашей целью. Magisk достаточно хорош для решения проблемы root в пользовательском пространстве и будет жить долго. Цель KernelSU - предоставить пользователям интерфейс ядра, а не заменить Magisk. - -## Может ли KernelSU поддерживать устройства, не относящиеся к GKI? - -Это возможно. Но для этого необходимо скачать исходный текст ядра, подключить KernelSU к дереву исходных текстов и скомпилировать ядро самостоятельно. - -## Может ли KernelSU поддерживать устройства под управлением Android 12? - -На совместимость KernelSU влияет ядро устройства, и версия Android здесь ни при чем. Единственное ограничение - устройства, запускаемые с Android 12, должны иметь ядро 5.10+ (устройства GKI). Итак: - -1. Устройства, выпущенные под управлением Android 12, должны поддерживаться. -2. Устройства со старым ядром (некоторые устройства с Android 12 также имеют старое ядро) совместимы (Вы должны собрать ядро самостоятельно). - -## Может ли KernelSU поддерживать старое ядро? - -Это возможно, KernelSU бэкпортирован на ядро 4.14, для более старых ядер, вам нужно сделать бэкпорт вручную, и PR приветствуются! - -## Как интегрировать KernelSU в старое ядро? - -Пожалуйста, обратитесь к [руководству](how-to-integrate-for-non-gki) - -## Почему моя версия Android - 13, а ядро показывает "android12-5.10"? - -Версия ядра не имеет никакого отношения к версии Android, если вам нужно прошить ядро, всегда используйте версию ядра, версия Android не так важна. - -## Есть ли в KernelSU пространство имен --mount-master/global mount? - -Сейчас нет (возможно, в будущем), но есть много способов переключиться на глобальное пространство имен монтирования вручную, например: - -1. `nsenter -t 1 -m sh` для получения оболочки в глобальном пространстве имен монтирования. -2. Добавить `nsenter --mount=/proc/1/ns/mnt` к команде, которую вы хотите выполнить, тогда команда будет выполнена в глобальном пространстве имен монтирования. KernelSU также [использует этот способ](https://github.com/tiann/KernelSU/blob/77056a710073d7a5f7ee38f9e77c9fd0b3256576/manager/app/src/main/java/shirkneko/zako/mksu/ui/util/KsuCli.kt#L115) - -## Я GKI1.0, могу ли я использовать это? - -GKI1 полностью отличается от GKI2, вы должны скомпилировать ядро самостоятельно. diff --git a/website/docs/ru_RU/guide/hidden-features.md b/website/docs/ru_RU/guide/hidden-features.md deleted file mode 100644 index b562c39c..00000000 --- a/website/docs/ru_RU/guide/hidden-features.md +++ /dev/null @@ -1,7 +0,0 @@ -# Скрытые возможности - -## .ksurc - -По умолчанию `/system/bin/sh` загружает `/system/etc/mkshrc`. - -Вы можете заставить su загружать пользовательский rc-файл, создав файл `/data/adb/ksu/.ksurc`. \ No newline at end of file diff --git a/website/docs/ru_RU/guide/how-to-build.md b/website/docs/ru_RU/guide/how-to-build.md deleted file mode 100644 index 2eddb143..00000000 --- a/website/docs/ru_RU/guide/how-to-build.md +++ /dev/null @@ -1,65 +0,0 @@ -# Как собрать KernelSU? - -Прежде всего, необходимо ознакомиться с официальной документацией Android по сборке ядра: - -1. [Сборка ядер](https://source.android.com/docs/setup/build/building-kernels) -2. [Сборки релизов GKI](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -::: warning -Эта страница предназначена для устройств GKI, если вы используете старое ядро, пожалуйста, обратитесь к [Как интегрировать KernelSU для не GKI ядер?](how-to-integrate-for-non-gki). -::: - -## Сборка ядра - -### Синхронизация исходного кода ядра - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -Файл `` - это файл манифеста, который может однозначно определять сборку, с его помощью можно выполнить пересборку. Файл манифеста следует загрузить с сайта [Сборки релизов Google GKI](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -### Построение - -Пожалуйста, сначала ознакомьтесь с [официальной документацией](https://source.android.com/docs/setup/build/building-kernels). - -Например, нам необходимо собрать образ ядра aarch64: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` - -Не забудьте добавить флаг `LTO=thin`, иначе сборка может завершиться неудачей, если память вашего компьютера меньше 24 Гб. - -Начиная с Android 13, сборка ядра осуществляется с помощью `bazel`: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` - -## Сборка ядра с помощью KernelSU - -Если вы успешно собрали ядро, то собрать KernelSU очень просто, выберите любой запуск в корневом каталоге исходного кода ядра: - -- Последний тэг(стабильный) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -- Основная ветвь(разработка) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -- Выбранный тэг(Например, версия v0.5.2) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -А затем пересоберите ядро и получите образ ядра с KernelSU! diff --git a/website/docs/ru_RU/guide/how-to-integrate-for-non-gki.md b/website/docs/ru_RU/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index 5846e3ae..00000000 --- a/website/docs/ru_RU/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,264 +0,0 @@ -# Как интегрировать KernelSU для не GKI ядер? {#introduction} - -KernelSU может быть интегрирован в ядра, отличные от GKI, и был перенесен на версии 4.14 и ниже. - -В связи с фрагментацией ядер, отличных от GKI, у нас нет единого способа их сборки, поэтому мы не можем предоставить загрузочные образы, отличные от GKI. Однако вы можете собрать ядро самостоятельно с помощью интегрированной программы KernelSU. - -Во-первых, вы должны уметь собирать загрузочное ядро из исходных текстов ядра. Если ядро не является открытым, то запустить KernelSU для вашего устройства будет затруднительно. - -Если вы можете собрать загрузочное ядро, то существует два способа интеграции KernelSU в исходный код ядра: - -1. Автоматически с помощью `kprobe` -2. Вручную - -## Интеграция с kprobe {#using-kprobes} - -KernelSU использует kprobe для выполнения хуков ядра, если *kprobe* хорошо работает в вашем ядре, то рекомендуется использовать именно этот способ. - -Сначала добавьте KernelSU в дерево исходных текстов ядра: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -Затем необходимо проверить, включена ли функция *kprobe* в конфигурации ядра, если нет, то добавьте в нее эти настройки: - -``` -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` - -И снова соберите ядро, KernelSU должен работать нормально. - -Если вы обнаружите, что KPROBES по-прежнему не активирован, попробуйте включить `CONFIG_MODULES`. (Если это все равно не даст результата, используйте `make menuconfig` для поиска других зависимостей KPROBES). - -Если же при интеграции KernelSU возникает зацикливание загрузки, то, возможно, в вашем ядре *kprobe неисправен*, следует исправить ошибку kprobe или воспользоваться вторым способом. - -:::tip Как проверить, не сломан ли kprobe? - -закомментируйте `ksu_enable_sucompat()` и `ksu_enable_ksud()` в файле `KernelSU/kernel/ksu.c`, если устройство загружается нормально, то может быть нарушена работа kprobe. -::: - -## Ручная модификация исходного кода ядра {#modify-kernel-source-code} - -Если kprobe не работает в вашем ядре (возможно, это ошибка апстрима или ядра ниже 4.8), то можно попробовать следующий способ: - -Сначала добавьте Kernel SU в дерево исходного кода вашего ядра: - -- Последний тэг(стабильный) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -- Основная ветвь(разработка) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -- Выбранный тэг(Например, версия v0.5.2) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -Затем добавьте вызовы KernelSU в исходный код ядра, вот патч, на который можно сослаться: - -```diff -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; - -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; - -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+ - /** - * vfs_statx - Get basic and extra attributes by filename - * @dfd: A file descriptor representing the base dir for a relative filename -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ ksu_handle_stat(&dfd, &filename, &flags); - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` - -В исходных кодах ядра можно найти эти четыре функции: - -1. do_faccessat, обычно в `fs/open.c`. -2. do_execveat_common, обычно в `fs/exec.c`. -3. vfs_read, обычно в `fs/read_write.c`. -4. vfs_statx, обычно в `fs/stat.c`. - -Если в вашем ядре нет `vfs_statx`, используйте вместо него `vfs_fstatat`: - -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 068fdbcc9e26..5348b7bb9db2 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -87,6 +87,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) - } - EXPORT_SYMBOL(vfs_fstat); - -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+ - int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int flag) - { -@@ -94,6 +96,8 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int error = -EINVAL; - unsigned int lookup_flags = 0; - -+ ksu_handle_stat(&dfd, &filename, &flag); -+ - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH)) != 0) - goto out; -``` - -Для ядер младше 4.17, если вы не можете найти `do_faccessat`, просто перейдите к определению системного вызова `faccessat` и поместите вызов туда: - -```diff -diff --git a/fs/open.c b/fs/open.c -index 2ff887661237..e758d7db7663 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -355,6 +355,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return error; - } - -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+ - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -370,6 +373,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; - -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` - -Чтобы включить встроенный в KernelSU безопасный режим, необходимо также изменить `input_handle_event` в файле `drivers/input/input.c`: - -:::tip -Настоятельно рекомендуется включить эту функцию, она очень помогает предотвратить циклическую загрузку! -::: - -```diff -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 45306f9ef247..815091ebfca4 100755 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -367,10 +367,13 @@ static int input_get_disposition(struct input_dev *dev, - return disposition; - } - -+extern bool ksu_input_hook __read_mostly; -+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value); -+ - static void input_handle_event(struct input_dev *dev, - unsigned int type, unsigned int code, int value) - { - int disposition = input_get_disposition(dev, type, code, &value); -+ -+ if (unlikely(ksu_input_hook)) -+ ksu_handle_input_handle_event(&type, &code, &value); - - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - add_input_randomness(type, code, value); -``` - -Наконец, снова соберите ядро, KernelSU должен работать хорошо. diff --git a/website/docs/ru_RU/guide/installation.md b/website/docs/ru_RU/guide/installation.md deleted file mode 100644 index d09f26a0..00000000 --- a/website/docs/ru_RU/guide/installation.md +++ /dev/null @@ -1,169 +0,0 @@ -# Установка {#title} - -## Проверьте, поддерживается ли ваше устройство {#check-if-supported} - -Скачайте приложение менеджера KernelSU с сайта [GitHub Releases](https://github.com/tiann/KernelSU/releases) и установите его на устройство: - -- Если приложение показывает `Unsupported`, это означает, что **Вы должны скомпилировать ядро самостоятельно**, KernelSU не будет и никогда не предоставит Вам загрузочный образ для прошивки. -- Если приложение показывает `Не установлено`, значит, ваши устройства официально поддерживаются KernelSU. - -:::info -Для устройств, показывающих `Unsupported`, здесь находится [Unofficially-support-devices](unofficially-support-devices.md), вы можете скомпилировать ядро самостоятельно. -::: - -## Резервное копирование стокового файла boot.img {#backup-boot-image} - -Перед прошивкой необходимо создать резервную копию файла boot.img. Если возникнет ошибка загрузки, вы всегда сможете восстановить систему, перепрошив ее на заводскую загрузку с помощью fastboot. - -::: warning -Прошивка может привести к потере данных, поэтому обязательно выполните этот шаг перед переходом к следующему шагу!!! При необходимости можно также создать резервную копию всех данных на телефоне. -::: - -## Необходимые знания {#acknowage} - -### ADB и fastboot {#adb-and-fastboot} - -По умолчанию в этом руководстве вы будете использовать инструменты ADB и fastboot, поэтому, если вы их не знаете, рекомендуем сначала воспользоваться поисковой системой, чтобы узнать о них. - -### KMI - -Kernel Module Interface (KMI), версии ядра с одинаковым KMI **совместимы** Это то, что в GKI означает "общий"; наоборот, если KMI отличается, то эти ядра несовместимы друг с другом, и прошивка образа ядра с другим KMI, чем у вашего устройства, может привести к bootloop. - -В частности, для устройств GKI формат версии ядра должен быть следующим: - -```txt -KernelRelease := -Version.PatchLevel.SubLevel-AndroidRelease-KmiGeneration-suffix -w .x .y -zzz -k -something -``` - -`w.x-zz-k` - версия KMI. Например, если версия ядра устройства `5.10.101-android12-9-g30979850fc20`, то его KMI - `5.10-android12-9`; теоретически оно может нормально загружаться с другими ядрами KMI. - -::: tip -Обратите внимание, что SubLevel в версии ядра не является частью KMI! Это означает, что `5.10.101-android12-9-g30979850fc20` имеет тот же KMI, что и `5.10.137-android12-9-g30979850fc20`! -::: - -### Версия ядра и версия Android {#kernel-version-vs-android-version} - -Обратите внимание: **Версия ядра и версия Android - это не обязательно одно и то же!** - -Если вы обнаружили, что версия ядра `android12-5.10.101`, а версия системы Android - Android 13 или другая, не удивляйтесь, поскольку номер версии системы Android не обязательно совпадает с номером версии ядра Linux; Номер версии ядра Linux обычно соответствует версии системы Android, поставляемой с **устройством при его поставке**. При последующем обновлении системы Android версия ядра, как правило, не меняется. При необходимости прошивки **укажите версию ядра!!!**. - -## Введение {#installation-introduction} - -Существует несколько способов установки KernelSU, каждый из которых подходит для разных сценариев, поэтому выбирайте их по своему усмотрению. - -1. Установка с помощью пользовательского Recovery (например, TWRP) -2. Установка с помощью приложения для прошивки ядра, например, Franco Kernel Manager -3. Установка с помощью fastboot с использованием boot.img, предоставленного KernelSU -4. Восстановить boot.img вручную и установить его - -## Установка с помощью пользовательского Recovery {#install-by-recovery} - -Необходимые условия: На устройстве должен быть установлен пользовательский Recovery, например TWRP; если его нет или доступен только официальный Recovery, воспользуйтесь другим способом. - -Шаг: - -1. С [Release page](https://github.com/tiann/KernelSU/releases) KernelSU загрузите zip-пакет, начинающийся с AnyKernel3, который соответствует версии вашего телефона; например, версия ядра телефона - `android12-5.10. 66`, то следует скачать файл `AnyKernel3-android12-5.10.66_yyy-MM.zip` (где `yyyy` - год, а `MM` - месяц). -2. Перезагрузите телефон в TWRP. -3. С помощью adb поместите AnyKernel3-*.zip в /sdcard телефона и выберите установку в графическом интерфейсе TWRP; или вы можете напрямую `adb sideload AnyKernel-*.zip` для установки. - -PS. Данный способ подходит для любой установки (не ограничиваясь начальной установкой или последующими обновлениями), если вы используете TWRP. - -## Установка с помощью Kernel Flasher {#install-by-kernel-flasher} - -Необходимые условия: Ваше устройство должно быть рутованным. Например, вы установили Magisk, чтобы получить root, или установили старую версию KernelSU и должны обновить ее до другой версии; если ваше устройство не укоренено, попробуйте другие методы. - -Шаг: - -1. Загрузите zip-архив AnyKernel3; инструкции по загрузке см. в разделе *Установка с помощью пользовательского Recovery*. -2. Откройте приложение для прошивки ядра и используйте предоставленный AnyKernel3 zip для прошивки. - -Если вы раньше не использовали приложение для прошивки ядра, то наиболее популярными являются следующие. - -1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases) -2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel) -3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager) - -PS. Этот способ более удобен при обновлении KernelSU и может быть выполнен без компьютера (сначала сделайте резервную копию!). . - -## Установка с помощью boot.img, предоставленного KernelSU {#install-by-kernelsu-boot-image} - -Этот способ не требует наличия TWRP и root-прав на телефоне; он подходит для первой установки KernelSU. - -### Найти подходящий boot.img {#found-propery-image} - -KernelSU предоставляет общий boot.img для устройств GKI, и его необходимо прошить в загрузочный раздел устройства. - -Вы можете загрузить boot.img с [GitHub Release](https://github.com/tiann/KernelSU/releases), обратите внимание, что вы должны использовать правильную версию boot.img. Например, если на устройстве установлено ядро `android12-5.10.101`, то необходимо загрузить `android-5.10.101_yyy-MM.boot-.img`. , необходимо загрузить `android-5.10.101_yyy-MM.boot-.img`.(Соблюдайте соответствие KMI!). - -Где `` означает формат сжатия ядра в официальном boot.img, проверьте формат сжатия ядра в оригинальном boot.img, вы должны использовать правильный формат, например, `lz4`, `gz`; если вы используете неправильный формат сжатия, вы можете столкнуться с bootloop. - -::: info -1. Вы можете использовать magiskboot для получения формата сжатия исходной загрузки; конечно, вы также можете спросить других, более опытных ребят с той же моделью, что и ваше устройство. Кроме того, формат сжатия ядра обычно не меняется, поэтому, если вы успешно загрузились с определенным форматом сжатия, вы можете попробовать этот формат позже. -2. Устройства Xiaomi обычно используют `gz` или **без сжатия**. -3. Для устройств Pixel следуйте приведенным ниже инструкциям. -::: - -### прошить boot.img на устройство {#flash-boot-image} - -Используйте `adb` для подключения устройства, затем выполните `adb reboot bootloader` для входа в режим fastboot, после чего используйте эту команду для прошивки KernelSU: - -```sh -fastboot flash boot boot.img -``` - -::: info -Если устройство поддерживает `fastboot boot`, можно сначала использовать `fastboot boot boot.img`, чтобы попытаться использовать boot.img для загрузки системы. Если произойдет что-то непредвиденное, перезагрузите его снова для загрузки. -::: - -### перезагрузка {#reboot} - -После завершения прошивки необходимо перезагрузить устройство: - -```sh -fastboot reboot -``` - -## Исправить boot.img вручную {#patch-boot-image} - -Для некоторых устройств формат boot.img не так распространен, например, не `lz4`, `gz` или несжатый; наиболее типичным является Pixel, его boot.img имеет формат `lz4_legacy` со сжатием, ramdisk может быть `gz`, также может быть `lz4_legacy` со сжатием; в это время, если напрямую прошить boot.img, предоставляемый KernelSU, телефон может не загрузиться; в это время можно вручную исправить boot.img для достижения цели. - -Как правило, существует два способа исправления: - -1. [Android-Image-Kitchen](https://forum.xda-developers.com/t/tool-android-image-kitchen-unpack-repack-kernel-ramdisk-win-android-linux-mac.2073775/) -2. [magiskboot](https://github.com/topjohnwu/Magisk/releases) - -Среди них Android-Image-Kitchen подходит для работы на ПК, а magiskboot нуждается в сотрудничестве мобильного телефона. - -### Подготовка {#patch-preparation} - -1. Получите стоковый boot.img вашего телефона; его можно получить у производителя устройства, возможно, вам понадобится [payload-dumper-go](https://github.com/ssut/payload-dumper-go) -2. Загрузите zip-файл AnyKernel3, предоставленный KernelSU, который соответствует версии KMI вашего устройства (можно обратиться к разделу *Установка с помощью пользовательского Recovery*). -3. Распакуйте пакет AnyKernel3 и получите файл `Image`, который является файлом ядра KernelSU. - -### Использование Android-Image-Kitchen {#using-android-image-kitchen} - -1. Загрузите программу Android-Image-Kitchen на свой компьютер. -2. Поместите файл boot.img в корневую папку Android-Image-Kitchen. -3. Выполните команду `./unpackimg.sh boot.img` в корневом каталоге Android-Image-Kitchen, в результате чего boot.img распакуется и появятся некоторые файлы. -4. Замените `boot.img-kernel` в каталоге `split_img` тем `образом`, который вы извлекли из AnyKernel3 (обратите внимание на изменение названия на boot.img-kernel). -5. Выполните команду `./repackimg.sh` в корневом каталоге 在 Android-Image-Kitchen; Вы получите файл с именем `image-new.img`; Прошейте этот boot.img с помощью fastboot (см. предыдущий раздел). - -### Использование magiskboot {#using magiskboot} - -1. Загрузите последнюю версию Magisk с [Release Page](https://github.com/topjohnwu/Magisk/releases). -2. Переименуйте `Magisk-*(version).apk` в `Magisk-*.zip` и разархивируйте его. -3. Закачайте `Magisk-*/lib/arm64-v8a/libmagiskboot.so` на устройство с помощью adb: `adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot`. -4. Установите на устройство стоковый boot.img и образ в AnyKernel3. -5. Войдите в оболочку adb и перейдите в каталог `/data/local/tmp/`, затем `chmod +x magiskboot`. -6. Войдите в adb shell и cd директории `/data/local/tmp/`, выполните команду `./magiskboot unpack boot.img` для распаковки `boot.img`, вы получите файл `kernel`, это и есть ваше стоковое ядро. -7. Замените `kernel` на `Image`: `mv -f Image kernel`. -8. Выполните команду `./magiskboot repack boot.img`, чтобы перепаковать boot img, и получите файл `new-boot.img`, прошейте его на устройство с помощью fastboot. - -## Другие методы {#other-methods} - -На самом деле все эти способы установки имеют только одну основную идею - **заменить исходное ядро на ядро, предоставляемое KernelSU**; если это возможно, то установка возможна; например, возможны следующие способы. - -1. Сначала установить Magisk, получить права root через Magisk, а затем с помощью kernel flasher прошить AnyKernel zip из KernelSU. -2. Использовать какой-либо инструментарий для прошивки на ПК, чтобы прошить ядро, предоставленное KernelSU. diff --git a/website/docs/ru_RU/guide/module.md b/website/docs/ru_RU/guide/module.md deleted file mode 100644 index b80b17a6..00000000 --- a/website/docs/ru_RU/guide/module.md +++ /dev/null @@ -1,255 +0,0 @@ -# Руководство по разработке модулей {#introduction} - -KernelSU предоставляет механизм модулей, позволяющий добиться эффекта модификации системного каталога при сохранении целостности системного раздела. Этот механизм принято называть "бессистемным". - -Модульный механизм KernelSU практически аналогичен механизму Magisk. Если вы знакомы с разработкой модулей Magisk, то разработка модулей KernelSU очень похожа. Представление модулей ниже можно пропустить, достаточно прочитать [различия-с-magisk] (difference-with-magisk.md). - -## Busybox - -В комплект поставки KernelSU входит полнофункциональный бинарный файл BusyBox (включая полную поддержку SELinux). Исполняемый файл находится по адресу `/data/adb/ksu/bin/busybox`. BusyBox от KernelSU поддерживает переключаемый во время работы "ASH Standalone Shell Mode". Этот автономный режим означает, что при запуске в оболочке `ash` BusyBox каждая команда будет напрямую использовать апплет внутри BusyBox, независимо от того, что задано в качестве `PATH`. Например, такие команды, как `ls`, `rm`, `chmod` будут **НЕ** использовать то, что находится в `PATH` (в случае Android по умолчанию это будут `/system/bin/ls`, `/system/bin/rm` и `/system/bin/chmod` соответственно), а вместо этого будут напрямую вызывать внутренние апплеты BusyBox. Это гарантирует, что скрипты всегда будут выполняться в предсказуемом окружении и всегда будут иметь полный набор команд, независимо от того, на какой версии Android они выполняются. Чтобы заставить команду _не_ использовать BusyBox, необходимо вызвать исполняемый файл с полными путями. - -Каждый сценарий оболочки, запущенный в контексте KernelSU, будет выполняться в оболочке BusyBox `ash` с включенным автономным режимом. Для сторонних разработчиков это касается всех загрузочных скриптов и скриптов установки модулей. - -Для тех, кто хочет использовать эту возможность "Автономного режима" вне KernelSU, есть два способа включить ее: - -1. Установите переменной окружения `ASH_STANDALONE` значение `1`
Пример: `ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
СопровождающийРепозиторийПоддерживаемое устройство
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
diff --git a/website/docs/ru_RU/guide/what-is-kernelsu.md b/website/docs/ru_RU/guide/what-is-kernelsu.md deleted file mode 100644 index 9e9a7447..00000000 --- a/website/docs/ru_RU/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# Что такое KernelSU? {#introduction} - -KernelSU - это root-решение для устройств Android GKI, работающее в режиме ядра и предоставляющее root-права пользовательским приложениям непосредственно в пространстве ядра. - -## Особенности {#features} - -Основной особенностью KernelSU является то, что он **основан на ядре**. KernelSU работает в режиме ядра, поэтому он может предоставить интерфейс ядра, которого раньше не было. Например, мы можем добавить аппаратную точку останова любому процессу в режиме ядра; мы можем получить доступ к физической памяти любого процесса без чьего-либо ведома; мы можем перехватить любой syscall в пространстве ядра; и т.д. - -Кроме того, KernelSU предоставляет систему модулей через overlayfs, что позволяет загружать в систему пользовательские плагины. Также предусмотрен механизм модификации файлов в разделе `/system`. - -## Как использовать {#how-to-use} - -Пожалуйста, обратитесь к: [Установка](installation) - -## Как собрать {#how-to-build} - -[Как собрать](how-to-build) - -## Обсуждение {#discussion} - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/ru_RU/index.md b/website/docs/ru_RU/index.md deleted file mode 100644 index 31e3f00e..00000000 --- a/website/docs/ru_RU/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -layout: home -title: Основанное на ядре root-решение для Android - -hero: - name: KernelSU - text: Основанное на ядре root-решение для Android - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: Начало работы - link: /ru_RU/guide/what-is-kernelsu - - theme: alt - text: Посмотр на GitHub - link: https://github.com/tiann/KernelSU - -features: - - title: Основанный на ядре - details: KernelSU работает в режиме ядра Linux, он имеет больше контроля над пользовательскими приложениями. - - title: Контроль доступа по белому списку - details: Только приложение, которому предоставлено разрешение root, может получить доступ к `su`, другие приложения не могут воспринимать su. - - title: Ограниченные root-права - details: KernelSU позволяет вам настраивать uid, gid, группы, возможности и правила SELinux для su. Заприте root-власть в клетке. - - title: Модульность и открытый исходный код - details: KernelSU поддерживает модификацию /system бессистемно с помощью overlayfs и имеет открытый исходный код под лицензией GPL-3. - diff --git a/website/docs/vi_VN/guide/app-profile.md b/website/docs/vi_VN/guide/app-profile.md deleted file mode 100644 index e89b3597..00000000 --- a/website/docs/vi_VN/guide/app-profile.md +++ /dev/null @@ -1,118 +0,0 @@ -# App Profile - -App Profile là một cơ chế do KernelSU cung cấp để tùy chỉnh cấu hình của các ứng dụng khác nhau. - -Đối với các ứng dụng được cấp quyền root (tức là có thể sử dụng `su`), App Profile cũng có thể được gọi là Root Profile. Nó cho phép tùy chỉnh các quy tắc `uid`, `gid`, `groups`, `capabilities` và `SELinux` của lệnh `su`, do đó hạn chế các đặc quyền của người dùng root. Ví dụ: nó có thể chỉ cấp quyền mạng cho các ứng dụng tường lửa trong khi từ chối quyền truy cập tệp hoặc có thể cấp quyền shell thay vì quyền truy cập root đầy đủ cho các ứng dụng đóng băng: **giữ nguồn điện theo nguyên tắc đặc quyền tối thiểu.** - -Đối với các ứng dụng thông thường không có quyền root, App Profile có thể kiểm soát hành vi của hệ thống kernel và mô-đun đối với các ứng dụng này. Ví dụ, nó có thể xác định liệu các sửa đổi do mô-đun tạo ra có nên được giải quyết hay không. Hệ thống kernel và mô-đun có thể đưa ra quyết định dựa trên cấu hình này, chẳng hạn như thực hiện các hoạt động tương tự như "hiding" - -## Root Profile - -### UID, GID, và Groups - -Hệ thống Linux có hai khái niệm: người dùng (user) và nhóm (group). Mỗi người dùng có một user ID (UID) và một người dùng có thể thuộc nhiều nhóm, mỗi nhóm có group ID (GID) riêng. Những ID này được sử dụng để xác định người dùng trong hệ thống và xác định tài nguyên hệ thống nào họ có thể truy cập. - -Người dùng có UID bằng 0 được gọi là người dùng root và các nhóm có GID bằng 0 được gọi là nhóm root. Nhóm người dùng root thường giữ các đặc quyền hệ thống cao nhất. - -Trong trường hợp hệ thống Android, mỗi ứng dụng là một người dùng riêng biệt (không bao gồm các trường hợp UID dùng chung) với một UID duy nhất. Ví dụ: `0` đại diện cho người dùng root, `1000` đại diện cho `system`, `2000` đại diện cho ADB shell và các UID từ 10000 đến 19999 đại diện cho các ứng dụng thông thường. - -:::info -Ở đây, UID được đề cập không giống với khái niệm nhiều người dùng hoặc hồ sơ công việc (Work profile) trong hệ thống Android. Hồ sơ công việc thực sự được triển khai bằng cách phân vùng phạm vi UID. Ví dụ: 10000-19999 đại diện cho người dùng chính, trong khi 110000-119999 đại diện cho hồ sơ công việc. Mỗi ứng dụng thông thường trong số đó đều có UID riêng. -::: - -Mỗi ứng dụng có thể có nhiều nhóm, với GID đại diện cho nhóm chính, thường khớp với UID. Các nhóm khác được gọi là nhóm bổ sung. Một số quyền nhất định được kiểm soát thông qua các nhóm, chẳng hạn như quyền truy cập mạng hoặc truy cập Bluetooth. - -Ví dụ: nếu chúng ta thực thi lệnh `id` trong shell ADB, kết quả đầu ra có thể trông như thế này: - -```sh -oriole:/ $ id -uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0 -``` - -Ở đây, UID là `2000` và GID (ID nhóm chính) cũng là `2000`. Ngoài ra, nó thuộc một số nhóm bổ sung, chẳng hạn như `inet` (biểu thị khả năng tạo ổ cắm `AF_INET` và `AF_INET6`) và `sdcard_rw` (biểu thị quyền đọc/ghi đối với thẻ SD). - -Root Profile của KernelSU cho phép tùy chỉnh UID, GID và các nhóm cho quy trình gốc sau khi thực thi `su`. Ví dụ: Cấu hình gốc của ứng dụng gốc có thể đặt UID của nó thành `2000`, có nghĩa là khi sử dụng `su`, các quyền thực tế của ứng dụng sẽ ở cấp shell ADB. Nhóm `inet` có thể bị xóa, ngăn lệnh `su` truy cập mạng. - -:::tip Ghi chú -Hồ sơ ứng dụng chỉ kiểm soát các quyền của tiến trình gốc sau khi sử dụng `su`; nó không kiểm soát các quyền của ứng dụng. Nếu một ứng dụng đã yêu cầu quyền truy cập mạng, ứng dụng đó vẫn có thể truy cập mạng ngay cả khi không sử dụng `su`. Việc xóa nhóm `inet` khỏi `su` chỉ ngăn `su` truy cập mạng. -::: - -Root Profile được thực thi trong kernel và không dựa vào hành vi tự nguyện của các ứng dụng root, không giống như việc chuyển đổi người dùng hoặc nhóm thông qua `su`, việc cấp quyền `su` hoàn toàn phụ thuộc vào người dùng chứ không phải nhà phát triển. - -### Capabilities - -Capabilities (khả năng) là một cơ chế phân tách đặc quyền trong Linux. - -Với mục đích thực hiện kiểm tra quyền, việc triển khai UNIX truyền thống phân biệt hai loại quy trình: quy trình đặc quyền (có ID người dùng hiệu quả là 0, được gọi là siêu người dùng hoặc root) và quy trình không có đặc quyền (có UID hiệu dụng khác 0). Các quy trình đặc quyền bỏ qua tất cả các bước kiểm tra quyền của kernel, trong khi các quy trình không có đặc quyền phải chịu sự kiểm tra quyền đầy đủ dựa trên thông tin xác thực của quy trình (thường là: UID hiệu quả, GID hiệu quả và danh sách nhóm bổ sung). - -Bắt đầu với Linux 2.2, Linux chia các đặc quyền truyền thống được liên kết với siêu người dùng thành các đơn vị riêng biệt, được gọi là các khả năng, có thể được bật và tắt một cách độc lập. - -Mỗi Khả năng đại diện cho một hoặc nhiều đặc quyền. Ví dụ: `CAP_DAC_READ_SEARCH` thể hiện khả năng bỏ qua việc kiểm tra quyền để đọc tệp cũng như quyền đọc và thực thi thư mục. Nếu người dùng có UID hiệu dụng là `0` (người dùng root) thiếu khả năng `CAP_DAC_READ_SEARCH` hoặc cao hơn, điều này có nghĩa là ngay cả khi họ là root, họ không thể tùy ý đọc tệp. - -Cấu hình gốc của KernelSU cho phép tùy chỉnh các Khả năng của tiến trình gốc sau khi thực thi `su`, nhờ đó đạt được việc cấp một phần "quyền root". Không giống như UID và GID đã nói ở trên, một số ứng dụng gốc nhất định yêu cầu UID là `0` sau khi sử dụng `su`. Trong những trường hợp như vậy, việc giới hạn Khả năng của người dùng root này bằng UID `0` có thể hạn chế các hoạt động được phép của họ. - -:::tip Rất Khuyến Nghị -Capabilities của Linux [tài liệu chính thức](https://man7.org/linux/man-pages/man7/capabilities.7.html) cung cấp giải thích chi tiết về các khả năng mà mỗi Capabilities thể hiện. Nếu bạn có ý định tùy chỉnh Capabilities, bạn nên đọc tài liệu này trước. -::: - -### SELinux - -SELinux là một cơ chế Kiểm Soát Truy Cập Bắt Buộc (Mandatory Access Control: MAC) mạnh mẽ. Nó hoạt động theo nguyên tắc **từ chối mặc định**: bất kỳ hành động nào không được cho phép rõ ràng đều bị từ chối. - -SELinux có thể chạy ở hai chế độ chung: - -1. Chế độ cho phép (Permissive mode): Các sự kiện từ chối được ghi lại nhưng không được thực thi. -2. Chế độ thực thi (Enforcing mode): Các sự kiện từ chối được ghi lại và thực thi. - -:::warning Cảnh báo -Các hệ thống Android hiện đại phụ thuộc rất nhiều vào SELinux để đảm bảo an ninh hệ thống tổng thể. Chúng tôi khuyên bạn không nên sử dụng bất kỳ hệ thống tùy chỉnh nào chạy ở "chế độ cho phép" vì nó không mang lại lợi thế đáng kể nào so với hệ thống mở hoàn toàn. -::: - -Việc giải thích khái niệm đầy đủ về SELinux rất phức tạp và nằm ngoài phạm vi của tài liệu này. Trước tiên nên hiểu hoạt động của nó thông qua các tài nguyên sau: - -1. [Wikipedia](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) -2. [Red Hat: What Is SELinux?](https://www.redhat.com/en/topics/linux/what-is-selinux) -3. [ArchLinux: SELinux](https://wiki.archlinux.org/title/SELinux) - -Root Profile của KernelSU cho phép tùy chỉnh ngữ cảnh SELinux của tiến trình gốc sau khi thực thi `su`. Các quy tắc kiểm soát truy cập cụ thể có thể được đặt cho bối cảnh này để cho phép kiểm soát chi tiết hơn các quyền . - -Trong các trường hợp điển hình, khi một ứng dụng thực thi `su`, nó sẽ chuyển quy trình sang miền SELinux với **quyền truy cập không hạn chế**, chẳng hạn như `u:r:su:s0`. Thông qua Root Profile, miền này có thể được chuyển sang miền tùy chỉnh, chẳng hạn như `u:r:app1:s0` và một loạt quy tắc có thể được xác định cho miền này: - -```sh -type app1 -enforce app1 -typeattribute app1 mlstrustedsubject -allow app1 * * * -``` - -Lưu ý rằng quy tắc `allow app1 * * *` chỉ được sử dụng cho mục đích minh họa. Trong thực tế, quy tắc này không nên được sử dụng rộng rãi vì nó không khác nhiều so với chế độ cho phép. - -### Escalation - -Nếu cấu hình của Root Profile không được đặt đúng cách, một tình huống escalation (leo thang) có thể xảy ra: các hạn chế do Root Profile áp đặt có thể vô tình bị lỗi. - -Ví dụ: nếu bạn cấp quyền root cho người dùng shell ADB (đây là trường hợp phổ biến), sau đó bạn cấp quyền root cho một ứng dụng thông thường nhưng định cấu hình cấu hình gốc của nó bằng UID 2000 (là UID của người dùng shell ADB) , ứng dụng có thể có được quyền truy cập root đầy đủ bằng cách thực hiện lệnh `su` hai lần: - -1. Lần thực thi `su` đầu tiên phải tuân theo sự thực thi của App Profile và sẽ chuyển sang UID `2000` (adb shell) thay vì `0` (root). -2. Lần thực thi `su` thứ hai, vì UID là `2000` và bạn đã cấp quyền truy cập root cho UID `2000` (adb shell) trong cấu hình, ứng dụng sẽ có toàn quyền root. - -:::warning Ghi chú -Hành vi này hoàn toàn được mong đợi và không phải là lỗi. Vì vậy, chúng tôi khuyến nghị như sau: - -Nếu bạn thực sự cần cấp quyền root cho ADB (ví dụ: với tư cách là nhà phát triển), bạn không nên thay đổi UID thành `2000` khi định cấu hình Root Profile. Sử dụng `1000` (hệ thống) sẽ là lựa chọn tốt hơn. -::: - -## Non-Root Profile - -### Umount Modules - -KernelSU cung cấp một cơ chế systemless để sửa đổi các phân vùng hệ thống, đạt được thông qua việc gắn overlayfs. Tuy nhiên, một số ứng dụng có thể nhạy cảm với hành vi đó. Do đó, chúng ta có thể dỡ bỏ các mô-đun được gắn trên các ứng dụng này bằng cách đặt tùy chọn "umount modules". - -Ngoài ra, giao diện cài đặt của trình quản lý KernelSU cung cấp một công tắc cho "umount modules by default". Theo mặc định, công tắc này được **bật**, có nghĩa là KernelSU hoặc một số mô-đun sẽ hủy tải các mô-đun cho ứng dụng này trừ khi áp dụng cài đặt bổ sung. Nếu bạn không thích cài đặt này hoặc nếu nó ảnh hưởng đến một số ứng dụng nhất định, bạn có các tùy chọn sau: - -1. Giữ nút chuyển cho "umount modules by default" và tắt riêng tùy chọn "umount modules" trong App Profile đối với các ứng dụng yêu cầu tải mô-đun (hoạt động như "whitelist"). -2. Tắt khóa chuyển cho "umount modules by default" và bật riêng tùy chọn "umount modules" trong App Profile cho các ứng dụng yêu cầu dỡ bỏ mô-đun (hoạt động như "blacklist"). - -:::info -Trong các thiết bị sử dụng kernel phiên bản 5.10 trở lên, kernel thực hiện việc dỡ tải các mô-đun. Tuy nhiên, đối với các thiết bị chạy phiên bản kernel dưới 5.10, công tắc này chỉ đơn thuần là một tùy chọn cấu hình và bản thân KernelSU không thực hiện bất kỳ hành động nào. Một số mô-đun, chẳng hạn như Zygisksu, có thể sử dụng công tắc này để xác định xem có cần thiết phải dỡ bỏ mô-đun hay không. -::: diff --git a/website/docs/vi_VN/guide/difference-with-magisk.md b/website/docs/vi_VN/guide/difference-with-magisk.md deleted file mode 100644 index 2a294ce4..00000000 --- a/website/docs/vi_VN/guide/difference-with-magisk.md +++ /dev/null @@ -1,28 +0,0 @@ -# Sự khác biệt với Magisk - -Mặc dù có nhiều điểm tương đồng giữa mô-đun KernelSU và mô-đun Magisk nhưng chắc chắn vẫn có một số khác biệt do cơ chế triển khai hoàn toàn khác nhau của chúng. Nếu muốn mô-đun của mình chạy trên cả Magisk và KernelSU, bạn phải hiểu những khác biệt này. - -## Điểm tương đồng - -- Định dạng file mô-đun: đều sử dụng định dạng zip để sắp xếp các mô-đun và định dạng của các mô-đun gần như giống nhau -- Thư mục cài đặt mô-đun: cả hai đều nằm trong `/data/adb/modules` -- systemless: cả hai đều hỗ trợ sửa đổi /system theo cách không có hệ thống thông qua các mô-đun -- post-fs-data.sh: thời gian thực hiện và ngữ nghĩa hoàn toàn giống nhau -- service.sh: thời gian thực hiện và ngữ nghĩa hoàn toàn giống nhau -- system.prop: hoàn toàn giống nhau -- sepolicy.rule: hoàn toàn giống nhau -- BusyBox: các tập lệnh được chạy trong BusyBox với "standalone mode" được bật trong cả hai trường hợp - -## Điểm khác biệt - -Trước khi hiểu sự khác biệt, bạn cần biết cách phân biệt mô-đun của bạn đang chạy trong KernelSU hay Magisk. Bạn có thể sử dụng biến môi trường `KSU` để phân biệt nó ở tất cả những nơi bạn có thể chạy tập lệnh mô-đun (`customize.sh`, `post-fs-data.sh`, `service.sh`). Trong KernelSU, biến môi trường này sẽ được đặt thành `true`. - -Dưới đây là một số khác biệt: - -- Không thể cài đặt các mô-đun KernelSU ở chế độ Recovery. -- Các mô-đun KernelSU không có hỗ trợ tích hợp cho Zygisk (nhưng bạn có thể sử dụng các mô-đun Zygisk thông qua [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). -- Phương pháp thay thế hoặc xóa file trong module KernelSU hoàn toàn khác với Magisk. KernelSU không hỗ trợ phương thức `.replace`. Thay vào đó, bạn cần tạo một file cùng tên với `mknod filename c 0 0` để xóa file tương ứng. -- Các thư mục của BusyBox khác nhau. BusyBox tích hợp trong KernelSU nằm ở `/data/adb/ksu/bin/busybox`, trong khi ở Magisk nó nằm ở `/data/adb/magisk/busybox`. **Lưu ý rằng đây là hoạt động nội bộ của KernelSU và có thể thay đổi trong tương lai!** -- KernelSU không hỗ trợ file `.replace`; tuy nhiên, KernelSU hỗ trợ biến `REMOVE` và `REPLACE` để xóa hoặc thay thế các tệp và thư mục. -- KernelSU thêm giai đoạn `boot-completed` để chạy một số script khi khởi động xong. -- KernelSU thêm giai đoạn `post-mount` để chạy một số tập lệnh sau khi gắn overlayfs diff --git a/website/docs/vi_VN/guide/faq.md b/website/docs/vi_VN/guide/faq.md deleted file mode 100644 index 1c794bd3..00000000 --- a/website/docs/vi_VN/guide/faq.md +++ /dev/null @@ -1,67 +0,0 @@ -# FAQ - -## KernelSU có hỗ trợ thiết bị của tôi không? - -Đầu tiên, thiết bị của bạn sẽ có thể mở khóa bootloader. Nếu không thể thì nó không được hỗ trợ. - -Sau đó, cài đặt Ứng dụng KernelSU manager vào thiết bị của bạn và mở nó, nếu nó hiển thị `Unsupported` thì thiết bị của bạn chưa được hỗ trợ ngay, nhưng bạn có thể tạo nguồn kernel và tích hợp KernelSU để nó hoạt động hoặc sử dụng [unofficially-support-devices](unofficially-support-devices). - -## KernelSU có cần mở khóa Bootloader không? - -Chắc chắn có. - -## KernelSU có hỗ trợ các mô-đun không? - -Có, nhưng đây là phiên bản đầu tiên nên có thể bị lỗi. Đợi nó ổn định nhé :) - -## KernelSU có hỗ trợ Xposed không? - -Có, [Dreamland](https://github.com/canyie/Dreamland) và [TaiChi](https://taichi.cool) hiện đã hoạt động. Đối với LSPosed, bạn có thể làm cho nó hoạt động bằng [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) - -## KernelSU có hỗ trợ Zygisk không? - -KernelSU không có hỗ trợ Zygisk tích hợp sẵn nhưng thay vào đó, bạn có thể sử dụng [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext). - -## KernelSU có tương thích với Magisk không? - -Hệ thống mô-đun của KernelSU xung đột với magic mount của Magisk, nếu có bất kỳ mô-đun nào được kích hoạt trong KernelSU thì toàn bộ Magisk sẽ không hoạt động. - -Nhưng nếu bạn chỉ sử dụng `su` của KernelSU thì nó sẽ hoạt động tốt với Magisk: KernelSU sửa đổi `kernel` và Magisk sửa đổi `ramdisk`, chúng có thể hoạt động cùng nhau. - -## KernelSU sẽ thay thế Magisk? - -Chúng tôi không nghĩ như vậy và đó không phải là mục tiêu của chúng tôi. Magisk đủ tốt cho giải pháp root userspace và nó sẽ tồn tại lâu dài. Mục tiêu của KernelSU là cung cấp giao diện kernel cho người dùng chứ không thay thế Magisk. - -## KernelSU có thể hỗ trợ các thiết bị không phải GKI không? - -Điều đó là có thể. Nhưng bạn nên tải nguồn kernel về và tích hợp KernelSU vào source tree rồi tự biên dịch kernel. - -## KernelSU có thể hỗ trợ các thiết bị dưới Android 12 không? - -Chính kernel của thiết bị ảnh hưởng đến khả năng tương thích của KernelSU và nó không liên quan gì đến phiên bản Android. Hạn chế duy nhất là các thiết bị chạy Android 12 phải là kernel 5.10+(thiết bị GKI). Vì thế: - -1. Các thiết bị chạy Android 12 phải được hỗ trợ. -2. Các thiết bị có kernel cũ (Một số thiết bị Android 12 cũng là kernel cũ) tương thích (Bạn nên tự build kernel) - -## KernelSU có thể hỗ trợ kernel cũ không? - -Có thể, KernelSU hiện đã được backport sang kernel 4.14, đối với kernel cũ hơn, bạn cần backport nó một cách cẩn thận và PR rất đáng hoan nghênh! - -## Làm cách nào để tích hợp KernelSU cho kernel cũ? - -Vui lòng tham khảo [hướng dẫn](how-to-integrate-for-non-gki) - -## Tại sao phiên bản Android của tôi là 13 và kernel hiển thị "android12-5.10"? - -Phiên bản Kernel không liên quan gì đến phiên bản Android, nếu bạn cần flash kernel thì dùng luôn phiên bản kernel, phiên bản Android không quá quan trọng. - -## Đã có mount namespace --mount-master/global trên KernelSU chưa? - -Hiện tại thì không (có thể có trong tương lai), nhưng có nhiều cách để chuyển sang global mount namespace một cách thủ công, chẳng hạn như: - -1. `nsenter -t 1 -m sh` để lấy shell trong global mount namespace. -2. Thêm `nsenter --mount=/proc/1/ns/mnt` vào lệnh bạn muốn thực thi, sau đó lệnh được thực thi trong global mount namespace. KernelSU cũng [sử dụng cách này](https://github.com/tiann/KernelSU/blob/77056a710073d7a5f7ee38f9e77c9fd0b3256576/manager/app/src/main/java/shirkneko/zako/mksu/ui/util/KsuCli.kt#L115) - -## Tôi là GKI1.0, tôi có thể sử dụng cái này không? - -GKI1 khác hoàn toàn với GKI2, bạn phải tự biên dịch kernel. diff --git a/website/docs/vi_VN/guide/hidden-features.md b/website/docs/vi_VN/guide/hidden-features.md deleted file mode 100644 index 2b8f0c71..00000000 --- a/website/docs/vi_VN/guide/hidden-features.md +++ /dev/null @@ -1,7 +0,0 @@ -# Tính Năng Ẩn - -## .ksurc - -Theo mặc định, `/system/bin/sh` tải `/system/etc/mkshrc`. - -Bạn có thể tạo su tải tệp rc tùy chỉnh bằng cách tạo tệp `/data/adb/ksu/.ksurc`. diff --git a/website/docs/vi_VN/guide/how-to-build.md b/website/docs/vi_VN/guide/how-to-build.md deleted file mode 100644 index de08124c..00000000 --- a/website/docs/vi_VN/guide/how-to-build.md +++ /dev/null @@ -1,65 +0,0 @@ -# Làm thế nào để xây dựng KernelSU? - -Trước tiên, bạn nên đọc tài liệu chính thức của Android để xây dựng kernel: - -1. [Building Kernels](https://source.android.com/docs/setup/build/building-kernels?hl=vi) -2. [GKI Release Builds](https://source.android.com/docs/core/architecture/kernel/gki-release-builds?hl=vi) - -::: warning -Trang này dành cho thiết bị GKI, nếu bạn sử dụng kernel cũ, vui lòng tham khảo [cách tích hợp KernelSU cho kernel cũ](how-to-integrate-for-non-gki) -::: - -## Build Kernel - -### Đồng bộ hóa mã nguồn kernel - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -`` là một tệp kê khai có thể xác định duy nhất một bản dựng, bạn có thể sử dụng tệp kê khai đó để thực hiện một bản dựng có thể dự đoán lại. Bạn nên tải xuống tệp kê khai từ [Google GKI release builds](https://source.android.com/docs/core/architecture/kernel/gki-release-builds?hl=vi) - -### Build - -Trước tiên, vui lòng kiểm tra [tài liệu chính thức](https://source.android.com/docs/setup/build/building-kernels?hl=vi). - -Ví dụ: chúng ta cần xây dựng kernel image aarch64: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` - -Đừng quên thêm cờ `LTO=thin`, nếu không quá trình xây dựng có thể thất bại nếu bộ nhớ máy tính của bạn nhỏ hơn 24Gb. - -Bắt đầu từ Android 13, kernel được xây dựng bởi `bazel`: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` - -## Build Kernel với KernelSU - -Nếu bạn có thể build kernel thành công thì việc xây dựng KernelSU thật dễ dàng, Chọn bất kỳ một lần chạy trong thư mục gốc nguồn Kernel: - -- Thẻ mới nhất (ổn định) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -- nhánh chính (dev) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -- Chọn thẻ (chẳng hạn như v0.5.2) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -Và sau đó build lại kernel và bạn sẽ có được image kernel với KernelSU! diff --git a/website/docs/vi_VN/guide/how-to-integrate-for-non-gki.md b/website/docs/vi_VN/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index 0f3734e8..00000000 --- a/website/docs/vi_VN/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,176 +0,0 @@ -# Làm thế nào để tích hợp KernelSU vào thiết bị không sử dụng GKI ? - -KernelSU có thể được tích hợp vào kernel không phải GKI và hiện tại nó đã được backport xuống 4.14, thậm chí cũng có thể chạy trên kernel thấp hơn 4.14. - -Do các kernel không phải GKI bị phân mảnh nên chúng tôi không có cách build thống nhất, vì vậy chúng tôi không thể cung cấp các boot image không phải GKI. Nhưng bạn có thể tự build kernel với KernelSU được tích hợp vào. - -Đầu tiên, bạn phải build được kernel từ nguồn có khả năng boot được , nếu kernel không có mã nguồn mở thì rất khó để chạy KernelSU cho thiết bị của bạn. - -Nếu bạn có thể build kernel khởi động được, có hai cách để tích hợp KernelSU vào mã nguồn kernel: - -1. Tự động với `kprobe` -2. Thủ công - - -## Tích hợp vào kprobe - -KernelSU sử dụng kprobe để thực hiện hook kernel, nếu *kprobe* chạy tốt trong kernel của bạn thì nên sử dụng cách này. - -Đầu tiên, thêm KernelSU vào mã nguồn kernel của bạn: - -- Thẻ mới nhất (ổn định) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -- Nhánh chính (dev) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -- Chọn thẻ (chẳng hạn như v0.5.2) - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -Sau đó, bạn nên kiểm tra xem *kprobe* có được bật trong config của bạn hay không, nếu không, vui lòng thêm các cấu hình sau vào: - -``` -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` - -Rồi build lại kernel của bạn, KernelSU sẽ hoạt động ok. - -Trong trường hợp kprobe chưa được bật, bạn có thể thêm `CONFIG_MODULES=y` vào kernel config. (Nếu vẫn không có hiệu lực thì hãy sử dụng `make menuconfig` rồi tìm các thành phần khác mà kprobe phụ thuộc). - -Nhưng nếu bạn gặp bootloop khi tích hợp KernelSU thì có khả năng ***kprobe bị hỏng trong kernel***, bạn nên fix lỗi kprobe trong mã nguồn hoặc dùng cách 2. - -## Chỉnh sửa mã nguồn kernel thủ công - -Nếu kprobe không thể hoạt động trong kernel của bạn (có thể là lỗi do upstream hoặc kernel dưới bản 4.8), thì bạn có thể thử cách này: - -Đầu tiên, thêm KernelSU vào mã nguồn kernel của bạn: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -Sau đó, thêm lệnh gọi KernelSU vào mã nguồn kernel, đây là một patch bạn có thể tham khảo: - -```diff -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; - -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; - -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+ - /** - * vfs_statx - Get basic and extra attributes by filename - * @dfd: A file descriptor representing the base dir for a relative filename -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ ksu_handle_stat(&dfd, &filename, &flags); - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` - -Bạn sẽ tìm thấy bốn chức năng trong mã nguồn kernel: - -1. do_faccessat, thường là trong `fs/open.c` -2. do_execveat_common, thường nằm trong `fs/exec.c` -3. vfs_read, thường nằm trong `fs/read_write.c` -4. vfs_statx, thường có trong `fs/stat.c` - -Cuối cùng, chỉnh sửa `KernelSU/kernel/ksu.c` và bỏ `enable_sucompat()` sau đó xây dựng lại kernel của bạn, KernelSU sẽ hoạt động tốt. diff --git a/website/docs/vi_VN/guide/installation.md b/website/docs/vi_VN/guide/installation.md deleted file mode 100644 index 0edb2242..00000000 --- a/website/docs/vi_VN/guide/installation.md +++ /dev/null @@ -1,171 +0,0 @@ -# Cách cài đặt - -## Kiểm tra xem thiết bị của bạn có được hỗ trợ không - -Tải xuống APP KernelSU manager từ [GitHub Releases](https://github.com/tiann/KernelSU/releases) và cài đặt nó vào thiết bị của bạn: - -- Nếu ứng dụng hiển thị `Unsupported`, nghĩa là **Bạn nên tự biên dịch kernel**, KernelSU sẽ không và không bao giờ cung cấp boot image để bạn flash. -- Nếu ứng dụng hiển thị `Not installed` thì thiết bị của bạn đã được KernelSU hỗ trợ chính thức. - -:::info -Đối với các thiết bị hiển thị `Unsupported`, đây là [Thiết-bị-hỗ-trợ-không-chính-thức](unofficially-support-devices.md), bạn có thể tự biên dịch kernel. -::: - -## Sao lưu stock boot.img - -Trước khi flash, trước tiên bạn phải sao lưu stock boot.img. Nếu bạn gặp phải bootloop (vòng lặp khởi động), bạn luôn có thể khôi phục hệ thống bằng cách quay lại trạng thái khởi động ban đầu bằng fastboot. - -::: warning -Việc flash có thể gây mất dữ liệu, hãy đảm bảo thực hiện tốt bước này trước khi chuyển sang bước tiếp theo!! Bạn cũng có thể sao lưu tất cả dữ liệu trên điện thoại nếu cần. -::: - -## Kiến thức cần thiết - -### ADB và fastboot - -Theo mặc định, bạn sẽ sử dụng các công cụ ADB và fastboot trong hướng dẫn này, vì vậy nếu bạn không biết về chúng, chúng tôi khuyên bạn nên sử dụng công cụ tìm kiếm để tìm hiểu về chúng trước tiên. - -### KMI - -Kernel Module Interface (KMI), các phiên bản kernel có cùng KMI đều **tương thích** Đây là ý nghĩa của "general" trong GKI; ngược lại, nếu KMI khác thì các kernel này không tương thích với nhau và việc flash kernel image có KMI khác với thiết bị của bạn có thể gây ra bootloop. - -Cụ thể, đối với thiết bị GKI, định dạng phiên bản kernel phải như sau: - -```txt -KernelRelease := -Version.PatchLevel.SubLevel-AndroidRelease-KmiGeneration-suffix -w .x .y -zzz -k -something -``` - -`w.x-zzz-k` là phiên bản KMI. Ví dụ: nếu phiên bản kernel của thiết bị là `5.10.101-android12-9-g30979850fc20`, thì KMI của nó là `5.10-android12-9`; về mặt lý thuyết, nó có thể khởi động bình thường với các kernel KMI khác. - -::: tip -Lưu ý rằng SubLevel trong phiên bản kernel không phải là một phần của KMI! Điều đó có nghĩa là `5.10.101-android12-9-g30979850fc20` có cùng KMI với `5.10.137-android12-9-g30979850fc20`! -::: - -### Phiên bản kernel vs Phiên bản Android - -Xin lưu ý: **Phiên bản kernel và phiên bản Android không nhất thiết phải giống nhau!** - -Nếu bạn nhận thấy phiên bản kernel của mình là `android12-5.10.101` nhưng phiên bản hệ thống Android của bạn là Android 13 hoặc phiên bản khác; xin đừng ngạc nhiên, vì số phiên bản của hệ thống Android không nhất thiết phải giống với số phiên bản của kernel Linux; Số phiên bản của kernel Linux nhìn chung nhất quán với phiên bản của hệ thống Android đi kèm với **thiết bị khi nó được xuất xưởng**. Nếu hệ thống Android được nâng cấp sau này, phiên bản kernel thường sẽ không thay đổi. Nếu bạn cần flash, **vui lòng tham khảo phiên bản kernel!!** - -## Giới thiệu - -Có một số phương pháp cài đặt KernelSU, mỗi phương pháp phù hợp với một kịch bản khác nhau, vì vậy vui lòng chọn khi cần. - -1. Cài đặt với Recovery tùy chỉnh (ví dụ TWRP) -2. Cài đặt bằng ứng dụng flash kernel, chẳng hạn như Franco Kernel Manager -3. Cài đặt thông qua fastboot bằng boot.img do KernelSU cung cấp -4. Sửa boot.img theo cách thủ công và cài đặt nó - -## Cài đặt với Recovery tùy chỉnh - -Điều kiện chắc chắn: Thiết bị của bạn phải có Recovery tùy chỉnh, chẳng hạn như TWRP; nếu không hoặc chỉ có Recovery chính thức, hãy sử dụng phương pháp khác. - -Các bước: - -1. Từ [Release page](https://github.com/tiann/KernelSU/releases) của KernelSU, tải xuống gói zip bắt đầu bằng AnyKernel3 phù hợp với phiên bản điện thoại của bạn; ví dụ: phiên bản kernel của điện thoại là `android12-5.10. 66`, thì bạn nên tải xuống tệp `AnyKernel3-android12-5.10.66_yyyy-MM.zip` (trong đó `yyyy` là năm và `MM` là tháng). -2. Khởi động lại điện thoại vào TWRP. -3. Sử dụng adb để đặt AnyKernel3-*.zip vào điện thoại /sdcard và chọn cài đặt nó trong GUI TWRP; hoặc bạn có thể trực tiếp `adb sideload AnyKernel-*.zip` để cài đặt. - -PS. Phương pháp này phù hợp với mọi cài đặt (không giới hạn cài đặt ban đầu hoặc các nâng cấp tiếp theo), miễn là bạn sử dụng TWRP. - -## Cài đặt bằng Kernel Flasher - -Điều kiện chắc chắn: Thiết bị của bạn phải được root. Ví dụ: bạn đã cài đặt Magisk để root hoặc bạn đã cài đặt phiên bản KernelSU cũ và cần nâng cấp lên phiên bản KernelSU khác; nếu thiết bị của bạn chưa được root, vui lòng thử các phương pháp khác. - -Các bước: - -1. Tải xuống zip AnyKernel3; hãy tham khảo phần *Cài đặt bằng Custom Recovery* để biết hướng dẫn tải xuống. -2. Mở Ứng dụng Kernel Flash và sử dụng zip AnyKernel3 được cung cấp để flash. - -Nếu trước đây bạn chưa từng sử dụng Ứng dụng Kernel flash thì sau đây là những ứng dụng phổ biến hơn. - -1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases) -2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel) -3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager) - -PS. Phương pháp này thuận tiện hơn khi nâng cấp KernelSU và có thể thực hiện mà không cần máy tính (sao lưu trước!). . - -Các bước: - -## Cài đặt bằng boot.img do KernelSU cung cấp - -Phương pháp này không yêu cầu bạn phải có TWRP, cũng như không yêu cầu điện thoại của bạn phải có quyền root; nó phù hợp cho lần cài đặt KernelSU đầu tiên của bạn. - -### Tìm boot.img thích hợp - -KernelSU cung cấp boot.img chung cho các thiết bị GKI và bạn nên chuyển boot.img vào phân vùng boot của thiết bị. - -Bạn có thể tải xuống boot.img từ [GitHub Release](https://github.com/tiann/KernelSU/releases), xin lưu ý rằng bạn nên sử dụng đúng phiên bản boot.img. Ví dụ: nếu thiết bị của bạn hiển thị kernel `android12-5.10.101` , bạn cần tải xuống `android-5.10.101_yyyy-MM.boot-.img`. (Giữ KMI nhất quán!) - -Trong đó `` đề cập đến định dạng nén kernel của boot.img chính thức của bạn, vui lòng kiểm tra định dạng nén kernel của boot.img ban đầu của bạn, bạn nên sử dụng đúng định dạng, ví dụ: `lz4`, `gz`; nếu bạn sử dụng định dạng nén không chính xác, bạn có thể gặp phải bootloop. - -::: info -1. Bạn có thể sử dụng magiskboot để lấy định dạng nén của boot ban đầu; Tất nhiên, bạn cũng có thể hỏi những người khác, có kinh nghiệm hơn có cùng kiểu máy với thiết bị của bạn. Ngoài ra, định dạng nén của kernel thường không thay đổi nên nếu bạn khởi động thành công với một định dạng nén nào đó thì bạn có thể thử định dạng đó sau. -2. Các thiết bị Xiaomi thường sử dụng `gz` hoặc **uncompressed** (không nén). -3. Đối với thiết bị Pixel, hãy làm theo hướng dẫn bên dưới. -::: - -### flash boot.img vào thiết bị - -Sử dụng `adb` để kết nối thiết bị của bạn, sau đó thực thi `adb restart bootloader` để vào chế độ fastboot, sau đó sử dụng lệnh này để flash KernelSU: - -```sh -fastboot flash boot boot.img -``` - -::: info -Nếu thiết bị của bạn hỗ trợ `fastboot boot`, trước tiên bạn có thể sử dụng `fastboot boot boot.img` để thử sử dụng boot.img để khởi động hệ thống trước. Nếu có điều gì bất ngờ xảy ra, hãy khởi động lại để boot. -::: - -### khởi động lại - -Sau khi flash xong bạn nên khởi động lại máy: - -```sh -fastboot reboot -``` - -## Vá boot.img theo cách thủ công - -Đối với một số thiết bị, định dạng boot.img không quá phổ biến, chẳng hạn như không `lz4`, `gz` và không nén; điển hình nhất là Pixel, định dạng boot.img của nó là nén `lz4_legacy`, ramdisk có thể là `gz` cũng có thể là nén `lz4_legacy`; tại thời điểm này, nếu bạn trực tiếp flash boot.img do KernelSU cung cấp, điện thoại có thể không khởi động được; Tại thời điểm này, bạn có thể vá boot.img theo cách thủ công để dùng được. - -Nhìn chung có hai phương pháp vá: - -1. [Android-Image-Kitchen](https://forum.xda-developers.com/t/tool-android-image-kitchen-unpack-repack-kernel-ramdisk-win-android-linux-mac.2073775/) -2. [magiskboot](https://github.com/topjohnwu/Magisk/releases) - -Trong số đó, Android-Image-Kitchen phù hợp để hoạt động trên PC và magiskboot cần sự kết nối của điện thoại di động. - -### Chuẩn bị - -1. Lấy stock boot.img của điện thoại; bạn có thể lấy nó từ nhà sản xuất thiết bị của mình, bạn có thể cần [payload-dumper-go](https://github.com/ssut/payload-dumper-go) -2. Tải xuống tệp zip AnyKernel3 do KernelSU cung cấp phù hợp với phiên bản KMI của thiết bị của bạn (bạn có thể tham khảo *Cài đặt với Khôi phục tùy chỉnh*). -3. Giải nén gói AnyKernel3 và lấy tệp `Image`, đây là tệp kernel của KernelSU. - -### Sử dụng Android-Image-Kitchen - -1. Tải Android-Image-Kitchen về máy tính. -2. Đặt stock boot.img vào thư mục gốc của Android-Image-Kitchen. -3. Thực thi `./unpackimg.sh boot.img` tại thư mục gốc của Android-Image-Kitchen, lệnh này sẽ giải nén boot.img và bạn sẽ nhận được một số tệp. -4. Thay thế `boot.img-kernel` trong thư mục `split_img` bằng `Image` bạn đã trích xuất từ AnyKernel3 (lưu ý đổi tên thành boot.img-kernel). -5. Thực thi `./repackimg.sh` tại thư mục gốc của 在 Android-Image-Kitchen; Và bạn sẽ nhận được một file có tên `image-new.img`; Flash boot.img này bằng fastboot(Tham khảo phần trước). - -### Sử dụng magiskboot - -1. Tải xuống Magisk mới nhất từ [Trang phát hành](https://github.com/topjohnwu/Magisk/releases) -2. Đổi tên `Magisk-*(version).apk` thành `Magisk-*.zip` và giải nén nó. -3. Đẩy `Magisk-*/lib/arm64-v8a/libmagiskboot.so` vào thiết bị của bạn bằng adb: `adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp /magiskboot` -4. Đẩy stock boot.img và Image trong AnyKernel3 vào thiết bị của bạn. -5. Nhập thư mục adb shell và cd `/data/local/tmp/`, sau đó `chmod +x magiskboot` -6. Nhập adb shell và cd `/data/local/tmp/`, thực thi `./magiskboot unpack boot.img` để giải nén `boot.img`, bạn sẽ nhận được file `kernel`, đây là kernel gốc của bạn. -7. Thay thế `kernel` bằng `Image`: `mv -f Image kernel` -8. Thực thi `./magiskboot repack boot.img` để đóng gói lại boot img và bạn sẽ nhận được một tệp `new-boot.img`, flash tệp này vào thiết bị bằng fastboot. - -## Các phương pháp khác - -Trên thực tế, tất cả các phương pháp cài đặt này chỉ có một ý tưởng chính, đó là **thay thế kernel gốc bằng kernel do KernelSU cung cấp**; chỉ cần đạt được điều này là có thể cài đặt được; ví dụ, sau đây là các phương pháp có thể khác. - -1. Trước tiên hãy cài đặt Magisk, nhận quyền root thông qua Magisk, sau đó sử dụng flasher kernel để flash trong zip AnyKernel từ KernelSU. -2. Sử dụng một số bộ công cụ flash trên PC để flash trong kernel do KernelSU cung cấp. diff --git a/website/docs/vi_VN/guide/module.md b/website/docs/vi_VN/guide/module.md deleted file mode 100644 index 0b83cd0f..00000000 --- a/website/docs/vi_VN/guide/module.md +++ /dev/null @@ -1,257 +0,0 @@ -# Hướng dẫn mô-đun - -KernelSU cung cấp một cơ chế mô-đun giúp đạt được hiệu quả sửa đổi thư mục hệ thống trong khi vẫn duy trì tính toàn vẹn của phân vùng system. Cơ chế này thường được gọi là "systemless". - -Cơ chế mô-đun của KernelSU gần giống với Magisk. Nếu bạn đã quen với việc phát triển mô-đun Magisk thì việc phát triển các mô-đun KernelSU cũng rất tương tự. Bạn có thể bỏ qua phần giới thiệu các mô-đun bên dưới và chỉ cần đọc [difference-with-magisk](difference-with-magisk.md). - -## Busybox - -KernelSU cung cấp tính năng nhị phân BusyBox hoàn chỉnh (bao gồm hỗ trợ SELinux đầy đủ). Tệp thực thi được đặt tại `/data/adb/ksu/bin/busybox`. BusyBox của KernelSU hỗ trợ "ASH Standalone Shell Mode" có thể chuyển đổi thời gian chạy. Standalone mode này có nghĩa là khi chạy trong shell `ash` của BusyBox, mọi lệnh sẽ trực tiếp sử dụng applet trong BusyBox, bất kể cái gì được đặt là `PATH`. Ví dụ: các lệnh như `ls`, `rm`, `chmod` sẽ **KHÔNG** sử dụng những gì có trong `PATH` (trong trường hợp Android theo mặc định, nó sẽ là `/system/bin/ls`, ` /system/bin/rm` và `/system/bin/chmod` tương ứng), nhưng thay vào đó sẽ gọi trực tiếp các ứng dụng BusyBox nội bộ. Điều này đảm bảo rằng các tập lệnh luôn chạy trong môi trường có thể dự đoán được và luôn có bộ lệnh đầy đủ cho dù nó đang chạy trên phiên bản Android nào. Để buộc lệnh _not_ sử dụng BusyBox, bạn phải gọi tệp thực thi có đường dẫn đầy đủ. - -Mỗi tập lệnh shell đơn lẻ chạy trong ngữ cảnh của KernelSU sẽ được thực thi trong shell `ash` của BusyBox với standalone mode được bật. Đối với những gì liên quan đến nhà phát triển bên thứ 3, điều này bao gồm tất cả các tập lệnh khởi động và tập lệnh cài đặt mô-đun. - -Đối với những người muốn sử dụng tính năng "Standalone mode" này bên ngoài KernelSU, có 2 cách để kích hoạt tính năng này: - -1. Đặt biến môi trường `ASH_STANDALONE` thành `1`
Ví dụ: `ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
Người bảo trìKho lưu trữThiết bị hỗ trợ
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
diff --git a/website/docs/vi_VN/guide/what-is-kernelsu.md b/website/docs/vi_VN/guide/what-is-kernelsu.md deleted file mode 100644 index ce509da0..00000000 --- a/website/docs/vi_VN/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# KernelSU là gì? - -KernelSU là một giải pháp root cho các thiết bị Android GKI, nó hoạt động ở chế độ kernel và cấp quyền root cho ứng dụng không gian người dùng trực tiếp trong không gian kernel. - -## Tính năng - -Tính năng chính của KernelSU là **Kernel-based** (dựa trên Kernel). KernelSU hoạt động ở chế độ kernel nên nó có thể cung cấp giao diện kernel mà chúng ta chưa từng có trước đây. Ví dụ: chúng ta có thể thêm điểm dừng phần cứng vào bất kỳ quy trình nào ở chế độ kernel; Chúng ta có thể truy cập bộ nhớ vật lý của bất kỳ quy trình nào mà không bị phát hiện; Chúng ta còn có thể chặn bất kỳ syscall nào trong không gian kernel; v.v. - -Ngoài ra, KernelSU còn cung cấp hệ thống mô-đun thông qua lớp phủ, cho phép bạn tải plugin tùy chỉnh vào hệ thống. Nó cũng cung cấp một cơ chế để sửa đổi các tập tin trong phân vùng `/system`. - -## Hướng dẫn sử dụng - -Xin hãy xem: [Cách cài đặt](installation) - -## Cách để build - -[Cách để build](how-to-build) - -## Thảo luận - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/vi_VN/index.md b/website/docs/vi_VN/index.md deleted file mode 100644 index 3a2722d3..00000000 --- a/website/docs/vi_VN/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -layout: home -title: Giải pháp root dựa trên kernel dành cho Android - -hero: - name: KernelSU - text: Giải pháp root dựa trên kernel dành cho Android - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: Bắt Đầu - link: /guide/what-is-kernelsu - - theme: alt - text: Xem trên GitHub - link: https://github.com/tiann/KernelSU - -features: - - title: Dựa trên Kernel - details: KernelSU đang hoạt động ở chế độ kernel Linux, nó có nhiều quyền kiểm soát hơn đối với các ứng dụng userspace. - - title: Kiểm soát truy cập bằng whitelist - details: Chỉ ứng dụng được cấp quyền root mới có thể truy cập `su`, các ứng dụng khác không thể nhận được su. - - title: Quyền root bị hạn chế - details: KernelSU cho phép bạn tùy chỉnh uid, gid, group, capabilities và các quy tắc SELinux của su. Giới hạn sức mạnh của root. - - title: Mô-đun & Nguồn mở - details: KernelSU hỗ trợ sửa đổi /system một cách systemless bằng overlayfs và nó có nguồn mở theo GPL-3. - diff --git a/website/docs/zh_CN/guide/app-profile.md b/website/docs/zh_CN/guide/app-profile.md deleted file mode 100644 index 2f45b9de..00000000 --- a/website/docs/zh_CN/guide/app-profile.md +++ /dev/null @@ -1,118 +0,0 @@ -# App Profile - -App Profile 是 KernelSU 提供的一种针对各种应用自定义其使用配置的机制。 - -对授予了 root 权限(也即可以使用 `su`)的应用来说,App Profile 也可以称之为 Root Profile,它可以自定义 `su` 的 `uid`, `gid`, `groups`, `capabilities` 以及 `SELinux` 规则,从而限制 root 用户的权限;比如可以针对防火墙应用仅授予网络权限,而不授予文件访问权限,针对冻结类应用仅授予 shell 权限而不是直接给 root;通过最小化权限原则**把权力关进笼子里**。 - -对于没有被授予 root 权限的普通应用,App Profile 可以控制内核以及模块系统对此应用的行为;比如是否需要针对此应用卸载模块造成的修改等。内核和模块系统可以通过此配置决定是否要做一些类似“隐藏痕迹”类的操作。 - -## Root Profile - -### UID、GID 和 groups - -Linux 系统中有用户和组两个概念。每个用户都有一个用户 ID(UID),一个用户可以属于多个组,每个组也有组 ID(GID)。该 ID 用于识别系统的用户并确定用户可以访问哪些系统资源。 - -UID 为 0 的用户被称之为 root 用户,GID 为 0 的组被称之为 root 组;root 用户组通常拥有系统的最高权限。 - -对于 Android 系统来说,每一个 App 都是一个单独的用户(不考虑 share uid 的情况),拥有一个唯一的 UID。比如 `0` 是 root 用户,`1000` 是 `system`,`2000` 是 ADB shell,10000-19999 的是普通用户。 - -:::info -此处的 UID 跟 Android 系统的多用户,或者说工作资料(Work Profile),不是一个概念。工作资料实际上是对 UID 进行分片实现的,比如 10000-19999 是主用户,110000-119999 是工作资料;他们中的任何一个普通应用都拥有自己独有的 UID。 -::: - -每一个 App 可以有若干个组,GID 是其主要的组,通常与 UID 一致;其他的组被称之为补充组 (groups)。某些权限是通过组控制的,比如网络访问,蓝牙等。 - -例如,如果我们在 ADB shell 中执行 `id` 命令,会得到如下输出: - -```sh -oriole:/ $ id -uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readtracefs) context=u:r:shell:s0 -``` - -其中,UID 为 `2000`,GID 也即主要组 ID 也为 `2000`;除此之外它还在很多补充组里面,例如 `inet` 组代表可以创建 `AF_INET` 和 `AF_INET6` 的 socket(访问网络),`sdcard_rw` 代表可以读写 sdcard 等。 - -KernelSU 的 Root Profile 可以自定义执行 `su` 后 root 进程的 UID, GID 和 groups。例如,你可以设置某个 root 应用的 Root Profile 其 UID 为 `2000`,这意味着此应用在使用 `su` 的时候,它的实际权限是 ADB Shell 级别;你可以去掉 groups 中的 `inet`,这样这个 `su` 就无法访问网络。 - -:::tip 注意 -App Profile 仅仅是控制 root 应用使用 `su` 后的权限,它并非控制 App 本身的权限!如果 App 本身申请了网络访问权限,那么它即使不使用 `su` 也可以访问网络;为 `su` 去掉 `inet` 组仅仅是让 `su` 无法访问网络。 -::: - -与应用通过 `su` 主动切换用户或者组不同,Root Profile 是在内核中强制实施的,不依赖 root 应用的自觉行为,`su` 权限的授予完全取决于用户而非开发者。 - -### Capabilities - -Capabilities 是 Linux 的一种分权机制。 - -传统的 UNIX 系统为了执行权限检查,将进程分为两类:特权进程(其有效用户 ID 为 0,称为超级用户或 root)和非特权进程(其有效 UID 为非零)。特权进程会绕过所有内核权限检查,而非特权进程则根据其凭据(通常是有效 UID、有效 GID 和补充组列表)进行完整的权限检查。 - -从 Linux 2.2 开始,Linux 将传统上与超级用户关联的特权分解为独立的单元,称为 Capabilities(有的也翻译为“权能”),它们可以独立启用和禁用。 - -每一个 Capability 代表一个或者一类权限。比如 `CAP_DAC_READ_SEARCH` 就代表是否有能力绕过文件读取权限检查和目录读取和执行权限检查。如果一个有效 UID 为 `0` 的用户(root 用户)没有 `CAP_DAC_READ_SEARCH` 或者更高 Capalities,这意味着即使它是 root 也不能随意读取文件。 - -KernelSU 的 Root Profile 可以自定义执行 `su` 后 root 进程的 Capabilities,从而实现只授予“部分 root 权限”。与上面介绍的 UID, GID 不同,某些 root 应用就是需要 `su` 后 UID 是 `0`,此时我们可以通过限制这个 UID 为 `0` 的 root 用户的 Capabilities,就可以限制它能够执行的操作。 - -:::tip 强烈建议 -Linux 系统关于 Capability 的 [官方文档](https://man7.org/linux/man-pages/man7/capabilities.7.html),解释了每一项 Capability 所代表的能力,写的非常详细,如果你想要自定义 Capabilities,请务必先阅读此文档。 -::: - -### SELinux - -SELinux 是一种强大的强制性权限访问控制(MAC)机制。它按照**默认拒绝**的原则运行:任何未经明确允许的行为都会被拒绝。 - -SELinux 可按两种全局模式运行: - -1. 宽容模式:权限拒绝事件会被记录下来,但不会被强制执行。 -2. 强制模式:权限拒绝事件会被记录下来**并**强制执行。 - -:::warning 警告 -现代的 Android 系统极度依赖 SELinux 来保障整个系统的安全性,我们强烈建议您不要使用任何以“宽容模式”运行的自定义系统,因为那样与裸奔没什么区别。 -::: - -SELinux 的完整概念比较复杂,我们这里不打算讲解它的具体工作方式,建议你先通过以下资料来了解其工作原理: - -1. [wikipedia](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) -2. [Redhat: what-is-selinux](https://www.redhat.com/en/topics/linux/what-is-selinux) -3. [ArchLinux: SELinux](https://wiki.archlinux.org/title/SELinux) - -KernelSU 的 Root Profile 可以自定义执行 `su` 后 root 进程的 SELinux context,并且可以针对这个 context 设置特定的访问控制规则,从而更加精细化地控制 root 权限。 - -通常情况下,应用执行 `su` 后,会将进程切换到一个 **不受任何限制** 的 SELinux 域,比如 `u:r:su:s0`,通过 Root Profile,我们可以将它切换到一个自定义的域,比如 `u:r:app1:s0`,然后为这个域制定一系列规则: - -```sh -type app1 -enforce app1 -typeattribute app1 mlstrustedsubject -allow app1 * * * -``` - -注意:此处的 `allow app1 * * *` 仅仅作为演示方便而使用,实际过程中不应使用这个规则,因为它跟 permissive 区别不大。 - -### 逃逸 - -如果 Root Profile 的配置不合理,那么可能会发生逃逸的情况:Root Profile 的限制会意外失效。 - -比如,如果你为 ADB shell 用户设置允许 root 权限(这是相当常见的情况);然后你给某个普通应用允许 root 权限,但是配置它的 root profile 中的 UID 为 2000(ADB shell 用户的 UID);那么此时,这个 App 可以通过执行两次 `su` 来获得完整的 root 权限: - -1. 第一次执行 `su`,由于 App Profile 强制生效,会正常切换到 UID 为 `2000(adb shell)` 而非 `0(root)`。 -2. 第二次执行 `su`,由于此时它 UID 是 `2000`,而你给 `2000(adb shell)` 配置了允许 root,它会获得完整的 root 权限! - -:::warning 注意 -这是完全符合预期的行为,并非 BUG!因此我们建议: - -如果你的确需要给 adb 授予 root 权限(比如你是开发者),那么不建议你在配置 Root Profile 的时候将 UID 改成 `2000`,用 `1000(system)` 会更好。 -::: - -## Non Root Profile - -### 卸载模块 - -KernelSU 提供了一种 systemless 的方式来修改系统分区,这是通过挂载 overlayfs 来实现的。但有些情况下,App 可能会对这种行为比较敏感;因此,我们可以通过设置“卸载模块”来卸载挂载在这些 App 上的模块。 - -另外,KernelSU 管理器的设置界面还提供了一个“默认卸载模块”的开关,这个开关默认情况下是**开启**的,这意味着**如果不对 App 做额外的设置**,默认情况下 KernelSU 或者某些模块会对此 App 执行卸载操作。当然,如果你不喜欢这个设置或者这个设置会影响某些 App,可以有如下选择: - -1. 保持“默认卸载模块”的开关,然后针对不需要“卸载模块”的 App 进行单独的设置,在 App Profile 中关闭“卸载模块”;(相当于“白名单”)。 -2. 关闭“默认卸载模块”的开关,然后针对需要“卸载模块”的 App 进行单独的设置,在 App Profile 中开启“卸载模块”;(相当于“黑名单”)。 - -:::info -KernelSU 在 5.10 及以上内核上,内核会执行“卸载模块”的操作;但在 5.10 以下的设备上,这个开关仅仅是一个“配置项”,KernelSU 本身不会做任何动作,一些模块(如 Zygisksu 会通过这个模块决定是否需要卸载) -::: diff --git a/website/docs/zh_CN/guide/difference-with-magisk.md b/website/docs/zh_CN/guide/difference-with-magisk.md deleted file mode 100644 index ea539369..00000000 --- a/website/docs/zh_CN/guide/difference-with-magisk.md +++ /dev/null @@ -1,28 +0,0 @@ -# KernelSU 模块与 Magisk 的差异 {#title} - -虽然 KernelSU 模块与 Magisk 模块有很多相似之处,但由于它们的实现机制完全不同,因此不可避免地会有一些差异;如果你希望你的模块能同时在 Magisk 与 KernelSU 中运行,那么你必须了解这些差异。 - -## 相同之处 {#similarities} - -- 模块文件格式: 都以 zip 的方式组织模块,并且模块的格式几乎相同 -- 模块安装目录: 都在 `/data/adb/modules` -- systemless: 都支持通过模块的形式以 systemless 修改 /system -- `post-fs-data.sh`: 执行时机完全一致,语义也完全一致 -- `service.sh`: 执行时机完全一致,语义也完全一致 -- `system.prop`: 完全相同 -- `sepolicy.rule`: 完全相同 -- BusyBox:脚本都在 BusyBox 中以“独立模式”运行 - -## 不同之处 {#differences} - -在了解不同之处之前,你需要知道如何区分你的模块是运行在 KernelSU 还是运行在 Magisk 之中;在所有你可以运行模块脚本的地方(`customize.sh`, `post-fs-data.sh`, `service.sh`),你都可以通过环境变量`KSU` 来区分,在 KernelSU 中,这个环境变量将被设置为 `true`。 - -以下是一些不同之处: - -1. KernelSU 的模块不支持在 Recovery 中安装。 -2. KernelSU 的模块没有内置的 Zygisk 支持(但你可以通过 [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) 来使用 Zygisk 模块)。 -3. KernelSU 模块替换或者删除文件与 Magisk 完全不同。KernelSU 不支持 `.replace` 方式,相反,你需要通过 `mknod filename c 0 0` 创建同名文件夹来删除对应文件。 -4. BusyBox 的目录不同;KernelSU 内置的 BusyBox 在 `/data/adb/ksu/bin/busybox` 而 Magisk 在 `/data/adb/magisk/busybox`;**注意此为 KernelSU 内部行为,未来可能会更改!** -5. KernelSU 不支持 `.replace` 文件;但 KernelSU 支持 `REPLACE` 和 `REMOVE` 变量。 -6. KernelSU 新增了一种脚本 `boot-completed.sh`,以便在 Android 系统启动后运行某些任务。 -7. KernelSU 新增了一种脚本 `post-mount.sh`,以便在 Overlayfs 挂载后运行某些任务。 diff --git a/website/docs/zh_CN/guide/faq.md b/website/docs/zh_CN/guide/faq.md deleted file mode 100644 index 4aca7702..00000000 --- a/website/docs/zh_CN/guide/faq.md +++ /dev/null @@ -1,74 +0,0 @@ -# 常见问题 - -## KernelSU 是否支持我的设备? - -首先,您的设备应该能够解锁 bootloader。 如果不能,则不支持。 - -然后在你的设备上安装 KernelSU 管理器并打开它,如果它显示 `不支持` ,那么你的设备没有官方支持的开箱即用的 boot image;但你可以自己编译内核集成 KernelSU 进而使用它。 - -## KernelSU 是否需要解锁 Bootloader? - -当然需要。 - -## KernelSU 是否支持模块? - -支持。请查阅 [模块](module.md)。 - -## KernelSU 是否支持 Xposed? - -支持。LSPosed 可以在 [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) 的支持下正常运行。 - -## KernelSU 支持 Zygisk 吗? - -KernelSU 本体不支持 Zygisk,但是你可以用 [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) 来使用 Zygisk 模块。 - -## KernelSU 与 Magisk 兼容吗? - -KernelSU 的模块系统与 Magisk 的 magic mount 有冲突,如果 KernelSU 中启用了任何模块,那么整个 Magisk 将无法工作。 - -但是如果你只使用 KernelSU 的 `su`,那么它会和 Magisk 一起工作:KernelSU 修改 `kernel` 、 Magisk 修改 `ramdisk`,它们可以一起工作。 - -## KernelSU 会替代 Magisk 吗? - -我们不这么认为,这也不是我们的目标。Magisk 对于用户空间 root 解决方案来说已经足够好了,它会存活很久。KernelSU 的目标是为用户提供内核接口,而不是替代 Magisk。 - -## KernelSU 可以支持非 GKI 设备吗? - -可以。但是你应该下载内核源代码并将 KernelSU 集成到源代码树中并自己编译内核。 - -## KernelSU 支持 Android 12 以下的设备吗? - -影响 KernelSU 兼容性的是设备内核的版本,它与设备的 Android 版本没有直接的关系。唯一有关联的是:**出厂** Android 12 的设备,一定是 5.10 或更高的内核(GKI 设备);因此结论如下: - -1. 出厂 Android 12 的设备必定是支持的(GKI 设备) -2. 旧版本内核的设备(即使是 Android 12,也可能是旧内核)是兼容的(你需要自己编译内核) - -## KernelSU 可以支持旧内核吗? - -可以,目前最低支持到 4.14;更低的版本你需要手动移植它,欢迎 PR ! - -## 如何为旧内核集成 KernelSU? - -参考[教程](how-to-integrate-for-non-gki) - -## 为什么我手机系统是 Android 13,但内核版本却是 "android12-5.10"? - -内核版本与 Android 版本无关,如果你需要刷入 KernelSU,请永远使用**内核版本**而非 Android 版本,如果你为 "android12-5.10" 的设备刷入 Android 13 的内核,等待你的将是 bootloop. - -## 我是 GKI1.0, 能用 KernelSU 吗? - -GKI1 跟 GKI2 完全是两个东西,所以你需要自行编译内核。 - -## 如何把 `/system` 变成挂载为可读写? - -我们不建议你直接修改系统分区,你应该使用[模块功能](module.md) 来做修改;如果你执意要这么做,可以看看 [magisk_overlayfs](https://github.com/HuskyDG/magic_overlayfs) - -## KernelSU 能修改 hosts 吗,我如何使用 AdAway? - -当然可以。但这个功能 KernelSU 没有内置,你可以安装这个 [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) - -## 为什么有个 1 TB 的超大文件? - -1 TB 大小的 `modules.img` 是一个磁盘镜像文件,**不要担心它的大小**,它是一种被称之为[稀疏文件](https://en.wikipedia.org/wiki/Sparse_file)的文件格式,它的实际大小只有你使用的模块的大小,并且你在删除模块后它会动态缩小;它并不实际占用 1 TB 大小的磁盘空间(实际上你手机可能并没有这么多空间)。 - -如果你真的对这个文件的大小感到不爽,你可以使用 `resize2fs -M` 命令让它变成实际大小;但此时模块可能无法正常工作,我们也不会为此提供任何支持。 diff --git a/website/docs/zh_CN/guide/hidden-features.md b/website/docs/zh_CN/guide/hidden-features.md deleted file mode 100644 index 87c45865..00000000 --- a/website/docs/zh_CN/guide/hidden-features.md +++ /dev/null @@ -1,7 +0,0 @@ -# 隐藏功能 - -## ksurc - -默认情况下,`/system/bin/sh` 会加载 `/system/etc/mkshrc`。 - -可以通过创建 `/data/adb/ksu/.ksurc` 文件来让 su 加载该文件而不是 `/system/etc/mkshrc`。 \ No newline at end of file diff --git a/website/docs/zh_CN/guide/how-to-build.md b/website/docs/zh_CN/guide/how-to-build.md deleted file mode 100644 index 5884b95f..00000000 --- a/website/docs/zh_CN/guide/how-to-build.md +++ /dev/null @@ -1,63 +0,0 @@ -# 如何构建 KernelSU? - -首先,您应该阅读内核构建的 Android 官方文档: - -1. [构建内核](https://source.android.com/docs/setup/build/building-kernels) -2. [通用内核映像 (GKI) 发布构建](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -::: warning -本文档适用于 GKI 设备,如果你是旧内核,请参考[如何为非GKI设备集成 KernelSU](how-to-integrate-for-non-gki) -::: - -## 构建内核 - -### 同步内核源码 - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -`` 是一个可以唯一确定构建的清单文件,您可以使用该清单进行可重新预测的构建。 您应该从 [通用内核映像 (GKI) 发布构建](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) 下载清单文件 - -### 构建 - -请先查看 [官方文档](https://source.android.com/docs/setup/build/building-kernels)。 - -例如,我们需要构建 aarch64 内核镜像: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` - -不要忘记添加 `LTO=thin`, 否则,如果您的计算机内存小于 24GB,构建可能会失败. - -从 Android 13 开始,内核由 `bazel` 构建: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` - -## 使用 KernelSU 构建内核 - -如果您可以成功构建内核,那么构建 KernelSU 就很容易,根据自己的需求在内核源代码根目录中运行以下任一命令: - -::: code-group - -```sh[最新 tag(稳定版本)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -```sh[main 分支(开发版本)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -```sh[指定 tag(比如 v0.5.2)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -::: - -然后重建内核,您将获得带有 KernelSU 的内核映像! diff --git a/website/docs/zh_CN/guide/how-to-integrate-for-non-gki.md b/website/docs/zh_CN/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index 936796e9..00000000 --- a/website/docs/zh_CN/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,369 +0,0 @@ -# 如何为非 GKI 内核集成 KernelSU {#introduction} - -KernelSU 可以被集成到非 GKI 内核中,现在它最低支持到内核 4.14 版本;理论上也可以支持更低的版本。 - -由于非 GKI 内核的碎片化极其严重,因此通常没有统一的方法来编译它,所以我们也无法为非 GKI 设备提供 boot 镜像。但你完全可以自己集成 KernelSU 然后编译内核使用。 - -首先,你必须有能力从你设备的内核源码编译出一个可以开机并且能正常使用的内核,如果内核不开源,这通常难以做到。 - -如果你已经做好了上述准备,那有两个方法来集成 KernelSU 到你的内核之中。 - -1. 借助 `kprobe` 自动集成 -2. 手动修改内核源码 - -## 使用 kprobe 集成 {#using-kprobes} - -KernelSU 使用 kprobe 机制来做内核的相关 hook,如果 *kprobe* 可以在你编译的内核中正常运行,那么推荐用这个方法来集成。 - -首先,把 KernelSU 添加到你的内核源码树,在内核的根目录执行以下命令: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -:::info -[KernelSU 1.0 及更高版本已经不再支持非 GKI 内核](https://github.com/tiann/KernelSU/issues/1705),最后的支持版本为 `v0.9.5`,请注意使用正确的版本。 -::: - -然后,你需要检查你的内核是否开启了 *kprobe* 相关的配置,如果没有开启,需要添加以下配置: - -``` -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` - -最后,重新编译你的内核即可。 - -如果你发现 KPROBES 仍未生效,很有可能是因为它的依赖项`CONFIG_MODULES`没有被启用(如果还是未生效请键入`make menuconfig`搜索 KPROBES 的其它依赖并启用) - -如果你在集成 KernelSU 之后手机无法启动,那么很可能你的内核中 **kprobe 工作不正常**,你需要修复这个 bug 或者用第二种方法。 - -:::tip 如何验证是否是 kprobe 的问题? - -注释掉 `KernelSU/kernel/ksu.c` 中 `ksu_enable_sucompat()` 和 `ksu_enable_ksud()`,如果正常开机,那么就是 kprobe 的问题;或者你可以手动尝试使用 kprobe 功能,如果不正常,手机会直接重启。 -::: - -## 手动修改内核源码 {#modify-kernel-source-code} - -如果 kprobe 工作不正常(通常是上游的 bug 或者内核版本过低),那你可以尝试这种方法: - -首先,把 KernelSU 添加到你的内核源码树,在内核的根目录执行以下命令: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -请注意,某些设备的 defconfig 文件可能在`arch/arm64/configs/设备代号_defconfig`或位于`arch/arm64/configs/vendor/设备代号_defconfig`。在您的 defconfig 文件中,将`CONFIG_KSU`设置为`y`以启用 KernelSU,或设置为`n`以禁用。比如在某个 defconfig 中: -`arch/arm64/configs/...` -```sh -+# KernelSU -+CONFIG_KSU=y -``` - -然后,将 KernelSU 调用添加到内核源代码中,这里有几个补丁可以参考: - -::: code-group - -```diff[exec.c] -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); -+#endif - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); -+ #endif - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff[open.c] -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff[read_write.c] -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+#ifdef CONFIG_KSU -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); -+#endif - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ #endif -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff[stat.c] -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif -+ - /** - * vfs_statx - Get basic and extra attributes by filename - * @dfd: A file descriptor representing the base dir for a relative filename -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flags); -+ #endif - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` -::: - -主要是要改四个地方: - -1. do_faccessat,通常位于 `fs/open.c` -2. do_execveat_common,通常位于 `fs/exec.c` -3. vfs_read,通常位于 `fs/read_write.c` -4. vfs_statx,通常位于 `fs/stat.c` - -如果你的内核没有 `vfs_statx`, 使用 `vfs_fstatat` 来代替它: -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 068fdbcc9e26..5348b7bb9db2 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -87,6 +87,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) - } - EXPORT_SYMBOL(vfs_fstat); - -+#ifdef CONFIG_KSU -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+#endif -+ - int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int flag) - { -@@ -94,6 +96,8 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int error = -EINVAL; - unsigned int lookup_flags = 0; -+ #ifdef CONFIG_KSU -+ ksu_handle_stat(&dfd, &filename, &flag); -+ #endif -+ - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH)) != 0) - goto out; -``` - -对于早于 4.17 的内核,如果没有 `do_faccessat`,可以直接找到 `faccessat` 系统调用的定义然后修改: - -```diff -diff --git a/fs/open.c b/fs/open.c -index 2ff887661237..e758d7db7663 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -355,6 +355,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return error; - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+#endif -+ - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -370,6 +373,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; -+ #ifdef CONFIG_KSU -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ #endif -+ - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` - -### 安全模式 - -要使用 KernelSU 内置的安全模式,你还需要修改 `drivers/input/input.c` 中的 `input_handle_event` 方法: - -:::tip -强烈建议开启此功能,对用户救砖会非常有帮助! -::: - -:::info 莫名其妙进入安全模式? -如果你采用手动集成的方式,并且没有禁用`CONFIG_KPROBES`,那么用户在开机之后按音量下,也可能触发安全模式!因此如果使用手动集成,你需要关闭 `CONFIG_KPROBES`! -::: - -```diff -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 45306f9ef247..815091ebfca4 100755 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -367,10 +367,13 @@ static int input_get_disposition(struct input_dev *dev, - return disposition; - } - -+#ifdef CONFIG_KSU -+extern bool ksu_input_hook __read_mostly; -+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value); -+#endif -+ - static void input_handle_event(struct input_dev *dev, - unsigned int type, unsigned int code, int value) - { - int disposition = input_get_disposition(dev, type, code, &value); -+ #ifdef CONFIG_KSU -+ if (unlikely(ksu_input_hook)) -+ ksu_handle_input_handle_event(&type, &code, &value); -+ #endif - - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - add_input_randomness(type, code, value); -``` - -### pm 命令执行失败? - -你需要同时修改 `fs/devpts/inode.c`,补丁如下: - -```diff -diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c -index 32f6f1c68..d69d8eca2 100644 ---- a/fs/devpts/inode.c -+++ b/fs/devpts/inode.c -@@ -602,6 +602,8 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - return dentry; - } - -+extern int ksu_handle_devpts(struct inode*); -+ - /** - * devpts_get_priv -- get private data for a slave - * @pts_inode: inode of the slave -@@ -610,6 +612,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - */ - void *devpts_get_priv(struct dentry *dentry) - { -+ ksu_handle_devpts(dentry->d_inode); - if (dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC) - return NULL; - return dentry->d_fsdata; -``` - -### path_umount {#how-to-backport-path-umount} - -你可以通过从 K5.9 向旧版本移植 `path_umount`,在 GKI 之前的内核上获得卸载模块的功能。你可以通过以下补丁作为参考: - -```diff ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -1739,6 +1739,39 @@ static inline bool may_mandlock(void) - } - #endif - -+static int can_umount(const struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ -+ if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) -+ return -EINVAL; -+ if (!may_mount()) -+ return -EPERM; -+ if (path->dentry != path->mnt->mnt_root) -+ return -EINVAL; -+ if (!check_mnt(mnt)) -+ return -EINVAL; -+ if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ -+ return -EINVAL; -+ if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ return 0; -+} -+ -+int path_umount(struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ int ret; -+ -+ ret = can_umount(path, flags); -+ if (!ret) -+ ret = do_umount(mnt, flags); -+ -+ /* we mustn't call path_put() as that would clear mnt_expiry_mark */ -+ dput(path->dentry); -+ mntput_no_expire(mnt); -+ return ret; -+} - /* - * Now umount can handle mount points as well as block devices. - * This is important for filesystems which use unnamed block devices. -``` - -改完之后重新编译内核即可。 diff --git a/website/docs/zh_CN/guide/installation.md b/website/docs/zh_CN/guide/installation.md deleted file mode 100644 index 1fce7665..00000000 --- a/website/docs/zh_CN/guide/installation.md +++ /dev/null @@ -1,279 +0,0 @@ -# 安装 {#title} - -## 检查您的设备是否被支持 {#check-if-supported} - -从 [GitHub Releases](https://github.com/tiann/KernelSU/releases) 下载 KernelSU 管理器应用,然后将应用程序安装到设备并打开: - -- 如果应用程序显示 “不支持”,则表示您的设备不支持 KernelSU,你需要自己编译设备的内核才能使用,KernelSU 官方不会也永远不会为你提供一个可以刷写的 boot 镜像。 -- 如果应用程序显示 “未安装”,那么 KernelSU 支持您的设备;可以进行下一步操作。 - -:::info -对于显示“不支持”的设备,这里有一个[非官方支持设备列表](unofficially-support-devices.md),你可以用这个列表里面的内核自行编译。 -::: - -## 备份你的 boot.img {#backup-boot-image} - -在进行刷机操作之前,你必须先备份好自己的原厂 boot.img。如果你后续刷机出现了任何问题,你都可以通过使用 fastboot 刷回原厂 boot 来恢复系统。 - -::: warning -任何刷机操作都是有风险的,请务必做好这一步再进行下一步操作!!必要时你还可以备份你手机的所有数据。 -::: - -## 必备知识 {#acknowage} - -### ADB 和 fastboot {#adb-and-fastboot} - -此教程默认你会使用 ADB 和 fastboot 工具,如果你没有了解过,建议使用搜索引擎先学习相关知识。 - -### KMI - -KMI 全称 Kernel Module Interface,相同 KMI 的内核版本是**兼容的** 这也是 GKI 中“通用”的含义所在;反之,如果 KMI 不同,那么这些内核之间无法互相兼容,刷入与你设备 KMI 不同的内核镜像可能会导致死机。 - -具体来说,对 GKI 的设备,其内核版本格式应该如下: - -```txt -KernelRelease := -Version.PatchLevel.SubLevel-AndroidRelease-KmiGeneration-suffix -w .x .y -zzz -k -something -``` - -其中,`w.x-zzz-k` 为 KMI 版本。例如,一个设备内核版本为`5.10.101-android12-9-g30979850fc20`,那么它的 KMI 为 `5.10-android12-9`;理论上刷入其他这个 KMI 的内核也能正常开机。 - -::: tip -请注意,内核版本中的 SubLevel 不属于 KMI 的范畴!也就是说 `5.10.101-android12-9-g30979850fc20` 与 `5.10.137-android12-9-g30979850fc20` 的 KMI 相同! -::: - -### 安全补丁级别 {#security-patch-level} - -新的 Android 设备上可能采取了防回滚机制,它不允许刷入一个安全补丁更旧的内核。比如,如果你的设备内核是 `5.10.101-android12-9-g30979850fc20`,它的安全补丁为 `2023-11`;即使你刷入与内核 KMI 一致的内核,如果安全补丁级别比 `2023-11` 要老(例如`2023-06`),那么很可能会无法开机。 - -因此,在保持 KMI 一致的情况下,优先采用安全补丁级别更新的内核。 - -### 内核版本与 Android 版本 {#kernel-version-vs-android-version} - -请注意:**内核版本与 Android 版本并不一定相同!** - -如果您发现您的内核版本是 `android12-5.10.101`,然而你 Android 系统的版本为 Android 13 或者其他;请不要觉得奇怪,因为 Android 系统的版本与 Linux 内核的版本号不一定是一致的;Linux 内核的版本号一般与**设备出厂的时候自带的 Android 系统的版本一致**,如果后续 Android 系统升级,内核版本一般不会发生变化。如果你需要刷机,**请以内核版本为准!!** - -## 安装介绍 {#installationintroduction} - -自 `0.9.0` 版本以后,在 GKI 设备中,KernelSU 支持两种运行模式: - -1. `GKI`:使用**通用内核镜像**(GKI)替换掉设备原有的内核。 -2. `LKM`:使用**可加载内核模块**(LKM)的方式加载到设备内核中,不会替换掉设备原有的内核。 - -这两种方式适用于不同的场景,你可以根据自己的需求选择。 - -### GKI 模式 {#gki-mode} - -GKI 模式会替换掉设备原有的内核,使用 KernelSU 提供的通用内核镜像。GKI 模式的优点是: - -1. 通用型强,适用于大多数设备;比如三星开启了 KNOX 的设备,LKM 模式无法运作。还有一些冷门的魔改设备,也只能使用 GKI 模式; -2. 不依赖官方固件即可使用;不需要等待官方固件更新,只要 KMI 一致,就可以使用; - -### LKM 模式 {#lkm-mode} - -LKM 模式不会替换掉设备原有的内核,而是使用可加载内核模块的方式加载到设备内核中。LKM 模式的优点是: - -1. 不会替换掉设备原有的内核;如果你对设备原有的内核有特殊需求,或者你希望在使用第三方内核的同时使用 KernelSU,可以使用 LKM 模式; -2. 升级和 OTA 较为方便;升级 KernelSU 时,可以直接在管理器里面安装,无需再手动刷写;系统 OTA 后,可以直接安装到第二个槽位,也无需再手动刷写; -3. 适用于一些特殊场景;比如使用临时 ROOT 权限也可以加载 LKM,由于不需要替换 boot 分区,因此不会触发 avb,不会使设备意外变砖; -4. LKM 可以被临时卸载;如果你临时想取消 root,可以卸载 LKM,这个过程不需要刷写分区,甚至也不用重启设备;如果你想再次 root,只需要重启设备即可; - -:::tip 两种模式共存 -打开管理器后,你可以在首页看到设备当前运行的模式;注意 GKI 模式的优先级高于 LKM,如你既使用 GKI 内核替换掉了原有的内核,又使用 LKM 的方式修补了 GKI 内核,那么 LKM 会被忽略,设备将永远以 GKI 的模式运行。 -::: - -### 选哪个? {#which-one} - -如果你的设备是手机,我们建议您优先考虑 LKM 模式;如果你的设备是模拟器、WSA 或者 Waydroid 等,我们建议您优先考虑 GKI 模式。 - -## LKM 安装 - -### 获取官方固件 - -使用 LKM 的模式,需要获取官方固件,然后在官方固件的基础上修补;如果你使用的是第三方内核,可以把第三方内核的 boot.img 作为官方固件。 - -获取官方固件的方法有很多,如果你的设备支持 `fastboot boot`,那么我们最推荐以及最简单的方法是使用 `fastboot boot` 临时启动 KernelSU 提供的 GKI 内核,然后安装管理器,最后在管理器中直接安装;这种方法不需要你手动下载官方固件,也不需要你手动提取 boot。 - -如果你的设备不支持 `fastboot boot`,那么你可能需要手动去下载官方固件包,然后从中提取 boot。 - -与 GKI 模式不同,LKM 模式会修改 `ramdisk`,因此在出厂 Android 13 的设备上,它需要修补的是 `init_boot` 分区而非 `boot` 分区;而 GKI 模式则永远是操作 `boot` 分区。 - -### 使用管理器 - -打开管理器,点击右上角的安装图标,会出现若干个选项: - -1. 选择并修补一个文件;如果你手机目前没有 root 权限,你可以选择这个选项,然后选择你的官方固件,管理器会自动修补它;你只需要刷入这个修补后的文件,即可永久获取 root 权限; -2. 直接安装;如果你手机已经 root,你可以选择这个选项,管理器会自动获取你的设备信息,然后自动修补官方固件,然后刷入;你可以考虑使用 `fastboot boot` KernelSU 的 GKI 内核来获取临时 root 安装管理器,然后再使用这个选项;这种方式也是 KernelSU 升级最主要的方式; -3. 安装到另一个分区;如果你的设备支持 A/B 分区,你可以选择这个选项,管理器会自动修补官方固件,然后安装到另一个分区;这种方式适用于 OTA 后的设备,你可以在 OTA 后直接安装到另一个分区,然后重启设备即可; - -### 使用命令行 - -如果你不想使用管理器,你也可以使用命令行来安装 LKM;KernelSU 提供的 `ksud` 工具可以帮助你快速修补官方固件,然后刷入。 - -这个工具支持 macOS、Linux 和 Windows,你可以在 [GitHub Release](https://github.com/tiann/KernelSU/releases) 下载对应的版本。 - -使用方法:`ksud boot-patch` 具体的使用方法你可以查看命令行帮助。 - -```sh -oriole:/ # ksud boot-patch -h -Patch boot or init_boot images to apply KernelSU - -Usage: ksud boot-patch [OPTIONS] - -Options: - -b, --boot boot image path, if not specified, will try to find the boot image automatically - -k, --kernel kernel image path to replace - -m, --module LKM module path to replace, if not specified, will use the builtin one - -i, --init init to be replaced - -u, --ota will use another slot when boot image is not specified - -f, --flash Flash it to boot partition after patch - -o, --out output path, if not specified, will use current directory - --magiskboot magiskboot path, if not specified, will use builtin one - --kmi KMI version, if specified, will use the specified KMI - -h, --help Print help -``` - -需要说明的几个选项: - -1. `--magiskboot` 选项可以指定 magiskboot 的路径,如果不指定,ksud 会在环境变量中查找;如果你不知道如何获取 magiskboot,可以查阅[这里](#patch-boot-image); -2. `--kmi` 选项可以指定 `KMI` 版本,如果你的设备内核名字没有遵循 KMI 规范,你可以通过这个选项来指定; - -最常见的使用方法为: - -```sh -ksud boot-patch -b --kmi android13-5.10 -``` - -## GKI 安装 - -GKI 的安装方法有如下几种,各自适用于不同的场景,请按需选择: - -1. 使用 KernelSU 提供的**通用内核镜像**使用 fastboot 安装 -2. 使用内核刷写 App(如 KernelFlasher)安装 -3. 手动修补 boot.img 然后安装 -4. 使用自定义 Recovery(如 TWRP)安装 - -## 使用 KernelSU 提供的 boot.img 安装 {#install-by-kernelsu-boot-image} - -如果你设备的 `boot.img` 采用常用的压缩格式,那么可以采用 KernelSU 提供的通用内核镜像直接刷入,它不需要 TWRP 或者自行修补镜像。 - -### 找到合适的 boot.img {#found-propery-image} - -KernelSU 为 GKI 设备提供了通用的 boot.img,您应该将 boot.img 刷写到设备的 boot 分区。 - -您可以从 [GitHub Release](https://github.com/tiann/KernelSU/releases) 下载 boot.img, 请注意您应该使用正确版本的 boot.img。如果您不知道应该下载哪一个文件,请仔细阅读本文档中关于 [KMI](#kmi) 和[安全补丁级别](#security-patch-level)的描述。 - -通常情况下,同一个 KMI 和 安全补丁级别下会有三个不同格式的 boot 文件,它们除了内核压缩格式不同之外都一样。请检查您原有 boot.img 的内核压缩格式,您应该使用正确的格式,例如 `lz4`、`gz`;如果是用不正确的压缩格式,刷入 boot 后可能无法开机。 - -::: info -1. 您可以通过 magiskboot 来获取你原来 boot 的压缩格式;当然您也可以询问与您机型相同的其他更有经验的童鞋。另外,内核的压缩格式通常不会发生变化,如果您使用某个压缩格式成功开机,后续可优先尝试这个格式。 -2. 小米设备通常使用 `gz` 或者 **不压缩**。 -3. Pixel 设备有些特殊,请查看下面的教程。 -::: - -### 将 boot.img 刷入设备 {#flash-boot-image} - -使用 `adb` 连接您的设备,然后执行 `adb reboot bootloader` 进入 fastboot 模式,然后使用此命令刷入 KernelSU: - -```sh -fastboot flash boot boot.img -``` - -::: info -如果你的设备支持 `fastboot boot`,可以先使用 `fastboot boot boot.img` 来先尝试使用 boot.img 引导系统,如果出现意外,再重启一次即可开机。 -::: - -### 重启 {#reboot} - -刷入完成后,您应该重新启动您的设备: - -```sh -fastboot reboot -``` - -## 使用内核刷写 App 安装 {#install-by-kernel-flasher} - -步骤: - -1. 下载 AnyKernel3 的刷机包,如果你不知道下载哪一个,请仔细查阅上述文档中关于 [KMI](#kmi) 和[安全补丁级别](#security-patch-level)的描述;下载错误的刷机包很可能导致无法开机,请注意备份。 -2. 打开内核刷写 App(授予必要的 root 权限),使用提供的 AnyKernel3 刷机包刷入。 - -这种方法需要内核刷写 App 拥有 root 权限,你可以用如下几种方法实现: - -1. 你的设备已经获取了 root 权限,比如你已经安装好了 KernelSU 想升级到最新的版本,又或者你通过其他方法(如 Magisk)获取了 root。 -2. 如果你的手机没有 root,但手机支持 `fastboot boot boot.img` 这种临时启动的方法,你可以用 KernelSU 提供的 GKI 镜像临时启动你的设备,获取临时的 root 权限,然后使用内核刷写器刷入获取永久 root 权限。 - - -如果您以前没有使用过内核刷写 App,建议使用以下应用: - -1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases) -2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel) -3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager) - -## 手动修补 boot.img {#patch-boot-image} - -对于某些设备来说,其 boot.img 格式不那么常见,比如不是 `lz4`, `gz` 和未压缩;最典型的就是 Pixel,它 boot.img 的格式是 `lz4_legacy` 压缩,ramdisk 可能是 `gz` 也可能是 `lz4_legacy` 压缩;此时如果你直接刷入 KernelSU 提供的 boot.img,手机可能无法开机;这时候,你可以通过手动修补 boot.img 来实现。 - -任何情况下都推荐使用 `magiskboot` 来修补 boot 镜像,有两个方法: - -1. [magiskboot](https://github.com/topjohnwu/Magisk/releases) -2. [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) - -Magisk 官方提供的 `magiskboot` 只能运行在 Android/Linux 设备上,如果你想在 macOS/Windows 上使用 `magiskboot` 可以使用第二个方法。 - -::: tip -不再推荐使用 Android-Image-Kitchen,因为它可能没有合理地处理 boot 元数据(比如安全补丁级别),从而导致某些设备上会无法启动。 -::: - -### 准备 {#patch-preparation} - -1. 获取你手机的原厂 boot.img;你可以通过你手机的线刷包解压后之间获取,如果你是卡刷包,那你也许需要 [payload-dumper-go](https://github.com/ssut/payload-dumper-go) -2. 下载 KernelSU 提供的与你设备 KMI 版本一致的 AnyKernel3 刷机包;如果您不知道应该下载哪一个文件,请仔细阅读本文档中关于 [KMI](#kmi) 和[安全补丁级别](#security-patch-level)的描述。 -3. 解压缩 AnyKernel3 刷机包,获取其中的 `Image` 文件,此文件为 KernelSU 的内核文件。 - -### 在 Android 设备上使用 magiskboot {#using-magiskboot-on-Android-devices} - -1. 在 Magisk 的 [Release 页面](https://github.com/topjohnwu/Magisk/releases) 下载最新的 Magisk 安装包。 -2. 将 `Magisk-*(version).apk` 重命名为 `Magisk-*.zip` 然后解压缩。 -3. 将解压后的 `Magisk-*/lib/arm64-v8a/libmagiskboot.so` 文件,使用 adb push 到手机:`adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot` -4. 使用 adb 将原厂 boot.img 和 AnyKernel3 中的 Image 推送到手机 -5. adb shell 进入 /data/local/tmp/ 目录,然后赋予刚 push 文件的可执行权限 `chmod +x magiskboot` -6. adb shell 进入 /data/local/tmp/ 目录,执行 `./magiskboot unpack boot.img` 此时会解包 `boot.img` 得到一个叫做 `kernel` 的文件,这个文件为你原厂的 kernel -7. 使用 `Image` 替换 `kernel`: `mv -f Image kernel` -8. 执行 `./magiskboot repack boot.img` 打包 img,此时你会得到一个 `new-boot.img` 的文件,使用这个文件 fastboot 刷入设备即可。 - -### 在 macOS/Windows/Linux 上使用 magiskboot {#using-magiskboot-on-PC} - -1. 在 [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) 下载适合你操作系统的 `magiskboot` 二进制文件。 -2. 在你的 PC 上准备好设备原厂的 boot.img 和 KernelSU 的 Image。 -3. `chmod +x magiskboot` -4. 在你 PC 上合适的目录执行 `./magiskboot unpack boot.img` 来解包 `boot.img`, 你会得到一个 `kernel` 文件,这个文件是你设备原厂的 kernel。 -5. 使用 `Image` 替换 `kernel`: `mv -f Image kernel` -6. 执行 `./magiskboot repack boot.img` 打包 img,此时你会得到一个 `new-boot.img` 的文件,使用这个文件 fastboot 刷入设备即可。 - -:::info -Magisk 官方的 `magiskboot` 可以在 Linux 设备上执行,如果你是 Linux 用户,可以直接用官方版本。 -::: - -## 使用自定义 Recovery 安装 {#install-by-recovery} - -前提:你的设备必须有自定义的 Recovery,如 TWRP;如果没有或者只有官方 Recovery,请使用其他方法。 - -步骤: - -1. 在 KernelSU 的 [Release 页面](https://github.com/tiann/KernelSU/releases) 下载与你手机版本匹配的以 AnyKernel3 开头的 zip 刷机包;如果你不知道下载哪一个,请仔细查阅上述文档中关于 **KMI** 和**安全补丁级别**的描述;下载错误的刷机包很可能导致无法开机,请注意备份。 -2. 重启手机进入 TWRP。 -3. 使用 adb 将 AnyKernel3-*.zip 放到手机 /sdcard 然后在 TWRP 图形界面选择安装;或者你也可以直接 `adb sideload AnyKernel-*.zip` 安装。 - -PS. 这种方法适用于任何情况下的安装(不限于初次安装或者后续升级),只要你用 TWRP 就可以操作。 - -## 其他变通方法 {#other-methods} - -其实所有这些安装方法的主旨只有一个,那就是**替换原厂的内核为 KernelSU 提供的内核**;只要能实现这个目的,就可以安装;比如以下是其他可行的方法: - -1. 首先安装 Magisk,通过 Magisk 获取 root 权限后使用内核刷写器刷入 KernelSU 的 AnyKernel 包。 -2. 使用某些 PC 上的刷机工具箱刷入 KernelSU 提供的内核。 - -如果这些方法导致无法开机,请优先尝试用 `magiskboot` 的方法。 diff --git a/website/docs/zh_CN/guide/module-webui.md b/website/docs/zh_CN/guide/module-webui.md deleted file mode 100644 index 22290254..00000000 --- a/website/docs/zh_CN/guide/module-webui.md +++ /dev/null @@ -1,48 +0,0 @@ -# 模块 WebUI - -KernelSU 的模块除了执行启动脚本和修改系统文件之外,还支持显示 UI 界面和与用户交互。 - -你可以通过任何 Web 技术编写 HTML + CSS + JavaScript 页面,KernelSU 的管理器将通过 WebView 显示这些页面。此外,KernelSU 还提供了一些用于与系统交互的 JavaScript API,例如执行 shell 命令。 - -## WebUI 根目录 - -Web 资源文件应放置在模块根目录的 `webroot` 子目录中,并且其中**必须**有一个名为`index.html`的文件,该文件是模块页面入口。包含 Web 界面的最简单的模块结构如下: - -````txt -❯ tree . -. -|-- module.prop -`-- webroot - `--index.html -```` - -:::warning -安装模块时,KernelSU 会自动设置 `webroot` 目录的权限和 SELinux context,如果您不知道自己在做什么,请不要自行设置该目录的权限! -::: - -如果您的页面包含 CSS 和 JavaScript,您也需要将其放入此目录中。 - -## JavaScript API - -如果只是一个显示页面,那它和普通网页没有什么区别。更重要的是,KernelSU 提供了一系列的系统 API,可以让您实现模块特有的功能。 - -KernelSU 提供了一个 JavaScript 库并[在 npm 上发布](https://www.npmjs.com/package/kernelsu),您可以在网页的 JavaScript 代码中使用它。 - -例如,您可以执行 shell 命令来获取特定配置或修改属性: - -```JavaScript -import { exec } from 'kernelsu'; - -const { errno, stdout } = await exec("getprop ro.product.model"); -```` - -再比如,你可以让网页全屏显示,或者显示一个 Toast。 - -[API 文档](https://www.npmjs.com/package/kernelsu) - -如果您发现现有的 API 不能满足您的需求或者使用不方便,欢迎[在这里](https://github.com/tiann/KernelSU/issues)给我们提出建议! - -## 一些技巧 - -1. 您可以正常使用`localStorage`存储一些数据,但卸载管理器后,这些数据将会丢失。 如果需要持久保存,可以自己将数据写入某个目录。 -2. 对于简单的页面,我建议您使用 [parceljs](https://parceljs.org/) 进行打包。它零配置,使用非常方便。不过,如果你是前端高手或者有自己的喜好,那就选择你喜欢的吧! diff --git a/website/docs/zh_CN/guide/module.md b/website/docs/zh_CN/guide/module.md deleted file mode 100644 index 673088eb..00000000 --- a/website/docs/zh_CN/guide/module.md +++ /dev/null @@ -1,333 +0,0 @@ -# 模块开发指南 {#introduction} - -KernelSU 提供了一个模块机制,它可以在保持系统分区完整性的同时达到修改系统分区的效果;这种机制通常被称之为 systemless。 - -KernelSU 的模块运作机制与 Magisk 几乎是一样的,如果你熟悉 Magisk 模块的开发,那么开发 KernelSU 的模块大同小异,你可以跳过下面有关模块的介绍,只需要了解 [KernelSU 模块与 Magisk 模块的异同](difference-with-magisk.md)。 - -## 模块界面 - -KernelSU 的模块支持显示界面并与用户交互,请参阅 [WebUI 文档](module-webui.md)。 - -## Busybox - -KernelSU 提供了一个功能完备的 BusyBox 二进制文件(包括完整的 SELinux 支持)。可执行文件位于 `/data/adb/ksu/bin/busybox`。 -KernelSU 的 BusyBox 支持运行时可切换的 "ASH Standalone Shell Mode"。 -这种独立模式意味着在运行 BusyBox 的 ash shell 时,每个命令都会直接使用 BusyBox 中内置的应用程序,而不管 PATH 设置为什么。 -例如,`ls`、`rm`、`chmod` 等命令将不会使用 PATH 中设置的命令(在 Android 的情况下,默认情况下分别为 `/system/bin/ls`、`/system/bin/rm` 和 `/system/bin/chmod`),而是直接调用 BusyBox 内置的应用程序。 -这确保了脚本始终在可预测的环境中运行,并始终具有完整的命令套件,无论它运行在哪个 Android 版本上。 -要强制一个命令不使用 BusyBox,你必须使用完整路径调用可执行文件。 - -在 KernelSU 上下文中运行的每个 shell 脚本都将在 BusyBox 的 ash shell 中以独立模式运行。对于第三方开发者相关的内容,包括所有启动脚本和模块安装脚本。 - -对于想要在 KernelSU 之外使用这个“独立模式”功能的用户,有两种启用方法: - -1. 设置环境变量 `ASH_STANDALONE` 为 `1`。例如:`ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
维护者仓库地址支持设备
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
\ No newline at end of file diff --git a/website/docs/zh_CN/guide/what-is-kernelsu.md b/website/docs/zh_CN/guide/what-is-kernelsu.md deleted file mode 100644 index 28fb43d4..00000000 --- a/website/docs/zh_CN/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# 什么是 KernelSU? {#introduction} - -KernelSU 是 Android GKI 设备的 root 解决方案,它工作在内核模式,并直接在内核空间中为用户空间应用程序授予 root 权限。 - -## 功能 {#features} - -KernelSU 的主要特点是它是**基于内核的**。KernelSU 运行在内核空间,所以它可以提供我们以前从未有过的内核接口。例如,我们可以在内核模式下为任何进程添加硬件断点;我们可以在任何进程的物理内存中访问,而无人知晓;我们可以在内核空间拦截任何系统调用; 等等。 - -KernelSU 还提供了一个基于 overlayfs 的模块系统,允许您加载自定义插件到系统中。它还提供了一种修改 /system 分区中文件的机制。 - -## 如何使用 {#how-to-use} - -请参考: [安装](installation) - -## 如何构建 {#how-to-build} - -请参考: [如何构建](how-to-build) - -## 讨论 {#discussion} - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/zh_CN/index.md b/website/docs/zh_CN/index.md deleted file mode 100644 index 68955c1e..00000000 --- a/website/docs/zh_CN/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -layout: home -title: Android 上的内核级的 root 方案 - -hero: - name: KernelSU - text: Android 上的内核级的 root 方案 - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: 开始了解 - link: /zh_CN/guide/what-is-kernelsu - - theme: alt - text: 在 GitHub 中查看 - link: https://github.com/tiann/KernelSU - -features: - - title: 基于内核 - details: KernelSU 运行在内核空间,对用户空间应用有更强的掌控。 - - title: 白名单访问控制 - details: 只有被授权的 App 才可以访问 `su`,而其他 App 无法感知其存在。 - - title: 受限制的 root 权限 - details: KernelSU 可以自定义 `su` 的 uid, gid, groups, capabilities 和 SELinux 规则:把 root 权限关进笼子里。 - - title: 模块系统 & 开源 - details: KernelSU 支持通过 overlayfs 修改 /system,并且是 GPL-3 许可下的开源项目。 - diff --git a/website/docs/zh_TW/guide/app-profile.md b/website/docs/zh_TW/guide/app-profile.md deleted file mode 100644 index 8860e37b..00000000 --- a/website/docs/zh_TW/guide/app-profile.md +++ /dev/null @@ -1,119 +0,0 @@ -# App Profile {#app-profile} - -App Profile 是 KernelSU 提供的一種針對各種應用程式自訂其使用配置的機制。 - -對於授予了 root 權限(即可以使用 `su`)的應用程式來說,App Profile 也可以稱為 Root Profile,它可以自訂 `su` 的 `uid`、`gid`、`groups`、` capabilities` 以及 `SELinux context` 規則,從而限制 root 使用者的權限。 -例如可以針對防火牆應用程式僅授予網路權限,而不授予檔案存取權限,針對凍結類別應用程式僅授予 shell 權限而不是直接給 root ;透過最小化權限原則**把權力關進籠子裡**。 - -對於沒有被授予 root 權限的普通應用,App Profile 可以控制核心以及模組系統對此應用的行為;例如是否需要針對此應用程式卸載模組造成的修改等。核心和模組系統可以透過此配置決定是否要做一些類似「隱藏痕跡」類別的操作。 - -## Root Profile {#root-profile} - -### UID、GID 和 groups {#uid-gid-and-groups} - -Linux 系統中有使用者和群組兩個概念。每個使用者都有一個使用者 ID(UID),一個使用者可以屬於多個群組,每個群組也有群組 ID(GID)。此 ID 用於識別系統的使用者並確定使用者可以存取哪些系統資源。 - -UID 為 0 的使用者稱為 root 使用者,GID 為 0 的群組稱為 root 群組;root 使用者群組通常擁有系統的最高權限。 - -對於 Android 系統來說,每個應用程式都是一個單獨的使用者(不考慮 share uid 的情況),擁有一個唯一的 UID。例如 `0` 是 root 使用者,`1000` 是 `system`,`2000` 是 ADB shell,10000-19999 的是一般使用者。 - -:::info 補充 -此處的 UID 跟 Android 系統的多使用者,或者說工作資料(Work Profile),是不同概念。工作資料實際上是對 UID 進行分片實現的,例如 10000-19999 是主使用者,110000-119999 是工作資料;他們中的任何一個普通應用都擁有自己獨有的 UID。 -::: - -每一個應用程式可以有若干個群組,GID 是其主要的群組,通常與 UID 一致;其他的群組稱為補充群組(groups)。某些權限是透過群組控制的,例如網路訪問,藍牙等。 - -例如,如果我們在 ADB shell 中執行 `id` 指令,會得到以下輸出: - -```sh -oriole:/ $ id -uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_ww) (ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012(readreadtracefs:s05: -``` - -其中,UID 為`2000`,GID 也即主要組 ID 也為 `2000`;除此之外它還在許多補充組裡面,例如 `inet` 組代表可以創建 `AF_INET` 和 `AF_INET6` 的 socket(存取網路),`sdcard_rw` 代表可以讀寫 sdcard 等。 - -KernelSU 的 Root Profile 可以自訂執行 `su` 後 root 程式的 UID, GID 和 groups。例如,你可以設定某個 root 應用程式的Root Profile 其UID 為`2000`,這表示此應用程式在使用`su` 的時候,它的實際權限是ADB Shell 等級;你可以去掉groups 中的`inet` ,這樣這個`su` 就無法存取網路。 - -:::tip 注意 -App Profile 只是控制 root 應用程式使用 `su` 後的權限,它並非控制應用程式本身的權限!如果應用程式本身申請了網路存取權限,那麼它即使不使用 `su` 也可以存取網路;為 `su` 去掉 `inet` 群組只是讓 `su` 無法存取網路。 -::: - -與應用程式透過 `su` 主動切換使用者或群組不同,Root Profile 是在核心中強制實施的,不依賴 root 應用程式的自覺行為,`su` 權限的授予完全取決於使用者而非開發者。 - -### Capabilities {#capabilities} - -Capabilities 是 Linux 的一種分權機制。 - -傳統的 UNIX 系統為了執行權限檢查,將流程分為兩類:特權程式(其等效使用者 ID 為 0,稱為超級使用者或 root)和非特權程式(其等效 UID 為非零)。特權程式會繞過所有核心權限檢查,而非特權程式則根據其憑證(通常是等校 UID、等效 GID 和補充群組清單)進行完整的權限檢查。 - -從 Linux 2.2開始,Linux 將傳統上與超級使用者關聯的特權分解為獨立的單元,稱為 Capabilities(有的也翻譯為「權能」),它們可以獨立啟用和停用。 - -每一個 Capability 代表一個或一類權限。例如 `CAP_DAC_READ_SEARCH` 就代表是否有能力繞過檔案讀取權限檢查和目錄讀取和執行權限檢查。如果一個有效 UID 為 `0` 的使用者(root 使用者)沒有 `CAP_DAC_READ_SEARCH` 或更高 Capalities,這表示即使它是 root 也不能​​隨意讀取檔案。 - -KernelSU 的 Root Profile 可以自訂執行 `su` 後 root 程式的 Capabilities,從而實現只授予「部分 root 權限」。與上面介紹的UID, GID 不同,某些 root 應用就是需要 `su` 後 UID 是 `0`,此時我們可以透過限制這個 UID 為 `0` 的 root 使用者的 Capabilities,就可以限制它能夠執行的操作。 - -:::tip 強烈建議 -Linux 的 Capability [官方文件](https://man7.org/linux/man-pages/man7/capabilities.7.html)詳細解釋了每一項 Capability 所代表的能力,如果你想要自訂Capabilities,請務必先閱讀此文件。 -::: - -### SELinux {#selinux} - -SELinux 是一種強大的強制權限存取控制(MAC)機制。它按照**預設拒絕**的原則運作:任何未經明確允許的行為都會被拒絕。 - -SELinux 可依兩種全域模式運作: - -1. 寬容模式:權限拒絕事件會被記錄下來,但不會被強制執行。 -2. 強制模式:權限拒絕事件會被記錄下來**並且**強制執行。 - -:::warning 警告 -現代的 Android 系統極度依賴 SELinux 來保障整個系統的安全性,我們強烈建議您不要使用任何以「寬容模式」運作的自訂系統,因為那樣與裸奔沒什麼區別。 -::: - -SELinux 的完整概念比較複雜,我們這裡不打算講解它的具體運作方式,建議你先透過以下資料來了解其運作原理: - -1. [wikipedia](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) -2. [Redhat: what-is-selinux](https://www.redhat.com/en/topics/linux/what-is-selinux) -3. [ArchLinux: SELinux](https://wiki.archlinux.org/title/SELinux) - -KernelSU 的 Root Profile 可以自訂執行 `su` 後 root 程式的 SELinux context,並且可以針對這個 context 設定特定的存取控制規則,從而更精細地控制 root 權限。 - -通常情況下,應用程式執行 `su` 後,會將進程切換到一個**不受任何限制** 的 SELinux 域,例如`u:r:su:s0`,透過 Root Profile,我們可以將它切換到一個自訂的作用域,例如 `u:r:app1:s0`,然後為這個作用域制定一系列規則: - -```sh -type app1 -enforce app1 -typeattribute app1 mlstrustedsubject -allow app1 * * * -``` - -注意:此處的 `allow app1 * * *` 僅僅作為示範方便而使用,實際過程中不應使用這個規則,因為它跟寬容模式區別不大。 - -### 逃逸 {#escalation} - -如果 Root Profile 的配置不合理,那麼可能會發生逃逸的情況:Root Profile 的限制會意外失效。 - -例如,如果你為ADB shell 使用者設定允許root 權限(這是相當常見的情況);然後你給某個普通應用程式允許 root 權限,但是配置它的 root profile 中的 UID 為 2000(ADB shell 使用者的UID);那麼此時,這個 App 可以透過執行兩次 `su` 來獲得完整的root 權限: - -1. 第一次執行 `su`,由於 App Profile 強制生效,會正常切換到 UID 為 `2000` (adb shell) 而非 `0` (root)。 -2. 第二次執行 `su`,由於此時它 UID 是 `2000`,而你給 `2000` (adb shell) 配置了允許 root,它會獲得完整的 root 權限! - -:::warning 注意 -這是完全符合預期的行為,並非 BUG!因此我們建議: - -如果你的確需要給 adb 授予 root 權限(例如你是開發者),那麼不建議你在配置 Root Profile 的時候將 UID 改成 `2000`,用 `1000` (system) 會更好。 -::: - -## Non Root Profile {#non-root-profile} - -### 卸載模組 {#umount-modules} - -KernelSU 提供了一種無須直接修改系統分區的方式 (systemless) 來修改系統分區,這是透過掛載 overlayfs 來實現的。但有些情況下,App 可能會對這種行為比較敏感;因此,我們可以透過設定「卸載模組」來卸載掛載在這些應用程式上的模組。 - -另外,KernelSU 管理器的設定介面還提供了一個「預設卸載模組」的開關,這個開關預設是**開啟**的,這表示**如果不對應用程式做額外的設定**,預設情況下 KernelSU 或某些模組會對此應用程式執行卸載操作。當然,如果你不喜歡這個設定或這個設定會影響某些 App,你可以有以下選擇: - -1. 保持「預設卸載模組」的開關,然後針對不需要「卸載模組」的應用程式進行單獨的設置,在 App Profile 中關閉「卸載模組」;(相當於「白名單」)。 -2. 關閉「預設卸載模組」的開關,然後針對需要「卸載模組」的應用程式進行單獨的設置,在 App Profile 中開啟「卸載模組」;(相當於「黑名單」)。 - -:::info 提示 -KernelSU 在 5.10 及以上內核上,內核無須任何修改就可以卸載模組;但在 5.10 以下的設備上,這個開關僅僅是一個"設定",KernelSU 本身不會做任何動作,如果你希望在 5.10 以前的內核可以卸載模組,你需要將 `path_unmount` 函數向後移植到 `fs/namespace.c`,您可以在[如何為非 GKI 核心整合 KernelSU](how-to-integrate-for-non-gki.md#how-to-backport-path_unpount)獲取更多資訊。一些模組(如 ZygiskNext)也會透過這個設定決定是否需要卸載。 -::: \ No newline at end of file diff --git a/website/docs/zh_TW/guide/difference-with-magisk.md b/website/docs/zh_TW/guide/difference-with-magisk.md deleted file mode 100644 index fdaa5fc9..00000000 --- a/website/docs/zh_TW/guide/difference-with-magisk.md +++ /dev/null @@ -1,28 +0,0 @@ -# KernelSU 與 Magisk 的差異 {#difference-with-magisk} - -儘管 KernelSU 模組和 Magisk 模組之間有許多相似之處,但由於它們完全不同的實作機制,不可避免地存在一些差異;如果您想讓您的模組同時在 Magisk 和 KernelSU 上運作,那麼您必須瞭解這些差異。 - -## 相同之處 {#similarities} - -- 模組檔案格式:都以 Zip 的格式組織模組,並且模組的格式幾乎相同 -- 模組安裝目錄:都位於 `/data/adb/modules` -- 無系統修改:都支援透過模組以無系統修改的方式來更改 `/system` -- `post-fs-data.sh`:執行階段和語義完全相同 -- `service.sh`:執行階段和語義完全相同 -- `system.prop`:完全相同 -- `sepolicy.rule`:完全相同 -- BusyBox:指令碼在 BusyBox 中以「獨立模式」執行 - -## 不同之處 {#differences} - -在瞭解不同之處之前,您需要知道如何區分您的模組是在 KernelSU 還是 Magisk 中執行;在所有可以執行模組指令碼的位置 (`customize.sh`, `post-fs-data.sh`, `service.sh`),您都可以使用環境變數 `KSU` 來區分,在 KernelSU 中,這個環境變數將被設定為 `true`。 - -以下是一些不同之處: - -1. KernelSU 的模組無法在 Recovery 中安裝。 -2. KernelSU 的模組沒有內建的 Zygisk 支援 (但您可以透過 [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) 來使用 Zygisk 模組)。 -3. KernelSU 模組取代或刪除檔案與 Magisk 完全不同。KernelSU 不支援 `.replace` 方法,相反,您需要透過 `mknod filename c 0 0` 建立相同名稱的資料夾以刪除對應檔案。 -4. BusyBox 的目錄不同。KernelSU 內建的 BusyBox 在 `/data/adb/ksu/bin/busybox`,而 Magisk 在 `/data/adb/magisk/busybox`。**注意此為 KernelSU 內部行為,未來可能會變更!** -5. KernelSU 不支援 `.replace` 檔案;但 KernelSU 支援 `REPLACE` 和 `REMOVE` 變數以移除或取代檔案與資料夾。 -6. KernelSU 新增了 `boot-completed` 階段以在啟動完成時執行一些腳本。 -7. KernelSU 新增了 `post-mount` 階段,以便在掛載 overlayfs 後執行一些腳本。 diff --git a/website/docs/zh_TW/guide/faq.md b/website/docs/zh_TW/guide/faq.md deleted file mode 100644 index b3666a9e..00000000 --- a/website/docs/zh_TW/guide/faq.md +++ /dev/null @@ -1,80 +0,0 @@ -# 常見問題 - -## KernelSU 是否支援我的裝置? - -首先,您的裝置應該能解鎖 Bootloader。如果不能,則不支援。 - -然後在您的裝置上安裝 KernelSU 管理員並開啟它,如果它顯示 `不支援`,那麼您的裝置沒有官方支援的開箱即用的 Boot 映像;但您可以自行建置核心來源並整合 KernelSU 以繼續使用。 - -## KernelSU 是否需要解鎖 Bootloader? - -當然需要。 - -## KernelSU 是否支援模組? - -支援,但它是早期版本,可能存在問題。請等候它逐漸穩定 :) - -## KernelSU 是否支援 Xposed ? - -支援。[Dreamland](https://github.com/canyie/Dreamland) 和 [TaiChi](https://taichi.cool) 可以正常運作。LSPosed 可以在 [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) 的支援下正常運作。 - -## KernelSU 支援 Zygisk 嗎? - -KernelSU 沒有內建 Zygisk 支援,但是您可以用 [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) 來使用 Zygisk 模組。 - -## KernelSU 與 Magisk 相容嗎? - -KernelSU 的模組系統與 Magisk 的 magic mount 存在衝突,如果在 KernelSU 中啟用了任何模組,那麼整個 Magisk 將無法正常運作。 - -但是如果您只使用 KernelSU 的 `su`,那么它會和 Magisk 一同運作:KernelSU 修改 `kernel`、Magisk 修改 `ramdisk`,它們可以搭配使用。 - -## KernelSU 会取代 Magisk 嗎? - -我們不這樣認為,這也不是我們的目標。Magisk 對於使用者空間 Root 解決方案來說已經足夠優秀了,它會存在很長一段時間。KernelSU 的目標是為使用者提供核心介面,而非取代 Magisk。 - -## KernelSU 可以支援非 GKI 裝置嗎? - -可以。但是您應該下載核心來源並整合 KernelSU 至來源樹狀結構並自行編譯核心。 - -## KernelSU 支援 Android 12 以下的裝置嗎? - -影響 KernelSU 相容性的是裝置的核心版本,它與 Android 版本並無直接關係。唯一有關聯的是:**原廠** Android 12 的裝置,一定是 5.10 或更高的核心 (GKI 裝置);因此結論如下: - -1. 原廠 Android 12 的裝置必定支援 (GKI 裝置) -2. 舊版核心的裝置 (即使是 Android 12,也可能是舊版核心) 是相容的 (您需要自行建置核心) - -## KernelSU 可以支援舊版核心嗎? - -可以,目前最低支援到 4.14;更低的版本您需要手動移植它,歡迎 PR! - -## 如何為舊版核心整合 KernelSU? - -請參閱[指南](how-to-integrate-for-non-gki.md) - -## 為何我的 Android 版本為 13,但核心版本卻是 "android12-5.10"? - -核心版本與 Android 版本無關,如果您要使用 KernelSU,請一律使用**核心版本**而非 Android 版本,如果你為 "android12-5.10" 的裝置寫入 Android 13 的核心,等候您的將會是開機迴圈。 - -## 我是 GKI1.0,能用 KernelSU 嗎? - -GKI1 與 GKI2 完全不同,所以您需要自行編譯核心。 - -## KernelSU 支援 --mount-master/全域掛接命名空間嗎? - -目前沒有 (未來可能會支援),但實際上有很多種方法手動進入全域命名空間,無需 `su` 內建支援,比如: - -1. `nsenter -t 1 -m sh` 可以取得一個全域 mount namespace 的 shell. -2. 在您要執行的命令前新增 `nsenter --mount=/proc/1/ns/mnt` 即可使此命令在全域 mount namespace 下執行。KernelSU 本身也使用了 [這種方法](https://github.com/tiann/KernelSU/blob/77056a710073d7a5f7ee38f9e77c9fd0b3256576/manager/app/src/main/java/shirkneko/zako/mksu/ui/util/KsuCli.kt#L115) - -## KernelSU 可以修改 Hosts 嗎? 我要怎麼使用 AdAway? -當然。但是 KernelSU 沒有內建的 Hosts 支持,您可以安裝 [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) 來做到這一點。 - -## 為什麼會有 1TB 的龐大檔案? - -1 TB 大小的 `modules.img` 是一個磁碟映像文件,不用擔心它的大小,它是一種特殊類型的文件,稱為稀疏檔案,它的實際大小只有你使用的模組的大小,並且在你刪除模組後會動態縮小;實際上並沒有佔用1TB的磁碟空間(實際上你的手機可能並沒有那麼多空間)。 - -如果你確實對檔案的大小不滿意,可以使用 `resize2fs -M` 指令將其調整為實際大小;但此時模組可能無法正常運作,我們不會這種情況提供任何支援。 - -## 為什麼我的設備顯示錯誤的儲存空間大小? - -某些裝置使用非正規方法來計算裝置的儲存大小,可能會導致系統應用程式的儲存空間計算不準確,特別是在處理 1 TB 的稀疏檔案時。雖然這個問題似乎是三星設備特有的,僅影響三星應用程式和服務,但必須注意的是,差異主要在於總儲存大小,可用空間運算仍然準確。 \ No newline at end of file diff --git a/website/docs/zh_TW/guide/hidden-features.md b/website/docs/zh_TW/guide/hidden-features.md deleted file mode 100644 index c3a192b6..00000000 --- a/website/docs/zh_TW/guide/hidden-features.md +++ /dev/null @@ -1,7 +0,0 @@ -# 隱藏功能 {#hidden-features} - -## .ksurc - -預設狀況下,`/system/bin/sh` 會載入 `/system/etc/mkshrc`。 - -可以透過建立 `/data/adb/ksu/.ksurc` 檔案來讓 `su` 載入此檔案而非 `/system/etc/mkshrc`。 \ No newline at end of file diff --git a/website/docs/zh_TW/guide/how-to-build.md b/website/docs/zh_TW/guide/how-to-build.md deleted file mode 100644 index 89517c84..00000000 --- a/website/docs/zh_TW/guide/how-to-build.md +++ /dev/null @@ -1,71 +0,0 @@ -# 如何建置 KernelSU? {#how-to-build-kernelsu} - -首先,您需要閱讀核心建置的 Android 官方文件: - -1. [建置核心](https://source.android.com/docs/setup/build/building-kernels) -2. [標準核心映像 (GKI) 發行組建](https://source.android.com/docs/core/architecture/kernel/gki-release-builds) - -::: warning 警告 -此文件適用於 GKI 裝置,如果您是舊版核心,請參閱[如何為非 GKI 裝置整合 KernelSU](how-to-integrate-for-non-gki) -::: - -## 建置核心 {#build-kernel} - -### 同步核心原始碼 {#sync-the-kernel-source-code} - -```sh -repo init -u https://android.googlesource.com/kernel/manifest -mv .repo/manifests -repo init -m manifest.xml -repo sync -``` - -`` 是一個可以唯一確定組建的資訊清單,您可以使用這個資訊清單進行可重新預測的組建。您需要從[標準核心映像 (GKI) 發行組建](https://source.android.com/docs/core/architecture/kernel/gki-release-builds)下載資訊清單。 - -### 建置 {#build} - -請先查看[官方文件](https://source.android.com/docs/setup/build/building-kernels)。 - -例如,我們需要建置 aarch64 核心映像: - -```sh -LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -``` - -不要忘記新增 `LTO=thin`,否則,如果您的電腦記憶體小於 24GB,建置可能會失敗。 - -從 Android 13 開始,核心使用 `bazel` 建置: - -```sh -tools/bazel build --config=fast //common:kernel_aarch64_dist -``` - -:::info 你可能需要知道... -對於某些 Android 14 核心,要使 Wi-Fi/藍牙正常工作,可能需要刪除所有受 GKI 保護的匯出: - -```sh -rm common/android/abi_gki_protected_exports_* -``` -::: - -## 與 KernelSU 一起建置核心 {#build-kernel-with-kernelsu} - -如果您可以成功建置核心,那麼建置 KernelSU 就會非常輕鬆,依自己的需求在核心原始碼根目錄中執行以下任一命令: - -::: code-group - -```sh[最新 tag (穩定版本)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - -``` - -```sh[main 分支 (開發版本)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main -``` - -```sh[選取 tag (例如 v0.5.2)] -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2 -``` - -::: - -然後重新建置核心,您將會得到一個帶有 KernelSU 的核心映像! diff --git a/website/docs/zh_TW/guide/how-to-integrate-for-non-gki.md b/website/docs/zh_TW/guide/how-to-integrate-for-non-gki.md deleted file mode 100644 index a6c28485..00000000 --- a/website/docs/zh_TW/guide/how-to-integrate-for-non-gki.md +++ /dev/null @@ -1,355 +0,0 @@ -# 如何為非 GKI 核心整合 KernelSU {#how-to-integrate-kernelsu-for-non-gki-kernels} - -KernelSU 可以被整合到非 GKI 核心中,現在它最低支援到核心 4.14 版本;理論上也可以支援更低的版本。 - -由於非 GKI 核心的片段化極其嚴重,因此通常沒有統一的方法來建置它,所以我們也無法為非 GKI 裝置提供 Boot 映像。但您完全可以自行整合 KernelSU 並建置核心以繼續使用。 - -首先,您必須有能力從您裝置的核心原始碼建置出一個可以開機並且能夠正常使用的核心,如果核心並非開放原始碼,這通常難以做到。 - -如果您已經做好了上述準備,那有兩個方法來將 KernelSU 整合至您的核心之中。 - -1. 藉助 `kprobe` 自動整合 -2. 手動修改核心原始碼 - -## 使用 kprobe 整合 {#integrate-with-kprobe} - -KernelSU 使用 kprobe 機制來處理核心的相關 hook,如果 *kprobe* 可以在您建置的核心中正常運作,那麼建議使用這個方法進行整合。 - -首先,把 KernelSU 新增至您的核心來源樹狀結構,再核心的根目錄執行以下命令: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` - -:::info 公告 -[KernelSU 1.0 及更新版本不再支援非 GKI 核心](https://github.com/tiann/KernelSU/issues/1705)。最後一個支援的版本為 `v0.9.5`,請確保使用的版本正確。 -::: - -然後,您需要檢查您的核心是否啟用 *kprobe*,如果未啟用,則需要新增以下設定: - -``` -CONFIG_KPROBES=y -CONFIG_HAVE_KPROBES=y -CONFIG_KPROBE_EVENTS=y -``` - -最後,重新建置您的核心即可。 - -如果您發現 KPROBES 仍未生效,很有可能是因為它依賴的 `CONFIG_MODULES` 並未被啟用,如果還是未生效請輸入 `make menuconfig` 搜尋 KPROBES 的其他相依性並啟用。 - -如果您在整合 KernelSU 之後手機無法啟動,那麼很可能您的核心中 **kprobe 無法正常運作**,您需要修正這個錯誤,或者使用第二種方法。 - -:::tip 如何檢查 kprobe 是否損毀? - -將 `KernelSU/kernel/ksu.c` 中的 `ksu_enable_sucompat()` 和 `ksu_enable_ksud()` 註解掉,如果正常開機,即 kprobe 已損毀;或者您可以手動嘗試使用 kprobe 功能,如果不正常,手機會直接重新啟動。 -::: - -:::info 如何為非 GKI 核心啟用卸載模組功能 - -如果你的內核版本小於 5.10,你應該將 `path_umount` 向後移植至 `fs/namespace.c`。卸載模組功能依賴於這個函數。如果你沒有向後移植 `path_umount`,卸載模組功能將無法工作。你可以在[這裡查看更多關於 `path_unmount` 的資料](#how-to-backport-path_unpount)。 -::: - -## 手動修改核心原始碼 {#manually-modify-the-kernel-source} - -如果 kprobe 無法正常運作 (在4.8之前可能是上游或核心的錯誤),那您可以嘗試這種方法: - -首先,將 KernelSU 新增至您的原始碼樹狀結構,在核心的根目錄執行以下命令: - -```sh -curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5 -``` -請記住,在某些裝置上,您的 `defconfig` 可能位於 `arch/arm64/configs` 中,或在其他情況下位於 `arch/arm64/configs/vendor/你的defconfig` 中。無論您使用哪個 `defconfig`,請確保使用 `CONFIG_KSU=y` 啟用KernelSU,或使用 `n` 停用它。例如,如果您選擇啟用它,則 `defconfig` 應包含以下字串: -```conf -# KernelSU -CONFIG_KSU=y -``` - -然後,手動修改核心原始碼,您可以參閱下方的 patch: - -::: code-group - -```diff[exec.c] -diff --git a/fs/exec.c b/fs/exec.c -index ac59664eaecf..bdd585e1d2cc 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -1890,11 +1890,14 @@ static int __do_execve_file(int fd, struct filename *filename, - return retval; - } - -+extern bool ksu_execveat_hook __read_mostly; -+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, -+ void *envp, int *flags); -+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, -+ void *argv, void *envp, int *flags); - static int do_execveat_common(int fd, struct filename *filename, - struct user_arg_ptr argv, - struct user_arg_ptr envp, - int flags) - { -+ if (unlikely(ksu_execveat_hook)) -+ ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags); -+ else -+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags); - return __do_execve_file(fd, filename, argv, envp, flags, NULL); - } -``` -```diff[open.c] -diff --git a/fs/open.c b/fs/open.c -index 05036d819197..965b84d486b8 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -348,6 +348,8 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return ksys_fallocate(fd, mode, offset, len); - } - -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -355,6 +357,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - */ - long do_faccessat(int dfd, const char __user *filename, int mode) - { - const struct cred *old_cred; - struct cred *override_cred; - struct path path; - struct inode *inode; - struct vfsmount *mnt; - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; - -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); - - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` -```diff[read_write.c] -diff --git a/fs/read_write.c b/fs/read_write.c -index 650fc7e0f3a6..55be193913b6 100644 ---- a/fs/read_write.c -+++ b/fs/read_write.c -@@ -434,10 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) - } - EXPORT_SYMBOL(kernel_read); - -+extern bool ksu_vfs_read_hook __read_mostly; -+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr, -+ size_t *count_ptr, loff_t **pos); - ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) - { - ssize_t ret; - -+ if (unlikely(ksu_vfs_read_hook)) -+ ksu_handle_vfs_read(&file, &buf, &count, &pos); -+ - if (!(file->f_mode & FMODE_READ)) - return -EBADF; - if (!(file->f_mode & FMODE_CAN_READ)) -``` -```diff[stat.c] -diff --git a/fs/stat.c b/fs/stat.c -index 376543199b5a..82adcef03ecc 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat, - } - EXPORT_SYMBOL(vfs_statx_fd); - -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+ - /** - * vfs_statx - Get basic and extra attributes by filename - * @dfd: A file descriptor representing the base dir for a relative filename -@@ -170,6 +172,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, - int error = -EINVAL; - unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT; - -+ ksu_handle_stat(&dfd, &filename, &flags); - if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0) - return -EINVAL; -``` - -::: - -主要修改四個項目: - -1. do_faccessat,通常位於 `fs/open.c` -2. do_execveat_common,通常位於 `fs/exec.c` -3. vfs_read,通常位於 `fs/read_write.c` -4. vfs_statx,通常位於 `fs/stat.c` - -如果您的核心沒有 `vfs_statx`,使用 `vfs_fstatat` 將其取代: - -```diff -diff --git a/fs/stat.c b/fs/stat.c -index 068fdbcc9e26..5348b7bb9db2 100644 ---- a/fs/stat.c -+++ b/fs/stat.c -@@ -87,6 +87,8 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) - } - EXPORT_SYMBOL(vfs_fstat); - -+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags); -+ - int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int flag) - { -@@ -94,6 +96,8 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, - int error = -EINVAL; - unsigned int lookup_flags = 0; - -+ ksu_handle_stat(&dfd, &filename, &flag); -+ - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | - AT_EMPTY_PATH)) != 0) - goto out; -``` - -對於早於 4.17 的核心,如果沒有 `do_faccessat`,可以直接找到 `faccessat` 系統呼叫的定義並進行修改: - -```diff -diff --git a/fs/open.c b/fs/open.c -index 2ff887661237..e758d7db7663 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -355,6 +355,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) - return error; - } - -+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, -+ int *flags); -+ - /* - * access() needs to use the real uid/gid, not the effective uid/gid. - * We do this by temporarily clearing all FS-related capabilities and -@@ -370,6 +373,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) - int res; - unsigned int lookup_flags = LOOKUP_FOLLOW; - -+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL); -+ - if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ - return -EINVAL; -``` - -### 安全模式 {#safe-mode} - -若要啟用 KernelSU 內建的安全模式,您還需要修改 `drivers/input/input.c` 中的 `input_handle_event` 方法: - -:::tip 小建議 -強烈建議啟用此功能,如果遇到開機迴圈,這將會非常有用! -::: - -```diff -diff --git a/drivers/input/input.c b/drivers/input/input.c -index 45306f9ef247..815091ebfca4 100755 ---- a/drivers/input/input.c -+++ b/drivers/input/input.c -@@ -367,10 +367,13 @@ static int input_get_disposition(struct input_dev *dev, - return disposition; - } - -+extern bool ksu_input_hook __read_mostly; -+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value); -+ - static void input_handle_event(struct input_dev *dev, - unsigned int type, unsigned int code, int value) - { - int disposition = input_get_disposition(dev, type, code, &value); -+ -+ if (unlikely(ksu_input_hook)) -+ ksu_handle_input_handle_event(&type, &code, &value); - - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) - add_input_randomness(type, code, value); -``` - -:::info 不小心進入安全模式? -如果您使用手動整合且不停用 `CONFIG_KPROBES`,那麼您將可能會在啟動後透過按下音量來減少按鈕來觸發安全模式!因此,如果使用手動集成,您需要停用 `CONFIG_KPROBES` ! -::: - -### 無法在終端中執行 `pm` ? {#failed-to-execute-pm-in-terminal} - -你應該修改 `fs/devpts/inode.c`,參考: - -```diff -diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c -index 32f6f1c68..d69d8eca2 100644 ---- a/fs/devpts/inode.c -+++ b/fs/devpts/inode.c -@@ -602,6 +602,8 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - return dentry; - } - -+#ifdef CONFIG_KSU -+extern int ksu_handle_devpts(struct inode*); -+#endif -+ - /** - * devpts_get_priv -- get private data for a slave - * @pts_inode: inode of the slave -@@ -610,6 +612,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) - */ - void *devpts_get_priv(struct dentry *dentry) - { -+ #ifdef CONFIG_KSU -+ ksu_handle_devpts(dentry->d_inode); -+ #endif - if (dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC) - return NULL; - return dentry->d_fsdata; -``` - -### 如何向後移植 path_umount {#how-to-backport-path_unpount} - -你可以透過向後移植 `path_umount` 來讓卸載模組功能在低於 5.10 的非 GKI 核心上運作。你可以參考這個修改: - -```diff ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -1739,6 +1739,39 @@ static inline bool may_mandlock(void) - } - #endif - -+static int can_umount(const struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ -+ if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) -+ return -EINVAL; -+ if (!may_mount()) -+ return -EPERM; -+ if (path->dentry != path->mnt->mnt_root) -+ return -EINVAL; -+ if (!check_mnt(mnt)) -+ return -EINVAL; -+ if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */ -+ return -EINVAL; -+ if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ return 0; -+} -+ -+int path_umount(struct path *path, int flags) -+{ -+ struct mount *mnt = real_mount(path->mnt); -+ int ret; -+ -+ ret = can_umount(path, flags); -+ if (!ret) -+ ret = do_umount(mnt, flags); -+ -+ /* we mustn't call path_put() as that would clear mnt_expiry_mark */ -+ dput(path->dentry); -+ mntput_no_expire(mnt); -+ return ret; -+} - /* - * Now umount can handle mount points as well as block devices. - * This is important for filesystems which use unnamed block devices. -``` - -最後,再次建置您的核心,KernelSU 將會如期運作。 diff --git a/website/docs/zh_TW/guide/installation.md b/website/docs/zh_TW/guide/installation.md deleted file mode 100644 index 1d2e7a3d..00000000 --- a/website/docs/zh_TW/guide/installation.md +++ /dev/null @@ -1,265 +0,0 @@ -# 安裝 {#title} - -## 檢查您的裝置是否受支援 {#check-if-your-device-is-supported} - -從 [GitHub Releases](https://github.com/tiann/KernelSU/releases) 下載 KernelSU 管理器,然後安裝至裝置並開啟: - -- 如果顯示「不支援」,則表示您的裝置不支援 KernelSU,您需要自行編譯核心才能繼續使用,KernelSU 官方也永遠不會提供一個您可以寫入的 Boot 映像。 -- 如果顯示「未安裝」,那麼 KernelSU 支援您的裝置。 - -::: info 提示 -對於顯示「不支援」的裝置,這裡有一個[非官方支援裝置清單](unofficially-support-devices.md),您可以使用這個清單裡的核心自行編譯。 -::: - -## 備份您的原廠 boot.img {#backup-stock-boot-img} - -在寫入核心映像前,您必須預先備份您的原廠 boot.img。如果您在後續寫入中出現了任何問題,您都可以透過使用 Fastboot 寫回原廠 Boot 以還原系統。 - -::: warning 警告 -寫入核心映像可能會造成資料遺失,請確保做好這一步再繼續進行下一步作業!!必要時您還可以備份您手機的所有資料。 -::: - -## 必要知識 {#necessary-knowledge} - -### ADB 和 Fastboot {#adb-and-fastboot} - -預設狀況下,您將會使用 ADB 和 Fastboot 工具,如果您不知道它們,建議使用搜尋引擎先瞭解相關內容。 - -### KMI - -KMI 全稱 Kernel Module Interface,相同 KMI 的核心版本是**相容的**,這也是 GKI 中「標準」的涵義所在。反之,如果 KMI 不同,那麼這些核心之間無法彼此相容,寫入與您裝置 KMI 不同的核心映像可能會導致無法開機。 - -具體來講,對於 GKI 的裝置,其核心版本格式應該如下: - -```txt -KernelRelease := -Version.PatchLevel.SubLevel-AndroidRelease-KmiGeneration-suffix -w .x .y -zzz -k -something -``` - -其中,`w.x-zzz-k` 為 KMI 版本。例如,一部裝置核心版本為 `5.10.101-android12-9-g30979850fc20`,那麼它的 KMI 為 `5.10-android12-9`,理論上寫入其他這個 KMI 的核心也能正常開機。 - -::: tip 補充 -請注意,核心版本中的 SubLevel 並非 KMI 的一部分!也就是說 `5.10.101-android12-9-g30979850fc20` 與 `5.10.137-android12-9-g30979850fc20` 的 KMI 相同! -::: - -### 安全性修補程式等級 {#security-patch-level} - -較新的 Android 裝置可能具有防回滾機制,不允許寫入具有較舊安全性修補程式等級的啟動映像。例如,如果您的裝置核心為 `5.10.101-android12-9-g30979850fc20`,則其安全修補程式等級為 `2023-11`;即使寫入了 KMI 對應的核心,如果安全修補程式等級早於 `2023-11`(例如 `2023-06`),也可能會導致無法開機。 - -因此,最好使用具有最新安全性修補程式等級的核心來維護與 KMI 的對應關係。 - -### 核心版本與 Android 版本 {#kernel-version-vs-android-version} - -請注意:**核心版本與 Android 版本並不一定相同!** - -如果您發現您的核心版本是 `android12-5.10.101`,然而您 Android 系統的版本為 Android 13 或更高,請不要覺得奇怪,因為 Android 系統的版本與 Linux 核心的版本號碼並非一致。Linux 核心的版本號碼一般與**裝置出廠時隨附的 Android 系統的版本一致**,如果後續 Android 系統更新,核心版本一般不會發生變化。如果您需要寫入,**請以核心版本為準!!** - -## 安裝簡介 {#introduction} - -自 `0.9.0` 版本以後,在 GKI 裝置上,KernelSU 支援兩種運作模式: - -1. `GKI`:使用**通用核心鏡像**(GKI)取代掉裝置原有的核心。 -2. `LKM`:使用**可載入核心模組**(LKM)的方式載入到裝置核心中,不會替換掉裝置原有的核心。 - -這兩種方式適用於不同的場景,你可以根據自己的需求選擇。 - -### GKI 模式 {#gki-mode} - -GKI 模式會替換掉裝置原有的核心,使用 KernelSU 提供的通用核心鏡像。 GKI 模式的優點是: - -1. 通用型高,適用於大多數裝置;例如開啟了 KNOX 的三星裝置、或是 LKM 模式無法運作的裝置。還有一些冷門的魔改裝置,也只能使用 GKI 模式。 -2. 不依賴官方韌體即可使用;不需要等待官方韌體更新,只要 KMI 一致,就可以使用。 - -### LKM 模式 {#lkm-mode} - -LKM 模式不會替換掉裝置原有的核心,而是使用可載入核心模組的方式載入到裝置核心中。 LKM 模式的優點是: - -1. 不會取代裝置原有的核心:如果你對裝置原有的核心有特殊需求,或是你希望在使用第三方核心的同時使用 KernelSU,可以使用 LKM 模式。 -2. 升級和 OTA 較為方便:升級 KernelSU 時,可以直接在管理器內部安裝,無需再手動寫入;系統 OTA 後,可以直接安裝到第二個槽位,也無需再手動寫入。 -3. 適用於一些特殊場景:例如使用臨時 root 權限也可以載入 LKM,由於不需要替換 boot 分區,因此不會觸發 avb,不會使裝置意外變磚。 -4. LKM 可以被暫時卸載:如果你暫時想取消 root,可以卸載 LKM,這個過程不需要寫入分區,甚至也不用重啟裝置。如果你想重新取得 root,只需要重啟裝置即可。 - -:::tip 兩種模式共存 -打開管理器後,你可以在首頁看到裝置目前運行的模式。注意 GKI 模式的優先級高於 LKM ,如你既使用 GKI 核心替換掉了原有的核心,又使用 LKM 的方式修補了 GKI 核心,那麼 LKM 會被忽略,裝置將永遠以 GKI 的模式運作。 -::: - -### 選哪個? {#which-one} - -如果你的裝置是手機,我們建議您優先考慮 LKM 模式。 -如果你的裝置是模擬器、WSA 或 Waydroid 等,我們建議您優先考慮 GKI 模式。 - -## LKM 安裝 {#lkm-installation} - -### 取得官方韌體 {#get-the-official-firmware} - -使用 LKM 的模式,需要取得官方韌體,然後在官方韌體的基礎上修補;如果你使用的是第三方核心,可以把第三方核心的 boot.img 作為官方韌體。 - -取得官方韌體的方法有很多,如果你的裝置支援 `fastboot boot`,那麼我們最推薦以及最簡單的方法是使用 `fastboot boot` 臨時啟動 KernelSU 提供的 GKI 核心,並參考[使用管理器](#use-the-manager)安裝。 - -如果你的裝置不支援 `fastboot boot`,那麼你可能需要手動去下載官方韌體包,然後從中提取 boot。 - -與 GKI 模式不同,LKM 模式會修改 `ramdisk`,因此在出廠 Android 13 的裝置上,通常它需要修補的是 `init_boot` 分區而非 `boot` 分區;而 GKI 模式則永遠是修改 `boot` 分區。 - -### 使用管理器 {#use-the-manager} - -開啟管理器,點選右上角的安裝圖標,會出現若干個選項: - -1. 選擇並修補一個文件:如果你手機目前沒有 root 權限,你可以選擇這個選項,然後選擇你的官方韌體,管理器會自動修補它。你只需要寫入這個修補後的文件,即可永久取得 root 權限。 -2. 直接安裝:如果你手機已經 root,你可以選擇這個選項,管理器會自動獲取你的裝置資訊,然後自動修補官方韌體,然後寫入。你可以考慮使用 `fastboot boot` KernelSU 的 GKI 核心來取得臨時 root 安裝管理器,然後再使用這個選項。**這種方式也是 KernelSU 升級最主要的方式**。 -3. 安裝到另一個分割區:如果你的裝置支援 A/B 分區,你可以選擇這個選項,管理器會自動修補官方韌體,然後安裝到另一個分區。這種方式適用於 OTA 後的裝置,你可以在 OTA 後直接安裝到另一個分割區,然後重新啟動裝置即可。 - -### 使用命令列{#use-the-command-line} - -如果你不想使用管理器,你也可以使用命令列來安裝 LKM。KernelSU 提供的 `ksud` 可以幫助你快速修補官方韌體,然後寫入。 - -這個工具支援 macOS、Linux 和 Windows,你可以在 [GitHub Release](https://github.com/tiann/KernelSU/releases) 下載對應的版本。 - -使用方法:`ksud boot-patch`。 你可以查看命令列的提示了解具體的使用方法。 - -```sh -husky:/ # ksud boot-patch -h -Patch boot or init_boot images to apply KernelSU - -Usage: ksud boot-patch [OPTIONS] - -Options: - -b, --boot boot image path, if not specified, will try to find the boot image automatically - -k, --kernel kernel image path to replace - -m, --module LKM module path to replace, if not specified, will use the builtin one - -i, --init init to be replaced - -u, --ota will use another slot when boot image is not specified - -f, --flash Flash it to boot partition after patch - -o, --out output path, if not specified, will use current directory - --magiskboot magiskboot path, if not specified, will use builtin one - --kmi KMI version, if specified, will use the specified KMI - -h, --help Print help -``` -需要說明的幾個選項: -1. `--magiskboot` 選項可以指定 magiskboot 的路徑,如果不指定,ksud 會在環境變數中尋找。如果你不知道如何取得 magiskboot,可以參考[這裡](#patch-boot-image)。 -2. `--kmi` 選項可以指定 `KMI` 版本,如果你的裝置核心名字沒有遵循 KMI 規範,你可以透過這個選項來指定。 - -最常見的使用方法為: -```sh -ksud boot-patch -b --kmi android13-5.10 -``` -## GKI 安裝{#gki-mode-installation} -GKI 的安裝方式有以下幾種,各自適用於不同的場景,請依需求選擇: - -1. 使用 KernelSU 提供的 boot.img 透過 Fastboot 安裝 -2. 使用核心寫入程式 (例如 KernelFlasher) 安裝 -3. 使用自訂 Recovery (例如 TWRP) 安裝 -4. 手動修補 boot.img 並安裝 - -## 使用 KernelSU 提供的 boot.img 安裝 {#install-with-boot-img-provided-by-kernelsu} - -如果你的裝置的 `boot.img` 使用常見的壓縮格式,你可以直接寫入 KernelSU 提供的 GKI 核心映像,這種方法無需 TWRP,也無需您的手機有 Root 權限;適用於您初次安裝 KernelSU。 - -### 找到合適的 boot.img {#find-proper-boot-img} - -KernelSU 為 GKI 裝置提供了標準 boot.img,您需要將 boot.img 寫入至裝置的 Boot 分區。 - -您可以從 [GitHub Release](https://github.com/tiann/KernelSU/releases) 下載 boot.img,請注意,您應該使用正確版本的 boot.img。如果你不知道你該下載哪個檔案,請詳細閱讀文檔中的 [KMI](#kmi) 與[安全性修補程式等級](#security-patch-level)。 - -通常,在相同的 KMI 和安全性修補程式等級下,會存在三種不同格式的啟動檔案。除了核心壓縮格式之外,它們都是相同的。請檢查您原來的 boot.img 的核心壓縮格式。您應該使用正確的格式,例如 `lz4` 、 `gz`,如果你使用了不正確的壓縮格式,你可能會在寫入後無法開機。 - -::: info 關於 boot.img 的壓縮格式 -1. 您可以透過 magiskboot 以取得您的原始 Boot 的壓縮格式。當然,您也可以詢問與您相同型號的其他更有經驗的使用者。另外,核心的壓縮格式通常不會出現變更,如果您使用的某個壓縮格式成功開機,後續可以優先嘗試這個格式。 -2. 小米裝置通常 `gz` 或者 **不壓縮**。 -3. Pixel 裝置有些特殊,請遵循下方的指示。 -::: - -### 將 boot.img 寫入至裝置 {#flash-boot-img-to-device} - -使用 `adb` 連接您的裝置,然後執行 `adb reboot bootloader` 進入 fastboot 模式,然後使用此命令寫入 KernelSU: - -```sh -fastboot flash boot boot.img -``` - -::: info 提示 -如果您的裝置支援 `fastboot boot`,可以先使用 `fastboot boot boot.img` 來嘗試使用 boot.img 開機進入系統,如果出現意外,重新啟動即可開機。 -::: - -### 重新開機 {#reboot} - -寫入完成後,您應該重新啟動您的裝置: - -```sh -fastboot reboot -``` - -## 使用核心寫入程式安裝 {#install-with-kernel-flasher} - -先決條件:您的裝置必須已經 Root。例如您已經安裝了 Magisk 並取得 Root 存取權,或者您已經安裝了舊版本的 KernelSU 需升級到其他版本的 KernelSU;如果您的裝置並未 Root,請嘗試其他方法。 - -步驟: - -1. 下載 AnyKernel3 的 Zip 檔。如果你不知道你該下載哪個檔案,請詳細閱讀文檔中的 [KMI](#kmi) 與[安全性修補程式等級](#security-patch-level)。 -2. 開啟核心寫入程式提供的 AnyKernel3 Zip 檔案並寫入核心。 - -如果您先前並未使用過核心寫入應用程式,可以嘗試下面幾個: - -1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases) -2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel) -3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager) - -P.S. 這種方法在更新 KernelSU 時比較方便,無需電腦即可完成 (注意備份!)。 - -## 手動修補 boot.img {#patch-boot-image} - -對於某些裝置來說,其 boot.img 格式並不是很常見,不屬於 `lz4`,`gz` 和未壓縮;最典型的就是 Pixel,它的 boot.img 格式是 `lz4_legacy` 壓縮,ramdisk 可能是 `gz` 也可能是 `lz4_legacy` 壓縮;此時如果您直接寫入 KernelSU 提供的 boot.img,手機可能無法開機。這時,您可以透過手動修補 boot.img 來完成。 - -永遠建議使用 `magiskboot` 來修補映像,一般有兩種修補方法: - -1. [magiskboot](https://github.com/topjohnwu/Magisk/releases) -2. [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) - -其中,官方的 `magiskboot` 僅能在 Android 上使用,若您想在電腦上完成,可以嘗試第二個選項。 - -### 準備 {#preparation} - -1. 取得您手機的原廠 boot.img,您可以從您的裝置製造商取得,您也可能需要 [payload-dumper-go](https://github.com/ssut/payload-dumper-go)。 -2. 下載 KernelSU 提供的與您的裝置 KMI 一致的 AnyKernel3 Zip 檔 (可參閱[使用自訂 Recovery 安裝](#install-with-custom-recovery))。 -3. 解壓縮 AnyKernel3 Zip 檔,取得其中的 `Image` 檔,此檔案為具有 KernelSU 的核心。 - -### 在 Android 上使用 magiskboot {#using-magiskboot-on-Android-devices} - -1. 在 Magisk 的 [Release 頁面](https://github.com/topjohnwu/Magisk/releases) 下載最新的 Magisk。 -2. 將 `Magisk-*(version).apk` 重新命名為 `Magisk-*.zip` 並解壓縮。 -3. 使用 Adb 將 magiskboot 推入至手機:`adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot`。 -4. 使用 Adb 將原廠 boot.img 和 AnyKernel3 中的 Image 推入至手機。 -5. adb shell 進入 /data/local/tmp/ 目錄,然後賦予先前推入的檔案可執行權限 `chmod +x magiskboot`。 -6. adb shell 進入 /data/local/tmp/ 目錄,執行 `./magiskboot unpack boot.img` 此時會將 `boot.img` 解除封裝,得到一個名為 `kernel` 的檔案,這個檔案是您的原廠核心。 -7. 使用 `Image` 取代 `kernel`: `mv -f Image kernel` -8. 執行 `./magiskboot repack boot.img` 重新封裝映像,此時您會得到一個 `new-boot.img` 檔案,透過 Fastboot 將這個檔案寫入至裝置即可。 - -### 在 Windows/macOS/Linux PC 上使用 magiskboot {#using-magiskboot-on-PC} - -1. 在 [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci) 下載對應的 magiskboot。 -2. (僅linux)賦予檔案可執行權限 `chmod +x magiskboot`。 -3. 執行 `./magiskboot unpack boot.img` 此時會將 `boot.img` 解除封裝,得到一個名為 `kernel` 的檔案,這個檔案是您的原廠核心。 -4. 使用 `Image` 取代 `kernel`: `mv -f Image kernel` -5. 執行 `./magiskboot repack boot.img` 重新封裝映像,此時您會得到一個 `new-boot.img` 檔案,透過 Fastboot 將這個檔案寫入至裝置即可。 - -## 使用自訂 Recovery 安裝 {#install-with-custom-recovery} - -先決條件:您的裝置必須有自訂的 Recovery,例如 TWRP。如果沒有或者只有官方 Recovery,請使用其他方法。 - -步驟: - -1. 在 KernelSU 的 [Release 頁面](https://github.com/tiann/KernelSU/releases) 下載與您手機版本相符的以 AnyKernel3 開頭的 Zip 檔;例如,手機核心版本為 `android12-5.10.66`,那麼您應該下載 `AnyKernel3-android12-5.10.66_yyyy-MM.zip` 這個檔案 (其中 `yyyy` 為年份,`MM` 為月份)。 -2. 重新開機手機至 TWRP。 -3. 使用 Adb 將 AnyKernel3-*.zip 放置到手機 `/sdcard` 然後在 TWRP 圖形使用者介面選擇並安裝;或者您也可以直接 `adb sideload AnyKernel-*.zip` 安裝。 - -PS. 這種方法適用於任何狀況下的安裝 (不限於初次安裝或後續更新),只要您用 TWRP 就可以進行作業。 - -## GKI的其他替代方法 {#other-methods} - -其實所有這些安裝方法的主旨只有一個,那就是**將原廠核心取代為 KernelSU 提供的核心**。只要能實現這個目的,就可以安裝,比如以下是其他可行的方法: - -1. 首先安裝 Magisk,透過 Magisk 取得 Root 權限後使用核心寫入程式寫入 KernelSU 的 AnyKernel Zip。 -2. 使用某些 PC 上的寫入工具組寫入 KernelSU 提供的核心。 - -但是,如果不起作用,請嘗試 Magiskboot 方法。 - diff --git a/website/docs/zh_TW/guide/module-webui.md b/website/docs/zh_TW/guide/module-webui.md deleted file mode 100644 index 671faad7..00000000 --- a/website/docs/zh_TW/guide/module-webui.md +++ /dev/null @@ -1,50 +0,0 @@ -# 模組 WebUI {#module-webui} - -KernelSU 的模組除了執行啟動腳本和修改系統檔案之外,還支援顯示 UI 介面和與使用者互動。 - -該模組可以透過任何 Web 技術編寫 HTML + CSS + JavaScript 頁面。 KernelSU的管理器將透過 WebView 顯示這些頁面。它還提供了一些用於與系統互動的 JavaScript API,例如執行 shell 命令。 - -## WebUI 根目錄 {#webroot-directory} - -Web資源應放置在模組根目錄的 `webroot` 子目錄中,並且其中**必須**有一個名為 `index.html` 的文件,該檔案是模組頁面入口。 - -包含Web介面的最簡單的模組結構如下: - -```txt -❯ tree . -. -|-- module.prop -`-- webroot - `-- index.html -``` - -:::warning 提醒 -安裝模組時,KernelSU 將自動設定`webroot`的權限和 SELinux context。如果您不知道自己在做什麼,請不要自行設定該目錄的權限! -::: - -如果您的頁面包含 CSS 和 JavaScript,您也需要將其放入此目錄中。 - -## JavaScript API - -如果只是一個顯示頁面,那和一般網頁沒有什麼不同。更重要的是,KernelSU 提供了一系列的系統 API,讓您可以實現模組獨特的功能。 - -KernelSU [在 npm 上發布](https://www.npmjs.com/package/kernelsu)了一個 JavaScript 庫,您可以在網頁的 JavaScript 程式碼中使用它。 - -例如,您可以執行 shell 命令來取得特定配置或修改屬性: - -```JavaScript -import { exec } from 'kernelsu'; - -const { errno, stdout } = exec("getprop ro.product.model"); -``` - -再例如,你可以讓網頁全螢幕顯示,或是顯示一個 Toast。 - -[API 文檔](https://www.npmjs.com/package/kernelsu) - -如果您發現現有的 API 無法滿足您的需求或使用不方便,歡迎您在[這裡](https://github.com/tiann/KernelSU/issues)給我們建議! - -## 一些技巧 {#some-tips} - -1. 您可以正常使用 `localStorage` 來儲存一些數據,但解除安裝管理器後,這些數據將會遺失。如果需要持久保存,可以自行將資料寫入某個目錄。 -2. 對於簡單的頁面,我建議您使用 [parceljs](https://parceljs.org/) 進行打包。它無須設定,使用非常方便。不過,如果你是前端高手或有自己的喜好,那就選擇你喜歡的吧! diff --git a/website/docs/zh_TW/guide/module.md b/website/docs/zh_TW/guide/module.md deleted file mode 100644 index dac0fec6..00000000 --- a/website/docs/zh_TW/guide/module.md +++ /dev/null @@ -1,331 +0,0 @@ -# 模組指南 {#module-guide} - -KernelSU 提供了一個模組機制,它可以在保持系統分割區完整性的同時達到修改系統分割區的效果;這種機制一般被稱為 systemless (無系統修改)。 - -KernelSU 的模組運作機制與 Magisk 幾乎相同,如果您熟悉 Magisk 模組的開發,那麼開發 KernelSU 的模組大同小異,您可以跳過下列有關模組的介紹,只需要瞭解 [KernelSU 模組與 Magisk 模組的差異](difference-with-magisk.md)。 - -## WebUI - -KernelSU 的模組支援顯示互動介面,請參閱 [WebUI 文檔](module-webui.md). - -## Busybox - -KernelSU 提供了一個完備的 BusyBox 二進位檔案 (包括完整的 SELinux 支援)。可執行檔位於 `/data/adb/ksu/bin/busybox`。 -KernelSU 的 BusyBox 支援執行時可切換的 "ASH 獨立模式"。 -ASH 獨立模式在執行 BusyBox 時,每個命令都會直接使用 BusyBox 中內建的應用程式,而不論 `PATH` 的設定為何。 -例如,`ls`、`rm`、`chmod` 等命令將不會使用 `PATH` 中設定的命令 (在 Android 的狀況下,預設狀況下分別為 `/system/bin/ls`、`/system/bin/rm` 和 `/system/bin/chmod`),而是直接呼叫 BusyBox 內建的應用程式。 -這確保了腳本始終在可預測的環境中執行,並始終具有完整的命令套件,不論它執行在哪個 Android 版本上。 -要強制下一個命令不使用 BusyBox,您必須使用完整路徑呼叫可執行檔。 - -每個基於 KernelSU 上下文的腳本都將在 BusyBox 的獨立模式執行。對於第三方開發人員而言,這包括所有開機腳本和模組安裝腳本。 - -對於想要在 KernelSU 之外使用這個「獨立模式」功能的使用者,有兩種啟用方法: - -1. 將環境變數 `ASH_STANDALONE` 設為 `1`。例如:`ASH_STANDALONE=1 /data/adb/ksu/bin/busybox sh - - - - - - - - - - - - - - - - -
維護者存放庫支援裝置
{{ repo.maintainer }}{{ repo.kernel_name }}{{ repo.devices }}
\ No newline at end of file diff --git a/website/docs/zh_TW/guide/what-is-kernelsu.md b/website/docs/zh_TW/guide/what-is-kernelsu.md deleted file mode 100644 index 0735b853..00000000 --- a/website/docs/zh_TW/guide/what-is-kernelsu.md +++ /dev/null @@ -1,21 +0,0 @@ -# 什麼是 KernelSU? {#what-is-kernelsu} - -KernelSU 是 Android GKI 裝置的 Root 解決方案,它以核心模式運作,並直接在核心空間中為使用者空間應用程式授予 Root 權限。 - -## 功能 {#features} - -KernelSU 的主要功能是它是**基於核心的**。 KernelSU 在核心空間中執行,所以它可以向我們提供從未有過的核心介面。例如,我們可以在核心模式中為任何處理程序新增硬體中斷點;我們可以在任何處理程序的實體記憶體中存取,而無人知曉;我們可以在核心空間攔截任何系統呼叫;等等。 - -KernelSU 還提供了一個以 overlayfs 為基礎的模組系統,允許您將自訂模組載入到系統中。它還提供了一種修改 `/system` 分區中檔案的機制。 - -## 如何使用 {#how-to-use} - -請參閱:[安裝](installation) - -## 如何建置 {#how-to-build} - -请參閱:[如何建置](how-to-build) - -## 討論 {#discussion} - -- Telegram: [@KernelSU](https://t.me/KernelSU) diff --git a/website/docs/zh_TW/index.md b/website/docs/zh_TW/index.md deleted file mode 100644 index d03e83c1..00000000 --- a/website/docs/zh_TW/index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -layout: home -title: 基於核心的 Android Root 解決方案 - -hero: - name: KernelSU - text: 基於核心的 Android root 解決方案 - tagline: "" - image: - src: /logo.png - alt: KernelSU - actions: - - theme: brand - text: 開始瞭解 - link: /zh_TW/guide/what-is-kernelsu - - theme: alt - text: 在 GitHub 中檢視 - link: https://github.com/tiann/KernelSU - -features: - - title: 以核心為基礎 - details: KernelSU 以 Linux 核心模式運作,對使用者空間有更強的掌控。 - - title: 白名單存取控制 - details: 僅有被授予 Root 權限的應用程式才可存取 su,而其他應用程式完全無法知悉。 - - title: 可定制的 Root 權限 - details: KernelSU 能夠對 su 的使用者ID(uid)、群組ID(gid)、群組、權限,以及 SELinux 規則進行客製化管理,以此加強 root 權限的安全性。 - - title: 模組支援 - details: KernelSU 支援透過 overlayfs 修改 /system,它甚至可以使 /system 可寫入。 - diff --git a/website/package.json b/website/package.json deleted file mode 100644 index df6330ef..00000000 --- a/website/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "KernelSU_website", - "version": "1.0.0", - "description": "KernelSU official website: https://kernelsu.org", - "main": "index.js", - "repository": "https://kernelsu.org", - "author": "weishu", - "license": "MIT", - "devDependencies": { - "vitepress": "^1.6.3", - "vue": "^3.5.13" - }, - "scripts": { - "docs:dev": "vitepress dev docs", - "docs:build": "vitepress build docs", - "docs:preview": "vitepress preview docs" - }, - "type": "module" -} \ No newline at end of file diff --git a/website/yarn.lock b/website/yarn.lock deleted file mode 100644 index 384a4013..00000000 --- a/website/yarn.lock +++ /dev/null @@ -1,1166 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@algolia/autocomplete-core@1.17.7": - version "1.17.7" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.17.7.tgz#2c410baa94a47c5c5f56ed712bb4a00ebe24088b" - integrity sha512-BjiPOW6ks90UKl7TwMv7oNQMnzU+t/wk9mgIDi6b1tXpUek7MW0lbNOUHpvam9pe3lVCf4xPFT+lK7s+e+fs7Q== - dependencies: - "@algolia/autocomplete-plugin-algolia-insights" "1.17.7" - "@algolia/autocomplete-shared" "1.17.7" - -"@algolia/autocomplete-plugin-algolia-insights@1.17.7": - version "1.17.7" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.7.tgz#7d2b105f84e7dd8f0370aa4c4ab3b704e6760d82" - integrity sha512-Jca5Ude6yUOuyzjnz57og7Et3aXjbwCSDf/8onLHSQgw1qW3ALl9mrMWaXb5FmPVkV3EtkD2F/+NkT6VHyPu9A== - dependencies: - "@algolia/autocomplete-shared" "1.17.7" - -"@algolia/autocomplete-preset-algolia@1.17.7": - version "1.17.7" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.7.tgz#c9badc0d73d62db5bf565d839d94ec0034680ae9" - integrity sha512-ggOQ950+nwbWROq2MOCIL71RE0DdQZsceqrg32UqnhDz8FlO9rL8ONHNsI2R1MH0tkgVIDKI/D0sMiUchsFdWA== - dependencies: - "@algolia/autocomplete-shared" "1.17.7" - -"@algolia/autocomplete-shared@1.17.7": - version "1.17.7" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.7.tgz#105e84ad9d1a31d3fb86ba20dc890eefe1a313a0" - integrity sha512-o/1Vurr42U/qskRSuhBH+VKxMvkkUVTLU6WZQr+L5lGZZLYWyhdzWjW0iGXY7EkwRTjBqvN2EsR81yCTGV/kmg== - -"@algolia/client-abtesting@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/client-abtesting/-/client-abtesting-5.20.2.tgz#e0d950735cbe4e00960418749839820a333f9df0" - integrity sha512-IS8JSFsDD33haaKIIFaL7qj3bEIG9GldZfb3ILW0QF3at7TcrIJYy58hrDvFee5T3p3E2aH/+wqIr0eha8jB/w== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/client-analytics@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-5.20.2.tgz#b8bc4ff50c3968e58b11a56ce50e8732c056ca19" - integrity sha512-k0KxCfcX/HZySqPasKy6GkiiDuebaMh2v/nE0HHg1PbsyeyagLapDi6Ktjkxhz8NlUq6eTJR+ddGJegippKQtQ== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/client-common@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-5.20.2.tgz#4a80baedbe739ae84fde300a1f539508e5ae38a7" - integrity sha512-xoZcL/Uu49KYDb3feu2n06gALD17p5CslO8Zk3mZ7+uTurK3lgjLws7LNetZ172Ap/GpzPCRXI83d2iDoYQD6Q== - -"@algolia/client-insights@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/client-insights/-/client-insights-5.20.2.tgz#cf1c21e2c40c3751276c27048c72a3b164b0a4f2" - integrity sha512-fy7aCbo9y7WHt/9G03EYc471Dd5kIaM8PNP4z6AEQYr9a9X8c4inwNs6tePxAEfRHwVQi0CZ7kuVdn6/MjWx1A== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/client-personalization@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-5.20.2.tgz#ab8342c1e5f1a4ae71383dffdb25910c5df9d06e" - integrity sha512-ocL1ZXulfuXzJAwsKw2kMscKMD0rs/f4CFYu6Gjh4mK4um6rGfa1a6u1MSc4swFqRQer0wNP9Pi+kVfKhuKt5A== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/client-query-suggestions@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/client-query-suggestions/-/client-query-suggestions-5.20.2.tgz#fc2d5836aaf90fba60fc347e0f1b1e8e4ab15592" - integrity sha512-Xjs4Tj1zkLCnmq1ys8RRhLQPy002I6GuT/nbHVdSQmQu4yKCI0gOFbwxHdM6yYPEuE3cJx7A4wSQjCH21mUKsg== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/client-search@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-5.20.2.tgz#941788be5c238197d30a21237e0b3f28d80db874" - integrity sha512-2cD3RGB5byusLS0DAX1Nvl5MLiv7OoGgQrRs+94dTalqjvK8lGKzxxJhXoVojgx2qcROyIUAIDXFdTqv6NIHaA== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/ingestion@1.20.2": - version "1.20.2" - resolved "https://registry.yarnpkg.com/@algolia/ingestion/-/ingestion-1.20.2.tgz#f506af644979974a6842fb75ac90df8782da4b0d" - integrity sha512-S593Kmhc98+5zdzGet4GrZEBEBGl4vVtqg/MPfW8dCRf9qDRNYSkhBsIzlhQe9JWiohe9oB9LW5meibwOgRmww== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/monitoring@1.20.2": - version "1.20.2" - resolved "https://registry.yarnpkg.com/@algolia/monitoring/-/monitoring-1.20.2.tgz#920ce38c5d2250bc34692bc256b622e72c3f8169" - integrity sha512-bW41aWLYgBv/coJUIT85mkN3kk1VBKsM8tlwB5S/s446Mgc7r8t5TX7kA8kCR2UbwDedOK51i/85/x/rM0ZXbg== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/recommend@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/recommend/-/recommend-5.20.2.tgz#423ebaddf13de43a8eb28b0642b60e85f3393e34" - integrity sha512-wBMf3J1L5ogvU8p8ifHkknDXWn1zdZ2epkqpt2MkUaZynE3G77rrFU9frcO+Pu1FQJQ5xCDTKcYUUcJCDD00rg== - dependencies: - "@algolia/client-common" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -"@algolia/requester-browser-xhr@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.20.2.tgz#ec674ae20e9fecde1c1a73c5cb0fcfacd3803bac" - integrity sha512-w+VMzOkIq2XDGg6Ybzr74RlBZvJQnuIdKpVusQSXCXknvxwAwbO457LmoavhZWl06Lcsk9YDx1X2k0zb+iJQmw== - dependencies: - "@algolia/client-common" "5.20.2" - -"@algolia/requester-fetch@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/requester-fetch/-/requester-fetch-5.20.2.tgz#13d59d9c946d9cd3de319865d70db64e255028e4" - integrity sha512-wpjnbvbi3A13b0DvijE45DRYDvwcP5Ttz7RTMkPWTkF1s6AHuo6O2UcwGyaogMAGa1QOOzFYfp5u4YQwMOQx5g== - dependencies: - "@algolia/client-common" "5.20.2" - -"@algolia/requester-node-http@5.20.2": - version "5.20.2" - resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-5.20.2.tgz#29bd7333dbec0d24dfecd2e1d8276fe40e67ea9d" - integrity sha512-YuSSdtgUt1dFBTNYUb+2TA5j0Hd0eDXE0bVISjUvTCqmoaGsGLwW+rKI7p1eLQ1r7RESwBAvUwcY1qP2Wl3Lyw== - dependencies: - "@algolia/client-common" "5.20.2" - -"@babel/helper-string-parser@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" - integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== - -"@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== - -"@babel/parser@^7.25.3": - version "7.26.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.26.8.tgz#deca2b4d99e5e1b1553843b99823f118da6107c2" - integrity sha512-TZIQ25pkSoaKEYYaHbbxkfL36GNsQ6iFiBbeuzAkLnXayKR1yP1zFe+NxuZWWsUyvt8icPU9CCq0sgWGXR1GEw== - dependencies: - "@babel/types" "^7.26.8" - -"@babel/types@^7.26.8": - version "7.26.8" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.26.8.tgz#97dcdc190fab45be7f3dc073e3c11160d677c127" - integrity sha512-eUuWapzEGWFEpHFxgEaBG8e3n6S8L3MSu0oda755rOfabWPnh0Our1AozNFVUxGFIhbKgd1ksprsoDGMinTOTA== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - -"@docsearch/css@3.8.2": - version "3.8.2" - resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.8.2.tgz#7973ceb6892c30f154ba254cd05c562257a44977" - integrity sha512-y05ayQFyUmCXze79+56v/4HpycYF3uFqB78pLPrSV5ZKAlDuIAAJNhaRi8tTdRNXh05yxX/TyNnzD6LwSM89vQ== - -"@docsearch/js@3.8.2": - version "3.8.2" - resolved "https://registry.yarnpkg.com/@docsearch/js/-/js-3.8.2.tgz#bdcfc9837700eb38453b88e211ab5cc5a3813cc6" - integrity sha512-Q5wY66qHn0SwA7Taa0aDbHiJvaFJLOJyHmooQ7y8hlwwQLQ/5WwCcoX0g7ii04Qi2DJlHsd0XXzJ8Ypw9+9YmQ== - dependencies: - "@docsearch/react" "3.8.2" - preact "^10.0.0" - -"@docsearch/react@3.8.2": - version "3.8.2" - resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-3.8.2.tgz#7b11d39b61c976c0aa9fbde66e6b73b30f3acd42" - integrity sha512-xCRrJQlTt8N9GU0DG4ptwHRkfnSnD/YpdeaXe02iKfqs97TkZJv60yE+1eq/tjPcVnTW8dP5qLP7itifFVV5eg== - dependencies: - "@algolia/autocomplete-core" "1.17.7" - "@algolia/autocomplete-preset-algolia" "1.17.7" - "@docsearch/css" "3.8.2" - algoliasearch "^5.14.2" - -"@esbuild/aix-ppc64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" - integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== - -"@esbuild/android-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" - integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== - -"@esbuild/android-arm@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" - integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== - -"@esbuild/android-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" - integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== - -"@esbuild/darwin-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" - integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== - -"@esbuild/darwin-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" - integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== - -"@esbuild/freebsd-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" - integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== - -"@esbuild/freebsd-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" - integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== - -"@esbuild/linux-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" - integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== - -"@esbuild/linux-arm@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" - integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== - -"@esbuild/linux-ia32@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" - integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== - -"@esbuild/linux-loong64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" - integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== - -"@esbuild/linux-mips64el@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" - integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== - -"@esbuild/linux-ppc64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" - integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== - -"@esbuild/linux-riscv64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" - integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== - -"@esbuild/linux-s390x@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" - integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== - -"@esbuild/linux-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" - integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== - -"@esbuild/netbsd-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" - integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== - -"@esbuild/openbsd-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" - integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== - -"@esbuild/sunos-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" - integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== - -"@esbuild/win32-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" - integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== - -"@esbuild/win32-ia32@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" - integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== - -"@esbuild/win32-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" - integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== - -"@iconify-json/simple-icons@^1.2.21": - version "1.2.24" - resolved "https://registry.yarnpkg.com/@iconify-json/simple-icons/-/simple-icons-1.2.24.tgz#1cc703e731f979f76b0586236b402372169062d5" - integrity sha512-06ZWXZx3PHCE+02zn+iIGOKKNgE3kyPd0Yh7IUEIa0bCYI6UmGlsYYghRx8As9TnTNYMCEiy5V0zI4Jb6EY6XA== - dependencies: - "@iconify/types" "*" - -"@iconify/types@*": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@iconify/types/-/types-2.0.0.tgz#ab0e9ea681d6c8a1214f30cd741fe3a20cc57f57" - integrity sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg== - -"@jridgewell/sourcemap-codec@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" - integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== - -"@rollup/rollup-android-arm-eabi@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.6.tgz#9b726b4dcafb9332991e9ca49d54bafc71d9d87f" - integrity sha512-+GcCXtOQoWuC7hhX1P00LqjjIiS/iOouHXhMdiDSnq/1DGTox4SpUvO52Xm+div6+106r+TcvOeo/cxvyEyTgg== - -"@rollup/rollup-android-arm64@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.6.tgz#88326ff46168a47851077ca0bf0c442689ec088f" - integrity sha512-E8+2qCIjciYUnCa1AiVF1BkRgqIGW9KzJeesQqVfyRITGQN+dFuoivO0hnro1DjT74wXLRZ7QF8MIbz+luGaJA== - -"@rollup/rollup-darwin-arm64@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.6.tgz#b8fbcc9389bc6fad3334a1d16dbeaaa5637c5772" - integrity sha512-z9Ib+OzqN3DZEjX7PDQMHEhtF+t6Mi2z/ueChQPLS/qUMKY7Ybn5A2ggFoKRNRh1q1T03YTQfBTQCJZiepESAg== - -"@rollup/rollup-darwin-x64@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.6.tgz#1aa2bcad84c0fb5902e945d88822e17a4f661d51" - integrity sha512-PShKVY4u0FDAR7jskyFIYVyHEPCPnIQY8s5OcXkdU8mz3Y7eXDJPdyM/ZWjkYdR2m0izD9HHWA8sGcXn+Qrsyg== - -"@rollup/rollup-freebsd-arm64@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.6.tgz#29c54617e0929264dcb6416597d6d7481696e49f" - integrity sha512-YSwyOqlDAdKqs0iKuqvRHLN4SrD2TiswfoLfvYXseKbL47ht1grQpq46MSiQAx6rQEN8o8URtpXARCpqabqxGQ== - -"@rollup/rollup-freebsd-x64@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.6.tgz#a8b58ab7d31882559d93f2d1b5863d9e4b4b2678" - integrity sha512-HEP4CgPAY1RxXwwL5sPFv6BBM3tVeLnshF03HMhJYCNc6kvSqBgTMmsEjb72RkZBAWIqiPUyF1JpEBv5XT9wKQ== - -"@rollup/rollup-linux-arm-gnueabihf@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.6.tgz#a844e1978c8b9766b169ecb1cb5cc0d8a3f05930" - integrity sha512-88fSzjC5xeH9S2Vg3rPgXJULkHcLYMkh8faix8DX4h4TIAL65ekwuQMA/g2CXq8W+NJC43V6fUpYZNjaX3+IIg== - -"@rollup/rollup-linux-arm-musleabihf@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.6.tgz#6b44c3b7257985d71b087fcb4ef01325e2fff201" - integrity sha512-wM4ztnutBqYFyvNeR7Av+reWI/enK9tDOTKNF+6Kk2Q96k9bwhDDOlnCUNRPvromlVXo04riSliMBs/Z7RteEg== - -"@rollup/rollup-linux-arm64-gnu@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.6.tgz#ebb499cf1720115256d0c9ae7598c90cc2251bc5" - integrity sha512-9RyprECbRa9zEjXLtvvshhw4CMrRa3K+0wcp3KME0zmBe1ILmvcVHnypZ/aIDXpRyfhSYSuN4EPdCCj5Du8FIA== - -"@rollup/rollup-linux-arm64-musl@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.6.tgz#9658221b59d9e5643348f9a52fa5ef35b4dc07b1" - integrity sha512-qTmklhCTyaJSB05S+iSovfo++EwnIEZxHkzv5dep4qoszUMX5Ca4WM4zAVUMbfdviLgCSQOu5oU8YoGk1s6M9Q== - -"@rollup/rollup-linux-loongarch64-gnu@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.6.tgz#19418cc57579a5655af2d850a89d74b3f7e9aa92" - integrity sha512-4Qmkaps9yqmpjY5pvpkfOerYgKNUGzQpFxV6rnS7c/JfYbDSU0y6WpbbredB5cCpLFGJEqYX40WUmxMkwhWCjw== - -"@rollup/rollup-linux-powerpc64le-gnu@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.6.tgz#fe0bce7778cb6ce86898c781f3f11369d1a4952c" - integrity sha512-Zsrtux3PuaxuBTX/zHdLaFmcofWGzaWW1scwLU3ZbW/X+hSsFbz9wDIp6XvnT7pzYRl9MezWqEqKy7ssmDEnuQ== - -"@rollup/rollup-linux-riscv64-gnu@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.6.tgz#9c158360abf6e6f7794285642ba0898c580291f6" - integrity sha512-aK+Zp+CRM55iPrlyKiU3/zyhgzWBxLVrw2mwiQSYJRobCURb781+XstzvA8Gkjg/hbdQFuDw44aUOxVQFycrAg== - -"@rollup/rollup-linux-s390x-gnu@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.6.tgz#f9113498d22962baacdda008b5587d568b05aa34" - integrity sha512-WoKLVrY9ogmaYPXwTH326+ErlCIgMmsoRSx6bO+l68YgJnlOXhygDYSZe/qbUJCSiCiZAQ+tKm88NcWuUXqOzw== - -"@rollup/rollup-linux-x64-gnu@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.6.tgz#aec8d4cdf911cd869a72b8bd00833cb426664e0c" - integrity sha512-Sht4aFvmA4ToHd2vFzwMFaQCiYm2lDFho5rPcvPBT5pCdC+GwHG6CMch4GQfmWTQ1SwRKS0dhDYb54khSrjDWw== - -"@rollup/rollup-linux-x64-musl@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.6.tgz#61c0a146bdd1b5e0dcda33690dd909b321d8f20f" - integrity sha512-zmmpOQh8vXc2QITsnCiODCDGXFC8LMi64+/oPpPx5qz3pqv0s6x46ps4xoycfUiVZps5PFn1gksZzo4RGTKT+A== - -"@rollup/rollup-win32-arm64-msvc@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.6.tgz#c6c5bf290a3a459c18871110bc2e7009ce35b15a" - integrity sha512-3/q1qUsO/tLqGBaD4uXsB6coVGB3usxw3qyeVb59aArCgedSF66MPdgRStUd7vbZOsko/CgVaY5fo2vkvPLWiA== - -"@rollup/rollup-win32-ia32-msvc@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.6.tgz#16ca6bdadc9e054818b9c51f8dac82f6b8afab81" - integrity sha512-oLHxuyywc6efdKVTxvc0135zPrRdtYVjtVD5GUm55I3ODxhU/PwkQFD97z16Xzxa1Fz0AEe4W/2hzRtd+IfpOA== - -"@rollup/rollup-win32-x64-msvc@4.34.6": - version "4.34.6" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.6.tgz#f3d03ce2d82723eb089188ea1494a719b09e1561" - integrity sha512-0PVwmgzZ8+TZ9oGBmdZoQVXflbvuwzN/HRclujpl4N/q3i+y0lqLw8n1bXA8ru3sApDjlmONaNAuYr38y1Kr9w== - -"@shikijs/core@2.3.2", "@shikijs/core@^2.1.0": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@shikijs/core/-/core-2.3.2.tgz#dcdc851e6963fe4196e2f1051302dcecce1a8706" - integrity sha512-s7vyL3LzUKm3Qwf36zRWlavX9BQMZTIq9B1almM63M5xBuSldnsTHCmsXzoF/Kyw4k7Xgas7yAyJz9VR/vcP1A== - dependencies: - "@shikijs/engine-javascript" "2.3.2" - "@shikijs/engine-oniguruma" "2.3.2" - "@shikijs/types" "2.3.2" - "@shikijs/vscode-textmate" "^10.0.1" - "@types/hast" "^3.0.4" - hast-util-to-html "^9.0.4" - -"@shikijs/engine-javascript@2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@shikijs/engine-javascript/-/engine-javascript-2.3.2.tgz#9be457bb1ce4c8650b3b46b0f5054d4afef48a6d" - integrity sha512-w3IEMu5HfL/OaJTsMbIfZ1HRPnWVYRANeDtmsdIIEgUOcLjzFJFQwlnkckGjKHekEzNqlMLbgB/twnfZ/EEAGg== - dependencies: - "@shikijs/types" "2.3.2" - "@shikijs/vscode-textmate" "^10.0.1" - oniguruma-to-es "^3.1.0" - -"@shikijs/engine-oniguruma@2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@shikijs/engine-oniguruma/-/engine-oniguruma-2.3.2.tgz#42e64b7bbbaec5e903b12718dde1f1e1738a9c66" - integrity sha512-vikMY1TroyZXUHIXbMnvY/mjtOxMn+tavcfAeQPgWS9FHcgFSUoEtywF5B5sOLb9NXb8P2vb7odkh3nj15/00A== - dependencies: - "@shikijs/types" "2.3.2" - "@shikijs/vscode-textmate" "^10.0.1" - -"@shikijs/langs@2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@shikijs/langs/-/langs-2.3.2.tgz#a716ac528dea9e927d7088102a132c153f8a161b" - integrity sha512-UqI6bSxFzhexIJficZLKeB1L2Sc3xoNiAV0yHpfbg5meck93du+EKQtsGbBv66Ki53XZPhnR/kYkOr85elIuFw== - dependencies: - "@shikijs/types" "2.3.2" - -"@shikijs/themes@2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@shikijs/themes/-/themes-2.3.2.tgz#c117d826ce22899dea802499a7ad5a99c2de0446" - integrity sha512-QAh7D/hhfYKHibkG2tti8vxNt3ekAH5EqkXJeJbTh7FGvTCWEI7BHqNCtMdjFvZ0vav5nvUgdvA7/HI7pfsB4w== - dependencies: - "@shikijs/types" "2.3.2" - -"@shikijs/transformers@^2.1.0": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@shikijs/transformers/-/transformers-2.3.2.tgz#a62183c40cb004851312428d8681962ed487b37e" - integrity sha512-2HDnJumw8A/9GecRpTgvfqSbPjEbJ4DPWq5J++OVP1gNMLvbV0MqFsP4canqRNM1LqB7VmWY45Stipb0ZIJ+0A== - dependencies: - "@shikijs/core" "2.3.2" - "@shikijs/types" "2.3.2" - -"@shikijs/types@2.3.2", "@shikijs/types@^2.1.0": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@shikijs/types/-/types-2.3.2.tgz#d273d19a7b0c23445e07c0370f127a66400d1eb8" - integrity sha512-CBaMY+a3pepyC4SETi7+bSzO0f6hxEQJUUuS4uD7zppzjmrN4ZRtBqxaT+wOan26CR9eeJ5iBhc4qvWEwn7Eeg== - dependencies: - "@shikijs/vscode-textmate" "^10.0.1" - "@types/hast" "^3.0.4" - -"@shikijs/vscode-textmate@^10.0.1": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz#d06d45b67ac5e9b0088e3f67ebd3f25c6c3d711a" - integrity sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg== - -"@types/estree@1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" - integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== - -"@types/hast@^3.0.0", "@types/hast@^3.0.4": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa" - integrity sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ== - dependencies: - "@types/unist" "*" - -"@types/linkify-it@^5": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-5.0.0.tgz#21413001973106cda1c3a9b91eedd4ccd5469d76" - integrity sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q== - -"@types/markdown-it@^14.1.2": - version "14.1.2" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-14.1.2.tgz#57f2532a0800067d9b934f3521429a2e8bfb4c61" - integrity sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog== - dependencies: - "@types/linkify-it" "^5" - "@types/mdurl" "^2" - -"@types/mdast@^4.0.0": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6" - integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA== - dependencies: - "@types/unist" "*" - -"@types/mdurl@^2": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd" - integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg== - -"@types/unist@*", "@types/unist@^3.0.0": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c" - integrity sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q== - -"@types/web-bluetooth@^0.0.20": - version "0.0.20" - resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz#f066abfcd1cbe66267cdbbf0de010d8a41b41597" - integrity sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow== - -"@ungap/structured-clone@^1.0.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8" - integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g== - -"@vitejs/plugin-vue@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz#d1491f678ee3af899f7ae57d9c21dc52a65c7133" - integrity sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ== - -"@vue/compiler-core@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz#b0ae6c4347f60c03e849a05d34e5bf747c9bda05" - integrity sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q== - dependencies: - "@babel/parser" "^7.25.3" - "@vue/shared" "3.5.13" - entities "^4.5.0" - estree-walker "^2.0.2" - source-map-js "^1.2.0" - -"@vue/compiler-dom@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz#bb1b8758dbc542b3658dda973b98a1c9311a8a58" - integrity sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA== - dependencies: - "@vue/compiler-core" "3.5.13" - "@vue/shared" "3.5.13" - -"@vue/compiler-sfc@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz#461f8bd343b5c06fac4189c4fef8af32dea82b46" - integrity sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ== - dependencies: - "@babel/parser" "^7.25.3" - "@vue/compiler-core" "3.5.13" - "@vue/compiler-dom" "3.5.13" - "@vue/compiler-ssr" "3.5.13" - "@vue/shared" "3.5.13" - estree-walker "^2.0.2" - magic-string "^0.30.11" - postcss "^8.4.48" - source-map-js "^1.2.0" - -"@vue/compiler-ssr@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz#e771adcca6d3d000f91a4277c972a996d07f43ba" - integrity sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA== - dependencies: - "@vue/compiler-dom" "3.5.13" - "@vue/shared" "3.5.13" - -"@vue/devtools-api@^7.7.0": - version "7.7.1" - resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-7.7.1.tgz#6a44bf03ce27ba0230461171812d9ae98aeb2458" - integrity sha512-Cexc8GimowoDkJ6eNelOPdYIzsu2mgNyp0scOQ3tiaYSb9iok6LOESSsJvHaI+ib3joRfqRJNLkHFjhNuWA5dg== - dependencies: - "@vue/devtools-kit" "^7.7.1" - -"@vue/devtools-kit@^7.7.1": - version "7.7.1" - resolved "https://registry.yarnpkg.com/@vue/devtools-kit/-/devtools-kit-7.7.1.tgz#9b4cdef7111ffd8673c14e9a16a433c65ebb8a8e" - integrity sha512-yhZ4NPnK/tmxGtLNQxmll90jIIXdb2jAhPF76anvn5M/UkZCiLJy28bYgPIACKZ7FCosyKoaope89/RsFJll1w== - dependencies: - "@vue/devtools-shared" "^7.7.1" - birpc "^0.2.19" - hookable "^5.5.3" - mitt "^3.0.1" - perfect-debounce "^1.0.0" - speakingurl "^14.0.1" - superjson "^2.2.1" - -"@vue/devtools-shared@^7.7.1": - version "7.7.1" - resolved "https://registry.yarnpkg.com/@vue/devtools-shared/-/devtools-shared-7.7.1.tgz#3a92d7cc268c15fa639797c45b0aff79eae9b8d7" - integrity sha512-BtgF7kHq4BHG23Lezc/3W2UhK2ga7a8ohAIAGJMBr4BkxUFzhqntQtCiuL1ijo2ztWnmusymkirgqUrXoQKumA== - dependencies: - rfdc "^1.4.1" - -"@vue/reactivity@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.5.13.tgz#b41ff2bb865e093899a22219f5b25f97b6fe155f" - integrity sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg== - dependencies: - "@vue/shared" "3.5.13" - -"@vue/runtime-core@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz#1fafa4bf0b97af0ebdd9dbfe98cd630da363a455" - integrity sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw== - dependencies: - "@vue/reactivity" "3.5.13" - "@vue/shared" "3.5.13" - -"@vue/runtime-dom@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz#610fc795de9246300e8ae8865930d534e1246215" - integrity sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog== - dependencies: - "@vue/reactivity" "3.5.13" - "@vue/runtime-core" "3.5.13" - "@vue/shared" "3.5.13" - csstype "^3.1.3" - -"@vue/server-renderer@3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz#429ead62ee51de789646c22efe908e489aad46f7" - integrity sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA== - dependencies: - "@vue/compiler-ssr" "3.5.13" - "@vue/shared" "3.5.13" - -"@vue/shared@3.5.13", "@vue/shared@^3.5.13": - version "3.5.13" - resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.13.tgz#87b309a6379c22b926e696893237826f64339b6f" - integrity sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ== - -"@vueuse/core@12.5.0", "@vueuse/core@^12.4.0": - version "12.5.0" - resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-12.5.0.tgz#1321c75132c4f20f223e6313587ebeeec79957f2" - integrity sha512-GVyH1iYqNANwcahAx8JBm6awaNgvR/SwZ1fjr10b8l1HIgDp82ngNbfzJUgOgWEoxjL+URAggnlilAEXwCOZtg== - dependencies: - "@types/web-bluetooth" "^0.0.20" - "@vueuse/metadata" "12.5.0" - "@vueuse/shared" "12.5.0" - vue "^3.5.13" - -"@vueuse/integrations@^12.4.0": - version "12.5.0" - resolved "https://registry.yarnpkg.com/@vueuse/integrations/-/integrations-12.5.0.tgz#6496ea24772d087c8fec3973a471a6ab50f9e7c0" - integrity sha512-HYLt8M6mjUfcoUOzyBcX2RjpfapIwHPBmQJtTmXOQW845Y/Osu9VuTJ5kPvnmWJ6IUa05WpblfOwZ+P0G4iZsQ== - dependencies: - "@vueuse/core" "12.5.0" - "@vueuse/shared" "12.5.0" - vue "^3.5.13" - -"@vueuse/metadata@12.5.0": - version "12.5.0" - resolved "https://registry.yarnpkg.com/@vueuse/metadata/-/metadata-12.5.0.tgz#8f1778a2894bdda2bf458054377a379d40276306" - integrity sha512-Ui7Lo2a7AxrMAXRF+fAp9QsXuwTeeZ8fIB9wsLHqzq9MQk+2gMYE2IGJW48VMJ8ecvCB3z3GsGLKLbSasQ5Qlg== - -"@vueuse/shared@12.5.0": - version "12.5.0" - resolved "https://registry.yarnpkg.com/@vueuse/shared/-/shared-12.5.0.tgz#b93af7ab0fd6a8d879808c9bf37d540dac01da13" - integrity sha512-vMpcL1lStUU6O+kdj6YdHDixh0odjPAUM15uJ9f7MY781jcYkIwFA4iv2EfoIPO6vBmvutI1HxxAwmf0cx5ISQ== - dependencies: - vue "^3.5.13" - -algoliasearch@^5.14.2: - version "5.20.2" - resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-5.20.2.tgz#e1df37b02a4cf0f7031ff729ee9b35a7b43eeea6" - integrity sha512-8evxG++iWyWnhng3g5RP+kwn6j+2vKLfew8pVoekn87FcfsDm92zJXKwSrU6pl+m5eAbGFhFF/gCYEQiRdbPlA== - dependencies: - "@algolia/client-abtesting" "5.20.2" - "@algolia/client-analytics" "5.20.2" - "@algolia/client-common" "5.20.2" - "@algolia/client-insights" "5.20.2" - "@algolia/client-personalization" "5.20.2" - "@algolia/client-query-suggestions" "5.20.2" - "@algolia/client-search" "5.20.2" - "@algolia/ingestion" "1.20.2" - "@algolia/monitoring" "1.20.2" - "@algolia/recommend" "5.20.2" - "@algolia/requester-browser-xhr" "5.20.2" - "@algolia/requester-fetch" "5.20.2" - "@algolia/requester-node-http" "5.20.2" - -birpc@^0.2.19: - version "0.2.19" - resolved "https://registry.yarnpkg.com/birpc/-/birpc-0.2.19.tgz#cdd183a4a70ba103127d49765b4a71349da5a0ca" - integrity sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ== - -ccount@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" - integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== - -character-entities-html4@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" - integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== - -character-entities-legacy@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" - integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== - -comma-separated-tokens@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" - integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== - -copy-anything@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/copy-anything/-/copy-anything-3.0.5.tgz#2d92dce8c498f790fa7ad16b01a1ae5a45b020a0" - integrity sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w== - dependencies: - is-what "^4.1.8" - -csstype@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" - integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== - -dequal@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" - integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== - -devlop@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" - integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== - dependencies: - dequal "^2.0.0" - -emoji-regex-xs@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex-xs/-/emoji-regex-xs-1.0.0.tgz#e8af22e5d9dbd7f7f22d280af3d19d2aab5b0724" - integrity sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg== - -entities@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" - integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== - -esbuild@^0.21.3: - version "0.21.5" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" - integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== - optionalDependencies: - "@esbuild/aix-ppc64" "0.21.5" - "@esbuild/android-arm" "0.21.5" - "@esbuild/android-arm64" "0.21.5" - "@esbuild/android-x64" "0.21.5" - "@esbuild/darwin-arm64" "0.21.5" - "@esbuild/darwin-x64" "0.21.5" - "@esbuild/freebsd-arm64" "0.21.5" - "@esbuild/freebsd-x64" "0.21.5" - "@esbuild/linux-arm" "0.21.5" - "@esbuild/linux-arm64" "0.21.5" - "@esbuild/linux-ia32" "0.21.5" - "@esbuild/linux-loong64" "0.21.5" - "@esbuild/linux-mips64el" "0.21.5" - "@esbuild/linux-ppc64" "0.21.5" - "@esbuild/linux-riscv64" "0.21.5" - "@esbuild/linux-s390x" "0.21.5" - "@esbuild/linux-x64" "0.21.5" - "@esbuild/netbsd-x64" "0.21.5" - "@esbuild/openbsd-x64" "0.21.5" - "@esbuild/sunos-x64" "0.21.5" - "@esbuild/win32-arm64" "0.21.5" - "@esbuild/win32-ia32" "0.21.5" - "@esbuild/win32-x64" "0.21.5" - -estree-walker@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - -focus-trap@^7.6.4: - version "7.6.4" - resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-7.6.4.tgz#455ec5c51fee5ae99604ca15142409ffbbf84db9" - integrity sha512-xx560wGBk7seZ6y933idtjJQc1l+ck+pI3sKvhKozdBV1dRZoKhkW5xoCaFv9tQiX5RH1xfSxjuNu6g+lmN/gw== - dependencies: - tabbable "^6.2.0" - -fsevents@~2.3.2, fsevents@~2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -hast-util-to-html@^9.0.4: - version "9.0.4" - resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-9.0.4.tgz#d689c118c875aab1def692c58603e34335a0f5c5" - integrity sha512-wxQzXtdbhiwGAUKrnQJXlOPmHnEehzphwkK7aluUPQ+lEc1xefC8pblMgpp2w5ldBTEfveRIrADcrhGIWrlTDA== - dependencies: - "@types/hast" "^3.0.0" - "@types/unist" "^3.0.0" - ccount "^2.0.0" - comma-separated-tokens "^2.0.0" - hast-util-whitespace "^3.0.0" - html-void-elements "^3.0.0" - mdast-util-to-hast "^13.0.0" - property-information "^6.0.0" - space-separated-tokens "^2.0.0" - stringify-entities "^4.0.0" - zwitch "^2.0.4" - -hast-util-whitespace@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621" - integrity sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw== - dependencies: - "@types/hast" "^3.0.0" - -hookable@^5.5.3: - version "5.5.3" - resolved "https://registry.yarnpkg.com/hookable/-/hookable-5.5.3.tgz#6cfc358984a1ef991e2518cb9ed4a778bbd3215d" - integrity sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ== - -html-void-elements@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7" - integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg== - -is-what@^4.1.8: - version "4.1.16" - resolved "https://registry.yarnpkg.com/is-what/-/is-what-4.1.16.tgz#1ad860a19da8b4895ad5495da3182ce2acdd7a6f" - integrity sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A== - -magic-string@^0.30.11: - version "0.30.17" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453" - integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA== - dependencies: - "@jridgewell/sourcemap-codec" "^1.5.0" - -mark.js@8.11.1: - version "8.11.1" - resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5" - integrity sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ== - -mdast-util-to-hast@^13.0.0: - version "13.2.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4" - integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA== - dependencies: - "@types/hast" "^3.0.0" - "@types/mdast" "^4.0.0" - "@ungap/structured-clone" "^1.0.0" - devlop "^1.0.0" - micromark-util-sanitize-uri "^2.0.0" - trim-lines "^3.0.0" - unist-util-position "^5.0.0" - unist-util-visit "^5.0.0" - vfile "^6.0.0" - -micromark-util-character@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.1.tgz#2f987831a40d4c510ac261e89852c4e9703ccda6" - integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q== - dependencies: - micromark-util-symbol "^2.0.0" - micromark-util-types "^2.0.0" - -micromark-util-encode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz#0d51d1c095551cfaac368326963cf55f15f540b8" - integrity sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw== - -micromark-util-sanitize-uri@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz#ab89789b818a58752b73d6b55238621b7faa8fd7" - integrity sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ== - dependencies: - micromark-util-character "^2.0.0" - micromark-util-encode "^2.0.0" - micromark-util-symbol "^2.0.0" - -micromark-util-symbol@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz#e5da494e8eb2b071a0d08fb34f6cefec6c0a19b8" - integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q== - -micromark-util-types@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-2.0.1.tgz#a3edfda3022c6c6b55bfb049ef5b75d70af50709" - integrity sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ== - -minisearch@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/minisearch/-/minisearch-7.1.1.tgz#901d0367f078233cdc7a10be7264e09c6248cf5f" - integrity sha512-b3YZEYCEH4EdCAtYP7OlDyx7FdPwNzuNwLQ34SfJpM9dlbBZzeXndGavTrC+VCiRWomL21SWfMc6SCKO/U2ZNw== - -mitt@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" - integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw== - -nanoid@^3.3.8: - version "3.3.8" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" - integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== - -oniguruma-to-es@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/oniguruma-to-es/-/oniguruma-to-es-3.1.0.tgz#6e74d9ef4e8e33a61ad28c1f564b7d0ce1d0b0d9" - integrity sha512-BJ3Jy22YlgejHSO7Fvmz1kKazlaPmRSUH+4adTDUS/dKQ4wLxI+gALZ8updbaux7/m7fIlpgOZ5fp/Inq5jUAw== - dependencies: - emoji-regex-xs "^1.0.0" - regex "^6.0.1" - regex-recursion "^6.0.2" - -perfect-debounce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz#9c2e8bc30b169cc984a58b7d5b28049839591d2a" - integrity sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA== - -picocolors@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" - integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== - -postcss@^8.4.43, postcss@^8.4.48: - version "8.5.2" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.2.tgz#e7b99cb9d2ec3e8dd424002e7c16517cb2b846bd" - integrity sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA== - dependencies: - nanoid "^3.3.8" - picocolors "^1.1.1" - source-map-js "^1.2.1" - -preact@^10.0.0: - version "10.25.4" - resolved "https://registry.yarnpkg.com/preact/-/preact-10.25.4.tgz#c1d00bee9d7b9dcd06a2311d9951973b506ae8ac" - integrity sha512-jLdZDb+Q+odkHJ+MpW/9U5cODzqnB+fy2EiHSZES7ldV5LK7yjlVzTp7R8Xy6W6y75kfK8iWYtFVH7lvjwrCMA== - -property-information@^6.0.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.5.0.tgz#6212fbb52ba757e92ef4fb9d657563b933b7ffec" - integrity sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig== - -regex-recursion@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/regex-recursion/-/regex-recursion-6.0.2.tgz#a0b1977a74c87f073377b938dbedfab2ea582b33" - integrity sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg== - dependencies: - regex-utilities "^2.3.0" - -regex-utilities@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/regex-utilities/-/regex-utilities-2.3.0.tgz#87163512a15dce2908cf079c8960d5158ff43280" - integrity sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng== - -regex@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/regex/-/regex-6.0.1.tgz#282fa4435d0c700b09c0eb0982b602e05ab6a34f" - integrity sha512-uorlqlzAKjKQZ5P+kTJr3eeJGSVroLKoHmquUj4zHWuR+hEyNqlXsSKlYYF5F4NI6nl7tWCs0apKJ0lmfsXAPA== - dependencies: - regex-utilities "^2.3.0" - -rfdc@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" - integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== - -rollup@^4.20.0: - version "4.34.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.34.6.tgz#a07e4d2621759e29034d909655e7a32eee9195c9" - integrity sha512-wc2cBWqJgkU3Iz5oztRkQbfVkbxoz5EhnCGOrnJvnLnQ7O0WhQUYyv18qQI79O8L7DdHrrlJNeCHd4VGpnaXKQ== - dependencies: - "@types/estree" "1.0.6" - optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.34.6" - "@rollup/rollup-android-arm64" "4.34.6" - "@rollup/rollup-darwin-arm64" "4.34.6" - "@rollup/rollup-darwin-x64" "4.34.6" - "@rollup/rollup-freebsd-arm64" "4.34.6" - "@rollup/rollup-freebsd-x64" "4.34.6" - "@rollup/rollup-linux-arm-gnueabihf" "4.34.6" - "@rollup/rollup-linux-arm-musleabihf" "4.34.6" - "@rollup/rollup-linux-arm64-gnu" "4.34.6" - "@rollup/rollup-linux-arm64-musl" "4.34.6" - "@rollup/rollup-linux-loongarch64-gnu" "4.34.6" - "@rollup/rollup-linux-powerpc64le-gnu" "4.34.6" - "@rollup/rollup-linux-riscv64-gnu" "4.34.6" - "@rollup/rollup-linux-s390x-gnu" "4.34.6" - "@rollup/rollup-linux-x64-gnu" "4.34.6" - "@rollup/rollup-linux-x64-musl" "4.34.6" - "@rollup/rollup-win32-arm64-msvc" "4.34.6" - "@rollup/rollup-win32-ia32-msvc" "4.34.6" - "@rollup/rollup-win32-x64-msvc" "4.34.6" - fsevents "~2.3.2" - -shiki@^2.1.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/shiki/-/shiki-2.3.2.tgz#d13bae8403c8aec11907185b4d96746b317cf539" - integrity sha512-UZhz/gsUz7DHFbQBOJP7eXqvKyYvMGramxQiSDc83M/7OkWm6OdVHAReEc3vMLh6L6TRhgL9dvhXz9XDkCDaaw== - dependencies: - "@shikijs/core" "2.3.2" - "@shikijs/engine-javascript" "2.3.2" - "@shikijs/engine-oniguruma" "2.3.2" - "@shikijs/langs" "2.3.2" - "@shikijs/themes" "2.3.2" - "@shikijs/types" "2.3.2" - "@shikijs/vscode-textmate" "^10.0.1" - "@types/hast" "^3.0.4" - -source-map-js@^1.2.0, source-map-js@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" - integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== - -space-separated-tokens@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" - integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== - -speakingurl@^14.0.1: - version "14.0.1" - resolved "https://registry.yarnpkg.com/speakingurl/-/speakingurl-14.0.1.tgz#f37ec8ddc4ab98e9600c1c9ec324a8c48d772a53" - integrity sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ== - -stringify-entities@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-4.0.4.tgz#b3b79ef5f277cc4ac73caeb0236c5ba939b3a4f3" - integrity sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg== - dependencies: - character-entities-html4 "^2.0.0" - character-entities-legacy "^3.0.0" - -superjson@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/superjson/-/superjson-2.2.2.tgz#9d52bf0bf6b5751a3c3472f1292e714782ba3173" - integrity sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q== - dependencies: - copy-anything "^3.0.2" - -tabbable@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.2.0.tgz#732fb62bc0175cfcec257330be187dcfba1f3b97" - integrity sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew== - -trim-lines@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" - integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== - -unist-util-is@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424" - integrity sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw== - dependencies: - "@types/unist" "^3.0.0" - -unist-util-position@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-5.0.0.tgz#678f20ab5ca1207a97d7ea8a388373c9cf896be4" - integrity sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA== - dependencies: - "@types/unist" "^3.0.0" - -unist-util-stringify-position@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz#449c6e21a880e0855bf5aabadeb3a740314abac2" - integrity sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ== - dependencies: - "@types/unist" "^3.0.0" - -unist-util-visit-parents@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz#4d5f85755c3b8f0dc69e21eca5d6d82d22162815" - integrity sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw== - dependencies: - "@types/unist" "^3.0.0" - unist-util-is "^6.0.0" - -unist-util-visit@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-5.0.0.tgz#a7de1f31f72ffd3519ea71814cccf5fd6a9217d6" - integrity sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg== - dependencies: - "@types/unist" "^3.0.0" - unist-util-is "^6.0.0" - unist-util-visit-parents "^6.0.0" - -vfile-message@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-4.0.2.tgz#c883c9f677c72c166362fd635f21fc165a7d1181" - integrity sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw== - dependencies: - "@types/unist" "^3.0.0" - unist-util-stringify-position "^4.0.0" - -vfile@^6.0.0: - version "6.0.3" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.3.tgz#3652ab1c496531852bf55a6bac57af981ebc38ab" - integrity sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q== - dependencies: - "@types/unist" "^3.0.0" - vfile-message "^4.0.0" - -vite@^5.4.14: - version "5.4.14" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.14.tgz#ff8255edb02134df180dcfca1916c37a6abe8408" - integrity sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA== - dependencies: - esbuild "^0.21.3" - postcss "^8.4.43" - rollup "^4.20.0" - optionalDependencies: - fsevents "~2.3.3" - -vitepress@^1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-1.6.3.tgz#4e4662ce2ad55ef64604ecf4f96231a8da2fe9ba" - integrity sha512-fCkfdOk8yRZT8GD9BFqusW3+GggWYZ/rYncOfmgcDtP3ualNHCAg+Robxp2/6xfH1WwPHtGpPwv7mbA3qomtBw== - dependencies: - "@docsearch/css" "3.8.2" - "@docsearch/js" "3.8.2" - "@iconify-json/simple-icons" "^1.2.21" - "@shikijs/core" "^2.1.0" - "@shikijs/transformers" "^2.1.0" - "@shikijs/types" "^2.1.0" - "@types/markdown-it" "^14.1.2" - "@vitejs/plugin-vue" "^5.2.1" - "@vue/devtools-api" "^7.7.0" - "@vue/shared" "^3.5.13" - "@vueuse/core" "^12.4.0" - "@vueuse/integrations" "^12.4.0" - focus-trap "^7.6.4" - mark.js "8.11.1" - minisearch "^7.1.1" - shiki "^2.1.0" - vite "^5.4.14" - vue "^3.5.13" - -vue@^3.5.13: - version "3.5.13" - resolved "https://registry.yarnpkg.com/vue/-/vue-3.5.13.tgz#9f760a1a982b09c0c04a867903fc339c9f29ec0a" - integrity sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ== - dependencies: - "@vue/compiler-dom" "3.5.13" - "@vue/compiler-sfc" "3.5.13" - "@vue/runtime-dom" "3.5.13" - "@vue/server-renderer" "3.5.13" - "@vue/shared" "3.5.13" - -zwitch@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" - integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==