Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
crazypeace committed Nov 15, 2024
1 parent 754aabd commit b9ca003
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions v2rayN/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,23 +1571,20 @@ private void UpdateSubscriptionProcess()
if (args.Success)
{
AppendText(false, $"{hashCode}{UIRes.I18N("MsgGetSubscriptionSuccessfully")}");
string result = "";
// 是否base64解码
// 获取返回的订阅数据
string result = args.Msg;
// 如果需要base64解码
if (bBase64Decode)
{
// 将返回的订阅数据Base64解码
result = Utils.Base64Decode(args.Msg);
// Base64解码
result = Utils.Base64Decode(result);
if (Utils.IsNullOrEmpty(result))
{
// 解码失败 报错 中止处理
AppendText(false, $"{hashCode}{UIRes.I18N("MsgSubscriptionDecodingFailed")}");
return;
}
}
else
{
// 直接获取返回的订阅数据
result = args.Msg;
}

AppConfigHandler.RemoveServerViaSubid(ref appConfig, id);
AppendText(false, $"{hashCode}{UIRes.I18N("MsgClearSubscription")}");
Expand Down

0 comments on commit b9ca003

Please sign in to comment.