Skip to content

Commit

Permalink
修复一个正则BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
zsh2401 committed Jan 19, 2019
1 parent 2b0a8eb commit f1d9019
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion AutumnBox.CoreModules/Lib/EDpmSetterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace AutumnBox.CoreModules.Lib
[ExtText(TIP_OK, "Success!!", "zh-cn:设置成功!")]
[ExtText(TIP_FAIL, "Fail!!", "zh-cn:失败!")]
[ExtText(OK_MSG, "Fail!!", "zh-cn:终于成功了,请前往手机端软件进行确认,如果需要卸载,一定要前往该软件其设置内进行操作,否则可能导致DPM残留,那可就没得救了")]
[ExtText(ERR_MSG_KEY_DO_ALREADY_SET, "Fail!!", "zh-cn:设备管理员已经被设置过了!请先移除这个设备管理员(冻结APP请前往该APP设置进行移除)")]
[ExtText(ERR_MSG_KEY_DO_ALREADY_SET, "Fail!!", "zh-cn:设备管理员已经被设置过了!请先移除之前的设备管理员应用(冻结APP请前往该APP设置进行移除)")]
[ExtText(ERR_MSG_KEY_UNKNOWN, "Fail!!", "zh-cn:奇怪的问题,请点击左上角复制按钮,并将其发送给你想咨询的人")]
[ExtText(ERR_MSG_KEY_HAVE_USERS, "Fail!!", "zh-cn:设备上还有多余的用户!请尝试删除应用多开,访客模式等再试")]
[ExtText(ERR_MSG_KEY_HAVE_ACCOUNTS, "Fail!!", "zh-cn:设备上还有多余的账号!前往设置->同步/账号->删除,然后再试")]
Expand Down Expand Up @@ -98,6 +98,7 @@ public void Main(IDevice device, TextAttrManager texts)
return;
}
//提示用户移除屏幕锁等
Logger.Info(texts["WarningRemoveLock"]);
if (!UI.DoYN(texts["WarningRemoveLock"]))
{
UI.Shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace AutumnBox.OpenFramework.Extension
public abstract class ExtInfoI18NAttribute : ExtensionAttribute, IInformationAttribute
{
private const string DEFAULT_KEY = "ALL_REGIONS";
private const string KV_PATTERN = @"(?<key>[\w|\-]+):(?<value>.+)";
private readonly Regex regex = new Regex(KV_PATTERN);
private const string KV_PATTERN = @"(?<key>[^:]+):(?<value>[\s\S]+)";
private static readonly Regex regex = new Regex(KV_PATTERN);
private Dictionary<string, string> pairsOfRegionAndValue;
/// <summary>
/// 构建
Expand Down Expand Up @@ -51,7 +51,7 @@ private void ParseAndAddToDict(string kv)
if (match.Success)
{
AddOrOverwrite(
match.Result("${key}").ToLower() ,
match.Result("${key}").ToLower(),
match.Result("${value}"));
}
else
Expand Down

0 comments on commit f1d9019

Please sign in to comment.