Skip to content

Commit

Permalink
⚠ Warn when importing from legacy ss:// links
Browse files Browse the repository at this point in the history
  • Loading branch information
database64128 committed Dec 31, 2020
1 parent a28efee commit ac0fcdf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
4.4.0.0 2021-01-01
- Security: remove infrastructure of stream ciphers (#3048)
- Show warning message when importing from deprecated legacy ss:// links.
- Other minor bug fixes and improvements

4.3.3.0 2020-12-07
Expand Down
2 changes: 2 additions & 0 deletions shadowsocks-csharp/Controller/ShadowsocksController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ public bool AddServerBySSURL(string ssURL)
foreach (var server in servers)
{
_config.configs.Add(server);
if (server.warnLegacyUrl)
MessageBox.Show(I18N.GetString("Warning: importing {0} from a legacy ss:// link. Support for legacy ss:// links will be dropped in version 5. Make sure to update your ss:// links.", server.ToString()));
}
_config.index = _config.configs.Count - 1;
SaveConfig(_config);
Expand Down
1 change: 1 addition & 0 deletions shadowsocks-csharp/Data/i18n.csv
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Failed to update registry,Не удалось обновить запись в
Import from URL: {0} ?,импортировать из адреса: {0} ?,从URL导入: {0} ?,從URL匯入: {0} ?,{0}:このURLからインポートしますか?,,
Successfully imported from {0},Успешно импортировано из {0},导入成功:{0},導入成功:{0},{0}:インポートしました。,,
Failed to import. Please check if the link is valid.,,导入失败,请检查链接是否有效。,導入失敗,請檢查鏈接是否有效。,インポートに失敗しました。リンクの有効性を確認してください。,,
Warning: importing {0} from a legacy ss:// link. Support for legacy ss:// links will be dropped in version 5. Make sure to update your ss:// links.,,警告: 正在从旧版 ss:// 链接导入 {0}。对旧版 ss:// 链接的支持将于 v5 移除,请及时更新你的链接。,,,,
System Proxy On: ,Системный прокси:,系统代理已启用:,系統 Proxy 已啟用:,システム プロキシが有効:,시스템 프록시 활성화됨: ,Proxy système activé:
Running: Port {0},Запущен на порту {0},正在运行:端口 {0},正在執行:連接埠號碼 {0},実行中:ポート {0},실행 중: 포트 {0}번,En cours d'exécution: port {0}
"Unexpected error, shadowsocks will exit. Please report to","Непредвиденная ошибка, пожалуйста сообщите на",非预期错误,Shadowsocks将退出。请提交此错误到,非預期錯誤,Shadowsocks 將結束。請報告此錯誤至,予想外のエラーが発生したため、Shadowsocks を終了します。詳しくは下記までお問い合わせ下さい:,알 수 없는 오류로 Shadowsocks가 종료될 것입니다. 오류를 여기로 제보해주세요:,Shadowsocks va quitter en présence d/érreur inattendue. Veuillez signaler à
Expand Down
8 changes: 4 additions & 4 deletions shadowsocks-csharp/Model/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public class Server
public int server_port;
public string password;
public string method;




// optional fields
[DefaultValue("")]
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
Expand All @@ -53,6 +49,9 @@ public class Server

public int timeout;

// Set to true when imported from a legacy ss:// URL.
public bool warnLegacyUrl;

public override int GetHashCode()
{
return server.GetHashCode() ^ server_port;
Expand Down Expand Up @@ -177,6 +176,7 @@ private static Server ParseLegacyURL(string ssURL)
server.password = details.Groups["password"].Value;
server.server = details.Groups["hostname"].Value;
server.server_port = int.Parse(details.Groups["port"].Value);
server.warnLegacyUrl = true;
return server;
}

Expand Down

0 comments on commit ac0fcdf

Please sign in to comment.