Skip to content

Commit

Permalink
修复些许bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Mar 13, 2018
1 parent 041497b commit 4628556
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 41 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
v2rayN/.vs/
v2rayN/v2rayN/bin/
v2rayN/v2rayN/obj/
v2rayN/v2rayN/obj/
v2rayN/v2rayN/Jrohy.pfx
4 changes: 2 additions & 2 deletions v2rayN/v2rayN.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Debug|Any CPU.Build.0 = Release|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Debug|x86.ActiveCfg = Debug|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Debug|x86.Build.0 = Debug|Any CPU
{0A9785E6-D256-4B73-9757-4EF59955FD1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
31 changes: 16 additions & 15 deletions v2rayN/v2rayN/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 23 additions & 19 deletions v2rayN/v2rayN/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -677,37 +677,37 @@ private void menuScreenQRCodeScan_Click(object sender, EventArgs e)
Rectangle rect;
if (stretch == 1 ? Scan.ScanQRCode(screen, fullImage, cropRect, out url, out rect) : Scan.ScanQRCodeStretch(screen, fullImage, cropRect, stretch, out url, out rect))
{

QRCodeSplashForm splash = new QRCodeSplashForm();

splash.FormClosed += splash_FormClosed;


splash.Location = new Point(screen.Bounds.X, screen.Bounds.Y);
double dpi = Screen.PrimaryScreen.Bounds.Width / (double)screen_size.X;
splash.TargetRect = new Rectangle(
(int)(rect.Left * dpi + screen.Bounds.X),
(int)(rect.Top * dpi + screen.Bounds.Y),
(int)(rect.Width * dpi),
(int)(rect.Height * dpi));
splash.Size = new Size(fullImage.Width, fullImage.Height);

VmessItem vmessItem = V2rayConfigHandler.ImportFromStrConfig(out string msg, url);
if (vmessItem != null && ConfigHandler.AddServer(ref config, vmessItem, -1) == 0)
{
QRCodeSplashForm splash = new QRCodeSplashForm();

splash.FormClosed += splash_FormClosed;


splash.Location = new Point(screen.Bounds.X, screen.Bounds.Y);
double dpi = Screen.PrimaryScreen.Bounds.Width / (double)screen_size.X;
splash.TargetRect = new Rectangle(
(int)(rect.Left * dpi + screen.Bounds.X),
(int)(rect.Top * dpi + screen.Bounds.Y),
(int)(rect.Width * dpi),
(int)(rect.Height * dpi));
splash.Size = new Size(fullImage.Width, fullImage.Height);
splash.Show();

//刷新
RefreshServers();
LoadV2ray();

//扫到一个vmess的二维码即退出
break;

}
else
{
splash.Show();
UI.Show(msg);
}

//扫到一个二维码即退出
break;
}
}
}
Expand All @@ -718,7 +718,7 @@ private void menuScreenQRCodeScan_Click(object sender, EventArgs e)
private void menuClipboardImportVmess_Click(object sender, EventArgs e)
{
VmessItem vmessItem = V2rayConfigHandler.ImportFromClipboardConfig(out string msg);
if (ConfigHandler.AddServer(ref config, vmessItem, -1) == 0)
if (vmessItem != null && ConfigHandler.AddServer(ref config, vmessItem, -1) == 0)
{
//刷新
RefreshServers();
Expand Down Expand Up @@ -924,8 +924,12 @@ private void ChangeSysAgent(bool isChecked)




#endregion

private void cmsMain_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{

}
}
}
18 changes: 15 additions & 3 deletions v2rayN/v2rayN/v2rayN.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,31 @@
<ApplicationIcon>v2ray.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>BD431FE78E8A6683106E7110882AE5C41CBF5C60</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>098C530B77D817F19067D70C9FE9058F9EC51163</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>v2rayN_TemporaryKey.pfx</ManifestKeyFile>
<ManifestKeyFile>Jrohy.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>false</SignManifests>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Jrohy.pfx</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>.\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -201,6 +211,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Jrohy.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -272,6 +283,7 @@
<EmbeddedResource Include="zxing.presentation.dll" />
<EmbeddedResource Include="zxing.dll" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/v2rayN.csproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>发布\</PublishUrlHistory>
<PublishUrlHistory>发布|发布\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
Expand Down

0 comments on commit 4628556

Please sign in to comment.