Showing preview only (3,209K chars total). Download the full file or copy to clipboard to get everything.
Repository: tiann/KernelSU
Branch: main
Commit: 62fa92b7d1cc
Files: 542
Total size: 3.0 MB
Directory structure:
gitextract_ypog1o43/
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── config.yml
│ │ └── custom.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── build-lkm.yml
│ ├── build-manager.yml
│ ├── clang-format.yml
│ ├── clippy.yml
│ ├── ddk-lkm.yml
│ ├── deploy-website.yml
│ ├── ksud.yml
│ ├── ksuinit.yml
│ ├── release.yml
│ ├── rustfmt.yml
│ └── shellcheck.yml
├── .gitignore
├── LICENSE
├── SECURITY.md
├── docs/
│ ├── README.md
│ ├── README_CN.md
│ ├── README_ES.md
│ ├── README_ID.md
│ ├── README_IN.md
│ ├── README_IT.md
│ ├── README_IW.md
│ ├── README_JP.md
│ ├── README_KR.md
│ ├── README_PL.md
│ ├── README_PT-BR.md
│ ├── README_RU.md
│ ├── README_TR.md
│ ├── README_TW.md
│ └── README_VI.md
├── fastlane/
│ └── metadata/
│ └── android/
│ └── en-US/
│ ├── full_description.txt
│ └── short_description.txt
├── js/
│ ├── README.md
│ ├── index.d.ts
│ ├── index.js
│ └── package.json
├── justfile
├── kernel/
│ ├── .clang-format
│ ├── .clangd
│ ├── .gitignore
│ ├── Kbuild
│ ├── Kconfig
│ ├── LICENSE
│ ├── Makefile
│ ├── allowlist.c
│ ├── allowlist.h
│ ├── apk_sign.c
│ ├── apk_sign.h
│ ├── app_profile.c
│ ├── app_profile.h
│ ├── arch.h
│ ├── feature.c
│ ├── feature.h
│ ├── file_wrapper.c
│ ├── file_wrapper.h
│ ├── kernel_umount.c
│ ├── kernel_umount.h
│ ├── klog.h
│ ├── ksu.c
│ ├── ksu.h
│ ├── ksud.c
│ ├── ksud.h
│ ├── manager.h
│ ├── pkg_observer.c
│ ├── seccomp_cache.c
│ ├── seccomp_cache.h
│ ├── selinux/
│ │ ├── rules.c
│ │ ├── selinux.c
│ │ ├── selinux.h
│ │ ├── sepolicy.c
│ │ └── sepolicy.h
│ ├── setuid_hook.c
│ ├── setuid_hook.h
│ ├── setup.sh
│ ├── su_mount_ns.c
│ ├── su_mount_ns.h
│ ├── sucompat.c
│ ├── sucompat.h
│ ├── supercalls.c
│ ├── supercalls.h
│ ├── syscall_hook_manager.c
│ ├── syscall_hook_manager.h
│ ├── throne_tracker.c
│ ├── throne_tracker.h
│ ├── tools/
│ │ └── check_symbol.c
│ ├── util.c
│ └── util.h
├── manager/
│ ├── .gitignore
│ ├── app/
│ │ ├── .gitignore
│ │ ├── build.gradle.kts
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── aidl/
│ │ │ └── me/
│ │ │ └── weishu/
│ │ │ └── kernelsu/
│ │ │ └── IKsuInterface.aidl
│ │ ├── assets/
│ │ │ └── github-markdown.css
│ │ ├── cpp/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── jni.cc
│ │ │ ├── ksu.cc
│ │ │ ├── ksu.h
│ │ │ └── logging.h
│ │ ├── java/
│ │ │ └── me/
│ │ │ └── weishu/
│ │ │ └── kernelsu/
│ │ │ ├── KernelSUApplication.kt
│ │ │ ├── Kernels.kt
│ │ │ ├── Natives.kt
│ │ │ ├── data/
│ │ │ │ ├── model/
│ │ │ │ │ ├── AppInfo.kt
│ │ │ │ │ ├── Module.kt
│ │ │ │ │ ├── ModuleUpdateInfo.kt
│ │ │ │ │ ├── RepoModule.kt
│ │ │ │ │ └── TemplateInfo.kt
│ │ │ │ └── repository/
│ │ │ │ ├── ModuleRepoRepository.kt
│ │ │ │ ├── ModuleRepoRepositoryImpl.kt
│ │ │ │ ├── ModuleRepository.kt
│ │ │ │ ├── ModuleRepositoryImpl.kt
│ │ │ │ ├── SettingsRepository.kt
│ │ │ │ ├── SettingsRepositoryImpl.kt
│ │ │ │ ├── SuperUserRepository.kt
│ │ │ │ ├── SuperUserRepositoryImpl.kt
│ │ │ │ ├── TemplateRepository.kt
│ │ │ │ └── TemplateRepositoryImpl.kt
│ │ │ ├── magica/
│ │ │ │ ├── AppZygotePreload.java
│ │ │ │ ├── BootCompletedReceiver.java
│ │ │ │ └── MagicaService.java
│ │ │ ├── profile/
│ │ │ │ ├── Capabilities.kt
│ │ │ │ └── Groups.kt
│ │ │ └── ui/
│ │ │ ├── KsuService.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── UiMode.kt
│ │ │ ├── animation/
│ │ │ │ ├── DampedDragAnimation.kt
│ │ │ │ └── InteractiveHighlight.kt
│ │ │ ├── component/
│ │ │ │ ├── AppIconImage.kt
│ │ │ │ ├── FloatingBottomBar.kt
│ │ │ │ ├── GithubMarkdown.kt
│ │ │ │ ├── KeyEventBlocker.kt
│ │ │ │ ├── KsuValidCheck.kt
│ │ │ │ ├── Markdown.kt
│ │ │ │ ├── MenuPositionProvider.kt
│ │ │ │ ├── SearchStatus.kt
│ │ │ │ ├── bottombar/
│ │ │ │ │ ├── BottomBar.kt
│ │ │ │ │ ├── BottomBarMaterial.kt
│ │ │ │ │ ├── BottomBarMiuix.kt
│ │ │ │ │ ├── NavigationRailMaterial.kt
│ │ │ │ │ └── NavigationRailMiuix.kt
│ │ │ │ ├── choosekmidialog/
│ │ │ │ │ ├── ChooseKmiDialog.kt
│ │ │ │ │ ├── ChooseKmiDialogMaterial.kt
│ │ │ │ │ └── ChooseKmiDialogMiuix.kt
│ │ │ │ ├── dialog/
│ │ │ │ │ ├── Dialog.kt
│ │ │ │ │ ├── DialogMaterial.kt
│ │ │ │ │ └── DialogMiuix.kt
│ │ │ │ ├── filter/
│ │ │ │ │ ├── BaseFieldFilter.kt
│ │ │ │ │ └── FilterNumber.kt
│ │ │ │ ├── material/
│ │ │ │ │ ├── ExpressiveSwitch.kt
│ │ │ │ │ ├── SearchBar.kt
│ │ │ │ │ ├── SegmentedList.kt
│ │ │ │ │ ├── SendLogBottomSheet.kt
│ │ │ │ │ └── SettingsItem.kt
│ │ │ │ ├── miuix/
│ │ │ │ │ ├── DropdownItem.kt
│ │ │ │ │ ├── EditText.kt
│ │ │ │ │ ├── ScaleDialog.kt
│ │ │ │ │ ├── SendLogDialog.kt
│ │ │ │ │ ├── SuperEditArrow.kt
│ │ │ │ │ └── SuperSearchBar.kt
│ │ │ │ ├── profile/
│ │ │ │ │ ├── AppProfileConfigMaterial.kt
│ │ │ │ │ ├── AppProfileConfigMiuix.kt
│ │ │ │ │ ├── ProfileConfig.kt
│ │ │ │ │ ├── RootProfileConfigMaterial.kt
│ │ │ │ │ ├── RootProfileConfigMiuix.kt
│ │ │ │ │ ├── TemplateConfigMaterial.kt
│ │ │ │ │ ├── TemplateConfigMiuix.kt
│ │ │ │ │ └── dialogs/
│ │ │ │ │ ├── MultiSelectDialog.kt
│ │ │ │ │ └── SingleSelectDialog.kt
│ │ │ │ ├── rebootlistpopup/
│ │ │ │ │ ├── RebootListPopup.kt
│ │ │ │ │ ├── RebootListPopupMaterial.kt
│ │ │ │ │ └── RebootListPopupMiuix.kt
│ │ │ │ ├── statustag/
│ │ │ │ │ ├── StatusTag.kt
│ │ │ │ │ ├── StatusTagMaterial.kt
│ │ │ │ │ └── StatusTagMiuix.kt
│ │ │ │ └── uninstalldialog/
│ │ │ │ ├── UninstallDialog.kt
│ │ │ │ ├── UninstallDialogMaterial.kt
│ │ │ │ └── UninstallDialogMiuix.kt
│ │ │ ├── modifier/
│ │ │ │ └── DragGestureInspector.kt
│ │ │ ├── navigation3/
│ │ │ │ ├── DeepLinkResolver.kt
│ │ │ │ ├── Navigator.kt
│ │ │ │ └── Routes.kt
│ │ │ ├── screen/
│ │ │ │ ├── about/
│ │ │ │ │ ├── AboutMaterial.kt
│ │ │ │ │ ├── AboutMiuix.kt
│ │ │ │ │ ├── AboutScreen.kt
│ │ │ │ │ ├── AboutUiState.kt
│ │ │ │ │ └── AboutUtils.kt
│ │ │ │ ├── appprofile/
│ │ │ │ │ ├── AppProfileMaterial.kt
│ │ │ │ │ ├── AppProfileMiuix.kt
│ │ │ │ │ ├── AppProfileScreen.kt
│ │ │ │ │ ├── AppProfileUiState.kt
│ │ │ │ │ └── AppProfileUtils.kt
│ │ │ │ ├── colorpalette/
│ │ │ │ │ ├── ColorPaletteScreen.kt
│ │ │ │ │ ├── ColorPaletteScreenMaterial.kt
│ │ │ │ │ ├── ColorPaletteScreenMiuix.kt
│ │ │ │ │ └── ColorPaletteUiState.kt
│ │ │ │ ├── executemoduleaction/
│ │ │ │ │ ├── ExecuteModuleActionMaterial.kt
│ │ │ │ │ ├── ExecuteModuleActionMiuix.kt
│ │ │ │ │ ├── ExecuteModuleActionScreen.kt
│ │ │ │ │ ├── ExecuteModuleActionUiState.kt
│ │ │ │ │ └── ExecuteModuleActionUtils.kt
│ │ │ │ ├── flash/
│ │ │ │ │ ├── FlashMaterial.kt
│ │ │ │ │ ├── FlashMiuix.kt
│ │ │ │ │ ├── FlashScreen.kt
│ │ │ │ │ ├── FlashUiState.kt
│ │ │ │ │ └── FlashUtils.kt
│ │ │ │ ├── home/
│ │ │ │ │ ├── HomeMaterial.kt
│ │ │ │ │ ├── HomeMiuix.kt
│ │ │ │ │ ├── HomeScreen.kt
│ │ │ │ │ ├── HomeUiState.kt
│ │ │ │ │ └── HomeUtils.kt
│ │ │ │ ├── install/
│ │ │ │ │ ├── InstallMaterial.kt
│ │ │ │ │ ├── InstallMiuix.kt
│ │ │ │ │ ├── InstallScreen.kt
│ │ │ │ │ ├── InstallUiState.kt
│ │ │ │ │ └── InstallUtils.kt
│ │ │ │ ├── module/
│ │ │ │ │ ├── ModuleMaterial.kt
│ │ │ │ │ ├── ModuleMiuix.kt
│ │ │ │ │ ├── ModuleScreen.kt
│ │ │ │ │ ├── ModuleShortcutState.kt
│ │ │ │ │ ├── ModuleUiState.kt
│ │ │ │ │ └── ModuleUtils.kt
│ │ │ │ ├── modulerepo/
│ │ │ │ │ ├── ModuleRepoMaterial.kt
│ │ │ │ │ ├── ModuleRepoMiuix.kt
│ │ │ │ │ ├── ModuleRepoModels.kt
│ │ │ │ │ ├── ModuleRepoScreen.kt
│ │ │ │ │ └── ModuleRepoUiState.kt
│ │ │ │ ├── settings/
│ │ │ │ │ ├── SettingsMaterial.kt
│ │ │ │ │ ├── SettingsMiuix.kt
│ │ │ │ │ ├── SettingsScreen.kt
│ │ │ │ │ └── SettingsUiState.kt
│ │ │ │ ├── superuser/
│ │ │ │ │ ├── SuperUserMaterial.kt
│ │ │ │ │ ├── SuperUserMiuix.kt
│ │ │ │ │ ├── SuperUserScreen.kt
│ │ │ │ │ └── SuperUserUiState.kt
│ │ │ │ ├── template/
│ │ │ │ │ ├── TemplateMaterial.kt
│ │ │ │ │ ├── TemplateMiuix.kt
│ │ │ │ │ ├── TemplateScreen.kt
│ │ │ │ │ └── TemplateUiState.kt
│ │ │ │ └── templateeditor/
│ │ │ │ ├── TemplateEditorMaterial.kt
│ │ │ │ ├── TemplateEditorMiuix.kt
│ │ │ │ ├── TemplateEditorScreen.kt
│ │ │ │ ├── TemplateEditorUiState.kt
│ │ │ │ └── TemplateEditorUtils.kt
│ │ │ ├── theme/
│ │ │ │ ├── Colors.kt
│ │ │ │ ├── MaterialTheme.kt
│ │ │ │ ├── MiuixTheme.kt
│ │ │ │ └── Theme.kt
│ │ │ ├── util/
│ │ │ │ ├── AppIconCache.kt
│ │ │ │ ├── Colors.kt
│ │ │ │ ├── CompositionProvider.kt
│ │ │ │ ├── Downloader.kt
│ │ │ │ ├── HanziToPinyin.java
│ │ │ │ ├── HazeExt.kt
│ │ │ │ ├── KsuCli.kt
│ │ │ │ ├── LogEvent.kt
│ │ │ │ ├── Network.kt
│ │ │ │ ├── OemHelper.kt
│ │ │ │ ├── SELinuxChecker.kt
│ │ │ │ ├── Serialization.kt
│ │ │ │ ├── UidGroupUtils.kt
│ │ │ │ └── module/
│ │ │ │ ├── LatestVersionInfo.kt
│ │ │ │ ├── ModuleRepoApi.kt
│ │ │ │ └── Shortcut.kt
│ │ │ ├── viewmodel/
│ │ │ │ ├── HomeViewModel.kt
│ │ │ │ ├── MainActivityUiState.kt
│ │ │ │ ├── MainActivityViewModel.kt
│ │ │ │ ├── ModuleRepoViewModel.kt
│ │ │ │ ├── ModuleViewModel.kt
│ │ │ │ ├── SearchViewModelHelper.kt
│ │ │ │ ├── SettingsViewModel.kt
│ │ │ │ ├── SuperUserViewModel.kt
│ │ │ │ └── TemplateViewModel.kt
│ │ │ └── webui/
│ │ │ ├── AppIconUtil.kt
│ │ │ ├── Insets.kt
│ │ │ ├── MimeUtil.java
│ │ │ ├── MonetColorsProvider.kt
│ │ │ ├── SuFilePathHandler.java
│ │ │ ├── WebUIActivity.kt
│ │ │ ├── WebUIMaterial.kt
│ │ │ ├── WebUIMiuix.kt
│ │ │ ├── WebUIScreen.kt
│ │ │ ├── WebUIState.kt
│ │ │ ├── WebViewHelper.kt
│ │ │ └── WebViewInterface.kt
│ │ ├── jniLibs/
│ │ │ └── .gitignore
│ │ └── res/
│ │ ├── drawable/
│ │ │ ├── ic_launcher_foreground.xml
│ │ │ └── ic_launcher_monochrome.xml
│ │ ├── mipmap-anydpi/
│ │ │ └── ic_launcher.xml
│ │ ├── resources.properties
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ ├── values-ar/
│ │ │ └── strings.xml
│ │ ├── values-az/
│ │ │ └── strings.xml
│ │ ├── values-bg/
│ │ │ └── strings.xml
│ │ ├── values-bn/
│ │ │ └── strings.xml
│ │ ├── values-bn-rBD/
│ │ │ └── strings.xml
│ │ ├── values-bs/
│ │ │ └── strings.xml
│ │ ├── values-da/
│ │ │ └── strings.xml
│ │ ├── values-de/
│ │ │ └── strings.xml
│ │ ├── values-es/
│ │ │ └── strings.xml
│ │ ├── values-et/
│ │ │ └── strings.xml
│ │ ├── values-fa/
│ │ │ └── strings.xml
│ │ ├── values-fil/
│ │ │ └── strings.xml
│ │ ├── values-fr/
│ │ │ └── strings.xml
│ │ ├── values-gl/
│ │ │ └── strings.xml
│ │ ├── values-hi/
│ │ │ └── strings.xml
│ │ ├── values-hr/
│ │ │ └── strings.xml
│ │ ├── values-hu/
│ │ │ └── strings.xml
│ │ ├── values-in/
│ │ │ └── strings.xml
│ │ ├── values-it/
│ │ │ └── strings.xml
│ │ ├── values-iw/
│ │ │ └── strings.xml
│ │ ├── values-ja/
│ │ │ └── strings.xml
│ │ ├── values-km/
│ │ │ └── strings.xml
│ │ ├── values-kn/
│ │ │ └── strings.xml
│ │ ├── values-ko/
│ │ │ └── strings.xml
│ │ ├── values-lt/
│ │ │ └── strings.xml
│ │ ├── values-lv/
│ │ │ └── strings.xml
│ │ ├── values-mr/
│ │ │ └── strings.xml
│ │ ├── values-ms/
│ │ │ └── strings.xml
│ │ ├── values-my/
│ │ │ └── strings.xml
│ │ ├── values-night/
│ │ │ └── themes.xml
│ │ ├── values-nl/
│ │ │ └── strings.xml
│ │ ├── values-pl/
│ │ │ └── strings.xml
│ │ ├── values-pt/
│ │ │ └── strings.xml
│ │ ├── values-pt-rBR/
│ │ │ └── strings.xml
│ │ ├── values-ro/
│ │ │ └── strings.xml
│ │ ├── values-ru/
│ │ │ └── strings.xml
│ │ ├── values-sl/
│ │ │ └── strings.xml
│ │ ├── values-sr/
│ │ │ └── strings.xml
│ │ ├── values-te/
│ │ │ └── strings.xml
│ │ ├── values-th/
│ │ │ └── strings.xml
│ │ ├── values-tr/
│ │ │ └── strings.xml
│ │ ├── values-uk/
│ │ │ └── strings.xml
│ │ ├── values-vi/
│ │ │ └── strings.xml
│ │ ├── values-zh-rCN/
│ │ │ └── strings.xml
│ │ ├── values-zh-rHK/
│ │ │ └── strings.xml
│ │ ├── values-zh-rTW/
│ │ │ └── strings.xml
│ │ └── xml/
│ │ ├── backup_rules.xml
│ │ ├── data_extraction_rules.xml
│ │ ├── filepaths.xml
│ │ └── network_security_config.xml
│ ├── build.gradle.kts
│ ├── gradle/
│ │ ├── libs.versions.toml
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle.kts
│ └── sign.example.properties
├── scripts/
│ ├── allowlist.bt
│ └── ksubot.py
├── userspace/
│ ├── ksud/
│ │ ├── .cargo/
│ │ │ └── config.example.toml
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── bin/
│ │ │ ├── .gitignore
│ │ │ ├── aarch64/
│ │ │ │ ├── bootctl
│ │ │ │ └── busybox
│ │ │ └── x86_64/
│ │ │ └── busybox
│ │ ├── build.rs
│ │ └── src/
│ │ ├── apk_sign.rs
│ │ ├── assets.rs
│ │ ├── banner
│ │ ├── boot_patch.rs
│ │ ├── cli.rs
│ │ ├── cli_non_android.rs
│ │ ├── debug.rs
│ │ ├── defs.rs
│ │ ├── feature.rs
│ │ ├── init_event.rs
│ │ ├── installer.sh
│ │ ├── ksucalls.rs
│ │ ├── late_load.rs
│ │ ├── magica.rs
│ │ ├── main.rs
│ │ ├── metamodule.rs
│ │ ├── module.rs
│ │ ├── module_config.rs
│ │ ├── profile.rs
│ │ ├── resetprop.rs
│ │ ├── restorecon.rs
│ │ ├── sepolicy.rs
│ │ ├── su.rs
│ │ └── utils.rs
│ └── ksuinit/
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── build.rs
│ └── src/
│ ├── init.rs
│ ├── lib.rs
│ └── main.rs
└── website/
├── .gitignore
├── docs/
│ ├── .vitepress/
│ │ ├── config.ts
│ │ └── locales/
│ │ ├── en.ts
│ │ ├── id_ID.ts
│ │ ├── index.ts
│ │ ├── ja_JP.ts
│ │ ├── pt_BR.ts
│ │ ├── ru_RU.ts
│ │ ├── vi_VN.ts
│ │ ├── zh_CN.ts
│ │ └── zh_TW.ts
│ ├── guide/
│ │ ├── app-profile.md
│ │ ├── difference-with-magisk.md
│ │ ├── faq.md
│ │ ├── hidden-features.md
│ │ ├── how-to-build.md
│ │ ├── how-to-integrate-for-non-gki.md
│ │ ├── installation.md
│ │ ├── metamodule.md
│ │ ├── module-config.md
│ │ ├── module-webui.md
│ │ ├── module.md
│ │ ├── rescue-from-bootloop.md
│ │ ├── unofficially-support-devices.md
│ │ └── what-is-kernelsu.md
│ ├── id_ID/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── index.md
│ ├── ja_JP/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── pt_BR/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── public/
│ │ ├── ads.txt
│ │ └── templates/
│ │ ├── .gitkeep
│ │ ├── adaway.root
│ │ ├── adb
│ │ ├── cemiuiler.readproc
│ │ ├── hyperceiler.root
│ │ ├── incompetent.root
│ │ ├── kernelmanager.root
│ │ ├── nethunter.root
│ │ ├── rootexploler.root
│ │ ├── shizuku.root
│ │ ├── system
│ │ └── wireguard.root
│ ├── repos.json
│ ├── ru_RU/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── vi_VN/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── zh_CN/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ └── zh_TW/
│ ├── guide/
│ │ ├── app-profile.md
│ │ ├── difference-with-magisk.md
│ │ ├── faq.md
│ │ ├── hidden-features.md
│ │ ├── how-to-build.md
│ │ ├── how-to-integrate-for-non-gki.md
│ │ ├── installation.md
│ │ ├── metamodule.md
│ │ ├── module-config.md
│ │ ├── module-webui.md
│ │ ├── module.md
│ │ ├── rescue-from-bootloop.md
│ │ ├── unofficially-support-devices.md
│ │ └── what-is-kernelsu.md
│ └── index.md
└── package.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
*.bat eol=crlf
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: tiann
patreon: weishu
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: Bug report
description: Create a report to help us improve KernelSU
labels: [Bug]
body:
- type: checkboxes
attributes:
label: Please check before submitting an issue
options:
- label: I have searched the issues and haven't found anything relevant
required: true
- label: I will upload bugreport file in KernelSU Manager - Settings - Report log
required: true
- label: I know how to reproduce the issue which may not be specific to my device
required: false
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is
validations:
required: true
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behaviour
placeholder: |
- 1. Go to '...'
- 2. Click on '....'
- 3. Scroll down to '....'
- 4. See error
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
- type: textarea
attributes:
label: Logs
description: If applicable, add crash or any other logs to help us figure out the problem.
- type: textarea
attributes:
label: Device info
value: |
- Device:
- OS Version:
- KernelSU Version:
- Kernel Version:
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/tiann/KernelSU/issues/1705
about: "We do not accept external Feature Requests, see this link for more details."
================================================
FILE: .github/ISSUE_TEMPLATE/custom.yml
================================================
name: Custom issue template
description: WARNING! If you are reporting a bug but use this template, the issue will be closed directly.
title: '[Custom]'
body:
- type: textarea
id: description
attributes:
label: "Describe your problem."
validations:
required: true
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
actions:
patterns:
- "*"
- package-ecosystem: cargo
directory: userspace/ksud
schedule:
interval: weekly
allow:
- dependency-type: "all"
groups:
crates:
patterns:
- "*"
- package-ecosystem: cargo
directory: userspace/ksuinit
schedule:
interval: weekly
allow:
- dependency-type: "all"
groups:
crates:
patterns:
- "*"
- package-ecosystem: gradle
directory: manager
schedule:
interval: weekly
groups:
maven:
patterns:
- "*"
- package-ecosystem: npm
directory: website
schedule:
interval: weekly
allow:
- dependency-type: "all"
groups:
npm:
patterns:
- "*"
================================================
FILE: .github/workflows/build-lkm.yml
================================================
name: Build LKM for KernelSU
on:
workflow_call:
inputs:
expected_size2:
description: 'Second expected signature size (for PR builds)'
required: false
default: ''
type: string
expected_hash2:
description: 'Second expected signature hash (for PR builds)'
required: false
default: ''
type: string
workflow_dispatch:
jobs:
build-lkm:
strategy:
matrix:
kmi:
- android12-5.10
- android13-5.10
- android13-5.15
- android14-5.15
- android14-6.1
- android15-6.6
- android16-6.12
uses: ./.github/workflows/ddk-lkm.yml
with:
kmi: ${{ matrix.kmi }}
ddk_release: '20260313'
expected_size2: ${{ inputs.expected_size2 || '' }}
expected_hash2: ${{ inputs.expected_hash2 || '' }}
================================================
FILE: .github/workflows/build-manager.yml
================================================
name: Build Manager
on:
push:
branches: [ "main", "dev", "ci" ]
paths:
- '.github/workflows/build-manager.yml'
- '.github/workflows/build-lkm.yml'
- '.github/workflows/ddk-lkm.yml'
- '.github/workflows/ksud.yml'
- 'manager/**'
- 'kernel/**'
- 'userspace/**'
pull_request:
branches: [ "main", "dev" ]
paths:
- '.github/workflows/build-manager.yml'
- '.github/workflows/build-lkm.yml'
- '.github/workflows/ddk-lkm.yml'
- '.github/workflows/ksud.yml'
- 'manager/**'
- 'kernel/**'
- 'userspace/**'
workflow_call:
jobs:
generate-key:
runs-on: ubuntu-latest
outputs:
expected_size: ${{ steps.extract.outputs.expected_size }}
expected_hash: ${{ steps.extract.outputs.expected_hash }}
keystore: ${{ steps.gen.outputs.keystore }}
keystore_password: ${{ steps.gen.outputs.keystore_password }}
key_password: ${{ steps.gen.outputs.key_password }}
steps:
- name: Generate temporary keystore
if: github.event_name == 'pull_request'
id: gen
run: |
KEYSTORE_PASSWORD=$(openssl rand -hex 32)
KEY_PASSWORD=$(openssl rand -hex 32)
echo "keystore_password=$KEYSTORE_PASSWORD" >> $GITHUB_OUTPUT
echo "key_password=$KEY_PASSWORD" >> $GITHUB_OUTPUT
keytool -genkeypair \
-alias pr-key \
-keyalg RSA -keysize 2048 \
-validity 1 \
-storepass "$KEYSTORE_PASSWORD" \
-keypass "$KEY_PASSWORD" \
-dname "CN=KernelSU PR Build" \
-storetype JKS \
-keystore pr-key.jks
echo "keystore=$(base64 -w 0 pr-key.jks)" >> $GITHUB_OUTPUT
- name: Extract certificate hash and size
if: github.event_name == 'pull_request'
id: extract
env:
STORE_PASS: ${{ steps.gen.outputs.keystore_password }}
run: |
# Export DER certificate
keytool -exportcert \
-alias pr-key \
-keystore pr-key.jks \
-storepass "$STORE_PASS" \
-file pr-cert.der
# Calculate size in hex
SIZE_DEC=$(stat -c%s pr-cert.der)
SIZE_HEX=$(printf '0x%04x' "$SIZE_DEC")
echo "expected_size=$SIZE_HEX" >> $GITHUB_OUTPUT
# Calculate SHA256 hash
HASH=$(sha256sum pr-cert.der | awk '{print $1}')
echo "expected_hash=$HASH" >> $GITHUB_OUTPUT
echo "Certificate size: $SIZE_HEX ($SIZE_DEC bytes)"
echo "Certificate hash: $HASH"
build-lkm:
needs: generate-key
uses: ./.github/workflows/build-lkm.yml
with:
expected_size2: ${{ needs.generate-key.outputs.expected_size || '' }}
expected_hash2: ${{ needs.generate-key.outputs.expected_hash || '' }}
secrets: inherit
build-ksuinit:
uses: ./.github/workflows/ksuinit.yml
build-ksud:
needs: [build-lkm, build-ksuinit]
strategy:
matrix:
include:
- target: aarch64-linux-android
os: ubuntu-latest
- target: x86_64-linux-android
os: ubuntu-latest
uses: ./.github/workflows/ksud.yml
with:
target: ${{ matrix.target }}
os: ${{ matrix.os }}
build-ksud-extra:
needs: [build-lkm, build-ksuinit]
strategy:
matrix:
include:
- target: x86_64-pc-windows-gnu # windows pc
os: ubuntu-latest
- target: x86_64-apple-darwin # Intel mac
os: macos-latest
- target: aarch64-apple-darwin # M chip mac
os: macos-latest
- target: aarch64-unknown-linux-musl # arm64 Linux
os: ubuntu-latest
- target: x86_64-unknown-linux-musl # x86 Linux
os: ubuntu-latest
uses: ./.github/workflows/ksud.yml
with:
target: ${{ matrix.target }}
os: ${{ matrix.os }}
build-manager:
needs: [build-ksud, generate-key]
if: always() && needs.build-ksud.result == 'success' && needs.generate-key.result == 'success'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./manager
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup need_upload
id: need_upload
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
echo "UPLOAD=true" >> $GITHUB_OUTPUT
else
echo "UPLOAD=false" >> $GITHUB_OUTPUT
fi
- name: Write key
if: ${{ ( github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' )) || github.ref_type == 'tag' }}
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
{
echo KEYSTORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}'
echo KEY_ALIAS='${{ secrets.KEY_ALIAS }}'
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}'
echo KEYSTORE_FILE='key.jks'
} >> gradle.properties
echo ${{ secrets.KEYSTORE }} | base64 -d > key.jks
fi
- name: Write PR key
if: github.event_name == 'pull_request'
env:
PR_KEYSTORE: ${{ needs.generate-key.outputs.keystore }}
PR_KEYSTORE_PASSWORD: ${{ needs.generate-key.outputs.keystore_password }}
PR_KEY_PASSWORD: ${{ needs.generate-key.outputs.key_password }}
run: |
echo "$PR_KEYSTORE" | base64 -d > pr-key.jks
{
echo KEYSTORE_PASSWORD="$PR_KEYSTORE_PASSWORD"
echo KEY_ALIAS='pr-key'
echo KEY_PASSWORD="$PR_KEY_PASSWORD"
echo KEYSTORE_FILE='pr-key.jks'
} >> gradle.properties
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Download arm64 ksud
uses: actions/download-artifact@v7
with:
name: ksud-aarch64-linux-android
path: .
- name: Download x86_64 ksud
uses: actions/download-artifact@v7
with:
name: ksud-x86_64-linux-android
path: .
- name: Copy ksud to app jniLibs
run: |
mkdir -p app/src/main/jniLibs/arm64-v8a
mkdir -p app/src/main/jniLibs/x86_64
cp -f ../aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so
cp -f ../x86_64-linux-android/release/ksud ../manager/app/src/main/jniLibs/x86_64/libksud.so
- name: Build with Gradle
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
./gradlew clean assembleRelease -PIS_PR_BUILD=true
else
./gradlew clean assembleRelease
fi
- name: Upload build artifact
if: ${{ github.event_name == 'pull_request' || (github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')) || github.ref_type == 'tag' }}
uses: actions/upload-artifact@v6
with:
name: manager
path: manager/app/build/outputs/apk/release/*.apk
- name: Upload mappings
uses: actions/upload-artifact@v6
if: ${{ ( github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' )) || github.ref_type == 'tag' }}
with:
name: "mappings"
path: "manager/app/build/outputs/mapping/release/"
- name: Bot session cache
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
id: bot_session_cache
uses: actions/cache@v5
with:
path: scripts/ksubot.session
key: ${{ runner.os }}-bot-session
- name: Upload to telegram
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
env:
CHAT_ID: ${{ secrets.CHAT_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
TITLE: Manager
BRANCH: ${{ github.ref_name }}
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git rev-list --count HEAD)
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
pip3 install telethon
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
fi
================================================
FILE: .github/workflows/clang-format.yml
================================================
name: ClangFormat check
on:
push:
branches:
- 'main'
paths:
- '.github/workflows/clang-format.yml'
- 'kernel/**/*.c'
- 'kernel/**/*.h'
pull_request:
branches:
- 'main'
paths:
- '.github/workflows/clang-format.yml'
- 'kernel/**/*.c'
- 'kernel/**/*.h'
- 'kernel/.clang-format'
permissions:
checks: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: check
working-directory: kernel
run: make check-format
================================================
FILE: .github/workflows/clippy.yml
================================================
name: Clippy check
on:
push:
branches:
- main
paths:
- '.github/workflows/clippy.yml'
- 'userspace/**'
pull_request:
branches:
- main
paths:
- '.github/workflows/clippy.yml'
- 'userspace/**'
env:
RUSTFLAGS: '-Dwarnings'
CROSS_NO_WARNINGS: '0'
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup update stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: userspace/ksud
- name: Install cross
run: |
RUSTFLAGS="" cargo install cross --git https://github.com/cross-rs/cross --rev 66845c1
- name: Run clippy
run: |
cross clippy --manifest-path userspace/ksud/Cargo.toml --target aarch64-linux-android --release
cross clippy --manifest-path userspace/ksud/Cargo.toml --target x86_64-linux-android --release
cross clippy --manifest-path userspace/ksuinit/Cargo.toml --target aarch64-linux-android --release
cross clippy --manifest-path userspace/ksuinit/Cargo.toml --target x86_64-linux-android --release
================================================
FILE: .github/workflows/ddk-lkm.yml
================================================
name: Build KernelSU Kernel Module
on:
workflow_call:
inputs:
kmi:
description: 'KMI version'
required: true
type: string
ddk_release:
description: 'DDK release version'
required: false
default: '20260313'
type: string
expected_size2:
description: 'Second expected signature size (for PR builds)'
required: false
default: ''
type: string
expected_hash2:
description: 'Second expected signature hash (for PR builds)'
required: false
default: ''
type: string
jobs:
build-kernelsu-ko:
name: Build kernelsu.ko for ${{ inputs.kmi }}
runs-on: ubuntu-latest
container:
image: ghcr.io/ylarod/ddk-min:${{ inputs.kmi }}-${{ inputs.ddk_release }}
options: --privileged
steps:
- name: Checkout source code
uses: actions/checkout@v6
- name: Build kernelsu.ko
env:
EXPECTED_SIZE2: ${{ inputs.expected_size2 }}
EXPECTED_HASH2: ${{ inputs.expected_hash2 }}
run: |
git config --global --add safe.directory /__w/KernelSU/KernelSU
cd kernel
echo "=== Building kernelsu.ko for KMI: ${{ inputs.kmi }} ==="
EXTRA_ARGS=""
if [ -n "$EXPECTED_SIZE2" ] && [ -z "$EXPECTED_HASH2" ]; then
echo "ERROR: expected_hash2 must be provided when expected_size2 is set."
exit 1
fi
if [ -z "$EXPECTED_SIZE2" ] && [ -n "$EXPECTED_HASH2" ]; then
echo "ERROR: expected_size2 must be provided when expected_hash2 is set."
exit 1
fi
if [ -n "$EXPECTED_SIZE2" ]; then
EXTRA_ARGS="KSU_EXPECTED_SIZE2=$EXPECTED_SIZE2 KSU_EXPECTED_HASH2=$EXPECTED_HASH2"
fi
CONFIG_KSU=m CC=clang make $EXTRA_ARGS
echo "=== Build completed ==="
# Create output directory in GitHub workspace
mkdir -p /github/workspace/out
# Copy with KMI-specific naming
OUTPUT_NAME="${{ inputs.kmi }}_kernelsu.ko"
cp kernelsu.ko "/github/workspace/out/$OUTPUT_NAME"
echo "Copied to: /github/workspace/out/$OUTPUT_NAME"
ls -la "/github/workspace/out/$OUTPUT_NAME"
echo "Size: $(du -h "/github/workspace/out/$OUTPUT_NAME" | cut -f1)"
llvm-strip -d "/github/workspace/out/$OUTPUT_NAME"
echo "Size after stripping: $(du -h "/github/workspace/out/$OUTPUT_NAME" | cut -f1)"
- name: Upload kernelsu.ko artifact
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.kmi }}-lkm
path: /github/workspace/out/${{ inputs.kmi }}_kernelsu.ko
================================================
FILE: .github/workflows/deploy-website.yml
================================================
name: Deploy Website
on:
push:
branches:
- main
- website
paths:
- '.github/workflows/deploy-website.yml'
- 'website/**'
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./website
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: latest
cache: yarn # or pnpm / yarn
cache-dependency-path: website/yarn.lock
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build with VitePress
run: |
yarn docs:build
touch docs/.vitepress/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: website/docs/.vitepress/dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
================================================
FILE: .github/workflows/ksud.yml
================================================
name: Build ksud
on:
workflow_call:
inputs:
target:
required: true
type: string
os:
required: false
type: string
default: ubuntu-latest
pack_lkm:
required: false
type: boolean
default: true
pack_ksuinit:
required: false
type: boolean
default: true
use_cache:
required: false
type: boolean
default: true
jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v7
- name: Prepare LKM fies
if: ${{ inputs.pack_lkm }}
run: |
cp android*-lkm/*_kernelsu.ko ./userspace/ksud/bin/aarch64/
- name: Prepare ksuinit
if: ${{ inputs.pack_ksuinit }}
run: |
mv ksuinit/*/release/ksuinit ./userspace/ksud/bin/aarch64/
- name: Setup rustup
run: |
rustup update stable
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
workspaces: userspace/ksud
cache-targets: false
- name: Install cross
run: |
RUSTFLAGS="" cargo install cross --git https://github.com/cross-rs/cross --rev 66845c1
- name: Build ksud
run: CROSS_NO_WARNINGS=0 cross build --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud/Cargo.toml
- name: Upload ksud artifact
uses: actions/upload-artifact@v6
with:
name: ksud-${{ inputs.target }}
path: userspace/ksud/target/**/release/ksud*
================================================
FILE: .github/workflows/ksuinit.yml
================================================
name: Build ksuinit
on:
workflow_call:
inputs:
os:
required: false
type: string
default: ubuntu-latest
jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup rustup
run: |
rustup update stable
rustup target add aarch64-unknown-linux-musl
- uses: Swatinem/rust-cache@v2
with:
workspaces: userspace/ksuinit
cache-targets: false
- name: Build ksuinit
run: |
LLVM_BIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER="$LLVM_BIN/aarch64-linux-android26-clang"
export RUSTFLAGS="-C link-arg=-no-pie"
cd userspace/ksuinit
cargo build --target=aarch64-unknown-linux-musl --release
- name: Upload ksuinit artifact
uses: actions/upload-artifact@v6
with:
name: ksuinit
path: userspace/ksuinit/target/**/release/ksuinit*
================================================
FILE: .github/workflows/release.yml
================================================
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build-manager:
uses: ./.github/workflows/build-manager.yml
secrets: inherit
release:
needs:
- build-manager
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v7
- name: Rename ksud
run: |
mkdir -p ksud
for dir in ./ksud-*; do
if [ -d "$dir" ]; then
echo "----- Rename $dir -----"
ksud_platform_name=$(basename "$dir")
find "$dir" -type f -name "ksud" -path "*/release/*" | while read -r ksud_file; do
if [ -f "$ksud_file" ]; then
mv "$ksud_file" "ksud/$ksud_platform_name"
fi
done
fi
done
- name: Display structure of downloaded files
run: ls -R
- name: release
uses: softprops/action-gh-release@v2
with:
files: |
manager/*.apk
android*-lkm/*_kernelsu.ko
ksud/ksud-*
ksuinit/**
================================================
FILE: .github/workflows/rustfmt.yml
================================================
name: Rustfmt check
on:
push:
branches:
- 'main'
paths:
- '.github/workflows/rustfmt.yml'
- 'userspace/**'
pull_request:
branches:
- 'main'
paths:
- '.github/workflows/rustfmt.yml'
- 'userspace/**'
permissions:
checks: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: LoliGothick/rustfmt-check@master
with:
token: ${{ github.token }}
working-directory: userspace/ksud
- uses: LoliGothick/rustfmt-check@master
with:
token: ${{ github.token }}
working-directory: userspace/ksuinit
================================================
FILE: .github/workflows/shellcheck.yml
================================================
name: ShellCheck
on:
push:
branches:
- 'main'
paths:
- '.github/workflows/shellcheck.yml'
- '**/*.sh'
pull_request:
branches:
- 'main'
paths:
- '.github/workflows/shellcheck.yml'
- '**/*.sh'
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
ignore_names: gradlew
ignore_paths: ./userspace/ksud/src/installer.sh
================================================
FILE: .gitignore
================================================
.idea
.vscode
CLAUDE.md
AGENTS.md
.DS_Store
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: SECURITY.md
================================================
# Reporting Security Issues
The KernelSU team and community take security bugs in KernelSU seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/tiann/KernelSU/security/advisories/new) tab, or you can mailto [weishu](mailto:twsxtd@gmail.com) directly.
The KernelSU team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
================================================
FILE: docs/README.md
================================================
**English** | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
A kernel-based root solution for Android devices.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Features
1. Kernel-based `su` and root access management.
2. Module system based on [metamodules](https://kernelsu.org/guide/metamodule.html): Pluggable infrastructure for systemless modifications.
3. [App Profile](https://kernelsu.org/guide/app-profile.html): Lock up the root power in a cage.
## Compatibility state
KernelSU officially supports Android GKI 2.0 devices (kernel 5.10+). Older kernels (4.14+) are also supported, but the kernel will need to be built manually.
With this, WSA, ChromeOS, and container-based Android are all supported.
Currently, only the `arm64-v8a` and `x86_64` architectures are supported.
## Usage
- [Installation](https://kernelsu.org/guide/installation.html)
- [How to build](https://kernelsu.org/guide/how-to-build.html)
- [Official website](https://kernelsu.org/)
## Translation
To help translate KernelSU or improve existing translations, please use [Weblate](https://hosted.weblate.org/engage/kernelsu/). PR of Manager's translation is no longer accepted, because it will conflict with Weblate.
## Discussion
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Security
For information on reporting security vulnerabilities in KernelSU, see [SECURITY.md](/SECURITY.md).
## License
- Files under the `kernel` directory are [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- All other parts except the `kernel` directory are [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Credits
- [Kernel-Assisted Superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): The KernelSU idea.
- [Magisk](https://github.com/topjohnwu/Magisk): The powerful root tool.
- [genuine](https://github.com/brevent/genuine/): APK v2 signature validation.
- [Diamorphine](https://github.com/m0nad/Diamorphine): Some rootkit skills.
================================================
FILE: docs/README_CN.md
================================================
[English](README.md) | [Español](README_ES.md) | **简体中文** | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
一个 Android 上基于内核的 root 方案。
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## 特性
- 基于内核的 `su` 和权限管理。
- 基于 [metamodules](https://kernelsu.org/zh_CN/guide/metamodule.html) 的模块系统:可插拔的模块架构。
- [App Profile](https://kernelsu.org/zh_CN/guide/app-profile.html): 把 Root 权限关进笼子里。
## 兼容状态
KernelSU 官方支持 GKI 2.0 的设备(内核版本5.10以上);旧内核也是兼容的(最低4.14+),不过需要自己编译内核。
WSA, ChromeOS 和运行在容器上的 Android 也可以与 KernelSU 一起工作。
目前支持架构 : `arm64-v8a` 和 `x86_64`。
## 使用方法
- [安装教程](https://kernelsu.org/zh_CN/guide/installation.html)
- [如何构建?](https://kernelsu.org/zh_CN/guide/how-to-build.html)
- [官方网站](https://kernelsu.org/zh_CN/)
## 参与翻译
要将 KernelSU 翻译成您的语言,或完善现有的翻译,请使用 [Weblate](https://hosted.weblate.org/engage/kernelsu/)。现已不再接受有关管理器翻译的PR,因为这会与Weblate冲突。
## 讨论
- Telegram: [@KernelSU](https://t.me/KernelSU)
## 安全性
有关报告 KernelSU 安全漏洞的信息,请参阅 [SECURITY.md](/SECURITY.md)。
## 许可证
- 目录 `kernel` 下所有文件为 [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)。
- 除 `kernel` 目录的其他部分均为 [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html)。
## 鸣谢
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/):KernelSU 的灵感。
- [Magisk](https://github.com/topjohnwu/Magisk):强大的 root 工具箱。
- [genuine](https://github.com/brevent/genuine/):apk v2 签名验证。
- [Diamorphine](https://github.com/m0nad/Diamorphine):一些 rootkit 技巧。
================================================
FILE: docs/README_ES.md
================================================
[English](README.md) | **Español** | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Una solución root basada en el kernel para dispositivos Android.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Características
1. Binario `su` basado en el kernel y gestión de acceso root.
2. Sistema de módulos basado en [metamodules](https://kernelsu.org/guide/metamodule.html): Infraestructura conectable para modificaciones sin sistema.
## Estado de compatibilidad
**KernelSU** soporta de forma oficial dispositivos Android con **GKI 2.0** (a partir de la versión **5.10** del kernel). Los kernels antiguos (a partir de la versión **4.14**) también son compatibles, pero necesitas compilarlos por tu cuenta.
Con esto, WSA, ChromeOS y Android basado en contenedores están todos compatibles.
Actualmente, solo se admiten las arquitecturas `arm64-v8a` y `x86_64`.
## Uso
- [¿Cómo instalarlo?](https://kernelsu.org/guide/installation.html)
- [¿Cómo compilarlo?](https://kernelsu.org/guide/how-to-build.html)
- [Site oficial](https://kernelsu.org/)
## Traducción
Para ayudar a traducir KernelSU o mejorar las traducciones existentes, utilice [Weblate](https://hosted.weblate.org/engage/kernelsu/). Ya no se aceptan PR de la traducción de Manager porque entrará en conflicto con Weblate.
## Discusión
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Seguridad
Para obtener información sobre cómo informar vulnerabilidades de seguridad en KernelSU, consulte [SECURITY.md](/SECURITY.md).
## Licencia
- Los archivos bajo el directorio `kernel` están licenciados bajo [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- Todas las demás partes, a excepción del directorio `kernel`, están licenciados bajo [GPL-3-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Créditos
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): la idea de KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): la poderosa herramienta root.
- [genuine](https://github.com/brevent/genuine/): validación de firma apk v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): algunas habilidades de rootkit.
================================================
FILE: docs/README_ID.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | **Indonesia** | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Solusi root berbasis Kernel untuk perangkat Android.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Fitur
1. Manajemen akses root dan `su` berbasis kernel.
2. Sistem modul berdasarkan [metamodules](https://kernelsu.org/id_ID/guide/metamodule.html): Infrastruktur pluggable untuk modifikasi systemless.
3. [Profil Aplikasi](https://kernelsu.org/guide/app-profile.html): Kunci daya root di dalam sangkar.
## Status Kompatibilitas
KernelSU secara resmi mendukung perangkat Android GKI 2.0 (dengan kernel 5.10+), kernel lama (4.14+) juga kompatibel, tetapi Anda perlu membuat kernel sendiri.
WSA, ChromeOS, dan Android berbasis wadah juga dapat bekerja dengan KernelSU terintegrasi.
Dan ABI yang didukung saat ini adalah: `arm64-v8a` dan `x86_64`
## Penggunaan
- [Petunjuk Instalasi](https://kernelsu.org/id_ID/guide/installation.html)
- [Bagaimana cara membuat?](https://kernelsu.org/id_ID/guide/how-to-build.html)
- [Situs Web Resmi](https://kernelsu.org/id_ID/)
## Terjemahan
Untuk menerjemahkan KernelSU ke dalam bahasa Anda atau menyempurnakan terjemahan yang sudah ada, harap gunakan [Weblat](https://hosted.weblate.org/engage/kernelsu/).
## Diskusi
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Lisensi
- File di bawah direktori `kernel` adalah [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- Semua bagian lain kecuali direktori `kernel` adalah [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Kredit
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): ide KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): alat root yang ampuh.
- [genuine](https://github.com/brevent/genuine/): validasi tanda tangan apk v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): beberapa keterampilan rootkit.
================================================
FILE: docs/README_IN.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | **हिंदी** | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Android उपकरणों के लिए कर्नेल-आधारित रूट समाधान।
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## विशेषताएँ
1. कर्नेल-आधारित `su` और रूट एक्सेस प्रबंधन।
2. [metamodules](https://kernelsu.org/guide/metamodule.html) पर आधारित मॉड्यूल प्रणाली: Systemless संशोधनों के लिए प्लगेबल इंफ्रास्ट्रक्चर।
3. [App Profile](https://kernelsu.org/guide/app-profile.html): Root शक्ति को पिंजरे में बंद कर दो।
## अनुकूलता अवस्था
KernelSU आधिकारिक तौर पर Android GKI 2.0 डिवाइस (कर्नेल 5.10+) का समर्थन करता है। पुराने कर्नेल (4.14+) भी संगत हैं, लेकिन कर्नेल को मैन्युअल रूप से बनाना होगा।
इसके साथ, WSA, ChromeOS और कंटेनर-आधारित Android सभी समर्थित हैं।
वर्तमान में, केवल `arm64-v8a` और `x86_64` समर्थित हैं।
## प्रयोग
- [स्थापना निर्देश](https://kernelsu.org/guide/installation.html)
- [कैसे बनाना है ?](https://kernelsu.org/guide/how-to-build.html)
- [आधिकारिक वेबसाइट](https://kernelsu.org/)
## अनुवाद करना
KernelSU का अनुवाद करने या मौजूदा अनुवादों को बेहतर बनाने में सहायता के लिए, कृपया इसका उपयोग करें [Weblate](https://hosted.weblate.org/engage/kernelsu/).
## बहस
- Telegram: [@KernelSU](https://t.me/KernelSU)
## लाइसेंस
- `Kernel` निर्देशिका के अंतर्गत फ़ाइलें हैं [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
- `Kernel` निर्देशिका को छोड़कर अन्य सभी भाग हैं [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html)
## आभार सूची
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): KernelSU विचार।
- [Magisk](https://github.com/topjohnwu/Magisk): शक्तिशाली root उपकरण।
- [genuine](https://github.com/brevent/genuine/): apk v2 हस्ताक्षर सत्यापन।
- [Diamorphine](https://github.com/m0nad/Diamorphine): कुछ रूटकिट कौशल।
================================================
FILE: docs/README_IT.md
================================================
[English](REAME.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | **Italiano**
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Una soluzione per il root basata sul kernel per i dispositivi Android.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Funzionalità
1. `su` e accesso root basato sul kernel.
2. Sistema di moduli basato su [metamodules](https://kernelsu.org/guide/metamodule.html): Infrastruttura modulare per modifiche systemless.
3. [App profile](https://kernelsu.org/guide/app-profile.html): Limita i poteri dell'accesso root a permessi specifici.
## Compatibilità
KernelSU supporta ufficialmente i dispositivi Android GKI 2.0 (kernel 5.10 o superiore). I kernel precedenti (kernel 4.14+) sono anche compatibili, ma il kernel deve essere compilato manualmente.
Questo implica che WSA, ChromeOS e tutti le varianti di Android basate su container e virtualizzazione sono supportate.
Allo stato attuale solo le architetture a 64-bit ARM (arm64-v8a) e x86 (x86_64) sono supportate.
## Utilizzo
- [Istruzioni per l'installazione](https://kernelsu.org/guide/installation.html)
- [Come compilare manualmente?](https://kernelsu.org/guide/how-to-build.html)
- [Sito web ufficiale](https://kernelsu.org/)
## Traduzioni
Per aiutare a tradurre KernelSU o migliorare le traduzioni esistenti, si è pregati di utilizzare
To help translate KernelSU or improve existing translations, please use [Weblate](https://hosted.weblate.org/engage/kernelsu/). Le richieste di pull delle traduzioni del manager non saranno più accettate perché sarebbero in conflitto con Weblate.
## Discussione
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Securezza
Per informazioni riguardo la segnalazione di vulnerabilità di sicurezza per KernelSU, leggi [SECURITY.md](/SECURITY.md).
## Licenza
- I file nella cartella `kernel` sono forniti secondo la licenza [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- Tutte le altre parti, ad eccezione della certella `kernel`, seguono la licenza [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Riconoscimenti e attribuzioni
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): l'idea alla base di KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): la potente utilità per il root.
- [genuine](https://github.com/brevent/genuine/): verifica della firma apk v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): alcune capacità di rootkit.
================================================
FILE: docs/README_IW.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | **עברית** | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
פתרון לניהול root מבוסס על Kernel עבור מכשירי Android.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## תכונות
1. ניהול root ו־`su` מבוססים על Kernel.
2. מערכת מודולים מבוססת [metamodules](https://kernelsu.org/guide/metamodule.html): תשתית מודולרית לשינויים systemless.
3. [פרופיל אפליקציה](https://kernelsu.org/guide/app-profile.html): נעילת גישת root בכלוב.
## מצב תאימות
KernelSU תומך במכשירי Android GKI 2.0 (kernel 5.10+) באופן רשמי. לליבות ישנות (4.14+) יש גם תאימות, אך יידרש לבנות את הליבה באופן ידני.
באמצעות זה, תמיכה זמינה גם ל-WSA, ChromeOS ומכשירי Android המבוססים על מיכלים.
כרגע, רק `arm64-v8a` ו־`x86_64` נתמכים.
## שימוש
- [הוראות התקנה](https://kernelsu.org/guide/installation.html)
- [איך לבנות?](https://kernelsu.org/guide/how-to-build.html)
- [האתר רשמי](https://kernelsu.org/)
## תרגום
כדי לעזור בתרגום של KernelSU או לשפר תרגומים קיימים, יש להשתמש ב-[Weblate](https://hosted.weblate.org/engage/kernelsu/).
## דיון
- Telegram: [@KernelSU](https://t.me/KernelSU)
## רשיון
- קבצים תחת הספרייה `kernel` מוגנים על פי [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- כל החלקים האחרים, למעט הספרייה `kernel`, מוגנים על פי [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## קרדיטים
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): הרעיון של KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): הכלי הסופר חזק לניהול root.
- [genuine](https://github.com/brevent/genuine/): אימות חתימת apk v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): כמה יכולות רוט.
================================================
FILE: docs/README_JP.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | **日本語** | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Android におけるカーネルベースの root ソリューションです。
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## 特徴
1. カーネルベースの `su` と権限管理。
2. [metamodules](https://kernelsu.org/ja_JP/guide/metamodule.html) に基づくモジュールシステム: プラグイン可能なシステムレス変更インフラストラクチャ。
3. [アプリのプロファイル](https://kernelsu.org/guide/app-profile.html): root の権限をケージ内に閉じ込めます。
## 対応状況
KernelSU は GKI 2.0 デバイス(カーネルバージョン 5.10 以上)を公式にサポートしています。古いカーネル(4.14以上)とも互換性がありますが、自分でカーネルをビルドする必要があります。
WSA 、ChromeOS とコンテナ上で動作する Android でも KernelSU を統合して動かせます。
現在サポートしているアーキテクチャは `arm64-v8a` および `x86_64` です。
## 使用方法
- [インストール方法はこちら](https://kernelsu.org/ja_JP/guide/installation.html)
- [ビルド方法はこちら](https://kernelsu.org/guide/how-to-build.html)
- [公式サイト](https://kernelsu.org/ja_JP/)
## 翻訳
KernelSU をあなたの言語に翻訳するか、既存の翻訳を改善するには、[Weblate](https://hosted.weblate.org/engage/kernelsu/) を使用してください。Manager翻訳した PR は、Weblate と競合するため受け入れられなくなりました。
## ディスカッション
- Telegram: [@KernelSU](https://t.me/KernelSU)
## ライセンス
- `kernel` ディレクトリの下にあるすべてのファイル: [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)。
- `kernel` ディレクトリ以外のすべてのファイル: [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html)。
## クレジット
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/):KernelSU のアイデア元。
- [Magisk](https://github.com/topjohnwu/Magisk):強力な root ツール。
- [genuine](https://github.com/brevent/genuine/):apk v2 の署名検証。
- [Diamorphine](https://github.com/m0nad/Diamorphine): rootkit のスキル。
================================================
FILE: docs/README_KR.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | **한국어** | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
안드로이드 기기에서 사용되는 커널 기반 루팅 솔루션입니다.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## 기능들
1. 커널 기반 `su` 및 루트 액세스 관리.
2. [metamodules](https://kernelsu.org/guide/metamodule.html) 기반 모듈 시스템: 플러그인 가능한 시스템리스 수정 인프라.
3. [App Profile](https://kernelsu.org/guide/app-profile.html): 루트 권한을 케이지에 가둡니다.
## 호환 상태
KernelSU는 공식적으로 안드로이드 GKI 2.0 디바이스(커널 5.10 이상)를 지원합니다. 오래된 커널(4.14 이상)도 사용할 수 있지만, 커널을 수동으로 빌드해야 합니다.
KernelSU는 WSA, ChromeOS, 컨테이너 기반 안드로이드 모두를 지원합니다.
현재는 `arm64-v8a`와 `x86_64`만 지원됩니다.
## 사용 방법
- [설치 방법](https://kernelsu.org/guide/installation.html)
- [어떻게 빌드하나요?](https://kernelsu.org/guide/how-to-build.html)
- [공식 웹사이트](https://kernelsu.org/)
## 번역
KernelSU 번역을 돕거나 기존 번역을 개선하려면 [Weblate](https://hosted.weblate.org/engage/kernelsu/)를 이용해 주세요. 매니저의 번역은 Weblate와 충돌할 수 있으므로 더 이상 허용되지 않습니다.
## 토론
- 텔레그램: [@KernelSU](https://t.me/KernelSU)
## 보안
KernelSU의 보안 취약점 보고에 대한 자세한 내용은 [SECURITY.md](/SECURITY.md)를 참조하세요.
## 저작권
- `kernel` 디렉터리 아래의 파일은 [GPL-2.0 전용](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)입니다.
- `kernel` 디렉토리를 제외한 다른 모든 부분은 [GPL-3.0-이상](https://www.gnu.org/licenses/gpl-3.0.html)입니다.
## 크래딧
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): KernelSU의 아이디어.
- [Magisk](https://github.com/topjohnwu/Magisk): 강력한 루팅 도구.
- [genuine](https://github.com/brevent/genuine/): apk v2 서명 유효성 검사.
- [Diamorphine](https://github.com/m0nad/Diamorphine): 일부 rootkit 스킬.
================================================
FILE: docs/README_PL.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | **Polski** | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Rozwiązanie root oparte na jądrze dla urządzeń z systemem Android.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Cechy
1. Oparte na jądrze `su` i zarządzanie dostępem roota.
2. System modułów oparty na [metamodules](https://kernelsu.org/guide/metamodule.html): Wtykowa infrastruktura dla modyfikacji systemless.
## Kompatybilność
KernelSU oficjalnie obsługuje urządzenia z Androidem GKI 2.0 (z jądrem 5.10+), starsze jądra (4.14+) są również kompatybilne, ale musisz sam skompilować jądro.
WSA i Android oparty na kontenerach również powinny działać ze zintegrowanym KernelSU.
Aktualnie obsługiwane ABI to : `arm64-v8a` i `x86_64`.
## Użycie
- [Instalacja](https://kernelsu.org/guide/installation.html)
- [Jak skompilować?](https://kernelsu.org/guide/how-to-build.html)
## Tłumaczenie
Aby pomóc w tłumaczeniu KernelSU lub ulepszyć istniejące tłumaczenia, użyj [Weblate](https://hosted.weblate.org/engage/kernelsu/). PR tłumaczenia Managera nie jest już akceptowany, ponieważ będzie kolidował z Weblate.
## Dyskusja
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Bezpieczeństwo
Informacje na temat zgłaszania luk w zabezpieczeniach w KernelSU można znaleźć w pliku [SECURITY.md](/SECURITY.md).
## Licencja
- Pliki w katalogu `kernel` są na licencji [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- Wszystkie inne części poza katalogiem `kernel` są na licencji [GPL-3-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Podziękowania
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): pomysłodawca KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): implementacja sepolicy.
- [genuine](https://github.com/brevent/genuine/): walidacja podpisu apk v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): cenna znajomość rootkitów.
================================================
FILE: docs/README_PT-BR.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | **Português (Brasil)** | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Uma solução root baseada em kernel para dispositivos Android.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Características
1. `su` e gerenciamento de acesso root baseado em kernel.
2. Sistema de módulos baseado em [metamodules](https://kernelsu.org/pt_BR/guide/metamodule.html): Infraestrutura plugável para modificações systemless.
3. [Perfil do Aplicativo](https://kernelsu.org/pt_BR/guide/app-profile.html): Tranque o poder root em uma gaiola.
## Estado de compatibilidade
O KernelSU oferece suporte oficial a dispositivos Android GKI 2.0 (kernel 5.10+). Kernels mais antigos (4.14+) também são compatíveis, mas será necessário construir o kernel manualmente.
Com isso, WSA, ChromeOS e Android baseado em contêiner são todos suportados.
Atualmente, apenas as arquiteturas `arm64-v8a` e `x86_64` são compatíveis.
## Uso
- [Instalação](https://kernelsu.org/pt_BR/guide/installation.html)
- [Como compilar](https://kernelsu.org/pt_BR/guide/how-to-build.html)
- [Site oficial](https://kernelsu.org/pt_BR/)
## Tradução
Para contribuir com a tradução do KernelSU ou aprimorar traduções existentes, por favor, use o [Weblate](https://hosted.weblate.org/engage/kernelsu/). PR para a tradução do Manager não são mais aceitas, pois podem entrar em conflito com o Weblate.
## Discussão
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Segurança
Para obter informações sobre como relatar vulnerabilidades de segurança do KernelSU, consulte [SECURITY.md](/SECURITY.md).
## Licença
- Os arquivos no diretório `kernel` são [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- Todas as outras partes, exceto o diretório `kernel` são [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Créditos
- [Kernel-Assisted Superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): A ideia do KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): A poderosa ferramenta root.
- [genuine](https://github.com/brevent/genuine/): Validação de assinatura APK v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): Algumas habilidades de rootkit.
================================================
FILE: docs/README_RU.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | **Русский** | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Решение на основе ядра root для Android-устройств.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Особенности
1. Управление `su` и root-доступом на основе ядра.
2. Система модулей на основе [metamodules](https://kernelsu.org/ru_RU/guide/metamodule.html): Подключаемая инфраструктура для безсистемных модификаций.
3. [Профиль приложений](https://kernelsu.org/ru_RU/guide/app-profile.html): Запри корневую силу в клетке.
## Совместимость
KernelSU официально поддерживает устройства на базе Android GKI 2.0 (с ядром 5.10+), старые ядра (4.14+) также совместимы, но для этого необходимо собрать ядро самостоятельно.
WSA и Android на основе контейнеров также должны работать с интегрированным KernelSU.
В настоящее время поддерживаются следующие ABI: `arm64-v8a` и `x86_64`.
## Использование
- [Установка](https://kernelsu.org/ru_RU/guide/installation.html)
- [Как собрать?](https://kernelsu.org/ru_RU/guide/how-to-build.html)
- [официальный сайт](https://kernelsu.org/ru_RU/)
## Обсуждение
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Лицензия
- Файлы в директории `kernel` [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- Все остальные части, кроме директории `kernel` [GPL-3-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Благодарности
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): идея KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): реализация sepolicy.
- [genuine](https://github.com/brevent/genuine/): проверка подписи apk v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): некоторые навыки руткита.
================================================
FILE: docs/README_TR.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | **Türkçe** | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Android cihazlar için kernel tabanlı root çözümü.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Özellikler
1. Kernel-tabanlı `su` ve root erişimi yönetimi.
2. [metamodules](https://kernelsu.org/guide/metamodule.html)'ye dayalı modül sistemi: Systemless modifikasyonlar için takılabilir altyapı.
3. [Uygulama profili](https://kernelsu.org/guide/app-profile.html): Root gücünü bir kafese kapatın.
## Uyumluluk Durumu
KernelSU resmi olarak Android GKI 2.0 cihazlarını (5.10+ kernelli) destekler, eski kernellerle de (4.14+) uyumludur, ancak kerneli kendinizin derlemeniz gerekir.
Bununla birlikte; WSA, ChromeOS ve konteyner tabanlı Android'in tamamı desteklenmektedir.
Şimdilik sadece `arm64-v8a` ve `x86_64` desteklenmektedir.
## Kullanım
- [Yükleme yönergeleri](https://kernelsu.org/guide/installation.html)
- [Nasıl derlenir?](https://kernelsu.org/guide/how-to-build.html)
- [Resmi WEB sitesi](https://kernelsu.org/)
## Çeviri
KernelSU'nun başka dillere çevrilmesine veya mevcut çevirilerin iyileştirilmesine yardımcı olmak için lütfen [Weblate](https://hosted.weblate.org/engage/kernelsu/) kullanın. Yönetici uygulamasının PR ile çevirisi, Weblate ile çakışacağından artık kabul edilmeyecektir.
## Tartışma
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Güvenlik
KernelSU'daki güvenlik açıklarını bildirme hakkında bilgi için, bkz [SECURITY.md](/SECURITY.md).
## Lisans
- `kernel` klasöründeki dosyalar [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) lisansı altındadır.
- `kernel` klasörü dışındaki bütün diğer bölümler [GPL-3-veya-sonraki](https://www.gnu.org/licenses/gpl-3.0.html) lisansı altındadır.
## Krediler
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): KernelSU fikri.
- [Magisk](https://github.com/topjohnwu/Magisk): güçlü root aracı.
- [genuine](https://github.com/brevent/genuine/): apk v2 imza doğrulaması.
- [Diamorphine](https://github.com/m0nad/Diamorphine): bazı rootkit becerileri.
================================================
FILE: docs/README_TW.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | **繁體中文** | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | [Tiếng Việt](README_VI.md) | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="標誌">
一套基於 Android 裝置核心的 Root 解決方案。
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## 特色功能
1. 以核心內 `su` 管理 Root 存取。
2. 以 [metamodules](https://kernelsu.org/zh_TW/guide/metamodule.html) 運作模組系統:可插拔的無系統修改基礎架構。
3. [App Profile](https://kernelsu.org/zh_TW/guide/app-profile.html):使 Root 掌握的生殺大權受制於此。
## 相容事態
理論上採以 Android GKI 2.0 的裝置(核心版本 5.10+),皆受 KernelSU 支援;採以老舊核心版本(4.14+)的裝置在手動建置核心後,亦受支援。
另可在 WSA、ChromeOS 一類的容器式 Android 中運作。
目前僅適用 `arm64-v8a` 以及 `x86_64` 架構。
## 使用手冊
- [安裝教學](https://kernelsu.org/zh_TW/guide/installation.html)
- [如何建置 KernelSU?](https://kernelsu.org/zh_TW/guide/how-to-build.html)
- [官方網站](https://kernelsu.org/zh_TW/)
## 多語翻譯
欲要協助 KernelSU 邁向多語化,抑或改進翻譯品質,請前往 [Weblate](https://hosted.weblate.org/engage/kernelsu/) 進行翻譯。為避免與 Weblate 上的翻譯發生衝突,現已不再受理翻譯相關的管理工具 PR。
## 綜合討論
- Telegram:[@KernelSU](https://t.me/KernelSU)
## 安全政策
欲要得知、回報 KernelSU 的安全性漏洞,請參閱 [SECURITY.md](/SECURITY.md)。
## 授權條款
- 位於 `kernel` 資料夾的檔案以[《GPL-2.0-only》](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)規範。
- 非位於 `kernel` 資料夾的其他檔案以[《GPL-3.0-or-later》](https://www.gnu.org/licenses/gpl-3.0.html)規範。
## 致謝名單
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/):KernelSU 的靈感來源。
- [Magisk](https://github.com/topjohnwu/Magisk):強而有力的 Root 工具。
- [genuine](https://github.com/brevent/genuine/):用於確效 Apk v2 簽章。
- [Diamorphine](https://github.com/m0nad/Diamorphine): 用於增進 Rootkit 技巧。
================================================
FILE: docs/README_VI.md
================================================
[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR.md) | [Polski](README_PL.md) | [Português (Brasil)](README_PT-BR.md) | [Türkçe](README_TR.md) | [Русский](README_RU.md) | **Tiếng Việt** | [Indonesia](README_ID.md) | [עברית](README_IW.md) | [हिंदी](README_IN.md) | [Italiano](README_IT.md)
# KernelSU
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
Giải pháp root thông qua thay đổi trên Kernel hệ điều hành cho các thiết bị Android.
[](https://github.com/tiann/KernelSU/releases/latest)
[](https://hosted.weblate.org/engage/kernelsu)
[](https://t.me/KernelSU)
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
[](/LICENSE)
## Tính năng
1. Hỗ trợ gói thực thi `su` và quản lý quyền root.
2. Hệ thống mô-đun thông qua [metamodules](https://kernelsu.org/vi_VN/guide/metamodule.html): Cơ sở hạ tầng có thể cắm cho các sửa đổi systemless.
3. [App Profile](https://kernelsu.org/guide/app-profile.html): Hạn chế quyền root của ứng dụng.
## Tình trạng tương thích
KernelSU chính thức hỗ trợ các thiết bị Android với kernel GKI 2.0 (phiên bản kernel 5.10+), các phiên bản kernel cũ hơn (4.14+) cũng tương thích, nhưng bạn cần phải tự biên dịch.
WSA, ChromeOS và Android dựa trên container(container-based) cũng được hỗ trợ bởi KernelSU.
Hiên tại Giao diện nhị phân của ứng dụng (ABI) được hỗ trợ bao gồm `arm64-v8a` và `x86_64`.
## Sử dụng
- [Hướng dẫn cài đặt](https://kernelsu.org/vi_VN/guide/installation.html)
- [Cách để build?](https://kernelsu.org/vi_VN/guide/how-to-build.html)
- [Website Chính Thức](https://kernelsu.org/vi_VN/)
## Hỗ trợ dịch
Nếu bạn muốn hỗ trợ dịch KernelSU sang một ngôn ngữ khác hoặc cải thiện các bản dịch trước, vui lòng sử dụng [Weblate](https://hosted.weblate.org/engage/kernelsu/).
## Thảo luận
- Telegram: [@KernelSU](https://t.me/KernelSU)
## Giấy phép
- Tất cả các file trong thư mục `kernel` dùng giấy phép [GPL-2-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
- Tất cả các thành phần khác ngoại trừ thư mục `kernel` dùng giấy phép [GPL-3-or-later](https://www.gnu.org/licenses/gpl-3.0.html).
## Lời cảm ơn
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): ý tưởng cho KernelSU.
- [Magisk](https://github.com/topjohnwu/Magisk): công cụ root mạnh mẽ.
- [genuine](https://github.com/brevent/genuine/): phương pháp xác thực apk v2.
- [Diamorphine](https://github.com/m0nad/Diamorphine): các phương pháp ẩn của rootkit.
================================================
FILE: fastlane/metadata/android/en-US/full_description.txt
================================================
<p><i>KernelSU</i> is a Kernel based root solution for Android devices. It features kernel-based <code>su</code> and root access management as well as a Module system based on overlayfs (similar to Magisk). <i>KernelSU</i> works whitelist-based: Only App that is granted root permission can access <code>su</code>, other apps cannot perceive <code>su</code>.</p><p><i>KernelSU</i> officially supports Android GKI 2.0 devices(with kernel 5.10+), old kernels(4.14+) is also compatiable, but you need to build kernel yourself. WSA and containter-based Android should also work with <i>KernelSU</i> integrated.</p><p>Current supported ABIs are: <code>arm64-v8a</code> and <code>x86_64</code>.</p>
================================================
FILE: fastlane/metadata/android/en-US/short_description.txt
================================================
Kernel based root solution for Android
================================================
FILE: js/README.md
================================================
# Library for KernelSU's module WebUI
## Install
```sh
yarn add kernelsu
```
## API
### exec
Spawns a **root** shell and runs a command within that shell, returning a Promise that resolves with the `stdout` and `stderr` outputs upon completion.
- `command` `<string>` The command to run, with space-separated arguments.
- `options` `<Object>`
- `cwd` - Current working directory of the child process.
- `env` - Environment key-value pairs.
```javascript
import { exec } from 'kernelsu';
const { errno, stdout, stderr } = await exec('ls -l', { cwd: '/tmp' });
if (errno === 0) {
// success
console.log(stdout);
}
```
### spawn
Spawns a new process using the given `command` in **root** shell, with command-line arguments in `args`. If omitted, `args` defaults to an empty array.
Returns a `ChildProcess` instance. Instances of `ChildProcess` represent spawned child processes.
- `command` `<string>` The command to run.
- `args` `<string[]>` List of string arguments.
- `options` `<Object>`:
- `cwd` `<string>` - Current working directory of the child process.
- `env` `<Object>` - Environment key-value pairs.
Example of running `ls -lh /data`, capturing `stdout`, `stderr`, and the exit code:
```javascript
import { spawn } from 'kernelsu';
const ls = spawn('ls', ['-lh', '/data']);
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
ls.on('exit', (code) => {
console.log(`child process exited with code ${code}`);
});
```
#### ChildProcess
##### Event 'exit'
- `code` `<number>` The exit code if the child process exited on its own.
The `'exit'` event is emitted when the child process ends. If the process exits, `code` contains the final exit code; otherwise, it is null.
##### Event 'error'
- `err` `<Error>` The error.
The `'error'` event is emitted whenever:
- The process could not be spawned.
- The process could not be killed.
##### `stdout`
A `Readable Stream` that represents the child process's `stdout`.
```javascript
const subprocess = spawn('ls');
subprocess.stdout.on('data', (data) => {
console.log(`Received chunk ${data}`);
});
```
#### `stderr`
A `Readable Stream` that represents the child process's `stderr`.
### fullScreen
Request the WebView enter/exit full screen.
```javascript
import { fullScreen } from 'kernelsu';
fullScreen(true);
```
### enableEdgeToEdge
Request the WebView to set padding to 0 or safeDrawing insets
- tips: this is disabled by default but if you request resource from `internal/insets.css`, this will be enabled automatically.
- To get insets value and enable this automatically, you can
- add `@import "https://mui.kernelsu.org/internal/insets.css";` in css OR
- add `<link rel="stylesheet" type="text/css" href="/internal/insets.css" />` in html.
```javascript
import { enableEdgeToEdge } from 'kernelsu';
enableEdgeToEdge(true);
```
### toast
Show a toast message.
```javascript
import { toast } from 'kernelsu';
toast('Hello, world!');
```
### moduleInfo
Get module info.
```javascript
import { moduleInfo } from 'kernelsu';
// print moduleId in console
console.log(moduleInfo());
```
### listPackages
List installed packages.
Returns an array of package names.
- `type` `<string>` The type of packages to list: "user", "system", or "all".
```javascript
import { listPackages } from 'kernelsu';
// list user packages
const packages = listPackages("user");
```
- tips: when `listPackages` api is available, you can use ksu://icon/{packageName} to get app icon.
``` javascript
img.src = "ksu://icon/" + packageName;
```
### getPackagesInfo
Get information for a list of packages.
Returns an array of `PackagesInfo` objects.
- `packages` `<string[]>` The list of package names.
```javascript
import { getPackagesInfo } from 'kernelsu';
const packages = getPackagesInfo(['com.android.settings', 'com.android.shell']);
```
#### PackagesInfo
An object contains:
- `packageName` `<string>` Package name of the application.
- `versionName` `<string>` Version of the application.
- `versionCode` `<number>` Version code of the application.
- `appLabel` `<string>` Display name of the application.
- `isSystem` `<boolean>` Whether the application is a system app.
- `uid` `<number>` UID of the application.
### exit
Exit the current WebUI activity.
```javascript
import { exit } from 'kernelsu';
exit();
```
================================================
FILE: js/index.d.ts
================================================
interface ExecOptions {
cwd?: string,
env?: { [key: string]: string }
}
interface ExecResults {
errno: number,
stdout: string,
stderr: string
}
declare function exec(command: string): Promise<ExecResults>;
declare function exec(command: string, options: ExecOptions): Promise<ExecResults>;
interface SpawnOptions {
cwd?: string,
env?: { [key: string]: string }
}
interface Stdio {
on(event: 'data', callback: (data: string) => void)
}
interface ChildProcess {
stdout: Stdio,
stderr: Stdio,
on(event: 'exit', callback: (code: number) => void)
on(event: 'error', callback: (err: any) => void)
}
declare function spawn(command: string): ChildProcess;
declare function spawn(command: string, args: string[]): ChildProcess;
declare function spawn(command: string, options: SpawnOptions): ChildProcess;
declare function spawn(command: string, args: string[], options: SpawnOptions): ChildProcess;
declare function fullScreen(isFullScreen: boolean);
declare function enableEdgeToEdge(enable: boolean);
declare function toast(message: string);
declare function moduleInfo(): string;
interface PackagesInfo {
packageName: string;
versionName: string;
versionCode: number;
appLabel: string;
isSystem: boolean;
uid: number;
}
declare function listPackages(type: string): string[];
declare function getPackagesInfo(packages: string[]): PackagesInfo[];
declare function exit();
export {
exec,
spawn,
fullScreen,
enableEdgeToEdge,
toast,
moduleInfo,
listPackages,
getPackagesInfo,
exit,
}
================================================
FILE: js/index.js
================================================
let callbackCounter = 0;
function getUniqueCallbackName(prefix) {
return `${prefix}_callback_${Date.now()}_${callbackCounter++}`;
}
export function exec(command, options) {
if (typeof options === "undefined") {
options = {};
}
return new Promise((resolve, reject) => {
// Generate a unique callback function name
const callbackFuncName = getUniqueCallbackName("exec");
// Define the success callback function
window[callbackFuncName] = (errno, stdout, stderr) => {
resolve({ errno, stdout, stderr });
cleanup(callbackFuncName);
};
function cleanup(successName) {
delete window[successName];
}
try {
ksu.exec(command, JSON.stringify(options), callbackFuncName);
} catch (error) {
reject(error);
cleanup(callbackFuncName);
}
});
}
function Stdio() {
this.listeners = {};
}
Stdio.prototype.on = function (event, listener) {
if (!this.listeners[event]) {
this.listeners[event] = [];
}
this.listeners[event].push(listener);
};
Stdio.prototype.emit = function (event, ...args) {
if (this.listeners[event]) {
this.listeners[event].forEach((listener) => listener(...args));
}
};
function ChildProcess() {
this.listeners = {};
this.stdin = new Stdio();
this.stdout = new Stdio();
this.stderr = new Stdio();
}
ChildProcess.prototype.on = function (event, listener) {
if (!this.listeners[event]) {
this.listeners[event] = [];
}
this.listeners[event].push(listener);
};
ChildProcess.prototype.emit = function (event, ...args) {
if (this.listeners[event]) {
this.listeners[event].forEach((listener) => listener(...args));
}
};
export function spawn(command, args, options) {
if (typeof args === "undefined") {
args = [];
} else if (!(args instanceof Array)) {
// allow for (command, options) signature
options = args;
}
if (typeof options === "undefined") {
options = {};
}
const child = new ChildProcess();
const childCallbackName = getUniqueCallbackName("spawn");
window[childCallbackName] = child;
function cleanup(name) {
delete window[name];
}
child.on("exit", code => {
cleanup(childCallbackName);
});
try {
ksu.spawn(
command,
JSON.stringify(args),
JSON.stringify(options),
childCallbackName
);
} catch (error) {
child.emit("error", error);
cleanup(childCallbackName);
}
return child;
}
export function fullScreen(isFullScreen) {
ksu.fullScreen(isFullScreen);
}
export function enableEdgeToEdge(enable) {
ksu.enableEdgeToEdge(enable);
}
export function toast(message) {
ksu.toast(message);
}
export function moduleInfo() {
return ksu.moduleInfo();
}
export function listPackages(type) {
try {
return JSON.parse(ksu.listPackages(type));
} catch (error) {
return [];
}
}
export function getPackagesInfo(packages) {
try {
if (typeof packages !== "string") {
packages = JSON.stringify(packages);
}
return JSON.parse(ksu.getPackagesInfo(packages));
} catch (error) {
return [];
}
}
export function exit() {
ksu.exit();
}
================================================
FILE: js/package.json
================================================
{
"name": "kernelsu",
"version": "3.0.2",
"description": "Library for KernelSU's module WebUI",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "npm run test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tiann/KernelSU.git"
},
"keywords": [
"su",
"kernelsu",
"module",
"webui"
],
"author": "weishu",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/tiann/KernelSU/issues"
},
"homepage": "https://github.com/tiann/KernelSU#readme"
}
================================================
FILE: justfile
================================================
alias bk := build_ksud
alias bm := build_manager
build_ksud:
cross build --target aarch64-linux-android --release --manifest-path ./userspace/ksud/Cargo.toml
build_manager: build_ksud
cp userspace/ksud/target/aarch64-linux-android/release/ksud manager/app/src/main/jniLibs/arm64-v8a/libksud.so
cd manager && ./gradlew aDebug
clippy:
cargo fmt --manifest-path ./userspace/ksud/Cargo.toml
cross clippy --target x86_64-pc-windows-gnu --release --manifest-path ./userspace/ksud/Cargo.toml
cross clippy --target aarch64-linux-android --release --manifest-path ./userspace/ksud/Cargo.toml
================================================
FILE: kernel/.clang-format
================================================
# SPDX-License-Identifier: GPL-2.0
#
# clang-format configuration file. Intended for clang-format >= 4.
#
# For more information, see:
#
# Documentation/process/clang-format.rst
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
#AfterExternBlock: false # Unknown to clang-format-5.0
BeforeCatch: false
BeforeElse: false
IndentBraces: false
#SplitEmptyFunction: true # Unknown to clang-format-4.0
#SplitEmptyRecord: true # Unknown to clang-format-4.0
#SplitEmptyNamespace: true # Unknown to clang-format-4.0
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
#CompactNamespaces: false # Unknown to clang-format-4.0
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
#FixNamespaceComments: false # Unknown to clang-format-4.0
# Taken from:
# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ \
# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
# | sort | uniq
ForEachMacros:
- 'apei_estatus_for_each_section'
- 'ata_for_each_dev'
- 'ata_for_each_link'
- '__ata_qc_for_each'
- 'ata_qc_for_each'
- 'ata_qc_for_each_raw'
- 'ata_qc_for_each_with_internal'
- 'ax25_for_each'
- 'ax25_uid_for_each'
- '__bio_for_each_bvec'
- 'bio_for_each_bvec'
- 'bio_for_each_bvec_all'
- 'bio_for_each_integrity_vec'
- '__bio_for_each_segment'
- 'bio_for_each_segment'
- 'bio_for_each_segment_all'
- 'bio_list_for_each'
- 'bip_for_each_vec'
- 'bitmap_for_each_clear_region'
- 'bitmap_for_each_set_region'
- 'blkg_for_each_descendant_post'
- 'blkg_for_each_descendant_pre'
- 'blk_queue_for_each_rl'
- 'bond_for_each_slave'
- 'bond_for_each_slave_rcu'
- 'bpf_for_each_spilled_reg'
- 'btree_for_each_safe128'
- 'btree_for_each_safe32'
- 'btree_for_each_safe64'
- 'btree_for_each_safel'
- 'card_for_each_dev'
- 'cgroup_taskset_for_each'
- 'cgroup_taskset_for_each_leader'
- 'cpufreq_for_each_entry'
- 'cpufreq_for_each_entry_idx'
- 'cpufreq_for_each_valid_entry'
- 'cpufreq_for_each_valid_entry_idx'
- 'css_for_each_child'
- 'css_for_each_descendant_post'
- 'css_for_each_descendant_pre'
- 'device_for_each_child_node'
- 'dma_fence_chain_for_each'
- 'do_for_each_ftrace_op'
- 'drm_atomic_crtc_for_each_plane'
- 'drm_atomic_crtc_state_for_each_plane'
- 'drm_atomic_crtc_state_for_each_plane_state'
- 'drm_atomic_for_each_plane_damage'
- 'drm_client_for_each_connector_iter'
- 'drm_client_for_each_modeset'
- 'drm_connector_for_each_possible_encoder'
- 'drm_for_each_bridge_in_chain'
- 'drm_for_each_connector_iter'
- 'drm_for_each_crtc'
- 'drm_for_each_encoder'
- 'drm_for_each_encoder_mask'
- 'drm_for_each_fb'
- 'drm_for_each_legacy_plane'
- 'drm_for_each_plane'
- 'drm_for_each_plane_mask'
- 'drm_for_each_privobj'
- 'drm_mm_for_each_hole'
- 'drm_mm_for_each_node'
- 'drm_mm_for_each_node_in_range'
- 'drm_mm_for_each_node_safe'
- 'flow_action_for_each'
- 'for_each_active_dev_scope'
- 'for_each_active_drhd_unit'
- 'for_each_active_iommu'
- 'for_each_aggr_pgid'
- 'for_each_available_child_of_node'
- 'for_each_bio'
- 'for_each_board_func_rsrc'
- 'for_each_bvec'
- 'for_each_card_auxs'
- 'for_each_card_auxs_safe'
- 'for_each_card_components'
- 'for_each_card_dapms'
- 'for_each_card_pre_auxs'
- 'for_each_card_prelinks'
- 'for_each_card_rtds'
- 'for_each_card_rtds_safe'
- 'for_each_card_widgets'
- 'for_each_card_widgets_safe'
- 'for_each_cgroup_storage_type'
- 'for_each_child_of_node'
- 'for_each_clear_bit'
- 'for_each_clear_bit_from'
- 'for_each_cmsghdr'
- 'for_each_compatible_node'
- 'for_each_component_dais'
- 'for_each_component_dais_safe'
- 'for_each_comp_order'
- 'for_each_console'
- 'for_each_cpu'
- 'for_each_cpu_and'
- 'for_each_cpu_not'
- 'for_each_cpu_wrap'
- 'for_each_dapm_widgets'
- 'for_each_dev_addr'
- 'for_each_dev_scope'
- 'for_each_displayid_db'
- 'for_each_dma_cap_mask'
- 'for_each_dpcm_be'
- 'for_each_dpcm_be_rollback'
- 'for_each_dpcm_be_safe'
- 'for_each_dpcm_fe'
- 'for_each_drhd_unit'
- 'for_each_dss_dev'
- 'for_each_efi_memory_desc'
- 'for_each_efi_memory_desc_in_map'
- 'for_each_element'
- 'for_each_element_extid'
- 'for_each_element_id'
- 'for_each_endpoint_of_node'
- 'for_each_evictable_lru'
- 'for_each_fib6_node_rt_rcu'
- 'for_each_fib6_walker_rt'
- 'for_each_free_mem_pfn_range_in_zone'
- 'for_each_free_mem_pfn_range_in_zone_from'
- 'for_each_free_mem_range'
- 'for_each_free_mem_range_reverse'
- 'for_each_func_rsrc'
- 'for_each_hstate'
- 'for_each_if'
- 'for_each_iommu'
- 'for_each_ip_tunnel_rcu'
- 'for_each_irq_nr'
- 'for_each_link_codecs'
- 'for_each_link_cpus'
- 'for_each_link_platforms'
- 'for_each_lru'
- 'for_each_matching_node'
- 'for_each_matching_node_and_match'
- 'for_each_member'
- 'for_each_mem_region'
- 'for_each_memblock_type'
- 'for_each_memcg_cache_index'
- 'for_each_mem_pfn_range'
- '__for_each_mem_range'
- 'for_each_mem_range'
- '__for_each_mem_range_rev'
- 'for_each_mem_range_rev'
- 'for_each_migratetype_order'
- 'for_each_msi_entry'
- 'for_each_msi_entry_safe'
- 'for_each_net'
- 'for_each_net_continue_reverse'
- 'for_each_netdev'
- 'for_each_netdev_continue'
- 'for_each_netdev_continue_rcu'
- 'for_each_netdev_continue_reverse'
- 'for_each_netdev_feature'
- 'for_each_netdev_in_bond_rcu'
- 'for_each_netdev_rcu'
- 'for_each_netdev_reverse'
- 'for_each_netdev_safe'
- 'for_each_net_rcu'
- 'for_each_new_connector_in_state'
- 'for_each_new_crtc_in_state'
- 'for_each_new_mst_mgr_in_state'
- 'for_each_new_plane_in_state'
- 'for_each_new_private_obj_in_state'
- 'for_each_node'
- 'for_each_node_by_name'
- 'for_each_node_by_type'
- 'for_each_node_mask'
- 'for_each_node_state'
- 'for_each_node_with_cpus'
- 'for_each_node_with_property'
- 'for_each_nonreserved_multicast_dest_pgid'
- 'for_each_of_allnodes'
- 'for_each_of_allnodes_from'
- 'for_each_of_cpu_node'
- 'for_each_of_pci_range'
- 'for_each_old_connector_in_state'
- 'for_each_old_crtc_in_state'
- 'for_each_old_mst_mgr_in_state'
- 'for_each_oldnew_connector_in_state'
- 'for_each_oldnew_crtc_in_state'
- 'for_each_oldnew_mst_mgr_in_state'
- 'for_each_oldnew_plane_in_state'
- 'for_each_oldnew_plane_in_state_reverse'
- 'for_each_oldnew_private_obj_in_state'
- 'for_each_old_plane_in_state'
- 'for_each_old_private_obj_in_state'
- 'for_each_online_cpu'
- 'for_each_online_node'
- 'for_each_online_pgdat'
- 'for_each_pci_bridge'
- 'for_each_pci_dev'
- 'for_each_pci_msi_entry'
- 'for_each_pcm_streams'
- 'for_each_physmem_range'
- 'for_each_populated_zone'
- 'for_each_possible_cpu'
- 'for_each_present_cpu'
- 'for_each_prime_number'
- 'for_each_prime_number_from'
- 'for_each_process'
- 'for_each_process_thread'
- 'for_each_property_of_node'
- 'for_each_registered_fb'
- 'for_each_requested_gpio'
- 'for_each_requested_gpio_in_range'
- 'for_each_reserved_mem_range'
- 'for_each_reserved_mem_region'
- 'for_each_rtd_codec_dais'
- 'for_each_rtd_codec_dais_rollback'
- 'for_each_rtd_components'
- 'for_each_rtd_cpu_dais'
- 'for_each_rtd_cpu_dais_rollback'
- 'for_each_rtd_dais'
- 'for_each_set_bit'
- 'for_each_set_bit_from'
- 'for_each_set_clump8'
- 'for_each_sg'
- 'for_each_sg_dma_page'
- 'for_each_sg_page'
- 'for_each_sgtable_dma_page'
- 'for_each_sgtable_dma_sg'
- 'for_each_sgtable_page'
- 'for_each_sgtable_sg'
- 'for_each_sibling_event'
- 'for_each_subelement'
- 'for_each_subelement_extid'
- 'for_each_subelement_id'
- '__for_each_thread'
- 'for_each_thread'
- 'for_each_unicast_dest_pgid'
- 'for_each_wakeup_source'
- 'for_each_zone'
- 'for_each_zone_zonelist'
- 'for_each_zone_zonelist_nodemask'
- 'fwnode_for_each_available_child_node'
- 'fwnode_for_each_child_node'
- 'fwnode_graph_for_each_endpoint'
- 'gadget_for_each_ep'
- 'genradix_for_each'
- 'genradix_for_each_from'
- 'hash_for_each'
- 'hash_for_each_possible'
- 'hash_for_each_possible_rcu'
- 'hash_for_each_possible_rcu_notrace'
- 'hash_for_each_possible_safe'
- 'hash_for_each_rcu'
- 'hash_for_each_safe'
- 'hctx_for_each_ctx'
- 'hlist_bl_for_each_entry'
- 'hlist_bl_for_each_entry_rcu'
- 'hlist_bl_for_each_entry_safe'
- 'hlist_for_each'
- 'hlist_for_each_entry'
- 'hlist_for_each_entry_continue'
- 'hlist_for_each_entry_continue_rcu'
- 'hlist_for_each_entry_continue_rcu_bh'
- 'hlist_for_each_entry_from'
- 'hlist_for_each_entry_from_rcu'
- 'hlist_for_each_entry_rcu'
- 'hlist_for_each_entry_rcu_bh'
- 'hlist_for_each_entry_rcu_notrace'
- 'hlist_for_each_entry_safe'
- '__hlist_for_each_rcu'
- 'hlist_for_each_safe'
- 'hlist_nulls_for_each_entry'
- 'hlist_nulls_for_each_entry_from'
- 'hlist_nulls_for_each_entry_rcu'
- 'hlist_nulls_for_each_entry_safe'
- 'i3c_bus_for_each_i2cdev'
- 'i3c_bus_for_each_i3cdev'
- 'ide_host_for_each_port'
- 'ide_port_for_each_dev'
- 'ide_port_for_each_present_dev'
- 'idr_for_each_entry'
- 'idr_for_each_entry_continue'
- 'idr_for_each_entry_continue_ul'
- 'idr_for_each_entry_ul'
- 'in_dev_for_each_ifa_rcu'
- 'in_dev_for_each_ifa_rtnl'
- 'inet_bind_bucket_for_each'
- 'inet_lhash2_for_each_icsk_rcu'
- 'key_for_each'
- 'key_for_each_safe'
- 'klp_for_each_func'
- 'klp_for_each_func_safe'
- 'klp_for_each_func_static'
- 'klp_for_each_object'
- 'klp_for_each_object_safe'
- 'klp_for_each_object_static'
- 'kunit_suite_for_each_test_case'
- 'kvm_for_each_memslot'
- 'kvm_for_each_vcpu'
- 'list_for_each'
- 'list_for_each_codec'
- 'list_for_each_codec_safe'
- 'list_for_each_continue'
- 'list_for_each_entry'
- 'list_for_each_entry_continue'
- 'list_for_each_entry_continue_rcu'
- 'list_for_each_entry_continue_reverse'
- 'list_for_each_entry_from'
- 'list_for_each_entry_from_rcu'
- 'list_for_each_entry_from_reverse'
- 'list_for_each_entry_lockless'
- 'list_for_each_entry_rcu'
- 'list_for_each_entry_reverse'
- 'list_for_each_entry_safe'
- 'list_for_each_entry_safe_continue'
- 'list_for_each_entry_safe_from'
- 'list_for_each_entry_safe_reverse'
- 'list_for_each_prev'
- 'list_for_each_prev_safe'
- 'list_for_each_safe'
- 'llist_for_each'
- 'llist_for_each_entry'
- 'llist_for_each_entry_safe'
- 'llist_for_each_safe'
- 'mci_for_each_dimm'
- 'media_device_for_each_entity'
- 'media_device_for_each_intf'
- 'media_device_for_each_link'
- 'media_device_for_each_pad'
- 'nanddev_io_for_each_page'
- 'netdev_for_each_lower_dev'
- 'netdev_for_each_lower_private'
- 'netdev_for_each_lower_private_rcu'
- 'netdev_for_each_mc_addr'
- 'netdev_for_each_uc_addr'
- 'netdev_for_each_upper_dev_rcu'
- 'netdev_hw_addr_list_for_each'
- 'nft_rule_for_each_expr'
- 'nla_for_each_attr'
- 'nla_for_each_nested'
- 'nlmsg_for_each_attr'
- 'nlmsg_for_each_msg'
- 'nr_neigh_for_each'
- 'nr_neigh_for_each_safe'
- 'nr_node_for_each'
- 'nr_node_for_each_safe'
- 'of_for_each_phandle'
- 'of_property_for_each_string'
- 'of_property_for_each_u32'
- 'pci_bus_for_each_resource'
- 'pcm_for_each_format'
- 'ping_portaddr_for_each_entry'
- 'plist_for_each'
- 'plist_for_each_continue'
- 'plist_for_each_entry'
- 'plist_for_each_entry_continue'
- 'plist_for_each_entry_safe'
- 'plist_for_each_safe'
- 'pnp_for_each_card'
- 'pnp_for_each_dev'
- 'protocol_for_each_card'
- 'protocol_for_each_dev'
- 'queue_for_each_hw_ctx'
- 'radix_tree_for_each_slot'
- 'radix_tree_for_each_tagged'
- 'rbtree_postorder_for_each_entry_safe'
- 'rdma_for_each_block'
- 'rdma_for_each_port'
- 'rdma_umem_for_each_dma_block'
- 'resource_list_for_each_entry'
- 'resource_list_for_each_entry_safe'
- 'rhl_for_each_entry_rcu'
- 'rhl_for_each_rcu'
- 'rht_for_each'
- 'rht_for_each_entry'
- 'rht_for_each_entry_from'
- 'rht_for_each_entry_rcu'
- 'rht_for_each_entry_rcu_from'
- 'rht_for_each_entry_safe'
- 'rht_for_each_from'
- 'rht_for_each_rcu'
- 'rht_for_each_rcu_from'
- '__rq_for_each_bio'
- 'rq_for_each_bvec'
- 'rq_for_each_segment'
- 'scsi_for_each_prot_sg'
- 'scsi_for_each_sg'
- 'sctp_for_each_hentry'
- 'sctp_skb_for_each'
- 'shdma_for_each_chan'
- '__shost_for_each_device'
- 'shost_for_each_device'
- 'sk_for_each'
- 'sk_for_each_bound'
- 'sk_for_each_entry_offset_rcu'
- 'sk_for_each_from'
- 'sk_for_each_rcu'
- 'sk_for_each_safe'
- 'sk_nulls_for_each'
- 'sk_nulls_for_each_from'
- 'sk_nulls_for_each_rcu'
- 'snd_array_for_each'
- 'snd_pcm_group_for_each_entry'
- 'snd_soc_dapm_widget_for_each_path'
- 'snd_soc_dapm_widget_for_each_path_safe'
- 'snd_soc_dapm_widget_for_each_sink_path'
- 'snd_soc_dapm_widget_for_each_source_path'
- 'tb_property_for_each'
- 'tcf_exts_for_each_action'
- 'udp_portaddr_for_each_entry'
- 'udp_portaddr_for_each_entry_rcu'
- 'usb_hub_for_each_child'
- 'v4l2_device_for_each_subdev'
- 'v4l2_m2m_for_each_dst_buf'
- 'v4l2_m2m_for_each_dst_buf_safe'
- 'v4l2_m2m_for_each_src_buf'
- 'v4l2_m2m_for_each_src_buf_safe'
- 'virtio_device_for_each_vq'
- 'while_for_each_ftrace_op'
- 'xa_for_each'
- 'xa_for_each_marked'
- 'xa_for_each_range'
- 'xa_for_each_start'
- 'xas_for_each'
- 'xas_for_each_conflict'
- 'xas_for_each_marked'
- 'xbc_array_for_each_value'
- 'xbc_for_each_key_value'
- 'xbc_node_for_each_array_value'
- 'xbc_node_for_each_child'
- 'xbc_node_for_each_key_value'
- 'zorro_for_each_dev'
#IncludeBlocks: Preserve # Unknown to clang-format-5.0
IncludeCategories:
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
#IndentPPDirectives: None # Unknown to clang-format-5.0
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
# Taken from git's rules
#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
#SortUsingDeclarations: false # Unknown to clang-format-4.0
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 4
UseTab: Never
...
================================================
FILE: kernel/.clangd
================================================
Diagnostics:
UnusedIncludes: Strict
ClangTidy:
Remove: bugprone-sizeof-expression
================================================
FILE: kernel/.gitignore
================================================
.cache/
.thinlto-cache/
compile_commands.json
*.ko
*.o
*.mod
*.lds
*.mod.o
.*.o*
.*.mod*
*.ko*
*.mod.c
*.symvers*
*.order
.*.ko.cmd
.tmp_versions/
libs/
obj/
CLAUDE.md
.ddk-version
.vscode/settings.json
check_symbol
================================================
FILE: kernel/Kbuild
================================================
kernelsu-objs := ksu.o
kernelsu-objs += allowlist.o
kernelsu-objs += app_profile.o
kernelsu-objs += apk_sign.o
kernelsu-objs += sucompat.o
kernelsu-objs += syscall_hook_manager.o
kernelsu-objs += throne_tracker.o
kernelsu-objs += pkg_observer.o
kernelsu-objs += setuid_hook.o
kernelsu-objs += kernel_umount.o
kernelsu-objs += supercalls.o
kernelsu-objs += su_mount_ns.o
kernelsu-objs += feature.o
kernelsu-objs += ksud.o
kernelsu-objs += seccomp_cache.o
kernelsu-objs += file_wrapper.o
kernelsu-objs += util.o
kernelsu-objs += selinux/selinux.o
kernelsu-objs += selinux/sepolicy.o
kernelsu-objs += selinux/rules.o
ccflags-y += -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
ccflags-y += -I$(objtree)/security/selinux -include $(srctree)/include/uapi/asm-generic/errno.h
obj-$(CONFIG_KSU) += kernelsu.o
MDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Workaround bazel
# https://github.com/tiann/KernelSU/pull/316#issuecomment-1479043219
GIT := $(shell PATH="$$PATH":/usr/bin:/usr/local/bin which git)
ifneq ($(GIT),)
# Check if this is a git repository
# Try to detect Git repo intelligently
GIT_ROOT := $(shell cd $(MDIR) && $(GIT) rev-parse --show-toplevel 2>/dev/null)
ifneq ($(GIT_ROOT),)
KERNEL_GIT_ROOT := $(shell cd $(srctree) && $(GIT) rev-parse --show-toplevel 2>/dev/null)
ifneq ($(GIT_ROOT),$(KERNEL_GIT_ROOT))
# Only set version if it's a different repo from kernel
$(shell cd $(GIT_ROOT) && [ -f .git/shallow ] && $(GIT) fetch --unshallow 2>/dev/null || true)
KSU_GIT_VERSION := $(shell cd $(GIT_ROOT) && $(GIT) rev-list --count HEAD 2>/dev/null)
KSU_GIT_VERSION_VALID := 1
$(info -- KernelSU: Git repo detected at $(GIT_ROOT))
endif
endif
else
$(warning -- KernelSU: Git not detected, make sure git is installed in your PATH!)
endif
# Calculate version if git version is available
ifdef KSU_GIT_VERSION_VALID
# ksu_version: major * 10000 + git version + 200 for historical reasons
$(eval KSU_VERSION=$(shell expr 30000 + $(KSU_GIT_VERSION)))
$(info -- KernelSU version: $(KSU_VERSION))
ccflags-y += -DKSU_VERSION=$(KSU_VERSION)
else
# If there is no .git directory, use default version
$(warning "KSU_GIT_VERSION not defined! It is better to make KernelSU a git repository!")
ccflags-y += -DKSU_VERSION=16
endif
ifndef KSU_EXPECTED_SIZE
KSU_EXPECTED_SIZE := 0x033b
endif
ifndef KSU_EXPECTED_HASH
KSU_EXPECTED_HASH := c371061b19d8c7d7d6133c6a9bafe198fa944e50c1b31c9d8daa8d7f1fc2d2d6
endif
ifdef KSU_MANAGER_PACKAGE
ccflags-y += -DKSU_MANAGER_PACKAGE=\"$(KSU_MANAGER_PACKAGE)\"
$(info -- KernelSU Manager package name: $(KSU_MANAGER_PACKAGE))
endif
$(info -- KernelSU Manager signature size: $(KSU_EXPECTED_SIZE))
$(info -- KernelSU Manager signature hash: $(KSU_EXPECTED_HASH))
ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE)
ccflags-y += -DEXPECTED_HASH=\"$(KSU_EXPECTED_HASH)\"
ifdef KSU_EXPECTED_SIZE2
ifndef KSU_EXPECTED_HASH2
$(error KSU_EXPECTED_HASH2 must be set when KSU_EXPECTED_SIZE2 is set)
endif
ccflags-y += -DEXPECTED_SIZE2=$(KSU_EXPECTED_SIZE2)
ccflags-y += -DEXPECTED_HASH2=\"$(KSU_EXPECTED_HASH2)\"
$(info -- KernelSU Manager signature size2: $(KSU_EXPECTED_SIZE2))
$(info -- KernelSU Manager signature hash2: $(KSU_EXPECTED_HASH2))
endif
ccflags-y += -Wno-strict-prototypes -Wno-int-conversion -Wno-gcc-compat -Wno-missing-prototypes
ccflags-y += -Wno-declaration-after-statement -Wno-unused-function
# Keep a new line here!! Because someone may append config
================================================
FILE: kernel/Kconfig
================================================
menu "KernelSU"
config KSU
tristate "KernelSU function support"
depends on KPROBES && EXT4_FS
default y
help
Enable kernel-level root privileges on Android System.
Requires CONFIG_KPROBES for kernel hooking support.
Requires CONFIG_EXT4_FS for `ext4_unregister_sysfs`.
To compile as a module, choose M here: the
module will be called kernelsu.
config KSU_DEBUG
bool "KernelSU debug mode"
depends on KSU
default n
help
Enable KernelSU debug mode.
endmenu
================================================
FILE: kernel/LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: kernel/Makefile
================================================
KDIR := $(KDIR)
MDIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
$(info -- KDIR: $(KDIR))
$(info -- MDIR: $(MDIR))
.PHONY: all compdb clean format check-format
all: check_symbol
make -C $(KDIR) M=$(MDIR) modules
./check_symbol kernelsu.ko $(KDIR)/vmlinux
compdb:
python3 $(MDIR)/.vscode/generate_compdb.py -O $(KDIR) $(MDIR)
clean:
make -C $(KDIR) M=$(MDIR) clean
rm check_symbol
check_symbol: tools/check_symbol.c
$(CC) tools/check_symbol.c -o check_symbol
format:
find . \( -name "*.c" -o -name "*.h" \) -print0 | xargs -0 clang-format -i
check-format:
find . \( -name "*.c" -o -name "*.h" \) -print0 | xargs -0 clang-format --dry-run --Werror
# Keep a new line here!! Because someone may append config
================================================
FILE: kernel/allowlist.c
================================================
#include <linux/rcupdate.h>
#include <linux/limits.h>
#include <linux/rculist.h>
#include <linux/mutex.h>
#include <linux/task_work.h>
#include <linux/capability.h>
#include <linux/compiler.h>
#include <linux/fs.h>
#include <linux/gfp.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/version.h>
#include <linux/compiler_types.h>
#include "klog.h" // IWYU pragma: keep
#include "ksu.h"
#include "ksud.h"
#include "selinux/selinux.h"
#include "allowlist.h"
#include "manager.h"
#include "su_mount_ns.h"
#define FILE_MAGIC 0x7f4b5355 // ' KSU', u32
#define FILE_FORMAT_VERSION 3 // u32
#define KSU_APP_PROFILE_PRESERVE_UID 9999 // NOBODY_UID
#define KSU_DEFAULT_SELINUX_DOMAIN "u:r:" KERNEL_SU_DOMAIN ":s0"
static DEFINE_MUTEX(allowlist_mutex);
// default profiles, these may be used frequently, so we cache it
static struct root_profile default_root_profile;
static struct non_root_profile default_non_root_profile;
static int allow_list_arr[PAGE_SIZE / sizeof(int)] __read_mostly
__aligned(PAGE_SIZE);
static int allow_list_pointer __read_mostly = 0;
static void remove_uid_from_arr(uid_t uid)
{
int i;
for (i = 0; i < allow_list_pointer; i++) {
if (allow_list_arr[i] == uid) {
int remaining = allow_list_pointer - 1 - i;
if (remaining > 0) {
memmove(&allow_list_arr[i], &allow_list_arr[i + 1],
remaining * sizeof(allow_list_arr[0]));
}
allow_list_pointer--;
allow_list_arr[allow_list_pointer] = -1;
return;
}
}
}
static void init_default_profiles()
{
kernel_cap_t full_cap = CAP_FULL_SET;
default_root_profile.uid = 0;
default_root_profile.gid = 0;
default_root_profile.groups_count = 1;
default_root_profile.groups[0] = 0;
memcpy(&default_root_profile.capabilities.effective, &full_cap,
sizeof(default_root_profile.capabilities.effective));
default_root_profile.namespaces = KSU_NS_INHERITED;
strcpy(default_root_profile.selinux_domain, KSU_DEFAULT_SELINUX_DOMAIN);
// This means that we will umount modules by default!
default_non_root_profile.umount_modules = true;
}
struct perm_data {
struct list_head list;
struct rcu_head rcu;
struct app_profile profile;
};
static struct list_head allow_list;
static uint8_t allow_list_bitmap[PAGE_SIZE] __read_mostly __aligned(PAGE_SIZE);
#define BITMAP_UID_MAX ((sizeof(allow_list_bitmap) * BITS_PER_BYTE) - 1)
#define KERNEL_SU_ALLOWLIST "/data/adb/ksu/.allowlist"
void ksu_persistent_allow_list(void);
void ksu_show_allow_list(void)
{
struct perm_data *p = NULL;
pr_info("ksu_show_allow_list\n");
rcu_read_lock();
list_for_each_entry_rcu (p, &allow_list, list) {
pr_info("uid :%d, allow: %d\n", p->profile.current_uid,
p->profile.allow_su);
}
rcu_read_unlock();
}
bool ksu_get_app_profile(struct app_profile *profile)
{
struct perm_data *p = NULL;
bool found = false;
rcu_read_lock();
list_for_each_entry_rcu (p, &allow_list, list) {
bool uid_match = profile->current_uid == p->profile.current_uid;
if (uid_match) {
// found it, override it with ours
memcpy(profile, &p->profile, sizeof(*profile));
found = true;
goto exit;
}
}
exit:
rcu_read_unlock();
return found;
}
static inline bool forbid_system_uid(uid_t uid)
{
#define SHELL_UID 2000
#define SYSTEM_UID 1000
return uid < SHELL_UID && uid != SYSTEM_UID;
}
static bool profile_valid(struct app_profile *profile)
{
if (!profile) {
return false;
}
if (profile->version < KSU_APP_PROFILE_VER) {
pr_info("Unsupported profile version: %d\n", profile->version);
return false;
}
if (profile->allow_su) {
if (profile->rp_config.profile.groups_count > KSU_MAX_GROUPS) {
return false;
}
if (strlen(profile->rp_config.profile.selinux_domain) == 0) {
return false;
}
}
return true;
}
int ksu_set_app_profile(struct app_profile *profile)
{
struct perm_data *p = NULL, *np;
int result = 0;
u16 count = 0;
if (!profile_valid(profile)) {
pr_err("Failed to set app profile: invalid profile!\n");
return -EINVAL;
}
mutex_lock(&allowlist_mutex);
list_for_each_entry (p, &allow_list, list) {
++count;
// both uid and package must match, otherwise it will break multiple package with different user id
if (profile->current_uid == p->profile.current_uid &&
!strcmp(profile->key, p->profile.key)) {
// found it, just override it all!
np = (struct perm_data *)kzalloc(sizeof(struct perm_data),
GFP_KERNEL);
if (!np) {
result = -ENOMEM;
goto out_unlock;
}
memcpy(&np->profile, profile, sizeof(*profile));
list_replace_rcu(&p->list, &np->list);
kfree_rcu(p, rcu);
goto out;
}
}
if (unlikely(count == U16_MAX)) {
pr_err("too many app profile\n");
result = -E2BIG;
goto out_unlock;
}
// not found, alloc a new node!
p = (struct perm_data *)kzalloc(sizeof(struct perm_data), GFP_KERNEL);
if (!p) {
pr_err("ksu_set_app_profile alloc failed\n");
result = -ENOMEM;
goto out_unlock;
}
memcpy(&p->profile, profile, sizeof(*profile));
if (profile->allow_su) {
pr_info("set root profile, key: %s, uid: %d, gid: %d, context: %s\n",
profile->key, profile->current_uid,
profile->rp_config.profile.gid,
profile->rp_config.profile.selinux_domain);
} else {
pr_info("set app profile, key: %s, uid: %d, umount modules: %d\n",
profile->key, profile->current_uid,
profile->nrp_config.profile.umount_modules);
}
list_add_tail_rcu(&p->list, &allow_list);
out:
result = 0;
// check if the default profiles is changed, cache it to a single struct to accelerate access.
if (unlikely(!strcmp(profile->key, "$"))) {
// set default non root profile
memcpy(&default_non_root_profile, &profile->nrp_config.profile,
sizeof(default_non_root_profile));
} else if (unlikely(!strcmp(profile->key, "#"))) {
// set default root profile
// TODO: Do we really need this?
memcpy(&default_root_profile, &profile->rp_config.profile,
sizeof(default_root_profile));
} else if (profile->current_uid <= BITMAP_UID_MAX) {
if (profile->allow_su)
allow_list_bitmap[profile->current_uid / BITS_PER_BYTE] |=
1 << (profile->current_uid % BITS_PER_BYTE);
else
allow_list_bitmap[profile->current_uid / BITS_PER_BYTE] &=
~(1 << (profile->current_uid % BITS_PER_BYTE));
} else {
if (profile->allow_su) {
/*
* 1024 apps with uid higher than BITMAP_UID_MAX
* registered to request superuser?
*/
if (allow_list_pointer >= ARRAY_SIZE(allow_list_arr)) {
pr_err("too many apps registered\n");
WARN_ON(1);
} else {
allow_list_arr[allow_list_pointer++] = profile->current_uid;
}
} else {
remove_uid_from_arr(profile->current_uid);
}
}
out_unlock:
mutex_unlock(&allowlist_mutex);
return result;
}
bool __ksu_is_allow_uid(uid_t uid)
{
int i;
if (forbid_system_uid(uid)) {
// do not bother going through the list if it's system
return false;
}
if (likely(ksu_is_manager_appid_valid()) &&
unlikely(ksu_get_manager_appid() == uid % PER_USER_RANGE)) {
// manager is always allowed!
return true;
}
if (unlikely(allow_shell) && uid == SHELL_UID) {
return true;
}
if (likely(uid <= BITMAP_UID_MAX)) {
return !!(allow_list_bitmap[uid / BITS_PER_BYTE] &
(1 << (uid % BITS_PER_BYTE)));
} else {
for (i = 0; i < allow_list_pointer; i++) {
if (allow_list_arr[i] == uid)
return true;
}
}
return false;
}
bool __ksu_is_allow_uid_for_current(uid_t uid)
{
if (unlikely(uid == 0)) {
// already root, but only allow our domain.
return is_ksu_domain();
}
return __ksu_is_allow_uid(uid);
}
bool ksu_uid_should_umount(uid_t uid)
{
struct app_profile profile = { .current_uid = uid };
if (likely(ksu_is_manager_appid_valid()) &&
unlikely(ksu_get_manager_appid() == uid % PER_USER_RANGE)) {
// we should not umount on manager!
return false;
}
bool found = ksu_get_app_profile(&profile);
if (!found) {
// no app profile found, it must be non root app
return default_non_root_profile.umount_modules;
}
if (profile.allow_su) {
// if found and it is granted to su, we shouldn't umount for it
return false;
} else {
// found an app profile
if (profile.nrp_config.use_default) {
return default_non_root_profile.umount_modules;
} else {
return profile.nrp_config.profile.umount_modules;
}
}
}
void ksu_get_root_profile(uid_t uid, struct root_profile *profile)
{
struct perm_data *p = NULL;
if (is_uid_manager(uid)) {
goto use_default;
}
if (unlikely(allow_shell && uid == SHELL_UID)) {
goto use_default;
}
rcu_read_lock();
list_for_each_entry_rcu (p, &allow_list, list) {
if (uid == p->profile.current_uid && p->profile.allow_su) {
if (!p->profile.rp_config.use_default) {
memcpy(profile, &p->profile.rp_config.profile,
sizeof(*profile));
rcu_read_unlock();
return;
}
}
}
rcu_read_unlock();
use_default:
// use default profile
memcpy(profile, &default_root_profile, sizeof(*profile));
}
bool ksu_get_allow_list(int *array, u16 length, u16 *out_length, u16 *out_total,
bool allow)
{
struct perm_data *p = NULL;
u16 i = 0, j = 0;
rcu_read_lock();
list_for_each_entry_rcu (p, &allow_list, list) {
// pr_info("get_allow_list uid: %d allow: %d\n", p->uid, p->allow);
if (p->profile.allow_su == allow &&
!is_uid_manager(p->profile.current_uid)) {
if (j < length) {
array[j++] = p->profile.current_uid;
}
++i;
}
}
rcu_read_unlock();
if (out_length) {
*out_length = j;
}
if (out_total) {
*out_total = i;
}
return true;
}
// TODO: move to kernel thread or work queue
static void do_persistent_allow_list(struct callback_head *_cb)
{
u32 magic = FILE_MAGIC;
u32 version = FILE_FORMAT_VERSION;
struct perm_data *p = NULL;
loff_t off = 0;
const struct cred *saved = override_creds(ksu_cred);
struct file *fp =
filp_open(KERNEL_SU_ALLOWLIST, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (IS_ERR(fp)) {
pr_err("save_allow_list create file failed: %ld\n", PTR_ERR(fp));
goto out;
}
// store magic and version
if (kernel_write(fp, &magic, sizeof(magic), &off) != sizeof(magic)) {
pr_err("save_allow_list write magic failed.\n");
goto close_file;
}
if (kernel_write(fp, &version, sizeof(version), &off) != sizeof(version)) {
pr_err("save_allow_list write version failed.\n");
goto close_file;
}
mutex_lock(&allowlist_mutex);
list_for_each_entry (p, &allow_list, list) {
pr_info("save allow list, name: %s uid :%d, allow: %d\n",
p->profile.key, p->profile.current_uid, p->profile.allow_su);
kernel_write(fp, &p->profile, sizeof(p->profile), &off);
}
mutex_unlock(&allowlist_mutex);
close_file:
filp_close(fp, 0);
out:
revert_creds(saved);
kfree(_cb);
}
void ksu_persistent_allow_list()
{
struct task_struct *tsk;
tsk = get_pid_task(find_vpid(1), PIDTYPE_PID);
if (!tsk) {
pr_err("save_allow_list find init task err\n");
return;
}
struct callback_head *cb =
kzalloc(sizeof(struct callback_head), GFP_KERNEL);
if (!cb) {
pr_err("save_allow_list alloc cb err\b");
goto put_task;
}
cb->func = do_persistent_allow_list;
if (task_work_add(tsk, cb, TWA_RESUME)) {
kfree(cb);
pr_warn("save_allow_list add task_work failed\n");
}
put_task:
put_task_struct(tsk);
}
void ksu_load_allow_list()
{
loff_t off = 0;
ssize_t ret = 0;
struct file *fp = NULL;
u32 magic;
u32 version;
// load allowlist now!
fp = filp_open(KERNEL_SU_ALLOWLIST, O_RDONLY, 0);
if (IS_ERR(fp)) {
pr_err("load_allow_list open file failed: %ld\n", PTR_ERR(fp));
return;
}
// verify magic
if (kernel_read(fp, &magic, sizeof(magic), &off) != sizeof(magic) ||
magic != FILE_MAGIC) {
pr_err("allowlist file invalid: %d!\n", magic);
goto exit;
}
if (kernel_read(fp, &version, sizeof(version), &off) != sizeof(version)) {
pr_err("allowlist read version: %d failed\n", version);
goto exit;
}
pr_info("allowlist version: %d\n", version);
while (true) {
struct app_profile profile;
ret = kernel_read(fp, &profile, sizeof(profile), &off);
if (ret <= 0) {
pr_info("load_allow_list read err: %zd\n", ret);
break;
}
pr_info("load_allow_uid, name: %s, uid: %d, allow: %d\n", profile.key,
profile.current_uid, profile.allow_su);
ksu_set_app_profile(&profile);
}
exit:
ksu_show_allow_list();
filp_close(fp, 0);
}
void ksu_prune_allowlist(bool (*is_uid_valid)(uid_t, char *, void *),
void *data)
{
struct perm_data *np = NULL;
struct perm_data *n = NULL;
if (!ksu_boot_completed) {
pr_info("boot not completed, skip prune\n");
return;
}
bool modified = false;
mutex_lock(&allowlist_mutex);
list_for_each_entry_safe (np, n, &allow_list, list) {
uid_t uid = np->profile.current_uid;
char *package = np->profile.key;
// we use this uid for special cases, don't prune it!
bool is_preserved_uid = uid == KSU_APP_PROFILE_PRESERVE_UID;
if (!is_preserved_uid && !is_uid_valid(uid, package, data)) {
modified = true;
pr_info("prune uid: %d, package: %s\n", uid, package);
list_del_rcu(&np->list);
kfree_rcu(np, rcu);
if (likely(uid <= BITMAP_UID_MAX)) {
allow_list_bitmap[uid / BITS_PER_BYTE] &=
~(1 << (uid % BITS_PER_BYTE));
}
remove_uid_from_arr(uid);
}
}
mutex_unlock(&allowlist_mutex);
if (modified) {
smp_mb();
ksu_persistent_allow_list();
}
}
void ksu_allowlist_init(void)
{
int i;
BUILD_BUG_ON(sizeof(allow_list_bitmap) != PAGE_SIZE);
BUILD_BUG_ON(sizeof(allow_list_arr) != PAGE_SIZE);
for (i = 0; i < ARRAY_SIZE(allow_list_arr); i++)
allow_list_arr[i] = -1;
INIT_LIST_HEAD(&allow_list);
init_default_profiles();
}
void ksu_allowlist_exit(void)
{
struct perm_data *np = NULL;
struct perm_data *n = NULL;
// free allowlist
mutex_lock(&allowlist_mutex);
list_for_each_entry_safe (np, n, &allow_list, list) {
list_del(&np->list);
kfree(np);
}
mutex_unlock(&allowlist_mutex);
}
================================================
FILE: kernel/allowlist.h
================================================
#ifndef __KSU_H_ALLOWLIST
#define __KSU_H_ALLOWLIST
#include <linux/types.h>
#include <linux/uidgid.h>
#include "app_profile.h"
#define PER_USER_RANGE 100000
#define FIRST_APPLICATION_UID 10000
#define LAST_APPLICATION_UID 19999
#define FIRST_ISOLATED_UID 99000
#define LAST_ISOLATED_UID 99999
void ksu_allowlist_init(void);
void ksu_allowlist_exit(void);
void ksu_load_allow_list(void);
void ksu_show_allow_list(void);
// Check if the uid is in allow list
bool __ksu_is_allow_uid(uid_t uid);
#define ksu_is_allow_uid(uid) unlikely(__ksu_is_allow_uid(uid))
// Check if the uid is in allow list, or current is ksu domain root
bool __ksu_is_allow_uid_for_current(uid_t uid);
#define ksu_is_allow_uid_for_current(uid) \
unlikely(__ksu_is_allow_uid_for_current(uid))
bool ksu_get_allow_list(int *array, u16 length, u16 *out_length, u16 *out_total,
bool allow);
void ksu_prune_allowlist(bool (*is_uid_exist)(uid_t, char *, void *),
void *data);
void ksu_persistent_allow_list();
bool ksu_get_app_profile(struct app_profile *);
int ksu_set_app_profile(struct app_profile *);
bool ksu_uid_should_umount(uid_t uid);
void ksu_get_root_profile(uid_t uid, struct root_profile *);
static inline bool is_appuid(uid_t uid)
{
uid_t appid = uid % PER_USER_RANGE;
return appid >= FIRST_APPLICATION_UID && appid <= LAST_APPLICATION_UID;
}
static inline bool is_isolated_process(uid_t uid)
{
uid_t appid = uid % PER_USER_RANGE;
return appid >= FIRST_ISOLATED_UID && appid <= LAST_ISOLATED_UID;
}
#endif
extern bool allow_shell;
================================================
FILE: kernel/apk_sign.c
================================================
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/gfp.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/version.h>
#ifdef CONFIG_KSU_DEBUG
#include <linux/moduleparam.h>
#endif
#include <crypto/hash.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
#include <crypto/sha2.h>
#else
#include <crypto/sha.h>
#endif
#include "apk_sign.h"
#include "app_profile.h"
#include "klog.h" // IWYU pragma: keep
struct sdesc {
struct shash_desc shash;
char ctx[];
};
static struct sdesc *init_sdesc(struct crypto_shash *alg)
{
struct sdesc *sdesc;
int size;
size = sizeof(struct shash_desc) + crypto_shash_descsize(alg);
sdesc = kzalloc(size, GFP_KERNEL);
if (!sdesc)
return ERR_PTR(-ENOMEM);
sdesc->shash.tfm = alg;
return sdesc;
}
static int calc_hash(struct crypto_shash *alg, const unsigned char *data,
unsigned int datalen, unsigned char *digest)
{
struct sdesc *sdesc;
int ret;
sdesc = init_sdesc(alg);
if (IS_ERR(sdesc)) {
pr_info("can't alloc sdesc\n");
return PTR_ERR(sdesc);
}
ret = crypto_shash_digest(&sdesc->shash, data, datalen, digest);
kfree(sdesc);
return ret;
}
static int ksu_sha256(const unsigned char *data, unsigned int datalen,
unsigned char *digest)
{
struct crypto_shash *alg;
char *hash_alg_name = "sha256";
int ret;
alg = crypto_alloc_shash(hash_alg_name, 0, 0);
if (IS_ERR(alg)) {
pr_info("can't alloc alg %s\n", hash_alg_name);
return PTR_ERR(alg);
}
ret = calc_hash(alg, data, datalen, digest);
crypto_free_shash(alg);
return ret;
}
static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
unsigned expected_size, const char *expected_sha256)
{
kernel_read(fp, size4, 0x4, pos); // signer-sequence length
kernel_read(fp, size4, 0x4, pos); // signer length
kernel_read(fp, size4, 0x4, pos); // signed data length
*offset += 0x4 * 3;
kernel_read(fp, size4, 0x4, pos); // digests-sequence length
*pos += *size4;
*offset += 0x4 + *size4;
kernel_read(fp, size4, 0x4, pos); // certificates length
kernel_read(fp, size4, 0x4, pos); // certificate length
*offset += 0x4 * 2;
if (*size4 == expected_size) {
*offset += *size4;
#define CERT_MAX_LENGTH 1024
char cert[CERT_MAX_LENGTH];
if (*size4 > CERT_MAX_LENGTH) {
pr_info("cert length overlimit\n");
return false;
}
kernel_read(fp, cert, *size4, pos);
unsigned char digest[SHA256_DIGEST_SIZE];
if (IS_ERR(ksu_sha256(cert, *size4, digest))) {
pr_info("sha256 error\n");
return false;
}
char hash_str[SHA256_DIGEST_SIZE * 2 + 1];
hash_str[SHA256_DIGEST_SIZE * 2] = '\0';
bin2hex(hash_str, digest, SHA256_DIGEST_SIZE);
pr_info("sha256: %s, expected: %s\n", hash_str, expected_sha256);
if (strcmp(expected_sha256, hash_str) == 0) {
return true;
}
}
return false;
}
struct zip_entry_header {
uint32_t signature;
uint16_t version;
uint16_t flags;
uint16_t compression;
uint16_t mod_time;
uint16_t mod_date;
uint32_t crc32;
uint32_t compressed_size;
uint32_t uncompressed_size;
uint16_t file_name_length;
uint16_t extra_field_length;
} __attribute__((packed));
// This is a necessary but not sufficient condition, but it is enough for us
static bool has_v1_signature_file(struct file *fp)
{
struct zip_entry_header header;
const char MANIFEST[] = "META-INF/MANIFEST.MF";
loff_t pos = 0;
while (kernel_read(fp, &header, sizeof(struct zip_entry_header), &pos) ==
sizeof(struct zip_entry_header)) {
if (header.signature != 0x04034b50) {
// ZIP magic: 'PK'
return false;
}
// Read the entry file name
if (header.file_name_length == sizeof(MANIFEST) - 1) {
char fileName[sizeof(MANIFEST)];
kernel_read(fp, fileName, header.file_name_length, &pos);
fileName[header.file_name_length] = '\0';
// Check if the entry matches META-INF/MANIFEST.MF
if (strncmp(MANIFEST, fileName, sizeof(MANIFEST) - 1) == 0) {
return true;
}
} else {
// Skip the entry file name
pos += header.file_name_length;
}
// Skip to the next entry
pos += header.extra_field_length + header.compressed_size;
}
return false;
}
static __always_inline bool check_v2_signature(char *path,
unsigned expected_size,
const char *expected_sha256)
{
unsigned char buffer[0x11] = { 0 };
u32 size4;
u64 size8, size_of_block;
loff_t pos;
bool v2_signing_valid = false;
int v2_signing_blocks = 0;
bool v3_signing_exist = false;
bool v3_1_signing_exist = false;
int i;
struct file *fp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(fp)) {
pr_err("open %s error.\n", path);
return false;
}
// disable inotify for this file
fp->f_mode |= FMODE_NONOTIFY;
// https://en.wikipedia.org/wiki/Zip_(file_format)#End_of_central_directory_record_(EOCD)
for (i = 0;; ++i) {
unsigned short n;
pos = generic_file_llseek(fp, -i - 2, SEEK_END);
kernel_read(fp, &n, 2, &pos);
if (n == i) {
pos -= 22;
kernel_read(fp, &size4, 4, &pos);
if ((size4 ^ 0xcafebabeu) == 0xccfbf1eeu) {
break;
}
}
if (i == 0xffff) {
pr_info("error: cannot find eocd\n");
goto clean;
}
}
pos += 12;
// offset
kernel_read(fp, &size4, 0x4, &pos);
pos = size4 - 0x18;
kernel_read(fp, &size8, 0x8, &pos);
kernel_read(fp, buffer, 0x10, &pos);
if (strcmp((char *)buffer, "APK Sig Block 42")) {
goto clean;
}
pos = size4 - (size8 + 0x8);
kernel_read(fp, &size_of_block, 0x8, &pos);
if (size_of_block != size8) {
goto clean;
}
int loop_count = 0;
while (loop_count++ < 10) {
uint32_t id;
uint32_t offset;
kernel_read(fp, &size8, 0x8,
&pos); // sequence length
if (size8 == size_of_block) {
break;
}
kernel_read(fp, &id, 0x4, &pos); // id
offset = 4;
if (id == 0x7109871au) {
v2_signing_blocks++;
v2_signing_valid = check_block(fp, &size4, &pos, &offset,
expected_size, expected_sha256);
} else if (id == 0xf05368c0u) {
// http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java#73
v3_signing_exist = true;
} else if (id == 0x1b93ad61u) {
// http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java#74
v3_1_signing_exist = true;
} else {
#ifdef CONFIG_KSU_DEBUG
pr_info("Unknown id: 0x%08x\n", id);
#endif
}
pos += (size8 - offset);
}
if (v2_signing_blocks != 1) {
#ifdef CONFIG_KSU_DEBUG
pr_err("Unexpected v2 signature count: %d\n", v2_signing_blocks);
#endif
v2_signing_valid = false;
}
if (v2_signing_valid) {
int has_v1_signing = has_v1_signature_file(fp);
if (has_v1_signing) {
pr_err("Unexpected v1 signature scheme found!\n");
filp_close(fp, 0);
return false;
}
}
clean:
filp_close(fp, 0);
if (v3_signing_exist || v3_1_signing_exist) {
#ifdef CONFIG_KSU_DEBUG
pr_err("Unexpected v3 signature scheme found!\n");
#endif
return false;
}
return v2_signing_valid;
}
#ifdef CONFIG_KSU_DEBUG
int ksu_debug_manager_appid = -1;
#include "manager.h"
static int set_expected_size(const char *val, const struct kernel_param *kp)
{
int rv = param_set_uint(val, kp);
ksu_set_manager_appid(ksu_debug_manager_appid);
pr_info("ksu_manager_appid set to %d\n", ksu_debug_manager_appid);
return rv;
}
static struct kernel_param_ops expected_size_ops = {
.set = set_expected_size,
.get = param_get_uint,
};
module_param_cb(ksu_debug_manager_appid, &expected_size_ops,
&ksu_debug_manager_appid, S_IRUSR | S_IWUSR);
#endif
int get_pkg_from_apk_path(char *pkg, const char *path)
{
int len = strlen(path);
if (len >= KSU_MAX_PACKAGE_NAME || len < 1)
return -1;
const char *last_slash = NULL;
const char *second_last_slash = NULL;
int i;
for (i = len - 1; i >= 0; i--) {
if (path[i] == '/') {
if (!last_slash) {
last_slash = &path[i];
} else {
second_last_slash = &path[i];
break;
}
}
}
if (!last_slash || !second_last_slash)
return -1;
const char *last_hyphen = strchr(second_last_slash, '-');
if (!last_hyphen || last_hyphen > last_slash)
return -1;
int pkg_len = last_hyphen - second_last_slash - 1;
if (pkg_len >= KSU_MAX_PACKAGE_NAME || pkg_len <= 0)
return -1;
// Copying the package name
strncpy(pkg, second_last_slash + 1, pkg_len);
pkg[pkg_len] = '\0';
return 0;
}
bool is_manager_apk(char *path)
{
#ifdef KSU_MANAGER_PACKAGE
char pkg[KSU_MAX_PACKAGE_NAME];
if (get_pkg_from_apk_path(pkg, path) < 0) {
pr_err("Failed to get package name from apk path: %s\n", path);
return false;
}
// pkg is `<real package>`
if (strncmp(pkg, KSU_MANAGER_PACKAGE, sizeof(KSU_MANAGER_PACKAGE))) {
return false;
}
#endif
if (check_v2_signature(path, EXPECTED_SIZE, EXPECTED_HASH)) {
return true;
}
#ifdef EXPECTED_SIZE2
return check_v2_signature(path, EXPECTED_SIZE2, EXPECTED_HASH2);
#else
return false;
#endif
}
================================================
FILE: kernel/apk_sign.h
================================================
#ifndef __KSU_H_APK_V2_SIGN
#define __KSU_H_APK_V2_SIGN
#include <linux/types.h>
bool is_manager_apk(char *path);
int get_pkg_from_apk_path(char *pkg, const char *path);
#endif
================================================
FILE: kernel/app_profile.c
================================================
#include <linux/capability.h>
#include <linux/cred.h>
#include <linux/sched.h>
#include <linux/sched/user.h>
#include <linux/sched/signal.h>
#include <linux/seccomp.h>
#include <linux/slab.h>
#include <linux/thread_info.h>
#include <linux/uidgid.h>
#include <linux/version.h>
#include "allowlist.h"
#include "app_profile.h"
#include "klog.h" // IWYU pragma: keep
#include "selinux/selinux.h"
#include "su_mount_ns.h"
#include "syscall_hook_manager.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
static struct group_info root_groups = { .usage = REFCOUNT_INIT(2) };
#else
static struct group_info root_groups = { .usage = ATOMIC_INIT(2) };
#endif
void setup_groups(struct root_profile *profile, struct cred *cred)
{
if (profile->groups_count > KSU_MAX_GROUPS) {
pr_warn("Failed to setgroups, too large group: %d!\n", profile->uid);
return;
}
if (profile->groups_count == 1 && profile->groups[0] == 0) {
// setgroup to root and return early.
if (cred->group_info)
put_group_info(cred->group_info);
cred->group_info = get_group_info(&root_groups);
return;
}
u32 ngroups = profile->groups_count;
struct group_info *group_info = groups_alloc(ngroups);
if (!group_info) {
pr_warn("Failed to setgroups, ENOMEM for: %d\n", profile->uid);
return;
}
int i;
for (i = 0; i < ngroups; i++) {
gid_t gid = profile->groups[i];
kgid_t kgid = make_kgid(current_user_ns(), gid);
if (!gid_valid(kgid)) {
pr_warn("Failed to setgroups, invalid gid: %d\n", gid);
put_group_info(group_info);
return;
}
group_info->gid[i] = kgid;
}
groups_sort(group_info);
set_groups(cred, group_info);
put_group_info(group_info);
}
void seccomp_filter_release(struct task_struct *tsk);
static void disable_seccomp(void)
{
struct task_struct *fake;
fake = kmalloc(sizeof(*fake), GFP_ATOMIC);
if (!fake) {
pr_warn("failed to alloc fake task_struct\n");
return;
}
// Refer to kernel/seccomp.c: seccomp_set_mode_strict
// When disabling Seccomp, ensure that current->sighand->siglock is held during the operation.
spin_lock_irq(¤t->sighand->siglock);
// disable seccomp
#if defined(CONFIG_GENERIC_ENTRY) && \
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
clear_syscall_work(SECCOMP);
#else
clear_thread_flag(TIF_SECCOMP);
#endif
memcpy(fake, current, sizeof(*fake));
current->seccomp.mode = 0;
current->seccomp.filter = NULL;
atomic_set(¤t->seccomp.filter_count, 0);
spin_unlock_irq(¤t->sighand->siglock);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
// https://github.com/torvalds/linux/commit/bfafe5efa9754ebc991750da0bcca2a6694f3ed3#diff-45eb79a57536d8eccfc1436932f093eb5c0b60d9361c39edb46581ad313e8987R576-R577
fake->flags |= PF_EXITING;
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
// https://github.com/torvalds/linux/commit/0d8315dddd2899f519fe1ca3d4d5cdaf44ea421e#diff-45eb79a57536d8eccfc1436932f093eb5c0b60d9361c39edb46581ad313e8987R556-R558
fake->sighand = NULL;
#endif
seccomp_filter_release(fake);
kfree(fake);
}
void escape_with_root_profile(void)
{
struct cred *cred;
struct task_struct *p = current;
struct task_struct *t;
struct root_profile profile;
struct user_struct *new_user;
cred = prepare_creds();
if (!cred) {
pr_warn("prepare_creds failed!\n");
return;
}
if (cred->euid.val == 0) {
pr_warn("Already root, don't escape!\n");
goto out_abort_creds;
}
ksu_get_root_profile(cred->uid.val, &profile);
cred->uid.val = profile.uid;
cred->suid.val = profile.uid;
cred->euid.val = profile.uid;
cred->fsuid.val = profile.uid;
cred->gid.val = profile.gid;
cred->fsgid.val = profile.gid;
cred->sgid.val = profile.gid;
cred->egid.val = profile.gid;
cred->securebits = 0;
BUILD_BUG_ON(sizeof(profile.capabilities.effective) !=
sizeof(kernel_cap_t));
/*
* Mirror the kernel set*uid path: update cred->user first, then
* cred->ucounts, before commit_creds(). commit_creds() moves
* RLIMIT_NPROC accounting based on cred->user; if uid changes while
* user/ucounts stay stale, the old charge can remain pinned to the
* previous UID.
* See kernel/sys.c:set_user() and kernel/cred.c:set_cred_ucounts() /
* commit_creds():
* https://github.com/torvalds/linux/blob/v5.14/kernel/sys.c
* https://github.com/torvalds/linux/blob/v5.14/kernel/cred.c
*/
new_user = alloc_uid(cred->uid);
if (!new_user) {
goto out_abort_creds;
}
free_uid(cred->user);
cred->user = new_user;
// v5.14+ added cred->ucounts, so we must refresh it after changing uid/user:
// https://github.com/torvalds/linux/commit/905ae01c4ae2ae3df05bb141801b1db4b7d83c61#diff-ff6060da281bd9ef3f24e17b77a9b0b5b2ed2d7208bb69b29107bee69732bd31
// on older kernels, per-UID process accounting lives in user_struct.
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
if (set_cred_ucounts(cred)) {
goto out_abort_creds;
}
#endif
// setup capabilities
// we need CAP_DAC_READ_SEARCH becuase `/data/adb/ksud` is not accessible for non root process
// we add it here but don't add it to cap_inhertiable, it would be dropped automaticly after exec!
u64 cap_for_ksud = profile.capabilities.effective | CAP_DAC_READ_SEARCH;
memcpy(&cred->cap_effective, &cap_for_ksud, sizeof(cred->cap_effective));
memcpy(&cred->cap_permitted, &profile.capabilities.effective,
sizeof(cred->cap_permitted));
memcpy(&cred->cap_bset, &profile.capabilities.effective,
sizeof(cred->cap_bset));
setup_groups(&profile, cred);
setup_selinux(profile.selinux_domain, cred);
commit_creds(cred);
disable_seccomp();
for_each_thread (p, t) {
ksu_set_task_tracepoint_flag(t);
}
setup_mount_ns(profile.namespaces);
return;
out_abort_creds:
abort_creds(cred);
}
void escape_to_root_for_init(void)
{
struct cred *cred = prepare_creds();
if (!cred) {
pr_err("Failed to prepare init's creds!\n");
return;
}
setup_selinux(KERNEL_SU_CONTEXT, cred);
commit_creds(cred);
}
================================================
FILE: kernel/app_profile.h
================================================
#ifndef __KSU_H_APP_PROFILE
#define __KSU_H_APP_PROFILE
#include <linux/types.h>
// Forward declarations
struct cred;
#define KSU_APP_PROFILE_VER 2
#define KSU_MAX_PACKAGE_NAME 256
// NGROUPS_MAX for Linux is 65535 generally, but we only supports 32 groups.
#define KSU_MAX_GROUPS 32
#define KSU_SELINUX_DOMAIN 64
struct root_profile {
int32_t uid;
int32_t gid;
int32_t groups_count;
int32_t groups[KSU_MAX_GROUPS];
// kernel_cap_t is u32[2] for capabilities v3
struct {
u64 effective;
u64 permitted;
u64 inheritable;
} capabilities;
char selinux_domain[KSU_SELINUX_DOMAIN];
int32_t namespaces;
};
struct non_root_profile {
bool umount_modules;
};
struct app_profile {
// It may be utilized for backward compatibility, although we have never explicitly made any promises regarding this.
u32 version;
// this is usually the package of the app, but can be other value for special apps
char key[KSU_MAX_PACKAGE_NAME];
int32_t current_uid;
bool allow_su;
union {
struct {
bool use_default;
char template_name[KSU_MAX_PACKAGE_NAME];
struct root_profile profile;
} rp_config;
struct {
bool use_default;
struct non_root_profile profile;
} nrp_config;
};
};
// Escalate current process to root with the appropriate profile
void escape_with_root_profile(void);
void escape_to_root_for_init(void);
#endif
================================================
FILE: kernel/arch.h
================================================
#ifndef __KSU_H_ARCH
#define __KSU_H_ARCH
#include <linux/version.h>
#if defined(__aarch64__)
#define __PT_PARM1_REG regs[0]
#define __PT_PARM2_REG regs[1]
#define __PT_PARM3_REG regs[2]
#define __PT_SYSCALL_PARM4_REG regs[3]
#define __PT_CCALL_PARM4_REG regs[3]
#define __PT_PARM5_REG regs[4]
#define __PT_PARM6_REG regs[5]
#define __PT_RET_REG regs[30]
#define __PT_FP_REG regs[29] /* Works only with CONFIG_FRAME_POINTER */
#define __PT_RC_REG regs[0]
#define __PT_SP_REG sp
#define __PT_IP_REG pc
#define REBOOT_SYMBOL "__arm64_sys_reboot"
#define SYS_READ_SYMBOL "__arm64_sys_read"
#define SYS_EXECVE_SYMBOL "__arm64_sys_execve"
// https://cs.android.com/android/kernel/superproject/+/common-android-mainline:common/scripts/syscalltbl.sh;l=57;drc=9142be9e6443fd641ca37f820efe00d9cd890eb1
// https://cs.android.com/android/kernel/superproject/+/common-android-mainline:common/scripts/syscall.tbl;l=104;drc=b36d4b6aa88ef039647228b98c59a875e92f8c8e
#define SYS_FSTAT_SYMBOL "__arm64_sys_newfstat"
#elif defined(__x86_64__)
#define __PT_PARM1_REG di
#define __PT_PARM2_REG si
#define __PT_PARM3_REG dx
/* syscall uses r10 for PARM4 */
#define __PT_SYSCALL_PARM4_REG r10
#define __PT_CCALL_PARM4_REG cx
#define __PT_PARM5_REG r8
#define __PT_PARM6_REG r9
#define __PT_RET_REG sp
#define __PT_FP_REG bp
#define __PT_RC_REG ax
#define __PT_SP_REG sp
#define __PT_IP_REG ip
#define REBOOT_SYMBOL "__x64_sys_reboot"
#define SYS_READ_SYMBOL "__x64_sys_read"
#define SYS_EXECVE_SYMBOL "__x64_sys_execve"
#define SYS_FSTAT_SYMBOL "__x64_sys_newfstat"
#else
#error "Unsupported arch"
#endif
/* allow some architecutres to override `struct pt_regs` */
#ifndef __PT_REGS_CAST
#define __PT_REGS_CAST(x) (x)
#endif
#define PT_REGS_PARM1(x) (__PT_REGS_CAST(x)->__PT_PARM1_REG)
#define PT_REGS_PARM2(x) (__PT_REGS_CAST(x)->__PT_PARM2_REG)
#define PT_REGS_PARM3(x) (__PT_REGS_CAST(x)->__PT_PARM3_REG)
#define PT_REGS_SYSCALL_PARM4(x) (__PT_REGS_CAST(x)->__PT_SYSCALL_PARM4_REG)
#define PT_REGS_CCALL_PARM4(x) (__PT_REGS_CAST(x)->__PT_CCALL_PARM4_REG)
#define PT_REGS_PARM5(x) (__PT_REGS_CAST(x)->__PT_PARM5_REG)
#define PT_REGS_PARM6(x) (__PT_REGS_CAST(x)->__PT_PARM6_REG)
#define PT_REGS_RET(x) (__PT_REGS_CAST(x)->__PT_RET_REG)
#define PT_REGS_FP(x) (__PT_REGS_CAST(x)->__PT_FP_REG)
#define PT_REGS_RC(x) (__PT_REGS_CAST(x)->__PT_RC_REG)
#define PT_REGS_SP(x) (__PT_REGS_CAST(x)->__PT_SP_REG)
#define PT_REGS_IP(x) (__PT_REGS_CAST(x)->__PT_IP_REG)
#define PT_REAL_REGS(regs) ((struct pt_regs *)PT_REGS_PARM1(regs))
#endif
================================================
FILE: kernel/feature.c
================================================
#include "feature.h"
#include "klog.h" // IWYU pragma: keep
#include <linux/mutex.h>
static const struct ksu_feature_handler *feature_handlers[KSU_FEATURE_MAX];
static DEFINE_MUTEX(feature_mutex);
int ksu_register_feature_handler(const struct ksu_feature_handler *handler)
{
if (!handler) {
pr_err("feature: register handler is NULL\n");
return -EINVAL;
}
if (handler->feature_id >= KSU_FEATURE_MAX) {
pr_err("feature: invalid feature_id %u\n", handler->feature_id);
return -EINVAL;
}
if (!handler->get_handler && !handler->set_handler) {
pr_err("feature: no handler provided for feature %u\n",
handler->feature_id);
return -EINVAL;
}
mutex_lock(&feature_mutex);
if (feature_handlers[handler->feature_id]) {
pr_warn("feature: handle
gitextract_ypog1o43/
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── config.yml
│ │ └── custom.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── build-lkm.yml
│ ├── build-manager.yml
│ ├── clang-format.yml
│ ├── clippy.yml
│ ├── ddk-lkm.yml
│ ├── deploy-website.yml
│ ├── ksud.yml
│ ├── ksuinit.yml
│ ├── release.yml
│ ├── rustfmt.yml
│ └── shellcheck.yml
├── .gitignore
├── LICENSE
├── SECURITY.md
├── docs/
│ ├── README.md
│ ├── README_CN.md
│ ├── README_ES.md
│ ├── README_ID.md
│ ├── README_IN.md
│ ├── README_IT.md
│ ├── README_IW.md
│ ├── README_JP.md
│ ├── README_KR.md
│ ├── README_PL.md
│ ├── README_PT-BR.md
│ ├── README_RU.md
│ ├── README_TR.md
│ ├── README_TW.md
│ └── README_VI.md
├── fastlane/
│ └── metadata/
│ └── android/
│ └── en-US/
│ ├── full_description.txt
│ └── short_description.txt
├── js/
│ ├── README.md
│ ├── index.d.ts
│ ├── index.js
│ └── package.json
├── justfile
├── kernel/
│ ├── .clang-format
│ ├── .clangd
│ ├── .gitignore
│ ├── Kbuild
│ ├── Kconfig
│ ├── LICENSE
│ ├── Makefile
│ ├── allowlist.c
│ ├── allowlist.h
│ ├── apk_sign.c
│ ├── apk_sign.h
│ ├── app_profile.c
│ ├── app_profile.h
│ ├── arch.h
│ ├── feature.c
│ ├── feature.h
│ ├── file_wrapper.c
│ ├── file_wrapper.h
│ ├── kernel_umount.c
│ ├── kernel_umount.h
│ ├── klog.h
│ ├── ksu.c
│ ├── ksu.h
│ ├── ksud.c
│ ├── ksud.h
│ ├── manager.h
│ ├── pkg_observer.c
│ ├── seccomp_cache.c
│ ├── seccomp_cache.h
│ ├── selinux/
│ │ ├── rules.c
│ │ ├── selinux.c
│ │ ├── selinux.h
│ │ ├── sepolicy.c
│ │ └── sepolicy.h
│ ├── setuid_hook.c
│ ├── setuid_hook.h
│ ├── setup.sh
│ ├── su_mount_ns.c
│ ├── su_mount_ns.h
│ ├── sucompat.c
│ ├── sucompat.h
│ ├── supercalls.c
│ ├── supercalls.h
│ ├── syscall_hook_manager.c
│ ├── syscall_hook_manager.h
│ ├── throne_tracker.c
│ ├── throne_tracker.h
│ ├── tools/
│ │ └── check_symbol.c
│ ├── util.c
│ └── util.h
├── manager/
│ ├── .gitignore
│ ├── app/
│ │ ├── .gitignore
│ │ ├── build.gradle.kts
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── aidl/
│ │ │ └── me/
│ │ │ └── weishu/
│ │ │ └── kernelsu/
│ │ │ └── IKsuInterface.aidl
│ │ ├── assets/
│ │ │ └── github-markdown.css
│ │ ├── cpp/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── jni.cc
│ │ │ ├── ksu.cc
│ │ │ ├── ksu.h
│ │ │ └── logging.h
│ │ ├── java/
│ │ │ └── me/
│ │ │ └── weishu/
│ │ │ └── kernelsu/
│ │ │ ├── KernelSUApplication.kt
│ │ │ ├── Kernels.kt
│ │ │ ├── Natives.kt
│ │ │ ├── data/
│ │ │ │ ├── model/
│ │ │ │ │ ├── AppInfo.kt
│ │ │ │ │ ├── Module.kt
│ │ │ │ │ ├── ModuleUpdateInfo.kt
│ │ │ │ │ ├── RepoModule.kt
│ │ │ │ │ └── TemplateInfo.kt
│ │ │ │ └── repository/
│ │ │ │ ├── ModuleRepoRepository.kt
│ │ │ │ ├── ModuleRepoRepositoryImpl.kt
│ │ │ │ ├── ModuleRepository.kt
│ │ │ │ ├── ModuleRepositoryImpl.kt
│ │ │ │ ├── SettingsRepository.kt
│ │ │ │ ├── SettingsRepositoryImpl.kt
│ │ │ │ ├── SuperUserRepository.kt
│ │ │ │ ├── SuperUserRepositoryImpl.kt
│ │ │ │ ├── TemplateRepository.kt
│ │ │ │ └── TemplateRepositoryImpl.kt
│ │ │ ├── magica/
│ │ │ │ ├── AppZygotePreload.java
│ │ │ │ ├── BootCompletedReceiver.java
│ │ │ │ └── MagicaService.java
│ │ │ ├── profile/
│ │ │ │ ├── Capabilities.kt
│ │ │ │ └── Groups.kt
│ │ │ └── ui/
│ │ │ ├── KsuService.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── UiMode.kt
│ │ │ ├── animation/
│ │ │ │ ├── DampedDragAnimation.kt
│ │ │ │ └── InteractiveHighlight.kt
│ │ │ ├── component/
│ │ │ │ ├── AppIconImage.kt
│ │ │ │ ├── FloatingBottomBar.kt
│ │ │ │ ├── GithubMarkdown.kt
│ │ │ │ ├── KeyEventBlocker.kt
│ │ │ │ ├── KsuValidCheck.kt
│ │ │ │ ├── Markdown.kt
│ │ │ │ ├── MenuPositionProvider.kt
│ │ │ │ ├── SearchStatus.kt
│ │ │ │ ├── bottombar/
│ │ │ │ │ ├── BottomBar.kt
│ │ │ │ │ ├── BottomBarMaterial.kt
│ │ │ │ │ ├── BottomBarMiuix.kt
│ │ │ │ │ ├── NavigationRailMaterial.kt
│ │ │ │ │ └── NavigationRailMiuix.kt
│ │ │ │ ├── choosekmidialog/
│ │ │ │ │ ├── ChooseKmiDialog.kt
│ │ │ │ │ ├── ChooseKmiDialogMaterial.kt
│ │ │ │ │ └── ChooseKmiDialogMiuix.kt
│ │ │ │ ├── dialog/
│ │ │ │ │ ├── Dialog.kt
│ │ │ │ │ ├── DialogMaterial.kt
│ │ │ │ │ └── DialogMiuix.kt
│ │ │ │ ├── filter/
│ │ │ │ │ ├── BaseFieldFilter.kt
│ │ │ │ │ └── FilterNumber.kt
│ │ │ │ ├── material/
│ │ │ │ │ ├── ExpressiveSwitch.kt
│ │ │ │ │ ├── SearchBar.kt
│ │ │ │ │ ├── SegmentedList.kt
│ │ │ │ │ ├── SendLogBottomSheet.kt
│ │ │ │ │ └── SettingsItem.kt
│ │ │ │ ├── miuix/
│ │ │ │ │ ├── DropdownItem.kt
│ │ │ │ │ ├── EditText.kt
│ │ │ │ │ ├── ScaleDialog.kt
│ │ │ │ │ ├── SendLogDialog.kt
│ │ │ │ │ ├── SuperEditArrow.kt
│ │ │ │ │ └── SuperSearchBar.kt
│ │ │ │ ├── profile/
│ │ │ │ │ ├── AppProfileConfigMaterial.kt
│ │ │ │ │ ├── AppProfileConfigMiuix.kt
│ │ │ │ │ ├── ProfileConfig.kt
│ │ │ │ │ ├── RootProfileConfigMaterial.kt
│ │ │ │ │ ├── RootProfileConfigMiuix.kt
│ │ │ │ │ ├── TemplateConfigMaterial.kt
│ │ │ │ │ ├── TemplateConfigMiuix.kt
│ │ │ │ │ └── dialogs/
│ │ │ │ │ ├── MultiSelectDialog.kt
│ │ │ │ │ └── SingleSelectDialog.kt
│ │ │ │ ├── rebootlistpopup/
│ │ │ │ │ ├── RebootListPopup.kt
│ │ │ │ │ ├── RebootListPopupMaterial.kt
│ │ │ │ │ └── RebootListPopupMiuix.kt
│ │ │ │ ├── statustag/
│ │ │ │ │ ├── StatusTag.kt
│ │ │ │ │ ├── StatusTagMaterial.kt
│ │ │ │ │ └── StatusTagMiuix.kt
│ │ │ │ └── uninstalldialog/
│ │ │ │ ├── UninstallDialog.kt
│ │ │ │ ├── UninstallDialogMaterial.kt
│ │ │ │ └── UninstallDialogMiuix.kt
│ │ │ ├── modifier/
│ │ │ │ └── DragGestureInspector.kt
│ │ │ ├── navigation3/
│ │ │ │ ├── DeepLinkResolver.kt
│ │ │ │ ├── Navigator.kt
│ │ │ │ └── Routes.kt
│ │ │ ├── screen/
│ │ │ │ ├── about/
│ │ │ │ │ ├── AboutMaterial.kt
│ │ │ │ │ ├── AboutMiuix.kt
│ │ │ │ │ ├── AboutScreen.kt
│ │ │ │ │ ├── AboutUiState.kt
│ │ │ │ │ └── AboutUtils.kt
│ │ │ │ ├── appprofile/
│ │ │ │ │ ├── AppProfileMaterial.kt
│ │ │ │ │ ├── AppProfileMiuix.kt
│ │ │ │ │ ├── AppProfileScreen.kt
│ │ │ │ │ ├── AppProfileUiState.kt
│ │ │ │ │ └── AppProfileUtils.kt
│ │ │ │ ├── colorpalette/
│ │ │ │ │ ├── ColorPaletteScreen.kt
│ │ │ │ │ ├── ColorPaletteScreenMaterial.kt
│ │ │ │ │ ├── ColorPaletteScreenMiuix.kt
│ │ │ │ │ └── ColorPaletteUiState.kt
│ │ │ │ ├── executemoduleaction/
│ │ │ │ │ ├── ExecuteModuleActionMaterial.kt
│ │ │ │ │ ├── ExecuteModuleActionMiuix.kt
│ │ │ │ │ ├── ExecuteModuleActionScreen.kt
│ │ │ │ │ ├── ExecuteModuleActionUiState.kt
│ │ │ │ │ └── ExecuteModuleActionUtils.kt
│ │ │ │ ├── flash/
│ │ │ │ │ ├── FlashMaterial.kt
│ │ │ │ │ ├── FlashMiuix.kt
│ │ │ │ │ ├── FlashScreen.kt
│ │ │ │ │ ├── FlashUiState.kt
│ │ │ │ │ └── FlashUtils.kt
│ │ │ │ ├── home/
│ │ │ │ │ ├── HomeMaterial.kt
│ │ │ │ │ ├── HomeMiuix.kt
│ │ │ │ │ ├── HomeScreen.kt
│ │ │ │ │ ├── HomeUiState.kt
│ │ │ │ │ └── HomeUtils.kt
│ │ │ │ ├── install/
│ │ │ │ │ ├── InstallMaterial.kt
│ │ │ │ │ ├── InstallMiuix.kt
│ │ │ │ │ ├── InstallScreen.kt
│ │ │ │ │ ├── InstallUiState.kt
│ │ │ │ │ └── InstallUtils.kt
│ │ │ │ ├── module/
│ │ │ │ │ ├── ModuleMaterial.kt
│ │ │ │ │ ├── ModuleMiuix.kt
│ │ │ │ │ ├── ModuleScreen.kt
│ │ │ │ │ ├── ModuleShortcutState.kt
│ │ │ │ │ ├── ModuleUiState.kt
│ │ │ │ │ └── ModuleUtils.kt
│ │ │ │ ├── modulerepo/
│ │ │ │ │ ├── ModuleRepoMaterial.kt
│ │ │ │ │ ├── ModuleRepoMiuix.kt
│ │ │ │ │ ├── ModuleRepoModels.kt
│ │ │ │ │ ├── ModuleRepoScreen.kt
│ │ │ │ │ └── ModuleRepoUiState.kt
│ │ │ │ ├── settings/
│ │ │ │ │ ├── SettingsMaterial.kt
│ │ │ │ │ ├── SettingsMiuix.kt
│ │ │ │ │ ├── SettingsScreen.kt
│ │ │ │ │ └── SettingsUiState.kt
│ │ │ │ ├── superuser/
│ │ │ │ │ ├── SuperUserMaterial.kt
│ │ │ │ │ ├── SuperUserMiuix.kt
│ │ │ │ │ ├── SuperUserScreen.kt
│ │ │ │ │ └── SuperUserUiState.kt
│ │ │ │ ├── template/
│ │ │ │ │ ├── TemplateMaterial.kt
│ │ │ │ │ ├── TemplateMiuix.kt
│ │ │ │ │ ├── TemplateScreen.kt
│ │ │ │ │ └── TemplateUiState.kt
│ │ │ │ └── templateeditor/
│ │ │ │ ├── TemplateEditorMaterial.kt
│ │ │ │ ├── TemplateEditorMiuix.kt
│ │ │ │ ├── TemplateEditorScreen.kt
│ │ │ │ ├── TemplateEditorUiState.kt
│ │ │ │ └── TemplateEditorUtils.kt
│ │ │ ├── theme/
│ │ │ │ ├── Colors.kt
│ │ │ │ ├── MaterialTheme.kt
│ │ │ │ ├── MiuixTheme.kt
│ │ │ │ └── Theme.kt
│ │ │ ├── util/
│ │ │ │ ├── AppIconCache.kt
│ │ │ │ ├── Colors.kt
│ │ │ │ ├── CompositionProvider.kt
│ │ │ │ ├── Downloader.kt
│ │ │ │ ├── HanziToPinyin.java
│ │ │ │ ├── HazeExt.kt
│ │ │ │ ├── KsuCli.kt
│ │ │ │ ├── LogEvent.kt
│ │ │ │ ├── Network.kt
│ │ │ │ ├── OemHelper.kt
│ │ │ │ ├── SELinuxChecker.kt
│ │ │ │ ├── Serialization.kt
│ │ │ │ ├── UidGroupUtils.kt
│ │ │ │ └── module/
│ │ │ │ ├── LatestVersionInfo.kt
│ │ │ │ ├── ModuleRepoApi.kt
│ │ │ │ └── Shortcut.kt
│ │ │ ├── viewmodel/
│ │ │ │ ├── HomeViewModel.kt
│ │ │ │ ├── MainActivityUiState.kt
│ │ │ │ ├── MainActivityViewModel.kt
│ │ │ │ ├── ModuleRepoViewModel.kt
│ │ │ │ ├── ModuleViewModel.kt
│ │ │ │ ├── SearchViewModelHelper.kt
│ │ │ │ ├── SettingsViewModel.kt
│ │ │ │ ├── SuperUserViewModel.kt
│ │ │ │ └── TemplateViewModel.kt
│ │ │ └── webui/
│ │ │ ├── AppIconUtil.kt
│ │ │ ├── Insets.kt
│ │ │ ├── MimeUtil.java
│ │ │ ├── MonetColorsProvider.kt
│ │ │ ├── SuFilePathHandler.java
│ │ │ ├── WebUIActivity.kt
│ │ │ ├── WebUIMaterial.kt
│ │ │ ├── WebUIMiuix.kt
│ │ │ ├── WebUIScreen.kt
│ │ │ ├── WebUIState.kt
│ │ │ ├── WebViewHelper.kt
│ │ │ └── WebViewInterface.kt
│ │ ├── jniLibs/
│ │ │ └── .gitignore
│ │ └── res/
│ │ ├── drawable/
│ │ │ ├── ic_launcher_foreground.xml
│ │ │ └── ic_launcher_monochrome.xml
│ │ ├── mipmap-anydpi/
│ │ │ └── ic_launcher.xml
│ │ ├── resources.properties
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ ├── values-ar/
│ │ │ └── strings.xml
│ │ ├── values-az/
│ │ │ └── strings.xml
│ │ ├── values-bg/
│ │ │ └── strings.xml
│ │ ├── values-bn/
│ │ │ └── strings.xml
│ │ ├── values-bn-rBD/
│ │ │ └── strings.xml
│ │ ├── values-bs/
│ │ │ └── strings.xml
│ │ ├── values-da/
│ │ │ └── strings.xml
│ │ ├── values-de/
│ │ │ └── strings.xml
│ │ ├── values-es/
│ │ │ └── strings.xml
│ │ ├── values-et/
│ │ │ └── strings.xml
│ │ ├── values-fa/
│ │ │ └── strings.xml
│ │ ├── values-fil/
│ │ │ └── strings.xml
│ │ ├── values-fr/
│ │ │ └── strings.xml
│ │ ├── values-gl/
│ │ │ └── strings.xml
│ │ ├── values-hi/
│ │ │ └── strings.xml
│ │ ├── values-hr/
│ │ │ └── strings.xml
│ │ ├── values-hu/
│ │ │ └── strings.xml
│ │ ├── values-in/
│ │ │ └── strings.xml
│ │ ├── values-it/
│ │ │ └── strings.xml
│ │ ├── values-iw/
│ │ │ └── strings.xml
│ │ ├── values-ja/
│ │ │ └── strings.xml
│ │ ├── values-km/
│ │ │ └── strings.xml
│ │ ├── values-kn/
│ │ │ └── strings.xml
│ │ ├── values-ko/
│ │ │ └── strings.xml
│ │ ├── values-lt/
│ │ │ └── strings.xml
│ │ ├── values-lv/
│ │ │ └── strings.xml
│ │ ├── values-mr/
│ │ │ └── strings.xml
│ │ ├── values-ms/
│ │ │ └── strings.xml
│ │ ├── values-my/
│ │ │ └── strings.xml
│ │ ├── values-night/
│ │ │ └── themes.xml
│ │ ├── values-nl/
│ │ │ └── strings.xml
│ │ ├── values-pl/
│ │ │ └── strings.xml
│ │ ├── values-pt/
│ │ │ └── strings.xml
│ │ ├── values-pt-rBR/
│ │ │ └── strings.xml
│ │ ├── values-ro/
│ │ │ └── strings.xml
│ │ ├── values-ru/
│ │ │ └── strings.xml
│ │ ├── values-sl/
│ │ │ └── strings.xml
│ │ ├── values-sr/
│ │ │ └── strings.xml
│ │ ├── values-te/
│ │ │ └── strings.xml
│ │ ├── values-th/
│ │ │ └── strings.xml
│ │ ├── values-tr/
│ │ │ └── strings.xml
│ │ ├── values-uk/
│ │ │ └── strings.xml
│ │ ├── values-vi/
│ │ │ └── strings.xml
│ │ ├── values-zh-rCN/
│ │ │ └── strings.xml
│ │ ├── values-zh-rHK/
│ │ │ └── strings.xml
│ │ ├── values-zh-rTW/
│ │ │ └── strings.xml
│ │ └── xml/
│ │ ├── backup_rules.xml
│ │ ├── data_extraction_rules.xml
│ │ ├── filepaths.xml
│ │ └── network_security_config.xml
│ ├── build.gradle.kts
│ ├── gradle/
│ │ ├── libs.versions.toml
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle.kts
│ └── sign.example.properties
├── scripts/
│ ├── allowlist.bt
│ └── ksubot.py
├── userspace/
│ ├── ksud/
│ │ ├── .cargo/
│ │ │ └── config.example.toml
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── bin/
│ │ │ ├── .gitignore
│ │ │ ├── aarch64/
│ │ │ │ ├── bootctl
│ │ │ │ └── busybox
│ │ │ └── x86_64/
│ │ │ └── busybox
│ │ ├── build.rs
│ │ └── src/
│ │ ├── apk_sign.rs
│ │ ├── assets.rs
│ │ ├── banner
│ │ ├── boot_patch.rs
│ │ ├── cli.rs
│ │ ├── cli_non_android.rs
│ │ ├── debug.rs
│ │ ├── defs.rs
│ │ ├── feature.rs
│ │ ├── init_event.rs
│ │ ├── installer.sh
│ │ ├── ksucalls.rs
│ │ ├── late_load.rs
│ │ ├── magica.rs
│ │ ├── main.rs
│ │ ├── metamodule.rs
│ │ ├── module.rs
│ │ ├── module_config.rs
│ │ ├── profile.rs
│ │ ├── resetprop.rs
│ │ ├── restorecon.rs
│ │ ├── sepolicy.rs
│ │ ├── su.rs
│ │ └── utils.rs
│ └── ksuinit/
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── build.rs
│ └── src/
│ ├── init.rs
│ ├── lib.rs
│ └── main.rs
└── website/
├── .gitignore
├── docs/
│ ├── .vitepress/
│ │ ├── config.ts
│ │ └── locales/
│ │ ├── en.ts
│ │ ├── id_ID.ts
│ │ ├── index.ts
│ │ ├── ja_JP.ts
│ │ ├── pt_BR.ts
│ │ ├── ru_RU.ts
│ │ ├── vi_VN.ts
│ │ ├── zh_CN.ts
│ │ └── zh_TW.ts
│ ├── guide/
│ │ ├── app-profile.md
│ │ ├── difference-with-magisk.md
│ │ ├── faq.md
│ │ ├── hidden-features.md
│ │ ├── how-to-build.md
│ │ ├── how-to-integrate-for-non-gki.md
│ │ ├── installation.md
│ │ ├── metamodule.md
│ │ ├── module-config.md
│ │ ├── module-webui.md
│ │ ├── module.md
│ │ ├── rescue-from-bootloop.md
│ │ ├── unofficially-support-devices.md
│ │ └── what-is-kernelsu.md
│ ├── id_ID/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── index.md
│ ├── ja_JP/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── pt_BR/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── public/
│ │ ├── ads.txt
│ │ └── templates/
│ │ ├── .gitkeep
│ │ ├── adaway.root
│ │ ├── adb
│ │ ├── cemiuiler.readproc
│ │ ├── hyperceiler.root
│ │ ├── incompetent.root
│ │ ├── kernelmanager.root
│ │ ├── nethunter.root
│ │ ├── rootexploler.root
│ │ ├── shizuku.root
│ │ ├── system
│ │ └── wireguard.root
│ ├── repos.json
│ ├── ru_RU/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── vi_VN/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ ├── zh_CN/
│ │ ├── guide/
│ │ │ ├── app-profile.md
│ │ │ ├── difference-with-magisk.md
│ │ │ ├── faq.md
│ │ │ ├── hidden-features.md
│ │ │ ├── how-to-build.md
│ │ │ ├── how-to-integrate-for-non-gki.md
│ │ │ ├── installation.md
│ │ │ ├── metamodule.md
│ │ │ ├── module-config.md
│ │ │ ├── module-webui.md
│ │ │ ├── module.md
│ │ │ ├── rescue-from-bootloop.md
│ │ │ ├── unofficially-support-devices.md
│ │ │ └── what-is-kernelsu.md
│ │ └── index.md
│ └── zh_TW/
│ ├── guide/
│ │ ├── app-profile.md
│ │ ├── difference-with-magisk.md
│ │ ├── faq.md
│ │ ├── hidden-features.md
│ │ ├── how-to-build.md
│ │ ├── how-to-integrate-for-non-gki.md
│ │ ├── installation.md
│ │ ├── metamodule.md
│ │ ├── module-config.md
│ │ ├── module-webui.md
│ │ ├── module.md
│ │ ├── rescue-from-bootloop.md
│ │ ├── unofficially-support-devices.md
│ │ └── what-is-kernelsu.md
│ └── index.md
└── package.json
SYMBOL INDEX (997 symbols across 80 files)
FILE: js/index.d.ts
type ExecOptions (line 1) | interface ExecOptions {
type ExecResults (line 6) | interface ExecResults {
type SpawnOptions (line 15) | interface SpawnOptions {
type Stdio (line 20) | interface Stdio {
type ChildProcess (line 24) | interface ChildProcess {
type PackagesInfo (line 44) | interface PackagesInfo {
FILE: js/index.js
function getUniqueCallbackName (line 2) | function getUniqueCallbackName(prefix) {
function exec (line 6) | function exec(command, options) {
function Stdio (line 34) | function Stdio() {
function ChildProcess (line 51) | function ChildProcess() {
function spawn (line 71) | function spawn(command, args, options) {
function fullScreen (line 109) | function fullScreen(isFullScreen) {
function enableEdgeToEdge (line 113) | function enableEdgeToEdge(enable) {
function toast (line 117) | function toast(message) {
function moduleInfo (line 121) | function moduleInfo() {
function listPackages (line 125) | function listPackages(type) {
function getPackagesInfo (line 133) | function getPackagesInfo(packages) {
function exit (line 144) | function exit() {
FILE: kernel/allowlist.c
type root_profile (line 35) | struct root_profile
type non_root_profile (line 36) | struct non_root_profile
function remove_uid_from_arr (line 42) | static void remove_uid_from_arr(uid_t uid)
function init_default_profiles (line 59) | static void init_default_profiles()
type perm_data (line 76) | struct perm_data {
type list_head (line 82) | struct list_head
function ksu_show_allow_list (line 91) | void ksu_show_allow_list(void)
function ksu_get_app_profile (line 103) | bool ksu_get_app_profile(struct app_profile *profile)
function forbid_system_uid (line 124) | static inline bool forbid_system_uid(uid_t uid)
function profile_valid (line 131) | static bool profile_valid(struct app_profile *profile)
function ksu_set_app_profile (line 155) | int ksu_set_app_profile(struct app_profile *profile)
function __ksu_is_allow_uid (line 257) | bool __ksu_is_allow_uid(uid_t uid)
function __ksu_is_allow_uid_for_current (line 289) | bool __ksu_is_allow_uid_for_current(uid_t uid)
function ksu_uid_should_umount (line 298) | bool ksu_uid_should_umount(uid_t uid)
function ksu_get_root_profile (line 324) | void ksu_get_root_profile(uid_t uid, struct root_profile *profile)
function ksu_get_allow_list (line 354) | bool ksu_get_allow_list(int *array, u16 length, u16 *out_length, u16 *ou...
function do_persistent_allow_list (line 382) | static void do_persistent_allow_list(struct callback_head *_cb)
function ksu_persistent_allow_list (line 424) | void ksu_persistent_allow_list()
function ksu_load_allow_list (line 450) | void ksu_load_allow_list()
function ksu_prune_allowlist (line 499) | void ksu_prune_allowlist(bool (*is_uid_valid)(uid_t, char *, void *),
function ksu_allowlist_init (line 537) | void ksu_allowlist_init(void)
function ksu_allowlist_exit (line 552) | void ksu_allowlist_exit(void)
FILE: kernel/allowlist.h
type app_profile (line 38) | struct app_profile
type app_profile (line 39) | struct app_profile
type root_profile (line 42) | struct root_profile
function is_appuid (line 44) | static inline bool is_appuid(uid_t uid)
function is_isolated_process (line 50) | static inline bool is_isolated_process(uid_t uid)
FILE: kernel/apk_sign.c
type sdesc (line 21) | struct sdesc {
type sdesc (line 26) | struct sdesc
type crypto_shash (line 26) | struct crypto_shash
type sdesc (line 28) | struct sdesc
type shash_desc (line 31) | struct shash_desc
function calc_hash (line 39) | static int calc_hash(struct crypto_shash *alg, const unsigned char *data,
function ksu_sha256 (line 56) | static int ksu_sha256(const unsigned char *data, unsigned int datalen,
function check_block (line 73) | static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *o...
type zip_entry_header (line 119) | struct zip_entry_header {
function has_v1_signature_file (line 134) | static bool has_v1_signature_file(struct file *fp)
function __always_inline (line 169) | static __always_inline bool check_v2_signature(char *path,
function set_expected_size (line 292) | static int set_expected_size(const char *val, const struct kernel_param ...
type kernel_param_ops (line 300) | struct kernel_param_ops
function get_pkg_from_apk_path (line 310) | int get_pkg_from_apk_path(char *pkg, const char *path)
function is_manager_apk (line 349) | bool is_manager_apk(char *path)
FILE: kernel/app_profile.c
type group_info (line 20) | struct group_info
type group_info (line 22) | struct group_info
function setup_groups (line 25) | void setup_groups(struct root_profile *profile, struct cred *cred)
type task_struct (line 64) | struct task_struct
function disable_seccomp (line 66) | static void disable_seccomp(void)
function escape_with_root_profile (line 106) | void escape_with_root_profile(void)
function escape_to_root_for_init (line 197) | void escape_to_root_for_init(void)
FILE: kernel/app_profile.h
type cred (line 7) | struct cred
type root_profile (line 15) | struct root_profile {
type non_root_profile (line 34) | struct non_root_profile {
type app_profile (line 38) | struct app_profile {
FILE: kernel/feature.c
type ksu_feature_handler (line 6) | struct ksu_feature_handler
function ksu_register_feature_handler (line 10) | int ksu_register_feature_handler(const struct ksu_feature_handler *handler)
function ksu_unregister_feature_handler (line 44) | int ksu_unregister_feature_handler(u32 feature_id)
function ksu_get_feature (line 70) | int ksu_get_feature(u32 feature_id, u64 *value, bool *supported)
function ksu_set_feature (line 114) | int ksu_set_feature(u32 feature_id, u64 value)
function ksu_feature_init (line 150) | void ksu_feature_init(void)
function ksu_feature_exit (line 161) | void ksu_feature_exit(void)
FILE: kernel/feature.h
type ksu_feature_id (line 6) | enum ksu_feature_id {
type ksu_feature_handler (line 16) | struct ksu_feature_handler {
type ksu_feature_handler (line 23) | struct ksu_feature_handler
FILE: kernel/file_wrapper.c
type ksu_file_wrapper (line 24) | struct ksu_file_wrapper {
type ksu_file_wrapper (line 29) | struct ksu_file_wrapper
type file (line 29) | struct file
function ksu_wrapper_open (line 31) | static int ksu_wrapper_open(struct inode *ino, struct file *fp)
type file_operations (line 50) | struct file_operations
function loff_t (line 55) | static loff_t ksu_wrapper_llseek(struct file *fp, loff_t off, int flags)
function ksu_wrapper_read (line 62) | static ssize_t ksu_wrapper_read(struct file *fp, char __user *ptr, size_...
function ksu_wrapper_write (line 70) | static ssize_t ksu_wrapper_write(struct file *fp, const char __user *ptr,
function ksu_wrapper_read_iter (line 78) | static ssize_t ksu_wrapper_read_iter(struct kiocb *iocb, struct iov_iter...
function ksu_wrapper_write_iter (line 86) | static ssize_t ksu_wrapper_write_iter(struct kiocb *iocb, struct iov_ite...
function ksu_wrapper_iopoll (line 95) | static int ksu_wrapper_iopoll(struct kiocb *kiocb, struct io_comp_batch ...
function ksu_wrapper_iopoll (line 104) | static int ksu_wrapper_iopoll(struct kiocb *kiocb, bool spin)
function ksu_wrapper_iterate (line 114) | static int ksu_wrapper_iterate(struct file *fp, struct dir_context *dc)
function ksu_wrapper_iterate_shared (line 122) | static int ksu_wrapper_iterate_shared(struct file *fp, struct dir_contex...
function __poll_t (line 129) | static __poll_t ksu_wrapper_poll(struct file *fp, struct poll_table_stru...
function ksu_wrapper_unlocked_ioctl (line 136) | static long ksu_wrapper_unlocked_ioctl(struct file *fp, unsigned int cmd,
function ksu_wrapper_compat_ioctl (line 144) | static long ksu_wrapper_compat_ioctl(struct file *fp, unsigned int cmd,
function ksu_wrapper_mmap (line 152) | static int ksu_wrapper_mmap(struct file *fp, struct vm_area_struct *vma)
function ksu_wrapper_flush (line 159) | static int ksu_wrapper_flush(struct file *fp, fl_owner_t id)
function ksu_wrapper_fsync (line 166) | static int ksu_wrapper_fsync(struct file *fp, loff_t off1, loff_t off2,
function ksu_wrapper_fasync (line 174) | static int ksu_wrapper_fasync(int arg, struct file *fp, int arg2)
function ksu_wrapper_lock (line 181) | static int ksu_wrapper_lock(struct file *fp, int arg1, struct file_lock ...
function ksu_wrapper_sendpage (line 189) | static ssize_t ksu_wrapper_sendpage(struct file *fp, struct page *pg, in...
function ksu_wrapper_get_unmapped_area (line 201) | static unsigned long ksu_wrapper_get_unmapped_area(struct file *fp,
function ksu_wrapper_flock (line 217) | static int ksu_wrapper_flock(struct file *fp, int arg1, struct file_lock...
function ksu_wrapper_splice_write (line 227) | static ssize_t ksu_wrapper_splice_write(struct pipe_inode_info *pii,
function ksu_wrapper_splice_read (line 239) | static ssize_t ksu_wrapper_splice_read(struct file *fp, loff_t *off,
function ksu_wrapper_splice_eof (line 252) | void ksu_wrapper_splice_eof(struct file *fp)
function ksu_wrapper_setlease (line 263) | static int ksu_wrapper_setlease(struct file *fp, int arg1,
function ksu_wrapper_setlease (line 274) | static int ksu_wrapper_setlease(struct file *fp, int arg1,
function ksu_wrapper_setlease (line 285) | static int ksu_wrapper_setlease(struct file *fp, long arg1,
function ksu_wrapper_fallocate (line 297) | static long ksu_wrapper_fallocate(struct file *fp, int mode, loff_t offset,
function ksu_wrapper_show_fdinfo (line 308) | static void ksu_wrapper_show_fdinfo(struct seq_file *m, struct file *f)
function ksu_wrapper_copy_file_range (line 318) | static ssize_t ksu_wrapper_copy_file_range(struct file *file_in, loff_t ...
function loff_t (line 334) | static loff_t ksu_wrapper_remap_file_range(struct file *file_in, loff_t ...
function ksu_wrapper_fadvise (line 352) | static int ksu_wrapper_fadvise(struct file *fp, loff_t off1, loff_t off2,
type ksu_file_wrapper (line 363) | struct ksu_file_wrapper
function ksu_wrapper_release (line 365) | static int ksu_wrapper_release(struct inode *inode, struct file *filp)
type ksu_file_wrapper (line 376) | struct ksu_file_wrapper
type file (line 376) | struct file
type ksu_file_wrapper (line 378) | struct ksu_file_wrapper
type ksu_file_wrapper (line 379) | struct ksu_file_wrapper
function ksu_release_file_wrapper (line 441) | static void ksu_release_file_wrapper(struct ksu_file_wrapper *data)
type dentry (line 447) | struct dentry
type path (line 450) | struct path
function ksu_wrapper_d_release (line 454) | static void ksu_wrapper_d_release(struct dentry *dentry)
type dentry_operations (line 461) | struct dentry_operations
type vfsmount (line 475) | struct vfsmount
type inode (line 477) | struct inode
type inode (line 479) | struct inode
type inode (line 481) | struct inode
type qstr (line 482) | struct qstr
type file (line 501) | struct file
type file_operations (line 502) | struct file_operations
type inode (line 503) | struct inode
type inode (line 505) | struct inode
type file (line 506) | struct file
function ksu_install_file_wrapper (line 536) | int ksu_install_file_wrapper(int fd)
function ksu_file_wrapper_init (line 611) | void ksu_file_wrapper_init(void)
FILE: kernel/kernel_umount.c
function kernel_umount_feature_get (line 23) | static int kernel_umount_feature_get(u64 *value)
function kernel_umount_feature_set (line 29) | static int kernel_umount_feature_set(u64 value)
type ksu_feature_handler (line 37) | struct ksu_feature_handler
type path (line 44) | struct path
function ksu_umount_mnt (line 46) | static void ksu_umount_mnt(struct path *path, int flags)
function try_umount (line 54) | static void try_umount(const char *mnt, int flags)
type umount_tw (line 71) | struct umount_tw {
function umount_tw_func (line 75) | static void umount_tw_func(struct callback_head *cb)
function ksu_handle_umount (line 94) | int ksu_handle_umount(uid_t old_uid, uid_t new_uid)
function ksu_kernel_umount_init (line 152) | void ksu_kernel_umount_init(void)
function ksu_kernel_umount_exit (line 159) | void ksu_kernel_umount_exit(void)
FILE: kernel/kernel_umount.h
type mount_entry (line 15) | struct mount_entry {
type list_head (line 20) | struct list_head
type rw_semaphore (line 21) | struct rw_semaphore
FILE: kernel/ksu.c
function ksu_setup_stack_chk_guard (line 34) | __attribute__((visibility("hidden")));
function kernelsu_init_early (line 47) | __attribute__((naked)) int __init kernelsu_init_early(void)
type cred (line 59) | struct cred
function kernelsu_init (line 69) | int __init kernelsu_init(void)
function kernelsu_exit (line 149) | void kernelsu_exit(void)
FILE: kernel/ksu.h
function startswith (line 14) | static inline int startswith(char *s, char *prefix)
function endswith (line 19) | static inline int endswith(const char *s, const char *t)
type cred (line 28) | struct cred
FILE: kernel/ksud.c
type work_struct (line 62) | struct work_struct
type work_struct (line 63) | struct work_struct
type work_struct (line 64) | struct work_struct
function on_post_fs_data (line 66) | void on_post_fs_data(void)
type super_block (line 82) | struct super_block
function nuke_ext4_sysfs (line 83) | int nuke_ext4_sysfs(const char *mnt)
function on_module_mounted (line 105) | void on_module_mounted(void)
function on_boot_completed (line 111) | void on_boot_completed(void)
type user_arg_ptr (line 119) | struct user_arg_ptr {
type user_arg_ptr (line 131) | struct user_arg_ptr
function count (line 161) | static int __maybe_unused count(struct user_arg_ptr argv, int max)
function on_post_fs_data_cbfun (line 186) | static void on_post_fs_data_cbfun(struct callback_head *cb)
type callback_head (line 191) | struct callback_head
function check_argv (line 194) | static bool check_argv(struct user_arg_ptr argv, int index,
function ksu_initialize_selinux_tw_func (line 219) | static void ksu_initialize_selinux_tw_func(struct callback_head *cb)
function ksu_handle_execveat_ksud (line 228) | int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
type file (line 294) | struct file
type kiocb (line 295) | struct kiocb
type iov_iter (line 295) | struct iov_iter
type file_operations (line 296) | struct file_operations
function read_proxy (line 305) | static ssize_t read_proxy(struct file *file, char __user *buf, size_t co...
function read_iter_proxy (line 339) | static ssize_t read_iter_proxy(struct kiocb *iocb, struct iov_iter *to)
function is_init_rc (line 371) | static bool is_init_rc(struct file *fp)
function ksu_handle_sys_read (line 401) | static void ksu_handle_sys_read(unsigned int fd)
function is_volumedown_enough (line 448) | static bool is_volumedown_enough(unsigned int count)
function ksu_handle_input_handle_event (line 453) | int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code,
function ksu_is_safe_mode (line 471) | bool ksu_is_safe_mode()
function sys_execve_handler_pre (line 497) | static int sys_execve_handler_pre(struct kprobe *p, struct pt_regs *regs)
function sys_read_handler_pre (line 532) | static int sys_read_handler_pre(struct kprobe *p, struct pt_regs *regs)
function sys_fstat_handler_pre (line 541) | static int sys_fstat_handler_pre(struct kretprobe_instance *p,
function sys_fstat_handler_post (line 562) | static int sys_fstat_handler_post(struct kretprobe_instance *p,
function input_handle_event_handler_pre (line 586) | static int input_handle_event_handler_pre(struct kprobe *p,
type kprobe (line 595) | struct kprobe
type kprobe (line 600) | struct kprobe
type kretprobe (line 605) | struct kretprobe
type kprobe (line 612) | struct kprobe
function do_stop_init_rc_hook (line 617) | static void do_stop_init_rc_hook(struct work_struct *work)
function do_stop_execve_hook (line 623) | static void do_stop_execve_hook(struct work_struct *work)
function do_stop_input_hook (line 628) | static void do_stop_input_hook(struct work_struct *work)
function stop_init_rc_hook (line 633) | static void stop_init_rc_hook()
function stop_execve_hook (line 639) | static void stop_execve_hook()
function stop_input_hook (line 645) | static void stop_input_hook()
function ksu_ksud_init (line 657) | void ksu_ksud_init()
function ksu_ksud_exit (line 678) | void ksu_ksud_exit()
FILE: kernel/manager.h
function ksu_is_manager_appid_valid (line 12) | static inline bool ksu_is_manager_appid_valid()
function is_manager (line 17) | static inline bool is_manager()
function is_uid_manager (line 22) | static inline bool is_uid_manager(uid_t uid)
function uid_t (line 27) | static inline uid_t ksu_get_manager_appid()
function ksu_set_manager_appid (line 32) | static inline void ksu_set_manager_appid(uid_t appid)
function ksu_invalidate_manager_uid (line 37) | static inline void ksu_invalidate_manager_uid()
FILE: kernel/pkg_observer.c
type watch_dir (line 14) | struct watch_dir {
type fsnotify_group (line 22) | struct fsnotify_group
function ksu_handle_inode_event (line 24) | static int ksu_handle_inode_event(struct fsnotify_mark *mark, u32 mask,
type fsnotify_ops (line 39) | struct fsnotify_ops
function add_mark_on_inode (line 43) | static int add_mark_on_inode(struct inode *inode, u32 mask,
function watch_one_dir (line 63) | static int watch_one_dir(struct watch_dir *wd)
function unwatch_one_dir (line 85) | static void unwatch_one_dir(struct watch_dir *wd)
type watch_dir (line 102) | struct watch_dir
function ksu_observer_init (line 105) | int ksu_observer_init(void)
function ksu_observer_exit (line 122) | void ksu_observer_exit(void)
FILE: kernel/seccomp_cache.c
type action_cache (line 11) | struct action_cache {
type seccomp_filter (line 18) | struct seccomp_filter {
function ksu_seccomp_clear_cache (line 33) | void ksu_seccomp_clear_cache(struct seccomp_filter *filter, int nr)
function ksu_seccomp_allow_cache (line 50) | void ksu_seccomp_allow_cache(struct seccomp_filter *filter, int nr)
FILE: kernel/seccomp_cache.h
type seccomp_filter (line 7) | struct seccomp_filter
type seccomp_filter (line 8) | struct seccomp_filter
FILE: kernel/selinux/rules.c
type selinux_avc (line 24) | struct selinux_avc
function reset_avc_cache (line 27) | static void reset_avc_cache()
function apply_kernelsu_rules (line 42) | void apply_kernelsu_rules()
type sepol_data (line 157) | struct sepol_data {
type sepol_batch_cursor (line 162) | struct sepol_batch_cursor {
function sepol_remaining (line 167) | static size_t sepol_remaining(const struct sepol_batch_cursor *cursor)
function sepol_read_cmd_header (line 172) | static int sepol_read_cmd_header(struct sepol_batch_cursor *cursor,
function sepol_read_string (line 185) | static int sepol_read_string(struct sepol_batch_cursor *cursor,
function sepol_require_not_all (line 217) | static int sepol_require_not_all(const char *value, const char *name)
function sepol_expected_argc (line 227) | static int sepol_expected_argc(u32 cmd)
function apply_one_sepolicy_cmd (line 252) | static int apply_one_sepolicy_cmd(struct policydb *db,
function handle_sepolicy (line 426) | int handle_sepolicy(void __user *user_data, u64 data_len)
FILE: kernel/selinux/selinux.c
function transive_to_domain (line 26) | static int transive_to_domain(const char *domain, struct cred *cred)
function setup_selinux (line 54) | void setup_selinux(const char *domain, struct cred *cred)
function setup_ksu_cred (line 62) | void setup_ksu_cred(void)
function setenforce (line 69) | void setenforce(bool enforce)
function getenforce (line 76) | bool getenforce(void)
type lsm_context (line 92) | struct lsm_context {
function __security_secid_to_secctx (line 97) | static int __security_secid_to_secctx(u32 secid, struct lsm_context *cp)
function __security_release_secctx (line 101) | static void __security_release_secctx(struct lsm_context *cp)
function cache_sid (line 115) | void cache_sid(void)
function is_sid_match (line 160) | static bool is_sid_match(const struct cred *cred, u32 cached_sid,
function is_task_ksu_domain (line 191) | bool is_task_ksu_domain(const struct cred *cred)
function is_ksu_domain (line 196) | bool is_ksu_domain(void)
function is_zygote (line 201) | bool is_zygote(const struct cred *cred)
function is_init (line 206) | bool is_init(const struct cred *cred)
FILE: kernel/selinux/selinux.h
type cred (line 17) | struct cred
type cred (line 25) | struct cred
type cred (line 29) | struct cred
type cred (line 31) | struct cred
FILE: kernel/selinux/sepolicy.c
type avtab_node (line 22) | struct avtab_node
type policydb (line 22) | struct policydb
type avtab_key (line 23) | struct avtab_key
type avtab_extended_perms (line 24) | struct avtab_extended_perms
type policydb (line 26) | struct policydb
type policydb (line 29) | struct policydb
type type_datum (line 29) | struct type_datum
type type_datum (line 30) | struct type_datum
type class_datum (line 30) | struct class_datum
type perm_datum (line 31) | struct perm_datum
type policydb (line 33) | struct policydb
type type_datum (line 33) | struct type_datum
type type_datum (line 34) | struct type_datum
type class_datum (line 34) | struct class_datum
type policydb (line 37) | struct policydb
type policydb (line 41) | struct policydb
type policydb (line 44) | struct policydb
type policydb (line 48) | struct policydb
type policydb (line 51) | struct policydb
type policydb (line 53) | struct policydb
type policydb (line 56) | struct policydb
type type_datum (line 56) | struct type_datum
type type_datum (line 57) | struct type_datum
type policydb (line 59) | struct policydb
type avtab_node (line 95) | struct avtab_node
type policydb (line 95) | struct policydb
type avtab_key (line 96) | struct avtab_key
type avtab_extended_perms (line 97) | struct avtab_extended_perms
type avtab_node (line 99) | struct avtab_node
type avtab_datum (line 120) | struct avtab_datum
type avtab_key (line 133) | struct avtab_key
type avtab_datum (line 134) | struct avtab_datum
function add_rule (line 146) | static bool add_rule(struct policydb *db, const char *s, const char *t,
function add_rule_raw (line 196) | static void add_rule_raw(struct policydb *db, struct type_datum *src,
function add_xperm_rule_raw (line 270) | static void add_xperm_rule_raw(struct policydb *db, struct type_datum *src,
function add_xperm_rule (line 358) | static bool add_xperm_rule(struct policydb *db, const char *s, const cha...
function add_type_rule (line 407) | static bool add_type_rule(struct policydb *db, const char *s, const char...
function u32 (line 450) | static u32 filenametr_hash(const void *k)
function filenametr_cmp (line 465) | static int filenametr_cmp(const void *k1, const void *k2)
type hashtab_key_params (line 482) | struct hashtab_key_params
function add_filename_trans (line 488) | static bool add_filename_trans(struct policydb *db, const char *s,
function add_genfscon (line 553) | static bool add_genfscon(struct policydb *db, const char *fs_name,
function add_type (line 587) | static bool add_type(struct policydb *db, const char *type_name, bool attr)
function set_type_state (line 662) | static bool set_type_state(struct policydb *db, const char *type_name,
function add_typeattribute_raw (line 688) | static void add_typeattribute_raw(struct policydb *db, struct type_datum...
function add_typeattribute (line 711) | static bool add_typeattribute(struct policydb *db, const char *type,
function ksu_type (line 739) | bool ksu_type(struct policydb *db, const char *name, const char *attr)
function ksu_attribute (line 744) | bool ksu_attribute(struct policydb *db, const char *name)
function ksu_permissive (line 749) | bool ksu_permissive(struct policydb *db, const char *type)
function ksu_enforce (line 754) | bool ksu_enforce(struct policydb *db, const char *type)
function ksu_typeattribute (line 759) | bool ksu_typeattribute(struct policydb *db, const char *type, const char...
function ksu_exists (line 764) | bool ksu_exists(struct policydb *db, const char *type)
function ksu_allow (line 770) | bool ksu_allow(struct policydb *db, const char *src, const char *tgt,
function ksu_deny (line 776) | bool ksu_deny(struct policydb *db, const char *src, const char *tgt,
function ksu_auditallow (line 782) | bool ksu_auditallow(struct policydb *db, const char *src, const char *tgt,
function ksu_dontaudit (line 787) | bool ksu_dontaudit(struct policydb *db, const char *src, const char *tgt,
function ksu_allowxperm (line 794) | bool ksu_allowxperm(struct policydb *db, const char *src, const char *tgt,
function ksu_auditallowxperm (line 801) | bool ksu_auditallowxperm(struct policydb *db, const char *src, const cha...
function ksu_dontauditxperm (line 808) | bool ksu_dontauditxperm(struct policydb *db, const char *src, const char...
function ksu_type_transition (line 816) | bool ksu_type_transition(struct policydb *db, const char *src, const cha...
function ksu_type_change (line 826) | bool ksu_type_change(struct policydb *db, const char *src, const char *tgt,
function ksu_type_member (line 832) | bool ksu_type_member(struct policydb *db, const char *src, const char *tgt,
function ksu_genfscon (line 839) | bool ksu_genfscon(struct policydb *db, const char *fs_name, const char *...
function copy_hashtab_node (line 854) | static int copy_hashtab_node(struct hashtab_node *new_node,
function destroy_hashtab_node (line 863) | static int destroy_hashtab_node(void *key, void *datum, void *data)
function shallow_copy_hashtab (line 869) | static int shallow_copy_hashtab(struct hashtab *new_tab,
function copy_class_datum_partially_callback (line 878) | static int
function destroy_class_datum_partially_callback (line 931) | static int destroy_class_datum_partially_callback(void *key, void *datum,
function free_class_datum_partially (line 957) | static void free_class_datum_partially(struct policydb *db)
function copy_class_datum_partially (line 970) | static int copy_class_datum_partially(struct policydb *new_db,
function copy_avtab (line 1005) | static int copy_avtab(struct avtab *new_avtab, struct avtab *old_avtab)
function copy_role_datum_partially_callback (line 1034) | static int
function destroy_role_datum_partially_callback (line 1060) | static int destroy_role_datum_partially_callback(void *key, void *datum,
function free_role_datum_partially (line 1071) | static void free_role_datum_partially(struct policydb *db)
function copy_role_datum_partially (line 1083) | static int copy_role_datum_partially(struct policydb *new_db,
function free_type_datum_partially (line 1116) | static void free_type_datum_partially(struct policydb *db)
function copy_type_datum_partially (line 1138) | static int copy_type_datum_partially(struct policydb *new_db,
function free_permissive_map (line 1205) | static void free_permissive_map(struct policydb *db)
function copy_permissive_map (line 1210) | static int copy_permissive_map(struct policydb *new_db, struct policydb ...
function free_filename_trans (line 1218) | static void free_filename_trans(struct policydb *db)
function copy_filename_trans (line 1223) | static int copy_filename_trans(struct policydb *new_db, struct policydb ...
function ksu_destroy_sepolicy (line 1232) | void ksu_destroy_sepolicy(struct selinux_policy *pol)
type selinux_policy (line 1254) | struct selinux_policy
type selinux_policy (line 1254) | struct selinux_policy
type selinux_policy (line 1257) | struct selinux_policy
type policydb (line 1262) | struct policydb
FILE: kernel/selinux/sepolicy.h
type selinux_policy (line 8) | struct selinux_policy
type selinux_policy (line 8) | struct selinux_policy
type selinux_policy (line 10) | struct selinux_policy
type policydb (line 13) | struct policydb
type policydb (line 14) | struct policydb
type policydb (line 15) | struct policydb
type policydb (line 16) | struct policydb
type policydb (line 17) | struct policydb
type policydb (line 18) | struct policydb
type policydb (line 21) | struct policydb
type policydb (line 23) | struct policydb
type policydb (line 25) | struct policydb
type policydb (line 27) | struct policydb
type policydb (line 31) | struct policydb
type policydb (line 33) | struct policydb
type policydb (line 35) | struct policydb
type policydb (line 39) | struct policydb
type policydb (line 41) | struct policydb
type policydb (line 43) | struct policydb
type policydb (line 47) | struct policydb
FILE: kernel/setuid_hook.c
function ksu_install_manager_fd_tw_func (line 25) | static void ksu_install_manager_fd_tw_func(struct callback_head *cb)
function ksu_handle_setresuid (line 31) | int ksu_handle_setresuid(uid_t ruid, uid_t euid, uid_t suid)
function ksu_setuid_hook_init (line 76) | void ksu_setuid_hook_init(void)
function ksu_setuid_hook_exit (line 81) | void ksu_setuid_hook_exit(void)
FILE: kernel/su_mount_ns.c
type path (line 23) | struct path
type pt_regs (line 28) | struct pt_regs
type pt_regs (line 30) | struct pt_regs
function ksu_sys_setns (line 33) | static long ksu_sys_setns(int fd, int flags)
function ksu_mnt_ns_global (line 51) | static void ksu_mnt_ns_global(void)
function ksu_mnt_ns_individual (line 146) | static void ksu_mnt_ns_individual(void)
function ksu_setup_mount_ns_tw_func (line 165) | static void ksu_setup_mount_ns_tw_func(struct callback_head *cb)
function setup_mount_ns (line 178) | void setup_mount_ns(int32_t ns_mode)
FILE: kernel/su_mount_ns.h
type ksu_mns_tw (line 8) | struct ksu_mns_tw {
FILE: kernel/sucompat.c
function su_compat_feature_get (line 28) | static int su_compat_feature_get(u64 *value)
function su_compat_feature_set (line 34) | static int su_compat_feature_set(u64 value)
type ksu_feature_handler (line 42) | struct ksu_feature_handler
function ksu_handle_faccessat (line 72) | int ksu_handle_faccessat(int *dfd, const char __user **filename_user, in...
function ksu_handle_stat (line 93) | int ksu_handle_stat(int *dfd, const char __user **filename_user, int *fl...
function ksu_handle_execve_sucompat (line 118) | int ksu_handle_execve_sucompat(const char __user **filename_user,
function ksu_sucompat_init (line 169) | void ksu_sucompat_init()
function ksu_sucompat_exit (line 176) | void ksu_sucompat_exit()
FILE: kernel/supercalls.c
function only_manager (line 29) | bool only_manager(void)
function only_root (line 34) | bool only_root(void)
function manager_or_root (line 39) | bool manager_or_root(void)
function always_allow (line 44) | bool always_allow(void)
function allowed_for_su (line 49) | bool allowed_for_su(void)
function do_grant_root (line 56) | static int do_grant_root(void __user *arg)
function do_get_info (line 66) | static int do_get_info(void __user *arg)
function do_report_event (line 93) | static int do_report_event(void __user *arg)
function do_set_sepolicy (line 140) | static int do_set_sepolicy(void __user *arg)
function do_check_safemode (line 151) | static int do_check_safemode(void __user *arg)
function do_new_get_allow_list_common (line 169) | static int do_new_get_allow_list_common(void __user *arg, bool allow)
function do_new_get_deny_list (line 214) | static int do_new_get_deny_list(void __user *arg)
function do_new_get_allow_list (line 219) | static int do_new_get_allow_list(void __user *arg)
function do_get_allow_list_common (line 224) | static int do_get_allow_list_common(void __user *arg, bool allow)
function do_get_deny_list (line 265) | static int do_get_deny_list(void __user *arg)
function do_get_allow_list (line 270) | static int do_get_allow_list(void __user *arg)
function do_uid_granted_root (line 275) | static int do_uid_granted_root(void __user *arg)
function do_uid_should_umount (line 293) | static int do_uid_should_umount(void __user *arg)
function do_get_manager_appid (line 311) | static int do_get_manager_appid(void __user *arg)
function do_get_app_profile (line 325) | static int do_get_app_profile(void __user *arg)
function do_set_app_profile (line 346) | static int do_set_app_profile(void __user *arg)
function do_get_feature (line 364) | static int do_get_feature(void __user *arg)
function do_set_feature (line 391) | static int do_set_feature(void __user *arg)
function do_get_wrapper_fd (line 410) | static int do_get_wrapper_fd(void __user *arg)
function do_manage_mark (line 425) | static int do_manage_mark(void __user *arg)
function do_nuke_ext4_sysfs (line 490) | static int do_nuke_ext4_sysfs(void __user *arg)
type list_head (line 520) | struct list_head
function add_try_umount (line 523) | static int add_try_umount(void __user *arg)
type ksu_ioctl_cmd_map (line 629) | struct ksu_ioctl_cmd_map
type ksu_install_fd_tw (line 713) | struct ksu_install_fd_tw {
function ksu_install_fd_tw_func (line 718) | static void ksu_install_fd_tw_func(struct callback_head *cb)
function reboot_handler_pre (line 737) | static int reboot_handler_pre(struct kprobe *p, struct pt_regs *regs)
type kprobe (line 766) | struct kprobe
function ksu_supercalls_init (line 771) | void ksu_supercalls_init(void)
function ksu_supercalls_exit (line 789) | void ksu_supercalls_exit(void)
function anon_ksu_ioctl (line 795) | static long anon_ksu_ioctl(struct file *filp, unsigned int cmd,
function anon_ksu_release (line 824) | static int anon_ksu_release(struct inode *inode, struct file *filp)
type file_operations (line 831) | struct file_operations
function ksu_install_fd (line 839) | int ksu_install_fd(void)
FILE: kernel/supercalls.h
type ksu_become_daemon_cmd (line 14) | struct ksu_become_daemon_cmd {
type ksu_get_info_cmd (line 23) | struct ksu_get_info_cmd {
type ksu_report_event_cmd (line 29) | struct ksu_report_event_cmd {
type ksu_set_sepolicy_cmd (line 33) | struct ksu_set_sepolicy_cmd {
type ksu_sepolicy_cmd_hdr (line 38) | struct ksu_sepolicy_cmd_hdr {
type ksu_check_safemode_cmd (line 50) | struct ksu_check_safemode_cmd {
type ksu_get_allow_list_cmd (line 55) | struct ksu_get_allow_list_cmd {
type ksu_new_get_allow_list_cmd (line 61) | struct ksu_new_get_allow_list_cmd {
type ksu_uid_granted_root_cmd (line 67) | struct ksu_uid_granted_root_cmd {
type ksu_uid_should_umount_cmd (line 72) | struct ksu_uid_should_umount_cmd {
type ksu_get_manager_appid_cmd (line 77) | struct ksu_get_manager_appid_cmd {
type ksu_get_app_profile_cmd (line 81) | struct ksu_get_app_profile_cmd {
type ksu_set_app_profile_cmd (line 85) | struct ksu_set_app_profile_cmd {
type ksu_get_feature_cmd (line 89) | struct ksu_get_feature_cmd {
type ksu_set_feature_cmd (line 95) | struct ksu_set_feature_cmd {
type ksu_get_wrapper_fd_cmd (line 100) | struct ksu_get_wrapper_fd_cmd {
type ksu_manage_mark_cmd (line 105) | struct ksu_manage_mark_cmd {
type ksu_nuke_ext4_sysfs_cmd (line 116) | struct ksu_nuke_ext4_sysfs_cmd {
type ksu_add_try_umount_cmd (line 120) | struct ksu_add_try_umount_cmd {
type ksu_ioctl_cmd_map (line 161) | struct ksu_ioctl_cmd_map {
FILE: kernel/syscall_hook_manager.c
function ksu_clear_task_tracepoint_flag_if_needed (line 29) | void ksu_clear_task_tracepoint_flag_if_needed(struct task_struct *t)
function handle_process_mark (line 40) | static void handle_process_mark(bool mark)
function ksu_mark_all_process (line 53) | void ksu_mark_all_process(void)
function ksu_unmark_all_process (line 59) | void ksu_unmark_all_process(void)
function ksu_mark_running_process_locked (line 65) | static void ksu_mark_running_process_locked()
function ksu_mark_running_process (line 95) | void ksu_mark_running_process()
function ksu_get_task_mark (line 110) | int ksu_get_task_mark(pid_t pid)
function ksu_set_task_mark (line 135) | int ksu_set_task_mark(pid_t pid, bool mark)
type kretprobe (line 165) | struct kretprobe
type kretprobe (line 168) | struct kretprobe
type kretprobe (line 168) | struct kretprobe
function destroy_kretprobe (line 186) | static void destroy_kretprobe(struct kretprobe **rp_ptr)
function syscall_regfunc_handler (line 197) | static int syscall_regfunc_handler(struct kretprobe_instance *ri,
function syscall_unregfunc_handler (line 214) | static int syscall_unregfunc_handler(struct kretprobe_instance *ri,
type kretprobe (line 231) | struct kretprobe
type kretprobe (line 232) | struct kretprobe
function check_syscall_fastpath (line 235) | static inline bool check_syscall_fastpath(int nr)
function ksu_handle_init_mark_tracker (line 249) | int ksu_handle_init_mark_tracker(const char __user **filename_user)
function ksu_sys_enter_handler (line 284) | static void ksu_sys_enter_handler(void *data, struct pt_regs *regs, long...
function ksu_syscall_hook_manager_init (line 333) | void ksu_syscall_hook_manager_init(void)
function ksu_syscall_hook_manager_exit (line 364) | void ksu_syscall_hook_manager_exit(void)
FILE: kernel/syscall_hook_manager.h
function ksu_set_task_tracepoint_flag (line 21) | static inline void ksu_set_task_tracepoint_flag(struct task_struct *t)
function ksu_clear_task_tracepoint_flag (line 30) | static inline void ksu_clear_task_tracepoint_flag(struct task_struct *t)
type task_struct (line 39) | struct task_struct
FILE: kernel/throne_tracker.c
type uid_data (line 19) | struct uid_data {
function crown_manager (line 25) | static void crown_manager(const char *apk, struct list_head *uid_data)
type data_path (line 49) | struct data_path {
type apk_path_hash (line 55) | struct apk_path_hash {
type list_head (line 61) | struct list_head
type my_dir_context (line 63) | struct my_dir_context {
function FILLDIR_RETURN_TYPE (line 83) | FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
function search_manager (line 163) | void search_manager(const char *path, int depth, struct list_head *uid_d...
function is_uid_exist (line 241) | static bool is_uid_exist(uid_t uid, char *package, void *data)
function track_throne (line 257) | void track_throne(bool prune_only)
function ksu_throne_tracker_init (line 350) | void ksu_throne_tracker_init()
function ksu_throne_tracker_exit (line 355) | void ksu_throne_tracker_exit()
FILE: kernel/tools/check_symbol.c
type ElfFile (line 10) | typedef struct {
function open_elf (line 18) | int open_elf(const char *path, ElfFile *elf)
function close_elf (line 64) | void close_elf(ElfFile *elf)
function Elf64_Shdr (line 69) | Elf64_Shdr *find_symtab(ElfFile *elf)
function Elf64_Shdr (line 79) | Elf64_Shdr *find_section(ElfFile *elf, const char *name)
function Elf64_Sym (line 90) | Elf64_Sym *find_symbol(ElfFile *elf, const char *name, Elf64_Shdr *symtab,
function main (line 105) | int main(int argc, char *argv[])
FILE: kernel/util.c
function try_set_access_flag (line 8) | bool try_set_access_flag(unsigned long addr)
FILE: manager/app/src/main/cpp/jni.cc
function JNIEXPORT (line 16) | JNIEXPORT jint JNICALL
function JNIEXPORT (line 27) | JNIEXPORT jint JNICALL
function JNIEXPORT (line 37) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 43) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 49) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 55) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 61) | JNIEXPORT jboolean JNICALL
function fillIntArray (line 66) | static void fillIntArray(JNIEnv *env, jobject list, int *data, int count) {
function addIntToList (line 77) | static void addIntToList(JNIEnv *env, jobject list, int ele) {
function capListToBits (line 86) | static uint64_t capListToBits(JNIEnv *env, jobject list) {
function getListSize (line 106) | static int getListSize(JNIEnv *env, jobject list) {
function fillArrayWithList (line 112) | static void fillArrayWithList(JNIEnv *env, jobject list, int *data, int ...
function JNIEXPORT (line 124) | JNIEXPORT jobject JNICALL
function JNIEXPORT (line 220) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 306) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 311) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 316) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 322) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 328) | JNIEXPORT jboolean JNICALL
function JNIEXPORT (line 334) | JNIEXPORT jstring JNICALL
function fork_dont_care_and_exec_ksud (line 343) | int fork_dont_care_and_exec_ksud(const char *path) {
function JNIEXPORT (line 379) | JNIEXPORT void JNICALL
FILE: manager/app/src/main/cpp/ksu.cc
function scan_driver_fd (line 22) | static inline int scan_driver_fd() {
function ksuctl (line 66) | static int ksuctl(unsigned long op, Args &&... args) {
type ksu_get_info_cmd (line 77) | struct ksu_get_info_cmd
function get_info (line 79) | struct ksu_get_info_cmd get_info() {
function get_version (line 86) | uint32_t get_version() {
function get_allow_list (line 91) | bool get_allow_list(struct ksu_new_get_allow_list_cmd *cmd) {
function is_safe_mode (line 95) | bool is_safe_mode() {
function is_lkm_mode (line 101) | bool is_lkm_mode() {
function is_late_load_mode (line 109) | bool is_late_load_mode() {
function is_manager (line 117) | bool is_manager() {
function is_pr_build (line 125) | bool is_pr_build() {
function uid_should_umount (line 133) | bool uid_should_umount(int uid) {
function set_app_profile (line 140) | bool set_app_profile(const app_profile *profile) {
function get_app_profile (line 146) | int get_app_profile(app_profile *profile) {
function set_su_enabled (line 153) | bool set_su_enabled(bool enabled) {
function is_su_enabled (line 160) | bool is_su_enabled() {
function get_feature (line 172) | static inline bool get_feature(uint32_t feature_id, uint64_t *out_value,...
function set_feature (line 183) | static inline bool set_feature(uint32_t feature_id, uint64_t value) {
function set_kernel_umount_enabled (line 190) | bool set_kernel_umount_enabled(bool enabled) {
function is_kernel_umount_enabled (line 194) | bool is_kernel_umount_enabled() {
FILE: manager/app/src/main/cpp/ksu.h
type root_profile (line 34) | struct root_profile {
type non_root_profile (line 53) | struct non_root_profile {
type app_profile (line 57) | struct app_profile {
type ksu_feature_id (line 87) | enum ksu_feature_id {
type ksu_get_feature_cmd (line 93) | struct ksu_get_feature_cmd {
type ksu_set_feature_cmd (line 99) | struct ksu_set_feature_cmd {
type ksu_become_daemon_cmd (line 104) | struct ksu_become_daemon_cmd {
type ksu_get_info_flag (line 108) | enum ksu_get_info_flag : uint32_t {
type ksu_get_info_cmd (line 115) | struct ksu_get_info_cmd {
type ksu_report_event_cmd (line 121) | struct ksu_report_event_cmd {
type ksu_set_sepolicy_cmd (line 125) | struct ksu_set_sepolicy_cmd {
type ksu_check_safemode_cmd (line 130) | struct ksu_check_safemode_cmd {
type ksu_new_get_allow_list_cmd (line 134) | struct ksu_new_get_allow_list_cmd {
type ksu_uid_granted_root_cmd (line 140) | struct ksu_uid_granted_root_cmd {
type ksu_uid_should_umount_cmd (line 145) | struct ksu_uid_should_umount_cmd {
type ksu_get_manager_appid_cmd (line 150) | struct ksu_get_manager_appid_cmd {
type ksu_get_app_profile_cmd (line 154) | struct ksu_get_app_profile_cmd {
type ksu_set_app_profile_cmd (line 158) | struct ksu_set_app_profile_cmd {
type ksu_new_get_allow_list_cmd (line 188) | struct ksu_new_get_allow_list_cmd
FILE: manager/app/src/main/java/me/weishu/kernelsu/magica/AppZygotePreload.java
class AppZygotePreload (line 11) | public class AppZygotePreload implements ZygotePreload {
method forkDontCareAndExecKsud (line 14) | private static native void forkDontCareAndExecKsud(String ksudPath);
method doPreload (line 16) | @Override
FILE: manager/app/src/main/java/me/weishu/kernelsu/magica/BootCompletedReceiver.java
class BootCompletedReceiver (line 10) | public class BootCompletedReceiver extends BroadcastReceiver {
method onReceive (line 12) | @Override
FILE: manager/app/src/main/java/me/weishu/kernelsu/magica/MagicaService.java
class MagicaService (line 10) | public class MagicaService extends Service {
method onBind (line 11) | @Nullable
FILE: manager/app/src/main/java/me/weishu/kernelsu/ui/util/HanziToPinyin.java
class HanziToPinyin (line 35) | public class HanziToPinyin {
method HanziToPinyin (line 346) | protected HanziToPinyin(boolean hasChinaCollator) {
method getInstance (line 350) | public static HanziToPinyin getInstance() {
method doSelfValidation (line 384) | private static boolean doSelfValidation() {
method getToken (line 403) | private Token getToken(char character) {
method get (line 472) | public ArrayList<Token> get(final String input) {
method addToken (line 520) | private void addToken(
method toPinyinString (line 527) | public String toPinyinString(String string) {
class Token (line 539) | public static class Token {
method Token (line 562) | public Token() {
method Token (line 565) | public Token(int type, String source, String target) {
FILE: manager/app/src/main/java/me/weishu/kernelsu/ui/webui/MimeUtil.java
class MimeUtil (line 21) | class MimeUtil {
method getMimeFromFileName (line 23) | public static String getMimeFromFileName(String fileName) {
method guessHardcodedMime (line 46) | private static String guessHardcodedMime(String fileName) {
FILE: manager/app/src/main/java/me/weishu/kernelsu/ui/webui/SuFilePathHandler.java
class SuFilePathHandler (line 43) | public final class SuFilePathHandler implements WebViewAssetLoader.PathH...
method SuFilePathHandler (line 91) | public SuFilePathHandler(@NonNull Context context, @NonNull File direc...
method getCanonicalDirPath (line 109) | public static String getCanonicalDirPath(@NonNull File file) throws IO...
method getCanonicalFileIfChild (line 115) | public static File getCanonicalFileIfChild(@NonNull File parent, @NonN...
method handleSvgzStream (line 125) | @NonNull
method openFile (line 131) | public static InputStream openFile(@NonNull File file, @NonNull Shell ...
method guessMimeType (line 145) | @NonNull
method isAllowedInternalStorageDir (line 151) | private boolean isAllowedInternalStorageDir(@NonNull Context context) ...
method handle (line 181) | @Override
type InsetsSupplier (line 227) | public interface InsetsSupplier {
method get (line 228) | @NonNull
type OnInsetsRequestedListener (line 232) | public interface OnInsetsRequestedListener {
method onInsetsRequested (line 233) | void onInsetsRequested(boolean enable);
FILE: scripts/ksubot.py
function get_caption (line 32) | def get_caption():
function check_environ (line 49) | def check_environ():
function main (line 84) | async def main():
FILE: userspace/ksud/build.rs
function get_git_version (line 7) | fn get_git_version() -> Result<(u32, String), std::io::Error> {
function main (line 31) | fn main() {
FILE: userspace/ksud/src/apk_sign.rs
function get_apk_signature (line 4) | pub fn get_apk_signature(apk: &str) -> Result<(u32, String)> {
function calc_cert_sha256 (line 90) | fn calc_cert_sha256(
FILE: userspace/ksud/src/assets.rs
constant RESETPROP_PATH (line 12) | pub const RESETPROP_PATH: &str = concatcp!(BINARY_DIR, "resetprop");
constant BUSYBOX_PATH (line 13) | pub const BUSYBOX_PATH: &str = concatcp!(BINARY_DIR, "busybox");
constant BOOTCTL_PATH (line 14) | pub const BOOTCTL_PATH: &str = concatcp!(BINARY_DIR, "bootctl");
function ensure_binaries (line 16) | pub fn ensure_binaries(ignore_if_exist: bool) -> anyhow::Result<()> {
type Asset (line 42) | struct Asset;
type Asset (line 48) | struct Asset;
function get_asset_data (line 50) | pub fn get_asset_data(name: &str) -> Result<std::borrow::Cow<'static, [u...
function copy_assets_to_file (line 55) | pub fn copy_assets_to_file(name: &str, dst: impl AsRef<Path>) -> Result<...
function list_supported_kmi (line 61) | pub fn list_supported_kmi() -> std::vec::Vec<std::string::String> {
FILE: userspace/ksud/src/boot_patch.rs
function ensure_gki_kernel (line 32) | pub(super) fn ensure_gki_kernel() -> Result<()> {
function get_kernel_version (line 39) | pub fn get_kernel_version() -> Result<(i32, i32, i32)> {
function parse_kmi (line 62) | fn parse_kmi(version: &str) -> Result<String> {
function parse_kmi_from_uname (line 72) | fn parse_kmi_from_uname() -> Result<String> {
function parse_kmi_from_modules (line 78) | fn parse_kmi_from_modules() -> Result<String> {
function get_current_kmi (line 95) | pub fn get_current_kmi() -> Result<String> {
function calculate_sha1 (line 99) | fn calculate_sha1(file_path: impl AsRef<Path>) -> Result<String> {
function do_backup (line 118) | pub(super) fn do_backup(
function clean_backup (line 143) | pub(super) fn clean_backup(sha1: &str) -> Result<()> {
function flash_boot (line 165) | pub(super) fn flash_boot(bootdevice: &Option<String>, new_boot: &PathBuf...
function choose_boot_partition (line 178) | pub fn choose_boot_partition(
function get_slot_suffix (line 204) | pub fn get_slot_suffix(ota: bool) -> String {
function list_available_partitions (line 217) | pub fn list_available_partitions() -> Vec<String> {
function post_ota (line 228) | pub(super) fn post_ota() -> Result<()> {
function dd (line 267) | pub(super) fn dd<P: AsRef<Path>, Q: AsRef<Path>>(ifile: P, ofile: Q) -> ...
function parse_kmi_from_kernel (line 287) | fn parse_kmi_from_kernel(kernel: &PathBuf, workdir: &Path) -> Result<Str...
function parse_kmi_from_boot (line 320) | fn parse_kmi_from_boot(magiskboot: &Path, image: &PathBuf, workdir: &Pat...
function do_cpio_cmd (line 341) | fn do_cpio_cmd(magiskboot: &Path, workdir: &Path, cpio_path: &Path, cmd:...
function is_magisk_patched (line 354) | fn is_magisk_patched(magiskboot: &Path, workdir: &Path, cpio_path: &Path...
function is_kernelsu_patched (line 367) | fn is_kernelsu_patched(magiskboot: &Path, workdir: &Path, cpio_path: &Pa...
function find_magiskboot (line 380) | fn find_magiskboot(magiskboot_path: Option<PathBuf>, workdir: &Path) -> ...
function find_boot_image (line 405) | fn find_boot_image(
type BootPatchArgs (line 447) | pub struct BootPatchArgs {
function patch (line 531) | pub fn patch(args: BootPatchArgs) -> Result<()> {
type BootRestoreArgs (line 831) | pub struct BootRestoreArgs {
function restore (line 869) | pub fn restore(args: BootRestoreArgs) -> Result<()> {
FILE: userspace/ksud/src/cli.rs
type Args (line 14) | struct Args {
type Commands (line 20) | enum Commands {
type BootInfo (line 109) | enum BootInfo {
type Debug (line 134) | enum Debug {
type MarkCommand (line 177) | enum MarkCommand {
type Sepolicy (line 204) | enum Sepolicy {
type Module (line 225) | enum Module {
type ModuleConfigCmd (line 273) | enum ModuleConfigCmd {
type Profile (line 315) | enum Profile {
type Feature (line 355) | enum Feature {
type Kernel (line 390) | enum Kernel {
type UmountOp (line 406) | enum UmountOp {
function run (line 424) | pub fn run() -> Result<()> {
FILE: userspace/ksud/src/cli_non_android.rs
type Args (line 10) | struct Args {
type Commands (line 16) | enum Commands {
function run (line 33) | pub fn run() -> Result<()> {
FILE: userspace/ksud/src/debug.rs
constant KERNEL_PARAM_PATH (line 9) | const KERNEL_PARAM_PATH: &str = "/sys/module/kernelsu";
function read_u32 (line 11) | fn read_u32(path: &PathBuf) -> Result<u32> {
function set_kernel_param (line 18) | fn set_kernel_param(uid: u32) -> Result<()> {
function get_pkg_uid (line 31) | fn get_pkg_uid(pkg: &str) -> Result<u32> {
function set_manager (line 39) | pub fn set_manager(pkg: &str) -> Result<()> {
function mark_get (line 53) | pub fn mark_get(pid: i32) -> Result<()> {
function mark_set (line 66) | pub fn mark_set(pid: i32) -> Result<()> {
function mark_unset (line 77) | pub fn mark_unset(pid: i32) -> Result<()> {
function mark_refresh (line 88) | pub fn mark_refresh() -> Result<()> {
FILE: userspace/ksud/src/defs.rs
constant ADB_DIR (line 5) | pub const ADB_DIR: &str = "/data/adb/";
constant WORKING_DIR (line 6) | pub const WORKING_DIR: &str = concatcp!(ADB_DIR, "ksu/");
constant BINARY_DIR (line 7) | pub const BINARY_DIR: &str = concatcp!(WORKING_DIR, "bin/");
constant LOG_DIR (line 8) | pub const LOG_DIR: &str = concatcp!(WORKING_DIR, "log/");
constant PROFILE_DIR (line 10) | pub const PROFILE_DIR: &str = concatcp!(WORKING_DIR, "profile/");
constant PROFILE_SELINUX_DIR (line 11) | pub const PROFILE_SELINUX_DIR: &str = concatcp!(PROFILE_DIR, "selinux/");
constant PROFILE_TEMPLATE_DIR (line 12) | pub const PROFILE_TEMPLATE_DIR: &str = concatcp!(PROFILE_DIR, "templates...
constant KSURC_PATH (line 14) | pub const KSURC_PATH: &str = concatcp!(WORKING_DIR, ".ksurc");
constant DAEMON_PATH (line 15) | pub const DAEMON_PATH: &str = concatcp!(ADB_DIR, "ksud");
constant MAGISKBOOT_PATH (line 16) | pub const MAGISKBOOT_PATH: &str = concatcp!(BINARY_DIR, "magiskboot");
constant DAEMON_LINK_PATH (line 18) | pub const DAEMON_LINK_PATH: &str = concatcp!(BINARY_DIR, "ksud");
constant MODULE_DIR (line 20) | pub const MODULE_DIR: &str = concatcp!(ADB_DIR, "modules/");
constant MODULE_UPDATE_DIR (line 21) | pub const MODULE_UPDATE_DIR: &str = concatcp!(ADB_DIR, "modules_update/");
constant METAMODULE_DIR (line 22) | pub const METAMODULE_DIR: &str = concatcp!(ADB_DIR, "metamodule/");
constant MODULE_WEB_DIR (line 24) | pub const MODULE_WEB_DIR: &str = "webroot";
constant MODULE_ACTION_SH (line 25) | pub const MODULE_ACTION_SH: &str = "action.sh";
constant DISABLE_FILE_NAME (line 26) | pub const DISABLE_FILE_NAME: &str = "disable";
constant UPDATE_FILE_NAME (line 27) | pub const UPDATE_FILE_NAME: &str = "update";
constant REMOVE_FILE_NAME (line 28) | pub const REMOVE_FILE_NAME: &str = "remove";
constant MODULE_CONFIG_DIR (line 31) | pub const MODULE_CONFIG_DIR: &str = concatcp!(WORKING_DIR, "module_confi...
constant PERSIST_CONFIG_NAME (line 32) | pub const PERSIST_CONFIG_NAME: &str = "persist.config";
constant TEMP_CONFIG_NAME (line 33) | pub const TEMP_CONFIG_NAME: &str = "tmp.config";
constant METAMODULE_MOUNT_SCRIPT (line 36) | pub const METAMODULE_MOUNT_SCRIPT: &str = "metamount.sh";
constant METAMODULE_METAINSTALL_SCRIPT (line 37) | pub const METAMODULE_METAINSTALL_SCRIPT: &str = "metainstall.sh";
constant METAMODULE_METAUNINSTALL_SCRIPT (line 38) | pub const METAMODULE_METAUNINSTALL_SCRIPT: &str = "metauninstall.sh";
constant KSU_BACKUP_DIR (line 40) | pub const KSU_BACKUP_DIR: &str = WORKING_DIR;
constant KSU_BACKUP_FILE_PREFIX (line 41) | pub const KSU_BACKUP_FILE_PREFIX: &str = "ksu_backup_";
constant BACKUP_FILENAME (line 42) | pub const BACKUP_FILENAME: &str = "stock_image.sha1";
constant VERSION_CODE (line 45) | pub const VERSION_CODE: &str = include_str!(concat!(env!("OUT_DIR"), "/V...
constant VERSION_NAME (line 46) | pub const VERSION_NAME: &str = include_str!(concat!(env!("OUT_DIR"), "/V...
FILE: userspace/ksud/src/feature.rs
constant FEATURE_CONFIG_PATH (line 10) | const FEATURE_CONFIG_PATH: &str = concatcp!(defs::WORKING_DIR, ".feature...
constant FEATURE_MAGIC (line 12) | const FEATURE_MAGIC: u32 = 0x7f4b5355;
constant FEATURE_VERSION (line 13) | const FEATURE_VERSION: u32 = 1;
type FeatureId (line 17) | pub enum FeatureId {
method from_u32 (line 23) | pub const fn from_u32(id: u32) -> Option<Self> {
method name (line 31) | pub const fn name(self) -> &'static str {
method description (line 38) | pub const fn description(self) -> &'static str {
function parse_feature_id (line 50) | fn parse_feature_id(name: &str) -> Result<FeatureId> {
function load_binary_config (line 58) | pub fn load_binary_config() -> Result<HashMap<u32, u64>> {
function save_binary_config (line 113) | pub fn save_binary_config(features: &HashMap<u32, u64>) -> Result<()> {
function apply_config (line 143) | pub fn apply_config(features: &HashMap<u32, u64>) {
function get_feature (line 166) | pub fn get_feature(id: &str) -> Result<()> {
function get_feature_config (line 187) | pub fn get_feature_config(id: &str) -> Result<()> {
function set_feature (line 209) | pub fn set_feature(id: &str, value: u64) -> Result<()> {
function list_features (line 256) | pub fn list_features() {
function load_config_and_apply (line 315) | pub fn load_config_and_apply() -> Result<()> {
function save_config (line 328) | pub fn save_config() -> Result<()> {
function check_feature (line 351) | pub fn check_feature(id: &str) -> Result<()> {
function init_features (line 378) | pub fn init_features() -> Result<()> {
FILE: userspace/ksud/src/init_event.rs
function on_post_data_fs (line 12) | pub fn on_post_data_fs() -> Result<()> {
function run_stage (line 114) | pub fn run_stage(stage: &str, block: bool) {
function on_services (line 142) | pub fn on_services() {
function on_boot_completed (line 147) | pub fn on_boot_completed() {
function catch_bootlog (line 155) | fn catch_bootlog(logname: &str, command: &[&str]) -> Result<()> {
FILE: userspace/ksud/src/ksucalls.rs
constant EVENT_POST_FS_DATA (line 8) | const EVENT_POST_FS_DATA: u32 = 1;
constant EVENT_BOOT_COMPLETED (line 9) | const EVENT_BOOT_COMPLETED: u32 = 2;
constant EVENT_MODULE_MOUNTED (line 10) | const EVENT_MODULE_MOUNTED: u32 = 3;
constant K (line 12) | const K: u32 = b'K' as u32;
constant KSU_IOCTL_GRANT_ROOT (line 13) | const KSU_IOCTL_GRANT_ROOT: i32 = _IO(K, 1);
constant KSU_IOCTL_GET_INFO (line 14) | const KSU_IOCTL_GET_INFO: i32 = _IOR::<()>(K, 2);
constant KSU_IOCTL_REPORT_EVENT (line 15) | const KSU_IOCTL_REPORT_EVENT: i32 = _IOW::<()>(K, 3);
constant KSU_IOCTL_SET_SEPOLICY (line 16) | const KSU_IOCTL_SET_SEPOLICY: i32 = _IOWR::<()>(K, 4);
constant KSU_IOCTL_CHECK_SAFEMODE (line 17) | const KSU_IOCTL_CHECK_SAFEMODE: i32 = _IOR::<()>(K, 5);
constant KSU_IOCTL_GET_FEATURE (line 18) | const KSU_IOCTL_GET_FEATURE: i32 = _IOWR::<()>(K, 13);
constant KSU_IOCTL_SET_FEATURE (line 19) | const KSU_IOCTL_SET_FEATURE: i32 = _IOW::<()>(K, 14);
constant KSU_IOCTL_GET_WRAPPER_FD (line 20) | const KSU_IOCTL_GET_WRAPPER_FD: i32 = _IOW::<()>(K, 15);
constant KSU_IOCTL_MANAGE_MARK (line 21) | const KSU_IOCTL_MANAGE_MARK: i32 = _IOWR::<()>(K, 16);
constant KSU_IOCTL_NUKE_EXT4_SYSFS (line 22) | const KSU_IOCTL_NUKE_EXT4_SYSFS: i32 = _IOW::<()>(K, 17);
constant KSU_IOCTL_ADD_TRY_UMOUNT (line 23) | const KSU_IOCTL_ADD_TRY_UMOUNT: i32 = _IOW::<()>(K, 18);
constant KSU_GET_INFO_FLAG_LATE_LOAD (line 26) | const KSU_GET_INFO_FLAG_LATE_LOAD: u32 = 1 << 2;
type GetInfoCmd (line 30) | struct GetInfoCmd {
type ReportEventCmd (line 37) | struct ReportEventCmd {
type SetSepolicyCmd (line 43) | pub struct SetSepolicyCmd {
type CheckSafemodeCmd (line 50) | struct CheckSafemodeCmd {
type GetFeatureCmd (line 56) | struct GetFeatureCmd {
type SetFeatureCmd (line 64) | struct SetFeatureCmd {
type GetWrapperFdCmd (line 71) | struct GetWrapperFdCmd {
type ManageMarkCmd (line 78) | struct ManageMarkCmd {
type NukeExt4SysfsCmd (line 86) | pub struct NukeExt4SysfsCmd {
type AddTryUmountCmd (line 92) | struct AddTryUmountCmd {
constant KSU_MARK_GET (line 99) | const KSU_MARK_GET: u32 = 1;
constant KSU_MARK_MARK (line 100) | const KSU_MARK_MARK: u32 = 2;
constant KSU_MARK_UNMARK (line 101) | const KSU_MARK_UNMARK: u32 = 3;
constant KSU_MARK_REFRESH (line 102) | const KSU_MARK_REFRESH: u32 = 4;
constant KSU_UMOUNT_WIPE (line 105) | const KSU_UMOUNT_WIPE: u8 = 0;
constant KSU_UMOUNT_ADD (line 106) | const KSU_UMOUNT_ADD: u8 = 1;
constant KSU_UMOUNT_DEL (line 107) | const KSU_UMOUNT_DEL: u8 = 2;
constant KSU_INSTALL_MAGIC1 (line 113) | const KSU_INSTALL_MAGIC1: u32 = 0xDEADBEEF;
constant KSU_INSTALL_MAGIC2 (line 114) | const KSU_INSTALL_MAGIC2: u32 = 0xCAFEBABE;
function scan_driver_fd (line 116) | fn scan_driver_fd() -> Option<RawFd> {
function init_driver_fd (line 135) | fn init_driver_fd() -> Option<RawFd> {
function ksuctl (line 155) | fn ksuctl<T>(request: i32, arg: *mut T) -> std::io::Result<i32> {
function get_info (line 170) | fn get_info() -> GetInfoCmd {
function get_version (line 182) | pub fn get_version() -> i32 {
function is_late_load (line 186) | pub fn is_late_load() -> bool {
function grant_root (line 190) | pub fn grant_root() -> std::io::Result<()> {
function report_event (line 195) | fn report_event(event: u32) {
function report_post_fs_data (line 200) | pub fn report_post_fs_data() {
function report_boot_complete (line 204) | pub fn report_boot_complete() {
function report_module_mounted (line 208) | pub fn report_module_mounted() {
function check_kernel_safemode (line 212) | pub fn check_kernel_safemode() -> bool {
function set_sepolicy (line 218) | pub fn set_sepolicy(cmd: &SetSepolicyCmd) -> std::io::Result<i32> {
function get_feature (line 225) | pub fn get_feature(feature_id: u32) -> std::io::Result<(u64, bool)> {
function set_feature (line 236) | pub fn set_feature(feature_id: u32, value: u64) -> std::io::Result<()> {
function get_wrapped_fd (line 242) | pub fn get_wrapped_fd(fd: RawFd) -> std::io::Result<RawFd> {
function mark_get (line 249) | pub fn mark_get(pid: i32) -> std::io::Result<u32> {
function mark_set (line 260) | pub fn mark_set(pid: i32) -> std::io::Result<()> {
function mark_unset (line 271) | pub fn mark_unset(pid: i32) -> std::io::Result<()> {
function mark_refresh (line 282) | pub fn mark_refresh() -> std::io::Result<()> {
function nuke_ext4_sysfs (line 292) | pub fn nuke_ext4_sysfs(mnt: &str) -> anyhow::Result<()> {
function umount_list_wipe (line 302) | pub fn umount_list_wipe() -> std::io::Result<()> {
function umount_list_add (line 313) | pub fn umount_list_add(path: &str, flags: u32) -> anyhow::Result<()> {
function umount_list_del (line 325) | pub fn umount_list_del(path: &str) -> anyhow::Result<()> {
FILE: userspace/ksud/src/late_load.rs
function dump_process_info (line 8) | fn dump_process_info(label: &str) {
function run (line 37) | pub fn run() -> Result<()> {
FILE: userspace/ksud/src/magica.rs
function resetprop (line 10) | const fn resetprop() -> ResetProp {
function exec_shell_commands (line 20) | fn exec_shell_commands(commands: &[(&str, &[&str])], log_prefix: &str) -...
function enable_adb_root (line 34) | fn enable_adb_root(port: u16) -> Result<()> {
function disable_adb_root (line 91) | pub fn disable_adb_root() -> Result<()> {
function connect_to_device (line 117) | fn connect_to_device(port: u16) -> Result<ADBTcpDevice> {
function run (line 135) | pub fn run(port: u16) -> Result<()> {
FILE: userspace/ksud/src/main.rs
function main (line 52) | fn main() -> anyhow::Result<()> {
FILE: userspace/ksud/src/metamodule.rs
function is_metamodule (line 19) | pub fn is_metamodule(props: &HashMap<String, String>) -> bool {
function get_metamodule_path (line 28) | pub fn get_metamodule_path() -> Option<PathBuf> {
function has_metamodule (line 70) | pub fn has_metamodule() -> bool {
function check_install_safety (line 78) | pub fn check_install_safety() -> Result<(), bool> {
function ensure_symlink (line 115) | pub fn ensure_symlink(module_path: &Path) -> Result<()> {
function remove_symlink (line 147) | pub fn remove_symlink() -> Result<()> {
function get_install_script (line 161) | pub fn get_install_script(
function check_metamodule_script (line 199) | fn check_metamodule_script(script_name: &str) -> Option<PathBuf> {
function exec_metauninstall_script (line 219) | pub fn exec_metauninstall_script(module_id: &str) -> Result<()> {
function exec_mount_script (line 244) | pub fn exec_mount_script(module_dir: &str) -> Result<()> {
function exec_stage_script (line 267) | pub fn exec_stage_script(stage: &str, block: bool) -> Result<()> {
FILE: userspace/ksud/src/module.rs
constant INSTALLER_CONTENT (line 33) | const INSTALLER_CONTENT: &str = include_str!("./installer.sh");
constant INSTALL_MODULE_SCRIPT (line 34) | const INSTALL_MODULE_SCRIPT: &str = concatcp!(
function validate_module_id (line 48) | pub fn validate_module_id(module_id: &str) -> Result<()> {
function get_common_script_envs (line 60) | pub fn get_common_script_envs() -> Vec<(&'static str, String)> {
function exec_install_script (line 84) | fn exec_install_script(module_file: &str, is_metamodule: bool) -> Result...
function ensure_boot_completed (line 103) | fn ensure_boot_completed() -> Result<()> {
type ModuleType (line 112) | pub enum ModuleType {
function foreach_module (line 119) | pub fn foreach_module(
function foreach_active_module (line 150) | fn foreach_active_module(f: impl FnMut(&Path) -> Result<()>) -> Result<(...
function load_sepolicy_rule (line 154) | pub fn load_sepolicy_rule() -> Result<()> {
function exec_script (line 171) | pub fn exec_script<T: AsRef<Path>>(path: T, wait: bool) -> Result<()> {
function exec_stage_script (line 242) | pub fn exec_stage_script(stage: &str, block: bool) -> Result<()> {
function exec_common_scripts (line 265) | pub fn exec_common_scripts(dir: &str, wait: bool) -> Result<()> {
function load_system_prop (line 287) | pub fn load_system_prop() -> Result<()> {
function prune_modules (line 303) | pub fn prune_modules() -> Result<()> {
function handle_updated_modules (line 362) | pub fn handle_updated_modules() -> Result<()> {
function install_module_to_system (line 397) | fn install_module_to_system(zip: &str) -> Result<()> {
function install_module (line 543) | pub fn install_module(zip: &str) -> Result<()> {
function undo_uninstall_module (line 551) | pub fn undo_uninstall_module(id: &str) -> Result<()> {
function uninstall_module (line 568) | pub fn uninstall_module(id: &str) -> Result<()> {
function run_action (line 583) | pub fn run_action(id: &str) -> Result<()> {
function enable_module (line 590) | pub fn enable_module(id: &str) -> Result<()> {
function disable_module (line 607) | pub fn disable_module(id: &str) -> Result<()> {
function disable_all_modules (line 619) | pub fn disable_all_modules() -> Result<()> {
function uninstall_all_modules (line 623) | pub fn uninstall_all_modules() -> Result<()> {
function mark_all_modules (line 628) | fn mark_all_modules(flag_file: &str) -> Result<()> {
function read_module_prop (line 643) | pub fn read_module_prop(module_path: &Path) -> Result<HashMap<String, St...
function resolve_module_icon_path (line 665) | fn resolve_module_icon_path(
function list_module (line 713) | fn list_module(path: &str) -> Vec<HashMap<String, String>> {
function list_modules (line 809) | pub fn list_modules() -> Result<()> {
function get_managed_features (line 818) | pub fn get_managed_features() -> Result<HashMap<String, Vec<String>>> {
FILE: userspace/ksud/src/module_config.rs
constant MODULE_CONFIG_MAGIC (line 12) | const MODULE_CONFIG_MAGIC: u32 = 0x4b53554d;
constant MODULE_CONFIG_VERSION (line 13) | const MODULE_CONFIG_VERSION: u32 = 1;
constant MAX_CONFIG_KEY_LEN (line 16) | pub const MAX_CONFIG_KEY_LEN: usize = 256;
constant MAX_CONFIG_VALUE_LEN (line 17) | pub const MAX_CONFIG_VALUE_LEN: usize = 1024 * 1024;
constant MAX_CONFIG_COUNT (line 18) | pub const MAX_CONFIG_COUNT: usize = 32;
type ConfigType (line 21) | pub enum ConfigType {
method filename (line 27) | const fn filename(self) -> &'static str {
function parse_bool_config (line 37) | pub fn parse_bool_config(value: &str) -> bool {
function validate_config_key (line 47) | pub fn validate_config_key(key: &str) -> Result<()> {
function validate_config_value (line 72) | pub fn validate_config_value(value: &str) -> Result<()> {
function validate_config_count (line 86) | fn validate_config_count(config: &HashMap<String, String>) -> Result<()> {
function get_config_dir (line 98) | fn get_config_dir(module_id: &str) -> PathBuf {
function get_config_path (line 103) | fn get_config_path(module_id: &str, config_type: ConfigType) -> PathBuf {
function ensure_config_dir (line 108) | fn ensure_config_dir(module_id: &str) -> Result<PathBuf> {
function load_config (line 115) | pub fn load_config(module_id: &str, config_type: ConfigType) -> Result<H...
function save_config (line 195) | pub fn save_config(
function get_config_value (line 279) | pub fn get_config_value(
function set_config_value (line 289) | pub fn set_config_value(
function delete_config_value (line 308) | pub fn delete_config_value(module_id: &str, key: &str, config_type: Conf...
function clear_config (line 320) | pub fn clear_config(module_id: &str, config_type: ConfigType) -> Result<...
function merge_configs (line 333) | pub fn merge_configs(module_id: &str) -> Result<HashMap<String, String>> {
function get_all_module_configs (line 362) | pub fn get_all_module_configs() -> Result<HashMap<String, HashMap<String...
function clear_all_temp_configs (line 400) | pub fn clear_all_temp_configs() -> Result<()> {
function clear_module_configs (line 442) | pub fn clear_module_configs(module_id: &str) -> Result<()> {
FILE: userspace/ksud/src/profile.rs
function set_sepolicy (line 6) | pub fn set_sepolicy(pkg: String, policy: String) -> Result<()> {
function get_sepolicy (line 14) | pub fn get_sepolicy(pkg: String) -> Result<()> {
function set_template (line 22) | pub fn set_template(id: String, template: String) -> Result<()> {
function get_template (line 29) | pub fn get_template(id: String) -> Result<()> {
function delete_template (line 36) | pub fn delete_template(id: String) -> Result<()> {
function list_templates (line 42) | pub fn list_templates() -> Result<()> {
function apply_sepolies (line 57) | pub fn apply_sepolies() -> Result<()> {
FILE: userspace/ksud/src/resetprop.rs
type Args (line 20) | struct Args {
function run_from_args (line 72) | pub fn run_from_args(args: &[String]) -> Result<()> {
function load_system_prop_file (line 176) | pub fn load_system_prop_file(path: &Path) -> Result<()> {
FILE: userspace/ksud/src/restorecon.rs
constant SYSTEM_CON (line 9) | pub const SYSTEM_CON: &str = "u:object_r:system_file:s0";
constant ADB_CON (line 10) | pub const ADB_CON: &str = "u:object_r:adb_data_file:s0";
constant UNLABEL_CON (line 11) | pub const UNLABEL_CON: &str = "u:object_r:unlabeled:s0";
constant SELINUX_XATTR (line 13) | const SELINUX_XATTR: &str = "security.selinux";
function lsetfilecon (line 15) | pub fn lsetfilecon<P: AsRef<Path>>(path: P, con: &str) -> Result<()> {
function lgetfilecon (line 25) | pub fn lgetfilecon<P: AsRef<Path>>(path: P) -> Result<String> {
function setsyscon (line 36) | pub fn setsyscon<P: AsRef<Path>>(path: P) -> Result<()> {
function restore_syscon (line 40) | pub fn restore_syscon<P: AsRef<Path>>(dir: P) -> Result<()> {
function restore_syscon_if_unlabeled (line 49) | fn restore_syscon_if_unlabeled<P: AsRef<Path>>(dir: P) -> Result<()> {
function restorecon (line 61) | pub fn restorecon() -> Result<()> {
FILE: userspace/ksud/src/sepolicy.rs
type SeObject (line 12) | type SeObject<'a> = Vec<&'a str>;
function is_sepolicy_char (line 14) | fn is_sepolicy_char(c: char) -> bool {
function parse_single_word (line 18) | fn parse_single_word(input: &str) -> IResult<&str, &str> {
function parse_bracket_objs (line 22) | fn parse_bracket_objs(input: &str) -> IResult<&str, SeObject<'_>> {
function parse_single_obj (line 32) | fn parse_single_obj(input: &str) -> IResult<&str, SeObject<'_>> {
function parse_star (line 37) | fn parse_star(input: &str) -> IResult<&str, SeObject<'_>> {
function parse_seobj (line 45) | fn parse_seobj(input: &str) -> IResult<&str, SeObject<'_>> {
function parse_seobj_no_star (line 50) | fn parse_seobj_no_star(input: &str) -> IResult<&str, SeObject<'_>> {
type SeObjectParser (line 55) | trait SeObjectParser<'a> {
method parse (line 56) | fn parse(input: &'a str) -> IResult<&'a str, Self>
type NormalPerm (line 62) | struct NormalPerm<'a> {
type XPerm (line 71) | struct XPerm<'a> {
type TypeState (line 81) | struct TypeState<'a> {
type TypeAttr (line 87) | struct TypeAttr<'a> {
type Type (line 93) | struct Type<'a> {
type Attr (line 99) | struct Attr<'a> {
type TypeTransition (line 104) | struct TypeTransition<'a> {
type TypeChange (line 113) | struct TypeChange<'a> {
type GenFsCon (line 122) | struct GenFsCon<'a> {
type PolicyStatement (line 129) | enum PolicyStatement<'a> {
function parse (line 166) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 188) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 215) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 226) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 243) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 255) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 265) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 294) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse (line 310) | fn parse(input: &'a str) -> IResult<&'a str, Self>
function parse (line 326) | fn parse(input: &'a str) -> IResult<&'a str, Self> {
function parse_sepolicy (line 347) | fn parse_sepolicy<'a, 'b>(input: &'b str, strict: bool) -> Result<Vec<Po...
constant CMD_NORMAL_PERM (line 367) | const CMD_NORMAL_PERM: u32 = 1;
constant CMD_XPERM (line 368) | const CMD_XPERM: u32 = 2;
constant CMD_TYPE_STATE (line 369) | const CMD_TYPE_STATE: u32 = 3;
constant CMD_TYPE (line 370) | const CMD_TYPE: u32 = 4;
constant CMD_TYPE_ATTR (line 371) | const CMD_TYPE_ATTR: u32 = 5;
constant CMD_ATTR (line 372) | const CMD_ATTR: u32 = 6;
constant CMD_TYPE_TRANSITION (line 373) | const CMD_TYPE_TRANSITION: u32 = 7;
constant CMD_TYPE_CHANGE (line 374) | const CMD_TYPE_CHANGE: u32 = 8;
constant CMD_GENFSCON (line 375) | const CMD_GENFSCON: u32 = 9;
constant SUBCMD_NORMAL_PERM_ALLOW (line 377) | const SUBCMD_NORMAL_PERM_ALLOW: u32 = 1;
constant SUBCMD_NORMAL_PERM_DENY (line 378) | const SUBCMD_NORMAL_PERM_DENY: u32 = 2;
constant SUBCMD_NORMAL_PERM_AUDITALLOW (line 379) | const SUBCMD_NORMAL_PERM_AUDITALLOW: u32 = 3;
constant SUBCMD_NORMAL_PERM_DONTAUDIT (line 380) | const SUBCMD_NORMAL_PERM_DONTAUDIT: u32 = 4;
constant SUBCMD_XPERM_ALLOW (line 382) | const SUBCMD_XPERM_ALLOW: u32 = 1;
constant SUBCMD_XPERM_AUDITALLOW (line 383) | const SUBCMD_XPERM_AUDITALLOW: u32 = 2;
constant SUBCMD_XPERM_DONTAUDIT (line 384) | const SUBCMD_XPERM_DONTAUDIT: u32 = 3;
constant SUBCMD_TYPE_STATE_PERMISSIVE (line 386) | const SUBCMD_TYPE_STATE_PERMISSIVE: u32 = 1;
constant SUBCMD_TYPE_STATE_ENFORCE (line 387) | const SUBCMD_TYPE_STATE_ENFORCE: u32 = 2;
constant SUBCMD_TYPE_CHANGE_CHANGE (line 389) | const SUBCMD_TYPE_CHANGE_CHANGE: u32 = 1;
constant SUBCMD_TYPE_CHANGE_MEMBER (line 390) | const SUBCMD_TYPE_CHANGE_MEMBER: u32 = 2;
type PolicyObject (line 393) | enum PolicyObject {
type Error (line 401) | type Error = anyhow::Error;
method try_from (line 402) | fn try_from(s: &str) -> Result<Self> {
type AtomicStatement (line 417) | struct AtomicStatement {
type Error (line 430) | type Error = anyhow::Error;
function try_from (line 431) | fn try_from(perm: &'a NormalPerm<'a>) -> Result<Self> {
type Error (line 464) | type Error = anyhow::Error;
function try_from (line 465) | fn try_from(perm: &'a XPerm<'a>) -> Result<Self> {
type Error (line 495) | type Error = anyhow::Error;
function try_from (line 496) | fn try_from(perm: &'a TypeState<'a>) -> Result<Self> {
type Error (line 521) | type Error = anyhow::Error;
function try_from (line 522) | fn try_from(perm: &'a Type<'a>) -> Result<Self> {
type Error (line 542) | type Error = anyhow::Error;
function try_from (line 543) | fn try_from(perm: &'a TypeAttr<'a>) -> Result<Self> {
type Error (line 565) | type Error = anyhow::Error;
function try_from (line 566) | fn try_from(perm: &'a Attr<'a>) -> Result<Self> {
type Error (line 583) | type Error = anyhow::Error;
function try_from (line 584) | fn try_from(perm: &'a TypeTransition<'a>) -> Result<Self> {
type Error (line 606) | type Error = anyhow::Error;
function try_from (line 607) | fn try_from(perm: &'a TypeChange<'a>) -> Result<Self> {
type Error (line 630) | type Error = anyhow::Error;
function try_from (line 631) | fn try_from(perm: &'a GenFsCon<'a>) -> Result<Self> {
type Error (line 648) | type Error = anyhow::Error;
function try_from (line 649) | fn try_from(value: &'a PolicyStatement) -> Result<Self> {
function cmd_expected_argc (line 664) | const fn cmd_expected_argc(cmd: u32) -> Option<usize> {
function encode_policy_object (line 675) | fn encode_policy_object(payload: &mut Vec<u8>, object: &PolicyObject) ->...
function append_atomic_statement (line 689) | fn append_atomic_statement(payload: &mut Vec<u8>, statement: &AtomicStat...
function serialize_atomic_statements (line 713) | fn serialize_atomic_statements(statements: &[AtomicStatement]) -> Result...
function flatten_atomic_statements (line 721) | fn flatten_atomic_statements<'a>(
function apply_rules_batch (line 732) | fn apply_rules_batch<'a>(statements: &'a [PolicyStatement<'a>], strict: ...
function live_patch (line 771) | pub fn live_patch(policy: &str) -> Result<()> {
function apply_file (line 780) | pub fn apply_file<P: AsRef<Path>>(path: P) -> Result<()> {
function check_rule (line 785) | pub fn check_rule(policy: &str) -> Result<()> {
FILE: userspace/ksud/src/su.rs
function grant_root (line 24) | pub fn grant_root(global_mnt: bool) -> Result<()> {
function print_usage (line 41) | fn print_usage(program: &str, opts: &Options) {
function set_identity (line 46) | fn set_identity(uid: u32, gid: u32, groups: &[u32]) {
function wrap_tty (line 61) | fn wrap_tty(fd: c_int) {
function root_shell (line 82) | pub fn root_shell() -> Result<()> {
function add_path_to_env (line 290) | fn add_path_to_env(path: &str) -> Result<()> {
FILE: userspace/ksud/src/utils.rs
function ensure_clean_dir (line 41) | pub fn ensure_clean_dir(dir: impl AsRef<Path>) -> Result<()> {
function ensure_file_exists (line 51) | pub fn ensure_file_exists<T: AsRef<Path>>(file: T) -> Result<()> {
function ensure_dir_exists (line 65) | pub fn ensure_dir_exists<T: AsRef<Path>>(dir: T) -> Result<()> {
function ensure_binary (line 74) | pub fn ensure_binary<T: AsRef<Path>>(
function getprop (line 103) | pub fn getprop(prop: &str) -> Option<String> {
function is_safe_mode (line 107) | pub fn is_safe_mode() -> bool {
function get_zip_uncompressed_size (line 123) | pub fn get_zip_uncompressed_size(zip_path: &str) -> Result<u64> {
function switch_mnt_ns (line 131) | pub fn switch_mnt_ns(pid: i32) -> Result<()> {
function switch_cgroup (line 146) | fn switch_cgroup(grp: &str, pid: u32) {
function switch_cgroups (line 158) | pub fn switch_cgroups() {
function umask (line 172) | pub fn umask(mask: u32) {
function has_magisk (line 176) | pub fn has_magisk() -> bool {
function link_ksud_to_bin (line 180) | fn link_ksud_to_bin() -> Result<()> {
function install (line 189) | pub fn install(magiskboot: Option<PathBuf>) -> Result<()> {
function uninstall (line 209) | pub fn uninstall(magiskboot_path: Option<PathBuf>) -> Result<()> {
FILE: userspace/ksuinit/build.rs
function main (line 1) | fn main() {
FILE: userspace/ksuinit/src/init.rs
type AutoUmount (line 14) | struct AutoUmount {
method drop (line 19) | fn drop(&mut self) {
function mount_filesystem (line 28) | fn mount_filesystem(name: &str, mountpoint: &str) -> Result<()> {
function prepare_mount (line 50) | fn prepare_mount() -> AutoUmount {
function setup_kmsg (line 68) | fn setup_kmsg() {
function unlimit_kmsg (line 89) | fn unlimit_kmsg() {
function init (line 99) | pub fn init() -> Result<()> {
function load_module_from_path (line 134) | fn load_module_from_path(path: &str) -> Result<()> {
FILE: userspace/ksuinit/src/lib.rs
type Kptr (line 8) | struct Kptr {
method new (line 13) | pub fn new() -> Result<Self> {
method drop (line 21) | fn drop(&mut self) {
function parse_kallsyms (line 26) | fn parse_kallsyms() -> Result<HashMap<String, u64>> {
function load_module (line 55) | pub fn load_module(data: &[u8]) -> Result<()> {
function has_kernelsu_legacy (line 99) | fn has_kernelsu_legacy() -> bool {
function has_kernelsu_v2 (line 117) | fn has_kernelsu_v2() -> bool {
function has_kernelsu (line 169) | pub fn has_kernelsu() -> bool {
FILE: userspace/ksuinit/src/main.rs
function main (line 12) | pub unsafe extern "C" fn main(_argc: i32, argv: *const *const u8, envp: ...
FILE: website/docs/.vitepress/locales/en.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
FILE: website/docs/.vitepress/locales/id_ID.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
FILE: website/docs/.vitepress/locales/ja_JP.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
FILE: website/docs/.vitepress/locales/pt_BR.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
FILE: website/docs/.vitepress/locales/ru_RU.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
FILE: website/docs/.vitepress/locales/vi_VN.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
FILE: website/docs/.vitepress/locales/zh_CN.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
FILE: website/docs/.vitepress/locales/zh_TW.ts
function nav (line 36) | function nav() {
function sidebarGuide (line 42) | function sidebarGuide() {
Condensed preview — 542 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,245K chars).
[
{
"path": ".gitattributes",
"chars": 14,
"preview": "*.bat eol=crlf"
},
{
"path": ".github/FUNDING.yml",
"chars": 77,
"preview": "# These are supported funding model platforms\n\ngithub: tiann\npatreon: weishu\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.yml",
"chars": 1893,
"preview": "name: Bug report\ndescription: Create a report to help us improve KernelSU\nlabels: [Bug]\n\nbody:\n - type: checkboxes\n "
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 213,
"preview": "blank_issues_enabled: false\ncontact_links:\n - name: Feature Request\n url: https://github.com/tiann/KernelSU/issues/1"
},
{
"path": ".github/ISSUE_TEMPLATE/custom.yml",
"chars": 291,
"preview": "name: Custom issue template\ndescription: WARNING! If you are reporting a bug but use this template, the issue will be cl"
},
{
"path": ".github/dependabot.yml",
"chars": 907,
"preview": "version: 2\nupdates:\n - package-ecosystem: github-actions\n directory: /\n schedule:\n interval: weekly\n grou"
},
{
"path": ".github/workflows/build-lkm.yml",
"chars": 869,
"preview": "name: Build LKM for KernelSU\non:\n workflow_call:\n inputs:\n expected_size2:\n description: 'Second expecte"
},
{
"path": ".github/workflows/build-manager.yml",
"chars": 8822,
"preview": "name: Build Manager\n\non:\n push:\n branches: [ \"main\", \"dev\", \"ci\" ]\n paths:\n - '.github/workflows/build-manag"
},
{
"path": ".github/workflows/clang-format.yml",
"chars": 555,
"preview": "name: ClangFormat check\n\non:\n push:\n branches:\n - 'main'\n paths:\n - '.github/workflows/clang-format.yml"
},
{
"path": ".github/workflows/clippy.yml",
"chars": 1126,
"preview": "name: Clippy check\n\non:\n push:\n branches:\n - main\n paths:\n - '.github/workflows/clippy.yml'\n - 'us"
},
{
"path": ".github/workflows/ddk-lkm.yml",
"chars": 2657,
"preview": "name: Build KernelSU Kernel Module\n\non:\n workflow_call:\n inputs:\n kmi:\n description: 'KMI version'\n "
},
{
"path": ".github/workflows/deploy-website.yml",
"chars": 1748,
"preview": "name: Deploy Website\n\non:\n push:\n branches:\n - main\n - website\n paths:\n - '.github/workflows/deplo"
},
{
"path": ".github/workflows/ksud.yml",
"chars": 1689,
"preview": "name: Build ksud\non:\n workflow_call:\n inputs:\n target:\n required: true\n type: string\n os:\n "
},
{
"path": ".github/workflows/ksuinit.yml",
"chars": 1038,
"preview": "name: Build ksuinit\non:\n workflow_call:\n inputs:\n os:\n required: false\n type: string\n defa"
},
{
"path": ".github/workflows/release.yml",
"chars": 1134,
"preview": "name: Release\non:\n push:\n tags:\n - \"v*\"\n workflow_dispatch:\n\njobs:\n build-manager:\n uses: ./.github/workfl"
},
{
"path": ".github/workflows/rustfmt.yml",
"chars": 753,
"preview": "name: Rustfmt check\n\non:\n push:\n branches:\n - 'main'\n paths:\n - '.github/workflows/rustfmt.yml'\n -"
},
{
"path": ".github/workflows/shellcheck.yml",
"chars": 521,
"preview": "name: ShellCheck\n\non:\n push:\n branches:\n - 'main'\n paths:\n - '.github/workflows/shellcheck.yml'\n -"
},
{
"path": ".gitignore",
"chars": 44,
"preview": ".idea\n.vscode\nCLAUDE.md\nAGENTS.md\n.DS_Store\n"
},
{
"path": "LICENSE",
"chars": 35149,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "SECURITY.md",
"chars": 730,
"preview": "# Reporting Security Issues\n\nThe KernelSU team and community take security bugs in KernelSU seriously. We appreciate you"
},
{
"path": "docs/README.md",
"chars": 2955,
"preview": "**English** | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README"
},
{
"path": "docs/README_CN.md",
"chars": 2387,
"preview": "[English](README.md) | [Español](README_ES.md) | **简体中文** | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR"
},
{
"path": "docs/README_ES.md",
"chars": 3109,
"preview": "[English](README.md) | **Español** | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어](README_KR"
},
{
"path": "docs/README_ID.md",
"chars": 2848,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "docs/README_IN.md",
"chars": 2734,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "docs/README_IT.md",
"chars": 3420,
"preview": "[English](REAME.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국어"
},
{
"path": "docs/README_IW.md",
"chars": 2674,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "docs/README_JP.md",
"chars": 2483,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | **日本語** | [한국어](README_KR"
},
{
"path": "docs/README_KR.md",
"chars": 2478,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | **한"
},
{
"path": "docs/README_PL.md",
"chars": 2923,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "docs/README_PT-BR.md",
"chars": 3135,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "docs/README_RU.md",
"chars": 2659,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "docs/README_TR.md",
"chars": 3032,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "docs/README_TW.md",
"chars": 2559,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | **繁體中文** | [日本語](README_JP.md) | [한국어](README_KR"
},
{
"path": "docs/README_VI.md",
"chars": 2966,
"preview": "[English](README.md) | [Español](README_ES.md) | [简体中文](README_CN.md) | [繁體中文](README_TW.md) | [日本語](README_JP.md) | [한국"
},
{
"path": "fastlane/metadata/android/en-US/full_description.txt",
"chars": 692,
"preview": "<p><i>KernelSU</i> is a Kernel based root solution for Android devices. It features kernel-based <code>su</code> and roo"
},
{
"path": "fastlane/metadata/android/en-US/short_description.txt",
"chars": 38,
"preview": "Kernel based root solution for Android"
},
{
"path": "js/README.md",
"chars": 4430,
"preview": "# Library for KernelSU's module WebUI\n\n## Install\n\n```sh\nyarn add kernelsu\n```\n\n## API\n\n### exec\n\nSpawns a **root** shel"
},
{
"path": "js/index.d.ts",
"chars": 1598,
"preview": "interface ExecOptions {\n cwd?: string,\n env?: { [key: string]: string }\n}\n\ninterface ExecResults {\n errno: numb"
},
{
"path": "js/index.js",
"chars": 3268,
"preview": "let callbackCounter = 0;\nfunction getUniqueCallbackName(prefix) {\n return `${prefix}_callback_${Date.now()}_${callbackC"
},
{
"path": "js/package.json",
"chars": 545,
"preview": "{\n \"name\": \"kernelsu\",\n \"version\": \"3.0.2\",\n \"description\": \"Library for KernelSU's module WebUI\",\n \"main\": \"index.j"
},
{
"path": "justfile",
"chars": 610,
"preview": "alias bk := build_ksud\nalias bm := build_manager\n\nbuild_ksud:\n cross build --target aarch64-linux-android --release -"
},
{
"path": "kernel/.clang-format",
"chars": 16672,
"preview": "# SPDX-License-Identifier: GPL-2.0\n#\n# clang-format configuration file. Intended for clang-format >= 4.\n#\n# For more inf"
},
{
"path": "kernel/.clangd",
"chars": 90,
"preview": "Diagnostics:\n UnusedIncludes: Strict\n ClangTidy:\n Remove: bugprone-sizeof-expression\n"
},
{
"path": "kernel/.gitignore",
"chars": 217,
"preview": ".cache/\n.thinlto-cache/\ncompile_commands.json\n*.ko\n*.o\n*.mod\n*.lds\n*.mod.o\n.*.o*\n.*.mod*\n*.ko*\n*.mod.c\n*.symvers*\n*.orde"
},
{
"path": "kernel/Kbuild",
"chars": 3436,
"preview": "kernelsu-objs := ksu.o\nkernelsu-objs += allowlist.o\nkernelsu-objs += app_profile.o\nkernelsu-objs += apk_sign.o\nkernelsu-"
},
{
"path": "kernel/Kconfig",
"chars": 483,
"preview": "menu \"KernelSU\"\n\nconfig KSU\n\ttristate \"KernelSU function support\"\n\tdepends on KPROBES && EXT4_FS\n\tdefault y\n\thelp\n\t Ena"
},
{
"path": "kernel/LICENSE",
"chars": 18092,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
},
{
"path": "kernel/Makefile",
"chars": 735,
"preview": "KDIR := $(KDIR)\nMDIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))\n\n$(info -- KDIR: $(KDIR))\n$(info -- M"
},
{
"path": "kernel/allowlist.c",
"chars": 15932,
"preview": "#include <linux/rcupdate.h>\n#include <linux/limits.h>\n#include <linux/rculist.h>\n#include <linux/mutex.h>\n#include <linu"
},
{
"path": "kernel/allowlist.h",
"chars": 1630,
"preview": "#ifndef __KSU_H_ALLOWLIST\n#define __KSU_H_ALLOWLIST\n\n#include <linux/types.h>\n#include <linux/uidgid.h>\n#include \"app_pr"
},
{
"path": "kernel/apk_sign.c",
"chars": 10173,
"preview": "#include <linux/err.h>\n#include <linux/fs.h>\n#include <linux/gfp.h>\n#include <linux/kernel.h>\n#include <linux/slab.h>\n#i"
},
{
"path": "kernel/apk_sign.h",
"chars": 180,
"preview": "#ifndef __KSU_H_APK_V2_SIGN\n#define __KSU_H_APK_V2_SIGN\n\n#include <linux/types.h>\n\nbool is_manager_apk(char *path);\nint "
},
{
"path": "kernel/app_profile.c",
"chars": 6437,
"preview": "#include <linux/capability.h>\n#include <linux/cred.h>\n#include <linux/sched.h>\n#include <linux/sched/user.h>\n#include <l"
},
{
"path": "kernel/app_profile.h",
"chars": 1501,
"preview": "#ifndef __KSU_H_APP_PROFILE\n#define __KSU_H_APP_PROFILE\n\n#include <linux/types.h>\n\n// Forward declarations\nstruct cred;\n"
},
{
"path": "kernel/arch.h",
"chars": 2520,
"preview": "#ifndef __KSU_H_ARCH\n#define __KSU_H_ARCH\n\n#include <linux/version.h>\n\n#if defined(__aarch64__)\n\n#define __PT_PARM1_REG "
},
{
"path": "kernel/feature.c",
"chars": 4014,
"preview": "#include \"feature.h\"\n#include \"klog.h\" // IWYU pragma: keep\n\n#include <linux/mutex.h>\n\nstatic const struct ksu_feature_h"
},
{
"path": "kernel/feature.h",
"chars": 758,
"preview": "#ifndef __KSU_H_FEATURE\n#define __KSU_H_FEATURE\n\n#include <linux/types.h>\n\nenum ksu_feature_id {\n KSU_FEATURE_SU_COMP"
},
{
"path": "kernel/file_wrapper.c",
"chars": 21332,
"preview": "#include <linux/gfp.h>\n#include <linux/fdtable.h>\n#include <linux/export.h>\n#include <linux/anon_inodes.h>\n#include <lin"
},
{
"path": "kernel/file_wrapper.h",
"chars": 204,
"preview": "#ifndef KSU_FILE_WRAPPER_H\n#define KSU_FILE_WRAPPER_H\n\n#include <linux/file.h>\n#include <linux/fs.h>\n\nint ksu_install_fi"
},
{
"path": "kernel/kernel_umount.c",
"chars": 4251,
"preview": "#include <linux/sched.h>\n#include <linux/slab.h>\n#include <linux/task_work.h>\n#include <linux/cred.h>\n#include <linux/fs"
},
{
"path": "kernel/kernel_umount.h",
"chars": 522,
"preview": "#ifndef __KSU_H_KERNEL_UMOUNT\n#define __KSU_H_KERNEL_UMOUNT\n\n#include <linux/types.h>\n#include <linux/list.h>\n#include <"
},
{
"path": "kernel/klog.h",
"chars": 150,
"preview": "#ifndef __KSU_H_KLOG\n#define __KSU_H_KLOG\n\n#include <linux/printk.h>\n\n#ifdef pr_fmt\n#undef pr_fmt\n#define pr_fmt(fmt) \"K"
},
{
"path": "kernel/ksu.c",
"chars": 4781,
"preview": "#include <linux/export.h>\n#include <linux/fs.h>\n#include <linux/kobject.h>\n#include <linux/module.h>\n#include <linux/sch"
},
{
"path": "kernel/ksu.h",
"chars": 620,
"preview": "#ifndef __KSU_H_KSU\n#define __KSU_H_KSU\n\n#include <linux/types.h>\n#include <linux/workqueue.h>\n#include <linux/cred.h>\n\n"
},
{
"path": "kernel/ksud.c",
"chars": 18719,
"preview": "#include <linux/rcupdate.h>\n#include <linux/slab.h>\n#include <linux/task_work.h>\n#include <asm/current.h>\n#include <linu"
},
{
"path": "kernel/ksud.h",
"chars": 405,
"preview": "#ifndef __KSU_H_KSUD\n#define __KSU_H_KSUD\n\n#include <linux/types.h>\n\n#define KSUD_PATH \"/data/adb/ksud\"\n\nvoid ksu_ksud_i"
},
{
"path": "kernel/manager.h",
"chars": 848,
"preview": "#ifndef __KSU_H_KSU_MANAGER\n#define __KSU_H_KSU_MANAGER\n\n#include <linux/cred.h>\n#include <linux/types.h>\n#include \"allo"
},
{
"path": "kernel/pkg_observer.c",
"chars": 3075,
"preview": "// SPDX-License-Identifier: GPL-2.0\n#include <linux/module.h>\n#include <linux/fs.h>\n#include <linux/namei.h>\n#include <l"
},
{
"path": "kernel/seccomp_cache.c",
"chars": 1503,
"preview": "#include <linux/version.h>\n#include <linux/fs.h>\n#include <linux/nsproxy.h>\n#include <linux/sched/task.h>\n#include <linu"
},
{
"path": "kernel/seccomp_cache.h",
"chars": 271,
"preview": "#ifndef __KSU_H_KERNEL_COMPAT\n#define __KSU_H_KERNEL_COMPAT\n\n#include <linux/fs.h>\n#include <linux/version.h>\n\nextern vo"
},
{
"path": "kernel/selinux/rules.c",
"chars": 15155,
"preview": "#include \"linux/rcupdate.h\"\n#include \"security.h\"\n#include <linux/uaccess.h>\n#include <linux/types.h>\n#include <linux/ve"
},
{
"path": "kernel/selinux/selinux.c",
"chars": 5736,
"preview": "#include \"selinux.h\"\n#include \"linux/cred.h\"\n#include \"linux/sched.h\"\n#include \"objsec.h\"\n#include \"linux/version.h\"\n#in"
},
{
"path": "kernel/selinux/selinux.h",
"chars": 801,
"preview": "#ifndef __KSU_H_SELINUX\n#define __KSU_H_SELINUX\n\n#include \"linux/types.h\"\n#include \"linux/version.h\"\n#include \"linux/cre"
},
{
"path": "kernel/selinux/sepolicy.c",
"chars": 40187,
"preview": "#include \"ss/avtab.h\"\n#include \"ss/constraint.h\"\n#include \"ss/ebitmap.h\"\n#include \"ss/hashtab.h\"\n#include \"ss/policydb.h"
},
{
"path": "kernel/selinux/sepolicy.h",
"chars": 2207,
"preview": "#ifndef __KSU_H_SEPOLICY\n#define __KSU_H_SEPOLICY\n\n#include <linux/types.h>\n\n#include \"ss/policydb.h\"\n\nstruct selinux_po"
},
{
"path": "kernel/setuid_hook.c",
"chars": 2453,
"preview": "#include <linux/compiler.h>\n#include <linux/version.h>\n#include <linux/slab.h>\n#include <linux/task_work.h>\n#include <li"
},
{
"path": "kernel/setuid_hook.h",
"chars": 276,
"preview": "#ifndef __KSU_H_KSU_CORE\n#define __KSU_H_KSU_CORE\n\n#include <linux/init.h>\n#include <linux/types.h>\n\nvoid ksu_setuid_hoo"
},
{
"path": "kernel/setup.sh",
"chars": 3013,
"preview": "#!/bin/sh\nset -eu\n\nGKI_ROOT=$(pwd)\n\ndisplay_usage() {\n echo \"Usage: $0 [--cleanup | <commit-or-tag>]\"\n echo \" --c"
},
{
"path": "kernel/su_mount_ns.c",
"chars": 5745,
"preview": "#include <linux/dcache.h>\n#include <linux/errno.h>\n#include <linux/fdtable.h>\n#include <linux/file.h>\n#include <linux/fs"
},
{
"path": "kernel/su_mount_ns.h",
"chars": 257,
"preview": "#ifndef __KSU_SU_MOUNT_NS_H\n#define __KSU_SU_MOUNT_NS_H\n\n#define KSU_NS_INHERITED 0\n#define KSU_NS_GLOBAL 1\n#define KSU_"
},
{
"path": "kernel/sucompat.c",
"chars": 4632,
"preview": "#include <linux/compiler_types.h>\n#include <linux/preempt.h>\n#include <linux/printk.h>\n#include <linux/mm.h>\n#include <l"
},
{
"path": "kernel/sucompat.h",
"chars": 634,
"preview": "#ifndef __KSU_H_SUCOMPAT\n#define __KSU_H_SUCOMPAT\n#include <linux/types.h>\n\nextern bool ksu_su_compat_enabled;\n\nvoid ksu"
},
{
"path": "kernel/supercalls.c",
"chars": 21823,
"preview": "#include <linux/anon_inodes.h>\n#include <linux/capability.h>\n#include <linux/cred.h>\n#include <linux/err.h>\n#include <li"
},
{
"path": "kernel/supercalls.h",
"chars": 5946,
"preview": "#ifndef __KSU_H_SUPERCALLS\n#define __KSU_H_SUPERCALLS\n\n#include <linux/types.h>\n#include <linux/ioctl.h>\n#include \"app_p"
},
{
"path": "kernel/syscall_hook_manager.c",
"chars": 11225,
"preview": "#include \"linux/compiler.h\"\n#include \"linux/cred.h\"\n#include \"linux/printk.h\"\n#include \"selinux/selinux.h\"\n#include <lin"
},
{
"path": "kernel/syscall_hook_manager.h",
"chars": 1087,
"preview": "#ifndef __KSU_H_HOOK_MANAGER\n#define __KSU_H_HOOK_MANAGER\n\n#include <linux/version.h>\n#include <linux/sched.h>\n#include "
},
{
"path": "kernel/throne_tracker.c",
"chars": 11148,
"preview": "#include <linux/err.h>\n#include <linux/fs.h>\n#include <linux/list.h>\n#include <linux/slab.h>\n#include <linux/string.h>\n#"
},
{
"path": "kernel/throne_tracker.h",
"chars": 169,
"preview": "#ifndef __KSU_H_UID_OBSERVER\n#define __KSU_H_UID_OBSERVER\n\nvoid ksu_throne_tracker_init();\n\nvoid ksu_throne_tracker_exit"
},
{
"path": "kernel/tools/check_symbol.c",
"chars": 5424,
"preview": "#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <elf.h>\n#include <fcntl.h>\n#include <unistd.h>\n#incl"
},
{
"path": "kernel/util.c",
"chars": 1490,
"preview": "#include <linux/mm.h>\n#include <linux/pgtable.h>\n#include <linux/printk.h>\n#include <asm/current.h>\n\n#include \"util.h\"\n\n"
},
{
"path": "kernel/util.h",
"chars": 893,
"preview": "#ifndef __KSU_UTIL_H\n#define __KSU_UTIL_H\n\n#include <linux/types.h>\n\n#ifndef preempt_enable_no_resched_notrace\n#define p"
},
{
"path": "manager/.gitignore",
"chars": 83,
"preview": "*.iml\n.gradle\n.idea\n.kotlin\n.DS_Store\nbuild\ncaptures\n.cxx\nlocal.properties\nkey.jks\n"
},
{
"path": "manager/app/.gitignore",
"chars": 17,
"preview": "/build\n/release/\n"
},
{
"path": "manager/app/build.gradle.kts",
"chars": 6276,
"preview": "@file:Suppress(\"UnstableApiUsage\")\n\nplugins {\n alias(libs.plugins.agp.app)\n alias(libs.plugins.compose.compiler)\n "
},
{
"path": "manager/app/proguard-rules.pro",
"chars": 0,
"preview": ""
},
{
"path": "manager/app/src/main/AndroidManifest.xml",
"chars": 3496,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <uses-"
},
{
"path": "manager/app/src/main/aidl/me/weishu/kernelsu/IKsuInterface.aidl",
"chars": 253,
"preview": "// IKsuInterface.aidl\npackage me.weishu.kernelsu;\n\nimport android.content.pm.PackageInfo;\nimport rikka.parcelablelist.Pa"
},
{
"path": "manager/app/src/main/assets/github-markdown.css",
"chars": 29596,
"preview": "/* https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css */\n.markdown-body {\n "
},
{
"path": "manager/app/src/main/cpp/CMakeLists.txt",
"chars": 490,
"preview": "\n# For more information about using CMake with Android Studio, read the\n# documentation: https://d.android.com/studio/pr"
},
{
"path": "manager/app/src/main/cpp/jni.cc",
"chars": 13602,
"preview": "#include <jni.h>\n\n#include <sys/prctl.h>\n#include <linux/capability.h>\n#include <pwd.h>\n#include <unistd.h>\n#include <sy"
},
{
"path": "manager/app/src/main/cpp/ksu.cc",
"chars": 4929,
"preview": "//\n// Created by weishu on 2022/12/9.\n//\n\n#include <sys/prctl.h>\n#include <cstdint>\n#include <cstring>\n#include <cstdio>"
},
{
"path": "manager/app/src/main/cpp/ksu.h",
"chars": 5344,
"preview": "//\n// Created by weishu on 2022/12/9.\n//\n\n#ifndef KERNELSU_KSU_H\n#define KERNELSU_KSU_H\n\n#include <cstdint>\n#include <sy"
},
{
"path": "manager/app/src/main/cpp/logging.h",
"chars": 783,
"preview": "#pragma once\n\n#include <android/log.h>\n#include <cerrno>\n#include <cstring>\n#include <string>\n\n#ifndef LOG_TAG\n# define "
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/KernelSUApplication.kt",
"chars": 2609,
"preview": "package me.weishu.kernelsu\n\nimport android.app.Application\nimport android.content.pm.ApplicationInfo\nimport android.os.B"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/Kernels.kt",
"chars": 947,
"preview": "package me.weishu.kernelsu\n\nimport android.system.Os\n\n/**\n * @author weishu\n * @date 2022/12/10.\n */\n\ndata class KernelV"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/Natives.kt",
"chars": 4032,
"preview": "package me.weishu.kernelsu\n\nimport android.os.Parcelable\nimport androidx.annotation.Keep\nimport androidx.compose.runtime"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/model/AppInfo.kt",
"chars": 829,
"preview": "package me.weishu.kernelsu.data.model\n\nimport android.content.pm.PackageInfo\nimport android.os.Parcelable\nimport kotlinx"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/model/Module.kt",
"chars": 519,
"preview": "package me.weishu.kernelsu.data.model\n\nimport androidx.compose.runtime.Immutable\n\n@Immutable\ndata class Module(\n val "
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/model/ModuleUpdateInfo.kt",
"chars": 286,
"preview": "package me.weishu.kernelsu.data.model\n\nimport androidx.compose.runtime.Immutable\n\n@Immutable\ndata class ModuleUpdateInfo"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/model/RepoModule.kt",
"chars": 688,
"preview": "package me.weishu.kernelsu.data.model\n\nimport androidx.compose.runtime.Immutable\n\n@Immutable\ndata class Author(\n val "
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/model/TemplateInfo.kt",
"chars": 5871,
"preview": "package me.weishu.kernelsu.data.model\n\nimport android.os.Parcelable\nimport android.util.Log\nimport kotlinx.parcelize.Par"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/ModuleRepoRepository.kt",
"chars": 185,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport me.weishu.kernelsu.data.model.RepoModule\n\ninterface ModuleRepoReposit"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/ModuleRepoRepositoryImpl.kt",
"chars": 4553,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.withContext\n"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/ModuleRepository.kt",
"chars": 295,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport me.weishu.kernelsu.data.model.Module\nimport me.weishu.kernelsu.data.m"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/ModuleRepositoryImpl.kt",
"chars": 3535,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.withContext\n"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepository.kt",
"chars": 1092,
"preview": "package me.weishu.kernelsu.data.repository\n\ninterface SettingsRepository {\n var uiMode: String\n var checkUpdate: B"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepositoryImpl.kt",
"chars": 5172,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport android.content.ComponentName\nimport android.content.Context\nimport a"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/SuperUserRepository.kt",
"chars": 276,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport me.weishu.kernelsu.data.model.AppInfo\n\ninterface SuperUserRepository "
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/SuperUserRepositoryImpl.kt",
"chars": 4979,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport android.content.ComponentName\nimport android.content.Intent\nimport an"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/TemplateRepository.kt",
"chars": 378,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport me.weishu.kernelsu.data.model.TemplateInfo\n\ninterface TemplateReposit"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/data/repository/TemplateRepositoryImpl.kt",
"chars": 5023,
"preview": "package me.weishu.kernelsu.data.repository\n\nimport android.util.Log\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/magica/AppZygotePreload.java",
"chars": 792,
"preview": "package me.weishu.kernelsu.magica;\n\nimport android.app.ZygotePreload;\nimport android.content.pm.ApplicationInfo;\nimport "
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/magica/BootCompletedReceiver.java",
"chars": 1006,
"preview": "package me.weishu.kernelsu.magica;\n\nimport static me.weishu.kernelsu.magica.AppZygotePreload.TAG;\n\nimport android.conten"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/magica/MagicaService.java",
"chars": 340,
"preview": "package me.weishu.kernelsu.magica;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/profile/Capabilities.kt",
"chars": 7197,
"preview": "package me.weishu.kernelsu.profile\n\n/**\n * @author weishu\n * @date 2023/6/3.\n */\nenum class Capabilities(val cap: Int, v"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/profile/Groups.kt",
"chars": 7923,
"preview": "package me.weishu.kernelsu.profile\n\n/**\n * https://cs.android.com/android/platform/superproject/main/+/main:system/core/"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/KsuService.kt",
"chars": 3253,
"preview": "package me.weishu.kernelsu.ui\n\nimport android.content.Intent\nimport android.content.pm.PackageInfo\nimport android.conten"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt",
"chars": 19574,
"preview": "package me.weishu.kernelsu.ui\n\nimport android.annotation.SuppressLint\nimport android.content.Intent\nimport android.conte"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/UiMode.kt",
"chars": 445,
"preview": "package me.weishu.kernelsu.ui\n\nimport androidx.compose.runtime.staticCompositionLocalOf\n\nenum class UiMode(val value: St"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/animation/DampedDragAnimation.kt",
"chars": 5319,
"preview": "package me.weishu.kernelsu.ui.animation\n\nimport androidx.compose.animation.core.Animatable\nimport androidx.compose.anima"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/animation/InteractiveHighlight.kt",
"chars": 4330,
"preview": "package me.weishu.kernelsu.ui.animation\n\nimport android.annotation.SuppressLint\nimport android.graphics.RuntimeShader\nim"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/AppIconImage.kt",
"chars": 3210,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport android.content.pm.ApplicationInfo\nimport android.content.pm.PackageInfo"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/FloatingBottomBar.kt",
"chars": 15608,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport androidx.compose.animation.core.Animatable\nimport androidx.compose.anima"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/GithubMarkdown.kt",
"chars": 18375,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport android.annotation.SuppressLint\nimport android.content.ActivityNotFoundE"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/KeyEventBlocker.kt",
"chars": 842,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport androidx.compose.foundation.focusable\nimport androidx.compose.foundation"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/KsuValidCheck.kt",
"chars": 344,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport androidx.compose.runtime.Composable\nimport me.weishu.kernelsu.Natives\n\n@"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/Markdown.kt",
"chars": 2389,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport android.graphics.text.LineBreaker\nimport android.text.Layout\nimport andr"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/MenuPositionProvider.kt",
"chars": 4179,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport androidx.compose.foundation.layout.PaddingValues\nimport androidx.compose"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/SearchStatus.kt",
"chars": 2735,
"preview": "package me.weishu.kernelsu.ui.component\n\nimport androidx.compose.animation.core.FastOutSlowInEasing\nimport androidx.comp"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/bottombar/BottomBar.kt",
"chars": 3474,
"preview": "package me.weishu.kernelsu.ui.component.bottombar\n\nimport androidx.compose.animation.core.EaseInOut\nimport androidx.comp"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/bottombar/BottomBarMaterial.kt",
"chars": 3192,
"preview": "package me.weishu.kernelsu.ui.component.bottombar\n\nimport androidx.compose.foundation.layout.WindowInsets\nimport android"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/bottombar/BottomBarMiuix.kt",
"chars": 5544,
"preview": "package me.weishu.kernelsu.ui.component.bottombar\n\nimport androidx.annotation.StringRes\nimport androidx.compose.foundati"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/bottombar/NavigationRailMaterial.kt",
"chars": 3038,
"preview": "package me.weishu.kernelsu.ui.component.bottombar\n\nimport androidx.compose.foundation.layout.Spacer\nimport androidx.comp"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/bottombar/NavigationRailMiuix.kt",
"chars": 2213,
"preview": "package me.weishu.kernelsu.ui.component.bottombar\n\nimport androidx.compose.foundation.layout.Spacer\nimport androidx.comp"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/choosekmidialog/ChooseKmiDialog.kt",
"chars": 511,
"preview": "package me.weishu.kernelsu.ui.component.choosekmidialog\n\nimport androidx.compose.runtime.Composable\nimport me.weishu.ker"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/choosekmidialog/ChooseKmiDialogMaterial.kt",
"chars": 2941,
"preview": "package me.weishu.kernelsu.ui.component.choosekmidialog\n\nimport androidx.compose.foundation.layout.fillMaxWidth\nimport a"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/choosekmidialog/ChooseKmiDialogMiuix.kt",
"chars": 4264,
"preview": "package me.weishu.kernelsu.ui.component.choosekmidialog\n\nimport androidx.compose.foundation.layout.Arrangement\nimport an"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/dialog/Dialog.kt",
"chars": 10859,
"preview": "package me.weishu.kernelsu.ui.component.dialog\n\nimport android.os.Parcelable\nimport android.util.Log\nimport androidx.com"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/dialog/DialogMaterial.kt",
"chars": 3088,
"preview": "package me.weishu.kernelsu.ui.component.dialog\n\nimport androidx.compose.foundation.layout.Box\nimport androidx.compose.fo"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/dialog/DialogMiuix.kt",
"chars": 5079,
"preview": "package me.weishu.kernelsu.ui.component.dialog\n\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.co"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/filter/BaseFieldFilter.kt",
"chars": 1343,
"preview": "package me.weishu.kernelsu.ui.component.filter\n\nimport androidx.compose.runtime.mutableStateOf\nimport androidx.compose.u"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/filter/FilterNumber.kt",
"chars": 2979,
"preview": "package me.weishu.kernelsu.ui.component.filter\n\nimport androidx.compose.ui.text.TextRange\nimport androidx.compose.ui.tex"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/ExpressiveSwitch.kt",
"chars": 2072,
"preview": "package me.weishu.kernelsu.ui.component.material\n\nimport androidx.compose.foundation.interaction.MutableInteractionSourc"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SearchBar.kt",
"chars": 9650,
"preview": "package me.weishu.kernelsu.ui.component.material\n\nimport androidx.activity.compose.BackHandler\nimport androidx.compose.f"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SegmentedList.kt",
"chars": 18540,
"preview": "package me.weishu.kernelsu.ui.component.material\n\nimport androidx.compose.foundation.interaction.MutableInteractionSourc"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SendLogBottomSheet.kt",
"chars": 7293,
"preview": "package me.weishu.kernelsu.ui.component.material\n\nimport android.content.Intent\nimport android.net.Uri\nimport androidx.a"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/material/SettingsItem.kt",
"chars": 1802,
"preview": "package me.weishu.kernelsu.ui.component.material\n\nimport androidx.compose.foundation.LocalIndication\nimport androidx.com"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/DropdownItem.kt",
"chars": 1715,
"preview": "package me.weishu.kernelsu.ui.component.miuix\n\nimport androidx.compose.foundation.background\nimport androidx.compose.fou"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/EditText.kt",
"chars": 7942,
"preview": "package me.weishu.kernelsu.ui.component.miuix\n\nimport androidx.compose.foundation.clickable\nimport androidx.compose.foun"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/ScaleDialog.kt",
"chars": 3121,
"preview": "package me.weishu.kernelsu.ui.component.miuix\n\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.com"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/SendLogDialog.kt",
"chars": 6234,
"preview": "package me.weishu.kernelsu.ui.component.miuix\n\nimport android.content.Intent\nimport android.net.Uri\nimport android.widge"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/SuperEditArrow.kt",
"chars": 4706,
"preview": "package me.weishu.kernelsu.ui.component.miuix\n\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.com"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/miuix/SuperSearchBar.kt",
"chars": 14796,
"preview": "package me.weishu.kernelsu.ui.component.miuix\n\nimport androidx.compose.animation.AnimatedVisibility\nimport androidx.comp"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/AppProfileConfigMaterial.kt",
"chars": 2294,
"preview": "package me.weishu.kernelsu.ui.component.profile\n\nimport androidx.compose.foundation.layout.Column\nimport androidx.compos"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/AppProfileConfigMiuix.kt",
"chars": 2034,
"preview": "package me.weishu.kernelsu.ui.component.profile\n\nimport androidx.compose.foundation.layout.Column\nimport androidx.compos"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/ProfileConfig.kt",
"chars": 2406,
"preview": "package me.weishu.kernelsu.ui.component.profile\n\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.M"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfigMaterial.kt",
"chars": 12775,
"preview": "package me.weishu.kernelsu.ui.component.profile\n\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.c"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/RootProfileConfigMiuix.kt",
"chars": 15967,
"preview": "package me.weishu.kernelsu.ui.component.profile\n\nimport androidx.compose.foundation.isSystemInDarkTheme\nimport androidx."
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/TemplateConfigMaterial.kt",
"chars": 4621,
"preview": "package me.weishu.kernelsu.ui.component.profile\n\nimport androidx.compose.foundation.layout.padding\nimport androidx.compo"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/TemplateConfigMiuix.kt",
"chars": 3536,
"preview": "package me.weishu.kernelsu.ui.component.profile\n\nimport androidx.compose.foundation.layout.Column\nimport androidx.compos"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/dialogs/MultiSelectDialog.kt",
"chars": 5641,
"preview": "package me.weishu.kernelsu.ui.component.profile.dialogs\n\nimport androidx.compose.foundation.layout.Arrangement\nimport an"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/profile/dialogs/SingleSelectDialog.kt",
"chars": 2008,
"preview": "package me.weishu.kernelsu.ui.component.profile.dialogs\n\nimport androidx.compose.foundation.rememberScrollState\nimport a"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/rebootlistpopup/RebootListPopup.kt",
"chars": 355,
"preview": "package me.weishu.kernelsu.ui.component.rebootlistpopup\n\nimport androidx.compose.runtime.Composable\nimport me.weishu.ker"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/rebootlistpopup/RebootListPopupMaterial.kt",
"chars": 2400,
"preview": "package me.weishu.kernelsu.ui.component.rebootlistpopup\n\nimport android.content.Context\nimport android.os.PowerManager\ni"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/rebootlistpopup/RebootListPopupMiuix.kt",
"chars": 3683,
"preview": "package me.weishu.kernelsu.ui.component.rebootlistpopup\n\nimport android.content.Context\nimport android.os.PowerManager\ni"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/statustag/StatusTag.kt",
"chars": 598,
"preview": "package me.weishu.kernelsu.ui.component.statustag\n\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/statustag/StatusTagMaterial.kt",
"chars": 1280,
"preview": "package me.weishu.kernelsu.ui.component.statustag\n\nimport androidx.compose.foundation.background\nimport androidx.compose"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/statustag/StatusTagMiuix.kt",
"chars": 1109,
"preview": "package me.weishu.kernelsu.ui.component.statustag\n\nimport androidx.compose.foundation.background\nimport androidx.compose"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/uninstalldialog/UninstallDialog.kt",
"chars": 452,
"preview": "package me.weishu.kernelsu.ui.component.uninstalldialog\n\nimport androidx.compose.runtime.Composable\nimport me.weishu.ker"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/uninstalldialog/UninstallDialogMaterial.kt",
"chars": 3735,
"preview": "package me.weishu.kernelsu.ui.component.uninstalldialog\n\nimport androidx.compose.material3.AlertDialog\nimport androidx.c"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/component/uninstalldialog/UninstallDialogMiuix.kt",
"chars": 4729,
"preview": "package me.weishu.kernelsu.ui.component.uninstalldialog\n\nimport android.widget.Toast\nimport androidx.compose.foundation."
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/modifier/DragGestureInspector.kt",
"chars": 2799,
"preview": "package me.weishu.kernelsu.ui.modifier\n\nimport androidx.compose.foundation.gestures.awaitEachGesture\nimport androidx.com"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/navigation3/DeepLinkResolver.kt",
"chars": 2142,
"preview": "package me.weishu.kernelsu.ui.navigation3\n\nimport android.app.Activity\nimport android.content.Intent\nimport android.net."
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/navigation3/Navigator.kt",
"chars": 4076,
"preview": "package me.weishu.kernelsu.ui.navigation3\n\nimport androidx.compose.runtime.Composable\nimport androidx.compose.runtime.mu"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/navigation3/Routes.kt",
"chars": 2121,
"preview": "package me.weishu.kernelsu.ui.navigation3\n\nimport android.os.Parcelable\nimport androidx.navigation3.runtime.NavKey\nimpor"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/about/AboutMaterial.kt",
"chars": 5654,
"preview": "package me.weishu.kernelsu.ui.screen.about\n\nimport androidx.compose.foundation.Image\nimport androidx.compose.foundation."
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/about/AboutMiuix.kt",
"chars": 6966,
"preview": "package me.weishu.kernelsu.ui.screen.about\n\nimport androidx.compose.foundation.Image\nimport androidx.compose.foundation."
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/about/AboutScreen.kt",
"chars": 1311,
"preview": "package me.weishu.kernelsu.ui.screen.about\n\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.platfo"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/about/AboutUiState.kt",
"chars": 344,
"preview": "package me.weishu.kernelsu.ui.screen.about\n\nimport androidx.compose.runtime.Immutable\n\n@Immutable\ndata class AboutUiStat"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/about/AboutUtils.kt",
"chars": 936,
"preview": "package me.weishu.kernelsu.ui.screen.about\n\nimport android.util.Log\nimport androidx.compose.runtime.Immutable\n\n@Immutabl"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/appprofile/AppProfileMaterial.kt",
"chars": 19331,
"preview": "package me.weishu.kernelsu.ui.screen.appprofile\n\nimport androidx.compose.animation.AnimatedVisibility\nimport androidx.co"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/appprofile/AppProfileMiuix.kt",
"chars": 25665,
"preview": "package me.weishu.kernelsu.ui.screen.appprofile\r\n\r\nimport androidx.compose.animation.AnimatedVisibility\r\nimport androidx"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/appprofile/AppProfileScreen.kt",
"chars": 5213,
"preview": "package me.weishu.kernelsu.ui.screen.appprofile\n\nimport android.widget.Toast\nimport androidx.compose.runtime.Composable\n"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/appprofile/AppProfileUiState.kt",
"chars": 763,
"preview": "package me.weishu.kernelsu.ui.screen.appprofile\n\nimport androidx.compose.runtime.Immutable\nimport me.weishu.kernelsu.Nat"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/appprofile/AppProfileUtils.kt",
"chars": 450,
"preview": "package me.weishu.kernelsu.ui.screen.appprofile\n\nimport androidx.annotation.StringRes\nimport androidx.compose.runtime.Co"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/colorpalette/ColorPaletteScreen.kt",
"chars": 2641,
"preview": "package me.weishu.kernelsu.ui.screen.colorpalette\n\nimport androidx.activity.compose.LocalActivity\nimport androidx.compos"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/colorpalette/ColorPaletteScreenMaterial.kt",
"chars": 25679,
"preview": "package me.weishu.kernelsu.ui.screen.colorpalette\n\nimport android.annotation.SuppressLint\nimport android.os.Build\nimport"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/colorpalette/ColorPaletteScreenMiuix.kt",
"chars": 29666,
"preview": "package me.weishu.kernelsu.ui.screen.colorpalette\n\nimport android.annotation.SuppressLint\nimport android.os.Build\nimport"
},
{
"path": "manager/app/src/main/java/me/weishu/kernelsu/ui/screen/colorpalette/ColorPaletteUiState.kt",
"chars": 1082,
"preview": "package me.weishu.kernelsu.ui.screen.colorpalette\n\nimport androidx.compose.runtime.Immutable\nimport com.materialkolor.Pa"
}
]
// ... and 342 more files (download for full content)
About this extraction
This page contains the full source code of the tiann/KernelSU GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 542 files (3.0 MB), approximately 804.0k tokens, and a symbol index with 997 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.