use std::sync::LazyLock;
use tosho_macros::comptime_b64;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Constants {
pub(crate) image_ua: String,
pub(crate) api_ua: String,
pub(crate) os_ver: &'static str,
pub(crate) app_ver: &'static str,
pub(crate) os_name: &'static str,
}
pub static ANDROID_CONSTANTS: LazyLock<Constants> = LazyLock::new(|| {
Constants {
image_ua: "Dalvik/2.1.0 (Linux; U; Android 14; SM-A156E Build/UP1A.231005.007)".to_string(),
api_ua: "okhttp/4.9.0".to_string(),
os_ver: "34", app_ver: "1024",
os_name: "android",
}
});
pub const BASE_API: &str = comptime_b64!("aHR0cHM6Ly9qdW1wZy1hcGkudG9reW8tY2RuLmNvbS9hcGk=");
pub const BASE_IMG: &str = comptime_b64!("aHR0cHM6Ly9qdW1wZy1hc3NldHMudG9reW8tY2RuLmNvbQ==");
pub const BASE_HOST: &str = comptime_b64!("bWFuZ2FwbHVzLnNodWVpc2hhLmNvLmpw");
pub const API_HOST: &str = comptime_b64!("anVtcGctYXBpLnRva3lvLWNkbi5jb20=");
pub const IMAGE_HOST: &str = comptime_b64!("anVtcGctYXNzZXRzLnRva3lvLWNkbi5jb20=");
pub fn get_constants(device_type: u8) -> &'static Constants {
match device_type {
1 => &ANDROID_CONSTANTS,
_ => panic!("Invalid device type"),
}
}