refactor: 🚀 对目录结构和代码逻辑进行重构
20
.github/workflows/release-assets.yml
vendored
@ -49,15 +49,15 @@ jobs:
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
dist/*.exe
|
||||
dist/*.zip
|
||||
dist/*.dmg
|
||||
dist/*.AppImage
|
||||
dist/*.snap
|
||||
dist/*.deb
|
||||
dist/*.rpm
|
||||
dist/*.tar.gz
|
||||
dist/*.yml
|
||||
dist/*.blockmap
|
||||
dist-release/*.exe
|
||||
dist-release/*.zip
|
||||
dist-release/*.dmg
|
||||
dist-release/*.AppImage
|
||||
dist-release/*.snap
|
||||
dist-release/*.deb
|
||||
dist-release/*.rpm
|
||||
dist-release/*.tar.gz
|
||||
dist-release/*.yml
|
||||
dist-release/*.blockmap
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
|
2
.gitignore
vendored
@ -11,7 +11,7 @@ node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
dist-electron
|
||||
release
|
||||
dist-release
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
|
@ -1,4 +1,4 @@
|
||||
export default function CustomPlugin() {
|
||||
export default function VitePluginPath() {
|
||||
return {
|
||||
name: 'vite-plugin-path',
|
||||
transform(src, id) {
|
||||
|
4
dev-publish.yml
Normal file
@ -0,0 +1,4 @@
|
||||
provider: github
|
||||
owner: viarotel-org
|
||||
repo: escrcpy
|
||||
updaterCacheDirName: escrcpy-updater
|
51
electron-builder.json
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
|
||||
"appId": "org.viarotel.escrcpy",
|
||||
"asar": true,
|
||||
"productName": "escrcpy",
|
||||
"directories": {
|
||||
"output": "dist-release/${version}",
|
||||
"buildResources": "electron/resources/build"
|
||||
},
|
||||
"files": ["dist", "dist-electron"],
|
||||
"extraResources": ["electron/resources/extra"],
|
||||
"publish": {
|
||||
"provider": "github",
|
||||
"owner": "viarotel-org",
|
||||
"repo": "escrcpy",
|
||||
"updaterCacheDirName": "escrcpy-updater"
|
||||
},
|
||||
"mac": {
|
||||
"target": ["dmg"],
|
||||
"artifactName": "${productName}-${version}-mac-installer.${ext}"
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": ["x64"]
|
||||
},
|
||||
{
|
||||
"target": "zip"
|
||||
},
|
||||
{
|
||||
"target": "portable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nsis": {
|
||||
"artifactName": "${productName}-${version}-win-setup.${ext}",
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"deleteAppDataOnUninstall": false
|
||||
},
|
||||
"portable": {
|
||||
"artifactName": "${productName}-${version}-win-portable.${ext}",
|
||||
"requestExecutionLevel": "user"
|
||||
},
|
||||
"linux": {
|
||||
"target": ["AppImage"],
|
||||
"artifactName": "${productName}-${version}-linux.${ext}"
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/**
|
||||
* @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,23 +1,21 @@
|
||||
import path from 'node:path'
|
||||
import { app, ipcMain } from 'electron'
|
||||
import { is } from '@electron-toolkit/utils'
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
import devPublishPath from '@root/dev-publish.yml?path'
|
||||
|
||||
export default (mainWindow) => {
|
||||
// dev-start, 这里是为了在本地做应用升级测试使用,正式环境请务必删除
|
||||
if (is.dev && process.env.ELECTRON_RENDERER_URL) {
|
||||
const updateConfigPath = path.join(process.cwd(), './dev-app-update.yml')
|
||||
// console.log('updateConfigPath', updateConfigPath)
|
||||
// if (is.dev && process.env.ELECTRON_RENDERER_URL) {
|
||||
if (is.dev && process.env.VITE_DEV_SERVER_URL) {
|
||||
const updateConfigPath = devPublishPath
|
||||
autoUpdater.updateConfigPath = updateConfigPath
|
||||
Object.defineProperty(app, 'isPackaged', {
|
||||
get() {
|
||||
return true
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Object.defineProperty(app, 'isPackaged', {
|
||||
get() {
|
||||
return true
|
||||
},
|
||||
})
|
||||
// dev-end
|
||||
|
||||
// 触发检查更新(此方法用于被渲染线程调用,例如页面点击检查更新按钮来调用此方法)
|
||||
ipcMain.on('check-for-update', () => {
|
||||
console.log('ipcMain:check-for-update')
|
@ -4,9 +4,7 @@ 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?path'
|
||||
|
||||
console.log('adbPath', adbPath)
|
||||
import adbPath from '@resources/extra/core/adb.exe?path'
|
||||
|
||||
const exec = util.promisify(child_process.exec)
|
||||
|
||||
@ -99,7 +97,7 @@ const watch = async (callback) => {
|
||||
}
|
||||
|
||||
export default () => {
|
||||
client = Adb.createClient({})
|
||||
client = Adb.createClient({ bin: adbPath })
|
||||
console.log('client', client)
|
||||
|
||||
return {
|
@ -4,7 +4,7 @@ import adbkit from './adbkit/index.js'
|
||||
import scrcpy from './scrcpy/index.js'
|
||||
|
||||
export default {
|
||||
install(expose) {
|
||||
init(expose) {
|
||||
expose('nodePath', path)
|
||||
expose('electron', electron())
|
||||
expose('adbkit', adbkit())
|
@ -1,7 +1,7 @@
|
||||
import util from 'node:util'
|
||||
import child_process from 'node:child_process'
|
||||
import adbPath from '@resources/core/adb.exe?path'
|
||||
import scrcpyPath from '@resources/core/scrcpy.exe?path'
|
||||
import adbPath from '@resources/extra/core/adb.exe?path'
|
||||
import scrcpyPath from '@resources/extra/core/scrcpy.exe?path'
|
||||
|
||||
const exec = util.promisify(child_process.exec)
|
||||
|
175
electron/loading/index.js
Normal file
@ -0,0 +1,175 @@
|
||||
// --------- Preload scripts loading ---------
|
||||
function domReady(condition = ['complete', 'interactive']) {
|
||||
return new Promise((resolve) => {
|
||||
if (condition.includes(document.readyState)) {
|
||||
resolve(true)
|
||||
}
|
||||
else {
|
||||
document.addEventListener('readystatechange', () => {
|
||||
if (condition.includes(document.readyState)) {
|
||||
resolve(true)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const safeDOM = {
|
||||
append(parent, child) {
|
||||
if (!Array.from(parent.children).find(e => e === child)) {
|
||||
parent.appendChild(child)
|
||||
}
|
||||
},
|
||||
remove(parent, child) {
|
||||
if (Array.from(parent.children).find(e => e === child)) {
|
||||
parent.removeChild(child)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* https://tobiasahlin.com/spinkit
|
||||
* https://connoratherton.com/loaders
|
||||
* https://projects.lukehaas.me/css-loaders
|
||||
* https://matejkustec.github.io/SpinThatShit
|
||||
*/
|
||||
function useLoading() {
|
||||
const className = 'electron-loading'
|
||||
const loginStyles = `
|
||||
.${className}-core {
|
||||
font-size: 30px;
|
||||
text-indent: -9999em;
|
||||
overflow: hidden;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
border-radius: 50%;
|
||||
margin: 72px auto;
|
||||
position: relative;
|
||||
-webkit-transform: translateZ(0);
|
||||
-ms-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
-webkit-animation: electron-loading-dots 1.7s infinite ease, electron-loading-spin 1.7s infinite ease;
|
||||
animation: electron-loading-dots 1.7s infinite ease, electron-loading-spin 1.7s infinite ease;
|
||||
}
|
||||
|
||||
@-webkit-keyframes electron-loading-dots {
|
||||
0% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
||||
}
|
||||
5%,
|
||||
95% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
||||
}
|
||||
10%,
|
||||
59% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em;
|
||||
}
|
||||
20% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em;
|
||||
}
|
||||
38% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em;
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes electron-loading-dots {
|
||||
0% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
||||
}
|
||||
5%,
|
||||
95% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
||||
}
|
||||
10%,
|
||||
59% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em, -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em, -0.297em -0.775em 0 -0.477em;
|
||||
}
|
||||
20% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em, -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em, -0.749em -0.34em 0 -0.477em;
|
||||
}
|
||||
38% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em, -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em, -0.82em -0.09em 0 -0.477em;
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em, 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes electron-loading-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes electron-loading-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.${className}-wrap {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 3000;
|
||||
background: white;
|
||||
color: #028D71;
|
||||
}
|
||||
|
||||
.${className}-text {
|
||||
margin-top: -45px;
|
||||
}
|
||||
`
|
||||
|
||||
const styleEl = document.createElement('style')
|
||||
styleEl.id = `${className}-style`
|
||||
styleEl.innerHTML = loginStyles
|
||||
|
||||
const divEl = document.createElement('div')
|
||||
divEl.className = `${className}-wrap`
|
||||
divEl.innerHTML = `
|
||||
<div class="${className}-core"></div>
|
||||
<div class="${className}-text"> 初始化服务中...</div>
|
||||
`
|
||||
|
||||
return {
|
||||
appendLoading() {
|
||||
safeDOM.append(document.head, styleEl)
|
||||
safeDOM.append(document.body, divEl)
|
||||
},
|
||||
removeLoading() {
|
||||
safeDOM.remove(document.head, styleEl)
|
||||
safeDOM.remove(document.body, divEl)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
const { appendLoading, removeLoading } = useLoading()
|
||||
domReady().then(appendLoading)
|
||||
|
||||
window.onmessage = (ev) => {
|
||||
ev.data.payload === 'removeLoading' && removeLoading()
|
||||
}
|
||||
|
||||
setTimeout(removeLoading, 4999)
|
@ -1,6 +1,12 @@
|
||||
import path from 'node:path'
|
||||
import { BrowserWindow, app } from 'electron'
|
||||
import ipcManage from './ipcManage/index.js'
|
||||
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 events from './events/index.js'
|
||||
|
||||
// The built directory structure
|
||||
//
|
||||
@ -11,18 +17,26 @@ import ipcManage from './ipcManage/index.js'
|
||||
// │ │ ├── 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() {
|
||||
let icon = logoPath
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
icon = icoLogoPath
|
||||
}
|
||||
else if (process.platform === 'darwin') {
|
||||
icon = icnsLogoPath
|
||||
}
|
||||
|
||||
mainWindow = new BrowserWindow({
|
||||
icon: path.join(process.env.VITE_PUBLIC, 'electron-vite.svg'),
|
||||
show: false,
|
||||
icon,
|
||||
minWidth: 1000,
|
||||
minHeight: 700,
|
||||
autoHideMenuBar: true,
|
||||
@ -32,6 +46,16 @@ function createWindow() {
|
||||
preload: path.join(__dirname, './preload.js'),
|
||||
sandbox: false,
|
||||
},
|
||||
backgroundColor: 'white',
|
||||
})
|
||||
|
||||
mainWindow.on('ready-to-show', () => {
|
||||
mainWindow.show()
|
||||
})
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
shell.openExternal(details.url)
|
||||
return { action: 'deny' }
|
||||
})
|
||||
|
||||
// Test active push message to Renderer-process.
|
||||
@ -50,7 +74,7 @@ function createWindow() {
|
||||
mainWindow.loadFile(path.join(process.env.DIST, 'index.html'))
|
||||
}
|
||||
|
||||
ipcManage(mainWindow)
|
||||
events(mainWindow)
|
||||
}
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
@ -71,4 +95,12 @@ app.on('activate', () => {
|
||||
}
|
||||
})
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
app.whenReady().then(() => {
|
||||
electronApp.setAppUserModelId('com.viarotel.escrcpy')
|
||||
|
||||
app.on('browser-window-created', (_, window) => {
|
||||
optimizer.watchWindowShortcuts(window)
|
||||
})
|
||||
|
||||
createWindow()
|
||||
})
|
||||
|
@ -1,6 +1,7 @@
|
||||
import plugins from './plugins/index.js'
|
||||
import exposes from './exposes/index.js'
|
||||
import { exposeContext } from './helpers/index.js'
|
||||
import './loading/index.js'
|
||||
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true'
|
||||
|
||||
plugins.install(exposeContext)
|
||||
exposes.init(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 |
@ -2,12 +2,12 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<link rel="icon" href="/logo.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue + TS</title>
|
||||
<title>Escrcpy</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
@ -2,9 +2,11 @@
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
"@/*": ["src/*"],
|
||||
"@root/*": ["*"],
|
||||
"@resources/*": ["electron/resources/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules", "dist", "dist-electron"],
|
||||
"exclude": ["node_modules", "dist", "dist-electron", "dist-release"],
|
||||
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.vue", "electron"]
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "escrcpy-next",
|
||||
"name": "escrcpy",
|
||||
"version": "1.6.2",
|
||||
"private": true,
|
||||
"description": "Scrcpy Powered by Electron",
|
||||
@ -29,6 +29,7 @@
|
||||
"electron-builder": "^24.6.4",
|
||||
"electron-updater": "^6.1.4",
|
||||
"element-plus": "^2.4.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"pinia": "^2.1.7",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.4.9",
|
||||
|
@ -49,6 +49,9 @@ devDependencies:
|
||||
element-plus:
|
||||
specifier: ^2.4.0
|
||||
version: 2.4.0(vue@3.3.4)
|
||||
lodash-es:
|
||||
specifier: ^4.17.21
|
||||
version: 4.17.21
|
||||
pinia:
|
||||
specifier: ^2.1.7
|
||||
version: 2.1.7(typescript@5.2.2)(vue@3.3.4)
|
||||
|
@ -1,26 +0,0 @@
|
||||
<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>
|
Before Width: | Height: | Size: 6.7 KiB |
BIN
public/logo.ico
Normal file
After Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
@ -58,10 +58,10 @@ export default {
|
||||
tips: '可以用来开启或关闭屏幕',
|
||||
},
|
||||
{
|
||||
label: '截屏快照',
|
||||
label: '截取屏幕',
|
||||
icon: 'Crop',
|
||||
handle: this.handleScreenCap,
|
||||
tips: '不要和切换键搞错啦',
|
||||
tips: '',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ export default {
|
||||
const adbCache = storage.get('adbCache') || {}
|
||||
return {
|
||||
loading: false,
|
||||
loadingText: '初始化中...',
|
||||
loadingText: '努力加载中...',
|
||||
connectLoading: false,
|
||||
deviceList: [],
|
||||
formData: {
|
||||
|
12
src/main.js
@ -21,11 +21,7 @@ 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)
|
||||
// })
|
||||
// })
|
||||
app.$nextTick(() => {
|
||||
// Remove Preload scripts loading
|
||||
postMessage({ payload: 'removeLoading' }, '*')
|
||||
})
|
||||
|
@ -1,12 +1,26 @@
|
||||
import { resolve } from 'node:path'
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, mergeConfig } 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'
|
||||
import usePath from './binary.js'
|
||||
|
||||
const merge = config =>
|
||||
mergeConfig(
|
||||
{
|
||||
resolve: {
|
||||
alias: {
|
||||
'@root': resolve('./'),
|
||||
'@resources': resolve('./electron/resources'),
|
||||
},
|
||||
},
|
||||
plugins: [usePath()],
|
||||
},
|
||||
config,
|
||||
)
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@ -23,21 +37,14 @@ export default defineConfig({
|
||||
useElectron([
|
||||
{
|
||||
entry: 'electron/main.js',
|
||||
vite: {},
|
||||
vite: merge({}),
|
||||
},
|
||||
{
|
||||
entry: 'electron/preload.js',
|
||||
onstart(args) {
|
||||
args.reload()
|
||||
},
|
||||
vite: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@resources': resolve('./electron/resources'),
|
||||
},
|
||||
},
|
||||
plugins: [binary()],
|
||||
},
|
||||
vite: merge({}),
|
||||
},
|
||||
]),
|
||||
useRenderer(),
|
||||
|