Commit Graph

156 Commits

Author SHA1 Message Date
topjohnwu ff4ca74cfe Ban all unwrap usage in codebase 2025-12-08 23:31:04 -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
topjohnwu 3a60ef2039 Update to ONDK r29.3 2025-11-21 13:28:46 -08:00
Wang Han c8d51b38ba Enhance fdt_header validation for empty dtb 2025-11-02 02:42:48 -08:00
topjohnwu 536e50c6e0 Support optional trailing positional arguments 2025-10-19 17:15:30 -07:00
topjohnwu 57d9fc6099 Support short only options and switches 2025-10-19 17:15:30 -07:00
topjohnwu b72ba6759e Vendor argh sources
Further customization will come in future commits
2025-10-19 17:15:30 -07:00
topjohnwu 5bcb55b7fc Format Rust imports with rustfmt 2025-10-19 17:15:30 -07:00
topjohnwu 0dc8231585 Make all dependencies workspace = true 2025-10-19 17:15:30 -07:00
topjohnwu cd8820f563 Refactor code for more readability 2025-09-29 01:41:55 -07:00
topjohnwu 742913ebcb Support installing Magisk on vendor_boot
Close #9238, fix #8835
2025-09-28 01:10:11 -07:00
topjohnwu ed206c6480 Upgrade cargo dependencies 2025-09-26 23:37:45 -07:00
topjohnwu 312bfe1bab Do not leak base::ffi to external crates 2025-09-11 01:17:34 -07:00
topjohnwu ef4e230258 Use nix for libc functions 2025-09-08 23:59:29 -07:00
topjohnwu a75c335261 Update cargo dependencies 2025-09-08 02:24:01 -07:00
topjohnwu bc89c60977 Run cargo fmt 2025-09-02 22:06:08 -07:00
topjohnwu 653730d75e Make cxx binding generate less code 2025-08-29 01:44:06 -07:00
topjohnwu 484d53ef7e Update to ONDK r29.2 2025-08-28 16:15:59 -07:00
topjohnwu 2e4fa6864c Make Utf8CStr a first class citizen in C++ codebase
Utf8CStr is in many cases a better string view class than
std::string_view, because it provides "view" access to a string buffer
that is guaranteed to be null terminated. It also has the additional
benefit of being UTF-8 verified and can seemlessly cross FFI boundaries.

We would want to start use more Utf8CStr in our existing C++ codebase.
2025-08-27 22:48:48 -07:00
topjohnwu 3599dcedfb Make argh directly parse into Utf8CString 2025-08-27 01:26:41 -07:00
topjohnwu b861671391 Cleanup libbase 2025-08-25 01:31:47 -07:00
LoveSy 78f5cd55c7 Use lzma-rust2 for xz and lzma compression and decompression 2025-08-24 00:23:55 -07:00
topjohnwu 9787a69528 Make all decoders Read instead of Write
Most libraries only implement Read for decoders
2025-08-24 00:23:55 -07:00
topjohnwu 87b8fe374d Fix magiskboot cli parsing 2025-08-23 20:31:15 -07:00
topjohnwu 7b706bb0cb Cleanup and fix compress/decompress command 2025-08-23 20:31:15 -07:00
LoveSy 5cbaf2ae11 Use super let to simplify code 2025-08-22 12:05:44 -07:00
topjohnwu 8ebc6207b4 Merge headers 2025-08-22 12:03:47 -07:00
topjohnwu 7848ee616b Cleanup magiskboot main function 2025-08-22 12:03:47 -07:00
topjohnwu fd193c3cae Simplify ResultExt implementation
Also introduce OptionExt
2025-08-22 12:03:47 -07:00
topjohnwu 36d33c7a85 Make log_err directly return LoggedResult 2025-08-22 12:03:47 -07:00
topjohnwu 2c39d0234d Fix compression format detection 2025-08-21 12:21:22 -07:00
topjohnwu c313812129 Simplify magiskboot FFI 2025-08-21 12:21:22 -07:00
topjohnwu af51880a81 Introduce CmdArgs for argument parsing in Rust 2025-08-21 12:21:22 -07:00
LoveSy db8d832707 Move magiskboot cli to argh 2025-08-20 21:40:34 -07:00
5ec1cff a54bdb54e4 Skip avb 1,0 verify if tail contains avb 2.0 header
This way, magiskboot will not print "unexpected ASN.1 DER tag: expected SEQUENCE, got APPLICATION [1] (primitive)".
2025-07-21 00:51:14 -07:00
topjohnwu 466e4bd4e1 Update cargo dependencies 2025-07-11 02:04:33 -07:00
topjohnwu 37a9724a54 Apply clippy fix 2025-07-02 21:20:14 -07:00
topjohnwu 1460317ebd Cleanup C++ headers 2025-06-16 02:25:38 -07:00
topjohnwu 898580bf90 Update dependencies 2025-06-02 19:51:12 -07:00
topjohnwu 78d1200608 Migrate all compression code to Rust 2025-05-20 03:26:00 -07:00
topjohnwu 4ad26d3dfb Better path methods 2025-04-28 17:22:14 -07:00
topjohnwu 3327fc668e Remove FsPath and FsPathMnt trait
Directly use Utf8CStr
2025-04-28 17:22:14 -07:00
topjohnwu e02b5f7868 Rename cstr_buf to cstr::buf 2025-04-22 03:21:00 -07:00
topjohnwu f3fef7bfe4 Make FsPath a trait 2025-04-22 03:21:00 -07:00
topjohnwu cb08504fe5 Update cargo dependencies 2025-04-11 14:48:16 -07:00
topjohnwu 9c7d359093 Optimize and format imports
[skip ci]
2025-04-08 09:57:09 -07:00
topjohnwu c09a792958 Reorganize magiskinit code 2025-03-24 17:26:03 -07:00
LoveSy 12a0870bc9 Replace bzip2 with bz2-rs 2025-03-08 14:37:17 -08:00