refactor: ✨ 采用新的开发架构
@ -1,9 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
@ -1,12 +1,10 @@
|
||||
/* eslint-env node */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
|
||||
module.exports = {
|
||||
extends: ['@electron-toolkit', '@viarotel-org'],
|
||||
extends: ['@viarotel-org'],
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'eqeqeq': 'off',
|
||||
'prefer-promise-reject-errors': 'off',
|
||||
'antfu/top-level-function': 'off',
|
||||
'import/default': 'off',
|
||||
},
|
||||
}
|
||||
|
26
.gitignore
vendored
@ -1,4 +1,26 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
out
|
||||
*.log*
|
||||
dist-ssr
|
||||
dist-electron
|
||||
release
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
@ -1,6 +0,0 @@
|
||||
out
|
||||
dist
|
||||
pnpm-lock.yaml
|
||||
LICENSE.md
|
||||
jsconfig.json
|
||||
jsconfig.*.json
|
@ -1,4 +0,0 @@
|
||||
singleQuote: true
|
||||
semi: false
|
||||
printWidth: 100
|
||||
trailingComma: none
|
2
.vscode/extensions.json
vendored
@ -1,3 +1,3 @@
|
||||
{
|
||||
"recommendations": ["dbaeumer.vscode-eslint"]
|
||||
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
|
||||
}
|
||||
|
39
.vscode/launch.json
vendored
@ -1,39 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug Main Process",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
|
||||
},
|
||||
"runtimeArgs": ["--sourcemap"],
|
||||
"env": {
|
||||
"REMOTE_DEBUGGING_PORT": "9222"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Debug Renderer Process",
|
||||
"port": 9222,
|
||||
"request": "attach",
|
||||
"type": "chrome",
|
||||
"webRoot": "${workspaceFolder}/src/renderer",
|
||||
"timeout": 60000,
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Debug All",
|
||||
"configurations": ["Debug Main Process", "Debug Renderer Process"],
|
||||
"presentation": {
|
||||
"order": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
21
CHANGELOG.md
@ -1,5 +1,26 @@
|
||||
# Changelog
|
||||
|
||||
## [1.6.2](https://github.com/viarotel-org/escrcpy/compare/v1.6.1...v1.6.2) (2023-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 修复USB未授权设备导致无线连接地址变为假值的问题 ([9c25325](https://github.com/viarotel-org/escrcpy/commit/9c25325d672a3447df21abe9bc01a7c22b440ec9))
|
||||
|
||||
## [1.6.1](https://github.com/viarotel-org/escrcpy/compare/v1.6.0...v1.6.1) (2023-10-13)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* 🔨 自定义通用的文件存储路径相关逻辑完善 ([8455e86](https://github.com/viarotel-org/escrcpy/commit/8455e8692be67bc947f76ebcbd4ea4f476ccbca4))
|
||||
|
||||
## [1.6.0](https://github.com/viarotel-org/escrcpy/compare/v1.5.3...v1.6.0) (2023-10-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 🚀 增加了对设备交互控制栏的支持 ([fd20736](https://github.com/viarotel-org/escrcpy/commit/fd207364a4cb68e352b594bf2d55905e53949a33))
|
||||
|
||||
## [1.5.3](https://github.com/viarotel-org/escrcpy/compare/v1.5.2...v1.5.3) (2023-10-13)
|
||||
|
||||
|
||||
|
156
README.md
@ -1,152 +1,18 @@
|
||||
# Escrcpy
|
||||
# Vue 3 + TypeScript + Vite
|
||||
|
||||
📱 使用图形界面的 Scrcpy 显示和控制您的 Android 设备,由 Electron 驱动
|
||||
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
||||
|
||||
📱 Use Scrcpy with a graphical interface to display and control your Android device, driven by Electron
|
||||
## Recommended IDE Setup
|
||||
|
||||
<div style="display:flex;">
|
||||
<img src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/570065a5683b4cf7af9cfa9743c06ab4~tplv-k3u1fbpfcp-jj-mark:0:0:0:0:q75.image#?w=1360&h=693&s=140693&e=jpg&b=ffffff" alt="viarotel-escrcpy" style="width: 100%;">
|
||||
</div>
|
||||
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
|
||||
## 特点
|
||||
## Type Support For `.vue` Imports in TS
|
||||
|
||||
- 🏃 同步:得益于 Web 技术,将更快速的与 Scrcpy 保持同步
|
||||
- 😎 轻巧度:本机支持,仅显示设备屏幕
|
||||
- ⚡️ 性能:30~120 帧每秒,取决于设备
|
||||
- 🌟 质量:1920×1080 或更高
|
||||
- 🕒 低延迟:35~70 毫秒
|
||||
- 🚀 快速启动:显示第一张图片仅需约1秒钟
|
||||
- 🙅♂️ 非侵入性:不会在安卓设备上留下任何安装文件
|
||||
- 🤩 用户收益:无需账户、无广告、无需互联网连接
|
||||
- 🗽 自由:免费且开源软件
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
## 获取软件包
|
||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
||||
|
||||
[查看发布地址](https://github.com/viarotel-org/escrcpy/releases)
|
||||
|
||||
## 快速上手
|
||||
|
||||
### USB 连接
|
||||
|
||||
> 注意:如果手机上提示调试授权请点击允许
|
||||
|
||||
1. 安卓手机需开启开发者模式并打开 USB 调试
|
||||
2. 打开 Escrcpy 并将安卓手机连接到你的电脑
|
||||
3. 这时 Escrcpy 设备列表应该已经检测到你的手机,点击开始镜像
|
||||
4. 开始享受吧
|
||||
|
||||
### WIFI 连接
|
||||
|
||||
> 注意:如果首次无线连接失败,你可能需要无线配对请参阅 [常见问题](#常见问题)
|
||||
>
|
||||
> 注意:需同时开启无线调试功能,并在无线调试页面中获取你的当前设备的无线地址(通常为你连接WIFI时分配的IP地址)及端口号(默认为 5555)
|
||||
|
||||
1. 同 USB 连接中的 1-2 步骤
|
||||
2. 将获取到的设备 IP 地址及端口号填写到 Escrcpy 中,然后点击连接设备
|
||||
3. 这时 Escrcpy 设备列表应该已经检测到你的手机,点击开始镜像
|
||||
4. 开始享受吧
|
||||
|
||||
## 快捷键
|
||||
|
||||
请参阅 [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master/doc/shortcuts.md)
|
||||
|
||||
## 高级配置
|
||||
|
||||
> 持续完善中 目前支持 Scrcpy 中以下常用配置
|
||||
|
||||
### 显示配置
|
||||
|
||||
- 分辨率
|
||||
- 比特率
|
||||
- 刷新率
|
||||
- 屏幕旋转
|
||||
- 视频解码器
|
||||
- 视频编码器
|
||||
|
||||
### 设备控制
|
||||
|
||||
- 保持设备清醒
|
||||
- 连接设备后自动关闭屏幕
|
||||
|
||||
### 音频控制
|
||||
|
||||
- 镜像时禁用音频
|
||||
|
||||
### 窗口控制
|
||||
|
||||
- 无边框模式
|
||||
- 全屏幕模式
|
||||
|
||||
## 下一步做什么?
|
||||
|
||||
> 优先级从高到低
|
||||
|
||||
1. 用户界面进行优化,制作合适的 Logo ✅
|
||||
2. 内置的软件更新功能 ✅
|
||||
3. 录制和保存音视频 ✅
|
||||
4. 添加设备快捷交互控制栏 ✅
|
||||
5. 支持自定义 Adb 及 Scrcpy 依赖,并支持生成精简版本和完整版本以满足不同用户需求
|
||||
6. 添加 macOS 及 linux 操作系统的支持 🚧
|
||||
7. 支持语言国际化功能 🚧
|
||||
8. 添加对游戏的增强功能,如游戏键位映射 🚧
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 电脑连接设备后无法检测到
|
||||
|
||||
1. 请重新插拔你的设备,并确认设备同意了 USB 调试授权窗口。
|
||||
2. 如果还不行,你的电脑可能缺少必要的驱动程序,请使用第三方工具 如:驱动精灵,安装必要的驱动后重试。
|
||||
|
||||
### 无法输入中文
|
||||
|
||||
该问题是已知的, Scrcpy 似乎并未直接对中文输入进行测试和支持 需要在手机端安装第三方输入法 以下输入法经测试可以很好支持
|
||||
|
||||
- 搜狗输入法
|
||||
- QQ输入法
|
||||
- 谷歌拼音输入法
|
||||
- Gboard
|
||||
|
||||
### 没有控制栏,无法通过点击返回上一步及桌面问题
|
||||
|
||||
> 后期会增加支持 目前可以使用以下方法
|
||||
|
||||
1. 在高级设置中开启 设备控制 => 虚拟控制栏 (如果该配置不起作用则需要在设备上手动开启)
|
||||
2. 通过快捷键,请参阅 [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master/doc/shortcuts.md)
|
||||
|
||||
### 无线连接提示: 目标计算机积极拒绝访问
|
||||
|
||||
第一次无线连接可能需要配对 或 插入USB 以保证与电脑建立连接即授权成功后方可使用
|
||||
|
||||
### 通过数据线连接后点击无线模式没有反应
|
||||
|
||||
请再点一次,或点击刷新设备,一般不会超过两次,如果还不行,请提供机型和安卓版本信息到 [Issues](https://github.com/viarotel-org/escrcpy/issues)
|
||||
|
||||
### 设备交互控制栏为什么不设计为自动跟踪吸附的悬浮菜单?
|
||||
|
||||
采用悬浮菜单方案不可避免地会增加对 Scrcpy 的耦合性,并增加与 Scrcpy 同步更新的难度。许多类似的 ScrcpyGUI 软件在使用此方案后不得不投入大量精力,最终因难以维护而放弃开发。因此,综合考虑,我们决定采用现有的方案,并期待 Scrcpy 未来能够增加原生交互控制栏的支持。
|
||||
|
||||
## 获得帮助
|
||||
|
||||
> 因为是开源项目 全靠爱发电 所以支持有限 更新节奏不固定
|
||||
|
||||
- issues: [反馈问题](https://github.com/viarotel-org/escrcpy/issues)
|
||||
- email: viarotel@qq.com
|
||||
- weixin: viarotel
|
||||
- qq: 523469508
|
||||
|
||||
## 致谢
|
||||
|
||||
该项目的诞生离不开以下开源项目
|
||||
|
||||
- [scrcpy](https://github.com/Genymobile/scrcpy)
|
||||
- [adbkit](https://github.com/DeviceFarmer/adbkit)
|
||||
- [electron](https://www.electronjs.org/)
|
||||
|
||||
## 支持项目
|
||||
|
||||
> 如果该项目帮到你的话,可以请我吃包辣条,可以使我更有动力完善该项目
|
||||
|
||||
<div style="display:flex;">
|
||||
<img src="https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/79dcbc40246743e2b6870419e88e0392~tplv-k3u1fbpfcp-watermark.image?" alt="viarotel-wepay" style="width: 36%;">
|
||||
<img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/1e5e69b83dd746deade95afd4a6864ec~tplv-k3u1fbpfcp-watermark.image?" alt="viarotel-alipay" style="width: 36%;">
|
||||
</div>
|
||||
1. Disable the built-in TypeScript Extension
|
||||
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
||||
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
||||
|
10
binary.js
Normal file
@ -0,0 +1,10 @@
|
||||
export default function CustomPlugin() {
|
||||
return {
|
||||
name: 'vite-plugin-path',
|
||||
transform(src, id) {
|
||||
if (id.endsWith('?path')) {
|
||||
return `export default ${JSON.stringify(id.slice(0, -5))}`
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@ -1,4 +0,0 @@
|
||||
provider: github
|
||||
owner: viarotel-org
|
||||
repo: escrcpy
|
||||
updaterCacheDirName: escrcpy-updater
|
48
electron-builder.json5
Normal file
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @see https://www.electron.build/configuration/configuration
|
||||
*/
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
|
||||
"appId": "YourAppID",
|
||||
"asar": true,
|
||||
"productName": "YourAppName",
|
||||
"directories": {
|
||||
"output": "release/${version}"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"dist-electron"
|
||||
],
|
||||
"extraResources": [
|
||||
"electron/resources"
|
||||
],
|
||||
"mac": {
|
||||
"target": [
|
||||
"dmg"
|
||||
],
|
||||
"artifactName": "${productName}-Mac-${version}-Installer.${ext}"
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
],
|
||||
"artifactName": "${productName}-Windows-${version}-Setup.${ext}"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"deleteAppDataOnUninstall": false
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
"AppImage"
|
||||
],
|
||||
"artifactName": "${productName}-Linux-${version}.${ext}"
|
||||
}
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
appId: com.electron.app
|
||||
productName: escrcpy
|
||||
directories:
|
||||
buildResources: build
|
||||
files:
|
||||
- '!**/.vscode/*'
|
||||
- '!src/*'
|
||||
- '!electron.vite.config.{js,ts,mjs,cjs}'
|
||||
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
|
||||
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
|
||||
asarUnpack:
|
||||
- resources/**
|
||||
win:
|
||||
executableName: escrcpy
|
||||
target:
|
||||
- nsis
|
||||
- zip
|
||||
- portable
|
||||
nsis:
|
||||
artifactName: ${productName}-${version}-setup.${ext}
|
||||
shortcutName: ${productName}
|
||||
uninstallDisplayName: ${productName}
|
||||
createDesktopShortcut: always
|
||||
portable:
|
||||
artifactName: '${productName}-${version}-portable.${ext}'
|
||||
requestExecutionLevel: user
|
||||
mac:
|
||||
entitlementsInherit: 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
|
||||
dmg:
|
||||
artifactName: ${name}-${version}.${ext}
|
||||
linux:
|
||||
target:
|
||||
- AppImage
|
||||
- snap
|
||||
- deb
|
||||
maintainer: electronjs.org
|
||||
category: Utility
|
||||
appImage:
|
||||
artifactName: ${name}-${version}.${ext}
|
||||
npmRebuild: false
|
||||
publish:
|
||||
provider: github
|
||||
owner: viarotel-org
|
||||
repo: escrcpy
|
||||
updaterCacheDirName: escrcpy-updater
|
@ -1,37 +0,0 @@
|
||||
import { resolve } from 'node:path'
|
||||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import useEslint from 'vite-plugin-eslint'
|
||||
import useUnoCSS from 'unocss/vite'
|
||||
import postcssConfig from '@viarotel-org/postcss-config'
|
||||
|
||||
export default defineConfig({
|
||||
main: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@root': resolve('./'),
|
||||
},
|
||||
},
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
},
|
||||
preload: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@resources': resolve('resources'),
|
||||
},
|
||||
},
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
},
|
||||
renderer: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@root': resolve('./'),
|
||||
'@renderer': resolve('src/renderer/src'),
|
||||
},
|
||||
},
|
||||
plugins: [useEslint(), vue(), useUnoCSS()],
|
||||
css: {
|
||||
postcss: postcssConfig(),
|
||||
},
|
||||
},
|
||||
})
|
74
electron/main.js
Normal file
@ -0,0 +1,74 @@
|
||||
import path from 'node:path'
|
||||
import { BrowserWindow, app } from 'electron'
|
||||
import ipcManage from './ipcManage/index.js'
|
||||
|
||||
// The built directory structure
|
||||
//
|
||||
// ├─┬─┬ dist
|
||||
// │ │ └── index.html
|
||||
// │ │
|
||||
// │ ├─┬ dist-electron
|
||||
// │ │ ├── main.js
|
||||
// │ │ └── preload.js
|
||||
// │
|
||||
process.env.DIST = path.join(__dirname, '../dist')
|
||||
process.env.VITE_PUBLIC = app.isPackaged
|
||||
? process.env.DIST
|
||||
: path.join(process.env.DIST, '../public')
|
||||
|
||||
let mainWindow
|
||||
// 🚧 Use ['ENV_NAME'] avoid vite:define plugin - Vite@2.x
|
||||
const VITE_DEV_SERVER_URL = process.env.VITE_DEV_SERVER_URL
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
icon: path.join(process.env.VITE_PUBLIC, 'electron-vite.svg'),
|
||||
minWidth: 1000,
|
||||
minHeight: 700,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
// nodeIntegration: true,
|
||||
// contextIsolation: false,
|
||||
preload: path.join(__dirname, './preload.js'),
|
||||
sandbox: false,
|
||||
},
|
||||
})
|
||||
|
||||
// Test active push message to Renderer-process.
|
||||
mainWindow.webContents.on('did-finish-load', () => {
|
||||
mainWindow?.webContents.send(
|
||||
'main-process-message',
|
||||
new Date().toLocaleString(),
|
||||
)
|
||||
})
|
||||
|
||||
if (VITE_DEV_SERVER_URL) {
|
||||
mainWindow.loadURL(VITE_DEV_SERVER_URL)
|
||||
}
|
||||
else {
|
||||
// win.loadFile('dist/index.html')
|
||||
mainWindow.loadFile(path.join(process.env.DIST, 'index.html'))
|
||||
}
|
||||
|
||||
ipcManage(mainWindow)
|
||||
}
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
mainWindow = null
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
// On OS X it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
app.whenReady().then(createWindow)
|
@ -4,7 +4,9 @@ import path from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
import dayjs from 'dayjs'
|
||||
import { Adb } from '@devicefarmer/adbkit'
|
||||
import adbPath from '@resources/core/adb.exe?asset&asarUnpack'
|
||||
import adbPath from '@resources/core/adb.exe?path'
|
||||
|
||||
console.log('adbPath', adbPath)
|
||||
|
||||
const exec = util.promisify(child_process.exec)
|
||||
|
||||
@ -18,7 +20,8 @@ window.addEventListener('beforeunload', () => {
|
||||
|
||||
const shell = async command => exec(`${adbPath} ${command}`)
|
||||
const getDevices = async () => await client.listDevicesWithPaths()
|
||||
const deviceShell = async (id, command) => await client.getDevice(id).shell(command)
|
||||
const deviceShell = async (id, command) =>
|
||||
await client.getDevice(id).shell(command)
|
||||
const kill = async (...params) => await client.kill(...params)
|
||||
const connect = async (...params) => await client.connect(...params)
|
||||
const disconnect = async (...params) => await client.disconnect(...params)
|
||||
@ -96,7 +99,7 @@ const watch = async (callback) => {
|
||||
}
|
||||
|
||||
export default () => {
|
||||
client = Adb.createClient({ bin: adbPath })
|
||||
client = Adb.createClient({})
|
||||
console.log('client', client)
|
||||
|
||||
return {
|
@ -6,7 +6,6 @@ import scrcpy from './scrcpy/index.js'
|
||||
export default {
|
||||
install(expose) {
|
||||
expose('nodePath', path)
|
||||
|
||||
expose('electron', electron())
|
||||
expose('adbkit', adbkit())
|
||||
expose('scrcpy', scrcpy())
|
@ -1,7 +1,7 @@
|
||||
import util from 'node:util'
|
||||
import child_process from 'node:child_process'
|
||||
import adbPath from '@resources/core/adb.exe?asset&asarUnpack'
|
||||
import scrcpyPath from '@resources/core/scrcpy.exe?asset&asarUnpack'
|
||||
import adbPath from '@resources/core/adb.exe?path'
|
||||
import scrcpyPath from '@resources/core/scrcpy.exe?path'
|
||||
|
||||
const exec = util.promisify(child_process.exec)
|
||||
|
@ -1,4 +1,6 @@
|
||||
import plugins from './plugins/index.js'
|
||||
import { exposeContext } from './helpers/index.js'
|
||||
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true'
|
||||
|
||||
plugins.install(exposeContext)
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
13
index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue + TS</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"exclude": ["node_modules", "dist", "out"],
|
||||
"include": ["src/**/*"],
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@renderer/*": ["src/renderer/src/*"],
|
||||
"@resources/*": ["resources/*"]
|
||||
}
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "dist-electron"],
|
||||
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.vue", "electron"]
|
||||
}
|
56
package.json
@ -1,52 +1,40 @@
|
||||
{
|
||||
"name": "escrcpy",
|
||||
"version": "1.5.3",
|
||||
"name": "escrcpy-next",
|
||||
"version": "1.6.2",
|
||||
"private": true,
|
||||
"description": "Scrcpy Powered by Electron",
|
||||
"author": "viarotel",
|
||||
"homepage": "https://github.com/viarotel-org/escrcpy",
|
||||
"main": "./out/main/index.js",
|
||||
"main": "dist-electron/main.js",
|
||||
"scripts": {
|
||||
"format": "prettier --write .",
|
||||
"lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix",
|
||||
"start": "electron-vite preview",
|
||||
"dev": "electron-vite dev",
|
||||
"build": "electron-vite build",
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"build:win": "npm run build && electron-builder --win --config",
|
||||
"build:mac": "npm run build && electron-builder --mac --config",
|
||||
"build:linux": "npm run build && electron-builder --linux --config"
|
||||
"dev": "vite",
|
||||
"build": "vite build && electron-builder",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@devicefarmer/adbkit": "^3.2.5",
|
||||
"@electron-toolkit/preload": "^2.0.0",
|
||||
"@electron-toolkit/utils": "^2.0.0",
|
||||
"@viarotel-org/design": "^0.7.0",
|
||||
"dayjs": "^1.11.10",
|
||||
"electron-updater": "^6.1.1",
|
||||
"element-plus": "^2.3.14",
|
||||
"fs-extra": "^11.1.1",
|
||||
"lodash-es": "^4.17.21",
|
||||
"pinia": "^2.1.6",
|
||||
"ufo": "^1.3.1"
|
||||
"vue": "^3.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-toolkit/eslint-config": "^1.0.1",
|
||||
"@rushstack/eslint-patch": "^1.3.3",
|
||||
"@devicefarmer/adbkit": "^3.2.5",
|
||||
"@electron-toolkit/preload": "^2.0.0",
|
||||
"@electron-toolkit/utils": "^2.0.1",
|
||||
"@viarotel-org/design": "^0.7.0",
|
||||
"@viarotel-org/eslint-config": "^0.7.0",
|
||||
"@viarotel-org/postcss-config": "^0.7.0",
|
||||
"@viarotel-org/unocss-config": "^0.7.4",
|
||||
"@vitejs/plugin-vue": "^4.3.1",
|
||||
"@vue/eslint-config-prettier": "^8.0.0",
|
||||
"electron": "^25.6.0",
|
||||
"@vitejs/plugin-vue": "^4.3.4",
|
||||
"dayjs": "^1.11.10",
|
||||
"electron": "^26.1.0",
|
||||
"electron-builder": "^24.6.4",
|
||||
"electron-vite": "^1.0.28",
|
||||
"eslint": "8.49.0",
|
||||
"eslint-plugin-vue": "^9.17.0",
|
||||
"less": "^4.2.0",
|
||||
"prettier": "^3.0.2",
|
||||
"electron-updater": "^6.1.4",
|
||||
"element-plus": "^2.4.0",
|
||||
"pinia": "^2.1.7",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.4.9",
|
||||
"vite-plugin-electron": "^0.14.0",
|
||||
"vite-plugin-electron-renderer": "^0.14.5",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vue": "^3.3.4"
|
||||
"vue-tsc": "^1.8.8"
|
||||
}
|
||||
}
|
||||
|
1727
pnpm-lock.yaml
generated
34
public/electron-vite.animate.svg
Normal file
@ -0,0 +1,34 @@
|
||||
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M63.9202 127.84C99.2223 127.84 127.84 99.2223 127.84 63.9202C127.84 28.6181 99.2223 0 63.9202 0C28.6181 0 0 28.6181 0 63.9202C0 99.2223 28.6181 127.84 63.9202 127.84Z" fill="url(#paint0_linear_103_2)"/>
|
||||
<g id="not-lightning" clip-path="url(#clip0_103_2)">
|
||||
<animateTransform
|
||||
attributeName="transform"
|
||||
attributeType="XML"
|
||||
type="rotate"
|
||||
from="0 64 64"
|
||||
to="360 64 64"
|
||||
dur="20s"
|
||||
repeatCount="indefinite"/>
|
||||
<path d="M51.3954 39.5028C52.3733 39.6812 53.3108 39.033 53.4892 38.055C53.6676 37.0771 53.0194 36.1396 52.0414 35.9612L51.3954 39.5028ZM28.9393 60.9358C29.4332 61.7985 30.5329 62.0976 31.3957 61.6037C32.2585 61.1098 32.5575 60.0101 32.0636 59.1473L28.9393 60.9358ZM37.6935 66.7457C37.025 66.01 35.8866 65.9554 35.1508 66.6239C34.415 67.2924 34.3605 68.4308 35.029 69.1666L37.6935 66.7457ZM96.9206 89.515C97.7416 88.9544 97.9526 87.8344 97.3919 87.0135C96.8313 86.1925 95.7113 85.9815 94.8904 86.5422L96.9206 89.515ZM52.0414 35.9612C46.4712 34.9451 41.2848 34.8966 36.9738 35.9376C32.6548 36.9806 29.0841 39.1576 27.0559 42.6762L30.1748 44.4741C31.5693 42.0549 34.1448 40.3243 37.8188 39.4371C41.5009 38.5479 46.1547 38.5468 51.3954 39.5028L52.0414 35.9612ZM27.0559 42.6762C24.043 47.9029 25.2781 54.5399 28.9393 60.9358L32.0636 59.1473C28.6579 53.1977 28.1088 48.0581 30.1748 44.4741L27.0559 42.6762ZM35.029 69.1666C39.6385 74.24 45.7158 79.1355 52.8478 83.2597L54.6499 80.1432C47.8081 76.1868 42.0298 71.5185 37.6935 66.7457L35.029 69.1666ZM52.8478 83.2597C61.344 88.1726 70.0465 91.2445 77.7351 92.3608C85.359 93.4677 92.2744 92.6881 96.9206 89.515L94.8904 86.5422C91.3255 88.9767 85.4902 89.849 78.2524 88.7982C71.0793 87.7567 62.809 84.8612 54.6499 80.1432L52.8478 83.2597ZM105.359 84.9077C105.359 81.4337 102.546 78.6127 99.071 78.6127V82.2127C100.553 82.2127 101.759 83.4166 101.759 84.9077H105.359ZM99.071 78.6127C95.5956 78.6127 92.7831 81.4337 92.7831 84.9077H96.3831C96.3831 83.4166 97.5892 82.2127 99.071 82.2127V78.6127ZM92.7831 84.9077C92.7831 88.3817 95.5956 91.2027 99.071 91.2027V87.6027C97.5892 87.6027 96.3831 86.3988 96.3831 84.9077H92.7831ZM99.071 91.2027C102.546 91.2027 105.359 88.3817 105.359 84.9077H101.759C101.759 86.3988 100.553 87.6027 99.071 87.6027V91.2027Z" fill="#A2ECFB"/>
|
||||
<path d="M91.4873 65.382C90.8456 66.1412 90.9409 67.2769 91.7002 67.9186C92.4594 68.5603 93.5951 68.465 94.2368 67.7058L91.4873 65.382ZM84.507 35.2412C83.513 35.2282 82.6967 36.0236 82.6838 37.0176C82.6708 38.0116 83.4661 38.8279 84.4602 38.8409L84.507 35.2412ZM74.9407 39.8801C75.9127 39.6716 76.5315 38.7145 76.323 37.7425C76.1144 36.7706 75.1573 36.1517 74.1854 36.3603L74.9407 39.8801ZM25.5491 80.9047C25.6932 81.8883 26.6074 82.5688 27.5911 82.4247C28.5747 82.2806 29.2552 81.3664 29.1111 80.3828L25.5491 80.9047ZM94.2368 67.7058C97.8838 63.3907 100.505 58.927 101.752 54.678C103.001 50.4213 102.9 46.2472 100.876 42.7365L97.7574 44.5344C99.1494 46.9491 99.3603 50.0419 98.2974 53.6644C97.2323 57.2945 94.9184 61.3223 91.4873 65.382L94.2368 67.7058ZM100.876 42.7365C97.9119 37.5938 91.7082 35.335 84.507 35.2412L84.4602 38.8409C91.1328 38.9278 95.7262 41.0106 97.7574 44.5344L100.876 42.7365ZM74.1854 36.3603C67.4362 37.8086 60.0878 40.648 52.8826 44.8146L54.6847 47.931C61.5972 43.9338 68.5948 41.2419 74.9407 39.8801L74.1854 36.3603ZM52.8826 44.8146C44.1366 49.872 36.9669 56.0954 32.1491 62.3927C27.3774 68.63 24.7148 75.2115 25.5491 80.9047L29.1111 80.3828C28.4839 76.1026 30.4747 70.5062 35.0084 64.5802C39.496 58.7143 46.2839 52.7889 54.6847 47.931L52.8826 44.8146Z" fill="#A2ECFB"/>
|
||||
<path d="M49.0825 87.2295C48.7478 86.2934 47.7176 85.8059 46.7816 86.1406C45.8455 86.4753 45.358 87.5055 45.6927 88.4416L49.0825 87.2295ZM78.5635 96.4256C79.075 95.5732 78.7988 94.4675 77.9464 93.9559C77.0941 93.4443 75.9884 93.7205 75.4768 94.5729L78.5635 96.4256ZM79.5703 85.1795C79.2738 86.1284 79.8027 87.1379 80.7516 87.4344C81.7004 87.7308 82.71 87.2019 83.0064 86.2531L79.5703 85.1795ZM69.156 22.5301C68.2477 22.1261 67.1838 22.535 66.7799 23.4433C66.3759 24.3517 66.7848 25.4155 67.6931 25.8194L69.156 22.5301ZM45.6927 88.4416C47.5994 93.7741 50.1496 98.2905 53.2032 101.505C56.2623 104.724 59.9279 106.731 63.9835 106.731V103.131C61.1984 103.131 58.4165 101.765 55.8131 99.0249C53.2042 96.279 50.8768 92.2477 49.0825 87.2295L45.6927 88.4416ZM63.9835 106.731C69.8694 106.731 74.8921 102.542 78.5635 96.4256L75.4768 94.5729C72.0781 100.235 68.0122 103.131 63.9835 103.131V106.731ZM83.0064 86.2531C85.0269 79.7864 86.1832 72.1831 86.1832 64.0673H82.5832C82.5832 71.8536 81.4723 79.0919 79.5703 85.1795L83.0064 86.2531ZM86.1832 64.0673C86.1832 54.1144 84.4439 44.922 81.4961 37.6502C78.5748 30.4436 74.3436 24.8371 69.156 22.5301L67.6931 25.8194C71.6364 27.5731 75.3846 32.1564 78.1598 39.0026C80.9086 45.7836 82.5832 54.507 82.5832 64.0673H86.1832Z" fill="#A2ECFB"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M103.559 84.9077C103.559 82.4252 101.55 80.4127 99.071 80.4127C96.5924 80.4127 94.5831 82.4252 94.5831 84.9077C94.5831 87.3902 96.5924 89.4027 99.071 89.4027C101.55 89.4027 103.559 87.3902 103.559 84.9077Z" stroke="#A2ECFB" stroke-width="3.6" stroke-linecap="round"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M28.8143 89.4027C31.2929 89.4027 33.3023 87.3902 33.3023 84.9077C33.3023 82.4252 31.2929 80.4127 28.8143 80.4127C26.3357 80.4127 24.3264 82.4252 24.3264 84.9077C24.3264 87.3902 26.3357 89.4027 28.8143 89.4027Z" stroke="#A2ECFB" stroke-width="3.6" stroke-linecap="round"/>
|
||||
<path d="M63.9835 27.6986C66.4621 27.6986 68.4714 25.6861 68.4714 23.2036C68.4714 20.7211 66.4621 18.7086 63.9835 18.7086C61.5049 18.7086 59.4956 20.7211 59.4956 23.2036C59.4956 25.6861 61.5049 27.6986 63.9835 27.6986Z" stroke="#A2ECFB" stroke-width="3.6" stroke-linecap="round"/>
|
||||
</g>
|
||||
<path d="M70.7175 48.0096L56.3133 50.676C56.0766 50.7199 55.9013 50.9094 55.887 51.1369L55.001 65.2742C54.9801 65.6072 55.3038 65.8656 55.6478 65.7907L59.6582 64.9163C60.0334 64.8346 60.3724 65.1468 60.2953 65.5033L59.1038 71.0151C59.0237 71.386 59.3923 71.7032 59.7758 71.5932L62.2528 70.8822C62.6368 70.7721 63.0057 71.0902 62.9245 71.4615L61.031 80.1193C60.9126 80.6608 61.6751 80.9561 61.9931 80.4918L62.2055 80.1817L73.9428 58.053C74.1393 57.6825 73.8004 57.26 73.3696 57.3385L69.2417 58.0912C68.8538 58.1618 68.5237 57.8206 68.6332 57.462L71.3274 48.6385C71.437 48.2794 71.1058 47.9378 70.7175 48.0096Z" fill="url(#paint1_linear_103_2)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_103_2" x1="1.43824" y1="7.91009" x2="56.3296" y2="82.4569" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41D1FF"/>
|
||||
<stop offset="1" stop-color="#BD34FE"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_103_2" x1="60.3173" y1="48.7336" x2="64.237" y2="77.1962" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFEA83"/>
|
||||
<stop offset="0.0833333" stop-color="#FFDD35"/>
|
||||
<stop offset="1" stop-color="#FFA800"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_103_2">
|
||||
<rect width="128" height="128" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 6.9 KiB |
26
public/electron-vite.svg
Normal file
@ -0,0 +1,26 @@
|
||||
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_103_2)">
|
||||
<path d="M63.9202 127.84C99.2223 127.84 127.84 99.2223 127.84 63.9202C127.84 28.6181 99.2223 0 63.9202 0C28.6181 0 0 28.6181 0 63.9202C0 99.2223 28.6181 127.84 63.9202 127.84Z" fill="url(#paint0_linear_103_2)"/>
|
||||
<path d="M51.3954 39.5028C52.3733 39.6812 53.3108 39.033 53.4892 38.055C53.6676 37.0771 53.0194 36.1396 52.0414 35.9612L51.3954 39.5028ZM28.9393 60.9358C29.4332 61.7985 30.5329 62.0976 31.3957 61.6037C32.2585 61.1098 32.5575 60.0101 32.0636 59.1473L28.9393 60.9358ZM37.6935 66.7457C37.025 66.01 35.8866 65.9554 35.1508 66.6239C34.415 67.2924 34.3605 68.4308 35.029 69.1666L37.6935 66.7457ZM96.9206 89.515C97.7416 88.9544 97.9526 87.8344 97.3919 87.0135C96.8313 86.1925 95.7113 85.9815 94.8904 86.5422L96.9206 89.515ZM52.0414 35.9612C46.4712 34.9451 41.2848 34.8966 36.9738 35.9376C32.6548 36.9806 29.0841 39.1576 27.0559 42.6762L30.1748 44.4741C31.5693 42.0549 34.1448 40.3243 37.8188 39.4371C41.5009 38.5479 46.1547 38.5468 51.3954 39.5028L52.0414 35.9612ZM27.0559 42.6762C24.043 47.9029 25.2781 54.5399 28.9393 60.9358L32.0636 59.1473C28.6579 53.1977 28.1088 48.0581 30.1748 44.4741L27.0559 42.6762ZM35.029 69.1666C39.6385 74.24 45.7158 79.1355 52.8478 83.2597L54.6499 80.1432C47.8081 76.1868 42.0298 71.5185 37.6935 66.7457L35.029 69.1666ZM52.8478 83.2597C61.344 88.1726 70.0465 91.2445 77.7351 92.3608C85.359 93.4677 92.2744 92.6881 96.9206 89.515L94.8904 86.5422C91.3255 88.9767 85.4902 89.849 78.2524 88.7982C71.0793 87.7567 62.809 84.8612 54.6499 80.1432L52.8478 83.2597ZM105.359 84.9077C105.359 81.4337 102.546 78.6127 99.071 78.6127V82.2127C100.553 82.2127 101.759 83.4166 101.759 84.9077H105.359ZM99.071 78.6127C95.5956 78.6127 92.7831 81.4337 92.7831 84.9077H96.3831C96.3831 83.4166 97.5892 82.2127 99.071 82.2127V78.6127ZM92.7831 84.9077C92.7831 88.3817 95.5956 91.2027 99.071 91.2027V87.6027C97.5892 87.6027 96.3831 86.3988 96.3831 84.9077H92.7831ZM99.071 91.2027C102.546 91.2027 105.359 88.3817 105.359 84.9077H101.759C101.759 86.3988 100.553 87.6027 99.071 87.6027V91.2027Z" fill="#A2ECFB"/>
|
||||
<path d="M91.4873 65.382C90.8456 66.1412 90.9409 67.2769 91.7002 67.9186C92.4594 68.5603 93.5951 68.465 94.2368 67.7058L91.4873 65.382ZM84.507 35.2412C83.513 35.2282 82.6967 36.0236 82.6838 37.0176C82.6708 38.0116 83.4661 38.8279 84.4602 38.8409L84.507 35.2412ZM74.9407 39.8801C75.9127 39.6716 76.5315 38.7145 76.323 37.7425C76.1144 36.7706 75.1573 36.1517 74.1854 36.3603L74.9407 39.8801ZM25.5491 80.9047C25.6932 81.8883 26.6074 82.5688 27.5911 82.4247C28.5747 82.2806 29.2552 81.3664 29.1111 80.3828L25.5491 80.9047ZM94.2368 67.7058C97.8838 63.3907 100.505 58.927 101.752 54.678C103.001 50.4213 102.9 46.2472 100.876 42.7365L97.7574 44.5344C99.1494 46.9491 99.3603 50.0419 98.2974 53.6644C97.2323 57.2945 94.9184 61.3223 91.4873 65.382L94.2368 67.7058ZM100.876 42.7365C97.9119 37.5938 91.7082 35.335 84.507 35.2412L84.4602 38.8409C91.1328 38.9278 95.7262 41.0106 97.7574 44.5344L100.876 42.7365ZM74.1854 36.3603C67.4362 37.8086 60.0878 40.648 52.8826 44.8146L54.6847 47.931C61.5972 43.9338 68.5948 41.2419 74.9407 39.8801L74.1854 36.3603ZM52.8826 44.8146C44.1366 49.872 36.9669 56.0954 32.1491 62.3927C27.3774 68.63 24.7148 75.2115 25.5491 80.9047L29.1111 80.3828C28.4839 76.1026 30.4747 70.5062 35.0084 64.5802C39.496 58.7143 46.2839 52.7889 54.6847 47.931L52.8826 44.8146Z" fill="#A2ECFB"/>
|
||||
<path d="M49.0825 87.2295C48.7478 86.2934 47.7176 85.8059 46.7816 86.1406C45.8455 86.4753 45.358 87.5055 45.6927 88.4416L49.0825 87.2295ZM78.5635 96.4256C79.075 95.5732 78.7988 94.4675 77.9464 93.9559C77.0941 93.4443 75.9884 93.7205 75.4768 94.5729L78.5635 96.4256ZM79.5703 85.1795C79.2738 86.1284 79.8027 87.1379 80.7516 87.4344C81.7004 87.7308 82.71 87.2019 83.0064 86.2531L79.5703 85.1795ZM69.156 22.5301C68.2477 22.1261 67.1838 22.535 66.7799 23.4433C66.3759 24.3517 66.7848 25.4155 67.6931 25.8194L69.156 22.5301ZM45.6927 88.4416C47.5994 93.7741 50.1496 98.2905 53.2032 101.505C56.2623 104.724 59.9279 106.731 63.9835 106.731V103.131C61.1984 103.131 58.4165 101.765 55.8131 99.0249C53.2042 96.279 50.8768 92.2477 49.0825 87.2295L45.6927 88.4416ZM63.9835 106.731C69.8694 106.731 74.8921 102.542 78.5635 96.4256L75.4768 94.5729C72.0781 100.235 68.0122 103.131 63.9835 103.131V106.731ZM83.0064 86.2531C85.0269 79.7864 86.1832 72.1831 86.1832 64.0673H82.5832C82.5832 71.8536 81.4723 79.0919 79.5703 85.1795L83.0064 86.2531ZM86.1832 64.0673C86.1832 54.1144 84.4439 44.922 81.4961 37.6502C78.5748 30.4436 74.3436 24.8371 69.156 22.5301L67.6931 25.8194C71.6364 27.5731 75.3846 32.1564 78.1598 39.0026C80.9086 45.7836 82.5832 54.507 82.5832 64.0673H86.1832Z" fill="#A2ECFB"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M103.559 84.9077C103.559 82.4252 101.55 80.4127 99.071 80.4127C96.5924 80.4127 94.5831 82.4252 94.5831 84.9077C94.5831 87.3902 96.5924 89.4027 99.071 89.4027C101.55 89.4027 103.559 87.3902 103.559 84.9077Z" stroke="#A2ECFB" stroke-width="3.6" stroke-linecap="round"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M28.8143 89.4027C31.2929 89.4027 33.3023 87.3902 33.3023 84.9077C33.3023 82.4252 31.2929 80.4127 28.8143 80.4127C26.3357 80.4127 24.3264 82.4252 24.3264 84.9077C24.3264 87.3902 26.3357 89.4027 28.8143 89.4027Z" stroke="#A2ECFB" stroke-width="3.6" stroke-linecap="round"/>
|
||||
<path d="M63.9835 27.6986C66.4621 27.6986 68.4714 25.6861 68.4714 23.2036C68.4714 20.7211 66.4621 18.7086 63.9835 18.7086C61.5049 18.7086 59.4956 20.7211 59.4956 23.2036C59.4956 25.6861 61.5049 27.6986 63.9835 27.6986Z" stroke="#A2ECFB" stroke-width="3.6" stroke-linecap="round"/>
|
||||
<path d="M70.7175 48.0096L56.3133 50.676C56.0766 50.7199 55.9013 50.9094 55.887 51.1369L55.001 65.2742C54.9801 65.6072 55.3038 65.8656 55.6478 65.7907L59.6582 64.9163C60.0334 64.8346 60.3724 65.1468 60.2953 65.5033L59.1038 71.0151C59.0237 71.386 59.3923 71.7032 59.7758 71.5932L62.2528 70.8822C62.6368 70.7721 63.0057 71.0902 62.9245 71.4615L61.031 80.1193C60.9126 80.6608 61.6751 80.9561 61.9931 80.4918L62.2055 80.1817L73.9428 58.053C74.1393 57.6825 73.8004 57.26 73.3696 57.3385L69.2417 58.0912C68.8538 58.1618 68.5237 57.8206 68.6332 57.462L71.3274 48.6385C71.437 48.2794 71.1058 47.9378 70.7175 48.0096Z" fill="url(#paint1_linear_103_2)"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_103_2" x1="1.43824" y1="7.91009" x2="56.3296" y2="82.4569" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41D1FF"/>
|
||||
<stop offset="1" stop-color="#BD34FE"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_103_2" x1="60.3173" y1="48.7336" x2="64.237" y2="77.1962" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFEA83"/>
|
||||
<stop offset="0.0833333" stop-color="#FFDD35"/>
|
||||
<stop offset="1" stop-color="#FFA800"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_103_2">
|
||||
<rect width="128" height="128" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 6.7 KiB |
1
public/vite.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 170 KiB |
@ -8,10 +8,7 @@
|
||||
:name="item.prop"
|
||||
lazy
|
||||
>
|
||||
<component
|
||||
:is="item.prop"
|
||||
:ref="item.prop"
|
||||
/>
|
||||
<component :is="item.prop" :ref="item.prop" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="flex flex-col items-center justify-center h-full -mt-8">
|
||||
<div class="">
|
||||
<img src="@renderer/assets/icon.png" class="h-48" alt="" />
|
||||
<img src="@/assets/icon.png" class="h-48" alt="" />
|
||||
</div>
|
||||
<div class="pt-4 text-xl text-center italic text-gray-700">
|
||||
📱 使用图形化的
|
||||
@ -22,7 +22,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { version } from '@root/package.json'
|
||||
import { version } from '/package.json'
|
||||
|
||||
export default {
|
||||
data() {
|
@ -108,7 +108,7 @@
|
||||
|
||||
<script>
|
||||
import { debounce } from 'lodash-es'
|
||||
import { useScrcpyStore } from '@renderer/store/index.js'
|
||||
import { useScrcpyStore } from '@/store/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -155,6 +155,7 @@ export default {
|
||||
async handleDirectory({ field }) {
|
||||
const res = await this.$electron.ipcRenderer.invoke('show-open-dialog', {
|
||||
properties: ['openDirectory'],
|
||||
defaultPath: this.scrcpyForm[field],
|
||||
})
|
||||
|
||||
if (!res) {
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<div class="flex items-center flex-none space-x-2">
|
||||
<el-input v-model="formData.host" placeholder="192.168.0.1" class="w-86 flex-none" clearable>
|
||||
<el-input v-model="formData.host" placeholder="192.168.0.1" class="!w-86 flex-none" clearable>
|
||||
<template #prepend>
|
||||
无线连接
|
||||
</template>
|
||||
@ -15,7 +15,7 @@
|
||||
placeholder="5555"
|
||||
:min="0"
|
||||
clearable
|
||||
class="w-32 flex-none"
|
||||
class="!w-32 flex-none"
|
||||
>
|
||||
</el-input>
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
{{ row.name }}
|
||||
|
||||
<el-tag v-if="row.$wireless" type="primary" effect="light" class="ml-2">
|
||||
<el-tag v-if="row.$wireless" effect="light" class="ml-2">
|
||||
WIFI
|
||||
</el-tag>
|
||||
</div>
|
||||
@ -140,11 +140,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isIPWithPort, sleep } from '@renderer/utils/index.js'
|
||||
import storage from '@renderer/utils/storages'
|
||||
import dayjs from 'dayjs'
|
||||
import PairDialog from './PairDialog/index.vue'
|
||||
import ControlBar from './ControlBar/index.vue'
|
||||
import storage from '@/utils/storages'
|
||||
import { isIPWithPort, sleep } from '@/utils/index.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -180,7 +180,7 @@ export default {
|
||||
|
||||
this.getDeviceData()
|
||||
|
||||
if (type === 'add' && !isIPWithPort(ret.id)) {
|
||||
if (type === 'add' && !isIPWithPort(ret.id) && ret.$host) {
|
||||
this.formData = {
|
||||
...this.formData,
|
||||
host: ret.$host,
|
||||
@ -347,6 +347,7 @@ export default {
|
||||
console.log('getDeviceData.data', this.deviceList)
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
if (error.message) {
|
||||
this.$message.warning(error.message)
|
||||
}
|
@ -20,3 +20,12 @@ app.config.globalProperties.$scrcpy = window.scrcpy
|
||||
app.config.globalProperties.$path = window.nodePath
|
||||
|
||||
app.mount('#app')
|
||||
|
||||
// .$nextTick(() => {
|
||||
// // Remove Preload scripts loading
|
||||
// postMessage({ payload: 'removeLoading' }, '*')
|
||||
// // Use contextBridge
|
||||
// window.ipcRenderer.on('main-process-message', (_event, message) => {
|
||||
// console.log(message)
|
||||
// })
|
||||
// })
|
@ -1,89 +0,0 @@
|
||||
import { join } from 'node:path'
|
||||
|
||||
import { BrowserWindow, app, shell } from 'electron'
|
||||
import { electronApp, is, optimizer } from '@electron-toolkit/utils'
|
||||
|
||||
import iconPath from '../../resources/icons/icon.png?asset'
|
||||
import winIconPath from '../../resources/icons/icon.ico?asset'
|
||||
import macIconPath from '../../resources/icons/icon.icns?asset'
|
||||
|
||||
import ipcManage from './ipcManage/index.js'
|
||||
|
||||
function createWindow() {
|
||||
let icon = iconPath
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
icon = winIconPath
|
||||
}
|
||||
else if (process.platform === 'darwin') {
|
||||
icon = macIconPath
|
||||
}
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
icon,
|
||||
minWidth: 1000,
|
||||
minHeight: 700,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
},
|
||||
})
|
||||
|
||||
mainWindow.on('ready-to-show', () => {
|
||||
mainWindow.show()
|
||||
})
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
shell.openExternal(details.url)
|
||||
return { action: 'deny' }
|
||||
})
|
||||
|
||||
// HMR for renderer base on electron-vite cli.
|
||||
// Load the remote URL for development or the local html file for production.
|
||||
if (is.dev && process.env.ELECTRON_RENDERER_URL) {
|
||||
mainWindow.loadURL(process.env.ELECTRON_RENDERER_URL)
|
||||
}
|
||||
else {
|
||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
||||
}
|
||||
|
||||
ipcManage(mainWindow)
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
// Set app user model id for windows
|
||||
electronApp.setAppUserModelId('com.electron')
|
||||
|
||||
// Default open or close DevTools by F12 in development
|
||||
// and ignore CommandOrControl + R in production.
|
||||
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
|
||||
app.on('browser-window-created', (_, window) => {
|
||||
optimizer.watchWindowShortcuts(window)
|
||||
})
|
||||
|
||||
createWindow()
|
||||
|
||||
app.on('activate', () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (BrowserWindow.getAllWindows().length === 0)
|
||||
createWindow()
|
||||
})
|
||||
})
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app"s specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
@ -1,18 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Escrcpy</title>
|
||||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"
|
||||
/>
|
||||
<link rel="icon" href="/src/assets/logo.jpg" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 18 KiB |
@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import storage from '@renderer/utils/storages'
|
||||
import { pickBy } from 'lodash-es'
|
||||
import * as scrcpyModel from './model/index.js'
|
||||
import storage from '@/utils/storages/index.js'
|
||||
|
||||
/**
|
||||
* 获取 Scrcpy 默认配置
|
@ -3,11 +3,12 @@ export default () => {
|
||||
|
||||
return [
|
||||
{
|
||||
label: '录制存储路径',
|
||||
label: '文件存储地址',
|
||||
type: 'input.directory',
|
||||
field: '--record',
|
||||
value: $path.resolve('../'),
|
||||
placeholder: '默认值为执行应用的同级目录',
|
||||
tips: '截图和录制的音视频都存在这里',
|
||||
},
|
||||
{
|
||||
label: '录制视频格式',
|
45
vite.config.js
Normal file
@ -0,0 +1,45 @@
|
||||
import { resolve } from 'node:path'
|
||||
import { defineConfig } from 'vite'
|
||||
import useElectron from 'vite-plugin-electron'
|
||||
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 binary from './binary.js'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
assetsInclude: ['**/*.exe'],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve('./src'),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
useEslint(),
|
||||
useUnoCSS(),
|
||||
useVue(),
|
||||
useElectron([
|
||||
{
|
||||
entry: 'electron/main.js',
|
||||
vite: {},
|
||||
},
|
||||
{
|
||||
entry: 'electron/preload.js',
|
||||
onstart(args) {
|
||||
args.reload()
|
||||
},
|
||||
vite: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@resources': resolve('./electron/resources'),
|
||||
},
|
||||
},
|
||||
plugins: [binary()],
|
||||
},
|
||||
},
|
||||
]),
|
||||
useRenderer(),
|
||||
],
|
||||
})
|