Files
KernelSU/zh_TW/guide/how-to-integrate-for-non-gki.html
2023-11-13 03:46:43 +00:00

325 lines
80 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-TW" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>如何為非 GKI 核心整合 KernelSU | KernelSU</title>
<meta name="description" content="一個以核心為基礎,適用於 Android GKI 的 Root 解決方案。">
<link rel="preload stylesheet" href="/assets/style.aaa90101.css" as="style">
<script type="module" src="/assets/app.a2c23f3d.js"></script>
<link rel="preload" href="/assets/inter-roman-latin.2ed14f66.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/assets/chunks/framework.ec8f7e8e.js">
<link rel="modulepreload" href="/assets/chunks/theme.4b73f3e8.js">
<link rel="modulepreload" href="/assets/zh_TW_guide_how-to-integrate-for-non-gki.md.035c5fb8.lean.js">
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
</head>
<body>
<div id="app"><div class="Layout" data-v-5a346dfe><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0f60ec36></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0f60ec36> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5a346dfe data-v-ae24b3ad><div class="VPNavBar has-sidebar" data-v-ae24b3ad data-v-a0fd61f4><div class="container" data-v-a0fd61f4><div class="title" data-v-a0fd61f4><div class="VPNavBarTitle has-sidebar" data-v-a0fd61f4 data-v-86d1bed8><a class="title" href="/zh_TW/" data-v-86d1bed8><!--[--><!--]--><!----><!--[-->KernelSU<!--]--><!--[--><!--]--></a></div></div><div class="content" data-v-a0fd61f4><div class="curtain" data-v-a0fd61f4></div><div class="content-body" data-v-a0fd61f4><!--[--><!--]--><div class="VPNavBarSearch search" data-v-a0fd61f4><!----></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-a0fd61f4 data-v-7f418b0f><span id="main-nav-aria-label" class="visually-hidden" data-v-7f418b0f>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh_TW/guide/what-is-kernelsu.html" tabindex="0" data-v-7f418b0f data-v-42ef59de><!--[--><span data-v-42ef59de>指南</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://github.com/tiann/KernelSU" target="_blank" rel="noreferrer" tabindex="0" data-v-7f418b0f data-v-42ef59de><!--[--><span data-v-42ef59de>Github</span><!--]--></a><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-a0fd61f4 data-v-74abcbb9 data-v-9c007e85><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-9c007e85><span class="text" data-v-9c007e85><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="option-icon" data-v-9c007e85><path d="M0 0h24v24H0z" fill="none"></path><path d=" M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z " class="css-c4d79v"></path></svg><!----><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="text-icon" data-v-9c007e85><path d="M12,16c-0.3,0-0.5-0.1-0.7-0.3l-6-6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l5.3,5.3l5.3-5.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-6,6C12.5,15.9,12.3,16,12,16z"></path></svg></span></button><div class="menu" data-v-9c007e85><div class="VPMenu" data-v-9c007e85 data-v-e7ea1737><!----><!--[--><!--[--><div class="items" data-v-74abcbb9><p class="title" data-v-74abcbb9>繁體中文</p><!--[--><div class="VPMenuLink" data-v-74abcbb9 data-v-43f1e123><a class="VPLink link" href="/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->English<!--]--></a></div><div class="VPMenuLink" data-v-74abcbb9 data-v-43f1e123><a class="VPLink link" href="/zh_CN/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->简体中文<!--]--></a></div><div class="VPMenuLink" data-v-74abcbb9 data-v-43f1e123><a class="VPLink link" href="/ja_JP/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->日本語<!--]--></a></div><div class="VPMenuLink" data-v-74abcbb9 data-v-43f1e123><a class="VPLink link" href="/vi_VN/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Tiếng Việt<!--]--></a></div><div class="VPMenuLink" data-v-74abcbb9 data-v-43f1e123><a class="VPLink link" href="/id_ID/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Bahasa<!--]--></a></div><div class="VPMenuLink" data-v-74abcbb9 data-v-43f1e123><a class="VPLink link" href="/ru_RU/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Русский<!--]--></a></div><div class="VPMenuLink" data-v-74abcbb9 data-v-43f1e123><a class="VPLink link" href="/pt_BR/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Português (Brasil)<!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-a0fd61f4 data-v-e6aabb21><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-e6aabb21 data-v-ce54a7d1 data-v-b1685198><span class="check" data-v-b1685198><span class="icon" data-v-b1685198><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-ce54a7d1><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-ce54a7d1><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-a0fd61f4 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/tiann/KernelSU" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-f80f8133><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-a0fd61f4 data-v-d0bd9dde data-v-9c007e85><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-9c007e85><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-9c007e85><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-9c007e85><div class="VPMenu" data-v-9c007e85 data-v-e7ea1737><!----><!--[--><!--[--><div class="group translations" data-v-d0bd9dde><p class="trans-title" data-v-d0bd9dde>繁體中文</p><!--[--><div class="VPMenuLink" data-v-d0bd9dde data-v-43f1e123><a class="VPLink link" href="/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->English<!--]--></a></div><div class="VPMenuLink" data-v-d0bd9dde data-v-43f1e123><a class="VPLink link" href="/zh_CN/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->简体中文<!--]--></a></div><div class="VPMenuLink" data-v-d0bd9dde data-v-43f1e123><a class="VPLink link" href="/ja_JP/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->日本語<!--]--></a></div><div class="VPMenuLink" data-v-d0bd9dde data-v-43f1e123><a class="VPLink link" href="/vi_VN/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Tiếng Việt<!--]--></a></div><div class="VPMenuLink" data-v-d0bd9dde data-v-43f1e123><a class="VPLink link" href="/id_ID/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Bahasa<!--]--></a></div><div class="VPMenuLink" data-v-d0bd9dde data-v-43f1e123><a class="VPLink link" href="/ru_RU/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Русский<!--]--></a></div><div class="VPMenuLink" data-v-d0bd9dde data-v-43f1e123><a class="VPLink link" href="/pt_BR/guide/how-to-integrate-for-non-gki.html" data-v-43f1e123><!--[-->Português (Brasil)<!--]--></a></div><!--]--></div><div class="group" data-v-d0bd9dde><div class="item appearance" data-v-d0bd9dde><p class="label" data-v-d0bd9dde>Appearance</p><div class="appearance-action" data-v-d0bd9dde><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-d0bd9dde data-v-ce54a7d1 data-v-b1685198><span class="check" data-v-b1685198><span class="icon" data-v-b1685198><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-ce54a7d1><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-ce54a7d1><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div></div></div><div class="group" data-v-d0bd9dde><div class="item social-links" data-v-d0bd9dde><div class="VPSocialLinks social-links-list" data-v-d0bd9dde data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/tiann/KernelSU" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-f80f8133><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-a0fd61f4 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><!----></header><div class="VPLocalNav reached-top" data-v-5a346dfe data-v-79c8c1df><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-79c8c1df><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="menu-icon" data-v-79c8c1df><path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path></svg><span class="menu-text" data-v-79c8c1df>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-79c8c1df data-v-1c15a60a><button data-v-1c15a60a>Return to top</button><!----></div></div><aside class="VPSidebar" data-v-5a346dfe data-v-b00e2fdd><div class="curtain" data-v-b00e2fdd></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-b00e2fdd><span class="visually-hidden" id="sidebar-aria-label" data-v-b00e2fdd> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-b00e2fdd><section class="VPSidebarItem level-0 has-active" data-v-b00e2fdd data-v-e31bd47b><div class="item" role="button" tabindex="0" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><h2 class="text" data-v-e31bd47b>Guide</h2><!----></div><div class="items" data-v-e31bd47b><!--[--><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/what-is-kernelsu.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>什麼是 KernelSU</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/installation.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>安裝</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/how-to-build.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>如何建置?</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/how-to-integrate-for-non-gki.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>如何為非 GKI 核心整合 KernelSU</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/unofficially-support-devices.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>非官方支援裝置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/module.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>模組指南</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/rescue-from-bootloop.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>搶救開機迴圈</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/faq.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>常見問題</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e31bd47b data-v-e31bd47b><div class="item" data-v-e31bd47b><div class="indicator" data-v-e31bd47b></div><a class="VPLink link link" href="/zh_TW/guide/hidden-features.html" data-v-e31bd47b><!--[--><p class="text" data-v-e31bd47b>隱藏功能</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5a346dfe data-v-669faec9><div class="VPDoc has-sidebar has-aside" data-v-669faec9 data-v-6b87e69f><!--[--><!--]--><div class="container" data-v-6b87e69f><div class="aside" data-v-6b87e69f><div class="aside-curtain" data-v-6b87e69f></div><div class="aside-container" data-v-6b87e69f><div class="aside-content" data-v-6b87e69f><div class="VPDocAside" data-v-6b87e69f data-v-3f215769><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" role="navigation" data-v-3f215769 data-v-d330b1bb><div class="content" data-v-d330b1bb><div class="outline-marker" data-v-d330b1bb></div><div class="outline-title" role="heading" aria-level="2" data-v-d330b1bb>On this page</div><nav aria-labelledby="doc-outline-aria-label" data-v-d330b1bb><span class="visually-hidden" id="doc-outline-aria-label" data-v-d330b1bb> Table of Contents for current page </span><ul class="root" data-v-d330b1bb data-v-d0ee3533><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-6b87e69f><div class="content-container" data-v-6b87e69f><!--[--><!--]--><!----><main class="main" data-v-6b87e69f><div style="position:relative;" class="vp-doc _zh_TW_guide_how-to-integrate-for-non-gki" data-v-6b87e69f><div><h1 id="introduction" tabindex="-1">如何為非 GKI 核心整合 KernelSU <a class="header-anchor" href="#introduction" aria-label="Permalink to &quot;如何為非 GKI 核心整合 KernelSU {#introduction}&quot;"></a></h1><p>KernelSU 可以被整合到非 GKI 核心中,現在它最低支援到核心 4.14 版本;理論上也可以支援更低的版本。</p><p>由於非 GKI 核心的片段化極其嚴重,因此通常沒有統一的方法來建置它,所以我們也無法為非 GKI 裝置提供 Boot 映像。但您完全可以自行整合 KernelSU 並建置核心以繼續使用。</p><p>首先,您必須有能力從您裝置的核心原始碼建置出一個可以開機並且能夠正常使用的核心,如果核心並非開放原始碼,這通常難以做到。</p><p>如果您已經做好了上述準備,那有兩個方法來將 KernelSU 整合至您的核心之中。</p><ol><li>藉助 <code>kprobe</code> 自動整合</li><li>手動修改核心原始碼</li></ol><h2 id="using-kprobes" tabindex="-1">使用 kprobe 整合 <a class="header-anchor" href="#using-kprobes" aria-label="Permalink to &quot;使用 kprobe 整合 {#using-kprobes}&quot;"></a></h2><p>KernelSU 使用 kprobe 機制來處理核心的相關 hook如果 <em>kprobe</em> 可以在您建置的核心中正常運作,那麼建議使用這個方法進行整合。</p><p>首先,把 KernelSU 新增至您的核心來源樹狀結構,再核心的根目錄執行以下命令:</p><ul><li>最新 tag (稳定版本)</li></ul><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#B392F0;">curl</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">-LSs</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">|</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">bash</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">-</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6F42C1;">curl</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">-LSs</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#24292E;"> </span><span style="color:#D73A49;">|</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">bash</span><span style="color:#24292E;"> </span><span style="color:#032F62;">-</span></span></code></pre></div><ul><li>main 分支(開發版本)</li></ul><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#B392F0;">curl</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">-LSs</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">|</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">bash</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">-s</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">main</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6F42C1;">curl</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">-LSs</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#24292E;"> </span><span style="color:#D73A49;">|</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">bash</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">-s</span><span style="color:#24292E;"> </span><span style="color:#032F62;">main</span></span></code></pre></div><ul><li>選取 tag (例如 v0.5.2)</li></ul><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#B392F0;">curl</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">-LSs</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">|</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">bash</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">-s</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">v0.5.2</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6F42C1;">curl</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">-LSs</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#24292E;"> </span><span style="color:#D73A49;">|</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">bash</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">-s</span><span style="color:#24292E;"> </span><span style="color:#032F62;">v0.5.2</span></span></code></pre></div><p>然後,您需要檢查您的核心是否啟用 <em>kprobe</em> 相關組態,如果未啟用,則需要新增以下組態:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#e1e4e8;">CONFIG_KPROBES=y</span></span>
<span class="line"><span style="color:#e1e4e8;">CONFIG_HAVE_KPROBES=y</span></span>
<span class="line"><span style="color:#e1e4e8;">CONFIG_KPROBE_EVENTS=y</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#24292e;">CONFIG_KPROBES=y</span></span>
<span class="line"><span style="color:#24292e;">CONFIG_HAVE_KPROBES=y</span></span>
<span class="line"><span style="color:#24292e;">CONFIG_KPROBE_EVENTS=y</span></span></code></pre></div><p>最後,重新建置您的核心即可。</p><p>如果您發現 KPROBES 仍未生效,很有可能是因為它的相依性 <code>CONFIG_MODULES</code> 並未被啟用 (如果還是未生效請輸入 <code>make menuconfig</code> 搜尋 KPROBES 的其他相依性並啟用)</p><p>如果您在整合 KernelSU 之後手機無法啟動,那麼很可能您的核心中 <strong>kprobe 無法正常運作</strong>,您需要修正這個錯誤,或者使用第二種方法。</p><div class="tip custom-block"><p class="custom-block-title">如何檢查 kprobe 是否損毀?</p><p><code>KernelSU/kernel/ksu.c</code> 中的 <code>ksu_enable_sucompat()</code><code>ksu_enable_ksud()</code> 取消註解,如果正常開機,即 kprobe 已損毀;或者您可以手動嘗試使用 kprobe 功能,如果不正常,手機會直接重新啟動。</p></div><h2 id="modify-kernel-source-code" tabindex="-1">手動修改核心原始碼 <a class="header-anchor" href="#modify-kernel-source-code" aria-label="Permalink to &quot;手動修改核心原始碼 {#modify-kernel-source-code}&quot;"></a></h2><p>如果 kprobe 無法正常運作 (可能是上游的錯誤或核心版本過低),那您可以嘗試這種方法:</p><p>首先,將 KernelSU 新增至您的原始碼樹狀結構,再核心的根目錄執行以下命令:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#B392F0;">curl</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">-LSs</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">|</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">bash</span><span style="color:#E1E4E8;"> </span><span style="color:#9ECBFF;">-</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6F42C1;">curl</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">-LSs</span><span style="color:#24292E;"> </span><span style="color:#032F62;">&quot;https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh&quot;</span><span style="color:#24292E;"> </span><span style="color:#D73A49;">|</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">bash</span><span style="color:#24292E;"> </span><span style="color:#032F62;">-</span></span></code></pre></div><p>然後,手動修改核心原始碼,您可以參閱下方的 patch</p><div class="language-diff vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">diff</span><pre class="shiki github-dark has-diff vp-code-dark"><code><span class="line"><span style="color:#79B8FF;">diff --git a/fs/exec.c b/fs/exec.c</span></span>
<span class="line"><span style="color:#E1E4E8;">index ac59664eaecf..bdd585e1d2cc 100644</span></span>
<span class="line"><span style="color:#FDAEB7;">--- a/fs/exec.c</span></span>
<span class="line"><span style="color:#85E89D;">+++ b/fs/exec.c</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -1890,11 +1890,14 @@</span><span style="color:#E1E4E8;"> static int __do_execve_file(int fd, struct filename *filename,</span></span>
<span class="line"><span style="color:#E1E4E8;"> return retval;</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+extern bool ksu_execveat_hook __read_mostly;</span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv,</span></span>
<span class="line"><span style="color:#85E89D;">+ void *envp, int *flags);</span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr,</span></span>
<span class="line"><span style="color:#85E89D;">+ void *argv, void *envp, int *flags);</span></span>
<span class="line"><span style="color:#E1E4E8;"> static int do_execveat_common(int fd, struct filename *filename,</span></span>
<span class="line"><span style="color:#E1E4E8;"> struct user_arg_ptr argv,</span></span>
<span class="line"><span style="color:#E1E4E8;"> struct user_arg_ptr envp,</span></span>
<span class="line"><span style="color:#E1E4E8;"> int flags)</span></span>
<span class="line"><span style="color:#E1E4E8;"> {</span></span>
<span class="line"><span style="color:#85E89D;">+ if (unlikely(ksu_execveat_hook))</span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_execveat(&amp;fd, &amp;filename, &amp;argv, &amp;envp, &amp;flags);</span></span>
<span class="line"><span style="color:#85E89D;">+ else</span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_execveat_sucompat(&amp;fd, &amp;filename, &amp;argv, &amp;envp, &amp;flags);</span></span>
<span class="line"><span style="color:#E1E4E8;"> return __do_execve_file(fd, filename, argv, envp, flags, NULL);</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#79B8FF;">diff --git a/fs/open.c b/fs/open.c</span></span>
<span class="line"><span style="color:#E1E4E8;">index 05036d819197..965b84d486b8 100644</span></span>
<span class="line"><span style="color:#FDAEB7;">--- a/fs/open.c</span></span>
<span class="line"><span style="color:#85E89D;">+++ b/fs/open.c</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -348,6 +348,8 @@</span><span style="color:#E1E4E8;"> SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)</span></span>
<span class="line"><span style="color:#E1E4E8;"> return ksys_fallocate(fd, mode, offset, len);</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,</span></span>
<span class="line"><span style="color:#85E89D;">+ int *flags);</span></span>
<span class="line"><span style="color:#E1E4E8;"> /*</span></span>
<span class="line"><span style="color:#E1E4E8;"> * access() needs to use the real uid/gid, not the effective uid/gid.</span></span>
<span class="line"><span style="color:#E1E4E8;"> * We do this by temporarily clearing all FS-related capabilities and</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -355,6 +357,7 @@</span><span style="color:#E1E4E8;"> SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)</span></span>
<span class="line"><span style="color:#E1E4E8;"> */</span></span>
<span class="line"><span style="color:#E1E4E8;"> long do_faccessat(int dfd, const char __user *filename, int mode)</span></span>
<span class="line"><span style="color:#E1E4E8;"> {</span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_faccessat(&amp;dfd, &amp;filename, &amp;mode, NULL);</span></span>
<span class="line"><span style="color:#E1E4E8;"> const struct cred *old_cred;</span></span>
<span class="line"><span style="color:#E1E4E8;"> struct cred *override_cred;</span></span>
<span class="line"><span style="color:#E1E4E8;"> struct path path;</span></span>
<span class="line"><span style="color:#79B8FF;">diff --git a/fs/read_write.c b/fs/read_write.c</span></span>
<span class="line"><span style="color:#E1E4E8;">index 650fc7e0f3a6..55be193913b6 100644</span></span>
<span class="line"><span style="color:#FDAEB7;">--- a/fs/read_write.c</span></span>
<span class="line"><span style="color:#85E89D;">+++ b/fs/read_write.c</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -434,10 +434,14 @@</span><span style="color:#E1E4E8;"> ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> EXPORT_SYMBOL(kernel_read);</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+extern bool ksu_vfs_read_hook __read_mostly;</span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,</span></span>
<span class="line"><span style="color:#85E89D;">+ size_t *count_ptr, loff_t **pos);</span></span>
<span class="line"><span style="color:#E1E4E8;"> ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)</span></span>
<span class="line"><span style="color:#E1E4E8;"> {</span></span>
<span class="line"><span style="color:#E1E4E8;"> ssize_t ret;</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+ if (unlikely(ksu_vfs_read_hook))</span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_vfs_read(&amp;file, &amp;buf, &amp;count, &amp;pos);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#E1E4E8;"> if (!(file-&gt;f_mode &amp; FMODE_READ))</span></span>
<span class="line"><span style="color:#E1E4E8;"> return -EBADF;</span></span>
<span class="line"><span style="color:#E1E4E8;"> if (!(file-&gt;f_mode &amp; FMODE_CAN_READ))</span></span>
<span class="line"><span style="color:#79B8FF;">diff --git a/fs/stat.c b/fs/stat.c</span></span>
<span class="line"><span style="color:#E1E4E8;">index 376543199b5a..82adcef03ecc 100644</span></span>
<span class="line"><span style="color:#FDAEB7;">--- a/fs/stat.c</span></span>
<span class="line"><span style="color:#85E89D;">+++ b/fs/stat.c</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -148,6 +148,8 @@</span><span style="color:#E1E4E8;"> int vfs_statx_fd(unsigned int fd, struct kstat *stat,</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> EXPORT_SYMBOL(vfs_statx_fd);</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#E1E4E8;"> /**</span></span>
<span class="line"><span style="color:#E1E4E8;"> * vfs_statx - Get basic and extra attributes by filename</span></span>
<span class="line"><span style="color:#E1E4E8;"> * @dfd: A file descriptor representing the base dir for a relative filename</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -170,6 +172,7 @@</span><span style="color:#E1E4E8;"> int vfs_statx(int dfd, const char __user *filename, int flags,</span></span>
<span class="line"><span style="color:#E1E4E8;"> int error = -EINVAL;</span></span>
<span class="line"><span style="color:#E1E4E8;"> unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT;</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_stat(&amp;dfd, &amp;filename, &amp;flags);</span></span>
<span class="line"><span style="color:#E1E4E8;"> if ((flags &amp; ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |</span></span>
<span class="line"><span style="color:#E1E4E8;"> AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0)</span></span>
<span class="line"><span style="color:#E1E4E8;"> return -EINVAL;</span></span></code></pre><pre class="shiki github-light has-diff vp-code-light"><code><span class="line"><span style="color:#005CC5;">diff --git a/fs/exec.c b/fs/exec.c</span></span>
<span class="line"><span style="color:#24292E;">index ac59664eaecf..bdd585e1d2cc 100644</span></span>
<span class="line"><span style="color:#B31D28;">--- a/fs/exec.c</span></span>
<span class="line"><span style="color:#22863A;">+++ b/fs/exec.c</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -1890,11 +1890,14 @@</span><span style="color:#24292E;"> static int __do_execve_file(int fd, struct filename *filename,</span></span>
<span class="line"><span style="color:#24292E;"> return retval;</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+extern bool ksu_execveat_hook __read_mostly;</span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv,</span></span>
<span class="line"><span style="color:#22863A;">+ void *envp, int *flags);</span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr,</span></span>
<span class="line"><span style="color:#22863A;">+ void *argv, void *envp, int *flags);</span></span>
<span class="line"><span style="color:#24292E;"> static int do_execveat_common(int fd, struct filename *filename,</span></span>
<span class="line"><span style="color:#24292E;"> struct user_arg_ptr argv,</span></span>
<span class="line"><span style="color:#24292E;"> struct user_arg_ptr envp,</span></span>
<span class="line"><span style="color:#24292E;"> int flags)</span></span>
<span class="line"><span style="color:#24292E;"> {</span></span>
<span class="line"><span style="color:#22863A;">+ if (unlikely(ksu_execveat_hook))</span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_execveat(&amp;fd, &amp;filename, &amp;argv, &amp;envp, &amp;flags);</span></span>
<span class="line"><span style="color:#22863A;">+ else</span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_execveat_sucompat(&amp;fd, &amp;filename, &amp;argv, &amp;envp, &amp;flags);</span></span>
<span class="line"><span style="color:#24292E;"> return __do_execve_file(fd, filename, argv, envp, flags, NULL);</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#005CC5;">diff --git a/fs/open.c b/fs/open.c</span></span>
<span class="line"><span style="color:#24292E;">index 05036d819197..965b84d486b8 100644</span></span>
<span class="line"><span style="color:#B31D28;">--- a/fs/open.c</span></span>
<span class="line"><span style="color:#22863A;">+++ b/fs/open.c</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -348,6 +348,8 @@</span><span style="color:#24292E;"> SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)</span></span>
<span class="line"><span style="color:#24292E;"> return ksys_fallocate(fd, mode, offset, len);</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,</span></span>
<span class="line"><span style="color:#22863A;">+ int *flags);</span></span>
<span class="line"><span style="color:#24292E;"> /*</span></span>
<span class="line"><span style="color:#24292E;"> * access() needs to use the real uid/gid, not the effective uid/gid.</span></span>
<span class="line"><span style="color:#24292E;"> * We do this by temporarily clearing all FS-related capabilities and</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -355,6 +357,7 @@</span><span style="color:#24292E;"> SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)</span></span>
<span class="line"><span style="color:#24292E;"> */</span></span>
<span class="line"><span style="color:#24292E;"> long do_faccessat(int dfd, const char __user *filename, int mode)</span></span>
<span class="line"><span style="color:#24292E;"> {</span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_faccessat(&amp;dfd, &amp;filename, &amp;mode, NULL);</span></span>
<span class="line"><span style="color:#24292E;"> const struct cred *old_cred;</span></span>
<span class="line"><span style="color:#24292E;"> struct cred *override_cred;</span></span>
<span class="line"><span style="color:#24292E;"> struct path path;</span></span>
<span class="line"><span style="color:#005CC5;">diff --git a/fs/read_write.c b/fs/read_write.c</span></span>
<span class="line"><span style="color:#24292E;">index 650fc7e0f3a6..55be193913b6 100644</span></span>
<span class="line"><span style="color:#B31D28;">--- a/fs/read_write.c</span></span>
<span class="line"><span style="color:#22863A;">+++ b/fs/read_write.c</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -434,10 +434,14 @@</span><span style="color:#24292E;"> ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> EXPORT_SYMBOL(kernel_read);</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+extern bool ksu_vfs_read_hook __read_mostly;</span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,</span></span>
<span class="line"><span style="color:#22863A;">+ size_t *count_ptr, loff_t **pos);</span></span>
<span class="line"><span style="color:#24292E;"> ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)</span></span>
<span class="line"><span style="color:#24292E;"> {</span></span>
<span class="line"><span style="color:#24292E;"> ssize_t ret;</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+ if (unlikely(ksu_vfs_read_hook))</span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_vfs_read(&amp;file, &amp;buf, &amp;count, &amp;pos);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#24292E;"> if (!(file-&gt;f_mode &amp; FMODE_READ))</span></span>
<span class="line"><span style="color:#24292E;"> return -EBADF;</span></span>
<span class="line"><span style="color:#24292E;"> if (!(file-&gt;f_mode &amp; FMODE_CAN_READ))</span></span>
<span class="line"><span style="color:#005CC5;">diff --git a/fs/stat.c b/fs/stat.c</span></span>
<span class="line"><span style="color:#24292E;">index 376543199b5a..82adcef03ecc 100644</span></span>
<span class="line"><span style="color:#B31D28;">--- a/fs/stat.c</span></span>
<span class="line"><span style="color:#22863A;">+++ b/fs/stat.c</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -148,6 +148,8 @@</span><span style="color:#24292E;"> int vfs_statx_fd(unsigned int fd, struct kstat *stat,</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> EXPORT_SYMBOL(vfs_statx_fd);</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#24292E;"> /**</span></span>
<span class="line"><span style="color:#24292E;"> * vfs_statx - Get basic and extra attributes by filename</span></span>
<span class="line"><span style="color:#24292E;"> * @dfd: A file descriptor representing the base dir for a relative filename</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -170,6 +172,7 @@</span><span style="color:#24292E;"> int vfs_statx(int dfd, const char __user *filename, int flags,</span></span>
<span class="line"><span style="color:#24292E;"> int error = -EINVAL;</span></span>
<span class="line"><span style="color:#24292E;"> unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT;</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_stat(&amp;dfd, &amp;filename, &amp;flags);</span></span>
<span class="line"><span style="color:#24292E;"> if ((flags &amp; ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |</span></span>
<span class="line"><span style="color:#24292E;"> AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0)</span></span>
<span class="line"><span style="color:#24292E;"> return -EINVAL;</span></span></code></pre></div><p>主要修改四個項目:</p><ol><li>do_faccessat通常位於 <code>fs/open.c</code></li><li>do_execveat_common通常位於 <code>fs/exec.c</code></li><li>vfs_read通常位於 <code>fs/read_write.c</code></li><li>vfs_statx通常位於 <code>fs/stat.c</code></li></ol><p>如果您的核心沒有 <code>vfs_statx</code>,使用 <code>vfs_fstatat</code> 將其取代:</p><div class="language-diff vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">diff</span><pre class="shiki github-dark has-diff vp-code-dark"><code><span class="line"><span style="color:#79B8FF;">diff --git a/fs/stat.c b/fs/stat.c</span></span>
<span class="line"><span style="color:#E1E4E8;">index 068fdbcc9e26..5348b7bb9db2 100644</span></span>
<span class="line"><span style="color:#FDAEB7;">--- a/fs/stat.c</span></span>
<span class="line"><span style="color:#85E89D;">+++ b/fs/stat.c</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -87,6 +87,8 @@</span><span style="color:#E1E4E8;"> int vfs_fstat(unsigned int fd, struct kstat *stat)</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> EXPORT_SYMBOL(vfs_fstat);</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#E1E4E8;"> int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,</span></span>
<span class="line"><span style="color:#E1E4E8;"> int flag)</span></span>
<span class="line"><span style="color:#E1E4E8;"> {</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -94,6 +96,8 @@</span><span style="color:#E1E4E8;"> int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,</span></span>
<span class="line"><span style="color:#E1E4E8;"> int error = -EINVAL;</span></span>
<span class="line"><span style="color:#E1E4E8;"> unsigned int lookup_flags = 0;</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_stat(&amp;dfd, &amp;filename, &amp;flag);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#E1E4E8;"> if ((flag &amp; ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |</span></span>
<span class="line"><span style="color:#E1E4E8;"> AT_EMPTY_PATH)) != 0)</span></span>
<span class="line"><span style="color:#E1E4E8;"> goto out;</span></span></code></pre><pre class="shiki github-light has-diff vp-code-light"><code><span class="line"><span style="color:#005CC5;">diff --git a/fs/stat.c b/fs/stat.c</span></span>
<span class="line"><span style="color:#24292E;">index 068fdbcc9e26..5348b7bb9db2 100644</span></span>
<span class="line"><span style="color:#B31D28;">--- a/fs/stat.c</span></span>
<span class="line"><span style="color:#22863A;">+++ b/fs/stat.c</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -87,6 +87,8 @@</span><span style="color:#24292E;"> int vfs_fstat(unsigned int fd, struct kstat *stat)</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> EXPORT_SYMBOL(vfs_fstat);</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#24292E;"> int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,</span></span>
<span class="line"><span style="color:#24292E;"> int flag)</span></span>
<span class="line"><span style="color:#24292E;"> {</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -94,6 +96,8 @@</span><span style="color:#24292E;"> int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,</span></span>
<span class="line"><span style="color:#24292E;"> int error = -EINVAL;</span></span>
<span class="line"><span style="color:#24292E;"> unsigned int lookup_flags = 0;</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_stat(&amp;dfd, &amp;filename, &amp;flag);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#24292E;"> if ((flag &amp; ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |</span></span>
<span class="line"><span style="color:#24292E;"> AT_EMPTY_PATH)) != 0)</span></span>
<span class="line"><span style="color:#24292E;"> goto out;</span></span></code></pre></div><p>對於早於 4.17 的核心,如果沒有 <code>do_faccessat</code>,可以直接找到 <code>faccessat</code> 系統呼叫的定義並進行修改:</p><div class="language-diff vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">diff</span><pre class="shiki github-dark has-diff vp-code-dark"><code><span class="line"><span style="color:#79B8FF;">diff --git a/fs/open.c b/fs/open.c</span></span>
<span class="line"><span style="color:#E1E4E8;">index 2ff887661237..e758d7db7663 100644</span></span>
<span class="line"><span style="color:#FDAEB7;">--- a/fs/open.c</span></span>
<span class="line"><span style="color:#85E89D;">+++ b/fs/open.c</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -355,6 +355,9 @@</span><span style="color:#E1E4E8;"> SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)</span></span>
<span class="line"><span style="color:#E1E4E8;"> return error;</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,</span></span>
<span class="line"><span style="color:#85E89D;">+ int *flags);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#E1E4E8;"> /*</span></span>
<span class="line"><span style="color:#E1E4E8;"> * access() needs to use the real uid/gid, not the effective uid/gid.</span></span>
<span class="line"><span style="color:#E1E4E8;"> * We do this by temporarily clearing all FS-related capabilities and</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -370,6 +373,8 @@</span><span style="color:#E1E4E8;"> SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)</span></span>
<span class="line"><span style="color:#E1E4E8;"> int res;</span></span>
<span class="line"><span style="color:#E1E4E8;"> unsigned int lookup_flags = LOOKUP_FOLLOW;</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_faccessat(&amp;dfd, &amp;filename, &amp;mode, NULL);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#E1E4E8;"> if (mode &amp; ~S_IRWXO) /* where&#39;s F_OK, X_OK, W_OK, R_OK? */</span></span>
<span class="line"><span style="color:#E1E4E8;"> return -EINVAL;</span></span></code></pre><pre class="shiki github-light has-diff vp-code-light"><code><span class="line"><span style="color:#005CC5;">diff --git a/fs/open.c b/fs/open.c</span></span>
<span class="line"><span style="color:#24292E;">index 2ff887661237..e758d7db7663 100644</span></span>
<span class="line"><span style="color:#B31D28;">--- a/fs/open.c</span></span>
<span class="line"><span style="color:#22863A;">+++ b/fs/open.c</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -355,6 +355,9 @@</span><span style="color:#24292E;"> SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)</span></span>
<span class="line"><span style="color:#24292E;"> return error;</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,</span></span>
<span class="line"><span style="color:#22863A;">+ int *flags);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#24292E;"> /*</span></span>
<span class="line"><span style="color:#24292E;"> * access() needs to use the real uid/gid, not the effective uid/gid.</span></span>
<span class="line"><span style="color:#24292E;"> * We do this by temporarily clearing all FS-related capabilities and</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -370,6 +373,8 @@</span><span style="color:#24292E;"> SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)</span></span>
<span class="line"><span style="color:#24292E;"> int res;</span></span>
<span class="line"><span style="color:#24292E;"> unsigned int lookup_flags = LOOKUP_FOLLOW;</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_faccessat(&amp;dfd, &amp;filename, &amp;mode, NULL);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#24292E;"> if (mode &amp; ~S_IRWXO) /* where&#39;s F_OK, X_OK, W_OK, R_OK? */</span></span>
<span class="line"><span style="color:#24292E;"> return -EINVAL;</span></span></code></pre></div><p>若要啟用 KernelSU 內建的安全模式,您還需要修改 <code>drivers/input/input.c</code> 中的 <code>input_handle_event</code> 方法:</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>強烈建議啟用此功能,如果遇到開機迴圈,這將會非常有用!</p></div><div class="language-diff vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">diff</span><pre class="shiki github-dark has-diff vp-code-dark"><code><span class="line"><span style="color:#79B8FF;">diff --git a/drivers/input/input.c b/drivers/input/input.c</span></span>
<span class="line"><span style="color:#E1E4E8;">index 45306f9ef247..815091ebfca4 100755</span></span>
<span class="line"><span style="color:#FDAEB7;">--- a/drivers/input/input.c</span></span>
<span class="line"><span style="color:#85E89D;">+++ b/drivers/input/input.c</span></span>
<span class="line"><span style="color:#B392F0;font-weight:bold;">@@ -367,10 +367,13 @@</span><span style="color:#E1E4E8;"> static int input_get_disposition(struct input_dev *dev,</span></span>
<span class="line"><span style="color:#E1E4E8;"> return disposition;</span></span>
<span class="line"><span style="color:#E1E4E8;"> }</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#85E89D;">+extern bool ksu_input_hook __read_mostly;</span></span>
<span class="line"><span style="color:#85E89D;">+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#E1E4E8;"> static void input_handle_event(struct input_dev *dev,</span></span>
<span class="line"><span style="color:#E1E4E8;"> unsigned int type, unsigned int code, int value)</span></span>
<span class="line"><span style="color:#E1E4E8;"> {</span></span>
<span class="line"><span style="color:#E1E4E8;"> int disposition = input_get_disposition(dev, type, code, &amp;value);</span></span>
<span class="line"><span style="color:#85E89D;">+</span></span>
<span class="line"><span style="color:#85E89D;">+ if (unlikely(ksu_input_hook))</span></span>
<span class="line"><span style="color:#85E89D;">+ ksu_handle_input_handle_event(&amp;type, &amp;code, &amp;value);</span></span>
<span class="line"><span style="color:#E1E4E8;"> </span></span>
<span class="line"><span style="color:#E1E4E8;"> if (disposition != INPUT_IGNORE_EVENT &amp;&amp; type != EV_SYN)</span></span>
<span class="line"><span style="color:#E1E4E8;"> add_input_randomness(type, code, value);</span></span></code></pre><pre class="shiki github-light has-diff vp-code-light"><code><span class="line"><span style="color:#005CC5;">diff --git a/drivers/input/input.c b/drivers/input/input.c</span></span>
<span class="line"><span style="color:#24292E;">index 45306f9ef247..815091ebfca4 100755</span></span>
<span class="line"><span style="color:#B31D28;">--- a/drivers/input/input.c</span></span>
<span class="line"><span style="color:#22863A;">+++ b/drivers/input/input.c</span></span>
<span class="line"><span style="color:#6F42C1;font-weight:bold;">@@ -367,10 +367,13 @@</span><span style="color:#24292E;"> static int input_get_disposition(struct input_dev *dev,</span></span>
<span class="line"><span style="color:#24292E;"> return disposition;</span></span>
<span class="line"><span style="color:#24292E;"> }</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#22863A;">+extern bool ksu_input_hook __read_mostly;</span></span>
<span class="line"><span style="color:#22863A;">+extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#24292E;"> static void input_handle_event(struct input_dev *dev,</span></span>
<span class="line"><span style="color:#24292E;"> unsigned int type, unsigned int code, int value)</span></span>
<span class="line"><span style="color:#24292E;"> {</span></span>
<span class="line"><span style="color:#24292E;"> int disposition = input_get_disposition(dev, type, code, &amp;value);</span></span>
<span class="line"><span style="color:#22863A;">+</span></span>
<span class="line"><span style="color:#22863A;">+ if (unlikely(ksu_input_hook))</span></span>
<span class="line"><span style="color:#22863A;">+ ksu_handle_input_handle_event(&amp;type, &amp;code, &amp;value);</span></span>
<span class="line"><span style="color:#24292E;"> </span></span>
<span class="line"><span style="color:#24292E;"> if (disposition != INPUT_IGNORE_EVENT &amp;&amp; type != EV_SYN)</span></span>
<span class="line"><span style="color:#24292E;"> add_input_randomness(type, code, value);</span></span></code></pre></div><p>最後再次建置您的核心KernelSU 將會如期運作。</p></div></div></main><footer class="VPDocFooter" data-v-6b87e69f data-v-ef5dee53><!--[--><!--]--><div class="edit-info" data-v-ef5dee53><div class="edit-link" data-v-ef5dee53><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/tiann/KernelSU/edit/main/website/docs/zh_TW/guide/how-to-integrate-for-non-gki.md" target="_blank" rel="noreferrer" data-v-ef5dee53><!--[--><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="edit-link-icon" aria-label="edit icon" data-v-ef5dee53><path d="M18,23H4c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h7c0.6,0,1,0.4,1,1s-0.4,1-1,1H4C3.4,5,3,5.4,3,6v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1v-7c0-0.6,0.4-1,1-1s1,0.4,1,1v7C21,21.7,19.7,23,18,23z"></path><path d="M8,17c-0.3,0-0.5-0.1-0.7-0.3C7,16.5,6.9,16.1,7,15.8l1-4c0-0.2,0.1-0.3,0.3-0.5l9.5-9.5c1.2-1.2,3.2-1.2,4.4,0c1.2,1.2,1.2,3.2,0,4.4l-9.5,9.5c-0.1,0.1-0.3,0.2-0.5,0.3l-4,1C8.2,17,8.1,17,8,17zM9.9,12.5l-0.5,2.1l2.1-0.5l9.3-9.3c0.4-0.4,0.4-1.1,0-1.6c-0.4-0.4-1.2-0.4-1.6,0l0,0L9.9,12.5z M18.5,2.5L18.5,2.5L18.5,2.5z"></path></svg> 在 GitHub 中編輯本頁面<!--]--></a></div><!----></div><nav class="prev-next" data-v-ef5dee53><div class="pager" data-v-ef5dee53><a class="pager-link prev" href="/zh_TW/guide/how-to-build.html" data-v-ef5dee53><span class="desc" data-v-ef5dee53>Previous page</span><span class="title" data-v-ef5dee53>如何建置?</span></a></div><div class="pager" data-v-ef5dee53><a class="pager-link next" href="/zh_TW/guide/unofficially-support-devices.html" data-v-ef5dee53><span class="desc" data-v-ef5dee53>Next page</span><span class="title" data-v-ef5dee53>非官方支援裝置</span></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-5a346dfe data-v-e03eb2e1><div class="container" data-v-e03eb2e1><p class="message" data-v-e03eb2e1>係依據 GPL3 授權發行。</p><p class="copyright" data-v-e03eb2e1>Copyright © 2022-目前 KernelSU 開發人員</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"ja_jp_guide_difference-with-magisk.md\":\"665d74c8\",\"ja_jp_guide_faq.md\":\"b51546fa\",\"ja_jp_guide_hidden-features.md\":\"cdaa1636\",\"ja_jp_guide_installation.md\":\"7f4d5495\",\"id_id_guide_rescue-from-bootloop.md\":\"5cce45dd\",\"guide_app-profile.md\":\"27f6816c\",\"ja_jp_index.md\":\"474a6e1c\",\"guide_hidden-features.md\":\"469c34a7\",\"guide_installation.md\":\"f81e59f3\",\"guide_how-to-integrate-for-non-gki.md\":\"5ad8c015\",\"guide_rescue-from-bootloop.md\":\"656e5988\",\"guide_unofficially-support-devices.md\":\"692e1ce3\",\"id_id_guide_difference-with-magisk.md\":\"24526677\",\"id_id_guide_how-to-build.md\":\"f09b7a1a\",\"id_id_guide_module.md\":\"068bf86d\",\"id_id_guide_installation.md\":\"2d1e9f50\",\"ja_jp_guide_module.md\":\"dbefd5cf\",\"id_id_guide_unofficially-support-devices.md\":\"78d9391e\",\"id_id_guide_what-is-kernelsu.md\":\"b6c7dc2f\",\"guide_how-to-build.md\":\"83e45bdd\",\"id_id_index.md\":\"06fbc917\",\"index.md\":\"133d8307\",\"pt_br_guide_rescue-from-bootloop.md\":\"ee15e0d3\",\"ru_ru_guide_app-profile.md\":\"084a5687\",\"ru_ru_guide_faq.md\":\"1d543e4d\",\"id_id_guide_faq.md\":\"a19560c6\",\"guide_module.md\":\"fcc5d1bb\",\"pt_br_guide_app-profile.md\":\"dd333014\",\"guide_what-is-kernelsu.md\":\"f089de90\",\"zh_tw_index.md\":\"419b5e06\",\"pt_br_guide_module.md\":\"dc3df57b\",\"zh_cn_guide_how-to-integrate-for-non-gki.md\":\"fc1a10e8\",\"ru_ru_guide_hidden-features.md\":\"6c681acf\",\"ru_ru_guide_how-to-build.md\":\"3ac4fa09\",\"ja_jp_guide_rescue-from-bootloop.md\":\"7bb5da8e\",\"ja_jp_guide_unofficially-support-devices.md\":\"e12c36fa\",\"ja_jp_guide_what-is-kernelsu.md\":\"10b56327\",\"pt_br_guide_faq.md\":\"01a58b64\",\"pt_br_guide_how-to-build.md\":\"df81a6ce\",\"guide_difference-with-magisk.md\":\"6bc0c587\",\"ru_ru_guide_rescue-from-bootloop.md\":\"c45eb81e\",\"ru_ru_guide_unofficially-support-devices.md\":\"903ca1e7\",\"ru_ru_guide_what-is-kernelsu.md\":\"11586959\",\"ru_ru_index.md\":\"4a8cc387\",\"vi_vn_guide_app-profile.md\":\"0b09a7b5\",\"vi_vn_guide_difference-with-magisk.md\":\"57b7c7d3\",\"vi_vn_guide_faq.md\":\"510e2971\",\"vi_vn_guide_hidden-features.md\":\"f00f568c\",\"vi_vn_guide_how-to-build.md\":\"f65da7b9\",\"vi_vn_guide_how-to-integrate-for-non-gki.md\":\"f0064cd4\",\"vi_vn_guide_installation.md\":\"a6c03995\",\"vi_vn_guide_module.md\":\"d89b5b5b\",\"vi_vn_guide_rescue-from-bootloop.md\":\"dc2854ff\",\"vi_vn_guide_unofficially-support-devices.md\":\"2078077c\",\"vi_vn_guide_what-is-kernelsu.md\":\"48965b2f\",\"vi_vn_index.md\":\"f75cd4bf\",\"zh_cn_guide_app-profile.md\":\"cabe50a9\",\"zh_cn_guide_difference-with-magisk.md\":\"d3fa9085\",\"zh_cn_guide_faq.md\":\"ac23a8b3\",\"zh_cn_guide_hidden-features.md\":\"34a0e2c0\",\"pt_br_guide_unofficially-support-devices.md\":\"9d8e434d\",\"guide_faq.md\":\"89521262\",\"zh_cn_guide_installation.md\":\"b6f3f2dc\",\"zh_cn_guide_module.md\":\"95d10721\",\"zh_cn_guide_rescue-from-bootloop.md\":\"fa76b90c\",\"zh_cn_guide_how-to-build.md\":\"709f65fb\",\"zh_cn_guide_unofficially-support-devices.md\":\"4c68d324\",\"zh_cn_guide_what-is-kernelsu.md\":\"296b4e28\",\"zh_cn_index.md\":\"c6e87037\",\"zh_tw_guide_difference-with-magisk.md\":\"831b592b\",\"zh_tw_guide_faq.md\":\"e91224a7\",\"ru_ru_guide_installation.md\":\"ad88b078\",\"zh_tw_guide_hidden-features.md\":\"728dbc1c\",\"zh_tw_guide_how-to-build.md\":\"32de6944\",\"zh_tw_guide_how-to-integrate-for-non-gki.md\":\"035c5fb8\",\"ru_ru_guide_module.md\":\"19fabb40\",\"zh_tw_guide_installation.md\":\"48e9e870\",\"zh_tw_guide_module.md\":\"57647aec\",\"zh_tw_guide_rescue-from-bootloop.md\":\"499539d8\",\"zh_tw_guide_unofficially-support-devices.md\":\"e1ab05b4\",\"zh_tw_guide_what-is-kernelsu.md\":\"c73a8b16\",\"ru_ru_guide_how-to-integrate-for-non-gki.md\":\"12445e00\",\"pt_br_guide_hidden-features.md\":\"817db7e8\",\"pt_br_guide_difference-with-magisk.md\":\"c0878d2e\",\"pt_br_guide_what-is-kernelsu.md\":\"e7123691\",\"pt_br_index.md\":\"14860a0b\",\"id_id_guide_how-to-integrate-for-non-gki.md\":\"600d4255\",\"ru_ru_guide_difference-with-magisk.md\":\"928ea8b2\",\"pt_br_guide_installation.md\":\"163448ef\",\"pt_br_guide_how-to-integrate-for-non-gki.md\":\"6bd8e7c3\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"KernelSU\",\"description\":\"A VitePress site\",\"base\":\"/\",\"head\":[],\"appearance\":true,\"themeConfig\":{},\"locales\":{\"root\":{\"label\":\"English\",\"lang\":\"en-US\",\"themeConfig\":{\"nav\":[{\"text\":\"Guide\",\"link\":\"/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"last Updated\",\"sidebar\":{\"/guide/\":[{\"text\":\"Guide\",\"items\":[{\"text\":\"What is KernelSU?\",\"link\":\"/guide/what-is-kernelsu\"},{\"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\":\"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\"}]}]},\"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\"}},\"description\":\"A kernel-based root solution for Android GKI devices.\"},\"zh_CN\":{\"label\":\"简体中文\",\"lang\":\"zh-CN\",\"themeConfig\":{\"nav\":[{\"text\":\"指南\",\"link\":\"/zh_CN/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"最后更新\",\"sidebar\":{\"/zh_CN/guide/\":[{\"text\":\"Guide\",\"items\":[{\"text\":\"什么是 KernelSU?\",\"link\":\"/zh_CN/guide/what-is-kernelsu\"},{\"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\":\"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\"}]}]},\"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 中编辑本页\"}},\"description\":\"一个基于内核,为安卓 GKI 准备的 root 方案。\"},\"zh_TW\":{\"label\":\"繁體中文\",\"lang\":\"zh-TW\",\"themeConfig\":{\"nav\":[{\"text\":\"指南\",\"link\":\"/zh_TW/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"上次更新\",\"sidebar\":{\"/zh_TW/guide/\":[{\"text\":\"Guide\",\"items\":[{\"text\":\"什麼是 KernelSU\",\"link\":\"/zh_TW/guide/what-is-kernelsu\"},{\"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\":\"搶救開機迴圈\",\"link\":\"/zh_TW/guide/rescue-from-bootloop.md\"},{\"text\":\"常見問題\",\"link\":\"/zh_TW/guide/faq\"},{\"text\":\"隱藏功能\",\"link\":\"/zh_TW/guide/hidden-features\"}]}]},\"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 中編輯本頁面\"}},\"description\":\"一個以核心為基礎,適用於 Android GKI 的 Root 解決方案。\"},\"ja_JP\":{\"label\":\"日本語\",\"lang\":\"ja-JP\",\"themeConfig\":{\"nav\":[{\"text\":\"ガイド\",\"link\":\"/ja_JP/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"最終更新\",\"sidebar\":{\"/ja_JP/guide/\":[{\"text\":\"ガイド\",\"items\":[{\"text\":\"KernelSU とは?\",\"link\":\"/ja_JP/guide/what-is-kernelsu\"},{\"text\":\"インストール\",\"link\":\"/ja_JP/guide/installation\"},{\"text\":\"ビルドするには?\",\"link\":\"/guide/how-to-build\"},{\"text\":\"非 GKI デバイスでの実装\",\"link\":\"/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\"}]}]},\"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 でこのページを編集\"}},\"description\":\"Android GKI デバイス向けのカーネルベースの root ソリューション\"},\"vi_VN\":{\"label\":\"Tiếng Việt\",\"lang\":\"vi-VN\",\"themeConfig\":{\"nav\":[{\"text\":\"Hướng Dẫn\",\"link\":\"/vi_VN/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"cập nhật lần cuối\",\"sidebar\":{\"/vi_VN/guide/\":[{\"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\"}]}]},\"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\"}},\"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.\"},\"id_ID\":{\"label\":\"Bahasa\",\"lang\":\"id-ID\",\"themeConfig\":{\"nav\":[{\"text\":\"Petunjuk\",\"link\":\"/id_ID/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"Update Terakhir\",\"sidebar\":{\"/id_ID/guide/\":[{\"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\"}]}]},\"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\"}},\"description\":\"Solusi root kernel-based untuk perangkat Android GKI.\"},\"ru_RU\":{\"label\":\"Русский\",\"lang\":\"ru-RU\",\"themeConfig\":{\"nav\":[{\"text\":\"Руководство\",\"link\":\"/ru_RU/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"последнее обновление\",\"sidebar\":{\"/ru_RU/guide/\":[{\"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\"}]}]},\"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\"}},\"description\":\"Решение на основе ядра root для устройств Android GKI.\"},\"pt_BR\":{\"label\":\"Português (Brasil)\",\"lang\":\"pt-BR\",\"themeConfig\":{\"nav\":[{\"text\":\"Guia\",\"link\":\"/pt_BR/guide/what-is-kernelsu\"},{\"text\":\"Github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"lastUpdatedText\":\"Última atualização\",\"sidebar\":{\"/pt_BR/guide/\":[{\"text\":\"Guia\",\"items\":[{\"text\":\"O que é KernelSU?\",\"link\":\"/pt_BR/guide/what-is-kernelsu\"},{\"text\":\"Instalação\",\"link\":\"/pt_BR/guide/installation\"},{\"text\":\"Como construir?\",\"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\":\"Perfil do Aplicativo\",\"link\":\"/pt_BR/guide/app-profile.md\"},{\"text\":\"Resgate do bootloop\",\"link\":\"/pt_BR/guide/rescue-from-bootloop.md\"},{\"text\":\"FAQ\",\"link\":\"/pt_BR/guide/faq\"},{\"text\":\"Recursos ocultos\",\"link\":\"/pt_BR/guide/hidden-features\"}]}]},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/tiann/KernelSU\"}],\"footer\":{\"message\":\"Lançado sob a Licença GPL3.\",\"copyright\":\"Copyright © Desenvolvedores KernelSU atuais de 2022\"},\"editLink\":{\"pattern\":\"https://github.com/tiann/KernelSU/edit/main/website/docs/:path\",\"text\":\"Edite esta página no GitHub\"}},\"description\":\"Uma solução root baseada em kernel para dispositivos Android GKI.\"}},\"scrollOffset\":90,\"cleanUrls\":false}");</script>
</body>
</html>