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

+5-4
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

+20-8
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

+3-3
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

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FreeControl/Properties/Resources.resx

+2-2
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.

FreeControl/SetProt.bat

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set scrcpy_path=%APPDATA%\Free Control\%1
2+
set scrcpy_path=%APPDATA%\FreeControl\%1
33
color 0E
44
if not exist "%scrcpy_path%\adb.exe" (echo No found adb.exe
55
echo Press any key to exit&&pause>nul&&exit
@@ -11,7 +11,7 @@ adb devices
1111
echo Setting port
1212
adb tcpip 5555
1313
set res="%ERRORLEVEL%"
14-
if %res%=="0" (echo Success
14+
if %res%=="0" (
1515
echo " .,:,,, .::,,,::."
1616
echo " .::::,,;;, .,;;:,,....:i:"
1717
echo " :i,.::::,;i:. ....,,:::::::::,.... .;i:,. ......;i."
@@ -48,7 +48,8 @@ echo " .,issr;,... ...........................,is1s;."
4848
echo " .,is1si;:,....................,:;ir1sr;,"
4949
echo " ..:isssssrrii;::::::;;iirsssssr;:.."
5050
echo " .,::iiirsssssssssrri;;:."
51-
echo Press any key to exit&&pause>nul&&exit
51+
color 2
52+
echo Success! Press any key to exit&&pause>nul&&exit
5253
)
53-
echo Faild
54-
echo Press any key to exit&&pause>nul&&exit
54+
color 4
55+
echo Faild! Press any key to exit&&pause>nul&&exit

FreeControl/Setting.cs

+5
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,10 @@ public List<string> ControllerButton
160160
};
161161
}
162162
}
163+
164+
/// <summary>
165+
/// 程序版本号
166+
/// </summary>
167+
public string Version { get; set; } = "1.0.0";
163168
}
164169
}

FreeControl/app.manifest

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<!-- UAC 清单选项
8+
如果想要更改 Windows 用户帐户控制级别,请使用
9+
以下节点之一替换 requestedExecutionLevel 节点。
10+
11+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
12+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
13+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
14+
15+
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
16+
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
17+
元素。
18+
-->
19+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<application>
26+
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
27+
Windows 版本的列表。取消评论适当的元素,
28+
Windows 将自动选择最兼容的环境。 -->
29+
30+
<!-- Windows Vista -->
31+
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
32+
33+
<!-- Windows 7 -->
34+
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
35+
36+
<!-- Windows 8 -->
37+
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
38+
39+
<!-- Windows 8.1 -->
40+
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
41+
42+
<!-- Windows 10 -->
43+
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
44+
45+
</application>
46+
</compatibility>
47+
48+
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
49+
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
50+
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
51+
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
52+
53+
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
54+
<!--
55+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
56+
<windowsSettings>
57+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
58+
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
59+
</windowsSettings>
60+
</application>
61+
-->
62+
63+
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
64+
<!--
65+
<dependency>
66+
<dependentAssembly>
67+
<assemblyIdentity
68+
type="win32"
69+
name="Microsoft.Windows.Common-Controls"
70+
version="6.0.0.0"
71+
processorArchitecture="*"
72+
publicKeyToken="6595b64144ccf1df"
73+
language="*"
74+
/>
75+
</dependentAssembly>
76+
</dependency>
77+
-->
78+
79+
</assembly>

README.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
# FreeControl
22

33
## 介绍
4-
基于开源项目[**scrcpy**](https://github.com/Genymobile/scrcpy)使用C#简单封装
4+
基于开源项目[**scrcpy**](https://github.com/Genymobile/scrcpy)提供简洁的交互界面
55

6-
做本程序的目的主要是学习,另外就是自己用着方便些。
6+
- 编码语言 `C#`
7+
- 开发工具 `Visual Studio 2022`
8+
- 运行环境 `.NET Framework 4.7.2`
79

810
## 截图
911

1012
![](https://cdn.jsdelivr.net/gh/pdone/static@latest/img/article/free-control/v1.4.0_1.png)
1113

1214
![](https://cdn.jsdelivr.net/gh/pdone/static@latest/img/article/free-control/v1.4.0_2.png)
1315

14-
15-
1616
![](https://cdn.jsdelivr.net/gh/pdone/static@latest/img/article/free-control/v1.4.0_4.png)
1717

1818
![](https://cdn.jsdelivr.net/gh/pdone/static@latest/img/article/free-control/v1.4.0_5.gif)
1919

2020
## 版本说明
21+
### v1.6.0
22+
- 基于scrcpy v2.1.1
23+
- 修复了一些bug
24+
2125
### v1.5.1
2226
- 基于scrcpy v1.25
2327

@@ -50,12 +54,12 @@
5054
- 基于scrcpy v1.14
5155

5256
## 下载地址
53-
### 蓝奏云
54-
[https://pdone.lanzouf.com/b018hod6f?password=5555](https://pdone.lanzouf.com/b018hod6f?password=5555)
5557

5658
### Github
5759
[https://github.com/pdone/FreeControl/releases](https://github.com/pdone/FreeControl/releases)
5860

61+
> 如果使用GitHub下载速度太慢,可尝试此链接 [ghproxy代理加速](https://ghproxy.com/https://github.com/pdone/FreeControl/releases/download/v1.6.0/FreeControl.exe)
62+
5963
## 代码仓库地址
6064
#### [https://github.com/pdone/FreeControl](https://github.com/pdone/FreeControl)
6165

0 commit comments

Comments
 (0)