Commit Graph

67 Commits

Author SHA1 Message Date
topjohnwu
b28326198c Use crates for cpio code 2023-09-22 01:39:21 -07:00
topjohnwu
b750c89c87 Address clippy warnings 2023-09-19 01:11:50 -07:00
LoveSy
8d7c7c3dfb Refactor dtb in rust 2023-09-19 00:41:42 -07:00
LoveSy
0243610c09 No trailing zeros if the signed boot img is larger 2023-09-12 18:09:20 -07:00
topjohnwu
89aee6ffa7 Add more to the Utf8CStr family
Better C strings with path operations
2023-09-12 17:35:01 -07:00
topjohnwu
4eaf701cb7 Address clippy warnings 2023-09-06 21:45:12 -07:00
LoveSy
8d81bd0e33 resetprop: replace nanopb with quick-protobuf for persist 2023-09-05 22:20:57 -07:00
topjohnwu
41226c12b8 Update to ONDK r25.7 2023-08-15 17:10:20 -07:00
topjohnwu
b5b14ce343 Use cxx_name instead of rust_name 2023-08-10 21:22:53 -07:00
topjohnwu
f924ffcbf3 Merge files 2023-08-08 00:57:58 -07:00
topjohnwu
7ad77a14ae Remove unused line 2023-07-17 21:43:09 -07:00
topjohnwu
af65d07456 Support AVB1.0 signing and verification in magiskboot 2023-07-17 18:57:50 -07:00
topjohnwu
c97ab690b6 Segment memory mapped boot image region 2023-07-13 21:01:49 -07:00
LoveSy
64c82e1f2c Refine cpio argh
we can use argh to handle `--help` now
2023-07-06 15:07:06 -07:00
LoveSy
af2207433d Fix error logging
ok_or will unconditionally creates a LoggedResult, which prints
an error even it successes. Use ok_or_else which lazily creates
a LoggedResult only if it fails.
2023-07-06 11:01:57 -07:00
topjohnwu
d778b0b0a7 Custom help message when using argh
Help messages generated from argh is nearly useless and very hard to
customize. Fork argh and disable all code for generating help messages.

Use a closure to print the help message when handling EarlyExit.
2023-07-05 17:05:39 -07:00
topjohnwu
5ee6daf126 Handle cpio commands properly 2023-07-03 21:57:28 -07:00
topjohnwu
ee943afbc9 Cleanup SHA hash implementation 2023-06-30 15:50:52 -07:00
LoveSy
1f7c3e9f14 Use rust to calculate sha 2023-06-30 14:06:02 -07:00
topjohnwu
4ee4cbada6 Standardize logging and error handling
- Introduce new types: LoggedResult and LoggedError
- Introduce new extension methods to log and add additional msgs
- Never exit when logging error messages in Rust (all errors should be
  handled by using Result and Rust's error propagation)
- Remove all usages of anyhow as it doesn't fit Magisk's use cases
2023-06-29 17:14:53 -07:00
topjohnwu
dc26ad7125 Address clippy warnings 2023-06-22 02:36:31 -07:00
LoveSy
24b1c607f3 Replace clap with argh 2023-06-22 02:36:31 -07:00
topjohnwu
732a161b67 Minor cleanup 2023-06-22 02:23:27 -07:00
topjohnwu
9c7cf340a1 Move pattern matching to Rust 2023-06-21 16:47:20 -07:00
topjohnwu
399b9e5eba Move hexpatch to Rust 2023-06-20 18:17:26 -07:00
topjohnwu
a6b1149b9f Minor cleanup 2023-06-20 14:36:07 -07:00
LoveSy
51e985ae7f Use quick-protobuf 2023-06-20 14:36:07 -07:00
LoveSy
c874391be4 Box CpioEntry 2023-06-15 04:09:17 -07:00
LoveSy
7e8e013832 Fix two typo 2023-06-15 04:09:17 -07:00
topjohnwu
cb3ab63815 Replace all CStr usage to Utf8CStr 2023-06-12 13:57:15 -07:00
LoveSy
d15017b777 Add arg requirement for cpio extract 2023-06-12 02:40:50 -07:00
topjohnwu
23c1f0111b Improve Rust implementation
- Move mmap_file implementation into Rust
- Introduce Utf8CStr as the better c-string type to use
2023-06-12 02:40:50 -07:00
LoveSy
866386e21f Use to_string instead of to_owned 2023-06-12 02:40:50 -07:00
LoveSy
bf10496fa9 Add log for restore 2023-06-12 02:40:50 -07:00
LoveSy
607e6547a7 No check rm -r 2023-06-12 02:40:50 -07:00
topjohnwu
6b21091fe2 Fix compile errors and cleanup 2023-06-12 02:40:50 -07:00
topjohnwu
e58f98e844 Update cargo files 2023-06-12 02:40:50 -07:00
LoveSy
b8cb9cd84d Refactor magiskboot cpio 2023-06-12 02:40:50 -07:00
topjohnwu
5e2ef1b7f4 Better bytes support in C++ 2023-06-06 17:11:42 -07:00
topjohnwu
305e8b3d14 Improve bootimg const correctness 2023-06-03 05:10:22 -07:00
topjohnwu
2a654e5d7f Improve byte_data const correctness 2023-06-03 03:16:03 -07:00
topjohnwu
57afae3425 Cleanup cpio codebase 2023-06-03 00:31:20 -07:00
topjohnwu
feb44f875e Migrate PREINITDEVICE in recovery mode
Close #6917
2023-06-02 16:49:04 -07:00
topjohnwu
d77a368176 Move dependency version into workspace 2023-05-28 17:30:33 -07:00
topjohnwu
5b8b48ccc1 Properly support streamable input 2023-05-26 14:07:11 -07:00
topjohnwu
659b9c6fee Support extracting any partition from payload.bin 2023-05-26 13:36:47 -07:00
LoveSy
ec31cab5a7 Add zip and payload.bin support to Magisk app 2023-05-26 13:36:47 -07:00
topjohnwu
18d0cedbe2 Parse rule files with Rust 2023-05-24 19:11:56 -07:00
topjohnwu
8e8f01f8b5 Move project common code into include 2023-05-23 21:30:30 -07:00
topjohnwu
f5aaff2b1e Cleanup filter_out_stream implementation 2023-05-20 01:28:10 -07:00