From d003827f23e590565c2272f3142c8cc1babc4e52 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Wed, 10 Aug 2022 22:31:24 +0800 Subject: [PATCH] update: remove legacy backend --- backend/kms-check.php | 60 ------------------- backend/kms-cli.php | 52 ---------------- backend/kms-help.php | 47 --------------- backend/kms-keys.db | Bin 20480 -> 0 bytes backend/kms-keys.php | 43 -------------- backend/kms-office.php | 116 ------------------------------------ backend/kms-web.php | 34 ----------- backend/route.php | 131 ----------------------------------------- 8 files changed, 483 deletions(-) delete mode 100644 backend/kms-check.php delete mode 100644 backend/kms-cli.php delete mode 100644 backend/kms-help.php delete mode 100644 backend/kms-keys.db delete mode 100644 backend/kms-keys.php delete mode 100644 backend/kms-office.php delete mode 100644 backend/kms-web.php delete mode 100644 backend/route.php diff --git a/backend/kms-check.php b/backend/kms-check.php deleted file mode 100644 index 819d6a1..0000000 --- a/backend/kms-check.php +++ /dev/null @@ -1,60 +0,0 @@ - 'error', - 'message' => 'host param not exist' - ); - } - if (isset($config['port'])) { - $port = $config['port']; - } else { - $port = 1688; // 默认KMS端口 - } - if (isset($config['site']) && $config['site'] !== '') { - $site = $config['site']; - } else { - $site = null; // site参数可选 - } - $cmd = 'vlmcs '; // 生成vlmcs测试命令 - if (isDomain($host) || isIPv4($host)) { - $cmd .= $host; - } else if (isIPv6($host)) { - $cmd .= '[' . $host . ']'; // IPv6地址需用中括号包围 - } else { - return array( // host内容不是 IPv4/IPv6/Domain - 'status' => 'error', - 'message' => 'illegal host' - ); - } - if ($port > 65535 || $port < 0) { // 端口不存在 - return array( - 'status' => 'error', - 'message' => 'illegal port' - ); - } else { - $cmd .= ':' . $port; // 命令中加入端口信息 - } - if ($site !== null) { - $cmd .= ' -w ' . $site; // 加入site参数 - } - $cmd .= ' -G temp'; - $raw = shell_exec($cmd); // 执行vlmcs测试 - preg_match_all('/Sending activation request \(KMS V6\)/', $raw, $match); - if (count($match[0]) == 6) { // KMS服务器连接成功 - return array( - 'status' => 'ok', - 'message' => 'success' - ); - } else { // KMS服务器连接异常 - return array( - 'status' => 'error', - 'message' => 'connect fail' - ); - } -} - -?> diff --git a/backend/kms-cli.php b/backend/kms-cli.php deleted file mode 100644 index bcc01ec..0000000 --- a/backend/kms-cli.php +++ /dev/null @@ -1,52 +0,0 @@ - $versionContent) { - echo PHP_EOL; - showVersion($versionName, $versionContent); // 逐个显示表格 - } -} - -function showWinKeys() { // 显示Windows的KMS密钥 - $kmsKeys = getKmsKeys('win'); - showKmsKeys($kmsKeys); -} - -function showWinServerKeys() { // 显示Windows Server的KMS密钥 - $kmsKeys = array_reverse(getKmsKeys('win-server')); - showKmsKeys($kmsKeys); -} - -?> diff --git a/backend/kms-help.php b/backend/kms-help.php deleted file mode 100644 index c6152bb..0000000 --- a/backend/kms-help.php +++ /dev/null @@ -1,47 +0,0 @@ - http://' . $webSite . '/office' . PHP_EOL; - echo PHP_EOL; - echo 'KMS_KEY -> http://' . $webSite . '/win' . PHP_EOL; - echo ' -> http://' . $webSite . '/win-server' . PHP_EOL; - echo PHP_EOL; - echo 'KMS_KEY(GBK) -> http://' . $webSite . '/win/gbk' . PHP_EOL; - echo ' -> http://' . $webSite . '/win-server/gbk' . PHP_EOL; - echo PHP_EOL; -} - -function webHelp() { - global $webSite; - echo ''; - echo ''; - echo 'Windows Activation'; - echo ''; - echo '

Windows KMS Activation

';
-    echo ' slmgr /upk' . PHP_EOL;
-    echo ' slmgr /ipk {KMS_KEY}' . PHP_EOL;
-    echo ' slmgr /skms ' . $webSite . PHP_EOL;
-    echo ' slmgr /ato' . PHP_EOL;
-    echo ' slmgr /dlv ';
-    echo '

KMS (Office)
KMS_KEY (Windows)
KMS_KEY (Windows Server)

'; -} - -?> diff --git a/backend/kms-keys.db b/backend/kms-keys.db deleted file mode 100644 index 3b7f403b90ef727d3b0e426c0037e2fd0307d9c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20480 zcmeHO>yIQ?b?=$3c|Y1Oc3Fe%@+<}$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f..0000000 --- a/backend/kms-keys.php +++ /dev/null @@ -1,43 +0,0 @@ -open('kms-keys.db'); // KMS密钥数据库 - } -} - -function getVersionName($type, $version_id) { // 获取对应版本的名称 - $db = new kmsDB; - $res = $db->query('SELECT * FROM `' . $type . '_version` WHERE version_id=' . $version_id . ';'); - return $res->fetchArray(SQLITE3_ASSOC)['version_name']; -} - -function getKmsKeys($type) { // 获取所有版本的KMS密钥 - $db = new kmsDB; - $res = $db->query('SELECT * FROM `' . $type . '`;'); - while ($row = $res->fetchArray(SQLITE3_ASSOC)) { - $index = $row['version']; - unset($row['version']); - $data[getVersionName($type, $index)][] = $row; - } - return $data; -} - -?> diff --git a/backend/kms-office.php b/backend/kms-office.php deleted file mode 100644 index 8f4dff6..0000000 --- a/backend/kms-office.php +++ /dev/null @@ -1,116 +0,0 @@ - $officeKmsCmd) { - $office[$index] .= PHP_EOL . $activeCmd; - } -} - -function showOfficeHelp() { // 命令行输出Office激活帮助 - loadOsppInfo(); - loadOfficeCmd(); - global $office, $osppOption, $osppDescription, $osppDescriptionCn; - echo PHP_EOL; - foreach ($office as $index => $officeKmsCmd) { - echo str_pad('', 34, ' ') . 'Office Professional Plus ' . $index . ' VL Activation Command' . PHP_EOL; - echo str_pad('', 120, '-') . PHP_EOL; - echo $officeKmsCmd; - echo str_pad('', 120, '-') . PHP_EOL . PHP_EOL; - } - $length = 0; - $length_first = 0; - foreach ($osppOption as $index => $option) { // 获取最长的字符串长度 - $strLength = strlen($option) + strlen($osppDescription[$index]); - if ($length < $strLength) { - $length = $strLength; - $length_first = strlen($option); - } - } - $title = 'Common activation commands'; - echo str_pad('', floor(($length - strlen($title) + 26) / 2), ' ') . $title . PHP_EOL; - echo '┏' . str_pad('', $length + 24, '-') . '┓' . PHP_EOL; - foreach ($osppOption as $index => $option) { - echo '| cscript ospp.vbs ' . str_pad($osppOption[$index], $length_first, ' ') . ' | '; - echo str_pad($osppDescription[$index], $length - $length_first + 2, ' ') . ' |' . PHP_EOL; - } - echo '┗' . str_pad('', $length + 24, '-') . '┛' . PHP_EOL . PHP_EOL; - echo 'These commands are only applicable to the VL version of Office.' . PHP_EOL; - echo 'If it is a Retail version, please convert it to Volume first.' . PHP_EOL . PHP_EOL; -} - -function webOfficeHelp() { // 网页输出Office激活帮助 - loadOsppInfo(); - loadOfficeCmd(); - global $office, $osppOption, $osppDescription, $osppDescriptionCn; - echo ''; - echo ''; - echo 'Office KMS Server'; - echo '
'; - foreach ($office as $officeVersion => $officeKmsCmd) { - echo '

Office Professional Plus ' . $officeVersion . ' VL

' . PHP_EOL; - echo '
' . $officeKmsCmd . '
' . PHP_EOL; - } - echo '

常用激活命令

' . PHP_EOL; - echo ''; - foreach ($osppOption as $index => $option) { - echo ''; - echo ''; - } - echo '
命令说明
cscript ospp.vbs ' . $option . '' . $osppDescriptionCn[$index] . '

' . PHP_EOL; - echo '

以上命令仅用于激活VL版本的Office,如果当前为Retail版本,请先转化为批量授权版本。

' . PHP_EOL; - echo '
'; -} - -?> diff --git a/backend/kms-web.php b/backend/kms-web.php deleted file mode 100644 index c7b6bf2..0000000 --- a/backend/kms-web.php +++ /dev/null @@ -1,34 +0,0 @@ -'; - echo ''; - echo $title; - echo '
'; - foreach ($kmsKeys as $versionName => $versionContent) { - echo '

' . $versionName . '

'; - echo ''; - foreach ($versionContent as $row) { - echo ''; - echo ''; - } - echo '
操作系统KMS密钥
' . $row['name'] . '' . $row['key'] . '
'; - } - echo '
'; -} - -function webWinKeys() { // 网页显示Windows的KMS密钥 - $kmsKeys = getKmsKeys('win'); - webKmsKeys($kmsKeys, 'Windows KMS Keys'); -} - -function webWinServerKeys() { // 网页显示Windows Server的KMS密钥 - $kmsKeys = array_reverse(getKmsKeys('win-server')); - webKmsKeys($kmsKeys, 'Windows Server KMS Keys'); -} - -?> diff --git a/backend/route.php b/backend/route.php deleted file mode 100644 index 5a545e3..0000000 --- a/backend/route.php +++ /dev/null @@ -1,131 +0,0 @@ -