├── suTest ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── themes.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── values-night │ │ │ │ │ └── themes.xml │ │ │ │ ├── layout │ │ │ │ │ └── activity_main.xml │ │ │ │ ├── drawable-v24 │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ └── drawable │ │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── linux │ │ │ │ └── sutest │ │ │ │ └── MainActivity.java │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── linux │ │ │ │ └── sutest │ │ │ │ └── ExampleUnitTest.java │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── linux │ │ │ └── sutest │ │ │ └── ExampleInstrumentedTest.java │ ├── release │ │ ├── app-release.apk │ │ └── output-metadata.json │ ├── proguard-rules.pro │ └── build.gradle ├── .idea │ ├── .gitignore │ ├── compiler.xml │ ├── misc.xml │ └── gradle.xml ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── local.properties ├── settings.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── PermissionManager ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── themes.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── drawable │ │ │ │ │ ├── ripple_grey.xml │ │ │ │ │ ├── line_drawable.xml │ │ │ │ │ ├── thumb_drawable.xml │ │ │ │ │ ├── thumb.xml │ │ │ │ │ ├── line.xml │ │ │ │ │ ├── shape_wnd_grey_corner.xml │ │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── values-night │ │ │ │ │ └── themes.xml │ │ │ │ ├── layout │ │ │ │ │ ├── select_app_recycler_item.xml │ │ │ │ │ ├── select_app_wnd.xml │ │ │ │ │ └── activity_main.xml │ │ │ │ └── drawable-v24 │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── assets │ │ │ │ └── su │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── linux │ │ │ │ │ └── permissionmanager │ │ │ │ │ ├── Model │ │ │ │ │ ├── SelectAppRecyclerItem.java │ │ │ │ │ └── PopupWindowOnTouchClose.java │ │ │ │ │ ├── Adapter │ │ │ │ │ └── SelectAppRecyclerAdapter.java │ │ │ │ │ └── Utils │ │ │ │ │ └── ScreenInfoUtils.java │ │ │ ├── AndroidManifest.xml │ │ │ └── cpp │ │ │ │ └── CMakeLists.txt │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── linux │ │ │ │ └── permissionmanager │ │ │ │ └── ExampleUnitTest.java │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── linux │ │ │ └── permissionmanager │ │ │ └── ExampleInstrumentedTest.java │ ├── proguard-rules.pro │ └── build.gradle ├── .idea │ ├── .gitignore │ ├── compiler.xml │ ├── gradle.xml │ └── misc.xml ├── appKey.jks ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── .gitignore ├── su ├── jni │ ├── Application.mk │ └── Android.mk ├── base64.h ├── log.h ├── su.h ├── base64.cpp ├── su_hide_path_utils.h └── su.cpp ├── testRoot ├── jni │ ├── Application.mk │ └── Android.mk ├── base64.h ├── kernel_root_kit │ ├── kernel_root_kit_umbrella.h │ ├── kernel_root_kit_random.h │ ├── kernel_root_kit_log.h │ ├── kernel_root_kit_su_install_helper.h │ ├── kernel_root_kit_init64_process_helper.h │ ├── kernel_root_kit_ptrace_arm64_utils.h │ ├── kernel_root_kit_process64_inject.h │ ├── kernel_root_kit_maps_helper.h │ ├── kernel_root_kit_so_symbol_parser.h │ ├── kernel_root_kit_command.h │ ├── kernel_root_kit_process_cmdline_utils.h │ ├── kernel_root_kit_su_install_helper.cpp │ └── kernel_root_kit_fork_helper.h └── base64.cpp ├── ScreenCap ├── 1.png ├── 2.png ├── 3.png └── 4.png ├── find_kernel_func ├── find_do_execve │ └── find_do_execve.exe ├── find_avc_denied │ └── find_avc_denied.exe ├── 3rdparty │ └── capstone-4.0.2-win64 │ │ ├── cstool.exe │ │ ├── capstone.dll │ │ ├── capstone.lib │ │ ├── capstone_dll.lib │ │ ├── RELEASE_NOTES │ │ ├── include │ │ ├── windowsce │ │ │ ├── intrin.h │ │ │ └── stdint.h │ │ ├── platform.h │ │ └── capstone │ │ │ ├── platform.h │ │ │ ├── evm.h │ │ │ └── xcore.h │ │ ├── SPONSORS.TXT │ │ ├── LICENSE.TXT │ │ ├── README.md │ │ ├── CREDITS.TXT │ │ └── LICENSE_LLVM.TXT └── find_proc_pid_status │ ├── find_proc_pid_status.exe │ └── find_proc_pid_status.cpp ├── patch_kernel_root ├── toolchains-exe │ ├── aarch64-linux-android-as.exe │ └── arm-linux-androideabi-as.exe ├── ArmAsmHelper_Linux.h └── ArmAsmHelper_Windows.h ├── tests └── Byte2Hex.cpp ├── CMakeLists.txt ├── .github └── workflows │ ├── PermissionManager.yml │ └── SKRootKernelRoot_Windows.yml └── README.md /suTest/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /PermissionManager/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .cache/ 3 | .vscode/ -------------------------------------------------------------------------------- /su/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := arm64-v8a 2 | APP_STL := c++_static -------------------------------------------------------------------------------- /testRoot/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := arm64-v8a 2 | APP_STL := c++_static -------------------------------------------------------------------------------- /suTest/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /PermissionManager/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /ScreenCap/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/ScreenCap/1.png -------------------------------------------------------------------------------- /ScreenCap/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/ScreenCap/2.png -------------------------------------------------------------------------------- /ScreenCap/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/ScreenCap/3.png -------------------------------------------------------------------------------- /ScreenCap/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/ScreenCap/4.png -------------------------------------------------------------------------------- /suTest/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | suTest 3 | -------------------------------------------------------------------------------- /PermissionManager/appKey.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/appKey.jks -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PermissionManager 3 | -------------------------------------------------------------------------------- /suTest/app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/release/app-release.apk -------------------------------------------------------------------------------- /PermissionManager/app/src/main/assets/su: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/assets/su -------------------------------------------------------------------------------- /suTest/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /find_kernel_func/find_do_execve/find_do_execve.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/find_kernel_func/find_do_execve/find_do_execve.exe -------------------------------------------------------------------------------- /PermissionManager/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /find_kernel_func/find_avc_denied/find_avc_denied.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/find_kernel_func/find_avc_denied/find_avc_denied.exe -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /find_kernel_func/3rdparty/capstone-4.0.2-win64/cstool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/find_kernel_func/3rdparty/capstone-4.0.2-win64/cstool.exe -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /suTest/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | task clean(type: Delete) { 4 | delete rootProject.buildDir 5 | } -------------------------------------------------------------------------------- /find_kernel_func/3rdparty/capstone-4.0.2-win64/capstone.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/find_kernel_func/3rdparty/capstone-4.0.2-win64/capstone.dll -------------------------------------------------------------------------------- /find_kernel_func/3rdparty/capstone-4.0.2-win64/capstone.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/find_kernel_func/3rdparty/capstone-4.0.2-win64/capstone.lib -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /PermissionManager/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | task clean(type: Delete) { 4 | delete rootProject.buildDir 5 | } -------------------------------------------------------------------------------- /find_kernel_func/3rdparty/capstone-4.0.2-win64/capstone_dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/find_kernel_func/3rdparty/capstone-4.0.2-win64/capstone_dll.lib -------------------------------------------------------------------------------- /find_kernel_func/find_proc_pid_status/find_proc_pid_status.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/find_kernel_func/find_proc_pid_status/find_proc_pid_status.exe -------------------------------------------------------------------------------- /patch_kernel_root/toolchains-exe/aarch64-linux-android-as.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/patch_kernel_root/toolchains-exe/aarch64-linux-android-as.exe -------------------------------------------------------------------------------- /patch_kernel_root/toolchains-exe/arm-linux-androideabi-as.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/patch_kernel_root/toolchains-exe/arm-linux-androideabi-as.exe -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/suTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /su/base64.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE_64_H 2 | #define BASE_64_H 3 | #include 4 | std::string base64_encode(unsigned char const*, unsigned int len); 5 | std::string base64_decode(std::string const& s); 6 | #endif 7 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /suTest/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /testRoot/base64.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE_64_H 2 | #define BASE_64_H 3 | #include 4 | std::string base64_encode(unsigned char const*, unsigned int len); 5 | std::string base64_decode(std::string const& s); 6 | #endif 7 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /PermissionManager/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidAppsUsedByMyself/SKRoot-linuxKernelRoot/HEAD/PermissionManager/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /find_kernel_func/3rdparty/capstone-4.0.2-win64/RELEASE_NOTES: -------------------------------------------------------------------------------- 1 | This release 4.0.2 is dedicated to my dad! 2 | 3 | Without him, I would not work in computing field, let alone writing any code 4 | or making contribution to the cyber security community. 5 | -------------------------------------------------------------------------------- /suTest/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Apr 15 02:25:04 CST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /PermissionManager/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Feb 19 21:34:04 CST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /suTest/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /PermissionManager/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /su/log.h: -------------------------------------------------------------------------------- 1 | #ifndef _LOG_H_ 2 | #define _LOG_H_ 3 | #include 4 | #include 5 | #include 6 | 7 | //安静输出模式 8 | #define QUIET_PRINTF 9 | 10 | #ifdef QUIET_PRINTF 11 | #define TRACE(fmt, ...) 12 | #else 13 | #define TRACE(fmt, ...) printf(fmt, ##__VA_ARGS__) 14 | #endif 15 | 16 | #endif /* _LOG_H_ */ 17 | -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /suTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/drawable/ripple_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | //点击时波纹的颜色 5 | //未点击时控件的背景(可以是图片,可以是颜色,也可以是drawable里的xml背景(比如圆角)) 6 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/drawable/line_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/drawable/thumb_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testRoot/kernel_root_kit/kernel_root_kit_umbrella.h: -------------------------------------------------------------------------------- 1 | #ifndef KERNEL_ROOT_KIT_UMBRELLA_H_ 2 | #define KERNEL_ROOT_KIT_UMBRELLA_H_ 3 | #include "kernel_root_kit_command.h" 4 | #include "kernel_root_kit_process64_inject.h" 5 | #include "kernel_root_kit_init64_process_helper.h" 6 | #include "kernel_root_kit_su_install_helper.h" 7 | #endif /* KERNEL_ROOT_KIT_UMBRELLA_H_ */ 8 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/drawable/thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /su/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_CPPFLAGS += -std=c++17 -fPIE -fvisibility=hidden -frtti -fexceptions 5 | LOCAL_LDFLAGS += -fPIE -pie 6 | LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true 7 | LOCAL_MODULE := su 8 | LOCAL_SRC_FILES := \ 9 | ../su.cpp \ 10 | ../base64.cpp \ 11 | 12 | include $(BUILD_EXECUTABLE) 13 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/drawable/line.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /find_kernel_func/3rdparty/capstone-4.0.2-win64/include/windowsce/intrin.h: -------------------------------------------------------------------------------- 1 | 2 | #if defined(_MSC_VER) && defined(_WIN32_WCE) && (_WIN32_WCE < 0x800) && !defined(__INTRIN_H_) && !defined(_INTRIN) 3 | #define _STDINT 4 | 5 | #ifdef _M_ARM 6 | #include 7 | #if (_WIN32_WCE >= 0x700) && defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) 8 | #include 9 | #endif 10 | #endif // _M_ARM 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /suTest/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/drawable/shape_wnd_grey_corner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /suTest/app/release/output-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "artifactType": { 4 | "type": "APK", 5 | "kind": "Directory" 6 | }, 7 | "applicationId": "com.linux.sutest", 8 | "variantName": "release", 9 | "elements": [ 10 | { 11 | "type": "SINGLE", 12 | "filters": [], 13 | "attributes": [], 14 | "versionCode": 1, 15 | "versionName": "1.0", 16 | "outputFile": "app-release.apk" 17 | } 18 | ], 19 | "elementType": "File" 20 | } -------------------------------------------------------------------------------- /suTest/local.properties: -------------------------------------------------------------------------------- 1 | ## This file is automatically generated by Android Studio. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file should *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | # 7 | # Location of the SDK. This is only used by Gradle. 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | sdk.dir=C\:\\Users\\abc\\AppData\\Local\\Android\\Sdk -------------------------------------------------------------------------------- /suTest/app/src/test/java/com/linux/sutest/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.linux.sutest; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /PermissionManager/app/src/test/java/com/linux/permissionmanager/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.linux.permissionmanager; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /testRoot/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_CPPFLAGS += -std=c++17 -fPIE -fvisibility=hidden -frtti -fexceptions 5 | LOCAL_LDFLAGS += -fPIE -pie 6 | LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true 7 | LOCAL_MODULE := testRoot 8 | LOCAL_SRC_FILES := \ 9 | ../testRoot.cpp \ 10 | ../base64.cpp \ 11 | ../kernel_root_kit/kernel_root_kit_process64_inject.cpp \ 12 | ../kernel_root_kit/kernel_root_kit_ptrace_arm64_utils.cpp \ 13 | ../kernel_root_kit/kernel_root_kit_su_install_helper.cpp 14 | 15 | include $(BUILD_EXECUTABLE) 16 | -------------------------------------------------------------------------------- /suTest/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | plugins { 8 | id 'com.android.application' version '7.1.0-alpha11' 9 | id 'com.android.library' version '7.1.0-alpha11' 10 | } 11 | } 12 | dependencyResolutionManagement { 13 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 14 | repositories { 15 | google() 16 | mavenCentral() 17 | } 18 | } 19 | rootProject.name = "suTest" 20 | include ':app' 21 | -------------------------------------------------------------------------------- /PermissionManager/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | plugins { 8 | id 'com.android.application' version '7.1.0-alpha11' 9 | id 'com.android.library' version '7.1.0-alpha11' 10 | } 11 | } 12 | dependencyResolutionManagement { 13 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 14 | repositories { 15 | google() 16 | mavenCentral() 17 | } 18 | } 19 | rootProject.name = "PermissionManager" 20 | include ':app' 21 | -------------------------------------------------------------------------------- /testRoot/kernel_root_kit/kernel_root_kit_random.h: -------------------------------------------------------------------------------- 1 | #ifndef _RANDOM_UTILS_H_ 2 | #define _RANDOM_UTILS_H_ 3 | #include 4 | #include 5 | #include 6 | #include 7 | namespace kernel_root { 8 | /*生成随机数*/ 9 | static void rand_str(char* dest, int n) { 10 | int i, randno; 11 | char stardstring[63] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 12 | srand((unsigned)time(NULL)); 13 | for (i = 0; i < n; i++) { 14 | randno = rand() % 62; 15 | *dest = stardstring[randno]; 16 | dest++; 17 | } 18 | } 19 | } 20 | 21 | #endif /* _RANDOM_UTILS_H_ */ 22 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | #424242 11 | #FF767676 12 | #00000000 13 | -------------------------------------------------------------------------------- /testRoot/kernel_root_kit/kernel_root_kit_log.h: -------------------------------------------------------------------------------- 1 | #ifndef _KERNEL_ROOT_KIT_LOG_H_ 2 | #define _KERNEL_ROOT_KIT_LOG_H_ 3 | #include 4 | namespace kernel_root { 5 | #define QUIET_KERNEL_ROOT_KIT_PRINTF 6 | 7 | #ifdef QUIET_KERNEL_ROOT_KIT_PRINTF 8 | #undef ROOT_PRINTF 9 | #define ROOT_PRINTF(fmt, ...) 10 | #else 11 | #ifdef __ANDROID__ 12 | #undef ROOT_PRINTF 13 | #include 14 | #define ROOT_PRINTF "JNIGlue" 15 | //#define TRACE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) 16 | #define ROOT_PRINTF(fmt, ...) printf(fmt, ##__VA_ARGS__) 17 | #else 18 | #define ROOT_PRINTF(fmt, ...) printf(fmt, ##__VA_ARGS__) 19 | #endif 20 | #endif 21 | } 22 | #endif /* _KERNEL_ROOT_KIT_LOG_H_ */ 23 | -------------------------------------------------------------------------------- /suTest/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | -------------------------------------------------------------------------------- /suTest/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /testRoot/kernel_root_kit/kernel_root_kit_su_install_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef _SU_INSTALL_HELPER_H_ 2 | #define _SU_INSTALL_HELPER_H_ 3 | #include 4 | namespace kernel_root { 5 | std::string install_su(const char* str_root_key, const char* base_path, const char* origin_su_full_path, ssize_t & err, const char* su_hide_folder_head_flag = "su"); 6 | 7 | std::string safe_install_su(const char* str_root_key, const char* base_path, const char* origin_su_full_path, ssize_t& err, const char* su_hide_folder_head_flag = "su"); 8 | 9 | ssize_t uninstall_su(const char* str_root_key, const char* base_path, const char* su_hide_folder_head_flag = "su" ); 10 | //fork安全版本(可用于安卓APP直接调用) 11 | ssize_t safe_uninstall_su(const char* str_root_key, const char* base_path, const char* su_hide_folder_head_flag = "su"); 12 | } 13 | #endif /* _SU_INSTALL_HELPER_H_ */ 14 | -------------------------------------------------------------------------------- /tests/Byte2Hex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | const char HEX[16] = {'0', '1', '2', '3', '4', '5', '6', '7', 5 | '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; 6 | std::string bytesToHexString(const std::byte *input, size_t length) { 7 | std::string str; 8 | str.reserve(length << 1); 9 | for (size_t i = 0; i < length; ++i) { 10 | int t = static_cast(input[i]); 11 | int a = t / 16; 12 | int b = t % 16; 13 | str.append(1, HEX[a]); 14 | str.append(1, HEX[b]); 15 | } 16 | return str; 17 | } 18 | int main() { 19 | const std::byte input[] = {std::byte{0x12}, std::byte{0x34}, std::byte{0x56}}; 20 | size_t length = sizeof(input) / sizeof(input[0]); 21 | 22 | std::string output = bytesToHexString(input, length); 23 | std::cout << output << std::endl; 24 | } -------------------------------------------------------------------------------- /PermissionManager/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /suTest/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /PermissionManager/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /suTest/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /suTest/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /suTest/app/src/androidTest/java/com/linux/sutest/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.linux.sutest; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.linux.sutest", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /suTest/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /PermissionManager/app/src/androidTest/java/com/linux/permissionmanager/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.linux.permissionmanager; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.linux.permissionmanager", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 要求最低的 CMake 版本 2 | cmake_minimum_required(VERSION 3.0) 3 | 4 | # 启用 CMP0048 策略 5 | cmake_policy(SET CMP0048 NEW) 6 | 7 | # 设置项目名称和版本号 8 | project(patch_kernel_root VERSION 1.0) 9 | 10 | 11 | # 要求 C++17 标准 12 | set(CMAKE_CXX_STANDARD 17) 13 | set(CMAKE_CXX_STANDARD_REQUIRED True) 14 | 15 | # 添加头文件目录 16 | include_directories(include) 17 | 18 | # 添加所有源文件(排除测试文件) 19 | file(GLOB SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/patch_kernel_root/*.cpp") 20 | list(FILTER SRC_FILES EXCLUDE REGEX "^Byte2HexTest.cpp$") 21 | 22 | # 添加可执行文件 23 | add_executable(patch_kernel_root ${SRC_FILES}) 24 | 25 | # 添加测试文件 26 | option(BUILD_TESTING "Build the tests" ON) 27 | if(BUILD_TESTING) 28 | enable_testing() 29 | file(GLOB TEST_SOURCES "tests/*.cpp") 30 | foreach(TEST_SOURCE ${TEST_SOURCES}) 31 | get_filename_component(TEST_NAME ${TEST_SOURCE} NAME_WE) 32 | add_executable(${TEST_NAME} ${TEST_SOURCE}) 33 | # target_link_libraries(${TEST_NAME} patch_kernel_root) 34 | endforeach() 35 | endif() 36 | -------------------------------------------------------------------------------- /find_kernel_func/3rdparty/capstone-4.0.2-win64/SPONSORS.TXT: -------------------------------------------------------------------------------- 1 | * Version 4.0.2 - May 08th, 2020 2 | 3 | Release 4.0.2 was sponsored by the following companies (in no particular order). 4 | 5 | - Senrio: https://senr.io 6 | - Catena Cyber: https://catenacyber.fr 7 | 8 | ------------------------------------ 9 | 10 | * Version 4.0.1 - January 10th, 2019 11 | 12 | Release 4.0.1 was sponsored by the following companies (in no particular order). 13 | 14 | - NowSecure: https://www.nowsecure.com 15 | - Verichains: https://verichains.io 16 | - Vsec: https://vsec.com.vn 17 | 18 | ----------------------------------- 19 | * Version 4.0 - December 18th, 2018 20 | 21 | Capstone 4.0 version marks 5 years of the project! 22 | This release was sponsored by the following companies (in no particular order). 23 | 24 | - Thinkst Canary: https://canary.tools 25 | - NowSecure: https://www.nowsecure.com 26 | - ECQ: https://e-cq.net 27 | - Senrio: https://senr.io 28 | - GracefulBits: https://gracefulbits.com 29 | - Catena Cyber: https://catenacyber.fr 30 | -------------------------------------------------------------------------------- /.github/workflows/PermissionManager.yml: -------------------------------------------------------------------------------- 1 | name: PermissionManager_CIBuild 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | paths: 7 | - '.github/workflows/PermissionManager.yml' 8 | - 'PermissionManager/**' 9 | - 'testRoot/**' 10 | pull_request: 11 | branches: [master] 12 | workflow_dispatch: 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Setup JDK 20 | uses: actions/setup-java@v2 21 | with: 22 | distribution: "adopt" 23 | java-version: 11 24 | - name: Build with Gradle 25 | run: | 26 | cd PermissionManager 27 | chmod +x ./gradlew 28 | ./gradlew assembleRelease 29 | - name: Upload Artifacts 30 | uses: actions/upload-artifact@v2 31 | if: ${{ !github.event.pull_request }} 32 | with: 33 | path: "PermissionManager/app/build/outputs/apk/release/app-release-unsigned.apk" 34 | name: app-release-unsigned.apk -------------------------------------------------------------------------------- /PermissionManager/app/src/main/java/com/linux/permissionmanager/Model/SelectAppRecyclerItem.java: -------------------------------------------------------------------------------- 1 | package com.linux.permissionmanager.Model; 2 | 3 | import android.graphics.drawable.Drawable; 4 | 5 | public class SelectAppRecyclerItem { 6 | private Drawable icon=null; 7 | private String showName; 8 | private String packageName; 9 | 10 | public SelectAppRecyclerItem(Drawable icon, String showName, String packageName){ 11 | this.icon=icon; 12 | this.showName = showName; 13 | this.packageName = packageName; 14 | } 15 | 16 | public Drawable getIcon() { 17 | return icon; 18 | } 19 | 20 | public void setIcon(Drawable icon) { 21 | this.icon = icon; 22 | } 23 | 24 | public String getShowName() { 25 | return showName; 26 | } 27 | 28 | public void setShowName(String showName) { 29 | this.showName = showName; 30 | } 31 | 32 | public String getPackageName() { 33 | return packageName; 34 | } 35 | 36 | public void setPackageName(String packageName) { 37 | this.packageName = packageName; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /suTest/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdk 31 7 | 8 | defaultConfig { 9 | applicationId "com.linux.sutest" 10 | minSdk 23 11 | targetSdk 31 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | compileOptions { 25 | sourceCompatibility JavaVersion.VERSION_1_8 26 | targetCompatibility JavaVersion.VERSION_1_8 27 | } 28 | } 29 | 30 | dependencies { 31 | 32 | implementation 'androidx.appcompat:appcompat:1.4.1' 33 | implementation 'com.google.android.material:material:1.5.0' 34 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3' 35 | testImplementation 'junit:junit:4.13.2' 36 | androidTestImplementation 'androidx.test.ext:junit:1.1.3' 37 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 38 | } -------------------------------------------------------------------------------- /.github/workflows/SKRootKernelRoot_Windows.yml: -------------------------------------------------------------------------------- 1 | name: SKRootKernelRoot_Windows_CIBuild 2 | on: 3 | push: 4 | branches: [master] 5 | paths: 6 | - '.github/workflows/SKRootKernelRoot_Windows.yml' 7 | - 'patch_kernel_root/**' 8 | pull_request: 9 | branches: [master] 10 | workflow_dispatch: 11 | 12 | jobs: 13 | build: 14 | name: Compile SKRoot Kernel Root on Windows 15 | runs-on: windows-latest 16 | env: 17 | ACTIONS_ALLOW_UNSECURE_COMMANDS: true 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Add MSBuild to PATH 21 | uses: microsoft/setup-msbuild@v1.1 22 | - name: Compile patch_kernel_root 23 | shell: cmd 24 | run: | 25 | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" 26 | cl patch_kernel_root\patch_kernel_root.cpp /MTd /EHsc /Fe:patch_kernel_root /Ipatch_kernel_root /I "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include" /std:c++17 27 | - name: Upload artifacts 28 | uses: Actions/upload-artifact@main 29 | with: 30 | name: patch_kernel_root 31 | path: patch_kernel_root.exe 32 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 19 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /su/su.h: -------------------------------------------------------------------------------- 1 | #ifndef _SU_H_ 2 | #define _SU_H_ 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #define DEFAULT_SHELL "/system/bin/sh" 38 | 39 | // Constants for atty 40 | #define ATTY_IN (1 << 0) 41 | #define ATTY_OUT (1 << 1) 42 | #define ATTY_ERR (1 << 2) 43 | 44 | #define UID_ROOT 0 45 | #define UID_SHELL 2000 46 | 47 | #define ROOT_VER_CODE 1 48 | #define ROOT_VERSION "1.0" 49 | 50 | struct su_req_base { 51 | int uid = UID_ROOT; 52 | bool login = false; 53 | bool keepenv = false; 54 | bool mount_master = false; 55 | } __attribute__((packed)); 56 | 57 | struct su_request : public su_req_base { 58 | std::string shell = DEFAULT_SHELL; 59 | std::string command; 60 | }; 61 | 62 | #endif /* _SU_H_ */ 63 | -------------------------------------------------------------------------------- /suTest/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /PermissionManager/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /PermissionManager/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | -------------------------------------------------------------------------------- /PermissionManager/app/src/main/res/layout/select_app_recycler_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 16 | 17 | 24 | 29 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /PermissionManager/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdk 31 7 | 8 | defaultConfig { 9 | applicationId "com.linux.permissionmanager" 10 | minSdk 23 11 | targetSdk 31 12 | versionCode 1 13 | versionName "1.0" 14 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | externalNativeBuild { 17 | cmake { 18 | cppFlags '-std=c++17' 19 | abiFilters "arm64-v8a" //需要什么构架的so,就在这边添加即 20 | } 21 | } 22 | } 23 | 24 | buildTypes { 25 | release { 26 | minifyEnabled false 27 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 28 | } 29 | } 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | externalNativeBuild { 35 | cmake { 36 | path file('src/main/cpp/CMakeLists.txt') 37 | version '3.18.1' 38 | } 39 | } 40 | buildFeatures { 41 | viewBinding true 42 | } 43 | } 44 | 45 | dependencies { 46 | 47 | implementation 'androidx.appcompat:appcompat:1.4.1' 48 | implementation 'com.google.android.material:material:1.5.0' 49 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3' 50 | testImplementation 'junit:junit:4.13.2' 51 | androidTestImplementation 'androidx.test.ext:junit:1.1.3' 52 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 53 | } -------------------------------------------------------------------------------- /suTest/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 17 |