fix custom emoji & call recorder quality,add order feature for chat exports

This commit is contained in:
particle-box
2026-02-07 00:44:00 +05:30
parent 3744c5b422
commit a21b938be0
9 changed files with 254 additions and 62 deletions

View File

@@ -1,4 +1,4 @@
use std::{ffi::CStr, fs};
use std::{ffi::{CStr, CString}, fs};
use nix::libc::{self, c_uint};
@@ -12,7 +12,18 @@ def_hook!(
if pathname == "/system/fonts/NotoColorEmoji.ttf" {
if let Some(font_path) = config::native_config().custom_emoji_font_path {
if fs::metadata(&font_path).is_ok() {
return libc::openat(libc::AT_FDCWD, font_path.as_ptr() as *const u8, flags, mode);
match CString::new(font_path.clone()) {
Ok(c_font_path) => {
let fd = libc::openat(libc::AT_FDCWD, c_font_path.as_ptr() as *const u8, flags, mode);
if fd >= 0 {
return fd;
}
warn!("failed to open custom emoji font path (fd={}): {}", fd, font_path);
}
Err(_) => {
warn!("custom emoji font path contains null byte, using fallback system font");
}
}
} else {
warn!("custom emoji font path does not exist: {}", font_path);
}
@@ -31,4 +42,4 @@ pub fn init() {
}
dobby_hook_sym!("libc.so", "open", open_hook);
}
}