├── .babelrc ├── .editorconfig ├── .electron-vue ├── build.js ├── dev-client.js ├── dev-runner.js ├── webpack.main.config.js ├── webpack.renderer.config.js └── webpack.web.config.js ├── .eslintignore ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE.md ├── lock.yml ├── move.yml ├── no-response.yml └── stale.yml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── FAQ.md ├── LICENSE ├── README.md ├── README.zh_CN.md ├── _config.yml ├── appveyor.yml ├── build └── icons │ ├── 16x16.png │ ├── 256x256.png │ ├── icon.icns │ └── icon.ico ├── dist ├── electron │ └── .gitkeep └── web │ └── .gitkeep ├── package.json ├── screenshot.gif ├── src ├── index.ejs ├── main │ ├── adb │ │ └── index.js │ ├── index.dev.js │ ├── index.js │ └── scrcpy │ │ └── index.js ├── renderer │ ├── App.vue │ ├── assets │ │ ├── .gitkeep │ │ └── icons │ │ │ ├── 256x256.png │ │ │ ├── icon.icns │ │ │ └── icon.ico │ ├── components │ │ ├── components │ │ │ └── EditableCell.vue │ │ ├── dashboard │ │ │ ├── Configuration.vue │ │ │ └── Management.vue │ │ ├── layout │ │ │ ├── Footer.vue │ │ │ ├── Header.vue │ │ │ ├── Main.vue │ │ │ └── index.js │ │ └── menu │ │ │ ├── Menu.js │ │ │ ├── Tray.js │ │ │ └── index.js │ ├── directives │ │ ├── index.js │ │ └── waves │ │ │ ├── index.js │ │ │ ├── waves.css │ │ │ └── waves.js │ ├── lang │ │ ├── en.js │ │ ├── index.js │ │ ├── zh_CN.js │ │ └── zh_TW.js │ ├── main.js │ ├── mixin │ │ ├── drag.js │ │ └── index.js │ ├── plugins │ │ ├── index.js │ │ ├── notify.js │ │ ├── openExternal.js │ │ └── store.js │ ├── router │ │ └── index.js │ ├── styles │ │ ├── index.scss │ │ ├── mixin.scss │ │ ├── scrollbar.scss │ │ └── variables.scss │ ├── utils │ │ └── regular │ │ │ └── index.js │ └── views │ │ ├── Dashboard.vue │ │ └── Layout.vue └── test │ └── execa.js └── static ├── .gitkeep └── icons ├── 16x16.png ├── 256x256.png ├── icon.icns └── icon.ico /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "comments": false, 3 | "env": { 4 | "main": { 5 | "presets": [ 6 | ["env", { 7 | "targets": { "node": 7 } 8 | }], 9 | "stage-0" 10 | ] 11 | }, 12 | "renderer": { 13 | "presets": [ 14 | ["env", { 15 | "modules": false 16 | }], 17 | "stage-0" 18 | ] 19 | }, 20 | "web": { 21 | "presets": [ 22 | ["env", { 23 | "modules": false 24 | }], 25 | "stage-0" 26 | ] 27 | } 28 | }, 29 | "plugins": ["transform-runtime"] 30 | } 31 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | 7 | indent_size = 1 8 | indent_style = tab 9 | tab_width = 2 10 | 11 | end_of_line = lf 12 | 13 | trim_trailing_whitespace = true 14 | insert_final_newline = true -------------------------------------------------------------------------------- /.electron-vue/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | process.env.NODE_ENV = 'production' 4 | 5 | const { say } = require('cfonts') 6 | const chalk = require('chalk') 7 | const del = require('del') 8 | const { spawn } = require('child_process') 9 | const webpack = require('webpack') 10 | const Multispinner = require('multispinner') 11 | 12 | 13 | const mainConfig = require('./webpack.main.config') 14 | const rendererConfig = require('./webpack.renderer.config') 15 | const webConfig = require('./webpack.web.config') 16 | 17 | const doneLog = chalk.bgGreen.white(' DONE ') + ' ' 18 | const errorLog = chalk.bgRed.white(' ERROR ') + ' ' 19 | const okayLog = chalk.bgBlue.white(' OKAY ') + ' ' 20 | const isCI = process.env.CI || false 21 | 22 | if (process.env.BUILD_TARGET === 'clean') clean() 23 | else if (process.env.BUILD_TARGET === 'web') web() 24 | else build() 25 | 26 | function clean () { 27 | del.sync(['build/*', '!build/icons', '!build/icons/icon.*']) 28 | console.log(`\n${doneLog}\n`) 29 | process.exit() 30 | } 31 | 32 | function build () { 33 | greeting() 34 | 35 | del.sync(['dist/electron/*', '!.gitkeep']) 36 | 37 | const tasks = ['main', 'renderer'] 38 | const m = new Multispinner(tasks, { 39 | preText: 'building', 40 | postText: 'process' 41 | }) 42 | 43 | let results = '' 44 | 45 | m.on('success', () => { 46 | process.stdout.write('\x1B[2J\x1B[0f') 47 | console.log(`\n\n${results}`) 48 | console.log(`${okayLog}take it away ${chalk.yellow('`electron-builder`')}\n`) 49 | process.exit() 50 | }) 51 | 52 | pack(mainConfig).then(result => { 53 | results += result + '\n\n' 54 | m.success('main') 55 | }).catch(err => { 56 | m.error('main') 57 | console.log(`\n ${errorLog}failed to build main process`) 58 | console.error(`\n${err}\n`) 59 | process.exit(1) 60 | }) 61 | 62 | pack(rendererConfig).then(result => { 63 | results += result + '\n\n' 64 | m.success('renderer') 65 | }).catch(err => { 66 | m.error('renderer') 67 | console.log(`\n ${errorLog}failed to build renderer process`) 68 | console.error(`\n${err}\n`) 69 | process.exit(1) 70 | }) 71 | } 72 | 73 | function pack (config) { 74 | return new Promise((resolve, reject) => { 75 | config.mode = 'production' 76 | webpack(config, (err, stats) => { 77 | if (err) reject(err.stack || err) 78 | else if (stats.hasErrors()) { 79 | let err = '' 80 | 81 | stats.toString({ 82 | chunks: false, 83 | colors: true 84 | }) 85 | .split(/\r?\n/) 86 | .forEach(line => { 87 | err += ` ${line}\n` 88 | }) 89 | 90 | reject(err) 91 | } else { 92 | resolve(stats.toString({ 93 | chunks: false, 94 | colors: true 95 | })) 96 | } 97 | }) 98 | }) 99 | } 100 | 101 | function web () { 102 | del.sync(['dist/web/*', '!.gitkeep']) 103 | webConfig.mode = 'production' 104 | webpack(webConfig, (err, stats) => { 105 | if (err || stats.hasErrors()) console.log(err) 106 | 107 | console.log(stats.toString({ 108 | chunks: false, 109 | colors: true 110 | })) 111 | 112 | process.exit() 113 | }) 114 | } 115 | 116 | function greeting () { 117 | const cols = process.stdout.columns 118 | let text = '' 119 | 120 | if (cols > 85) text = 'lets-build' 121 | else if (cols > 60) text = 'lets-|build' 122 | else text = false 123 | 124 | if (text && !isCI) { 125 | say(text, { 126 | colors: ['yellow'], 127 | font: 'simple3d', 128 | space: false 129 | }) 130 | } else console.log(chalk.yellow.bold('\n lets-build')) 131 | console.log() 132 | } -------------------------------------------------------------------------------- /.electron-vue/dev-client.js: -------------------------------------------------------------------------------- 1 | const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 2 | 3 | hotClient.subscribe(event => { 4 | /** 5 | * Reload browser when HTMLWebpackPlugin emits a new index.html 6 | * 7 | * Currently disabled until jantimon/html-webpack-plugin#680 is resolved. 8 | * https://github.com/SimulatedGREG/electron-vue/issues/437 9 | * https://github.com/jantimon/html-webpack-plugin/issues/680 10 | */ 11 | // if (event.action === 'reload') { 12 | // window.location.reload() 13 | // } 14 | 15 | /** 16 | * Notify `mainWindow` when `main` process is compiling, 17 | * giving notice for an expected reload of the `electron` process 18 | */ 19 | if (event.action === 'compiling') { 20 | document.body.innerHTML += ` 21 | 34 | 35 |
36 | Compiling Main Process... 37 |
38 | ` 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /.electron-vue/dev-runner.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const chalk = require('chalk') 4 | const electron = require('electron') 5 | const path = require('path') 6 | const { say } = require('cfonts') 7 | const { spawn } = require('child_process') 8 | const webpack = require('webpack') 9 | const WebpackDevServer = require('webpack-dev-server') 10 | const webpackHotMiddleware = require('webpack-hot-middleware') 11 | 12 | const mainConfig = require('./webpack.main.config') 13 | const rendererConfig = require('./webpack.renderer.config') 14 | 15 | let electronProcess = null 16 | let manualRestart = false 17 | let hotMiddleware 18 | 19 | function logStats (proc, data) { 20 | let log = '' 21 | 22 | log += chalk.yellow.bold(`┏ ${proc} Process ${new Array((19 - proc.length) + 1).join('-')}`) 23 | log += '\n\n' 24 | 25 | if (typeof data === 'object') { 26 | data.toString({ 27 | colors: true, 28 | chunks: false 29 | }).split(/\r?\n/).forEach(line => { 30 | log += ' ' + line + '\n' 31 | }) 32 | } else { 33 | log += ` ${data}\n` 34 | } 35 | 36 | log += '\n' + chalk.yellow.bold(`┗ ${new Array(28 + 1).join('-')}`) + '\n' 37 | 38 | console.log(log) 39 | } 40 | 41 | function startRenderer () { 42 | return new Promise((resolve, reject) => { 43 | rendererConfig.entry.renderer = [path.join(__dirname, 'dev-client')].concat(rendererConfig.entry.renderer) 44 | rendererConfig.mode = 'development' 45 | const compiler = webpack(rendererConfig) 46 | hotMiddleware = webpackHotMiddleware(compiler, { 47 | log: false, 48 | heartbeat: 2500 49 | }) 50 | 51 | compiler.hooks.compilation.tap('compilation', compilation => { 52 | compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => { 53 | hotMiddleware.publish({ action: 'reload' }) 54 | cb() 55 | }) 56 | }) 57 | 58 | compiler.hooks.done.tap('done', stats => { 59 | logStats('Renderer', stats) 60 | }) 61 | 62 | const server = new WebpackDevServer( 63 | compiler, 64 | { 65 | contentBase: path.join(__dirname, '../'), 66 | quiet: true, 67 | before (app, ctx) { 68 | app.use(hotMiddleware) 69 | ctx.middleware.waitUntilValid(() => { 70 | resolve() 71 | }) 72 | } 73 | } 74 | ) 75 | 76 | server.listen(9080) 77 | }) 78 | } 79 | 80 | function startMain () { 81 | return new Promise((resolve, reject) => { 82 | mainConfig.entry.main = [path.join(__dirname, '../src/main/index.dev.js')].concat(mainConfig.entry.main) 83 | mainConfig.mode = 'development' 84 | const compiler = webpack(mainConfig) 85 | 86 | compiler.hooks.watchRun.tapAsync('watch-run', (compilation, done) => { 87 | logStats('Main', chalk.white.bold('compiling...')) 88 | hotMiddleware.publish({ action: 'compiling' }) 89 | done() 90 | }) 91 | 92 | compiler.watch({}, (err, stats) => { 93 | if (err) { 94 | console.log(err) 95 | return 96 | } 97 | 98 | logStats('Main', stats) 99 | 100 | if (electronProcess && electronProcess.kill) { 101 | manualRestart = true 102 | process.kill(electronProcess.pid) 103 | electronProcess = null 104 | startElectron() 105 | 106 | setTimeout(() => { 107 | manualRestart = false 108 | }, 5000) 109 | } 110 | 111 | resolve() 112 | }) 113 | }) 114 | } 115 | 116 | function startElectron () { 117 | var args = [ 118 | '--inspect=5858', 119 | path.join(__dirname, '../dist/electron/main.js') 120 | ] 121 | 122 | // detect yarn or npm and process commandline args accordingly 123 | if (process.env.npm_execpath.endsWith('yarn.js')) { 124 | args = args.concat(process.argv.slice(3)) 125 | } else if (process.env.npm_execpath.endsWith('npm-cli.js')) { 126 | args = args.concat(process.argv.slice(2)) 127 | } 128 | 129 | electronProcess = spawn(electron, args) 130 | 131 | electronProcess.stdout.on('data', data => { 132 | electronLog(data, 'blue') 133 | }) 134 | electronProcess.stderr.on('data', data => { 135 | electronLog(data, 'red') 136 | }) 137 | 138 | electronProcess.on('close', () => { 139 | if (!manualRestart) process.exit() 140 | }) 141 | } 142 | 143 | function electronLog (data, color) { 144 | let log = '' 145 | data = data.toString().split(/\r?\n/) 146 | data.forEach(line => { 147 | log += ` ${line}\n` 148 | }) 149 | if (/[0-9A-z]+/.test(log)) { 150 | console.log( 151 | chalk[color].bold('┏ Electron -------------------') + 152 | '\n\n' + 153 | log + 154 | chalk[color].bold('┗ ----------------------------') + 155 | '\n' 156 | ) 157 | } 158 | } 159 | 160 | function greeting () { 161 | const cols = process.stdout.columns 162 | let text = '' 163 | 164 | if (cols > 104) text = 'electron-vue' 165 | else if (cols > 76) text = 'electron-|vue' 166 | else text = false 167 | 168 | if (text) { 169 | say(text, { 170 | colors: ['yellow'], 171 | font: 'simple3d', 172 | space: false 173 | }) 174 | } else console.log(chalk.yellow.bold('\n electron-vue')) 175 | console.log(chalk.blue(' getting ready...') + '\n') 176 | } 177 | 178 | function init () { 179 | greeting() 180 | 181 | Promise.all([startRenderer(), startMain()]) 182 | .then(() => { 183 | startElectron() 184 | }) 185 | .catch(err => { 186 | console.error(err) 187 | }) 188 | } 189 | 190 | init() 191 | -------------------------------------------------------------------------------- /.electron-vue/webpack.main.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | process.env.BABEL_ENV = 'main' 4 | 5 | const path = require('path') 6 | const { dependencies } = require('../package.json') 7 | const webpack = require('webpack') 8 | 9 | const BabiliWebpackPlugin = require('babili-webpack-plugin') 10 | 11 | let mainConfig = { 12 | entry: { 13 | main: path.join(__dirname, '../src/main/index.js') 14 | }, 15 | externals: [ 16 | ...Object.keys(dependencies || {}) 17 | ], 18 | module: { 19 | rules: [ 20 | { 21 | test: /\.(js)$/, 22 | enforce: 'pre', 23 | exclude: /node_modules/, 24 | use: { 25 | loader: 'eslint-loader', 26 | options: { 27 | formatter: require('eslint-friendly-formatter') 28 | } 29 | } 30 | }, 31 | { 32 | test: /\.js$/, 33 | use: 'babel-loader', 34 | exclude: /node_modules/ 35 | }, 36 | { 37 | test: /\.node$/, 38 | use: 'node-loader' 39 | } 40 | ] 41 | }, 42 | node: { 43 | __dirname: process.env.NODE_ENV !== 'production', 44 | __filename: process.env.NODE_ENV !== 'production' 45 | }, 46 | output: { 47 | filename: '[name].js', 48 | libraryTarget: 'commonjs2', 49 | path: path.join(__dirname, '../dist/electron') 50 | }, 51 | plugins: [ 52 | new webpack.NoEmitOnErrorsPlugin() 53 | ], 54 | resolve: { 55 | extensions: ['.js', '.json', '.node'] 56 | }, 57 | target: 'electron-main' 58 | } 59 | 60 | /** 61 | * Adjust mainConfig for development settings 62 | */ 63 | if (process.env.NODE_ENV !== 'production') { 64 | mainConfig.plugins.push( 65 | new webpack.DefinePlugin({ 66 | '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"` 67 | }) 68 | ) 69 | } 70 | 71 | /** 72 | * Adjust mainConfig for production settings 73 | */ 74 | if (process.env.NODE_ENV === 'production') { 75 | mainConfig.plugins.push( 76 | new BabiliWebpackPlugin(), 77 | new webpack.DefinePlugin({ 78 | 'process.env.NODE_ENV': '"production"' 79 | }) 80 | ) 81 | } 82 | 83 | module.exports = mainConfig 84 | -------------------------------------------------------------------------------- /.electron-vue/webpack.renderer.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | process.env.BABEL_ENV = 'renderer' 4 | 5 | const path = require('path') 6 | const { dependencies } = require('../package.json') 7 | const webpack = require('webpack') 8 | 9 | const BabiliWebpackPlugin = require('babili-webpack-plugin') 10 | const CopyWebpackPlugin = require('copy-webpack-plugin') 11 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') 12 | const HtmlWebpackPlugin = require('html-webpack-plugin') 13 | const { VueLoaderPlugin } = require('vue-loader') 14 | 15 | /** 16 | * List of node_modules to include in webpack bundle 17 | * 18 | * Required for specific packages like Vue UI libraries 19 | * that provide pure *.vue files that need compiling 20 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals 21 | */ 22 | let whiteListedModules = ['vue','element-ui'] 23 | 24 | let rendererConfig = { 25 | devtool: '#cheap-module-eval-source-map', 26 | entry: { 27 | renderer: path.join(__dirname, '../src/renderer/main.js') 28 | }, 29 | externals: [ 30 | ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)) 31 | ], 32 | module: { 33 | rules: [ 34 | { 35 | test: /\.(js|vue)$/, 36 | enforce: 'pre', 37 | exclude: /node_modules/, 38 | use: { 39 | loader: 'eslint-loader', 40 | options: { 41 | formatter: require('eslint-friendly-formatter') 42 | } 43 | } 44 | }, 45 | { 46 | test: /\.scss$/, 47 | use: ['vue-style-loader', 'css-loader', 'sass-loader'] 48 | }, 49 | { 50 | test: /\.sass$/, 51 | use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax'] 52 | }, 53 | { 54 | test: /\.less$/, 55 | use: ['vue-style-loader', 'css-loader', 'less-loader'] 56 | }, 57 | { 58 | test: /\.css$/, 59 | use: ['vue-style-loader', 'css-loader'] 60 | }, 61 | { 62 | test: /\.html$/, 63 | use: 'vue-html-loader' 64 | }, 65 | { 66 | test: /\.js$/, 67 | use: 'babel-loader', 68 | exclude: /node_modules/ 69 | }, 70 | { 71 | test: /\.node$/, 72 | use: 'node-loader' 73 | }, 74 | { 75 | test: /\.vue$/, 76 | use: { 77 | loader: 'vue-loader', 78 | options: { 79 | extractCSS: process.env.NODE_ENV === 'production', 80 | loaders: { 81 | sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1', 82 | scss: 'vue-style-loader!css-loader!sass-loader', 83 | less: 'vue-style-loader!css-loader!less-loader' 84 | } 85 | } 86 | } 87 | }, 88 | { 89 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 90 | use: { 91 | loader: 'url-loader', 92 | query: { 93 | limit: 10000, 94 | name: 'imgs/[name]--[folder].[ext]' 95 | } 96 | } 97 | }, 98 | { 99 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 100 | loader: 'url-loader', 101 | options: { 102 | limit: 10000, 103 | name: 'media/[name]--[folder].[ext]' 104 | } 105 | }, 106 | { 107 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 108 | use: { 109 | loader: 'url-loader', 110 | query: { 111 | limit: 10000, 112 | name: 'fonts/[name]--[folder].[ext]' 113 | } 114 | } 115 | } 116 | ] 117 | }, 118 | node: { 119 | __dirname: process.env.NODE_ENV !== 'production', 120 | __filename: process.env.NODE_ENV !== 'production' 121 | }, 122 | plugins: [ 123 | new VueLoaderPlugin(), 124 | new MiniCssExtractPlugin({filename: 'styles.css'}), 125 | new HtmlWebpackPlugin({ 126 | filename: 'index.html', 127 | template: path.resolve(__dirname, '../src/index.ejs'), 128 | templateParameters(compilation, assets, options) { 129 | return { 130 | compilation: compilation, 131 | webpack: compilation.getStats().toJson(), 132 | webpackConfig: compilation.options, 133 | htmlWebpackPlugin: { 134 | files: assets, 135 | options: options 136 | }, 137 | process, 138 | }; 139 | }, 140 | minify: { 141 | collapseWhitespace: true, 142 | removeAttributeQuotes: true, 143 | removeComments: true 144 | }, 145 | nodeModules: process.env.NODE_ENV !== 'production' 146 | ? path.resolve(__dirname, '../node_modules') 147 | : false 148 | }), 149 | new webpack.HotModuleReplacementPlugin(), 150 | new webpack.NoEmitOnErrorsPlugin() 151 | ], 152 | output: { 153 | filename: '[name].js', 154 | libraryTarget: 'commonjs2', 155 | path: path.join(__dirname, '../dist/electron') 156 | }, 157 | resolve: { 158 | alias: { 159 | '@': path.join(__dirname, '../src/renderer'), 160 | 'vue$': 'vue/dist/vue.esm.js' 161 | }, 162 | extensions: ['.js', '.vue', '.json', '.css', '.node'] 163 | }, 164 | target: 'electron-renderer' 165 | } 166 | 167 | /** 168 | * Adjust rendererConfig for development settings 169 | */ 170 | if (process.env.NODE_ENV !== 'production') { 171 | rendererConfig.plugins.push( 172 | new webpack.DefinePlugin({ 173 | '__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"` 174 | }) 175 | ) 176 | } 177 | 178 | /** 179 | * Adjust rendererConfig for production settings 180 | */ 181 | if (process.env.NODE_ENV === 'production') { 182 | rendererConfig.devtool = '' 183 | 184 | rendererConfig.plugins.push( 185 | new BabiliWebpackPlugin(), 186 | new CopyWebpackPlugin([ 187 | { 188 | from: path.join(__dirname, '../static'), 189 | to: path.join(__dirname, '../dist/electron/static'), 190 | ignore: ['.*'] 191 | } 192 | ]), 193 | new webpack.DefinePlugin({ 194 | 'process.env.NODE_ENV': '"production"' 195 | }), 196 | new webpack.LoaderOptionsPlugin({ 197 | minimize: true 198 | }) 199 | ) 200 | } 201 | 202 | module.exports = rendererConfig 203 | -------------------------------------------------------------------------------- /.electron-vue/webpack.web.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | process.env.BABEL_ENV = 'web' 4 | 5 | const path = require('path') 6 | const webpack = require('webpack') 7 | 8 | const BabiliWebpackPlugin = require('babili-webpack-plugin') 9 | const CopyWebpackPlugin = require('copy-webpack-plugin') 10 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') 11 | const HtmlWebpackPlugin = require('html-webpack-plugin') 12 | const { VueLoaderPlugin } = require('vue-loader') 13 | 14 | let webConfig = { 15 | devtool: '#cheap-module-eval-source-map', 16 | entry: { 17 | web: path.join(__dirname, '../src/renderer/main.js') 18 | }, 19 | module: { 20 | rules: [ 21 | { 22 | test: /\.(js|vue)$/, 23 | enforce: 'pre', 24 | exclude: /node_modules/, 25 | use: { 26 | loader: 'eslint-loader', 27 | options: { 28 | formatter: require('eslint-friendly-formatter') 29 | } 30 | } 31 | }, 32 | { 33 | test: /\.scss$/, 34 | use: ['vue-style-loader', 'css-loader', 'sass-loader'] 35 | }, 36 | { 37 | test: /\.sass$/, 38 | use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax'] 39 | }, 40 | { 41 | test: /\.less$/, 42 | use: ['vue-style-loader', 'css-loader', 'less-loader'] 43 | }, 44 | { 45 | test: /\.css$/, 46 | use: ['vue-style-loader', 'css-loader'] 47 | }, 48 | { 49 | test: /\.html$/, 50 | use: 'vue-html-loader' 51 | }, 52 | { 53 | test: /\.js$/, 54 | use: 'babel-loader', 55 | include: [ path.resolve(__dirname, '../src/renderer') ], 56 | exclude: /node_modules/ 57 | }, 58 | { 59 | test: /\.vue$/, 60 | use: { 61 | loader: 'vue-loader', 62 | options: { 63 | extractCSS: true, 64 | loaders: { 65 | sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1', 66 | scss: 'vue-style-loader!css-loader!sass-loader', 67 | less: 'vue-style-loader!css-loader!less-loader' 68 | } 69 | } 70 | } 71 | }, 72 | { 73 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 74 | use: { 75 | loader: 'url-loader', 76 | query: { 77 | limit: 10000, 78 | name: 'imgs/[name].[ext]' 79 | } 80 | } 81 | }, 82 | { 83 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 84 | use: { 85 | loader: 'url-loader', 86 | query: { 87 | limit: 10000, 88 | name: 'fonts/[name].[ext]' 89 | } 90 | } 91 | } 92 | ] 93 | }, 94 | plugins: [ 95 | new VueLoaderPlugin(), 96 | new MiniCssExtractPlugin({filename: 'styles.css'}), 97 | new HtmlWebpackPlugin({ 98 | filename: 'index.html', 99 | template: path.resolve(__dirname, '../src/index.ejs'), 100 | templateParameters(compilation, assets, options) { 101 | return { 102 | compilation: compilation, 103 | webpack: compilation.getStats().toJson(), 104 | webpackConfig: compilation.options, 105 | htmlWebpackPlugin: { 106 | files: assets, 107 | options: options 108 | }, 109 | process, 110 | }; 111 | }, 112 | minify: { 113 | collapseWhitespace: true, 114 | removeAttributeQuotes: true, 115 | removeComments: true 116 | }, 117 | nodeModules: false 118 | }), 119 | new webpack.DefinePlugin({ 120 | 'process.env.IS_WEB': 'true' 121 | }), 122 | new webpack.HotModuleReplacementPlugin(), 123 | new webpack.NoEmitOnErrorsPlugin() 124 | ], 125 | output: { 126 | filename: '[name].js', 127 | path: path.join(__dirname, '../dist/web') 128 | }, 129 | resolve: { 130 | alias: { 131 | '@': path.join(__dirname, '../src/renderer'), 132 | 'vue$': 'vue/dist/vue.esm.js' 133 | }, 134 | extensions: ['.js', '.vue', '.json', '.css'] 135 | }, 136 | target: 'web' 137 | } 138 | 139 | /** 140 | * Adjust webConfig for production settings 141 | */ 142 | if (process.env.NODE_ENV === 'production') { 143 | webConfig.devtool = '' 144 | 145 | webConfig.plugins.push( 146 | new BabiliWebpackPlugin(), 147 | new CopyWebpackPlugin([ 148 | { 149 | from: path.join(__dirname, '../static'), 150 | to: path.join(__dirname, '../dist/web/static'), 151 | ignore: ['.*'] 152 | } 153 | ]), 154 | new webpack.DefinePlugin({ 155 | 'process.env.NODE_ENV': '"production"' 156 | }), 157 | new webpack.LoaderOptionsPlugin({ 158 | minimize: true 159 | }) 160 | ) 161 | } 162 | 163 | module.exports = webConfig 164 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/.eslintignore -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | sourceType: 'module' 6 | }, 7 | env: { 8 | browser: true, 9 | node: true 10 | }, 11 | globals: { 12 | __static: true 13 | }, 14 | plugins: [ 15 | 'html' 16 | ], 17 | 'rules': { 18 | // allow debugger during development 19 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## 前置需求 2 | 可全局使用 scrcpy adb 命令 3 | 4 | ## 所需信息 5 | 1. 手机类型 6 | 2. 系统信息 7 | 3. scrcpy 版本 8 | 4. 是否可以使用 scrcpy 在命令行 打开设备 9 | 5. 出错信息 10 | 11 | ## Pre-requirements 12 | Can use the scrcpy adb command globally 13 | 14 | ## Required information 15 | 1. Mobile phone information 16 | 2. System information 17 | 3. scrcpy version 18 | 4. Is it possible to open the device on the command line using scrcpy? 19 | 5. Error message 20 | -------------------------------------------------------------------------------- /.github/lock.yml: -------------------------------------------------------------------------------- 1 | # Configuration for lock-threads - https://github.com/dessant/lock-threads 2 | 3 | # Number of days of inactivity before a closed issue or pull request is locked 4 | daysUntilLock: 180 5 | # Comment to post before locking. Set to `false` to disable 6 | lockComment: > 7 | This issue has been automatically locked since there has not been 8 | any recent activity after it was closed. If you can still reproduce this issue in 9 | [Safe Mode](https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode) 10 | then please open a new issue and fill out 11 | [the entire issue template](https://github.com/atom/.github/blob/master/.github/ISSUE_TEMPLATE/bug_report.md) 12 | to ensure that we have enough information to address your issue. Thanks! 13 | # Issues or pull requests with these labels will not be locked 14 | exemptLabels: 15 | - help-wanted 16 | # Limit to only `issues` or `pulls` 17 | only: issues 18 | -------------------------------------------------------------------------------- /.github/move.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/.github/move.yml -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-no-response - https://github.com/probot/no-response 2 | 3 | # Number of days of inactivity before an issue is closed for lack of response 4 | daysUntilClose: 28 5 | 6 | # Label requiring a response 7 | responseRequiredLabel: more-information-needed 8 | 9 | # Comment to post when closing an issue for lack of response. Set to `false` to disable. 10 | closeComment: > 11 | This issue has been automatically closed because there has been no response 12 | to our request for more information from the original author. With only the 13 | information that is currently in the issue, we don't have enough information 14 | to take action. Please reach out if you have or find the answers we need so 15 | that we can investigate further. 16 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 365 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | # exemptLabels: 7 | # - pinned 8 | # - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | dist/electron/* 3 | dist/web/* 4 | build/* 5 | !build/icons 6 | !build/installer.nsh 7 | coverage 8 | node_modules/ 9 | npm-debug.log 10 | npm-debug.log.* 11 | thumbs.db 12 | !.gitkeep 13 | yarn-error.log 14 | docs/dist/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode8.3 2 | sudo: required 3 | dist: trusty 4 | language: c 5 | matrix: 6 | include: 7 | - os: osx 8 | - os: linux 9 | env: CC=clang CXX=clang++ npm_config_clang=1 10 | compiler: clang 11 | cache: 12 | directories: 13 | - node_modules 14 | - "$HOME/.electron" 15 | - "$HOME/.cache" 16 | addons: 17 | apt: 18 | packages: 19 | - libgnome-keyring-dev 20 | - icnsutils 21 | before_install: 22 | - mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([ 23 | "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz 24 | | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull 25 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi 26 | install: 27 | - nvm install 10.10.0 28 | - curl -o- -L https://yarnpkg.com/install.sh | bash 29 | - source ~/.bashrc 30 | - npm install -g xvfb-maybe 31 | - yarn 32 | script: 33 | - yarn run build 34 | branches: 35 | only: 36 | - master 37 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 🎉 Scrcpy-GUI 1.0.0 2 | 3 | *To receive a notification on new releases, click on **Watch > Releases only** on the top.* 4 | 5 | --- 6 | 7 | Because I don't have a macOS, I can't package dmg format. 8 | 9 | You can only compile it manually. 10 | 11 | Packaged files are generated to the `scrcpy/build` folder. 12 | ```shell 13 | git clone https://github.com/Tomotoes/scrcpy-gui 14 | cd scrcpy-gui 15 | npm i 16 | npm run build 17 | ``` 18 | 19 | If you have packaged dmg format software, please send it to me via email(simon@tomotoes.com), thank you! 20 | 21 | Feel free to open issues or PRs for any problem you may encounter, typos that you see or aspects that are confusing. Contributions are welcome, open an issue or email me if you have something you want to work on. 22 | 23 | 24 | 因为我没有 macOS, 所以我无法打包出 `dmg` 格式的应用. 25 | 26 | 你可以通过以下命令手动打包这个项目, 打包文件将生成到 `scrcpy/build` 文件夹. 27 | ```shell 28 | git clone https://github.com/Tomotoes/scrcpy-gui 29 | cd scrcpy-gui 30 | npm i 31 | npm run build 32 | ``` 33 | 34 | 如果你已经打包出了 `dmg`格式的软件,欢迎通过 email(simon@tomotoes.com) 发送给我, 谢谢了! 35 | 36 | 37 | 如果你因不可抗力原因无法下载软件, 我提供了百度云盘分享链接,里面也包括`scrcpy`软件: 38 | 39 | 链接: https://pan.baidu.com/s/1IESNnqxS67tT50JxQSZC-A 提取码: 8d1h 40 | 41 | 如果你有任何问题, 欢迎提交 `Issues` 或 `PR`. 42 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | education, socio-economic status, nationality, personal appearance, race, 10 | religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at simon@tomotoes.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | [fork]: /fork 4 | [pr]: /compare 5 | [style]: https://standardjs.com/ 6 | [code-of-conduct]: CODE_OF_CONDUCT.md 7 | 8 | Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. 9 | 10 | Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. 11 | 12 | ## Issues and PRs 13 | 14 | If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them. 15 | 16 | We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR. 17 | 18 | ## Submitting a pull request 19 | 20 | 1. [Fork][fork] and clone the repository. 21 | 1. Configure and install the dependencies: `npm install`. 22 | 1. Make sure the tests pass on your machine: `npm test`, note: these tests also apply the linter, so there's no need to lint separately. 23 | 1. Create a new branch: `git checkout -b my-branch-name`. 24 | 1. Make your change, add tests, and make sure the tests still pass. 25 | 1. Push to your fork and [submit a pull request][pr]. 26 | 1. Pat your self on the back and wait for your pull request to be reviewed and merged. 27 | 28 | Here are a few things you can do that will increase the likelihood of your pull request being accepted: 29 | 30 | - Follow the [style guide][style] which is using standard. Any linting errors should be shown when running `npm test`. 31 | - Write and update tests. 32 | - Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. 33 | - Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). 34 | 35 | Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you. 36 | 37 | ## Resources 38 | 39 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 40 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) 41 | - [GitHub Help](https://help.github.com) 42 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 | ## 常见问题 2 | > 在使用`scrcpy-gui`期间,你可能会遇到很多问题,不过你的问题可能之前就有人提问过,也被解决,所以你可以先看看使用文档。这份FAQ,以及那些被关闭的`issues`,应该能找到答案。 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | tomoto 3 |
4 |

Scrcpy GUI

5 | Built with ❤︎ by Simon Ma - 中文文档 6 |
7 |
8 |

A simple & beautiful GUI application for scrcpy

9 |

NOTE: Simon no energy to continue maintenance, if interested please fork

10 | 11 |

12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

28 | 29 | ## 💡Introduction 30 | 31 |
32 |
33 | 34 | 35 | 36 | [Scrcpy](https://github.com/Genymobile/scrcpy) was created by the team behind the popular Android emulator Genymotion, but it is not an Android emulator itself, it displays and controls Android devices connected via USB or TCP/IP, it does not require any root access. It works with GNU/Linux, Windows, and MacOS. 37 | 38 | Scrcpy works by running a server on your Android device, and the desktop application communicates using USB (or using ADB tunneling wireless). The server streams the H.264 video of the device screen. The client decodes the video frames and displays them. The client captures input (keyboard and mouse) events, sends them to the server, and the server injects them into the device. [The documentation](https://github.com/Genymobile/scrcpy/blob/master/DEVELOP.md) provides more details. 39 | 40 | If you want to see your Android screen interact with the app or content on your desktop, record your phone screen or perform other basic tasks, then Scrcpy is a good choice. 41 | 42 | In short, Scrcpy is an excellent way to easily view your Android screen on your computer and interact with it in real time. 43 | 44 | 45 | 46 | ## ✨Features 47 | 48 | - **lightness** (native, displays only the device screen) 49 | - **performance** (30~60fps) 50 | - **quality** (1920×1080 or above) 51 | - **low latency** ([35~70ms](https://github.com/Genymobile/scrcpy/pull/646)) 52 | - **low startup time** (~1 second to display the first image) 53 | - **non-intrusiveness** (nothing is left installed on the device) 54 | - **No need for ROOT** 55 | - **Wired and wireless can be connected** 56 | - **You can adjust the interface and bit rate** 57 | - **Pictures can be cut at will, with a screen recording** 58 | - **Support multiple devices to screen at the same time** 59 | - **Control your phone with your computer's keyboard and mouse** 60 | - **Mobile computer sharing clipboard** 61 | - **Automatically detect USB connected apps** 62 | - **Can directly add the LAN IP of the device to achieve the effect of wireless control** 63 | - **Automatically save the connected IP address, automatically reminder the next time you enter** 64 | - **Support device alias** 65 | - **Support for Chinese and English** 66 | - **Tray menu** 67 | - **etc...** 68 | 69 | 70 | 71 | ## 🌞Requirements 72 | 73 | 1. The Android device requires at least API 21 (Android 5.0). 74 | 75 | 2. Make sure you [enabled adb debugging](https://developer.android.com/studio/command-line/adb.html#Enabling) on your device(s). 76 | 77 | On some devices, you also need to enable [an additional option](https://github.com/Genymobile/scrcpy/issues/70#issuecomment-373286323) to control it using keyboard and mouse. 78 | 79 | 3. Install scrcpy and configure environment variables 80 | 81 | - Linux 82 | 83 | On Linux, you typically need to [build the app manually](https://github.com/Genymobile/scrcpy/blob/master/BUILD.md). Don't worry, it's not that hard. 84 | 85 | A [Snap](https://en.wikipedia.org/wiki/Snappy_(package_manager)) package is available: [`scrcpy`](https://snapstats.org/snaps/scrcpy). 86 | 87 | For Arch Linux, an [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository) package is available: [`scrcpy`](https://aur.archlinux.org/packages/scrcpy/). 88 | 89 | For Gentoo, an [Ebuild](https://wiki.gentoo.org/wiki/Ebuild) is available: [`scrcpy/`](https://github.com/maggu2810/maggu2810-overlay/tree/master/app-mobilephone/scrcpy). 90 | 91 | - Windows 92 | 93 | For Windows, for simplicity, prebuilt archives with all the dependencies (including `adb`) are available: 94 | 95 | - [`scrcpy-win32-v1.10.zip`](https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win32-v1.10.zip) 96 | *(SHA-256: f98b400b3764404b33b212e9762dd6f1593ddb766c1480fc2609c94768e4a8e1)* 97 | - [`scrcpy-win64-v1.10.zip`](https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win64-v1.10.zip) 98 | *(SHA-256: 95de34575d873c7e95dfcfb5e74d0f6af4f70b2a5bc6fde0f48d1a05480e3a44)* 99 | 100 | You can also [build the app manually](https://github.com/Genymobile/scrcpy/blob/master/BUILD.md). 101 | 102 | - macOS 103 | 104 | The application is available in [Homebrew](https://brew.sh/). Just install it: 105 | 106 | ``` 107 | brew install scrcpy 108 | ``` 109 | 110 | You need `adb`, accessible from your `PATH`. If you don't have it yet: 111 | 112 | ``` 113 | brew cask install android-platform-tools 114 | ``` 115 | 116 | You can also [build the app manually](https://github.com/Genymobile/scrcpy/blob/master/BUILD.md). 117 | 118 | 119 | 120 | ## 🎉Install 121 | 122 | Click here to download [App](https://github.com/Tomotoes/scrcpy-gui/releases). 123 | 124 | 125 | 126 | ## 🎇Instructions 127 | 128 | ### connection method 129 | 130 | #### Prerequisites 131 | 132 | - Make sure **adb , scrcpy** are working properly 133 | - Make sure the phone is turned on for USB debugging and certified for computer debugging 134 | 135 | #### Wired connection 136 | 137 | 1. Make sure the phone is connected to the computer via the data cable 138 | 139 | 2. Wait for the software to automatically detect the device 140 | 3. Select the device and click `Open Selected Mirror`. 141 | 4. Wait for the device to open 142 | 143 | #### Wireless connections 144 | 145 | 1. Please make sure the phone is on the same LAN as the computer. 146 | 2. When connecting for the first time: 147 | - **Please make sure your phone is connected to your computer via the cable** 148 | - **Please make sure that only one mobile phone is connected to the computer via the data cable** 149 | - The first time you need to set the port, you can connect to the phone later, just add the static IP of the phone. 150 | 3. Enter the LAN IP address of the phone (if the IP is DHCP assigned, please change to static IP) 151 | 4. Click `Open wireless connection` 152 | 5. Waiting for the wireless connection to succeed 153 | 6. Select the device and click `Open Selected Mirror`. 154 | 7. Wait for the device to open 155 | 156 | 157 | 158 | ## Shortcuts 159 | 160 | | Action | Shortcut | Shortcut (macOS) | 161 | | --------------------------------------- | ----------------------------- | ---------------------------- | 162 | | Switch fullscreen mode | `Ctrl`+`f` | `Cmd`+`f` | 163 | | Resize window to 1:1 (pixel-perfect) | `Ctrl`+`g` | `Cmd`+`g` | 164 | | Resize window to remove black borders | `Ctrl`+`x` \| *Double-click¹* | `Cmd`+`x` \| *Double-click¹* | 165 | | Click on `HOME` | `Ctrl`+`h` \| *Middle-click* | `Ctrl`+`h` \| *Middle-click* | 166 | | Click on `BACK` | `Ctrl`+`b` \| *Right-click²* | `Cmd`+`b` \| *Right-click²* | 167 | | Click on `APP_SWITCH` | `Ctrl`+`s` | `Cmd`+`s` | 168 | | Click on `MENU` | `Ctrl`+`m` | `Ctrl`+`m` | 169 | | Click on `VOLUME_UP` | `Ctrl`+`↑` *(up)* | `Cmd`+`↑` *(up)* | 170 | | Click on `VOLUME_DOWN` | `Ctrl`+`↓` *(down)* | `Cmd`+`↓` *(down)* | 171 | | Click on `POWER` | `Ctrl`+`p` | `Cmd`+`p` | 172 | | Power on | *Right-click²* | *Right-click²* | 173 | | Turn device screen off (keep mirroring) | `Ctrl`+`o` | `Cmd`+`o` | 174 | | Expand notification panel | `Ctrl`+`n` | `Cmd`+`n` | 175 | | Collapse notification panel | `Ctrl`+`Shift`+`n` | `Cmd`+`Shift`+`n` | 176 | | Copy device clipboard to computer | `Ctrl`+`c` | `Cmd`+`c` | 177 | | Paste computer clipboard to device | `Ctrl`+`v` | `Cmd`+`v` | 178 | | Copy computer clipboard to device | `Ctrl`+`Shift`+`v` | `Cmd`+`Shift`+`v` | 179 | | Enable/disable FPS counter (on stdout) | `Ctrl`+`i` | `Cmd`+`i` | 180 | 181 | *¹Double-click on black borders to remove them.* 182 | *²Right-click turns the screen on if it was off, presses BACK otherwise.* 183 | 184 | 185 | 186 | ## 🎯Develop 187 | 188 | This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[8fae476](https://github.com/SimulatedGREG/electron-vue/tree/8fae4763e9d225d3691b627e83b9e09b56f6c935) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html). 189 | 190 | Feel free to open issues or PRs for any problem you may encounter, typos that you see or aspects that are confusing. Contributions are welcome, open an issue or email me if you have something you want to work on. 191 | 192 | ``` bash 193 | # install dependencies 194 | npm install 195 | 196 | # serve with hot reload at localhost:9080 197 | npm run dev 198 | 199 | # build electron application for production 200 | npm run build 201 | 202 | # lint all JS/Vue component files in `src/` 203 | npm run lint 204 | ``` 205 | 206 | 207 | 208 | ## 👀Reward 209 | 210 | If you like `scrcpy-gui` and it really helps you, please give me a cup of coffee~ 211 | 212 | paypal: [https://paypal.me/tomotoes](https://paypal.me/tomotoes) 213 | 214 | [![Alipay:](https://camo.githubusercontent.com/f4874996db5ac421925db08778d800d76d36abbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545362539342541462545342542422539382545352541452539442d25453525393025393154412545362538442539302545352538412541392d677265656e2e737667)](https://cdn.jsdelivr.net/gh/Tomotoes/images/blog/alipay.png)[![Wechat:](https://camo.githubusercontent.com/26101aa838286ad0d45a6f71b25fdc6e14e7668c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545352542452541452545342542462541312d25453525393025393154412545362538442539302545352538412541392d677265656e2e737667)](https://cdn.jsdelivr.net/gh/Tomotoes/images/blog/wechat.png) 215 | 216 | 217 | ## 📃License 218 | 219 | **GNU GPLv3** 220 | -------------------------------------------------------------------------------- /README.zh_CN.md: -------------------------------------------------------------------------------- 1 |
2 | tomoto 3 |
4 |

Scrcpy GUI

5 | Built with ❤︎ by Simon Ma - English document 6 |
7 |
8 |

一个简洁&漂亮的 scrcpy GUI 应用

9 |

10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |

26 | 27 | 28 | 29 | ## 💡简介 30 | 31 |

点击链接加入QQ群聊【Scrcpy-GUI】

Topbook: 不用花钱,三步投屏手机到任何电脑系统,支持高帧率录屏、电脑控制手机。

32 |

感谢 Topbook 平台的分享!

33 |
34 |
35 | 36 | [Scrcpy](https://github.com/Genymobile/scrcpy) 是由流行的`Android`模拟器`Genymotion`背后的团队创建的,但它本身并不是`Android`模拟器,它显示和控制通过`USB`(或通过`TCP/IP`)连接的`Android`设备,它不需要任何`root`访问权限,它适用于`GNU/Linux`、`Windows`和`MacOS`。 37 | 38 | `Scrcpy`的工作原理是在你的`Android`设备上运行服务器,桌面应用程序使用`USB`(或使用`ADB`隧道无线)进行通信。服务器流式传输设备屏幕的[H.264](https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=en&sp=nmt4&tl=zh-CN&u=https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC&xid=25657,15700019,15700124,15700186,15700190,15700201,15700237,15700242,15700248&usg=ALkJrhiJZJWaUqBVRqUviQ4IlhKQCwqp_Q)视频。 客户端解码视频帧并显示它们。客户端捕获输入(键盘和鼠标)事件,将它们发送到服务器,服务器将它们注入设备。[文档](https://github.com/Genymobile/scrcpy/blob/master/DEVELOP.md)提供了更多详细信息。 39 | 40 | 如果你想在桌面上看到你的`Android`屏幕与应用程序或内容进行交互,记录你的手机屏幕或执行其他基本任务,那`Scrcpy`就是一个好的选择。 41 | 42 | 简而言之,`Scrcpy`是一种极好的方式,可以在你的计算机上轻松查看你的`Android`屏幕,并且可以实时与其进行交互。 43 | 44 | *引用自[云网牛站](https://ywnz.com/linuxsj/5581.html)* 45 | 46 | 47 | 48 | ## ✨亮点 49 | 50 | - **亮度** (原生,仅显示设备屏幕) 51 | - **表演** (30~60fps) 52 | - **质量** (1920×1080或以上) 53 | - **低延迟** (70~100ms) 54 | - **启动时间短** (显示第一张图像约1秒) 55 | - **非侵入性** (设备上没有安装任何东西) 56 | - **不需要 ROOT** 57 | - **有线无线都可连接** 58 | - **可以随便调整界面和码率** 59 | - **画面随意裁剪,自带录屏(手游直播利器)** 60 | - **支持多设备同时投屏** 61 | - **利用电脑的键盘和鼠标可以控制手机** 62 | - **把 APK 文件拖拽到电脑窗口即可安装应用到手机,把普通文件拖拽到窗口即可复制到手机** 63 | - **手机电脑共享剪贴板** 64 | - **自动检测USB连接的设备** 65 | - **可直接添加设备的局域网IP,达到无线控制的效果** 66 | - **将自动保存连接过的IP地址,下次输入时,自动提醒** 67 | - **支持设备别名** 68 | - **支持中英两种语言** 69 | - **Tray menu** 70 | - 等等等... 71 | 72 | *部分引用自[最美应用](http://zuimeia.com/app/6771/?platform=2)* 73 | 74 | 75 | 76 | ## 🌞要求 77 | 78 | 1. `Android 5.0`以上 79 | 80 | 2. 打开USB调试 81 | 82 | 在 `开发人员选项` 打开 `USB调试`,USB连接手机 83 | ![img](https://cdn.jsdelivr.net/gh/Tomotoes/images/scrcpy-gui/1.jpg) 84 | 85 | 3. 安装好`ADB` ,并配置环境变量。 86 | 87 | [Windows](https://dl.google.com/android/repository/platform-tools-latest-windows.zip) 88 | [Mac OS](https://dl.google.com/android/repository/platform-tools-latest-darwin.zip) 89 | [Linux](https://dl.google.com/android/repository/platform-tools-latest-linux.zip) 90 | 91 | 在任何路径下打开命令行,键入 `ADB` 有反馈。 92 | 93 | 4. 安装好`scrcpy`,并配置环境变量 94 | 95 | - Windows 96 | 97 | Windows 可以使用包含所有依赖项(包括adb)的预构建存档: 98 | 99 | 下载下面`scrcpy`的压缩包,里面有`ADB`文件,然后把解压后的`scrcpy`文件夹添加到环境变量,再重启电脑,就可以了。 100 | 101 | 1. [`scrcpy-win32-v1.10.zip`](https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win32-v1.10.zip) 102 | *(SHA-256: f98b400b3764404b33b212e9762dd6f1593ddb766c1480fc2609c94768e4a8e1)* 103 | 2. [`scrcpy-win64-v1.10.zip`](https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-win64-v1.10.zip) 104 | *(SHA-256: 95de34575d873c7e95dfcfb5e74d0f6af4f70b2a5bc6fde0f48d1a05480e3a44)* 105 | 106 | 你也可以[手动构建](https://github.com/Genymobile/scrcpy/blob/master/BUILD.md)。 107 | 108 | - Mac OS 109 | 110 | 可以使用 [Homebrew](https://brew.sh/) 来安装: 111 | 112 | ``` 113 | brew install scrcpy 114 | ``` 115 | 116 | 如果你还没有安装`ADB`,可以使用下面的命令: 117 | 118 | ``` 119 | brew cask install android-platform-tools 120 | ``` 121 | 122 | 你也可以[手动构建](https://github.com/Genymobile/scrcpy/blob/master/BUILD.md)。 123 | 124 | - Linux 125 | 126 | 你可能需要[手动构建应用程序](https://github.com/Genymobile/scrcpy/blob/master/BUILD.md)。别担心,这并不难。 127 | 128 | 此外,提供了 [Snap](https://en.wikipedia.org/wiki/Snappy_(package_manager)) 包:[`scrcpy`](https://snapstats.org/snaps/scrcpy) 129 | 130 | 对于 Arch Linux, 可以使用 [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository) 包:[`scrcpy`](https://aur.archlinux.org/packages/scrcpy/) 131 | 132 | 对于 Gentoo,可以使用 [Ebuild](https://wiki.gentoo.org/wiki/Ebuild) 包: [`scrcpy/`](https://github.com/maggu2810/maggu2810-overlay/tree/master/app-mobilephone/scrcpy) 133 | 134 | 135 | 136 | ## 🎉安装 137 | 138 | 点击此处下载[应用](https://github.com/Tomotoes/scrcpy-gui/releases)。 139 | 140 | 141 | 142 | ## 🎇使用 143 | 144 | ### 连接方法 145 | 146 | #### 必备条件 147 | 148 | - 请确保 **adb , scrcpy** 可正常使用 149 | - 请确保手机已打开 USB 调试, 并已认证电脑调试 150 | 151 | #### 有线连接 152 | 153 | 1. 请确保手机已通过数据线连接到电脑 154 | 155 | 2. 等待软件自动检测到设备 156 | 3. 选中设备,点击`打开选中的镜像` 157 | 4. 等待设备打开 158 | 159 | #### 无线连接 160 | 161 | 1. 请确保手机与电脑处在同一局域网 162 | 163 | 2. 第一次无线连接时: 164 | - **请确保手机已通过数据线连接到电脑** 165 | - **请确保只有一个手机通过数据线连接到电脑** 166 | - 第一次需设置端口,以后连接手机,只需要添加手机的静态IP即可 167 | 168 | 3. 输入手机的局域网`IP`地址(如果`IP`为`DHCP`分配,请更改为静态`IP`) 169 | 170 | 4. 点击`开启无线连接` 171 | 172 | 5. 等待无线连接成功 173 | 174 | 6. 选中设备,点击`打开选中的镜像` 175 | 176 | 7. 等待设备打开 177 | 178 | 179 | 180 | ### 快捷键 181 | 182 | | 操作 | 快捷键 | 快捷键 (macOS) | 183 | | -------------------------------- | ---------------------------- | --------------------------- | 184 | | 切换全屏模式 | `Ctrl`+`f` | `Cmd`+`f` | 185 | | 将窗口调整为 1:1 | `Ctrl`+`g` | `Cmd`+`g` | 186 | | 调整窗口大小以删除黑色边框 | `Ctrl`+`x` \| *双击黑色背景* | `Cmd`+`x` \| *双击黑色背景* | 187 | | 设备`HOME`键 | `Ctrl`+`h` \| *鼠标中键* | `Ctrl`+`h` \| *鼠标中键* | 188 | | 设备`BACK`键 | `Ctrl`+`b` \| *鼠标右键* | `Cmd`+`b` \| *鼠标右键* | 189 | | 设备`任务管理`键 | `Ctrl`+`s` | `Cmd`+`s` | 190 | | 设备`菜单`键 | `Ctrl`+`m` | `Ctrl`+`m` | 191 | | 设备`音量+`键 | `Ctrl`+`↑` | `Cmd`+`↑` | 192 | | 设备`音量-`键 | `Ctrl`+`↓` | `Cmd`+`↓` | 193 | | 设备`电源`键 | `Ctrl`+`p` | `Cmd`+`p` | 194 | | 点亮手机屏幕 | *鼠标右键* | *鼠标右键* | 195 | | 关闭设备屏幕(保持镜像) | `Ctrl`+`o` | `Cmd`+`o` | 196 | | 展开通知面板 | `Ctrl`+`n` | `Cmd`+`n` | 197 | | 折叠通知面板 | `Ctrl`+`Shift`+`n` | `Cmd`+`Shift`+`n` | 198 | | 将设备剪贴板中的内容复制到计算机 | `Ctrl`+`c` | `Cmd`+`c` | 199 | | 将计算机剪贴板中的内容粘贴到设备 | `Ctrl`+`v` | `Cmd`+`v` | 200 | | 将计算机剪贴板中的内容复制到设备 | `Ctrl`+`Shift`+`v` | `Cmd`+`Shift`+`v` | 201 | | 安装`APK` | 将`APK`文件拖入投屏 | 将`APK`文件拖入投屏 | 202 | | 传输文件到设备 | 将文件拖入投屏 | 将文件拖入投屏 | 203 | | 启用/禁用FPS计数器(stdout) | `Ctrl`+`i` | `Cmd`+`i` | 204 | 205 | 206 | 207 | ## 🎯开发 208 | 209 | This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[8fae476](https://github.com/SimulatedGREG/electron-vue/tree/8fae4763e9d225d3691b627e83b9e09b56f6c935) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html). 210 | 211 | 如果你有任何问题,欢迎提交 `Issues` 或 `PR`! 212 | 213 | ``` bash 214 | # install dependencies 215 | npm install 216 | 217 | # serve with hot reload at localhost:9080 218 | npm run dev 219 | 220 | # build electron application for production 221 | npm run build 222 | 223 | # lint all JS/Vue component files in `src/` 224 | npm run lint 225 | ``` 226 | 227 | 228 | 229 | 230 | ## 👀赞助 231 | 232 | 如果你喜欢`scrcpy-gui`,并且它对你确实有帮助,欢迎给我打赏一杯咖啡哈~ 233 | 234 | paypal: [https://paypal.me/tomotoes](https://paypal.me/tomotoes) 235 | 236 | [![支付宝赞助按钮](https://camo.githubusercontent.com/f4874996db5ac421925db08778d800d76d36abbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545362539342541462545342542422539382545352541452539442d25453525393025393154412545362538442539302545352538412541392d677265656e2e737667)](https://cdn.jsdelivr.net/gh/Tomotoes/images/blog/alipay.png)[![微信赞助按钮](https://camo.githubusercontent.com/26101aa838286ad0d45a6f71b25fdc6e14e7668c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545352542452541452545342542462541312d25453525393025393154412545362538442539302545352538412541392d677265656e2e737667)](https://cdn.jsdelivr.net/gh/Tomotoes/images/blog/wechat.png) 237 | 238 | 239 | ## 📃协议 240 | 241 | **GNU GPLv3** 242 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-merlot -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # Commented sections below can be used to run tests on the CI server 2 | # https://simulatedgreg.gitbooks.io/electron-vue/content/en/testing.html#on-the-subject-of-ci-testing 3 | version: 0.1.{build} 4 | 5 | branches: 6 | only: 7 | - master 8 | 9 | image: Visual Studio 2017 10 | platform: 11 | - x64 12 | 13 | cache: 14 | - node_modules 15 | - '%APPDATA%\npm-cache' 16 | - '%USERPROFILE%\.electron' 17 | - '%USERPROFILE%\AppData\Local\Yarn\cache' 18 | 19 | init: 20 | - git config --global core.autocrlf input 21 | 22 | install: 23 | - ps: Install-Product node 8 x64 24 | - git reset --hard HEAD 25 | - npm install 26 | - node --version 27 | 28 | build_script: 29 | #- yarn test 30 | - npm run release 31 | 32 | test: off 33 | -------------------------------------------------------------------------------- /build/icons/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/build/icons/16x16.png -------------------------------------------------------------------------------- /build/icons/256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/build/icons/256x256.png -------------------------------------------------------------------------------- /build/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/build/icons/icon.icns -------------------------------------------------------------------------------- /build/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/build/icons/icon.ico -------------------------------------------------------------------------------- /dist/electron/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/dist/electron/.gitkeep -------------------------------------------------------------------------------- /dist/web/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/dist/web/.gitkeep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scrcpy-gui", 3 | "version": "1.5.1", 4 | "author": "SimonMa ", 5 | "homepage": "https://github.com/Tomotoes/scrcpy-gui", 6 | "description": "✨ A simple & beautiful GUI application for scrcpy", 7 | "license": "Apache-2.0", 8 | "main": "./dist/electron/main.js", 9 | "scripts": { 10 | "build": "node .electron-vue/build.js && electron-builder", 11 | "build:dir": "node .electron-vue/build.js && electron-builder --dir", 12 | "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", 13 | "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", 14 | "start": "node .electron-vue/dev-runner.js", 15 | "lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src", 16 | "lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src", 17 | "pack": "npm run pack:main && npm run pack:renderer", 18 | "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js", 19 | "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js", 20 | "postinstall": "npm run lint:fix" 21 | }, 22 | "build": { 23 | "productName": "ScrcpyGui", 24 | "appId": "com.tomotoes.scrcpygui", 25 | "copyright": "Copyright © 2019 ${author}", 26 | "artifactName": "${productName}-${version}.${ext}", 27 | "compression": "maximum", 28 | "directories": { 29 | "output": "build" 30 | }, 31 | "asar": true, 32 | "files": [ 33 | "dist/electron/**/*" 34 | ], 35 | "dmg": { 36 | "contents": [ 37 | { 38 | "x": 410, 39 | "y": 150, 40 | "type": "link", 41 | "path": "/Applications" 42 | }, 43 | { 44 | "x": 130, 45 | "y": 150, 46 | "type": "file" 47 | } 48 | ] 49 | }, 50 | "mac": { 51 | "icon": "build/icons/icon.icns" 52 | }, 53 | "win": { 54 | "icon": "build/icons/icon.ico", 55 | "target": [ 56 | { 57 | "target": "nsis", 58 | "arch": [ 59 | "x64", 60 | "ia32" 61 | ] 62 | } 63 | ], 64 | "legalTrademarks": "Simon Personal" 65 | }, 66 | "nsis": { 67 | "oneClick": false, 68 | "allowToChangeInstallationDirectory": true, 69 | "menuCategory": true, 70 | "allowElevation": false 71 | }, 72 | "linux": { 73 | "icon": "build/icons", 74 | "target": [ 75 | "AppImage", 76 | "deb" 77 | ] 78 | } 79 | }, 80 | "dependencies": { 81 | "adbkit": "^2.11.1", 82 | "custom-electron-titlebar": "^3.2.2", 83 | "debug": "^4.1.1", 84 | "element-ui": "^2.11.1", 85 | "fix-path": "^3.0.0", 86 | "localstorage": "^1.0.1", 87 | "normalize.css": "^8.0.1", 88 | "vue": "^2.5.16", 89 | "vue-electron": "^1.0.6", 90 | "vue-i18n": "^8.14.0", 91 | "vue-router": "^3.1.2" 92 | }, 93 | "devDependencies": { 94 | "ajv": "^6.5.0", 95 | "babel-core": "^6.26.3", 96 | "babel-eslint": "^8.2.3", 97 | "babel-loader": "^7.1.4", 98 | "babel-plugin-component": "^1.1.1", 99 | "babel-plugin-transform-runtime": "^6.23.0", 100 | "babel-preset-env": "^1.7.0", 101 | "babel-preset-stage-0": "^6.24.1", 102 | "babel-register": "^6.26.0", 103 | "babili-webpack-plugin": "^0.1.2", 104 | "cfonts": "^2.1.2", 105 | "chalk": "^2.4.1", 106 | "copy-webpack-plugin": "^4.5.1", 107 | "cross-env": "^5.1.6", 108 | "css-loader": "^0.28.11", 109 | "del": "^3.0.0", 110 | "devtron": "^1.4.0", 111 | "electron": "^2.0.4", 112 | "electron-builder": "^20.19.2", 113 | "electron-debug": "^1.5.0", 114 | "electron-devtools-installer": "^2.2.4", 115 | "eslint": "^4.19.1", 116 | "eslint-friendly-formatter": "^4.0.1", 117 | "eslint-loader": "^2.0.0", 118 | "eslint-plugin-html": "^4.0.3", 119 | "file-loader": "^1.1.11", 120 | "html-webpack-plugin": "^3.2.0", 121 | "mini-css-extract-plugin": "0.4.0", 122 | "multispinner": "^0.2.1", 123 | "node-loader": "^0.6.0", 124 | "node-sass": "^4.9.2", 125 | "sass-loader": "^7.0.3", 126 | "style-loader": "^0.21.0", 127 | "url-loader": "^1.0.1", 128 | "vue-html-loader": "^1.2.4", 129 | "vue-loader": "^15.2.4", 130 | "vue-style-loader": "^4.1.0", 131 | "vue-template-compiler": "^2.5.16", 132 | "webpack": "^4.15.1", 133 | "webpack-cli": "^3.0.8", 134 | "webpack-dev-server": "^3.1.4", 135 | "webpack-hot-middleware": "^2.22.2", 136 | "webpack-merge": "^4.1.3" 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/screenshot.gif -------------------------------------------------------------------------------- /src/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% if (htmlWebpackPlugin.options.nodeModules) { %> 6 | 7 | 10 | <% } %> 11 | 12 | 13 |
14 | 15 | <% if (!process.browser) { %> 16 | 22 | <% } %> 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/adb/index.js: -------------------------------------------------------------------------------- 1 | import adb from 'adbkit' 2 | const client = adb.createClient() 3 | const debug = require('debug')('scrcpy') 4 | 5 | const onDevices = sender => { 6 | client.trackDevices() 7 | .then(function (tracker) { 8 | tracker.on('add', function (device) { 9 | debug('Device %s was plugged in', device.id) 10 | client.listDevices().then(function (devices) { 11 | debug(devices) 12 | sender.send('devices', devices) 13 | }) 14 | }) 15 | tracker.on('remove', function (device) { 16 | debug('Device %s was unplugged', device.id) 17 | client.listDevices().then(function (devices) { 18 | debug(devices) 19 | sender.send('devices', devices) 20 | }) 21 | }) 22 | tracker.on('end', function () { 23 | debug('Tracking stopped') 24 | }) 25 | }) 26 | .catch(function (err) { 27 | debugor('Something went wrong:', err.stack) 28 | }) 29 | } 30 | const connect = ({ sender }, args) => { 31 | const { id, ip } = args 32 | const success = 'Successfully opened wireless connection' 33 | const fail = 'Failed to open wireless connection' 34 | if (id) { 35 | client.tcpip(id) 36 | .then(function (port) { 37 | client.connect(ip, port).then(function (err) { 38 | if (err) { 39 | sender.send('connect', { success: false, message: fail }) 40 | return 41 | } 42 | sender.send('connect', { success: true, message: success }) 43 | }).catch(() => { 44 | sender.send('connect', { success: false, message: fail }) 45 | }) 46 | }).catch(() => { 47 | client.connect(ip).then(function (err) { 48 | if (err) { 49 | sender.send('connect', { success: false, message: fail }) 50 | return 51 | } 52 | sender.send('connect', { success: true, message: success }) 53 | }).catch(() => { 54 | sender.send('connect', { success: false, message: fail }) 55 | }) 56 | }) 57 | } else { 58 | client.connect(ip).then(function (err) { 59 | if (err) { 60 | sender.send('connect', { success: false, message: fail }) 61 | return 62 | } 63 | sender.send('connect', { success: true, message: success }) 64 | }).catch(() => { 65 | sender.send('connect', { success: false, message: fail }) 66 | }) 67 | } 68 | } 69 | 70 | const disconnect = ({ sender }, ip) => { 71 | client.disconnect(ip).then(id => { 72 | debug(id) 73 | sender.send('connect', { success: false, message: 'Device shutdown succeeded' }) 74 | }).catch(err => { 75 | debug(err) 76 | sender.send('connect', { success: false, message: 'Device shutdown failed' }) 77 | }) 78 | } 79 | 80 | export default { 81 | connect, disconnect, onDevices 82 | } 83 | -------------------------------------------------------------------------------- /src/main/index.dev.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is used specifically and only for development. It installs 3 | * `electron-debug` & `vue-devtools`. There shouldn't be any need to 4 | * modify this file, but it can be used to extend your development 5 | * environment. 6 | */ 7 | 8 | /* eslint-disable */ 9 | 10 | // Install `electron-debug` with `devtron` 11 | require('electron-debug')({ showDevTools: true }) 12 | 13 | // Install `vue-devtools` 14 | require('electron').app.on('ready', () => { 15 | let installExtension = require('electron-devtools-installer') 16 | installExtension.default(installExtension.VUEJS_DEVTOOLS) 17 | .then(() => {}) 18 | .catch(err => { 19 | console.log('Unable to install `vue-devtools`: \n', err) 20 | }) 21 | }) 22 | 23 | // Require `main` process to boot app 24 | require('./index') -------------------------------------------------------------------------------- /src/main/index.js: -------------------------------------------------------------------------------- 1 | import { app, BrowserWindow, ipcMain } from 'electron' 2 | import adb from './adb' 3 | import scrcpy from './scrcpy' 4 | 5 | /** 6 | * Set `__static` path to static files in production 7 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html 8 | */ 9 | if (process.env.NODE_ENV !== 'development') { 10 | global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\') 11 | } 12 | 13 | let mainWindow 14 | const winURL = process.env.NODE_ENV === 'development' 15 | ? 'http://localhost:9080' 16 | : `file://${__dirname}/index.html` 17 | 18 | function createWindow() { 19 | /** 20 | * Initial window options 21 | */ 22 | mainWindow = new BrowserWindow({ 23 | height: 800, 24 | width: 513, 25 | frame: false, 26 | title: 'Scrcpy', 27 | fullscreenable: false, 28 | // titleBarStyle: 'hidden', 29 | vibrancy: 'ultra-dark', 30 | center: true, 31 | icon: `${__static}/icons/256x256.png`, 32 | show: false, 33 | webPreferences: { 34 | backgroundThrottling: false 35 | }, 36 | // resizable: false 37 | }) 38 | 39 | mainWindow.setMenu(null) 40 | 41 | mainWindow.loadURL(winURL) 42 | mainWindow.once('ready-to-show', () => { 43 | mainWindow.show() 44 | // mainWindow.webContents.openDevTools() 45 | }) 46 | mainWindow.on('close', () => { 47 | ipcMain.removeAllListeners('open') 48 | ipcMain.removeAllListeners('connect') 49 | ipcMain.removeAllListeners('disconnect') 50 | }) 51 | 52 | mainWindow.on('closed', () => { 53 | mainWindow = null 54 | }) 55 | 56 | mainWindow.webContents.on('did-finish-load', function () { 57 | adb.onDevices(mainWindow.webContents) 58 | ipcMain.on('open', scrcpy.open) 59 | ipcMain.on('connect', adb.connect) 60 | ipcMain.on('disconnect', adb.disconnect) 61 | 62 | }) 63 | } 64 | 65 | app.on('ready', createWindow) 66 | 67 | app.on('window-all-closed', () => { 68 | if (process.platform !== 'darwin') { 69 | app.quit() 70 | } 71 | }) 72 | 73 | app.on('activate', () => { 74 | if (mainWindow === null) { 75 | createWindow() 76 | } 77 | }) 78 | 79 | /** 80 | * Auto Updater 81 | * 82 | * Uncomment the following code below and install `electron-updater` to 83 | * support auto updating. Code Signing with a valid certificate is required. 84 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating 85 | */ 86 | 87 | /* 88 | import { autoUpdater } from 'electron-updater' 89 | 90 | autoUpdater.on('update-downloaded', () => { 91 | autoUpdater.quitAndInstall() 92 | }) 93 | 94 | app.on('ready', () => { 95 | if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates() 96 | }) 97 | */ 98 | -------------------------------------------------------------------------------- /src/main/scrcpy/index.js: -------------------------------------------------------------------------------- 1 | const debug = require('debug')('scrcpy') 2 | const fixPath = require('fix-path') 3 | fixPath() 4 | const fs = require('fs') 5 | const open = ({ sender }, options) => { 6 | const args = [] 7 | const { config, devices } = options 8 | const { title, source, record, screen, fixed, control, touch, render, bitRate, maxSize, maxFps, orientation, crop, window, border, fullscreen, awake } = config 9 | const { open, openMirror, filepath } = record 10 | 11 | let cmd = 'scrcpy' 12 | if (source) { 13 | const scrcpyPath = `${source}\\scrcpy.exe` 14 | if (!fs.existsSync(scrcpyPath)) { 15 | sender.send('error', { type: 'unknownScrcpyPathException' }) 16 | return 17 | } 18 | cmd = scrcpyPath 19 | } 20 | 21 | args.push('--shortcut-mod=lctrl,rctrl') 22 | 23 | if (title !== '') { 24 | args.push('--window-title') 25 | args.push(title) 26 | } 27 | 28 | if (open) { 29 | if (!openMirror) { 30 | args.push('--no-display') 31 | } 32 | args.push('--record') 33 | args.push(filepath) 34 | } 35 | if (screen) { 36 | args.push('--turn-screen-off') 37 | } 38 | if (fixed) { 39 | args.push('--always-on-top') 40 | } 41 | if (!border) { 42 | args.push('--window-borderless') 43 | } 44 | if (fullscreen) { 45 | args.push('--fullscreen') 46 | } 47 | if (awake) { 48 | args.push('--stay-awake') 49 | } else if (!control) { 50 | args.push('--no-control') 51 | } 52 | if (touch) { 53 | args.push('--show-touches') 54 | } 55 | if (render) { 56 | args.push('--render-expired-frames') 57 | } 58 | if (bitRate !== 8) { 59 | args.push('--bit-rate') 60 | args.push(`${bitRate}M`) 61 | } 62 | if (maxSize !== 0) { 63 | args.push('--max-size') 64 | args.push(`${maxSize}`) 65 | } 66 | if (maxFps !== 0) { 67 | args.push('--max-fps') 68 | args.push(`${maxFps}`) 69 | } 70 | if (orientation !== 0) { 71 | args.push('--rotation') 72 | args.push(`${orientation}`) 73 | } 74 | { 75 | const { x, y, height, width } = crop 76 | if (height !== 0 || width !== 0) { 77 | args.push('--crop') 78 | args.push(`${height}:${width}:${x}:${y}`) 79 | } 80 | } 81 | { 82 | const { x, y, height, width } = window 83 | if (x !== 0 || y !== 0) { 84 | args.push('--window-x') 85 | args.push(`${x}`) 86 | args.push('--window-y') 87 | args.push(`${y}`) 88 | } 89 | if (height !== 0 || width !== 0) { 90 | args.push('--window-width') 91 | args.push(`${width}`) 92 | args.push('--window-height') 93 | args.push(`${height}`) 94 | } 95 | } 96 | 97 | devices.forEach(({ id }) => { 98 | const { spawn } = require('child_process') 99 | const scrcpy = spawn(cmd, [...args, '-s', `${id}`]) 100 | 101 | let opened = false 102 | let exited = false 103 | scrcpy.stdout.on('data', (data) => { 104 | if (!opened) { 105 | sender.send('open', id) 106 | opened = true 107 | } 108 | console.log(`stdout: ${data}`) 109 | }) 110 | scrcpy.on('error', (code) => { 111 | console.log(`child process close all stdio with code ${code}`) 112 | scrcpy.kill() 113 | }) 114 | 115 | scrcpy.on('close', (code) => { 116 | console.log(`child process close all stdio with code ${code}`) 117 | }) 118 | 119 | scrcpy.on('exit', (code) => { 120 | console.log(`child process exited with code ${code}`) 121 | if (!exited) { 122 | sender.send('close', { success: code === 0, id }) 123 | scrcpy.kill() 124 | exited = true 125 | } 126 | }) 127 | }) 128 | } 129 | 130 | export default { 131 | open 132 | } 133 | -------------------------------------------------------------------------------- /src/renderer/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 18 | -------------------------------------------------------------------------------- /src/renderer/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/src/renderer/assets/.gitkeep -------------------------------------------------------------------------------- /src/renderer/assets/icons/256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/src/renderer/assets/icons/256x256.png -------------------------------------------------------------------------------- /src/renderer/assets/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/src/renderer/assets/icons/icon.icns -------------------------------------------------------------------------------- /src/renderer/assets/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/src/renderer/assets/icons/icon.ico -------------------------------------------------------------------------------- /src/renderer/components/components/EditableCell.vue: -------------------------------------------------------------------------------- 1 | 27 | 107 | 122 | -------------------------------------------------------------------------------- /src/renderer/components/dashboard/Configuration.vue: -------------------------------------------------------------------------------- 1 | 297 | 298 | 442 | 443 | 448 | -------------------------------------------------------------------------------- /src/renderer/components/dashboard/Management.vue: -------------------------------------------------------------------------------- 1 | 136 | 137 | 303 | 304 | 335 | -------------------------------------------------------------------------------- /src/renderer/components/layout/Footer.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 23 | 24 | 50 | -------------------------------------------------------------------------------- /src/renderer/components/layout/Header.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 35 | -------------------------------------------------------------------------------- /src/renderer/components/layout/Main.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 19 | 20 | -------------------------------------------------------------------------------- /src/renderer/components/layout/index.js: -------------------------------------------------------------------------------- 1 | export { default as LayoutHeader } from './Header' 2 | export { default as LayoutMain } from './Main' 3 | export { default as LayoutFooter } from './Footer' 4 | -------------------------------------------------------------------------------- /src/renderer/components/menu/Menu.js: -------------------------------------------------------------------------------- 1 | const pkg = require('../../../../package') 2 | import { remote } from 'electron' 3 | const { Menu, MenuItem } = remote 4 | 5 | export default (vue) => (tray, ...items) => { 6 | const menu = new Menu() 7 | menu.append(new MenuItem({ 8 | label: vue.$t('titleBar.document'), 9 | click: () => remote.shell.openExternal('https://github.com/Tomotoes/scrcpy-gui') 10 | })) 11 | 12 | menu.append(new MenuItem({ 13 | label: vue.$t('titleBar.checkForUpdates'), 14 | click: () => remote.shell.openExternal('https://github.com/Tomotoes/scrcpy-gui/releases') 15 | })) 16 | 17 | menu.append(new MenuItem({ 18 | label: vue.$t('titleBar.feedback'), 19 | click: () => remote.shell.openExternal('https://github.com/Tomotoes/scrcpy-gui/issues') 20 | })) 21 | const submenu = [] 22 | if (!items.length) { 23 | submenu.push({ 24 | label: 'Supported languages: ' 25 | }) 26 | } 27 | submenu.push({ 28 | label: '- English', 29 | click: () => { 30 | localStorage.setItem('lang', 'en') 31 | tray.destroy() 32 | window.location.reload() 33 | } 34 | }) 35 | submenu.push({ 36 | type: 'separator' 37 | }) 38 | submenu.push( 39 | { 40 | label: '- 简体中文', 41 | click: () => { 42 | localStorage.setItem('lang', 'zhCN') 43 | tray.destroy() 44 | window.location.reload() 45 | } 46 | }) 47 | submenu.push({ 48 | type: 'separator' 49 | }) 50 | submenu.push( 51 | { 52 | label: '- 繁体中文', 53 | click: () => { 54 | localStorage.setItem('lang', 'zhTW') 55 | tray.destroy() 56 | window.location.reload() 57 | } 58 | }) 59 | menu.append(new MenuItem({ 60 | label: vue.$t('titleBar.switchLanguage'), 61 | submenu 62 | })) 63 | const about = [] 64 | about.push(`name: ${pkg.name}`) 65 | about.push(`version: ${pkg.version}`) 66 | about.push(`homepage: ${pkg.homepage}`) 67 | about.push(`author: ${pkg.author}`) 68 | about.push(`license: ${pkg.license}`) 69 | about.push(`description: ${pkg.description}`) 70 | about.push(`node: ${process.versions.node}`) 71 | about.push(`chrome: ${process.versions.chrome}`) 72 | about.push(`electron: ${process.versions.electron}`) 73 | menu.append(new MenuItem({ 74 | label: vue.$t('titleBar.about'), 75 | click: () => { 76 | vue.$alert(about.join('
'), 'Scrcpy-gui', { 77 | dangerouslyUseHTMLString: true, 78 | }) 79 | } 80 | })) 81 | items.forEach(({ label, click }) => { 82 | menu.append(new MenuItem({ label: vue.$t(label), click })) 83 | }) 84 | return menu 85 | } 86 | -------------------------------------------------------------------------------- /src/renderer/components/menu/Tray.js: -------------------------------------------------------------------------------- 1 | import { remote } from 'electron' 2 | const { Tray, getCurrentWindow } = remote 3 | const window = getCurrentWindow() 4 | const tray = new Tray(`${__static}/icons/16x16.png`) 5 | 6 | export default Menu => { 7 | const menu = Menu(tray,{ label: 'tray.hide', click() { window.hide() } }, { 8 | label: 'tray.exit', click() { 9 | window.close() 10 | } 11 | }) 12 | 13 | tray.setContextMenu(menu) 14 | tray.setTitle('Scrcpy') 15 | tray.setToolTip('Scrcpy') 16 | tray.on('right-click', () => { 17 | tray.popUpContextMenu(menu) 18 | }) 19 | tray.on('click', () => { 20 | window.show() 21 | }) 22 | return tray 23 | } 24 | -------------------------------------------------------------------------------- /src/renderer/components/menu/index.js: -------------------------------------------------------------------------------- 1 | import { Titlebar, Color } from 'custom-electron-titlebar' 2 | import getMenu from './Menu' 3 | import Tray from './Tray' 4 | 5 | export default vue => { 6 | const Menu = getMenu(vue) 7 | const tray = Tray(Menu) 8 | window.tray = tray 9 | let hideWhenClickingClose = false 10 | const config = vue.$store.get('config') 11 | if(config) { 12 | hideWhenClickingClose = config.hidden 13 | } 14 | new Titlebar({ 15 | backgroundColor: Color.fromHex('#868686'), 16 | shadow: true, 17 | icon: 'https://cdn.jsdelivr.net/gh/Tomotoes/images/blog/favicon.ico', 18 | maximizable: false, 19 | hideWhenClickingClose, 20 | menu: Menu(tray) 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /src/renderer/directives/index.js: -------------------------------------------------------------------------------- 1 | import waves from './waves/waves' 2 | 3 | export default (Vue) => { 4 | Vue.directive('focus', { 5 | inserted: function(el) { 6 | el.focus() 7 | } 8 | }) 9 | Vue.directive('waves', waves) 10 | } 11 | -------------------------------------------------------------------------------- /src/renderer/directives/waves/index.js: -------------------------------------------------------------------------------- 1 | import waves from './waves' 2 | 3 | const install = function(Vue) { 4 | Vue.directive('waves', waves) 5 | } 6 | 7 | if (window.Vue) { 8 | window.waves = waves 9 | Vue.use(install); // eslint-disable-line 10 | } 11 | 12 | waves.install = install 13 | export default waves 14 | -------------------------------------------------------------------------------- /src/renderer/directives/waves/waves.css: -------------------------------------------------------------------------------- 1 | .waves-ripple { 2 | position: absolute; 3 | border-radius: 100%; 4 | background-color: rgba(0, 0, 0, 0.15); 5 | background-clip: padding-box; 6 | pointer-events: none; 7 | -webkit-user-select: none; 8 | -moz-user-select: none; 9 | -ms-user-select: none; 10 | user-select: none; 11 | -webkit-transform: scale(0); 12 | -ms-transform: scale(0); 13 | transform: scale(0); 14 | opacity: 1; 15 | } 16 | 17 | .waves-ripple.z-active { 18 | opacity: 0; 19 | -webkit-transform: scale(2); 20 | -ms-transform: scale(2); 21 | transform: scale(2); 22 | -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out; 23 | transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out; 24 | transition: opacity 1.2s ease-out, transform 0.6s ease-out; 25 | transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out; 26 | } -------------------------------------------------------------------------------- /src/renderer/directives/waves/waves.js: -------------------------------------------------------------------------------- 1 | import './waves.css' 2 | 3 | export default { 4 | bind(el, binding) { 5 | el.addEventListener('click', e => { 6 | const customOpts = Object.assign({}, binding.value) 7 | const opts = Object.assign({ 8 | ele: el, // 波纹作用元素 9 | type: 'hit', // hit点击位置扩散center中心点扩展 10 | color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色 11 | }, customOpts) 12 | const target = opts.ele 13 | if (target) { 14 | target.style.position = 'relative' 15 | target.style.overflow = 'hidden' 16 | const rect = target.getBoundingClientRect() 17 | let ripple = target.querySelector('.waves-ripple') 18 | if (!ripple) { 19 | ripple = document.createElement('span') 20 | ripple.className = 'waves-ripple' 21 | ripple.style.height = ripple.style.width = `${Math.max(rect.width, rect.height) }px` 22 | target.appendChild(ripple) 23 | } else { 24 | ripple.className = 'waves-ripple' 25 | } 26 | switch (opts.type) { 27 | case 'center': 28 | ripple.style.top = `${rect.height / 2 - ripple.offsetHeight / 2 }px` 29 | ripple.style.left = `${rect.width / 2 - ripple.offsetWidth / 2 }px` 30 | break 31 | default: 32 | ripple.style.top = `${e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop }px` 33 | ripple.style.left = `${e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft }px` 34 | } 35 | ripple.style.backgroundColor = opts.color 36 | ripple.className = 'waves-ripple z-active' 37 | return false 38 | } 39 | }, false) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/renderer/lang/en.js: -------------------------------------------------------------------------------- 1 | export default { 2 | footer: { 3 | powerBy: 'Power by', 4 | author: 'Author' 5 | }, 6 | dashboard: { 7 | configuration: 'Configuration', 8 | management: 'Management' 9 | }, 10 | configuration: { 11 | source: { 12 | label: 'Scrcpy', 13 | placeholder: 'Scrcpy folder path - e.g: C:\\scrcpy-win64', 14 | tooltip: 'If not set, please configure the scrcpy folder path to an environment variable' 15 | }, 16 | title: { 17 | label: 'window title', 18 | placeholder: 'The default is the device model', 19 | }, 20 | record: { 21 | label: 'record screen', 22 | tip: 'When turned on, the mirror will be recorded; when closed, the recorded video file will be generated to the specified path.', 23 | filepath: 'file path', 24 | tooltip: 'The path includes the video name and the video format is .mkv', 25 | mirror: 'Open mirror when recording' 26 | }, 27 | bitRate: { 28 | label: 'bit rate', 29 | popover: '8 is the default bit rate' 30 | }, 31 | maxSize: { 32 | label: 'max size', 33 | popover: '0 is the default value' 34 | }, 35 | maxFps: { 36 | label: 'max fps', 37 | popover: '0 is the default value' 38 | }, 39 | orientation: { 40 | label: 'rotation angle', 41 | popover: '0° is the default value' 42 | }, 43 | window: { 44 | label: 'initialization', 45 | x: { 46 | title: 'Mirror\'s abscissa position', 47 | content: 'If the abscissa and ordinate are both 0, it will open in the default position' 48 | }, 49 | y: { 50 | title: 'Mirror\'s ordinate position', 51 | content: 'If the abscissa and ordinate are both 0, it will open in the default position' 52 | }, 53 | height: { 54 | title: 'Mirror height', 55 | content: 'If the width and height are both 0, the default size is displayed' 56 | }, 57 | width: { 58 | title: 'Mirror width', 59 | content: 'If the width and height are both 0, the default size is displayed' 60 | }, 61 | }, 62 | crop: { 63 | label: 'cut screen', 64 | x: 'The abscissa of the cut position', 65 | y: 'The ordinate of the cut position', 66 | height: { 67 | title: 'Height in the cut size', 68 | content: 'If the height and width are both 0, then it will not be cut' 69 | }, 70 | width: { 71 | title: 'Cut width in size', 72 | content: 'If the height and width are both 0, then it will not be cut' 73 | }, 74 | }, 75 | other: { 76 | label: 'other settings', 77 | fixed: 'Window always on top', 78 | control: 'Computer control', 79 | fullscreen: 'Display in full screen', 80 | border: 'Show window border', 81 | touch: 'Show phone tap location', 82 | render: 'Rendering all frames', 83 | screen: 'Turn off the phone screen', 84 | awake: { 85 | tooltip: 'The computer control option must be opened before turning off the lock screen', 86 | content: 'Turn off the lock screen' 87 | }, 88 | auto: 'Automatically turn on connected devices', 89 | hidden: { 90 | tooltip: 'Need to restart the application to take effect', 91 | content: 'Hide to system bar after exit' 92 | } 93 | }, 94 | button: { 95 | save: 'Save configuration', 96 | default: 'Restore default' 97 | }, 98 | notify: { 99 | saveSuccess: 'Configuration saved successfully!' 100 | } 101 | }, 102 | management: { 103 | ip: { 104 | tip: 'Device LAN IP address', 105 | remove: 'delete', 106 | connect: 'Turn on wireless connection' 107 | }, 108 | devices: { 109 | name: 'name', 110 | edit: 'Click to edit', 111 | method: { 112 | label: 'method', 113 | wired: 'wired', 114 | wireless: 'wireless' 115 | }, 116 | operation: 'operation', 117 | disconnect: 'disconnect' 118 | }, 119 | button: { 120 | open: 'Open the selected mirror' 121 | }, 122 | whenEmpty: 'No device connection', 123 | notify: { 124 | firstLoad: 'Loading device...', 125 | reduceDevices: 'Equipment changes', 126 | newDevices: 'New device detected', 127 | open: '{name} has been successfully opened' 128 | }, 129 | open: { 130 | loading: 'Opening the mirror, please wait a moment...', 131 | success: '{name} has been closed normally', 132 | error: `{name} failed to start. Please check the documentation carefully: 133 |

1. Whether scrcpy configured correctly

134 |

2. Whether the phone opens the debugging option

135 |

3. Whether the scrcpy-gui software set to start by the administrator

136 |

4. Whether the scrcpy command line can open the device

137 |

5. Run the \`adb-devices\` command to see if the device appears

138 | If the above configuration is normal, please go to Github to file an issue, and I will resolve it as soon as possible` 139 | }, 140 | connect: { 141 | error: { 142 | ip: 'Please enter the correct IP address', 143 | exist: '{name} has been connected' 144 | }, 145 | loading: 'Opening wireless connection...', 146 | success: 'Wireless connection turned on', 147 | fail: 'Failed to open wireless connection' 148 | }, 149 | disconnect: { 150 | success: '{name} already disconnected' 151 | }, 152 | error: { 153 | 'unknownScrcpyPathException': 'The path of the Scrcpy folder is incorrectly configured. Make sure that `scrcpy.exe` exists in this folder' 154 | } 155 | }, 156 | titleBar: { 157 | document: 'Document', 158 | checkForUpdates: 'Update', 159 | feedback: 'Feedback', 160 | switchLanguage: 'Languages', 161 | about: 'About' 162 | }, 163 | tray: { 164 | hide: 'Hide', 165 | exit: 'Exit' 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /src/renderer/lang/index.js: -------------------------------------------------------------------------------- 1 | export { default as en } from './en' 2 | export { default as zhCN } from './zh_CN' 3 | export { default as zhTW } from './zh_TW' 4 | -------------------------------------------------------------------------------- /src/renderer/lang/zh_CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | notify: { 3 | 'error': '错误', 4 | 'info': '提示', 5 | 'success': '成功', 6 | 'warning': '警告' 7 | }, 8 | footer: { 9 | powerBy: '基于', 10 | author: '作者' 11 | }, 12 | dashboard: { 13 | configuration: '镜像配置', 14 | management: '镜像管理' 15 | }, 16 | configuration: { 17 | source: { 18 | label: 'Scrcpy', 19 | placeholder: 'Scrcpy文件夹路径 - 例如: C:\\scrcpy-win64', 20 | tooltip: '如果不设置,请将scrcpy文件夹路径配置到环境变量' 21 | }, 22 | title: { 23 | label: '窗口标题', 24 | placeholder: '默认为手机型号' 25 | }, 26 | record: { 27 | label: '镜像录屏', 28 | tip: '开启后,将录制镜像;关闭后,将生成已录制的视频文件到指定路径', 29 | filepath: '录屏文件路径', 30 | tooltip: '路径包括视频名,视频格式为.mkv', 31 | mirror: '录屏时打开镜像' 32 | }, 33 | bitRate: { 34 | label: '镜像传输比特率', 35 | popover: '8为默认比特率' 36 | }, 37 | maxSize: { 38 | label: '等比最大分辨率', 39 | popover: '0为默认分辨率' 40 | }, 41 | maxFps: { 42 | label: '最大帧率', 43 | popover: '0为默认帧率' 44 | }, 45 | orientation: { 46 | label: '旋转角度', 47 | popover: '0°为默认值' 48 | }, 49 | crop: { 50 | label: '剪切屏幕', 51 | x: '剪切位置的横坐标', 52 | y: '剪切位置的纵坐标', 53 | height: { 54 | title: '剪切尺寸中的高度', 55 | content: '高宽为0,则不剪切' 56 | }, 57 | width: { 58 | title: '剪切尺寸中的宽度', 59 | content: '高宽为0,则不剪切' 60 | }, 61 | }, 62 | window: { 63 | label: '初始化', 64 | x: { 65 | title: '镜像的横坐标', 66 | content: '横纵坐标为0, 则以默认的位置打开' 67 | }, 68 | y: { 69 | title: '镜像的纵坐标', 70 | content: '横纵坐标为0, 则以默认的位置打开' 71 | }, 72 | height: { 73 | title: '镜像的高度', 74 | content: '高宽为0,则以默认尺寸显示' 75 | }, 76 | width: { 77 | title: '镜像的宽度', 78 | content: '高宽为0,则以默认尺寸显示' 79 | }, 80 | }, 81 | other: { 82 | label: '其他设置', 83 | fixed: '窗口置顶', 84 | control: '电脑控制', 85 | fullscreen: '全屏显示', 86 | border: '显示边框', 87 | touch: '显示点按位置', 88 | render: '渲染所有帧 会增加延迟', 89 | screen: '打开镜像时关闭屏幕', 90 | awake: { 91 | tooltip: '关闭锁屏前须打开电脑控制选项', 92 | content: '关闭锁屏' 93 | }, 94 | auto: '自动打开新连接的设备', 95 | hidden: { 96 | tooltip: '需要重启应用才会生效', 97 | content: '退出后隐藏到系统栏' 98 | } 99 | }, 100 | button: { 101 | save: '保存当前配置', 102 | default: '恢复默认配置' 103 | }, 104 | notify: { 105 | saveSuccess: '配置保存成功' 106 | } 107 | }, 108 | management: { 109 | ip: { 110 | tip: '设备局域网 IP 地址', 111 | remove: '删除', 112 | connect: '开启无线连接' 113 | }, 114 | devices: { 115 | name: '名称', 116 | edit: '点击即可修改', 117 | method: { 118 | label: '连接方式', 119 | wired: '有线', 120 | wireless: '无线' 121 | }, 122 | operation: '操作', 123 | disconnect: '断开连接' 124 | }, 125 | button: { 126 | open: '打开选中的镜像' 127 | }, 128 | whenEmpty: '暂无设备连接', 129 | notify: { 130 | firstLoad: '正在加载设备', 131 | reduceDevices: '设备发生变动', 132 | newDevices: '检测到新设备', 133 | open: '已成功打开 {name}' 134 | }, 135 | open: { 136 | loading: '正在打开镜像,请稍等片刻...', 137 | success: '{name} 已正常关闭', 138 | error: `{name} 打开失败,请您仔细查阅以下各项: 139 |

1. scrcpy 是否配置正确

140 |

2. scrcpy-gui 软件是否设置为管理员启动

141 |

3. scrcpy 命令行是否可以打开设备

142 |

4. 执行\`adb-devices\`命令 查看是否出现设备

143 |

5. 手机是否打开调试选项

144 | 如以上皆配置正常,请您到Github提出issue,我会尽快解决。` 145 | }, 146 | connect: { 147 | error: { 148 | ip: '请输入正确的 IP 地址', 149 | exist: '{name} 已经连接' 150 | }, 151 | loading: '正在开启无线连接...', 152 | success: '已成功打开无线连接', 153 | fail: '开启无线连接失败' 154 | }, 155 | disconnect: { 156 | success: '{name} 已断开连接' 157 | }, 158 | error: { 159 | unknownScrcpyPathException: 'Scrcpy 文件夹路径配置错误,请确保该文件夹中存在`scrcpy.exe`' 160 | } 161 | }, 162 | titleBar: { 163 | document: '帮助文档', 164 | checkForUpdates: '检查更新', 165 | feedback: '反馈提议', 166 | switchLanguage: '切换语言', 167 | about: '关于' 168 | }, 169 | tray: { 170 | hide: '隐藏', 171 | exit: '退出' 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /src/renderer/lang/zh_TW.js: -------------------------------------------------------------------------------- 1 | export default { 2 | notify: { 3 | 'error': '錯誤', 4 | 'info': '提示', 5 | 'success': '成功', 6 | 'warning': '警告' 7 | }, 8 | footer: { 9 | powerBy: '基於', 10 | author: '作者' 11 | }, 12 | dashboard: { 13 | configuration: '投影配置', 14 | management: '投影管理' 15 | }, 16 | configuration: { 17 | source: { 18 | label: 'Scrcpy', 19 | placeholder: 'Scrcpy資料夾路徑 - 例如: C:\\scrcpy-win64', 20 | tooltip: '如果不設定,請將scrcpy資料夾路徑配置到環境變數' 21 | }, 22 | title: { 23 | label: '視窗標題', 24 | placeholder: '預設為手機型號' 25 | }, 26 | record: { 27 | label: '錄製投影畫面', 28 | tip: '開啟後,將錄製投影畫面;關閉後,將儲存已錄製的影片文件到指定路徑', 29 | filepath: '螢幕錄影文件路徑', 30 | tooltip: '路徑包括影片名,影片格式為.mkv', 31 | mirror: '錄影時啟動投影' 32 | }, 33 | bitRate: { 34 | label: '投影傳輸比特率', 35 | popover: '8M為預設比特率' 36 | }, 37 | maxSize: { 38 | label: '等比最大解析度', 39 | popover: '0為預設解析度' 40 | }, 41 | maxFps: { 42 | label: '最大FPS幀數', 43 | popover: '0為預設FPS幀數' 44 | }, 45 | orientation: { 46 | label: '旋轉角度', 47 | popover: '0°為預設值' 48 | }, 49 | crop: { 50 | label: '裁剪畫面', 51 | x: '裁剪位置的横座標', 52 | y: '裁剪位置的縱座標', 53 | height: { 54 | title: '裁剪尺寸中的高度', 55 | content: '高寬為0,則不裁剪' 56 | }, 57 | width: { 58 | title: '裁剪尺寸中的寬度', 59 | content: '高寬為0,則不裁剪' 60 | }, 61 | }, 62 | window: { 63 | label: '初始化', 64 | x: { 65 | title: '投影的横座標', 66 | content: '橫縱座標為0, 則以預設的位置打開' 67 | }, 68 | y: { 69 | title: '投影的縱坐標', 70 | content: '橫縱座標為0, 則以預設的位置打開' 71 | }, 72 | height: { 73 | title: '投影畫面的高度', 74 | content: '高寬為0,則以預設尺寸顯示' 75 | }, 76 | width: { 77 | title: '投影畫面的寬度', 78 | content: '高寬為0,則以預設尺寸顯示' 79 | }, 80 | }, 81 | other: { 82 | label: '其他設置', 83 | fixed: '最上層顯示視窗', 84 | control: '允許由電腦控制裝置', 85 | fullscreen: '全螢幕顯示', 86 | border: '顯示邊框', 87 | touch: '顯示點擊位置', 88 | render: '渲染所有幀會增加延遲', 89 | screen: '開啟螢幕投影時關閉裝置螢幕', 90 | awake: { 91 | tooltip: '關閉鎖屏前須打開電腦控制選項', 92 | content: '關閉螢幕鎖定' 93 | }, 94 | auto: '自動打開新連接的裝置', 95 | hidden: { 96 | tooltip: '需要重新啟動應用才會生效', 97 | content: '退出後隐藏到系统欄' 98 | } 99 | }, 100 | button: { 101 | save: '保存目前配置', 102 | default: '恢復預設配置' 103 | }, 104 | notify: { 105 | saveSuccess: '配置保存成功' 106 | } 107 | }, 108 | management: { 109 | ip: { 110 | tip: '裝置區域連線 IP 地址', 111 | remove: '删除', 112 | connect: '開啟無線連接' 113 | }, 114 | devices: { 115 | name: '名稱', 116 | edit: '點擊即可修改', 117 | method: { 118 | label: '連接方式', 119 | wired: '有線', 120 | wireless: '無線' 121 | }, 122 | operation: '操作', 123 | disconnect: '中斷連接' 124 | }, 125 | button: { 126 | open: '開啟選中裝置的投影' 127 | }, 128 | whenEmpty: '暫時沒有裝置連接', 129 | notify: { 130 | firstLoad: '正在載入裝置', 131 | reduceDevices: '裝置發生變動', 132 | newDevices: '偵測到新裝置', 133 | open: '已成功開啟 {name}' 134 | }, 135 | open: { 136 | loading: '正在啟動投影,請稍候...', 137 | success: '{name} 已正常關閉', 138 | error: `{name} 開啟失敗,請您仔細確認以下項目: 139 |

1. scrcpy 是否配置正確

140 |

2. scrcpy-gui 本應用是否設置為以系統管理員身分啟動

141 |

3. scrcpy 命令行是否可以開啟裝置

142 |

4. 執行\`adb-devices\`命令 查看是否出現裝置

143 |

5. 手机是否開啟偵錯選項

144 | 如以上皆配置正常,請您到原作者Github提出issue,以協助解决。` 145 | }, 146 | connect: { 147 | error: { 148 | ip: '請輸入正確的 IP 地址', 149 | exist: '{name} 已經連接' 150 | }, 151 | loading: '正在啟動無線連接...', 152 | success: '已成功開啟無線連接', 153 | fail: '開啟無線連接失敗' 154 | }, 155 | disconnect: { 156 | success: '{name} 已中斷連接' 157 | }, 158 | error: { 159 | unknownScrcpyPathException: 'Scrcpy 資料夾路徑配置錯誤,請確認該資料夾中存在`scrcpy.exe`' 160 | } 161 | }, 162 | titleBar: { 163 | document: '使用說明', 164 | checkForUpdates: '檢查更新', 165 | feedback: '回報與建議', 166 | switchLanguage: '切換語言', 167 | about: '關於' 168 | }, 169 | tray: { 170 | hide: '隐藏', 171 | exit: '退出' 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /src/renderer/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | import 'normalize.css/normalize.css' 4 | 5 | import ElementUI from 'element-ui' 6 | import 'element-ui/lib/theme-chalk/index.css' 7 | import locale from 'element-ui/lib/locale' 8 | import _en from 'element-ui/lib/locale/lang/en' 9 | import _zhCN from 'element-ui/lib/locale/lang/zh-CN' 10 | import _zhTW from 'element-ui/lib/locale/lang/zh-TW' 11 | 12 | const lang = localStorage.getItem('lang') || 'zhCN' 13 | locale.use(lang === 'en' ? _en : _zhCN) 14 | 15 | Vue.use(ElementUI) 16 | 17 | import { en, zhCN, zhTW } from './lang' 18 | import VueI18n from 'vue-i18n' 19 | Vue.use(VueI18n) 20 | 21 | const i18n = new VueI18n({ 22 | locale: (localStorage.getItem('lang') || 'zhCN'), 23 | messages: { zhCN, zhTW, en } 24 | }) 25 | 26 | 27 | import router from './router' 28 | import App from './App' 29 | 30 | if (!process.env.IS_WEB) { Vue.use(require('vue-electron')) } 31 | Vue.config.productionTip = false 32 | 33 | import { openExternal, store, notify } from './plugins' 34 | Vue.use(openExternal) 35 | Vue.use(store) 36 | Vue.use(notify) 37 | 38 | import directives from './directives' 39 | Vue.use(directives) 40 | 41 | import { drag } from './mixin' 42 | 43 | /* eslint-disable no-new */ 44 | const vue = new Vue({ 45 | components: { App }, 46 | router, 47 | i18n, 48 | mixins: [drag], 49 | template: '' 50 | }).$mount('#app') 51 | 52 | import menu from './components/menu' 53 | menu(vue) 54 | -------------------------------------------------------------------------------- /src/renderer/mixin/drag.js: -------------------------------------------------------------------------------- 1 | export default { 2 | mounted() { 3 | this.disableDragEvent() 4 | }, 5 | methods: { 6 | disableDragEvent() { 7 | window.addEventListener('dragenter', this.disableDrag, false) 8 | window.addEventListener('dragover', this.disableDrag) 9 | window.addEventListener('drop', this.disableDrag) 10 | }, 11 | disableDrag(e) { 12 | e.preventDefault() 13 | e.dataTransfer.effectAllowed = 'none' 14 | e.dataTransfer.dropEffect = 'none' 15 | } 16 | }, 17 | beforeDestroy() { 18 | window.removeEventListener('dragenter', this.disableDrag, false) 19 | window.removeEventListener('dragover', this.disableDrag) 20 | window.removeEventListener('drop', this.disableDrag) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/renderer/mixin/index.js: -------------------------------------------------------------------------------- 1 | export { default as drag } from './drag' 2 | -------------------------------------------------------------------------------- /src/renderer/plugins/index.js: -------------------------------------------------------------------------------- 1 | export { default as openExternal } from './openExternal' 2 | export { default as store } from './store' 3 | export { default as notify } from './notify' 4 | -------------------------------------------------------------------------------- /src/renderer/plugins/notify.js: -------------------------------------------------------------------------------- 1 | import { Notification } from 'element-ui' 2 | const config = { 3 | dangerouslyUseHTMLString: true, 4 | customClass: 'custom-notice', 5 | showClose: true 6 | } 7 | 8 | export default { 9 | install(Vue) { 10 | Vue.prototype.$notify = ['info', 'success', 'warning', 'error'].reduce((notice, type) => { 11 | notice[type] = (message, duration = 1000, position = 'top-right', offset = 58) => { 12 | return Promise.resolve(Notification({ 13 | message, 14 | type, 15 | position, 16 | offset, 17 | duration, 18 | ...config 19 | })) 20 | } 21 | return notice 22 | }, {}) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/renderer/plugins/openExternal.js: -------------------------------------------------------------------------------- 1 | import { shell } from 'electron' 2 | 3 | export default { 4 | install(Vue) { 5 | Vue.prototype.$openExternal = function (url) { 6 | shell.openExternal(url) 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/renderer/plugins/store.js: -------------------------------------------------------------------------------- 1 | import LocalStorage from 'localstorage' 2 | const { version } = require('../../../package.json') 3 | const store = new LocalStorage(`scrcpy@${version}`) 4 | 5 | export default { 6 | install(Vue) { 7 | Vue.prototype.$store = { 8 | put(key, value) { 9 | store.put(key, value) 10 | }, 11 | get(key) { 12 | const [err, value] = store.get(key) 13 | if (err) { 14 | return null 15 | } 16 | return value 17 | }, 18 | has(key) { 19 | const [err, had] = store.has(key) 20 | if (err) { 21 | return false 22 | } 23 | return had 24 | }, 25 | delete(key) { 26 | const [err, deleted] = store.delete(key) 27 | if (err) { 28 | return false 29 | } 30 | return deleted 31 | }, 32 | clear() { 33 | store.delete() 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/renderer/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | Vue.use(Router) 4 | 5 | import Layout from '../views/Layout' 6 | 7 | const routerMap = [{ 8 | path: '/', 9 | component: Layout, 10 | redirect: '/dashboard', 11 | name: 'Dashboard', 12 | hidden: true, 13 | children: [{ 14 | path: 'dashboard', 15 | component: () => import('@/views/Dashboard') 16 | }] 17 | }] 18 | 19 | export default new Router({ 20 | routes: routerMap 21 | }) 22 | -------------------------------------------------------------------------------- /src/renderer/styles/index.scss: -------------------------------------------------------------------------------- 1 | @import './variables.scss'; 2 | @import './mixin.scss'; 3 | @import './scrollbar.scss'; 4 | 5 | body { 6 | -moz-osx-font-smoothing: grayscale; 7 | -webkit-font-smoothing: antialiased; 8 | text-rendering: optimizeLegibility; 9 | font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; 10 | } 11 | 12 | html { 13 | box-sizing: border-box; 14 | } 15 | 16 | *, 17 | *:before, 18 | *:after { 19 | box-sizing: inherit; 20 | } 21 | 22 | div:focus{ 23 | outline: none; 24 | } 25 | 26 | a:focus, 27 | a:active { 28 | outline: none; 29 | } 30 | 31 | a, 32 | a:focus, 33 | a:hover { 34 | cursor: pointer; 35 | color: inherit; 36 | } 37 | 38 | .clearfix { 39 | &:after { 40 | visibility: hidden; 41 | display: block; 42 | font-size: 0; 43 | content: " "; 44 | clear: both; 45 | height: 0; 46 | } 47 | } 48 | 49 | 50 | // body{ 51 | // overflow-x: hidden; 52 | // overflow-y: hidden; 53 | // } 54 | -------------------------------------------------------------------------------- /src/renderer/styles/mixin.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix { 2 | &:after { 3 | content: ""; 4 | display: table; 5 | clear: both; 6 | } 7 | } 8 | 9 | @mixin relative { 10 | position: relative; 11 | width: 100%; 12 | height: 100%; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/renderer/styles/scrollbar.scss: -------------------------------------------------------------------------------- 1 | ::-webkit-scrollbar 2 | { 3 | width: 6px; 4 | height: 10px; 5 | background-color: rgba(0, 0, 0, 0); 6 | } 7 | 8 | ::-webkit-scrollbar-track 9 | { 10 | background-color: rgba(0, 0, 0, 0.1); 11 | } 12 | 13 | ::-webkit-scrollbar-thumb 14 | { 15 | border-radius: 3px; 16 | background-color: rgba(0, 0, 0, 0.2); 17 | transition: all 0.4s ease; 18 | -moz-transition: all 0.4s ease; 19 | /* Firefox 4 */ 20 | -webkit-transition: all 0.4s ease; 21 | -o-transition: all 0.4s ease; 22 | /* Opera */; 23 | } 24 | 25 | ::-webkit-scrollbar-thumb:hover 26 | { 27 | border-radius: 3px; 28 | background-color: rgba(0, 0, 0, 0.4); 29 | transition: all 0.4s ease; 30 | -moz-transition: all 0.4s ease; 31 | /* Firefox 4 */ 32 | -webkit-transition: all 0.4s ease; 33 | /* Safari 和 Chrome */ 34 | -o-transition: all 0.4s ease; 35 | /* Opera */; 36 | } -------------------------------------------------------------------------------- /src/renderer/styles/variables.scss: -------------------------------------------------------------------------------- 1 | //sidebar 2 | $menuBg:#304156; 3 | $subMenuBg:#1f2d3d; 4 | $menuHover:#001528; 5 | -------------------------------------------------------------------------------- /src/renderer/utils/regular/index.js: -------------------------------------------------------------------------------- 1 | const Regular = (function () { 2 | const rules = { 3 | email(str) { 4 | return (/^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/).test(str) 5 | }, 6 | number(str) { 7 | return (/^[0-9]$/).test(str) 8 | }, 9 | english(str) { 10 | return (/^[a-zA-Z]+$/).test(str) 11 | }, 12 | text(str) { 13 | return (/^\w+$/).test(str) 14 | }, 15 | chinese(str) { 16 | return (/^[\u4E00-\u9FA5]+$/).test(str) 17 | }, 18 | lower(str) { 19 | return (/^[a-z]+$/).test(str) 20 | }, 21 | upper(str) { 22 | return (/^[A-Z]+$/).test(str) 23 | }, 24 | ip(str) { 25 | return (/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(:\d{4})?$/).test(str) 26 | } 27 | 28 | } 29 | return function (type, str) { 30 | if (type.constructor === Function) { 31 | rules[str] = type 32 | } else { 33 | return rules[type] ? rules[type](str) : false 34 | } 35 | } 36 | }()) 37 | 38 | export default Regular 39 | -------------------------------------------------------------------------------- /src/renderer/views/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/renderer/views/Layout.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | 17 | 19 | -------------------------------------------------------------------------------- /src/test/execa.js: -------------------------------------------------------------------------------- 1 | const shell = require('child_process') 2 | function test(){ 3 | const workerProcess = shell.exec('adb tcpip 1111') 4 | 5 | workerProcess.stdout.on('data', function (data) { 6 | console.log(`stdout: ${data}`) 7 | }) 8 | 9 | workerProcess.stderr.on('data', function (data) { 10 | if (data.includes('more than one device/emulator')) { 11 | shell.execSync('adb disconnect') 12 | } 13 | test() 14 | }) 15 | 16 | workerProcess.on('close', function (code) { 17 | console.log(`子进程已退出,退出码 ${code}`) 18 | }) 19 | } 20 | 21 | test() 22 | 23 | console.log(1) 24 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/static/.gitkeep -------------------------------------------------------------------------------- /static/icons/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/static/icons/16x16.png -------------------------------------------------------------------------------- /static/icons/256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/static/icons/256x256.png -------------------------------------------------------------------------------- /static/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/static/icons/icon.icns -------------------------------------------------------------------------------- /static/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimonAKing/scrcpy-gui/1e348ff6598bd925081b98ff1547a10750c24a22/static/icons/icon.ico --------------------------------------------------------------------------------