Commit Graph
2174 Commits
Author SHA1 Message Date
lsx 0675a18a3a init: check charger mode before force_normal_boot
b55f597c ("Skip loading magisk in charger mode") aborts when
androidboot.mode=charger, but the check sits after the force_normal_boot
branch. Devices that set androidboot.force_normal_boot=1 during off-mode
charging (e.g. some Motorola models) take force_normal_boot -> first_stage()
and never reach the charger check, so Magisk still loads in charger mode and
bumps the never-reset bootloop counter until safe mode trips.

Move the charger check ahead of skip_initramfs/force_normal_boot so charger
boots abort regardless, matching AOSP treating charger mode first.

Fixes #9967.
2026-08-18 18:38:55 +00:00
topjohnwu 8cc4d3a5c1 docs: update AGENTS.md in subdirectories
Update subproject AGENTS.md guidelines to always include the top-level
AGENTS.md.

Assisted-by: Gemini 3.7 Flash
2026-08-18 17:56:10 +00:00
topjohnwu 3bdffe695d Generate shorty in comments and reorder jni_hooks 2026-08-12 23:49:37 +00:00
Wang Han 65aa82516f Update jni hook signatures for A17 QPR2 2026-08-11 20:14:03 -07:00
Bela Schaum 72dfc7b9a8 Update condition to check for newline and comma 2026-08-05 11:17:01 -07:00
kousuandClaude Sonnet 4.6 d9a9b02c27 Update AVB hash header image_size to match unpacked original_image_size.
Fixes https://github.com/topjohnwu/Magisk/issues/8389

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-05 10:32:24 -07:00
Wang Han 2c98b6ccf2 Update resetprop to support --compact 2026-08-04 12:07:38 -07:00
topjohnwu 0b0ee5611e Update libcxx 2026-08-03 19:22:52 -07:00
topjohnwu fd0cb66b6b Cargo fmt 2026-07-31 22:57:41 -07:00
topjohnwu a581038608 Update cargo dependencies 2026-07-31 22:57:41 -07:00
topjohnwu bffc9108bc Address new clippy warnings 2026-07-31 22:57:41 -07:00
topjohnwu d04635478a Fix clippy warnings across native codebase
Address clippy warnings including collapsible match statements in
bootstages, daemon, su daemon, and db modules, as well as iterator
loops in files.rs.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 05099cce89 sepolicy: use pure token-based xperm parsing
Update extract_token to only split hyphens when preceding a valid
hex xperm. Revert parse_xperm and parse_xperms to pure token-based
AST parsing without inspecting ID strings.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 9d4befe06d sepolicy: add unit tests for statement parsing
Add unit tests covering all PolicyStatement variants, brace set
expansion, xperm ranges/complements, spacing corner cases, and error
cases.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 896b78cdd5 sepolicy: parse statements into PolicyStatement enum
Parse tokens into intermediate PolicyStatement enums with meaningful
field names before executing them on SePolicy.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu dfd9fe00d3 docs: update native AGENTS.md guidelines
Document native build pipeline, FFI mechanics, and Rust code
conventions in native/AGENTS.md.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu cfd195b514 docs: update AGENTS.md guidelines for AI models
- Expand top-level AGENTS.md with environment execution rules and AI guidelines.
- Add app/AGENTS.md for app subproject architecture and maintenance mode rules.
- Add native/AGENTS.md for native C/C++/Rust build target requirements.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
Wang Han 1b9f69b4b8 Update zygisk sepolicy for A17 QPR1 Beta 4
Mainline kernel starts to use dedicated memfd_file type for memfd,
which makes zygote cannot open memfd created by magiskd.
2026-07-27 18:49:19 -07:00
Wang Han 14ea5cfb4a Fix sepolicy parsing for hyphenated identifiers 2026-05-05 02:15:16 +08:00
topjohnwu 9d0b5298af Update to ONDK r30.0 2026-04-20 01:36:36 -07:00
topjohnwu 2f4bb0149e Update cargo dependencies 2026-04-08 05:29:57 +00:00
topjohnwu 74ead75ce8 Update cargo dependencies 2026-02-22 14:39:46 -08:00
Wang Han ee25db0627 Add jni hooks signature for nubia 2026-02-22 13:20:08 -08:00
topjohnwu 9ee6a6b3d7 Update to ONDK r29.5 2026-02-06 16:32:25 -08:00
Wang Han e872fafd8b Update getModuleDir() API doc 2026-02-05 13:12:34 -08:00
topjohnwu dd3798905f Update libsepol to upstream Android 16 QPR2 2026-02-05 12:51:21 -08:00
Ephemera42 0d39b10889 Optimize preinit finding and add klogdump partition
* Use major number check to filter out device-mapper devices while preserving virtio-blk compatibility.
* Introduce `klogdump` partition support for Smartisan devices as a valid preinit target.
2026-02-04 21:10:25 -08:00
vvb2060 628b4d4715 Allow reacquiring capabilities if not explicitly cleared
- Old behavior: Switching to a non-zero UID was implicitly interpreted as a request to drop capabilities, thereby preventing subsequent reacquisition  via `su`.
- New behavior: Switching to a non-zero UID now requires the `--drop-cap` argument to explicitly prevent the reacquisition of capabilities.
2026-02-04 11:35:24 -08:00
LoveSy be5246aef5 Reorder positional arguments in Backup and Remove 2026-02-04 11:35:12 -08:00
LoveSy b55f597ccf Skip loading magisk in charger mode 2026-02-03 15:55:53 -08:00
Wang Han e729eec636 Remove unnecessary file system permissions
Removed permissions for mounting loop devices, mirrors, and tmpfs.
2026-02-02 11:15:33 -08:00
LoveSy 5f13a8f8f7 support sony's init.real 2026-01-31 13:54:34 -08:00
canyie ac8d4200e1 Add nativeSpecializeAppProcess signature for XR devices running 14
Build fingerprint: google/gms_sdk_xr64_x86_64/emulator64_x86_64:14/UP1A.231005.007.A1/13953962:userdebug/test-keys
2026-01-31 13:51:41 -08:00
Wang Han e590ffbdcb Fix formatting and update comments in bootimg.cpp 2026-01-31 13:50:36 -08:00
Wang Han 97138f1e91 magiskboot: Fix tail offset calculation 2026-01-31 13:50:36 -08:00
LoveSy bea50fafba Fix magiskboot cpio ls -r 2026-01-31 13:50:13 -08:00
Pzqqt 0919db6b11 magiskboot: Avoid implicit type conversion
Fix #9607
2026-01-19 23:33:00 +08:00
topjohnwu 01cb75eaef Code cleanup 2025-12-13 22:12:30 -08:00
topjohnwu 33eaa7c5eb Update cargo dependencies 2025-12-12 11:42:45 -08:00
topjohnwu 8734423cb0 Update to ONDK r29.4 2025-12-12 11:42:45 -08:00
topjohnwu ff4ca74cfe Ban all unwrap usage in codebase 2025-12-08 23:31:04 -08:00
topjohnwu 200665c48a Make jni_hooks.hpp a normal C++ header
[skip ci]
2025-12-07 02:44:19 -08:00
topjohnwu dd42aa99ea Refactor gen_jni_hooks.py
[skip ci]
2025-12-07 02:25:50 -08:00
Wang Han 0936cdb192 Update nativeForkAndSpecialize signature for A16 QPR2
https://android.googlesource.com/platform/frameworks/base.git/+/67a4b1b2fee385f798d75ad02d016b80fc79f075
2025-12-07 00:18:50 -08:00
topjohnwu a510554b21 Disable Zygisk upon incomplete JNI hook
Do not enable Zygisk unless ALL replacements are hooked properly.
This allow Zygisk tests to fail when new signature is introduced.
2025-12-07 00:18:50 -08:00
南宫雪珊 b5138a4af0 Update unpack boot image help message 2025-12-05 11:14:45 -08:00
topjohnwu 64752f38e8 Do not unwrap when getting decoder and encoder
Or else things will crash mysteriously when unexpected input occurs
2025-12-05 03:40:18 -08:00
topjohnwu 9ac4b5ce7d Add proper lzma format detection 2025-12-05 03:40:18 -08:00
南宫雪珊 9a776c22d9 Revert "Use rootfs for magisktmp if possible" 2025-12-01 11:45:34 -08:00
topjohnwu d9dc459bf4 Update system_properties
Fix #9408
2025-12-01 00:25:39 -08:00