Skip to content

Commit

Permalink
添加workflows、修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pdone committed Jun 18, 2024
1 parent c503aef commit c603878
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 8 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Release

on:
push:
tags: [ "v*.*.*" ]

jobs:
build-and-release:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Restore NuGet Packages
run: nuget restore FreeControl.sln

- name: Build
run: |
msbuild FreeControl.sln /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath="../output"
$filePath = "output/Freecontrol.exe"
$sha256Hash = (Get-FileHash -Algorithm SHA256 -Path $filePath).Hash
$sha256Hash > "output/SHA256 $sha256Hash"
- uses: softprops/action-gh-release@v2
with:
files: |
output/FreeControl.exe
output/SHA256*
name: ${{ github.ref_name }}
draft: true
24 changes: 24 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test Build

on:
push:
branches: [dev]
pull_request:
branches: [master]

jobs:
test-build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Restore NuGet Packages
run: nuget restore FreeControl.sln

- name: Build
run: msbuild FreeControl.sln /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath="output"
1 change: 1 addition & 0 deletions FreeControl/Main.Designer.cs

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

5 changes: 4 additions & 1 deletion FreeControl/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ private void StartButtonClick(object sender, EventArgs e)
// 设置标题
StartParameters.Add($"--window-title \"{Info.ScrcpyTitle}\"");
// 设置断开后锁定屏幕
StartParameters.Add("--power-off-on-close");
if (_Setting.PowerOffOnClose)
{
StartParameters.Add("--power-off-on-close");
}
StartParameters.Add(_Setting.CustomArgs);
if (_Setting.AudioEnabled == false) StartParameters.Add(_Setting.GetDesc("AudioEnabled"));// 不转发音频

Expand Down
4 changes: 2 additions & 2 deletions FreeControl/Main.resx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADG
GgAAAk1TRnQBSQFMAgEBBAEAAXABAwFwAQMBHgEAAR4BAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAF4
GgAAAk1TRnQBSQFMAgEBBAEAAXgBAwF4AQMBHgEAAR4BAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAF4
AwABPAMAAQEBAAEgBQABgAFw/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
/wD/AP8A/wD/AJ4AAzgBXQMaAf8DGgH/AxoB/wMaAf8DGgH/AxoB/wMaAf8DGgH/AxoB/wMaAf8DGgH/
Expand Down Expand Up @@ -232,7 +232,7 @@
AXgDvwH/AzcBWggABAEDAgEDMAAEAQMCAQMIAAMHAQkDXgHtA2oB+QMPARQYAANNAZIDXgH7AxoB/wNE
AXgDAgEDLAADEQEWA14B0gMaAf8DWgHpAyIBMSQAA00BkgNfAfsDvwH/A0QBeAMCAQMsAAMRARYDXgHS
A78B/wNjAekDIgExHAADXQHOAxoB/wMbASYDUQGfAxoB/wMaAf8DWgHHAyUBNiAAAwMBBANJAYcDGgH/
AxoB/wNdAc8DKQE+A1ABnAN0Af4DMQFNFAADXwHOA78B/wMbASYDUQGfA78B/wO/Af8DWgHHAyUBNiAA
AxoB/wNdAc8DKQE+A1ABnAN1Af4DMQFNFAADXwHOA78B/wMbASYDUQGfA78B/wO/Af8DWgHHAyUBNiAA
AwMBBANJAYcDvwH/A78B/wNdAc8DKQE+A1EBnAOAAf4DMQFNIAADHgEqA10B3wMaAf8DWwHQAxgBICQA
AzkBXgNJAfYDGgH/A1UBrzAAAx4BKgNdAd8DvwH/A18B0AMYASAkAAM5AV4DYgH2A78B/wNVAa8kAAMc
AScDSQH2AxoB/wMaAf8DXwHaA10ByQNgAfMDGgH/AxwBJxwAA10B3AMaAf8DYQHrA1sBzQNeAfsDGgH/
Expand Down
4 changes: 2 additions & 2 deletions FreeControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.7.0")]
[assembly: AssemblyVersion("1.7.0")]
[assembly: AssemblyFileVersion("1.7.1")]
[assembly: AssemblyVersion("1.7.1")]
Binary file modified FreeControl/Resources/en.FreeControl.resources.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion FreeControl/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public List<string> ControllerButton
/// <summary>
/// 退出时锁屏
/// </summary>
public bool PowerOffOnClose { get; set; } = true;
public bool PowerOffOnClose { get; set; } = false;

/// <summary>
/// 自定义参数
Expand Down
4 changes: 4 additions & 0 deletions FreeControl/Update.en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Free Control Update Record

## v1.7.1
- Add `Workflows`
- Fix `PowerOffOnClose` parameter not taking effect

## v1.7.0
- `UHID keyboard` is enabled by default to optimize the Chinese input experience
- Add `PowerOffOnClose` parameter to control lock screen when exiting, enabled by default
Expand Down
4 changes: 4 additions & 0 deletions FreeControl/Update.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Free Control 更新记录

## v1.7.1
- 增加 `Workflows`
- 修复 `PowerOffOnClose` 参数未生效的问题

## v1.7.0
- 默认启用 `UHID keyboard` 优化中文输入体验
- 增加 `PowerOffOnClose` 参数控制退出时锁屏,默认启用
Expand Down
10 changes: 9 additions & 1 deletion README.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FreeControl

[![](https://img.shields.io/github/license/pdone/FreeControl?style=for-the-badge)](https://github.com/pdone/FreeControl/blob/master/LICENSE)
[![](https://img.shields.io/github/actions/workflow/status/pdone/FreeControl/build-and-release.yml?style=for-the-badge)](https://github.com/pdone/FreeControl/actions/workflows/build-and-release.yml)
[![](https://img.shields.io/github/release/pdone/FreeControl?style=for-the-badge)](https://github.com/pdone/FreeControl/releases/latest)
[![](https://img.shields.io/github/downloads/pdone/FreeControl/total?style=for-the-badge)](https://github.com/pdone/FreeControl/releases)
[![](https://img.shields.io/github/stars/pdone/FreeControl?style=for-the-badge)](https://github.com/pdone/FreeControl)
Expand Down Expand Up @@ -43,6 +43,14 @@ https://cdn.awaw.cc/gh/pdone/FreeControl/releases/latest/download/FreeControl.ex

## FAQ

### Lock Screen After Closing Window

`v1.7.1` and later versions, the `PowerOffOnClose` parameter is added to control whether the mobile phone will be locked after the control window is closed. It is not enabled by default. You can change the value of the `PowerOffOnClose` parameter to `true` in the configuration file `%AppData%\FreeControl\config.json` to enable it.

### Compilation Issues

`Workflows` have been added to this repository for continuous integration. You can view the latest code build status through `GitHub Action`. If `Workflows` is successfully built but cannot be compiled after being pulled locally, you can try to manually add project dependencies or retry by referring to the build process configured in `Workflows`.

### Input Method Issues

`v1.7.0` and later versions, the `UHID keyboard` feature of scrcpy is enabled by default to optimize the Chinese input experience.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FreeControl

[![](https://img.shields.io/github/license/pdone/FreeControl?style=for-the-badge)](https://github.com/pdone/FreeControl/blob/master/LICENSE)
[![](https://img.shields.io/github/actions/workflow/status/pdone/FreeControl/build-and-release.yml?style=for-the-badge)](https://github.com/pdone/FreeControl/actions/workflows/build-and-release.yml)
[![](https://img.shields.io/github/release/pdone/FreeControl?style=for-the-badge)](https://github.com/pdone/FreeControl/releases/latest)
[![](https://img.shields.io/github/downloads/pdone/FreeControl/total?style=for-the-badge)](https://github.com/pdone/FreeControl/releases)
[![](https://img.shields.io/github/stars/pdone/FreeControl?style=for-the-badge)](https://github.com/pdone/FreeControl)
Expand Down Expand Up @@ -43,6 +43,14 @@ https://cdn.awaw.cc/gh/pdone/FreeControl/releases/latest/download/FreeControl.ex

## 常见问题

### 关闭窗口后锁屏

`v1.7.1` 及以后的版本中,增加 `PowerOffOnClose` 参数,用于控制关闭控制窗口后,是否将手机锁屏。默认不启用,可以在配置文件 `%AppData%\FreeControl\config.json` 中,将 `PowerOffOnClose` 参数值改为 `true` 以启用。

### 编译问题

本仓库已添加 `Workflows` 进行持续集成,可通过 `GitHub Action` 查看最新代码构建情况。如果 `Workflows` 构建成功,但拉取本地后无法正常编译,可尝试手动添加项目依赖,也可参考 `Workflows` 中配置的构建流程重试。

### 输入法问题

`v1.7.0` 及以后的版本中,默认启用scrcpy的 `UHID keyboard` 特性,以优化中文输入体验。
Expand Down

0 comments on commit c603878

Please sign in to comment.