From 29a874afd4bb7884af07011aa95ab314e3c64f36 Mon Sep 17 00:00:00 2001 From: flucont Date: Mon, 25 Jul 2022 22:46:40 +0800 Subject: [PATCH] update --- app/lib/Plugins.php | 25 +++ app/view/admin/plugins.html | 2 +- app/view/admin/pluginswin.html | 2 +- app/view/admin/set.html | 16 +- public/install/src/panel6.zip | Bin 7987695 -> 7987485 bytes public/install/update/LinuxPanel-7.9.3.zip | Bin 7960856 -> 7960475 bytes public/static/css/download.css | 184 ++++++++++++++++++++- public/static/file/kaixin.zip | Bin 7990 -> 4358 bytes public/static/file/win/__init__.zip | Bin 3920 -> 0 bytes public/static/file/win/kaixin.zip | Bin 4436 -> 4345 bytes 10 files changed, 222 insertions(+), 7 deletions(-) delete mode 100644 public/static/file/win/__init__.zip diff --git a/app/lib/Plugins.php b/app/lib/Plugins.php index 84d8294..203f246 100644 --- a/app/lib/Plugins.php +++ b/app/lib/Plugins.php @@ -166,6 +166,7 @@ class Plugins //解密并下载插件主程序文件 public static function decode_plugin_main($plugin_name, $version, $main_filepath, $os = 'Linux'){ + if(self::decode_plugin_main_local($main_filepath, $os)) return true; $btapi = self::get_btapi($os); $result = $btapi->get_decode_plugin_main($plugin_name, $version); if($result && isset($result['status'])){ @@ -181,6 +182,30 @@ class Plugins } } + //本地解密插件主程序文件 + public static function decode_plugin_main_local($main_filepath, $os = 'Linux'){ + $btapi = self::get_btapi($os); + $userinfo = $btapi->get_user_info(); + if(isset($userinfo['uid'])){ + $src = file_get_contents($main_filepath); + $data = explode("\n", $src)[0]; + $uid = $userinfo['uid']; + $serverid = $userinfo['serverid']; + $key = md5(substr($serverid, 10, 16).$uid.$serverid); + $iv = md5($key.$serverid); + $key = substr($key, 8, 16); + $iv = substr($iv, 8, 16); + $de_text = openssl_decrypt($data, 'aes-128-cbc', $key, 0, $iv); + if(!empty($de_text)){ + file_put_contents($main_filepath, $de_text); + return true; + } + return false; + }else{ + throw new Exception('解密插件主程序文件失败,获取用户信息失败'); + } + } + //去除插件主程序文件授权校验 public static function noauth_plugin_main($main_filepath){ $data = file_get_contents($main_filepath); diff --git a/app/view/admin/plugins.html b/app/view/admin/plugins.html index 84e30ed..8d67fa9 100644 --- a/app/view/admin/plugins.html +++ b/app/view/admin/plugins.html @@ -35,7 +35,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:340px;