Skip to content

Commit

Permalink
trying to avoid raw url in pe binary sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
shevernitskiy committed Mar 9, 2024
1 parent 70ff94a commit 4a9bc1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ pub const ORIGINAL_FONT: &'static [u8; 1568] = include_bytes!("../assets/origina

pub const PATH_CACHE_FILE: &'static str = "./dfint-installer.cache";

pub const URL_HOOK_MANIFEST: &'static str =
"https://raw.githubusercontent.com/dfint/update-data/main/metadata/hook.json";
pub const URL_DICT_MANIFEST: &'static str =
"https://raw.githubusercontent.com/dfint/update-data/main/metadata/dict.json";
#[static_init::dynamic]
pub static URL_HOOK_MANIFEST: String = format!(
"https://{}.{}.com/dfint/update-data/main/metadata/hook.json",
"raw", "githubusercontent"
);

#[static_init::dynamic]
pub static URL_DICT_MANIFEST: String = format!(
"https://{}.{}.com/dfint/update-data/main/metadata/dict.json",
"raw", "githubusercontent"
);

pub const URL_BUGS: &'static str = "https://github.com/dfint/installer/issues";

pub const PATH_DATA: &'static str = "dfint-data";
Expand Down
4 changes: 2 additions & 2 deletions src/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl App {
self.hook_checksum = self.local_hook_checksum().unwrap_or(0);

spawn!({
match fetch_manifest::<HookManifest>(URL_HOOK_MANIFEST) {
match fetch_manifest::<HookManifest>(&URL_HOOK_MANIFEST) {
Ok(manifests) => {
write!(vec_hook_manifests, manifests.clone());
if let Some(manifest) = get_manifest_by_df(df_checksum, manifests) {
Expand All @@ -96,7 +96,7 @@ impl App {
self.dict_checksum = self.local_dict_checksum().unwrap_or(0);

spawn!({
match fetch_manifest::<DictManifest>(URL_DICT_MANIFEST) {
match fetch_manifest::<DictManifest>(&URL_DICT_MANIFEST) {
Ok(manifests) => {
write!(vec_dict_manifests, manifests.clone());
if let Some(manifest) = get_manifest_by_language(selected_language, manifests) {
Expand Down

0 comments on commit 4a9bc1c

Please sign in to comment.