Skip to content

Commit

Permalink
Update to scrcpy 2.1.1(x64)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdone committed Aug 18, 2023
1 parent f2d9571 commit 47ba20a
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 31 deletions.
Binary file removed FreeControl/DLL/ICSharpCode.SharpZipLib.dll
Binary file not shown.
Binary file removed FreeControl/DLL/Newtonsoft.Json.dll
Binary file not shown.
Binary file removed FreeControl/DLL/SunnyUI.dll
Binary file not shown.
9 changes: 5 additions & 4 deletions FreeControl/FreeControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
<PropertyGroup>
<ManifestCertificateThumbprint>6D93BF546206628F86A07C83939C359B342D910D</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="SunnyUI, Version=2.2.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -143,6 +146,7 @@
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -155,7 +159,7 @@
<EmbeddedResource Include="SetProt.bat" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\scrcpy-win64-v1.25.zip" />
<None Include="Resources\scrcpy-win64-v2.1.1.zip" />
<None Include="Resources\Setting.png" />
</ItemGroup>
<ItemGroup>
Expand All @@ -165,15 +169,12 @@
<None Include="Resources\pcm.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="DLL\ICSharpCode.SharpZipLib.dll" />
<Content Include="DLL\Newtonsoft.Json.dll" />
<Content Include="Resources\Home_Dark.png" />
<None Include="Resources\SunnyUI.Common.dll" />
<None Include="Resources\SunnyUI.dll" />
<Content Include="Resources\Setting_Dark.png" />
<None Include="Resources\shortcut_zh.jpg" />
<None Include="Resources\shortcut_en.jpg" />
<None Include="DLL\SunnyUI.dll" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
Expand Down
28 changes: 20 additions & 8 deletions FreeControl/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace FreeControl
{
Expand All @@ -26,7 +27,7 @@ public partial class Main : UIForm
/// <summary>
/// scrcpy版本
/// </summary>
public static readonly string ScrcpyVersion = "scrcpy-win64-v1.25";
public static readonly string ScrcpyVersion = "scrcpy-win64-v2.1.1";
/// <summary>
/// scrcpy路径
/// </summary>
Expand Down Expand Up @@ -72,7 +73,7 @@ public static string UserDataPath
{
get
{
return Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Free Control");
return Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FreeControl");
}
}
/// <summary>
Expand Down Expand Up @@ -126,14 +127,24 @@ public static void SetUserData(Setting userData)
/// </summary>
public void InitPdone()
{
//获取程序集信息
Assembly asm = Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location);
//获取用户配置数据
_Setting = GetUserData();
//adb路径
ADB.ADBPath = $@"{ScrcpyPath}";
//增加adb执行文件系统变量
ADB.AddEnvironmentPath(ScrcpyPath);
//是否重新加载资源包
bool reload = false;
if (_Setting.Version != fvi.ProductVersion)
{
reload = true;
_Setting.Version = fvi.ProductVersion;
}
//提取资源
ExtractResource();
ExtractResource(reload);

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

#region 设置标题和图标
Assembly asm = Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm.Location);
Text = $"Free Control v{fvi.ProductVersion}";
lbTitle.Visible = false;
lbTitle.Text = Text;
Expand Down Expand Up @@ -234,18 +243,21 @@ public void InitPdone()
/// <summary>
/// 提取内置资源
/// </summary>
private void ExtractResource()
private void ExtractResource(bool reload = false)
{
string tempFileName = "temp.zip";
if (reload)
{
Directory.Delete(ScrcpyPath, true);
}
if (!Directory.Exists(ScrcpyPath))
{
Directory.CreateDirectory(ScrcpyPath);
File.WriteAllBytes(ScrcpyPath + tempFileName, Properties.Resources.scrcpy_win64_v1_25);
File.WriteAllBytes(ScrcpyPath + tempFileName, Properties.Resources.scrcpy_win64_v2_1_1);
//解压缩
ZipFile.ExtractToDirectory(ScrcpyPath + tempFileName, UserDataPath);
//解压完成删除压缩包
File.Delete(ScrcpyPath + tempFileName);

}
}

Expand Down
6 changes: 3 additions & 3 deletions FreeControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Pdone Technology Ltd.")]
[assembly: AssemblyProduct("Free Control")]
[assembly: AssemblyCopyright("Copyright © 2023 pdoner.cn")]
[assembly: AssemblyCopyright("Copyright © 2023 awaw.cc")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -33,5 +33,5 @@
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.5.1")]
[assembly: AssemblyVersion("1.5.1")]
[assembly: AssemblyFileVersion("1.6.0")]
[assembly: AssemblyVersion("1.6.0")]
6 changes: 3 additions & 3 deletions FreeControl/Properties/Resources.Designer.cs

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

4 changes: 2 additions & 2 deletions FreeControl/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
<data name="pcm" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pcm.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="scrcpy_win64_v1_25" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\scrcpy-win64-v1.25.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="scrcpy_win64_v2_1_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\scrcpy-win64-v2.1.1.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="shortcut_en" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\shortcut_en.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
Expand Down
Binary file removed FreeControl/Resources/scrcpy-win64-v1.25.zip
Binary file not shown.
Binary file added FreeControl/Resources/scrcpy-win64-v2.1.1.zip
Binary file not shown.
11 changes: 6 additions & 5 deletions FreeControl/SetProt.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
set scrcpy_path=%APPDATA%\Free Control\%1
set scrcpy_path=%APPDATA%\FreeControl\%1
color 0E
if not exist "%scrcpy_path%\adb.exe" (echo No found adb.exe
echo Press any key to exit&&pause>nul&&exit
Expand All @@ -11,7 +11,7 @@ adb devices
echo Setting port
adb tcpip 5555
set res="%ERRORLEVEL%"
if %res%=="0" (echo Success
if %res%=="0" (
echo " .,:,,, .::,,,::."
echo " .::::,,;;, .,;;:,,....:i:"
echo " :i,.::::,;i:. ....,,:::::::::,.... .;i:,. ......;i."
Expand Down Expand Up @@ -48,7 +48,8 @@ echo " .,issr;,... ...........................,is1s;."
echo " .,is1si;:,....................,:;ir1sr;,"
echo " ..:isssssrrii;::::::;;iirsssssr;:.."
echo " .,::iiirsssssssssrri;;:."
echo Press any key to exit&&pause>nul&&exit
color 2
echo Success! Press any key to exit&&pause>nul&&exit
)
echo Faild
echo Press any key to exit&&pause>nul&&exit
color 4
echo Faild! Press any key to exit&&pause>nul&&exit
5 changes: 5 additions & 0 deletions FreeControl/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,10 @@ public List<string> ControllerButton
};
}
}

/// <summary>
/// 程序版本号
/// </summary>
public string Version { get; set; } = "1.0.0";
}
}
79 changes: 79 additions & 0 deletions FreeControl/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->

<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->

<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->

<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->

<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->

<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->

</application>
</compatibility>

<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->

<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->

</assembly>
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# FreeControl

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

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

## 截图

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

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



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

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

## 版本说明
### v1.6.0
- 基于scrcpy v2.1.1
- 修复了一些bug

### v1.5.1
- 基于scrcpy v1.25

Expand Down Expand Up @@ -50,12 +54,12 @@
- 基于scrcpy v1.14

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

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

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

Expand Down

0 comments on commit 47ba20a

Please sign in to comment.