├── app
├── apk
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── ids.xml
│ │ │ │ ├── theme_overlay.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── attrs.xml
│ │ │ │ ├── styles_md2.xml
│ │ │ │ └── themes_override.xml
│ │ │ ├── values-night
│ │ │ │ └── styles_md2.xml
│ │ │ ├── color
│ │ │ │ ├── color_error_transient.xml
│ │ │ │ ├── color_primary_transient.xml
│ │ │ │ ├── color_text_transient.xml
│ │ │ │ ├── color_on_primary_transient.xml
│ │ │ │ ├── color_card_background_color_selector.xml
│ │ │ │ ├── color_primary_error_transient.xml
│ │ │ │ ├── color_menu_tint.xml
│ │ │ │ └── color_state_primary_transient.xml
│ │ │ ├── drawable
│ │ │ │ ├── bg_selection_circle_green.xml
│ │ │ │ ├── ic_action_md2.xml
│ │ │ │ ├── ic_superuser_filled_md2.xml
│ │ │ │ ├── bg_line_top_rounded.xml
│ │ │ │ ├── bg_line_bottom_rounded.xml
│ │ │ │ ├── ic_home_filled_md2.xml
│ │ │ │ ├── ic_superuser_outlined_md2.xml
│ │ │ │ ├── ic_update_md2.xml
│ │ │ │ ├── ic_folder_list.xml
│ │ │ │ ├── ic_check_md2.xml
│ │ │ │ ├── ic_download_md2.xml
│ │ │ │ ├── ic_home_outlined_md2.xml
│ │ │ │ ├── ic_install.xml
│ │ │ │ ├── ic_save_md2.xml
│ │ │ │ ├── ic_check_circle_unchecked_md2.xml
│ │ │ │ ├── ic_paint.xml
│ │ │ │ ├── ic_check_circle_checked_md2.xml
│ │ │ │ ├── ic_close_md2.xml
│ │ │ │ ├── ic_back_md2.xml
│ │ │ │ ├── ic_notifications_md2.xml
│ │ │ │ ├── ic_delete_md2.xml
│ │ │ │ ├── ic_module_filled_md2.xml
│ │ │ │ ├── ic_search_md2.xml
│ │ │ │ ├── ic_restart.xml
│ │ │ │ ├── ic_day.xml
│ │ │ │ ├── ic_forth_md2.xml
│ │ │ │ ├── ic_bug_md2.xml
│ │ │ │ ├── ic_home_md2.xml
│ │ │ │ ├── ic_module_md2.xml
│ │ │ │ ├── ic_bug_filled_md2.xml
│ │ │ │ ├── ic_settings_md2.xml
│ │ │ │ ├── ic_superuser_md2.xml
│ │ │ │ ├── ic_bug_outlined_md2.xml
│ │ │ │ ├── ic_module_outlined_md2.xml
│ │ │ │ ├── ic_check_circle_md2.xml
│ │ │ │ ├── ic_night.xml
│ │ │ │ ├── ic_module_storage_md2.xml
│ │ │ │ ├── ic_day_night.xml
│ │ │ │ ├── ic_settings_filled_md2.xml
│ │ │ │ ├── ic_manager.xml
│ │ │ │ ├── avd_home_from_filled.xml
│ │ │ │ ├── ic_settings_outlined_md2.xml
│ │ │ │ └── avd_home_to_filled.xml
│ │ │ ├── menu
│ │ │ │ ├── menu_flash.xml
│ │ │ │ ├── menu_log_md2.xml
│ │ │ │ ├── menu_home_md2.xml
│ │ │ │ ├── menu_deny_md2.xml
│ │ │ │ ├── menu_bottom_nav.xml
│ │ │ │ └── menu_reboot.xml
│ │ │ ├── layout
│ │ │ │ ├── item_theme_container.xml
│ │ │ │ ├── item_log_textview.xml
│ │ │ │ ├── item_spinner.xml
│ │ │ │ ├── item_console_md2.xml
│ │ │ │ ├── item_text.xml
│ │ │ │ ├── markdown_window_md2.xml
│ │ │ │ ├── item_module_download.xml
│ │ │ │ ├── item_list_single_line.xml
│ │ │ │ ├── item_icon_link.xml
│ │ │ │ ├── item_settings_section.xml
│ │ │ │ └── fragment_theme_md2.xml
│ │ │ ├── anim
│ │ │ │ ├── fragment_enter.xml
│ │ │ │ ├── fragment_exit.xml
│ │ │ │ ├── fragment_exit_pop.xml
│ │ │ │ └── fragment_enter_pop.xml
│ │ │ └── values-v27
│ │ │ │ └── themes.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── topjohnwu
│ │ │ │ └── magisk
│ │ │ │ ├── view
│ │ │ │ ├── TextItem.kt
│ │ │ │ └── TappableHeadlineItem.kt
│ │ │ │ ├── utils
│ │ │ │ ├── AccessibilityUtils.kt
│ │ │ │ └── TextHolder.kt
│ │ │ │ ├── arch
│ │ │ │ ├── ViewEvent.kt
│ │ │ │ └── AsyncLoadViewModel.kt
│ │ │ │ ├── dialog
│ │ │ │ ├── SecondSlotWarningDialog.kt
│ │ │ │ ├── SuperuserRevokeDialog.kt
│ │ │ │ ├── ManagerInstallDialog.kt
│ │ │ │ ├── LocalModuleInstallDialog.kt
│ │ │ │ └── MarkDownDialog.kt
│ │ │ │ ├── ui
│ │ │ │ ├── install
│ │ │ │ │ └── InstallFragment.kt
│ │ │ │ ├── theme
│ │ │ │ │ ├── ThemeViewModel.kt
│ │ │ │ │ └── Theme.kt
│ │ │ │ ├── log
│ │ │ │ │ └── LogRvItem.kt
│ │ │ │ ├── superuser
│ │ │ │ │ └── SuperuserFragment.kt
│ │ │ │ ├── flash
│ │ │ │ │ └── ConsoleItem.kt
│ │ │ │ └── settings
│ │ │ │ │ └── SettingsFragment.kt
│ │ │ │ └── databinding
│ │ │ │ └── RecyclerViewItems.kt
│ │ │ └── AndroidManifest.xml
│ └── build.gradle.kts
├── shared
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── topjohnwu
│ │ └── magisk
│ │ ├── utils
│ │ └── CompoundEnumeration.java
│ │ └── ProviderInstaller.java
├── test
│ ├── .gitignore
│ ├── proguard-rules.pro
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── topjohnwu
│ │ └── magisk
│ │ └── test
│ │ └── Runners.kt
├── buildSrc
│ ├── .gitignore
│ ├── settings.gradle.kts
│ └── build.gradle.kts
├── core
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values-night
│ │ │ │ └── colors.xml
│ │ │ ├── values-v34
│ │ │ │ └── resources.xml
│ │ │ ├── drawable
│ │ │ │ ├── ic_logo.xml
│ │ │ │ ├── sc_extension.xml
│ │ │ │ ├── sc_superuser.xml
│ │ │ │ ├── ic_favorite.xml
│ │ │ │ ├── ic_patreon.xml
│ │ │ │ ├── ic_more.xml
│ │ │ │ ├── ic_superuser.xml
│ │ │ │ ├── ic_extension.xml
│ │ │ │ ├── ic_twitter.xml
│ │ │ │ ├── ic_github.xml
│ │ │ │ └── ic_paypal.xml
│ │ │ ├── drawable-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ ├── sc_extension.xml
│ │ │ │ └── sc_superuser.xml
│ │ │ ├── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── resources.xml
│ │ │ └── values-v31
│ │ │ │ └── themes.xml
│ │ │ ├── aidl
│ │ │ └── com
│ │ │ │ └── topjohnwu
│ │ │ │ └── magisk
│ │ │ │ └── core
│ │ │ │ └── utils
│ │ │ │ └── IRootUtils.aidl
│ │ │ └── java
│ │ │ └── com
│ │ │ └── topjohnwu
│ │ │ └── magisk
│ │ │ ├── core
│ │ │ ├── base
│ │ │ │ ├── BaseJobService.kt
│ │ │ │ ├── BaseReceiver.kt
│ │ │ │ ├── BaseService.kt
│ │ │ │ └── BaseProvider.kt
│ │ │ ├── utils
│ │ │ │ ├── DummyList.kt
│ │ │ │ ├── RequestAuthentication.kt
│ │ │ │ ├── ProgressInputStream.kt
│ │ │ │ └── RequestInstall.kt
│ │ │ ├── model
│ │ │ │ ├── module
│ │ │ │ │ ├── Module.kt
│ │ │ │ │ └── OnlineModule.kt
│ │ │ │ └── su
│ │ │ │ │ └── SuPolicy.kt
│ │ │ ├── download
│ │ │ │ └── Interfaces.kt
│ │ │ ├── Provider.kt
│ │ │ ├── ktx
│ │ │ │ └── XSU.kt
│ │ │ ├── data
│ │ │ │ ├── magiskdb
│ │ │ │ │ ├── StringDao.kt
│ │ │ │ │ └── SettingsDao.kt
│ │ │ │ └── RetrofitInterfaces.kt
│ │ │ ├── App.kt
│ │ │ ├── signing
│ │ │ │ └── ByteArrayStream.java
│ │ │ └── Service.kt
│ │ │ └── test
│ │ │ └── BaseTest.kt
│ └── proguard-rules.pro
├── stub
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values-cs
│ │ │ │ └── strings.xml
│ │ │ ├── values-el
│ │ │ │ └── strings.xml
│ │ │ ├── values-sv
│ │ │ │ └── strings.xml
│ │ │ ├── values-vi
│ │ │ │ └── strings.xml
│ │ │ ├── values-th
│ │ │ │ └── strings.xml
│ │ │ ├── values-zh-rTW
│ │ │ │ └── strings.xml
│ │ │ ├── values-az
│ │ │ │ └── strings.xml
│ │ │ ├── values-ja
│ │ │ │ └── strings.xml
│ │ │ ├── values-zh-rCN
│ │ │ │ └── strings.xml
│ │ │ ├── values-lt
│ │ │ │ └── strings.xml
│ │ │ ├── values-ko
│ │ │ │ └── strings.xml
│ │ │ ├── values-mk
│ │ │ │ └── strings.xml
│ │ │ ├── values-iw
│ │ │ │ └── strings.xml
│ │ │ ├── values-bg
│ │ │ │ └── strings.xml
│ │ │ ├── values-es
│ │ │ │ └── strings.xml
│ │ │ ├── values-uk
│ │ │ │ └── strings.xml
│ │ │ ├── values-ru
│ │ │ │ └── strings.xml
│ │ │ ├── values-nb
│ │ │ │ └── strings.xml
│ │ │ ├── values-ar
│ │ │ │ └── strings.xml
│ │ │ ├── values-ka
│ │ │ │ └── strings.xml
│ │ │ ├── values-nl
│ │ │ │ └── strings.xml
│ │ │ ├── values-ku
│ │ │ │ └── strings.xml
│ │ │ ├── values
│ │ │ │ └── strings.xml
│ │ │ ├── values-ta
│ │ │ │ └── strings.xml
│ │ │ ├── values-kk
│ │ │ │ └── strings.xml
│ │ │ ├── values-hu
│ │ │ │ └── strings.xml
│ │ │ ├── values-sk
│ │ │ │ └── strings.xml
│ │ │ ├── values-pa
│ │ │ │ └── strings.xml
│ │ │ ├── values-ast
│ │ │ │ └── strings.xml
│ │ │ ├── values-sw
│ │ │ │ └── strings.xml
│ │ │ ├── values-be
│ │ │ │ └── strings.xml
│ │ │ ├── values-de
│ │ │ │ └── strings.xml
│ │ │ ├── values-et
│ │ │ │ └── strings.xml
│ │ │ ├── values-hi
│ │ │ │ └── strings.xml
│ │ │ ├── values-hr
│ │ │ │ └── strings.xml
│ │ │ ├── values-pl
│ │ │ │ └── strings.xml
│ │ │ ├── values-tr
│ │ │ │ └── strings.xml
│ │ │ ├── values-in
│ │ │ │ └── strings.xml
│ │ │ ├── values-pt-rBR
│ │ │ │ └── strings.xml
│ │ │ ├── values-fa
│ │ │ │ └── strings.xml
│ │ │ ├── values-it
│ │ │ │ └── strings.xml
│ │ │ ├── values-pt-rPT
│ │ │ │ └── strings.xml
│ │ │ ├── values-ro
│ │ │ │ └── strings.xml
│ │ │ ├── values-ml
│ │ │ │ └── strings.xml
│ │ │ ├── values-sr
│ │ │ │ └── strings.xml
│ │ │ ├── values-b+sr+Latn
│ │ │ │ └── strings.xml
│ │ │ ├── values-sq
│ │ │ │ └── strings.xml
│ │ │ ├── values-ca
│ │ │ │ └── strings.xml
│ │ │ └── values-fr
│ │ │ │ └── strings.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── topjohnwu
│ │ │ │ └── magisk
│ │ │ │ ├── net
│ │ │ │ ├── ResponseListener.java
│ │ │ │ ├── ErrorHandler.java
│ │ │ │ ├── BadRequest.java
│ │ │ │ └── Networking.java
│ │ │ │ ├── dummy
│ │ │ │ ├── DummyService.java
│ │ │ │ ├── DummyReceiver.java
│ │ │ │ └── DummyProvider.java
│ │ │ │ ├── StubApplication.java
│ │ │ │ └── StubRootService.java
│ │ │ └── AndroidManifest.xml
│ ├── .gitignore
│ ├── proguard-rules.pro
│ └── build.gradle.kts
├── .gitignore
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── build.gradle.kts
├── settings.gradle.kts
└── gradle.properties
├── .github
├── ci.prop
├── ISSUE_TEMPLATE
│ ├── config.yml
│ └── bug_report.md
└── actions
│ └── setup
│ └── sccache.sh
├── tools
├── elf-cleaner
│ ├── .gitignore
│ └── Cargo.toml
├── rustup-wrapper
│ ├── .gitignore
│ └── Cargo.toml
├── bootctl
├── futility
├── keys
│ ├── verity.pk8
│ ├── kernel.keyblock
│ ├── kernel_data_key.vbprivk
│ └── verity.x509.pem
└── bootctl.patch
├── native
├── src
│ ├── exported_sym.txt
│ ├── boot
│ │ ├── .gitignore
│ │ ├── build.rs
│ │ ├── magiskboot.hpp
│ │ └── Cargo.toml
│ ├── core
│ │ ├── resetprop
│ │ │ ├── .gitignore
│ │ │ └── proto
│ │ │ │ └── persistent_properties.proto
│ │ ├── zygisk
│ │ │ └── mod.rs
│ │ ├── resetprop.rs
│ │ ├── su
│ │ │ └── mod.rs
│ │ ├── derive
│ │ │ ├── lib.rs
│ │ │ └── Cargo.toml
│ │ ├── applet_stub.cpp
│ │ ├── build.rs
│ │ ├── Cargo.toml
│ │ ├── deny
│ │ │ └── deny.hpp
│ │ └── include
│ │ │ └── resetprop.hpp
│ ├── base
│ │ ├── build.rs
│ │ ├── include
│ │ │ └── base.hpp
│ │ ├── logging.hpp
│ │ ├── Cargo.toml
│ │ ├── Android.mk
│ │ └── new.cpp
│ ├── init
│ │ ├── build.rs
│ │ ├── Cargo.toml
│ │ ├── preload.c
│ │ └── init.hpp
│ ├── sepolicy
│ │ ├── build.rs
│ │ ├── Cargo.toml
│ │ └── include
│ │ │ └── sepolicy.hpp
│ ├── external
│ │ ├── lz4-sys
│ │ │ └── Cargo.toml
│ │ ├── lzma-sys
│ │ │ └── Cargo.toml
│ │ └── xz-embedded
│ │ │ └── xz_crc32.c
│ ├── .cargo
│ │ └── config.toml
│ ├── Application.mk
│ ├── Android-rs.mk
│ └── include
│ │ └── codegen.rs
└── .gitignore
├── docs
├── images
│ ├── logo.png
│ ├── ota_done.png
│ ├── device_info.png
│ ├── restore_img.png
│ ├── disable_auto_ota.png
│ ├── manager_reboot.png
│ └── install_inactive_slot.png
└── README.md
├── .gitignore
├── .gitattributes
├── scripts
├── module_installer.sh
└── update_binary.sh
├── .gitmodules
└── config.prop.sample
/app/apk/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/shared/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/test/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/.github/ci.prop:
--------------------------------------------------------------------------------
1 | abiList=arm64-v8a
2 |
--------------------------------------------------------------------------------
/app/buildSrc/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/tools/elf-cleaner/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 |
--------------------------------------------------------------------------------
/tools/rustup-wrapper/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 |
--------------------------------------------------------------------------------
/app/core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | src/debug
3 | src/release
4 |
--------------------------------------------------------------------------------
/native/src/exported_sym.txt:
--------------------------------------------------------------------------------
1 | {
2 | NativeBridgeItf;
3 | };
4 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-cs/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-el/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-sv/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-vi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/native/src/boot/.gitignore:
--------------------------------------------------------------------------------
1 | proto/update_metadata.rs
2 | proto/mod.rs
3 |
--------------------------------------------------------------------------------
/native/src/core/resetprop/.gitignore:
--------------------------------------------------------------------------------
1 | proto/mod.rs
2 | proto/persistent_properties.rs
3 |
--------------------------------------------------------------------------------
/tools/bootctl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/tools/bootctl
--------------------------------------------------------------------------------
/tools/futility:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/tools/futility
--------------------------------------------------------------------------------
/native/src/core/zygisk/mod.rs:
--------------------------------------------------------------------------------
1 | mod daemon;
2 |
3 | pub use daemon::zygisk_should_load_module;
4 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /dict.txt
2 |
3 | # Gradle
4 | .gradle
5 | .kotlin
6 | /local.properties
7 | /build
8 |
--------------------------------------------------------------------------------
/app/stub/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /src/release/AndroidManifest.xml
3 | /src/debug/AndroidManifest.xml
4 |
--------------------------------------------------------------------------------
/docs/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/docs/images/logo.png
--------------------------------------------------------------------------------
/tools/keys/verity.pk8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/tools/keys/verity.pk8
--------------------------------------------------------------------------------
/docs/images/ota_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/docs/images/ota_done.png
--------------------------------------------------------------------------------
/docs/images/device_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/docs/images/device_info.png
--------------------------------------------------------------------------------
/docs/images/restore_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/docs/images/restore_img.png
--------------------------------------------------------------------------------
/tools/keys/kernel.keyblock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/tools/keys/kernel.keyblock
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-th/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/docs/images/disable_auto_ota.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/docs/images/disable_auto_ota.png
--------------------------------------------------------------------------------
/docs/images/manager_reboot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/docs/images/manager_reboot.png
--------------------------------------------------------------------------------
/tools/keys/kernel_data_key.vbprivk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/tools/keys/kernel_data_key.vbprivk
--------------------------------------------------------------------------------
/app/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/app/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/docs/images/install_inactive_slot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/metalex201/MagiskSafe/master/docs/images/install_inactive_slot.png
--------------------------------------------------------------------------------
/native/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | obj
3 | libs
4 | /.externalNativeBuild
5 | /.cxx
6 | *-rs.cpp
7 | *-rs.hpp
8 | /compile_commands.json
9 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/native/src/core/resetprop.rs:
--------------------------------------------------------------------------------
1 | pub use persist::{persist_delete_prop, persist_get_prop, persist_get_props, persist_set_prop};
2 |
3 | mod persist;
4 | mod proto;
5 |
--------------------------------------------------------------------------------
/native/src/core/su/mod.rs:
--------------------------------------------------------------------------------
1 | mod connect;
2 | mod daemon;
3 | mod db;
4 | mod pts;
5 |
6 | pub use daemon::SuInfo;
7 | pub use pts::{get_pty_num, pump_tty, restore_stdin};
8 |
--------------------------------------------------------------------------------
/app/core/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #0D0D0D
4 |
5 |
--------------------------------------------------------------------------------
/app/core/src/main/res/values-v34/resources.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
5 |
--------------------------------------------------------------------------------
/app/shared/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | }
4 |
5 | setupCommon()
6 |
7 | android {
8 | namespace = "com.topjohnwu.shared"
9 | }
10 |
--------------------------------------------------------------------------------
/native/src/base/build.rs:
--------------------------------------------------------------------------------
1 | use crate::codegen::gen_cxx_binding;
2 |
3 | #[path = "../include/codegen.rs"]
4 | mod codegen;
5 |
6 | fn main() {
7 | gen_cxx_binding("base-rs");
8 | }
9 |
--------------------------------------------------------------------------------
/native/src/init/build.rs:
--------------------------------------------------------------------------------
1 | use crate::codegen::gen_cxx_binding;
2 |
3 | #[path = "../include/codegen.rs"]
4 | mod codegen;
5 |
6 | fn main() {
7 | gen_cxx_binding("init-rs");
8 | }
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | out
2 | *.zip
3 | *.jks
4 | *.apk
5 | *.log
6 | /config.prop
7 | /notes.md
8 |
9 | # Built binaries
10 | native/out
11 |
12 | # Android Studio
13 | *.iml
14 | .idea
15 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values-night/styles_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/stub/src/main/java/com/topjohnwu/magisk/net/ResponseListener.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.net;
2 |
3 | public interface ResponseListener {
4 | void onResponse(T response);
5 | }
6 |
--------------------------------------------------------------------------------
/native/src/sepolicy/build.rs:
--------------------------------------------------------------------------------
1 | use crate::codegen::gen_cxx_binding;
2 |
3 | #[path = "../include/codegen.rs"]
4 | mod codegen;
5 |
6 | fn main() {
7 | gen_cxx_binding("policy-rs");
8 | }
9 |
--------------------------------------------------------------------------------
/app/buildSrc/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | dependencyResolutionManagement {
2 | versionCatalogs {
3 | create("libs") {
4 | from(files("../gradle/libs.versions.toml"))
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: XDA Community Support
4 | url: https://forum.xda-developers.com/f/magisk.5903/
5 | about: Please ask and answer questions here.
6 |
7 |
--------------------------------------------------------------------------------
/native/src/core/derive/lib.rs:
--------------------------------------------------------------------------------
1 | use proc_macro::TokenStream;
2 |
3 | mod decodable;
4 |
5 | #[proc_macro_derive(Decodable)]
6 | pub fn derive_decodable(input: TokenStream) -> TokenStream {
7 | decodable::derive_decodable(input)
8 | }
9 |
--------------------------------------------------------------------------------
/app/stub/src/main/java/com/topjohnwu/magisk/net/ErrorHandler.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.net;
2 |
3 | import java.net.HttpURLConnection;
4 |
5 | public interface ErrorHandler {
6 | void onError(HttpURLConnection conn, Exception e);
7 | }
8 |
--------------------------------------------------------------------------------
/tools/rustup-wrapper/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "rustup-wrapper"
3 | version = "0.0.0"
4 | edition = "2024"
5 |
6 | [dependencies]
7 | home = "0.5"
8 |
9 | [profile.release]
10 | strip = true
11 | lto = true
12 | codegen-units = 1
13 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values/theme_overlay.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("MagiskPlugin")
3 | }
4 |
5 | tasks.register("clean", Delete::class) {
6 | delete(rootProject.layout.buildDirectory)
7 |
8 | subprojects.forEach {
9 | dependsOn(":${it.name}:clean")
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 需要升級到完整版 Magisk Manager。是否下載並安裝?
3 | 請連上網路!升級到完整版 Magisk Manager 是必須的。
4 | 正在下載
5 |
6 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_error_transient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_primary_transient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_text_transient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/tools/elf-cleaner/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "elf-cleaner"
3 | version = "0.0.0"
4 | edition = "2024"
5 |
6 | [dependencies]
7 | object = { version = "0.36", features = ["build"] }
8 | anyhow = "1.0"
9 |
10 | [profile.release]
11 | strip = true
12 | lto = true
13 | codegen-units = 1
14 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_on_primary_transient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/shared/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-az/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Qurmanı sonlandırmaq üçün full Magisk Manager`ə yüksəldin. Yüklənib qurulsun?
3 | Lütfən internetə qoşulun! Full Magisk Manager\'ə yüksəltmə lazımidir.
4 |
5 |
--------------------------------------------------------------------------------
/native/src/core/derive/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "derive"
3 | version.workspace = true
4 | edition.workspace = true
5 |
6 | [lib]
7 | path = "lib.rs"
8 | proc-macro = true
9 |
10 | [dependencies]
11 | syn = { workspace = true }
12 | quote = { workspace = true }
13 | proc-macro2 = { workspace = true }
14 |
--------------------------------------------------------------------------------
/app/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Magisk Manager のフルバージョンにアップグレードしてセットアップを完了します。ダウンロードしてインストールしますか?
3 | ダウンロード中
4 | インターネットに接続してください!フルバージョンの Magisk Manager が必要です。
5 |
6 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/bg_selection_circle_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/native/src/base/include/base.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "../xwrap.hpp"
4 | #include "../files.hpp"
5 | #include "../misc.hpp"
6 | #include "../logging.hpp"
7 | #include "../base-rs.hpp"
8 |
9 | using rust::xpipe2;
10 | using rust::fd_path;
11 | using kv_pairs = std::vector>;
12 |
--------------------------------------------------------------------------------
/native/src/core/applet_stub.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 | #include
5 |
6 | int main(int argc, char *argv[]) {
7 | if (argc < 1)
8 | return 1;
9 | cmdline_logging();
10 | init_argv0(argc, argv);
11 | umask(0);
12 | return APPLET_STUB_MAIN(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_card_background_color_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_action_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-zh-rCN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 需要下载完整版 Magisk 才能正常运行。开始下载?
4 | 下载需要网络,请检查网络连接。
5 | 正在下载
6 | 请重新打开本应用
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-lt/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Atsinaujinkite į pilną Magisk Manager versiją, kad baigtumėte pasiruošimą. Atsisiųsti ir instaliuoti?
3 | Prašome prisijungti prie interneto! Atsinaujinimas į pilną Magisk Manager versiją yra privalomas.
4 |
5 |
--------------------------------------------------------------------------------
/app/stub/src/main/java/com/topjohnwu/magisk/dummy/DummyService.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.dummy;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.IBinder;
6 |
7 | public class DummyService extends Service {
8 | @Override
9 | public IBinder onBind(Intent intent) {
10 | return null;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ko/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 완전한 Magisk Manager로 업데이트하여 설치를 마치십시오. 다운로드하고 설치하시겠습니까?
3 | 인터넷에 연결해 주시기 바랍니다! 완전한 Magisk Manager로 업데이트 해야 합니다.
4 | 다운로드중
5 | 앱을 수동으로 재시작 하세요
6 |
7 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-mk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Надградете до целосната верзија на Magisk Manager за да го завршите поставувањето. Преземете и инсталирајте?
3 | Ве молиме поврзете се на интернет бидејќи е потребна надградба на целосната верзија на Magisk Manager.
4 |
5 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_primary_error_transient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-iw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | יש לעדכן לגירסה מלאה של מנהל Magisk בכדי לסיים את העדכון. להוריד ולהתקין?
4 | נא להתחבר לאינטרנט! עדכון לגירסה מלאה של מנהל Magisk נדרש.
5 | מוריד
6 |
7 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_menu_tint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_logo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | @Suppress("UnstableApiUsage")
2 | dependencyResolutionManagement {
3 | repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
4 | repositories {
5 | google()
6 | mavenCentral()
7 | maven("https://jitpack.io")
8 | }
9 | }
10 | rootProject.name = "Magisk"
11 | include(":apk", ":core", ":shared", ":stub", ":test")
12 |
--------------------------------------------------------------------------------
/app/stub/src/main/java/com/topjohnwu/magisk/dummy/DummyReceiver.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.dummy;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 |
7 | public class DummyReceiver extends BroadcastReceiver {
8 | @Override
9 | public void onReceive(Context context, Intent intent) {}
10 | }
11 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/core/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #00AF9C
4 | #00796B
5 | #e0e0e0
6 | #e0e0e0
7 | @color/ic_launcher_background
8 |
9 |
--------------------------------------------------------------------------------
/app/core/src/main/aidl/com/topjohnwu/magisk/core/utils/IRootUtils.aidl:
--------------------------------------------------------------------------------
1 | // IRootUtils.aidl
2 | package com.topjohnwu.magisk.core.utils;
3 |
4 | // Declare any non-default types here with import statements
5 |
6 | interface IRootUtils {
7 | android.app.ActivityManager.RunningAppProcessInfo getAppProcess(int pid);
8 | IBinder getFileSystem();
9 | boolean addSystemlessHosts();
10 | }
11 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-bg/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Надградете до пълната версия на Magisk Manager, за да довършите първоначалната настройка. Изтегляне и инсталиране сега?
3 | Моля да се свържете към работеща интернет мрежа, защото надграждането до пълната версия на Magisk Manager е задължително.
4 |
5 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Actualiza a la versión completa de Magisk para finalizar la instalación. ¿Descargar e instalar?
3 | Sin conexión disponible
4 | Descargando...
5 | Por favor, relanza la app
6 |
7 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-uk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Оновіть додаток Magisk для завершення встановлення. Завантажити і встановити?
4 | Будь ласка, підключіться до Інтернету! Потрібно оновити додаток Magisk.
5 | Завантаження
6 |
7 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/menu/menu_flash.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Обновите Magisk для завершения установки. Продолжить?
3 | Пожалуйста, подключитесь к Интернету! Требуется обновление Magisk.
4 | Загрузка
5 | Пожалуйста, перезапустите приложение
6 |
7 |
--------------------------------------------------------------------------------
/native/src/external/lz4-sys/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "lz4-sys"
3 | license = "MIT"
4 | version = "1.11.1+lz4-1.10.0"
5 | authors = [ "Jens Heyens ", "Artem V. Navrotskiy ", "Patrick Marks "]
6 | description = "Rust LZ4 sys package."
7 | repository = "https://github.com/10xGenomics/lz4-rs"
8 |
9 | [dependencies]
10 | libc = "0.2"
11 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/base/BaseJobService.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.base
2 |
3 | import android.app.job.JobService
4 | import android.content.Context
5 | import com.topjohnwu.magisk.core.patch
6 |
7 | abstract class BaseJobService : JobService() {
8 | override fun attachBaseContext(base: Context) {
9 | super.attachBaseContext(base.patch())
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/native/src/init/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "magiskinit"
3 | version.workspace = true
4 | edition.workspace = true
5 |
6 | [lib]
7 | crate-type = ["staticlib"]
8 | path = "lib.rs"
9 |
10 | [build-dependencies]
11 | cxx-gen = { workspace = true }
12 |
13 | [dependencies]
14 | base = { path = "../base" }
15 | magiskpolicy = { path = "../sepolicy", default-features = false }
16 | cxx = { workspace = true }
17 |
--------------------------------------------------------------------------------
/app/core/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/stub/src/main/java/com/topjohnwu/magisk/StubApplication.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 |
6 | public class StubApplication extends Application {
7 | @Override
8 | protected void attachBaseContext(Context base) {
9 | super.attachBaseContext(base);
10 | DynLoad.loadAndInitializeApp(this);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-nb/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Oppgrader til den komplette versjonen av Magisk Manager for å fullføre oppsettet. Vil du laste ned og installere?
4 | Vennligst koble deg på internettet! Å oppgradere til den komplette versjonen av Magisk Manager er påkrevd.
5 |
6 |
--------------------------------------------------------------------------------
/native/src/base/logging.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | void LOGD(const char *fmt, ...) __printflike(1, 2);
7 | void LOGI(const char *fmt, ...) __printflike(1, 2);
8 | void LOGW(const char *fmt, ...) __printflike(1, 2);
9 | void LOGE(const char *fmt, ...) __printflike(1, 2);
10 | #define PLOGE(fmt, args...) LOGE(fmt " failed with %d: %s\n", ##args, errno, std::strerror(errno))
11 |
--------------------------------------------------------------------------------
/app/test/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Keep all test dependencies
2 | -keep class org.junit.** { *; }
3 | -keep class androidx.test.** { *; }
4 |
5 | # Make sure the classloader constructor is kept
6 | -keepclassmembers class com.topjohnwu.magisk.test.TestClassLoader { (); }
7 |
8 | # Repackage dependencies
9 | -repackageclasses 'deps'
10 | -allowaccessmodification
11 |
12 | # Keep attributes for stacktrace
13 | -keepattributes *
14 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_superuser_filled_md2.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ar/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | عليك بتحديث ماجيسك لإكمال تهيئة التطبيق. هل تريد التنزيل والتثبيت؟
4 | يرجى الإتصال بالإنترنت! تحديث ماجيسك مطلوب.
5 | جارٍ التنزيل
6 | يرجى إعادة تشغيل التطبيق يدوياً
7 |
8 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/bg_line_top_rounded.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ka/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | განაახლეთ სრულ Magisk მენჯერის ვერსიამდე ინსტალაციის დასასრულებლად. გსურთ გადმოწერა და ინსტალირება?
4 | გთხოვთ დაუკავშირდით ინტერნეტს! საჭიროა Magisk მენეჯერის სრულ ვერსიამდე განახლება.
5 | მიმდინარეობს გადმოწერა
6 |
7 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-nl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Installeer de volledige Magisk Manager om de installatie af te ronden. Wil je dit nu doen?
4 | Maak verbinding met het internet! Het installeren van de volledige Magisk Manager is vereist.
5 | Bezig met downloaden...
6 |
7 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/bg_line_bottom_rounded.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_theme_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/view/TextItem.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.view
2 |
3 | import com.topjohnwu.magisk.R
4 | import com.topjohnwu.magisk.databinding.DiffItem
5 | import com.topjohnwu.magisk.databinding.ItemWrapper
6 | import com.topjohnwu.magisk.databinding.RvItem
7 |
8 | class TextItem(override val item: Int) : RvItem(), DiffItem, ItemWrapper {
9 | override val layoutRes = R.layout.item_text
10 | }
11 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ku/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | ماجیسکەکەت بەرزبکەوە بۆ وەشانی تەواوەتی، دەتەوێت دایبگریت و ڕێکیبخەیت؟
4 | تکایە پەیوەست ببە بە ئینتەرنێتەوە، پێویستە ماجیسکەکەت ڕێک بخەیت.
5 | داگرتن
6 | تکایە دووبارە ئەپەکە بکەوە
7 |
8 |
--------------------------------------------------------------------------------
/native/src/sepolicy/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "magiskpolicy"
3 | version.workspace = true
4 | edition.workspace = true
5 |
6 | [lib]
7 | crate-type = ["staticlib", "rlib"]
8 | path = "lib.rs"
9 |
10 | [build-dependencies]
11 | cxx-gen = { workspace = true }
12 |
13 | [features]
14 | default = ["main"]
15 | main = []
16 |
17 | [dependencies]
18 | base = { path = "../base" }
19 | cxx = { workspace = true }
20 | argh = { workspace = true }
21 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Upgrade to full Magisk to finish the setup. Download and install?
4 | Please connect to the Internet! Upgrading to full Magisk is required.
5 | Downloading
6 | Please manually re-launch the app
7 |
8 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/color/color_state_primary_transient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ta/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | அமைப்பை முடிக்க முழு மேகிஸ்க்கு மேம்படுத்தவும். பதிவிறக்கி நிறுவவா?
4 | இணையத்துடன் இணைக்கவும்! முழு மேகிஸ்க்கு மேம்படுத்தல் தேவை.
5 | பதிவிறக்குகிறது
6 | பயன்பாட்டை கைமுறையாக மீண்டும் தொடங்கவும்
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-kk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Орнатуды аяқтау үшін Magisk қолданбасының толық нұсқасын жүктеп алу керек. Жалғастырасыз ба?
4 | Интернетке қосылыңызшы! Magisk қолданбасын жаңарту керек.
5 | Жүктеп алуда
6 | Қолданбаны қайта қосыңыз
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-hu/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | A telepítés befejezéséhez frissíts a teljes Magiskre. Letöltés és telepítés?
4 | Csatlakozz az internethez! Frissíteni kell a teljes Magiskre.
5 | Letöltés
6 | Kérjük manuálisan indítsd újra az alkalmazást
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-sk/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pre dokončenie inštalácie sa vyžaduje upgrade Magisk Managera. Stiahnuť a nainštalovať?
4 | Pripojte sa na internet! Upgrade Magisk Managera je potrebný.
5 | Sťahuje sa
6 | Zavrite a spustite apku manuálne
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-pa/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | ਸੈਟਅਪ ਨੂੰ ਪੂਰਾ ਕਰਨ ਲਈ ਪੂਰੇ ਮੈਜਿਕਸ ਮੈਨੇਜਰ ਵਿਚ ਅਪਗ੍ਰੇਡ ਕਰੋ. ਡਾਉਨਲੋਡ ਅਤੇ ਇੰਸਟੌਲ ਕਰੋ?
4 | ਕਿਰਪਾ ਕਰਕੇ ਇੰਟਰਨੈਟ ਨਾਲ ਜੁੜੋ! ਪੂਰਾ ਮੈਜਿਕਸ ਮੈਨੇਜਰ ਅਪਗ੍ਰੇਡ ਕਰਨ ਦੀ ਲੋੜ ਹੈ।
5 | ਡਾਊਨਲੋਡ ਹੋ ਰਿਹਾ ਹੈ
6 | ਕਿਰਪਾ ਕਰਕੇ ਐਪ ਨੂੰ ਮੁੜ ਚਾਲੂ ਕਰੋ
7 |
8 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/sc_extension.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/sc_superuser.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 | -
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ast/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Instala la versión completa de Magisk pa finar la configuración. ¿Quies facelo agora?
4 | ¡Conéctate a internet! Tienes d\'instalar la versión completa de Magisk.
5 | Baxando
6 | Volvi llanzar l\'aplicación manualmente
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-sw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pata toleo jipya la Magisk kamili ili kumaliza usanidi. Pakua na usakinishe?
4 | Tafadhali unganisha kwenye Mtandao! Kusasisha hadi Magisk kamili inahitajika.
5 | Inapakua
6 | Tafadhali zindua upya programu wewe mwenyewe
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-be/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Абнавіце Magisk Manager для завяршэння ўсталёўкі. Спампаваць і ўсталяваць?
4 | Калі ласка, падлучыцеся да інтэрнэту! Патрабуецца абнаўленне Magisk Manager.
5 | Спампоўванне
6 | Калі ласка, уласнаручна перазапусціце праграму
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Upgrade zum vollständigen Magisk Manager, um das Setup abzuschließen. Herunterladen und installieren?
3 | Bitte Internetverbindung herstellen! Das Upgrade zum vollständigen Magisk Manager ist erforderlich.
4 | Herunterladen...
5 | Bitte starte die App manuell neu!
6 |
7 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-et/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Täienda seadistuse lõpetamiseks Magiski täisversioonile. Kas laadid alla ja installid?
4 | Palun ühendu Internetti! Nõutud on Magiski täisversioonile täiendamine.
5 | Allalaadimine
6 | Palun käivita rakendus käsitsi uuesti
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-hi/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | सेटअप को पूरा करने के लिए पूर्ण मैजिस्क मैनेजर में अपग्रेड करें. डाउनलोड करके इंस्टॉल करें?
4 | कृपया इन्टरनेट से जुड़िये! पूर्ण मैजिस्क मैनेजर में अपग्रेड की आवश्यकता है।
5 | डाउनलोड हो रहा है
6 | कृपया ऐप को फिर से शुरू करें
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-hr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Nadogradite na full Magisk Manager da biste dovršili postavljanje. Preuzeti i instalirati?
4 | Povežite se na Internet! Potrebna je nadogradnja na full Magisk Manager.
5 | Preuzimanje
6 | Ručno ponovno pokrenite aplikaciju
7 |
8 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Magisk Documentation
2 |
3 | - [Installation Instructions](install.md)
4 | - [Frequently Asked Questions](faq.md)
5 | - [Magisk Changelog](changes.md)
6 |
7 | The following sections are for developers
8 |
9 | - [Building and Developing Magisk](build.md) (for developing Magisk itself)
10 | - [Developer Guides](guides.md) (for developers **using** Magisk)
11 | - [Magisk Tools](tools.md)
12 | - [Internal Details](details.md)
13 | - [Android Booting Shenanigans](boot.md)
14 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-pl/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Zaktualizuj Magisk do pełnej wersji aby ukończyć instalację. Pobrać i zainstalować?
4 | Połącz się z Internetem! Wymagane jest uaktualnienie Magisk do pełnej wersji.
5 | Pobieranie
6 | Proszę ręcznie uruchomić aplikację ponownie.
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-tr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Kurulumu tamamlamak için tam Magisk Manager\'a yükseltin. İndirip yüklensin mi?
4 | Lütfen internete bağlanın! Magisk Manager\'ın tam sürümüne yükseltmek gerekiyor.
5 | İndiriliyor
6 | Lütfen uygulamayı el ile yeniden açınız.
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/utils/DummyList.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.utils
2 |
3 | object DummyList : java.util.AbstractList() {
4 |
5 | override val size: Int get() = 0
6 |
7 | override fun get(index: Int): String {
8 | throw IndexOutOfBoundsException()
9 | }
10 |
11 | override fun add(element: String): Boolean = false
12 |
13 | override fun add(index: Int, element: String) {}
14 |
15 | override fun clear() {}
16 | }
17 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-in/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tingkatkan Magisk Manager ke versi utuh untuk menyelesaikan penyiapan. Download dan instal?
4 | Harap sambungkan ke Internet! Peningkatan Magisk Manager versi utuh diperlukan.
5 | Mendownload
6 | Buka kembali aplikasi secara manual
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-pt-rBR/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Atualize para o Magisk completo para finalizar a configuração. Deseja baixar e instalar?
4 | Por favor, conecte-se à internet! É necessário atualizar para o Magisk completo.
5 | Baixando
6 | Por favor, reinicie o app manualmente.
7 |
8 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_home_filled_md2.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_superuser_outlined_md2.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/base/BaseReceiver.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.base
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 | import androidx.annotation.CallSuper
7 | import com.topjohnwu.magisk.core.patch
8 |
9 | abstract class BaseReceiver : BroadcastReceiver() {
10 | @CallSuper
11 | override fun onReceive(context: Context, intent: Intent?) {
12 | context.patch()
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-fa/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | برای به پایان رساندن تنظیمات ، به نسخه کامل Magisk Manager ارتقا دهید. دانلود و نصب بشه؟
4 | لطفاً به اینترنت متصل شوید! برای ارتقا به نسخه کامل Magisk Manager لازم است.
5 | درحال دانلود
6 | لطفاً به صورت دستی برنامه را دوباره راه اندازی کنید
7 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/model/module/Module.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.model.module
2 |
3 | abstract class Module : Comparable {
4 | abstract var id: String
5 | protected set
6 | abstract var name: String
7 | protected set
8 | abstract var version: String
9 | protected set
10 | abstract var versionCode: Int
11 | protected set
12 |
13 | override operator fun compareTo(other: Module) = id.compareTo(other.id)
14 | }
15 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_favorite.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_patreon.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Aggiorna alla versione completa di Magisk per completare l\'installazione. Vuoi procedere con il download e l\'installazione?
3 | Controlla la connessione a Internet! È necessaria per l\'aggiornamento alla versione completa di Magisk.
4 | Download in corso
5 | Riavvia manualmente l\'app
6 |
7 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-pt-rPT/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Atualize para o Magisk completo para finalizar a configuração. Deseja descarregar e instalar?
4 | Por favor, ligue-se à internet! É necessário atualizar para o Magisk completo.
5 | A descarregar
6 | Por favor, reinicie o app manualmente.
7 |
8 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_update_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ro/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Treci la versiunea completă Magisk pentru a finaliza configurarea. Descarci și instalezi?
4 | Te rugăm să te conectezi la internet! Este necesară actualizarea la versiunea completă Magisk.
5 | Se descarcă
6 | Te rugăm să relansezi manual aplicația
7 |
8 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/base/BaseService.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.base
2 |
3 | import android.app.Service
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.os.IBinder
7 | import com.topjohnwu.magisk.core.patch
8 |
9 | open class BaseService : Service() {
10 | override fun attachBaseContext(base: Context) {
11 | super.attachBaseContext(base.patch())
12 | }
13 | override fun onBind(intent: Intent?): IBinder? = null
14 | }
15 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/download/Interfaces.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.download
2 |
3 | import android.app.Notification
4 | import android.content.Context
5 |
6 | interface DownloadSession {
7 | val context: Context
8 | fun attachNotification(id: Int, builder: Notification.Builder)
9 | fun onDownloadComplete()
10 | }
11 |
12 | interface DownloadNotifier {
13 | val context: Context
14 | fun notifyUpdate(id: Int, editor: (Notification.Builder) -> Unit = {})
15 | }
16 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ml/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | സജ്ജീകരണം പൂർത്തിയാക്കാൻ പൂർണ്ണ മജിസ്കിലേക്ക് അപ്ഗ്രേഡ് ചെയ്യുക. ഡൗൺലോഡ് ചെയ്ത് ഇൻസ്റ്റാൾ ചെയ്യണോ?
4 | ദയവായി ഇന്റർനെറ്റിലേക്ക് കണക്റ്റുചെയ്യുക! പൂർണ്ണ മജിസ്കിലേക്ക് അപ്ഗ്രേഡ് ചെയ്യേണ്ടതുണ്ട്.
5 | ഡൗൺലോഡ് ചെയ്യുന്നു
6 | ആപ്പ് സ്വമേധയാ വീണ്ടും തുറക്കുക
7 |
8 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-sr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Ажурирајте Magisk да бисте завршили постављање. Преузми и инсталирај?
5 | Молимо повежите се на интернет! Неопходно је ажурирање Magisk-а.
6 | Преузимање
7 | Молимо покрените апликацију поново
8 |
9 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_folder_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-b+sr+Latn/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Ažurirajte Magisk da biste završili postavljanje. Preuzmi i instaliraj?
5 | Molimo povežite se na internet! Neophodno je ažuriranje Magisk-a.
6 | Preuzimanje
7 | Molimo pokrenite aplikaciju ponovo
8 |
9 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-sq/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Përditësoni Magisk në versionin e plotë për të përfunduar konfigurimin. Shkarkoni dhe instaloni?
4 | Ju lutemi lidhuni me internetin! Kërkohet internet për të shkarkuar Magisk në versionin e plotë.
5 | Duke shkarkuar
6 | Ju lutemi, ri-hapni aplikacionin manualisht
7 |
8 |
--------------------------------------------------------------------------------
/native/src/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | # Set arm64 as the default target
3 | # The actual compilation will have the target overriden by command-line.
4 | target = "aarch64-linux-android"
5 | # Enable cross language LTO, and explicitly set dwarf-version for ThinLTO
6 | rustflags = ["-Z", "dwarf-version=4", "-C", "linker-plugin-lto"]
7 | target-dir = "../out/rust"
8 |
9 | [unstable]
10 | build-std = ["std", "panic_abort"]
11 | build-std-features = ["panic_immediate_abort", "optimize_for_size"]
12 | profile-rustflags = true
13 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-ca/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Fes una actualització total de Magisk Manager per finalitzar l\'instal·lació. Descarregar i instal·lar?
4 | Si us plau, connecta\'t a internet! Es necessari fer una actualització total de Magisk Manager.
5 | Baixant
6 | Torni a obrir l\'aplicació manualment, si us plau
7 |
8 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_check_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_more.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 |
6 | 2dp
7 | 4dp
8 | 8dp
9 | 12dp
10 | 16dp
11 | 32dp
12 | 48dp
13 |
14 | 8dp
15 |
16 | 56dp
17 |
18 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable-v26/sc_extension.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable-v26/sc_superuser.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_download_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_superuser.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_home_outlined_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_install.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_save_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_check_circle_unchecked_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_paint.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_check_circle_checked_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_close_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/anim/fragment_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
15 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/anim/fragment_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
15 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/anim/fragment_exit_pop.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
15 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/anim/fragment_enter_pop.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
15 |
--------------------------------------------------------------------------------
/app/stub/src/main/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Une mise à niveau de Magisk Manager en version complète est nécessaire afin de terminer l’installation. Souhaitez‑vous procéder à son téléchargement et son installation ?
4 | Veuillez vous connecter à Internet ! Une mise à niveau complète de Magisk Manager est requise.
5 | Téléchargement en cours
6 | Veuillez relancer manuellement l’application
7 |
8 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_back_md2.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_notifications_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/native/src/base/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "base"
3 | version.workspace = true
4 | edition.workspace = true
5 |
6 | [lib]
7 | path = "lib.rs"
8 |
9 | [features]
10 | selinux = []
11 | dyn_selinux = []
12 |
13 | [build-dependencies]
14 | cxx-gen = { workspace = true }
15 |
16 | [dependencies]
17 | cxx = { workspace = true }
18 | libc = { workspace = true }
19 | cfg-if = { workspace = true }
20 | thiserror = { workspace = true }
21 | argh = { workspace = true }
22 | bytemuck = { workspace = true }
23 | num-traits = { workspace = true }
24 | num-derive = { workspace = true }
25 | const_format = { workspace = true }
26 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/menu/menu_log_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/menu/menu_home_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_delete_md2.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set the default behavior, in case people don't have core.autocrlf set.
2 | * text eol=lf
3 |
4 | # Explicitly declare text files you want to always be normalized and converted
5 | # to native line endings on checkout.
6 | # *.c text
7 | # *.h text
8 |
9 | # Declare files that will always have CRLF line endings on checkout.
10 | *.cmd text eol=crlf
11 | *.bat text eol=crlf
12 |
13 | # Denote all files that are truly binary and should not be modified.
14 | tools/** binary
15 | tools/rustup-wrapper/** -binary
16 | tools/elf-cleaner/** -binary
17 | *.jar binary
18 | *.exe binary
19 | *.apk binary
20 | *.png binary
21 | *.jpg binary
22 | *.ttf binary
23 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/Provider.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core
2 |
3 | import android.os.Bundle
4 | import com.topjohnwu.magisk.core.base.BaseProvider
5 | import com.topjohnwu.magisk.core.su.SuCallbackHandler
6 |
7 | class Provider : BaseProvider() {
8 |
9 | override fun call(method: String, arg: String?, extras: Bundle?): Bundle? {
10 | return when (method) {
11 | SuCallbackHandler.LOG, SuCallbackHandler.NOTIFY -> {
12 | SuCallbackHandler.run(context!!, method, extras)
13 | Bundle.EMPTY
14 | }
15 | else -> Bundle.EMPTY
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_log_textview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/utils/AccessibilityUtils.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.utils
2 |
3 | import android.content.ContentResolver
4 | import android.provider.Settings
5 |
6 | class AccessibilityUtils {
7 | companion object {
8 | fun isAnimationEnabled(cr: ContentResolver): Boolean {
9 | return !(Settings.Global.getFloat(cr, Settings.Global.ANIMATOR_DURATION_SCALE, 1.0f) == 0.0f
10 | && Settings.Global.getFloat(cr, Settings.Global.TRANSITION_ANIMATION_SCALE, 1.0f) == 0.0f
11 | && Settings.Global.getFloat(cr, Settings.Global.WINDOW_ANIMATION_SCALE, 1.0f) == 0.0f)
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_extension.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/native/src/base/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # Magisk project-wide common code
4 |
5 | include $(CLEAR_VARS)
6 | LOCAL_MODULE := libbase
7 | LOCAL_C_INCLUDES := \
8 | src/include \
9 | $(LOCAL_PATH)/include \
10 | src/external/cxx-rs/include \
11 | out/generated
12 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
13 | LOCAL_EXPORT_STATIC_LIBRARIES := libcxx
14 | LOCAL_STATIC_LIBRARIES := libcxx
15 | LOCAL_CFLAGS := -DRUST_CXX_NO_EXCEPTIONS
16 | LOCAL_SRC_FILES := \
17 | new.cpp \
18 | files.cpp \
19 | misc.cpp \
20 | logging.cpp \
21 | base-rs.cpp \
22 | ../external/cxx-rs/src/cxx.cc
23 | include $(BUILD_STATIC_LIBRARY)
24 |
--------------------------------------------------------------------------------
/native/src/sepolicy/include/sepolicy.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | #include "../policy-rs.hpp"
9 |
10 | // sepolicy paths
11 | #define PLAT_POLICY_DIR "/system/etc/selinux/"
12 | #define VEND_POLICY_DIR "/vendor/etc/selinux/"
13 | #define PROD_POLICY_DIR "/product/etc/selinux/"
14 | #define ODM_POLICY_DIR "/odm/etc/selinux/"
15 | #define SYSEXT_POLICY_DIR "/system_ext/etc/selinux/"
16 | #define SPLIT_PLAT_CIL PLAT_POLICY_DIR "plat_sepolicy.cil"
17 |
18 | // selinuxfs paths
19 | #define SELINUX_MNT "/sys/fs/selinux"
20 | #define SELINUX_VERSION SELINUX_MNT "/policyvers"
21 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/arch/ViewEvent.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.arch
2 |
3 | import android.content.Context
4 |
5 | /**
6 | * Class for passing events from ViewModels to Activities/Fragments
7 | * (see https://medium.com/google-developers/livedata-with-snackbar-navigation-and-other-events-the-singleliveevent-case-ac2622673150)
8 | */
9 | abstract class ViewEvent
10 |
11 | interface ContextExecutor {
12 | operator fun invoke(context: Context)
13 | }
14 |
15 | interface ActivityExecutor {
16 | operator fun invoke(activity: UIActivity<*>)
17 | }
18 |
19 | interface FragmentExecutor {
20 | operator fun invoke(fragment: BaseFragment<*>)
21 | }
22 |
--------------------------------------------------------------------------------
/app/core/src/main/res/values-v31/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/native/src/external/lzma-sys/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "lzma-sys"
3 | version = "0.1.20"
4 | authors = ["Alex Crichton "]
5 | license = "MIT/Apache-2.0"
6 | repository = "https://github.com/alexcrichton/xz2-rs"
7 | homepage = "https://github.com/alexcrichton/xz2-rs"
8 | documentation = "https://docs.rs/lzma-sys"
9 | description = """
10 | Raw bindings to liblzma which contains an implementation of LZMA and xz stream
11 | encoding/decoding.
12 |
13 | High level Rust bindings are available in the `xz2` crate.
14 | """
15 | categories = ["external-ffi-bindings"]
16 | edition = "2018"
17 |
18 | [dependencies]
19 | libc = "0.2.51"
20 |
21 | [features]
22 | static = []
23 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_module_filled_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_search_md2.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/native/src/boot/build.rs:
--------------------------------------------------------------------------------
1 | use pb_rs::{ConfigBuilder, types::FileDescriptor};
2 |
3 | use crate::codegen::gen_cxx_binding;
4 |
5 | #[path = "../include/codegen.rs"]
6 | mod codegen;
7 |
8 | fn main() {
9 | println!("cargo:rerun-if-changed=proto/update_metadata.proto");
10 |
11 | gen_cxx_binding("boot-rs");
12 |
13 | let cb = ConfigBuilder::new(
14 | &["proto/update_metadata.proto"],
15 | None,
16 | Some(&"proto"),
17 | &["."],
18 | )
19 | .unwrap();
20 | FileDescriptor::run(
21 | &cb.single_module(true)
22 | .dont_use_cow(true)
23 | .generate_getters(true)
24 | .build(),
25 | )
26 | .unwrap();
27 | }
28 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_restart.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SecondSlotWarningDialog.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.dialog
2 |
3 | import com.topjohnwu.magisk.core.R
4 | import com.topjohnwu.magisk.events.DialogBuilder
5 | import com.topjohnwu.magisk.view.MagiskDialog
6 |
7 | class SecondSlotWarningDialog : DialogBuilder {
8 |
9 | override fun build(dialog: MagiskDialog) {
10 | dialog.apply {
11 | setTitle(android.R.string.dialog_alert_title)
12 | setMessage(R.string.install_inactive_slot_msg)
13 | setButton(MagiskDialog.ButtonType.POSITIVE) {
14 | text = android.R.string.ok
15 | }
16 | setCancelable(true)
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.ui.install
2 |
3 | import com.topjohnwu.magisk.R
4 | import com.topjohnwu.magisk.arch.BaseFragment
5 | import com.topjohnwu.magisk.arch.viewModel
6 | import com.topjohnwu.magisk.databinding.FragmentInstallMd2Binding
7 | import com.topjohnwu.magisk.core.R as CoreR
8 |
9 | class InstallFragment : BaseFragment() {
10 |
11 | override val layoutRes = R.layout.fragment_install_md2
12 | override val viewModel by viewModel()
13 |
14 | override fun onStart() {
15 | super.onStart()
16 | requireActivity().setTitle(CoreR.string.install)
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_spinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/ktx/XSU.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.ktx
2 |
3 | import com.topjohnwu.magisk.core.Config
4 | import com.topjohnwu.superuser.Shell
5 | import kotlinx.coroutines.Dispatchers
6 | import kotlinx.coroutines.withContext
7 |
8 | fun reboot(reason: String = if (Config.recovery) "recovery" else "") {
9 | if (reason == "recovery") {
10 | // KEYCODE_POWER = 26, hide incorrect "Factory data reset" message
11 | Shell.cmd("/system/bin/input keyevent 26").submit()
12 | }
13 | Shell.cmd("/system/bin/svc power reboot $reason || /system/bin/reboot $reason").submit()
14 | }
15 |
16 | suspend fun Shell.Job.await() = withContext(Dispatchers.IO) { exec() }
17 |
--------------------------------------------------------------------------------
/app/test/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.application")
3 | kotlin("android")
4 | }
5 |
6 | android {
7 | namespace = "com.topjohnwu.magisk.test"
8 |
9 | defaultConfig {
10 | applicationId = "com.topjohnwu.magisk.test"
11 | versionCode = 1
12 | versionName = "1.0"
13 | proguardFile("proguard-rules.pro")
14 | }
15 |
16 | buildTypes {
17 | release {
18 | isMinifyEnabled = true
19 | }
20 | }
21 | }
22 |
23 | setupTestApk()
24 |
25 | dependencies {
26 | implementation(libs.test.runner)
27 | implementation(libs.test.rules)
28 | implementation(libs.test.junit)
29 | implementation(libs.test.uiautomator)
30 | }
31 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/arch/AsyncLoadViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.arch
2 |
3 | import androidx.annotation.MainThread
4 | import androidx.lifecycle.viewModelScope
5 | import kotlinx.coroutines.Job
6 | import kotlinx.coroutines.launch
7 |
8 | abstract class AsyncLoadViewModel : BaseViewModel() {
9 |
10 | private var loadingJob: Job? = null
11 |
12 | @MainThread
13 | fun startLoading() {
14 | if (loadingJob?.isActive == true) {
15 | // Prevent multiple jobs from running at the same time
16 | return
17 | }
18 | loadingJob = viewModelScope.launch { doLoadWork() }
19 | }
20 |
21 | protected abstract suspend fun doLoadWork()
22 | }
23 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_console_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/utils/RequestAuthentication.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.utils
2 |
3 | import android.app.Activity
4 | import android.app.KeyguardManager
5 | import android.content.Context
6 | import android.content.Intent
7 | import androidx.activity.result.contract.ActivityResultContract
8 |
9 | class RequestAuthentication: ActivityResultContract() {
10 |
11 | override fun createIntent(context: Context, input: Unit) =
12 | context.getSystemService(KeyguardManager::class.java)
13 | .createConfirmDeviceCredentialIntent(null, null)
14 |
15 | override fun parseResult(resultCode: Int, intent: Intent?) =
16 | resultCode == Activity.RESULT_OK
17 | }
18 |
--------------------------------------------------------------------------------
/native/src/init/preload.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "init.hpp"
6 |
7 | __attribute__((constructor))
8 | static void preload_init() {
9 | // Make sure our next exec won't get bugged
10 | unsetenv("LD_PRELOAD");
11 | unlink(PRELOAD_LIB);
12 | }
13 |
14 | int security_load_policy(void *data, size_t len) {
15 | int policy = open(PRELOAD_POLICY, O_WRONLY | O_CREAT, 0644);
16 | if (policy < 0) return -1;
17 |
18 | // Write the policy
19 | write(policy, data, len);
20 | close(policy);
21 |
22 | // Wait for ack
23 | int ack = open(PRELOAD_ACK, O_RDONLY);
24 | char c;
25 | read(ack, &c, 1);
26 | close(ack);
27 |
28 | return 0;
29 | }
30 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_day.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/core/src/main/res/values/resources.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Magisk
6 | Zygisk
7 |
8 |
9 | PayPal
10 | Patreon
11 | Twitter
12 | GitHub
13 |
14 | @drawable/ic_logo
15 |
16 | true
17 |
18 |
19 |
--------------------------------------------------------------------------------
/native/src/core/build.rs:
--------------------------------------------------------------------------------
1 | use pb_rs::{ConfigBuilder, types::FileDescriptor};
2 |
3 | use crate::codegen::gen_cxx_binding;
4 |
5 | #[path = "../include/codegen.rs"]
6 | mod codegen;
7 |
8 | fn main() {
9 | println!("cargo:rerun-if-changed=resetprop/proto/persistent_properties.proto");
10 |
11 | gen_cxx_binding("core-rs");
12 |
13 | let cb = ConfigBuilder::new(
14 | &["resetprop/proto/persistent_properties.proto"],
15 | None,
16 | Some(&"resetprop/proto"),
17 | &["."],
18 | )
19 | .unwrap();
20 | FileDescriptor::run(
21 | &cb.single_module(true)
22 | .dont_use_cow(true)
23 | .generate_getters(true)
24 | .build(),
25 | )
26 | .unwrap();
27 | }
28 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/native/src/base/new.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | /* Override libc++ new implementation
5 | * to optimize final build size */
6 |
7 | void* operator new(std::size_t s) { return std::malloc(s); }
8 | void* operator new[](std::size_t s) { return std::malloc(s); }
9 | void operator delete(void *p) { std::free(p); }
10 | void operator delete[](void *p) { std::free(p); }
11 | void* operator new(std::size_t s, const std::nothrow_t&) noexcept { return std::malloc(s); }
12 | void* operator new[](std::size_t s, const std::nothrow_t&) noexcept { return std::malloc(s); }
13 | void operator delete(void *p, const std::nothrow_t&) noexcept { std::free(p); }
14 | void operator delete[](void *p, const std::nothrow_t&) noexcept { std::free(p); }
15 |
--------------------------------------------------------------------------------
/native/src/core/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "magisk"
3 | version.workspace = true
4 | edition.workspace = true
5 |
6 | [lib]
7 | crate-type = ["staticlib"]
8 | path = "lib.rs"
9 |
10 | [features]
11 | default = ["check-signature"]
12 | check-signature = []
13 |
14 | [build-dependencies]
15 | cxx-gen = { workspace = true }
16 | pb-rs = { workspace = true }
17 |
18 | [dependencies]
19 | base = { path = "../base", features = ["selinux"] }
20 | derive = { path = "derive" }
21 | cxx = { workspace = true }
22 | num-traits = { workspace = true }
23 | num-derive = { workspace = true }
24 | quick-protobuf = { workspace = true }
25 | bytemuck = { workspace = true, features = ["derive"] }
26 | thiserror = { workspace = true }
27 | bit-set = { workspace = true }
28 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_forth_md2.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/scripts/module_installer.sh:
--------------------------------------------------------------------------------
1 | #!/sbin/sh
2 |
3 | #################
4 | # Initialization
5 | #################
6 |
7 | umask 022
8 |
9 | # echo before loading util_functions
10 | ui_print() { echo "$1"; }
11 |
12 | require_new_magisk() {
13 | ui_print "*******************************"
14 | ui_print " Please install Magisk v20.4+! "
15 | ui_print "*******************************"
16 | exit 1
17 | }
18 |
19 | #########################
20 | # Load util_functions.sh
21 | #########################
22 |
23 | OUTFD=$2
24 | ZIPFILE=$3
25 |
26 | mount /data 2>/dev/null
27 |
28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
29 | . /data/adb/magisk/util_functions.sh
30 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
31 |
32 | install_module
33 | exit 0
34 |
--------------------------------------------------------------------------------
/app/buildSrc/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
2 |
3 | plugins {
4 | `kotlin-dsl`
5 | }
6 |
7 | repositories {
8 | google()
9 | mavenCentral()
10 | }
11 |
12 | gradlePlugin {
13 | plugins {
14 | register("MagiskPlugin") {
15 | id = "MagiskPlugin"
16 | implementationClass = "MagiskPlugin"
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation(kotlin("gradle-plugin", libs.versions.kotlin.get()))
23 | implementation(libs.android.gradle.plugin)
24 | implementation(libs.ksp.plugin)
25 | implementation(libs.navigation.safe.args.plugin)
26 | implementation(libs.lsparanoid.plugin)
27 | implementation(libs.moshi.plugin)
28 | implementation(libs.jgit)
29 | }
30 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/data/magiskdb/StringDao.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.data.magiskdb
2 |
3 | class StringDao : MagiskDB() {
4 |
5 | suspend fun delete(key: String) {
6 | val query = "DELETE FROM ${Table.STRINGS} WHERE key=\"$key\""
7 | exec(query)
8 | }
9 |
10 | suspend fun put(key: String, value: String) {
11 | val kv = mapOf("key" to key, "value" to value)
12 | val query = "REPLACE INTO ${Table.STRINGS} ${kv.toQuery()}"
13 | exec(query)
14 | }
15 |
16 | suspend fun fetch(key: String, default: String = ""): String {
17 | val query = "SELECT value FROM ${Table.STRINGS} WHERE key=\"$key\" LIMIT 1"
18 | return exec(query) { it["value"] }.firstOrNull() ?: default
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/data/magiskdb/SettingsDao.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.data.magiskdb
2 |
3 | class SettingsDao : MagiskDB() {
4 |
5 | suspend fun delete(key: String) {
6 | val query = "DELETE FROM ${Table.SETTINGS} WHERE key=\"$key\""
7 | exec(query)
8 | }
9 |
10 | suspend fun put(key: String, value: Int) {
11 | val kv = mapOf("key" to key, "value" to value)
12 | val query = "REPLACE INTO ${Table.SETTINGS} ${kv.toQuery()}"
13 | exec(query)
14 | }
15 |
16 | suspend fun fetch(key: String, default: Int = -1): Int {
17 | val query = "SELECT value FROM ${Table.SETTINGS} WHERE key=\"$key\" LIMIT 1"
18 | return exec(query) { it["value"]?.toInt() }.firstOrNull() ?: default
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_bug_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
12 |
13 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_home_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
12 |
13 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/markdown_window_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values-v27/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/native/src/core/deny/deny.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #define ISOLATED_MAGIC "isolated"
6 |
7 | namespace DenyRequest {
8 | enum : int {
9 | ENFORCE,
10 | DISABLE,
11 | ADD,
12 | REMOVE,
13 | LIST,
14 | STATUS,
15 |
16 | END
17 | };
18 | }
19 |
20 | namespace DenyResponse {
21 | enum : int {
22 | OK,
23 | ENFORCED,
24 | NOT_ENFORCED,
25 | ITEM_EXIST,
26 | ITEM_NOT_EXIST,
27 | INVALID_PKG,
28 | NO_NS,
29 | ERROR,
30 |
31 | END
32 | };
33 | }
34 |
35 | // CLI entries
36 | int enable_deny();
37 | int disable_deny();
38 | int add_list(int client);
39 | int rm_list(int client);
40 | void ls_list(int client);
41 |
42 | bool proc_context_match(int pid, std::string_view context);
43 | void *logcat(void *arg);
44 | extern bool logcat_exit;
45 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_module_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
12 |
13 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_bug_filled_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_settings_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
12 |
13 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_superuser_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
12 |
13 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/native/src/boot/magiskboot.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define HEADER_FILE "header"
4 | #define KERNEL_FILE "kernel"
5 | #define RAMDISK_FILE "ramdisk.cpio"
6 | #define VND_RAMDISK_DIR "vendor_ramdisk"
7 | #define SECOND_FILE "second"
8 | #define EXTRA_FILE "extra"
9 | #define KER_DTB_FILE "kernel_dtb"
10 | #define RECV_DTBO_FILE "recovery_dtbo"
11 | #define DTB_FILE "dtb"
12 | #define BOOTCONFIG_FILE "bootconfig"
13 | #define NEW_BOOT "new-boot.img"
14 |
15 | int unpack(const char *image, bool skip_decomp = false, bool hdr = false);
16 | void repack(const char *src_img, const char *out_img, bool skip_comp = false);
17 | int verify(const char *image, const char *cert);
18 | int sign(const char *image, const char *name, const char *cert, const char *key);
19 | int split_image_dtb(const char *filename, bool skip_decomp = false);
20 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/menu/menu_deny_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
21 |
--------------------------------------------------------------------------------
/app/test/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.ui.theme
2 |
3 | import com.topjohnwu.magisk.arch.BaseViewModel
4 | import com.topjohnwu.magisk.core.Config
5 | import com.topjohnwu.magisk.dialog.DarkThemeDialog
6 | import com.topjohnwu.magisk.events.RecreateEvent
7 | import com.topjohnwu.magisk.view.TappableHeadlineItem
8 |
9 | class ThemeViewModel : BaseViewModel(), TappableHeadlineItem.Listener {
10 |
11 | val themeHeadline = TappableHeadlineItem.ThemeMode
12 |
13 | override fun onItemPressed(item: TappableHeadlineItem) = when (item) {
14 | is TappableHeadlineItem.ThemeMode -> DarkThemeDialog().show()
15 | }
16 |
17 | fun saveTheme(theme: Theme) {
18 | if (!theme.isSelected) {
19 | Config.themeOrdinal = theme.ordinal
20 | RecreateEvent().publish()
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_bug_outlined_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/view/TappableHeadlineItem.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.view
2 |
3 | import com.topjohnwu.magisk.R
4 | import com.topjohnwu.magisk.databinding.DiffItem
5 | import com.topjohnwu.magisk.databinding.RvItem
6 | import com.topjohnwu.magisk.core.R as CoreR
7 |
8 | sealed class TappableHeadlineItem : RvItem(), DiffItem {
9 |
10 | abstract val title: Int
11 | abstract val icon: Int
12 |
13 | override val layoutRes = R.layout.item_tappable_headline
14 |
15 | // --- listener
16 |
17 | interface Listener {
18 |
19 | fun onItemPressed(item: TappableHeadlineItem)
20 |
21 | }
22 |
23 | // --- objects
24 |
25 | object ThemeMode : TappableHeadlineItem() {
26 | override val title = CoreR.string.settings_dark_mode_title
27 | override val icon = R.drawable.ic_day_night
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/.github/actions/setup/sccache.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Get latest sccache version
4 | get_sccache_ver() {
5 | curl -sL 'https://api.github.com/repos/mozilla/sccache/releases/latest' | jq -r .name
6 | }
7 |
8 | # $1=variant
9 | # $2=install_dir
10 | # $3=exe
11 | install_from_gh() {
12 | local ver=$(curl -sL 'https://api.github.com/repos/mozilla/sccache/releases/latest' | jq -r .name)
13 | local url="https://github.com/mozilla/sccache/releases/download/${ver}/sccache-${ver}-$1.tar.gz"
14 | local dest="$2/$3"
15 | curl -L "$url" | tar xz -O --wildcards "*/$3" > $dest
16 | chmod +x $dest
17 | }
18 |
19 | if [ $RUNNER_OS = "macOS" ]; then
20 | brew install sccache
21 | elif [ $RUNNER_OS = "Linux" ]; then
22 | install_from_gh x86_64-unknown-linux-musl /usr/local/bin sccache
23 | elif [ $RUNNER_OS = "Windows" ]; then
24 | install_from_gh x86_64-pc-windows-msvc $USERPROFILE/.cargo/bin sccache.exe
25 | fi
26 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "selinux"]
2 | path = native/src/external/selinux
3 | url = https://github.com/topjohnwu/selinux.git
4 | [submodule "lz4"]
5 | path = native/src/external/lz4
6 | url = https://github.com/lz4/lz4.git
7 | [submodule "xz"]
8 | path = native/src/external/xz
9 | url = https://github.com/xz-mirror/xz.git
10 | [submodule "libcxx"]
11 | path = native/src/external/libcxx
12 | url = https://github.com/topjohnwu/libcxx.git
13 | [submodule "cxx-rs"]
14 | path = native/src/external/cxx-rs
15 | url = https://github.com/topjohnwu/cxx.git
16 | [submodule "lsplt"]
17 | path = native/src/external/lsplt
18 | url = https://github.com/LSPosed/LSPlt.git
19 | [submodule "system_properties"]
20 | path = native/src/external/system_properties
21 | url = https://github.com/topjohnwu/system_properties.git
22 | [submodule "crt0"]
23 | path = native/src/external/crt0
24 | url = https://github.com/topjohnwu/crt0.git
25 |
--------------------------------------------------------------------------------
/native/src/init/init.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define DEFAULT_DT_DIR "/proc/device-tree/firmware/android"
4 | #define REDIR_PATH "/data/magiskinit"
5 |
6 | #define PRELOAD_LIB "/dev/preload.so"
7 | #define PRELOAD_POLICY "/dev/sepolicy"
8 | #define PRELOAD_ACK "/dev/ack"
9 |
10 | #ifdef __cplusplus
11 |
12 | #include
13 | #include
14 |
15 | #include "init-rs.hpp"
16 |
17 | int magisk_proxy_main(int, char *argv[]);
18 | rust::Utf8CStr backup_init();
19 |
20 | // Expose some constants to Rust
21 |
22 | static inline rust::Utf8CStr split_plat_cil() {
23 | return SPLIT_PLAT_CIL;
24 | };
25 |
26 | static inline rust::Utf8CStr preload_lib() {
27 | return PRELOAD_LIB;
28 | }
29 |
30 | static inline rust::Utf8CStr preload_policy() {
31 | return PRELOAD_POLICY;
32 | }
33 |
34 | static inline rust::Utf8CStr preload_ack() {
35 | return PRELOAD_ACK;
36 | }
37 |
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/scripts/update_binary.sh:
--------------------------------------------------------------------------------
1 | #!/sbin/sh
2 |
3 | TMPDIR=/dev/tmp
4 | rm -rf $TMPDIR
5 | mkdir -p $TMPDIR 2>/dev/null
6 |
7 | export BBBIN=$TMPDIR/busybox
8 | for arch in "x86_64" "x86" "arm64-v8a" "armeabi-v7a"; do
9 | unzip -o "$3" "lib/$arch/libbusybox.so" -d $TMPDIR >&2
10 | libpath="$TMPDIR/lib/$arch/libbusybox.so"
11 | chmod 755 $libpath
12 | if [ -x $libpath ] && $libpath >/dev/null 2>&1; then
13 | mv -f $libpath $BBBIN
14 | break
15 | fi
16 | done
17 | $BBBIN rm -rf $TMPDIR/lib
18 |
19 | export INSTALLER=$TMPDIR/install
20 | $BBBIN mkdir -p $INSTALLER
21 | $BBBIN unzip -o "$3" "assets/*" "lib/*" "META-INF/com/google/*" -x "lib/*/libbusybox.so" -d $INSTALLER >&2
22 | export ASH_STANDALONE=1
23 | if echo "$3" | $BBBIN grep -q "uninstall"; then
24 | exec $BBBIN sh "$INSTALLER/assets/uninstaller.sh" "$@"
25 | else
26 | exec $BBBIN sh "$INSTALLER/META-INF/com/google/android/updater-script" "$@"
27 | fi
28 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/dialog/SuperuserRevokeDialog.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.dialog
2 |
3 | import com.topjohnwu.magisk.core.R
4 | import com.topjohnwu.magisk.events.DialogBuilder
5 | import com.topjohnwu.magisk.view.MagiskDialog
6 |
7 | class SuperuserRevokeDialog(
8 | private val appName: String,
9 | private val onSuccess: () -> Unit
10 | ) : DialogBuilder {
11 |
12 | override fun build(dialog: MagiskDialog) {
13 | dialog.apply {
14 | setTitle(R.string.su_revoke_title)
15 | setMessage(R.string.su_revoke_msg, appName)
16 | setButton(MagiskDialog.ButtonType.POSITIVE) {
17 | text = android.R.string.ok
18 | onClick { onSuccess() }
19 | }
20 | setButton(MagiskDialog.ButtonType.NEGATIVE) {
21 | text = android.R.string.cancel
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_module_outlined_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/native/src/Application.mk:
--------------------------------------------------------------------------------
1 | APP_BUILD_SCRIPT := src/Android.mk
2 | APP_CFLAGS := -Wall -Oz -fomit-frame-pointer
3 | APP_CPPFLAGS := -std=c++23
4 | APP_STL := none
5 | APP_PLATFORM := android-23
6 | APP_THIN_ARCHIVE := true
7 | APP_STRIP_MODE := none
8 |
9 | ifdef MAGISK_DEBUG
10 |
11 | NDK_APP_OUT := ./obj/debug
12 | APP_CFLAGS += -flto=thin -gdwarf-4
13 | APP_LDFLAGS += -flto=thin
14 |
15 | else
16 |
17 | NDK_APP_OUT := ./obj/release
18 | APP_CFLAGS += -flto
19 | APP_LDFLAGS += -flto -Wl,--icf=all
20 |
21 | endif
22 |
23 | ifdef B_CRT0
24 |
25 | # Disable all security and debugging features
26 | APP_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-stack-protector -fno-threadsafe-statics -U_FORTIFY_SOURCE
27 | # Override output folder to make sure all dependencies are rebuilt with new CFLAGS
28 | NDK_APP_OUT := $(NDK_APP_OUT)-nolibc
29 |
30 | endif
31 |
--------------------------------------------------------------------------------
/tools/bootctl.patch:
--------------------------------------------------------------------------------
1 | # How to build the bootctl bundled within the Magisk app:
2 | #
3 | # 1. Checkout and sync the AOSP tree:
4 | # https://source.android.com/setup/build/downloading
5 | # 2. Build for arm64:
6 | # lunch aosp_arm64-eng
7 | # 3. Apply patches:
8 | # cd system/extras; patch -p1 < bootctl.patch
9 | # 4. Build the executable:
10 | # m bootctl
11 |
12 | diff --git a/bootctl/Android.bp b/bootctl/Android.bp
13 | index f63871cf..8a551bbe 100644
14 | --- a/bootctl/Android.bp
15 | +++ b/bootctl/Android.bp
16 | @@ -26,11 +26,15 @@ cc_binary {
17 | "-Werror",
18 | ],
19 |
20 | - shared_libs: [
21 | + static_libs: [
22 | "android.hardware.boot@1.0",
23 | "android.hardware.boot@1.1",
24 | "android.hardware.boot@1.2",
25 | + ],
26 | + shared_libs: [
27 | "libhidlbase",
28 | "libutils",
29 | + "libcutils",
30 | + "liblog",
31 | ],
32 | }
33 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_check_circle_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
14 |
15 |
19 |
20 |
24 |
25 |
--------------------------------------------------------------------------------
/config.prop.sample:
--------------------------------------------------------------------------------
1 | ##########################################################
2 | # All variables in config.prop are optional
3 | # Removing or leaving them blank will keep default values
4 | ##########################################################
5 |
6 | # The version name of Magisk. Default: git HEAD short SHA1
7 | version=string
8 |
9 | # Output path. Default: out
10 | outdir=string
11 |
12 | # List of ABIs to build, separated with ','
13 | # Default: armeabi-v7a,x86,arm64-v8a,x86_64
14 | abiList=[string]
15 |
16 | #####################################################
17 | # Signing configs for signing zips and APKs
18 | # These 4 variables has to be either all set or not
19 | #####################################################
20 |
21 | # Path to keystore file
22 | keyStore=string
23 | # Keystore password
24 | keyStorePass=string
25 | # The desired key alias in the keystore
26 | keyAlias=string
27 | # Password of specified key alias
28 | keyPass=string
29 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/App.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core
2 |
3 | import android.app.Application
4 | import android.content.Context
5 | import com.topjohnwu.magisk.StubApk
6 | import com.topjohnwu.magisk.core.utils.RootUtils
7 |
8 | open class App() : Application() {
9 |
10 | constructor(o: Any) : this() {
11 | val data = StubApk.Data(o)
12 | // Add the root service name mapping
13 | data.classToComponent[RootUtils::class.java.name] = data.rootService.name
14 | // Send back the actual root service class
15 | data.rootService = RootUtils::class.java
16 | Info.stub = data
17 | }
18 |
19 | override fun attachBaseContext(context: Context) {
20 | if (context is Application) {
21 | AppContext.attachApplication(context)
22 | } else {
23 | super.attachBaseContext(context)
24 | AppContext.attachApplication(this)
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_night.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/native/src/core/resetprop/proto/persistent_properties.proto:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | syntax = "proto2";
17 | option optimize_for = LITE_RUNTIME;
18 | message PersistentProperties {
19 | message PersistentPropertyRecord {
20 | optional string name = 1;
21 | optional string value = 2;
22 | }
23 | repeated PersistentPropertyRecord properties = 1;
24 | }
25 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_module_storage_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/model/su/SuPolicy.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.model.su
2 |
3 | import com.topjohnwu.magisk.core.data.magiskdb.MagiskDB
4 |
5 | class SuPolicy(
6 | val uid: Int,
7 | var policy: Int = QUERY,
8 | var remain: Long = -1L,
9 | var logging: Boolean = true,
10 | var notification: Boolean = true,
11 | ) {
12 | companion object {
13 | const val QUERY = 0
14 | const val DENY = 1
15 | const val ALLOW = 2
16 | const val RESTRICT = 3
17 | }
18 |
19 | fun toMap(): MutableMap {
20 | val until = if (remain <= 0) {
21 | remain
22 | } else {
23 | MagiskDB.Literal("(strftime(\"%s\", \"now\") + $remain)")
24 | }
25 | return mutableMapOf(
26 | "uid" to uid,
27 | "policy" to policy,
28 | "until" to until,
29 | "logging" to logging,
30 | "notification" to notification
31 | )
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_day_night.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/menu/menu_bottom_nav.xml:
--------------------------------------------------------------------------------
1 |
2 |
30 |
--------------------------------------------------------------------------------
/app/shared/src/main/java/com/topjohnwu/magisk/utils/CompoundEnumeration.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.utils;
2 |
3 | import java.util.Enumeration;
4 | import java.util.NoSuchElementException;
5 |
6 | public class CompoundEnumeration implements Enumeration {
7 | private Enumeration[] enums;
8 | private int index = 0;
9 |
10 | @SafeVarargs
11 | public CompoundEnumeration(Enumeration ...enums) {
12 | this.enums = enums;
13 | }
14 |
15 | private boolean next() {
16 | while (index < enums.length) {
17 | if (enums[index] != null && enums[index].hasMoreElements()) {
18 | return true;
19 | }
20 | index++;
21 | }
22 | return false;
23 | }
24 |
25 | public boolean hasMoreElements() {
26 | return next();
27 | }
28 |
29 | public E nextElement() {
30 | if (!next()) {
31 | throw new NoSuchElementException();
32 | }
33 | return enums[index].nextElement();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_twitter.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_module_download.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
14 |
15 |
16 |
17 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/model/module/OnlineModule.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.model.module
2 |
3 | import android.os.Parcelable
4 | import com.topjohnwu.magisk.core.model.ModuleJson
5 | import kotlinx.parcelize.Parcelize
6 |
7 | @Parcelize
8 | data class OnlineModule(
9 | override var id: String,
10 | override var name: String,
11 | override var version: String,
12 | override var versionCode: Int,
13 | val zipUrl: String,
14 | val changelog: String,
15 | ) : Module(), Parcelable {
16 | constructor(local: LocalModule, json: ModuleJson) :
17 | this(local.id, local.name, json.version, json.versionCode, json.zipUrl, json.changelog)
18 |
19 | val downloadFilename get() = "$name-$version($versionCode).zip".legalFilename()
20 |
21 | private fun String.legalFilename() = replace(" ", "_")
22 | .replace("'", "").replace("\"", "")
23 | .replace("$", "").replace("`", "")
24 | .replace("*", "").replace("/", "_")
25 | .replace("#", "").replace("@", "")
26 | .replace("\\", "_")
27 | }
28 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/base/BaseProvider.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.base
2 |
3 | import android.content.ContentProvider
4 | import android.content.ContentValues
5 | import android.content.Context
6 | import android.content.pm.ProviderInfo
7 | import android.database.Cursor
8 | import android.net.Uri
9 | import com.topjohnwu.magisk.core.patch
10 |
11 | open class BaseProvider : ContentProvider() {
12 | override fun attachInfo(context: Context, info: ProviderInfo) {
13 | super.attachInfo(context.patch(), info)
14 | }
15 | override fun onCreate() = true
16 | override fun getType(uri: Uri): String? = null
17 | override fun insert(uri: Uri, values: ContentValues?): Uri? = null
18 | override fun delete(uri: Uri, selection: String?, selectionArgs: Array?) = 0
19 | override fun update(uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array?) = 0
20 | override fun query(uri: Uri, projection: Array?, selection: String?, selectionArgs: Array?, sortOrder: String?): Cursor? = null
21 | }
22 |
--------------------------------------------------------------------------------
/app/stub/src/main/java/com/topjohnwu/magisk/dummy/DummyProvider.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.dummy;
2 |
3 | import android.content.ContentProvider;
4 | import android.content.ContentValues;
5 | import android.database.Cursor;
6 | import android.net.Uri;
7 |
8 | public class DummyProvider extends ContentProvider {
9 | @Override
10 | public boolean onCreate() {
11 | return false;
12 | }
13 |
14 | @Override
15 | public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
16 | return null;
17 | }
18 |
19 | @Override
20 | public String getType(Uri uri) {
21 | return null;
22 | }
23 |
24 | @Override
25 | public Uri insert(Uri uri, ContentValues values) {
26 | return null;
27 | }
28 |
29 | @Override
30 | public int delete(Uri uri, String selection, String[] selectionArgs) {
31 | return 0;
32 | }
33 |
34 | @Override
35 | public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
36 | return 0;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/databinding/RecyclerViewItems.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.databinding
2 |
3 | import androidx.databinding.PropertyChangeRegistry
4 | import androidx.databinding.ViewDataBinding
5 | import androidx.recyclerview.widget.RecyclerView
6 |
7 | abstract class RvItem {
8 | abstract val layoutRes: Int
9 | }
10 |
11 | abstract class ObservableRvItem : RvItem(), ObservableHost {
12 | override var callbacks: PropertyChangeRegistry? = null
13 | }
14 |
15 | interface ItemWrapper {
16 | val item: E
17 | }
18 |
19 | interface ViewAwareItem {
20 | fun onBind(binding: ViewDataBinding, recyclerView: RecyclerView)
21 | }
22 |
23 | interface DiffItem {
24 |
25 | fun itemSameAs(other: T): Boolean {
26 | if (this === other) return true
27 | return when (this) {
28 | is ItemWrapper<*> -> item == (other as ItemWrapper<*>).item
29 | is Comparable<*> -> compareValues(this, other as Comparable<*>) == 0
30 | else -> this == other
31 | }
32 | }
33 |
34 | fun contentSameAs(other: T) = true
35 | }
36 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/menu/menu_reboot.xml:
--------------------------------------------------------------------------------
1 |
2 |
35 |
--------------------------------------------------------------------------------
/app/core/src/main/res/drawable/ic_github.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/test/BaseTest.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.test
2 |
3 | import android.app.Instrumentation
4 | import android.app.UiAutomation
5 | import android.content.Context
6 | import androidx.test.platform.app.InstrumentationRegistry
7 | import androidx.test.uiautomator.UiDevice
8 | import com.topjohnwu.magisk.core.utils.RootUtils
9 | import com.topjohnwu.superuser.Shell
10 | import org.junit.Assert.assertTrue
11 |
12 | interface BaseTest {
13 | val instrumentation: Instrumentation
14 | get() = InstrumentationRegistry.getInstrumentation()
15 | val appContext: Context get() = instrumentation.targetContext
16 | val testContext: Context get() = instrumentation.context
17 | val uiAutomation: UiAutomation get() = instrumentation.uiAutomation
18 | val device: UiDevice get() = UiDevice.getInstance(instrumentation)
19 |
20 | companion object {
21 | fun prerequisite() {
22 | assertTrue("Should have root access", Shell.getShell().isRoot)
23 | // Make sure the root service is running
24 | RootUtils.Connection.await()
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/signing/ByteArrayStream.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.signing;
2 |
3 | import java.io.ByteArrayInputStream;
4 | import java.io.ByteArrayOutputStream;
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 | import java.nio.ByteBuffer;
8 |
9 | public class ByteArrayStream extends ByteArrayOutputStream {
10 |
11 | public synchronized void readFrom(InputStream is) {
12 | readFrom(is, Integer.MAX_VALUE);
13 | }
14 |
15 | public synchronized void readFrom(InputStream is, int len) {
16 | int read;
17 | byte buffer[] = new byte[4096];
18 | try {
19 | while ((read = is.read(buffer, 0, Math.min(len, buffer.length))) > 0) {
20 | write(buffer, 0, read);
21 | len -= read;
22 | }
23 | } catch (IOException e) {
24 | e.printStackTrace();
25 | }
26 | }
27 |
28 | public ByteArrayInputStream getInputStream() {
29 | return new ByteArrayInputStream(buf, 0, count);
30 | }
31 |
32 | public ByteBuffer toByteBuffer() {
33 | return ByteBuffer.wrap(buf, 0, count);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | org.gradle.jvmargs=-Xmx2560m -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | org.gradle.parallel=true
19 |
20 | # Enable build cache
21 | org.gradle.caching=true
22 |
23 | # Use K2 in kapt
24 | kapt.use.k2=true
25 |
26 | # Android
27 | android.useAndroidX=true
28 | android.injected.testOnly=false
29 | android.nonFinalResIds=false
30 |
31 | # Magisk
32 | magisk.stubVersion=40
33 | magisk.versionCode=30200
34 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/ui/log/LogRvItem.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.ui.log
2 |
3 | import androidx.databinding.ViewDataBinding
4 | import androidx.recyclerview.widget.RecyclerView
5 | import com.google.android.material.textview.MaterialTextView
6 | import com.topjohnwu.magisk.R
7 | import com.topjohnwu.magisk.databinding.DiffItem
8 | import com.topjohnwu.magisk.databinding.ItemWrapper
9 | import com.topjohnwu.magisk.databinding.ObservableRvItem
10 | import com.topjohnwu.magisk.databinding.ViewAwareItem
11 |
12 | class LogRvItem(
13 | override val item: String
14 | ) : ObservableRvItem(), DiffItem, ItemWrapper, ViewAwareItem {
15 |
16 | override val layoutRes = R.layout.item_log_textview
17 |
18 | override fun onBind(binding: ViewDataBinding, recyclerView: RecyclerView) {
19 | val view = binding.root as MaterialTextView
20 | view.measure(0, 0)
21 | val desiredWidth = view.measuredWidth
22 | val layoutParams = view.layoutParams
23 | layoutParams.width = desiredWidth
24 | if (recyclerView.width < desiredWidth) {
25 | recyclerView.requestLayout()
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values/styles_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
17 |
18 |
23 |
24 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/native/src/boot/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "magiskboot"
3 | version.workspace = true
4 | edition.workspace = true
5 |
6 | [lib]
7 | crate-type = ["staticlib"]
8 | path = "lib.rs"
9 |
10 | [build-dependencies]
11 | cxx-gen = { workspace = true }
12 | pb-rs = { workspace = true }
13 |
14 | [dependencies]
15 | base = { path = "../base" }
16 | cxx = { workspace = true }
17 | byteorder = { workspace = true }
18 | size = { workspace = true }
19 | quick-protobuf = { workspace = true }
20 | argh = { workspace = true }
21 | sha1 = { workspace = true }
22 | sha2 = { workspace = true }
23 | digest = { workspace = true }
24 | p256 = { workspace = true }
25 | p384 = { workspace = true }
26 | p521 = { workspace = true }
27 | rsa = { workspace = true, features = ["sha2"] }
28 | x509-cert = { workspace = true }
29 | der = { workspace = true, features = ["derive", "pem"] }
30 | fdt = { workspace = true }
31 | bytemuck = { workspace = true, features = ["derive", "min_const_generics"] }
32 | num-traits = { workspace = true }
33 | flate2 = { workspace = true, features = ["zlib-rs"] }
34 | bzip2 = { workspace = true }
35 | lz4 = { workspace = true }
36 | xz2 = { workspace = true }
37 | zopfli = { workspace = true, features = ["gzip"] }
38 |
--------------------------------------------------------------------------------
/app/shared/src/main/java/com/topjohnwu/magisk/ProviderInstaller.java:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk;
2 |
3 | import android.content.Context;
4 | import android.content.pm.ApplicationInfo;
5 |
6 | public class ProviderInstaller {
7 |
8 | private static final String GMS_PACKAGE_NAME = "com.google.android.gms";
9 |
10 | public static void install(Context context) {
11 | try {
12 | // Check if gms is a system app
13 | ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(GMS_PACKAGE_NAME, 0);
14 | if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
15 | return;
16 | }
17 |
18 | // Try installing new SSL provider from Google Play Service
19 | Context gms = context.createPackageContext(GMS_PACKAGE_NAME,
20 | Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
21 | gms.getClassLoader()
22 | .loadClass("com.google.android.gms.common.security.ProviderInstallerImpl")
23 | .getMethod("insertProvider", Context.class)
24 | .invoke(null, gms);
25 | } catch (Exception ignored) {
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_list_single_line.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
14 |
15 |
16 |
17 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/dialog/ManagerInstallDialog.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.dialog
2 |
3 | import com.topjohnwu.magisk.core.AppContext
4 | import com.topjohnwu.magisk.core.Info
5 | import com.topjohnwu.magisk.core.R
6 | import com.topjohnwu.magisk.core.download.DownloadEngine
7 | import com.topjohnwu.magisk.core.download.Subject
8 | import com.topjohnwu.magisk.view.MagiskDialog
9 | import java.io.File
10 |
11 | class ManagerInstallDialog : MarkDownDialog() {
12 |
13 | override suspend fun getMarkdownText(): String {
14 | val text = Info.update.note
15 | // Cache the changelog
16 | File(AppContext.cacheDir, "${Info.update.versionCode}.md").writeText(text)
17 | return text
18 | }
19 |
20 | override fun build(dialog: MagiskDialog) {
21 | super.build(dialog)
22 | dialog.apply {
23 | setCancelable(true)
24 | setButton(MagiskDialog.ButtonType.POSITIVE) {
25 | text = R.string.install
26 | onClick { DownloadEngine.startWithActivity(activity, Subject.App()) }
27 | }
28 | setButton(MagiskDialog.ButtonType.NEGATIVE) {
29 | text = android.R.string.cancel
30 | }
31 | }
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/drawable/ic_settings_filled_md2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
--------------------------------------------------------------------------------
/app/stub/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
22 |
23 | -obfuscationdictionary ../dict.txt
24 | -classobfuscationdictionary ../dict.txt
25 | -packageobfuscationdictionary ../dict.txt
26 |
27 | # Excessive obfuscation
28 | -repackageclasses
29 | -allowaccessmodification
30 | -keepclassmembers class com.topjohnwu.magisk.dummy.* { (); }
31 | -keepclassmembers class com.topjohnwu.magisk.DownloadActivity { (); }
32 | -keepclassmembers class com.topjohnwu.magisk.StubRootService { (); }
33 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/utils/ProgressInputStream.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.utils
2 |
3 | import java.io.FilterInputStream
4 | import java.io.InputStream
5 |
6 | class ProgressInputStream(
7 | base: InputStream,
8 | val progressEmitter: (Long) -> Unit
9 | ) : FilterInputStream(base) {
10 |
11 | private var bytesRead = 0L
12 | private var lastUpdate = 0L
13 |
14 | private fun emitProgress() {
15 | val cur = System.currentTimeMillis()
16 | if (cur - lastUpdate > 1000) {
17 | lastUpdate = cur
18 | progressEmitter(bytesRead)
19 | }
20 | }
21 |
22 | override fun read(): Int {
23 | val b = read()
24 | if (b >= 0) {
25 | bytesRead++
26 | emitProgress()
27 | }
28 | return b
29 | }
30 |
31 | override fun read(b: ByteArray): Int {
32 | return read(b, 0, b.size)
33 | }
34 |
35 | override fun read(b: ByteArray, off: Int, len: Int): Int {
36 | val sz = super.read(b, off, len)
37 | if (sz > 0) {
38 | bytesRead += sz
39 | emitProgress()
40 | }
41 | return sz
42 | }
43 |
44 | override fun close() {
45 | super.close()
46 | progressEmitter(bytesRead)
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/core/src/main/java/com/topjohnwu/magisk/core/utils/RequestInstall.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.core.utils
2 |
3 | import android.annotation.TargetApi
4 | import android.app.Activity
5 | import android.content.Context
6 | import android.content.Intent
7 | import android.net.Uri
8 | import android.os.Build
9 | import android.provider.Settings
10 | import androidx.activity.result.contract.ActivityResultContract
11 |
12 | class RequestInstall : ActivityResultContract() {
13 |
14 | @TargetApi(26)
15 | override fun createIntent(context: Context, input: Unit): Intent {
16 | // This will only be called on API 26+
17 | return Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES)
18 | .setData(Uri.parse("package:${context.packageName}"))
19 | }
20 |
21 | override fun parseResult(resultCode: Int, intent: Intent?) =
22 | resultCode == Activity.RESULT_OK
23 |
24 | override fun getSynchronousResult(
25 | context: Context,
26 | input: Unit
27 | ): SynchronousResult? {
28 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
29 | return SynchronousResult(true)
30 | if (context.packageManager.canRequestPackageInstalls())
31 | return SynchronousResult(true)
32 | return null
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/values/themes_override.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
14 |
18 |
19 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/dialog/LocalModuleInstallDialog.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.dialog
2 |
3 | import android.net.Uri
4 | import com.topjohnwu.magisk.MainDirections
5 | import com.topjohnwu.magisk.core.Const
6 | import com.topjohnwu.magisk.core.R
7 | import com.topjohnwu.magisk.events.DialogBuilder
8 | import com.topjohnwu.magisk.ui.module.ModuleViewModel
9 | import com.topjohnwu.magisk.view.MagiskDialog
10 |
11 | class LocalModuleInstallDialog(
12 | private val viewModel: ModuleViewModel,
13 | private val uri: Uri,
14 | private val displayName: String
15 | ) : DialogBuilder {
16 | override fun build(dialog: MagiskDialog) {
17 | dialog.apply {
18 | setTitle(R.string.confirm_install_title)
19 | setMessage(context.getString(R.string.confirm_install, displayName))
20 | setButton(MagiskDialog.ButtonType.POSITIVE) {
21 | text = android.R.string.ok
22 | onClick {
23 | viewModel.apply {
24 | MainDirections.actionFlashFragment(Const.Value.FLASH_ZIP, uri).navigate()
25 | }
26 | }
27 | }
28 | setButton(MagiskDialog.ButtonType.NEGATIVE) {
29 | text = android.R.string.cancel
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/test/src/main/java/com/topjohnwu/magisk/test/Runners.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.test
2 |
3 | import android.os.Bundle
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import androidx.test.runner.AndroidJUnitRunner
6 |
7 | open class TestRunner : AndroidJUnitRunner() {
8 | override fun onCreate(arguments: Bundle) {
9 | // Support short-hand ".ClassName"
10 | arguments.getString("class")?.let {
11 | val classArg = it.split(",").joinToString(separator = ",") { clz ->
12 | if (clz.startsWith(".")) {
13 | "com.topjohnwu.magisk.test$clz"
14 | } else {
15 | clz
16 | }
17 | }
18 | arguments.putString("class", classArg)
19 | }
20 | super.onCreate(arguments)
21 | }
22 | }
23 |
24 | class AppTestRunner : TestRunner() {
25 | override fun onCreate(arguments: Bundle) {
26 | // Force using the target context's classloader to run tests
27 | arguments.putString("classLoader", TestClassLoader::class.java.name)
28 | super.onCreate(arguments)
29 | }
30 | }
31 |
32 | private val targetClassLoader inline get() =
33 | InstrumentationRegistry.getInstrumentation().targetContext.classLoader
34 |
35 | class TestClassLoader : ClassLoader(targetClassLoader)
36 |
--------------------------------------------------------------------------------
/app/apk/src/main/res/layout/item_icon_link.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
11 |
12 |
15 |
16 |
17 |
18 |
28 |
29 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt:
--------------------------------------------------------------------------------
1 | package com.topjohnwu.magisk.ui.superuser
2 |
3 | import android.os.Bundle
4 | import android.view.View
5 | import com.topjohnwu.magisk.R
6 | import com.topjohnwu.magisk.arch.BaseFragment
7 | import com.topjohnwu.magisk.arch.viewModel
8 | import com.topjohnwu.magisk.databinding.FragmentSuperuserMd2Binding
9 | import rikka.recyclerview.addEdgeSpacing
10 | import rikka.recyclerview.addItemSpacing
11 | import rikka.recyclerview.fixEdgeEffect
12 | import com.topjohnwu.magisk.core.R as CoreR
13 |
14 | class SuperuserFragment : BaseFragment() {
15 |
16 | override val layoutRes = R.layout.fragment_superuser_md2
17 | override val viewModel by viewModel()
18 |
19 | override fun onStart() {
20 | super.onStart()
21 | activity?.title = resources.getString(CoreR.string.superuser)
22 | }
23 |
24 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
25 | super.onViewCreated(view, savedInstanceState)
26 |
27 | binding.superuserList.apply {
28 | addEdgeSpacing(top = R.dimen.l_50, bottom = R.dimen.l1)
29 | addItemSpacing(R.dimen.l1, R.dimen.l_50, R.dimen.l1)
30 | fixEdgeEffect()
31 | }
32 | }
33 |
34 | override fun onPreBind(binding: FragmentSuperuserMd2Binding) {}
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/app/core/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Parcelable
2 | -keepclassmembers class * implements android.os.Parcelable {
3 | public static final ** CREATOR;
4 | }
5 |
6 | # Kotlin
7 | -assumenosideeffects class kotlin.jvm.internal.Intrinsics {
8 | public static void check*(...);
9 | public static void throw*(...);
10 | }
11 | -assumenosideeffects class java.util.Objects {
12 | public static ** requireNonNull(...);
13 | }
14 | -assumenosideeffects public class kotlin.coroutines.jvm.internal.DebugMetadataKt {
15 | private static ** getDebugMetadataAnnotation(...) return null;
16 | }
17 |
18 | # Stub
19 | -keep class com.topjohnwu.magisk.core.App { (java.lang.Object); }
20 | -keepclassmembers class androidx.appcompat.app.AppCompatDelegateImpl {
21 | boolean mActivityHandlesConfigFlagsChecked;
22 | int mActivityHandlesConfigFlags;
23 | }
24 |
25 | # Strip Timber verbose and debug logging
26 | -assumenosideeffects class timber.log.Timber$Tree {
27 | public void v(**);
28 | public void d(**);
29 | }
30 |
31 | # With R8 full mode generic signatures are stripped for classes that are not
32 | # kept. Suspend functions are wrapped in continuations where the type argument
33 | # is used.
34 | -keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
35 |
36 | # Excessive obfuscation
37 | -flattenpackagehierarchy
38 | -allowaccessmodification
39 |
40 | -dontwarn org.junit.**
41 | -dontwarn org.apache.**
42 |
--------------------------------------------------------------------------------
/native/src/Android-rs.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | ###########################
4 | # Rust compilation outputs
5 | ###########################
6 |
7 | include $(CLEAR_VARS)
8 | LOCAL_MODULE := magisk-rs
9 | LOCAL_EXPORT_C_INCLUDES := src/core/include
10 | LOCAL_LIB = ../out/$(TARGET_ARCH_ABI)/libmagisk-rs.a
11 | ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_LIB)))
12 | LOCAL_SRC_FILES := $(LOCAL_LIB)
13 | include $(PREBUILT_STATIC_LIBRARY)
14 | else
15 | include $(BUILD_STATIC_LIBRARY)
16 | endif
17 |
18 | include $(CLEAR_VARS)
19 | LOCAL_MODULE := boot-rs
20 | LOCAL_LIB = ../out/$(TARGET_ARCH_ABI)/libmagiskboot-rs.a
21 | ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_LIB)))
22 | LOCAL_SRC_FILES := $(LOCAL_LIB)
23 | include $(PREBUILT_STATIC_LIBRARY)
24 | else
25 | include $(BUILD_STATIC_LIBRARY)
26 | endif
27 |
28 | include $(CLEAR_VARS)
29 | LOCAL_MODULE := init-rs
30 | LOCAL_LIB = ../out/$(TARGET_ARCH_ABI)/libmagiskinit-rs.a
31 | ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_LIB)))
32 | LOCAL_SRC_FILES := $(LOCAL_LIB)
33 | include $(PREBUILT_STATIC_LIBRARY)
34 | else
35 | include $(BUILD_STATIC_LIBRARY)
36 | endif
37 |
38 | include $(CLEAR_VARS)
39 | LOCAL_MODULE := policy-rs
40 | LOCAL_LIB = ../out/$(TARGET_ARCH_ABI)/libmagiskpolicy-rs.a
41 | ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_LIB)))
42 | LOCAL_SRC_FILES := $(LOCAL_LIB)
43 | include $(PREBUILT_STATIC_LIBRARY)
44 | else
45 | include $(BUILD_STATIC_LIBRARY)
46 | endif
47 |
--------------------------------------------------------------------------------
/native/src/core/include/resetprop.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include