Skip to content

Commit

Permalink
feat: ⚡ 1.1.1
Browse files Browse the repository at this point in the history
Tons of bug fixes and performance improvements
  • Loading branch information
Frontesque committed Apr 26, 2022
1 parent c7b83d3 commit 4aaf838
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 77 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scrcpy-plus",
"version": "1.1.0",
"version": "1.1.1",
"description": "A GUI for scrcpy",
"main": "./dist/main/index.js",
"scripts": {
Expand Down
156 changes: 82 additions & 74 deletions src/renderer/components/device.vue
Original file line number Diff line number Diff line change
@@ -1,95 +1,103 @@
<template>
<section>
<h2>Device</h2>
<section>
<h2>Device</h2>

<!-- No Device Notice -->
<center v-show="!device">
<v-icon size="50px">mdi-devices</v-icon>
<h1>No Device Found</h1>
<p style="color: #999;">You may need to plug your device in or enable 'USB Debugging'</p>
</center>
<!-- No Device Notice -->
<center v-show="!device">
<v-icon size="50px">mdi-devices</v-icon>
<h1>No Device Found</h1>
<p style="color: #999;">You may need to plug your device in or enable 'USB Debugging'</p>
</center>

<!-- Show Device Information -->
<v-list-item v-for="(item, i) in deviceInfo" :key="i" v-show="device">
<div>
<v-list-item-title v-text="item.title" />
<p v-text="item.data" class="grey--text" />
</div>
</v-list-item>
</section>
<!-- Show Device Information -->
<v-list-item v-for="(item, i) in deviceInfo" :key="i" v-show="device">
<div>
<v-list-item-title v-text="item.title" />
<p v-text="item.data" class="grey--text" />
</div>
</v-list-item>

</section>
</template>

<script>
export default {
export default {
data() {
return {
return {
device: false,
device: false,
deviceInfo: [
{
title: "Model",
command: "adb shell getprop ro.product.model",
data: null,
},
{
title: "Device Codename",
command: "adb shell getprop ro.product.device",
data: null,
},
{
title: "Android Version",
command: "adb shell getprop ro.build.version.release",
data: null,
},
{
title: "Build",
command: "adb shell getprop ro.build.id",
data: null,
},
{
title: "SDK Version",
command: "adb shell getprop ro.build.version.sdk",
data: null,
},
{
title: "Fingerprint",
command: "adb shell getprop ro.build.fingerprint",
data: null,
}
]
}
deviceInfo: [{
title: "Model",
command: "adb shell getprop ro.product.model",
data: null,
},
{
title: "Device Codename",
command: "adb shell getprop ro.product.device",
data: null,
},
{
title: "Android Version",
command: "adb shell getprop ro.build.version.release",
data: null,
},
{
title: "Build",
command: "adb shell getprop ro.build.id",
data: null,
},
{
title: "SDK Version",
command: "adb shell getprop ro.build.version.sdk",
data: null,
},
{
title: "Fingerprint",
command: "adb shell getprop ro.build.fingerprint",
data: null,
}
]
}
},
methods: {
async refreshList() {
for (const i in this.deviceInfo) {
this.$scrcpy.execute(this.deviceInfo[i].command)
.then((data) => {
this.deviceInfo[i].data = data;
this.device = true;
this.$emit('update:device', true);
})
.catch((err) => {
this.device = false;
this.$emit('update:device', false);
})
}
refreshList() {
for (const i in this.deviceInfo) {
this.$scrcpy.execute(this.deviceInfo[i].command)
.then((data) => {
this.deviceInfo[i].data = data;
})
}
},
checkDevice() {
this.$scrcpy.execute("adb devices -l")
.then((data) => {
if (data.includes("device product:")) { // Device Detected
if (data.includes("device product:") != this.device) {
this.refreshList();
}
this.device = true;
this.$emit('update:device', true);
} else {
this.device = false;
this.$emit('update:device', false);
}
})
}
},
mounted() {
setInterval(() => {
this.refreshList()
}, 10000);
this.refreshList()
setInterval(() => {
this.checkDevice()
}, process.env.devicePollRate);
this.checkDevice()
}
}
}
</script>
1 change: 1 addition & 0 deletions src/renderer/components/scrcpy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default {
this.$scrcpy.execute("scrcpy"+flags)
.catch((err) => {
if (err.startsWith("INFO:")) return; // Catch information outputs
this.dialog = true;
this.dialogText = err;
})
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@

module.exports = {
env: {
version: "1.1.0",
version: "1.1.1",
scrcpyVersion: "1.23",
adbVersion: "31.0.3-7562133",
//scrcpyPath: "src/extraResources/scrcpy/", //Development
scrcpyPath: "resources/scrcpy/" //Production
scrcpyPath: "resources/scrcpy/", //Production

devicePollRate: 1250,
},
components: true,

Expand Down
10 changes: 10 additions & 0 deletions src/renderer/pages/changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
<v-btn style="margin-top: 1em;" class="rounded-xl" color="primary" @click="$router.go(-1)">Back</v-btn>
</section>

<section>
<h3>1.1.1</h3>
<ul>
<li>Fix error being thrown when closing the SCRCPY window</li>
<li>Increased device information/recognition polling rate 8x</li>
<li>Optimized device recognition to use less system resources</li>
<li>Fixed causing some devices to lag badly while having the main window open</li>
</ul>
</section>

<section>
<h3>1.1.0</h3>
<ul>
Expand Down

0 comments on commit 4aaf838

Please sign in to comment.