mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Fix unshell_obfuscate error. remove default encryption key error when there isn't any encryption
This commit is contained in:
@@ -3,17 +3,20 @@ use quote::quote;
|
||||
use syn::{ItemFn, LitStr, parse_macro_input};
|
||||
use unshell_crypt::{BACKUP_ENV_KEY, ENV_KEY_NAME, STATIC_IV, aes::encrypt_aes_lines, fill};
|
||||
|
||||
#[cfg(feature = "obfuscate")]
|
||||
#[static_init::dynamic]
|
||||
static KEY: String = {
|
||||
std::env::var(ENV_KEY_NAME).unwrap_or({
|
||||
// Diagnostic::new(proc_macro::Level::Warning, "Using default encryption key!").emit();
|
||||
|
||||
println!("Using default encryption key!");
|
||||
|
||||
BACKUP_ENV_KEY.to_owned()
|
||||
})
|
||||
};
|
||||
|
||||
// If there isn't any encryption
|
||||
#[cfg(not(feature = "obfuscate"))]
|
||||
#[static_init::dynamic]
|
||||
static KEY: String = "".to_string();
|
||||
|
||||
pub fn obfuscated_symbol(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
// Parse the input function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user