Skip to content

Commit 47ba20a

Browse files
committed
Update to scrcpy 2.1.1(x64)
1 parent f2d9571 commit 47ba20a

14 files changed

+133
-31
lines changed
-196 KB
Binary file not shown.

FreeControl/DLL/Newtonsoft.Json.dll

-561 KB
Binary file not shown.

FreeControl/DLL/SunnyUI.dll

-1.64 MB
Binary file not shown.

FreeControl/FreeControl.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
<PropertyGroup>
6767
<ManifestCertificateThumbprint>6D93BF546206628F86A07C83939C359B342D910D</ManifestCertificateThumbprint>
6868
</PropertyGroup>
69+
<PropertyGroup>
70+
<ApplicationManifest>app.manifest</ApplicationManifest>
71+
</PropertyGroup>
6972
<ItemGroup>
7073
<Reference Include="SunnyUI, Version=2.2.6.0, Culture=neutral, processorArchitecture=MSIL">
7174
<SpecificVersion>False</SpecificVersion>
@@ -143,6 +146,7 @@
143146
<SubType>Designer</SubType>
144147
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
145148
</EmbeddedResource>
149+
<None Include="app.manifest" />
146150
<None Include="Properties\Settings.settings">
147151
<Generator>SettingsSingleFileGenerator</Generator>
148152
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -155,7 +159,7 @@
155159
<EmbeddedResource Include="SetProt.bat" />
156160
</ItemGroup>
157161
<ItemGroup>
158-
<None Include="Resources\scrcpy-win64-v1.25.zip" />
162+
<None Include="Resources\scrcpy-win64-v2.1.1.zip" />
159163
<None Include="Resources\Setting.png" />
160164
</ItemGroup>
161165
<ItemGroup>
@@ -165,15 +169,12 @@
165169
<None Include="Resources\pcm.ico" />
166170
</ItemGroup>
167171
<ItemGroup>
168-
<Content Include="DLL\ICSharpCode.SharpZipLib.dll" />
169-
<Content Include="DLL\Newtonsoft.Json.dll" />
170172
<Content Include="Resources\Home_Dark.png" />
171173
<None Include="Resources\SunnyUI.Common.dll" />
172174
<None Include="Resources\SunnyUI.dll" />
173175
<Content Include="Resources\Setting_Dark.png" />
174176
<None Include="Resources\shortcut_zh.jpg" />
175177
<None Include="Resources\shortcut_en.jpg" />
176-
<None Include="DLL\SunnyUI.dll" />
177178
</ItemGroup>
178179
<ItemGroup>
179180
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">

FreeControl/Main.cs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using System.Threading;
1414
using System.Threading.Tasks;
1515
using System.Windows.Forms;
16+
using System.Windows.Forms.Design;
1617

1718
namespace FreeControl
1819
{
@@ -26,7 +27,7 @@ public partial class Main : UIForm
2627
/// <summary>
2728
/// scrcpy版本
2829
/// </summary>
29-
public static readonly string ScrcpyVersion = "scrcpy-win64-v1.25";
30+
public static readonly string ScrcpyVersion = "scrcpy-win64-v2.1.1";
3031
/// <summary>
3132
/// scrcpy路径
3233
/// </summary>
@@ -72,7 +73,7 @@ public static string UserDataPath
7273
{
7374
get
7475
{
75-
return Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Free Control");
76+
return Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FreeControl");
7677
}
7778
}
7879
/// <summary>
@@ -126,14 +127,24 @@ public static void SetUserData(Setting userData)
126127
/// </summary>
127128
public void InitPdone()
128129
{
130+
//获取程序集信息
131+
Assembly asm = Assembly.GetExecutingAssembly();
132+
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location);
129133
//获取用户配置数据
130134
_Setting = GetUserData();
131135
//adb路径
132136
ADB.ADBPath = $@"{ScrcpyPath}";
133137
//增加adb执行文件系统变量
134138
ADB.AddEnvironmentPath(ScrcpyPath);
139+
//是否重新加载资源包
140+
bool reload = false;
141+
if (_Setting.Version != fvi.ProductVersion)
142+
{
143+
reload = true;
144+
_Setting.Version = fvi.ProductVersion;
145+
}
135146
//提取资源
136-
ExtractResource();
147+
ExtractResource(reload);
137148

138149
#region 事件绑定
139150
//退出时保存用户配置数据
@@ -181,8 +192,6 @@ public void InitPdone()
181192
#endregion
182193

183194
#region 设置标题和图标
184-
Assembly asm = Assembly.GetExecutingAssembly();
185-
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location);
186195
Text = $"Free Control v{fvi.ProductVersion}";
187196
lbTitle.Visible = false;
188197
lbTitle.Text = Text;
@@ -234,18 +243,21 @@ public void InitPdone()
234243
/// <summary>
235244
/// 提取内置资源
236245
/// </summary>
237-
private void ExtractResource()
246+
private void ExtractResource(bool reload = false)
238247
{
239248
string tempFileName = "temp.zip";
249+
if (reload)
250+
{
251+
Directory.Delete(ScrcpyPath, true);
252+
}
240253
if (!Directory.Exists(ScrcpyPath))
241254
{
242255
Directory.CreateDirectory(ScrcpyPath);
243-
File.WriteAllBytes(ScrcpyPath + tempFileName, Properties.Resources.scrcpy_win64_v1_25);
256+
File.WriteAllBytes(ScrcpyPath + tempFileName, Properties.Resources.scrcpy_win64_v2_1_1);
244257
//解压缩
245258
ZipFile.ExtractToDirectory(ScrcpyPath + tempFileName, UserDataPath);
246259
//解压完成删除压缩包
247260
File.Delete(ScrcpyPath + tempFileName);
248-
249261
}
250262
}
251263

FreeControl/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("Pdone Technology Ltd.")]
1212
[assembly: AssemblyProduct("Free Control")]
13-
[assembly: AssemblyCopyright("Copyright © 2023 pdoner.cn")]
13+
[assembly: AssemblyCopyright("Copyright © 2023 awaw.cc")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -33,5 +33,5 @@
3333
//通过使用 "*",如下所示:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
//[assembly: AssemblyVersion("1.0.0")]
36-
[assembly: AssemblyFileVersion("1.5.1")]
37-
[assembly: AssemblyVersion("1.5.1")]
36+
[assembly: AssemblyFileVersion("1.6.0")]
37+
[assembly: AssemblyVersion("1.6.0")]

FreeControl/Properties/Resources.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FreeControl/Properties/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
<data name="pcm" type="System.Resources.ResXFileRef, System.Windows.Forms">
122122
<value>..\Resources\pcm.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123123
</data>
124-
<data name="scrcpy_win64_v1_25" type="System.Resources.ResXFileRef, System.Windows.Forms">
125-
<value>..\Resources\scrcpy-win64-v1.25.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
124+
<data name="scrcpy_win64_v2_1_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
125+
<value>..\Resources\scrcpy-win64-v2.1.1.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
126126
</data>
127127
<data name="shortcut_en" type="System.Resources.ResXFileRef, System.Windows.Forms">
128128
<value>..\Resources\shortcut_en.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
-36.5 MB
Binary file not shown.
5.68 MB
Binary file not shown.

0 commit comments

Comments
 (0)