Commit Graph

29 Commits

Author SHA1 Message Date
topjohnwu
dda8cc85c9 Use bytemuck 2023-09-14 13:10:09 -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
4fff2aa7d8 Fix proto read and write 2023-09-06 20:45:59 -07:00
topjohnwu
35b3c8ba5c Cleanup persist props code 2023-09-06 15:52:14 -07:00
LoveSy
8d81bd0e33 resetprop: replace nanopb with quick-protobuf for persist 2023-09-05 22:20:57 -07:00
LoveSy
64c82e1f2c Refine cpio argh
we can use argh to handle `--help` now
2023-07-06 15:07:06 -07:00
topjohnwu
e8e8afa6c2 Properly handle visibility 2023-07-06 11:12:27 -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
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
279f955a84 Minor changes 2023-06-23 01:50:33 -07:00
topjohnwu
399b9e5eba Move hexpatch to Rust 2023-06-20 18:17:26 -07:00
LoveSy
a9c89cbbbb Read certificate in Rust
Co-authored-by: topjohnwu <topjohnwu@gmail.com>
2023-06-16 01:49:44 -07:00
topjohnwu
037f46f7f0 Fix copy_cstr 2023-06-15 04:00:32 -07:00
topjohnwu
cb3ab63815 Replace all CStr usage to Utf8CStr 2023-06-12 13:57:15 -07:00
LoveSy
a9387e63e1 Fix Utf8CStr::as_ref() -> OsStr 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
topjohnwu
40f25f4d56 Introduce directory traversal 2023-06-09 02:00:37 -07:00
topjohnwu
9ea9f01933 Resolve clippy errors and warnings 2023-05-31 01:08:33 -07:00
topjohnwu
659b9c6fee Support extracting any partition from payload.bin 2023-05-26 13:36:47 -07:00
topjohnwu
533aeadd38 Update cstr macro 2023-05-25 01:03:04 -07:00
topjohnwu
7518092ad2 Implement logging purely in Rust 2023-05-09 18:54:38 -07:00
topjohnwu
b136aba1e2 Implement magiskinit logging in Rust 2023-05-02 16:49:43 -07:00
topjohnwu
3517e6d752 Handle nullptr char* in Rust 2023-01-20 03:45:16 +08:00
topjohnwu
af99c1b843 Don't crash when nullptr paired with len = 0 2022-09-15 16:56:22 -07:00
topjohnwu
c6646efe68 Move all xwrap to Rust 2022-09-15 01:17:05 -07:00
topjohnwu
4d9b7e7114 More Rust 2022-08-15 11:53:51 -07:00
topjohnwu
4c0f72f68f Move part of libbase to Rust 2022-08-08 22:53:37 -07:00
topjohnwu
b9e89a1a2d Restructure the native module
Consolidate all code into the src folder
2022-07-23 13:51:56 -07:00