From 58a66f1b8576bbaf1fc53649ccb786d4b62137d9 Mon Sep 17 00:00:00 2001 From: viarotel Date: Mon, 16 Oct 2023 16:08:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=89=93=E5=8C=85=E5=90=8E=E5=9B=BE=E6=A0=87=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-assets.yml | 3 +- README.md | 51 +++++++++++------- binary.js | 10 ---- electron-builder.json | 18 +++++-- electron/exposes/adbkit/index.js | 2 +- electron/main.js | 8 +-- .../resources/build/entitlements.mac.plist | 12 +++++ .../{extra/icons => build}/logo.icns | 0 .../resources/{extra/icons => build}/logo.ico | Bin .../resources/{extra/icons => build}/logo.png | Bin package.json | 7 ++- pnpm-lock.yaml | 33 +++++++++--- public/electron-vite.animate.svg | 34 ------------ public/vite.svg | 1 - src/store/scrcpy/model/record/index.js | 2 +- vite.config.js | 2 +- 16 files changed, 102 insertions(+), 81 deletions(-) delete mode 100644 binary.js create mode 100644 electron/resources/build/entitlements.mac.plist rename electron/resources/{extra/icons => build}/logo.icns (100%) rename electron/resources/{extra/icons => build}/logo.ico (100%) rename electron/resources/{extra/icons => build}/logo.png (100%) delete mode 100644 public/electron-vite.animate.svg delete mode 100644 public/vite.svg diff --git a/.github/workflows/release-assets.yml b/.github/workflows/release-assets.yml index 2cd63979..c104be65 100644 --- a/.github/workflows/release-assets.yml +++ b/.github/workflows/release-assets.yml @@ -48,6 +48,7 @@ jobs: uses: softprops/action-gh-release@v1 with: draft: true + prerelease: true files: | dist-release/*.exe dist-release/*.zip @@ -60,4 +61,4 @@ jobs: dist-release/*.yml dist-release/*.blockmap env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 998ad7d4..272cbf2f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ 📱 使用图形界面的 Scrcpy 显示和控制您的 Android 设备,由 Electron 驱动 -📱 Use Scrcpy with a graphical interface to display and control your Android device, driven by Electron -
viarotel-escrcpy
@@ -15,7 +13,7 @@ - ⚡️ 性能:30~120 帧每秒,取决于设备 - 🌟 质量:1920×1080 或更高 - 🕒 低延迟:35~70 毫秒 -- 🚀 快速启动:显示第一张图片仅需约1秒钟 +- 🚀 快速启动:显示第一张图片仅需约 1 秒钟 - 🙅‍♂️ 非侵入性:不会在安卓设备上留下任何安装文件 - 🤩 用户收益:无需账户、无广告、无需互联网连接 - 🗽 自由:免费且开源软件 @@ -39,7 +37,7 @@ > 注意:如果首次无线连接失败,你可能需要无线配对请参阅 [常见问题](#常见问题) > -> 注意:需同时开启无线调试功能,并在无线调试页面中获取你的当前设备的无线地址(通常为你连接WIFI时分配的IP地址)及端口号(默认为 5555) +> 注意:需同时开启无线调试功能,并在无线调试页面中获取你的当前设备的无线地址(通常为你连接 WIFI 时分配的 IP 地址)及端口号(默认为 5555) 1. 同 USB 连接中的 1-2 步骤 2. 将获取到的设备 IP 地址及端口号填写到 Escrcpy 中,然后点击连接设备 @@ -54,29 +52,43 @@ > 持续完善中 目前支持 Scrcpy 中以下常用配置 -### 显示配置 +### 视频控制 - 分辨率 - 比特率 - 刷新率 -- 屏幕旋转 - 视频解码器 - 视频编码器 +- 屏幕旋转 +- 屏幕裁剪 +- 多显示器 +- 视频缓冲 +- 音频缓冲 +- 接收器(v4l2)缓冲 +- 禁用视频 ### 设备控制 -- 保持设备清醒 -- 连接设备后自动关闭屏幕 - -### 音频控制 - -- 镜像时禁用音频 +- 展示触摸点 +- 保持清醒 +- 控制时关闭屏幕 +- 控制结束关闭屏幕 +- 控制时停止充电 ### 窗口控制 - 无边框模式 - 全屏幕模式 +### 音视频录制 + +- 文件保存路径 +- 录制视频格式 + +### 音频控制 + +- 禁用音频 + ## 下一步做什么? > 优先级从高到低 @@ -85,10 +97,11 @@ 2. 内置的软件更新功能 ✅ 3. 录制和保存音视频 ✅ 4. 添加设备快捷交互控制栏 ✅ -5. 支持自定义 Adb 及 Scrcpy 依赖,并支持生成精简版本和完整版本以满足不同用户需求 -6. 添加 macOS 及 linux 操作系统的支持 🚧 -7. 支持语言国际化功能 🚧 -8. 添加对游戏的增强功能,如游戏键位映射 🚧 +5. 支持自定义 Adb 及 Scrcpy 依赖,并支持生成精简版本和完整版本以满足不同用户需求 🚧 +6. 支持自定义设备名称,以及用户配置的导出及导入 🚧 +7. 添加 macOS 及 linux 操作系统的支持 🚧 +8. 支持语言国际化功能 🚧 +9. 添加对游戏的增强功能,如游戏键位映射 🚧 ## 常见问题 @@ -102,7 +115,7 @@ 该问题是已知的, Scrcpy 似乎并未直接对中文输入进行测试和支持 需要在手机端安装第三方输入法 以下输入法经测试可以很好支持 - 搜狗输入法 -- QQ输入法 +- QQ 输入法 - 谷歌拼音输入法 - Gboard @@ -115,7 +128,7 @@ ### 无线连接提示: 目标计算机积极拒绝访问 -第一次无线连接可能需要配对 或 插入USB 以保证与电脑建立连接即授权成功后方可使用 +第一次无线连接可能需要配对 或 插入 USB 以保证与电脑建立连接即授权成功后方可使用 ### 通过数据线连接后点击无线模式没有反应 @@ -148,6 +161,8 @@ > 如果该项目帮到你的话,可以请我吃包辣条,可以使我更有动力完善该项目 +> 注意:非 BUG 或计划外的需求,有偿处理;至于金额,根据问题难易程度,你觉得帮助了多少,看着给吧(维护这些项目已经耗费了大量精力,还要免费花时间解答问题就说不过去了吧...所以白嫖的一律不通过。) +
viarotel-wepay viarotel-alipay diff --git a/binary.js b/binary.js deleted file mode 100644 index 74c26b4d..00000000 --- a/binary.js +++ /dev/null @@ -1,10 +0,0 @@ -export default function VitePluginPath() { - return { - name: 'vite-plugin-path', - transform(src, id) { - if (id.endsWith('?path')) { - return `export default ${JSON.stringify(id.slice(0, -5))}` - } - }, - } -} diff --git a/electron-builder.json b/electron-builder.json index 4b466c09..0ce07f4e 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json", "appId": "org.viarotel.escrcpy", "asar": true, - "productName": "escrcpy", + "productName": "Escrcpy", "directories": { "output": "dist-release/${version}", "buildResources": "electron/resources/build" @@ -16,10 +16,20 @@ "updaterCacheDirName": "escrcpy-updater" }, "mac": { + "icon": "logo.icns", "target": ["dmg"], - "artifactName": "${productName}-${version}-mac-installer.${ext}" + "artifactName": "${productName}-${version}-mac-installer.${ext}", + "entitlementsInherit": "electron/resources/build/entitlements.mac.plist", + "extendInfo": { + "NSCameraUsageDescription": "Application requests access to the device's camera.", + "NSMicrophoneUsageDescription": "Application requests access to the device's microphone.", + "NSDocumentsFolderUsageDescription": "Application requests access to the user's Documents folder.", + "NSDownloadsFolderUsageDescription": "Application requests access to the user's Downloads folder." + }, + "notarize": false }, "win": { + "icon": "logo.ico", "target": [ { "target": "nsis", @@ -45,7 +55,9 @@ "requestExecutionLevel": "user" }, "linux": { + "icon": "logo.png", "target": ["AppImage"], "artifactName": "${productName}-${version}-linux.${ext}" - } + }, + "npmRebuild": false } diff --git a/electron/exposes/adbkit/index.js b/electron/exposes/adbkit/index.js index 1adfc357..41780d71 100644 --- a/electron/exposes/adbkit/index.js +++ b/electron/exposes/adbkit/index.js @@ -98,7 +98,7 @@ const watch = async (callback) => { export default () => { client = Adb.createClient({ bin: adbPath }) - console.log('client', client) + // console.log('client', client) return { shell, diff --git a/electron/main.js b/electron/main.js index 41a57343..6c42c724 100644 --- a/electron/main.js +++ b/electron/main.js @@ -2,12 +2,14 @@ import path from 'node:path' import { BrowserWindow, app, shell } from 'electron' import { electronApp, optimizer } from '@electron-toolkit/utils' -import logoPath from '@resources/extra/icons/logo.png?path' -import icoLogoPath from '@resources/extra/icons/logo.ico?path' -import icnsLogoPath from '@resources/extra/icons/logo.icns?path' +import logoPath from '@resources/build/logo.png?path' +import icoLogoPath from '@resources/build/logo.ico?path' +import icnsLogoPath from '@resources/build/logo.icns?path' import events from './events/index.js' +console.log('logoPath', logoPath) + // The built directory structure // // ├─┬─┬ dist diff --git a/electron/resources/build/entitlements.mac.plist b/electron/resources/build/entitlements.mac.plist new file mode 100644 index 00000000..38c887b2 --- /dev/null +++ b/electron/resources/build/entitlements.mac.plist @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.allow-dyld-environment-variables + + + diff --git a/electron/resources/extra/icons/logo.icns b/electron/resources/build/logo.icns similarity index 100% rename from electron/resources/extra/icons/logo.icns rename to electron/resources/build/logo.icns diff --git a/electron/resources/extra/icons/logo.ico b/electron/resources/build/logo.ico similarity index 100% rename from electron/resources/extra/icons/logo.ico rename to electron/resources/build/logo.ico diff --git a/electron/resources/extra/icons/logo.png b/electron/resources/build/logo.png similarity index 100% rename from electron/resources/extra/icons/logo.png rename to electron/resources/build/logo.png diff --git a/package.json b/package.json index 695e3e6a..6ac74d84 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,12 @@ "scripts": { "dev": "vite", "build": "vite build && electron-builder", + "build:win": "vite build && electron-builder --win", + "build:mac": "vite build && electron-builder --mac", + "build:linux": "vite build && electron-builder --linux", "preview": "vite preview", - "lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix" + "lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix", + "postinstall": "electron-builder install-app-deps" }, "dependencies": { "vue": "^3.3.4" @@ -23,6 +27,7 @@ "@viarotel-org/eslint-config": "^0.7.0", "@viarotel-org/postcss-config": "^0.7.0", "@viarotel-org/unocss-config": "^0.7.4", + "@viarotel-org/vite-plugin-path": "^0.8.1", "@vitejs/plugin-vue": "^4.3.4", "dayjs": "^1.11.10", "electron": "^26.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db25b4ad..1d06f3d5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,6 +31,9 @@ devDependencies: '@viarotel-org/unocss-config': specifier: ^0.7.4 version: 0.7.4(postcss@8.4.31)(vite@4.4.11) + '@viarotel-org/vite-plugin-path': + specifier: ^0.8.1 + version: 0.8.1 '@vitejs/plugin-vue': specifier: ^4.3.4 version: 4.4.0(vite@4.4.11)(vue@3.3.4) @@ -1370,6 +1373,20 @@ packages: - vite dev: true + /@viarotel-org/vite-plugin-path@0.8.1: + resolution: {integrity: sha512-sS3ovVk5tpS08ShtL9HMJxyWge5Oq0kn610xxxihYj2GrlhOqDeKDD+zp0ebhuO6E8dMmlWQctCfnyOVeBYaUQ==} + dependencies: + vite: 4.4.11 + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - terser + dev: true + /@vitejs/plugin-vue@4.4.0(vite@4.4.11)(vue@3.3.4): resolution: {integrity: sha512-xdguqb+VUwiRpSg+nsc2HtbAUSGak25DXYvpQQi4RVU1Xq1uworyoH/md9Rfd8zMmPR/pSghr309QNcftUVseg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -2137,7 +2154,7 @@ packages: supports-color: optional: true dependencies: - ms: 2.1.2 + ms: 2.1.3 dev: true /debug@4.3.4: @@ -2500,7 +2517,6 @@ packages: /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - requiresBuild: true dev: true /eslint-compat-utils@0.1.2(eslint@8.51.0): @@ -3254,7 +3270,6 @@ packages: /has@1.0.4: resolution: {integrity: sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==} engines: {node: '>= 0.4.0'} - requiresBuild: true dev: true /he@1.2.0: @@ -3838,6 +3853,10 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + /muggle-string@0.3.1: resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} dev: true @@ -4169,7 +4188,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.31 - yaml: 2.3.2 + yaml: 2.3.3 dev: true /postcss-nested@6.0.1(postcss@8.4.31): @@ -5132,11 +5151,11 @@ packages: dependencies: eslint-visitor-keys: 3.4.3 lodash: 4.17.21 - yaml: 2.3.2 + yaml: 2.3.3 dev: true - /yaml@2.3.2: - resolution: {integrity: sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==} + /yaml@2.3.3: + resolution: {integrity: sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==} engines: {node: '>= 14'} dev: true diff --git a/public/electron-vite.animate.svg b/public/electron-vite.animate.svg deleted file mode 100644 index 864b1f61..00000000 --- a/public/electron-vite.animate.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb1..00000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/store/scrcpy/model/record/index.js b/src/store/scrcpy/model/record/index.js index d120371c..13e18543 100644 --- a/src/store/scrcpy/model/record/index.js +++ b/src/store/scrcpy/model/record/index.js @@ -3,7 +3,7 @@ export default () => { return [ { - label: '文件存储地址', + label: '文件保存路径', type: 'input.directory', field: '--record', value: $path.resolve('../'), diff --git a/vite.config.js b/vite.config.js index d1b495c3..213f2a3c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,7 +6,7 @@ import useRenderer from 'vite-plugin-electron-renderer' import useVue from '@vitejs/plugin-vue' import useEslint from 'vite-plugin-eslint' import useUnoCSS from 'unocss/vite' -import usePath from './binary.js' +import usePath from '@viarotel-org/vite-plugin-path' const merge = config => mergeConfig(