From 268cd110c0047aface5bcd54ca3b8c1cb595b402 Mon Sep 17 00:00:00 2001 From: viarotel <38282758+viarotel@users.noreply.github.com> Date: Fri, 27 Dec 2024 23:11:42 +0800 Subject: [PATCH 1/3] chore(main): release 1.28.2 --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e920db9..da603f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.28.2](https://github.com/viarotel-org/escrcpy/compare/v1.28.1...v1.28.2) (2024-12-27) + + +### Performance Improvements + +* 👷 Optimize the edge hiding function ([d5caaa9](https://github.com/viarotel-org/escrcpy/commit/d5caaa915c5e979c2217357cf74efe20d477c5ba)) +* 📸 Support viewing real-time images and power information of the device ([d262adf](https://github.com/viarotel-org/escrcpy/commit/d262adf54df2a28c734b3db1a5d17bbccd983db9)) + ## [1.28.1](https://github.com/viarotel-org/escrcpy/compare/v1.28.0...v1.28.1) (2024-12-20) diff --git a/package.json b/package.json index 1599e3f..bd1aae1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "escrcpy", "type": "module", - "version": "1.28.1", + "version": "1.28.2", "private": true, "packageManager": "pnpm@9.12.3", "description": "Scrcpy Powered by Electron", From 38d1433a82d6c22c9bb6db681533c93e788e4cff Mon Sep 17 00:00:00 2001 From: viarotel Date: Sat, 28 Dec 2024 19:02:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?perf:=20=E2=99=BB=EF=B8=8F=20Optimize=20dev?= =?UTF-8?q?ice=20details=20performance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/exposes/adb/index.js | 26 +++----- package.json | 2 +- src/components/ControlBar/index.vue | 2 +- .../device/components/DevicePopover/index.vue | 63 ++++++++++++++----- src/pages/device/index.vue | 13 +--- 5 files changed, 61 insertions(+), 45 deletions(-) diff --git a/electron/exposes/adb/index.js b/electron/exposes/adb/index.js index a560c4b..2b52b19 100644 --- a/electron/exposes/adb/index.js +++ b/electron/exposes/adb/index.js @@ -128,18 +128,12 @@ const tcpip = async (id, port = 5555) => client.getDevice(id).tcpip(port) const screencap = async (deviceId, options = {}) => { const { returnBase64 = false } = options - let fileStream = null - try { - const device = client.getDevice(deviceId) - fileStream = await device.screencap() - } - catch (error) { - console.warn(error?.message || error) - return false - } + const device = client.getDevice(deviceId) + + const fileStream = await device.screencap() if (!fileStream) { - return false + throw new Error('Failed to obtain screenshot data') } if (returnBase64) { @@ -292,17 +286,11 @@ async function connectCode(password, options = {}) { } async function battery(id) { - try { - const res = await deviceShell(id, 'dumpsys battery') + const res = await deviceShell(id, 'dumpsys battery') - const value = parseBatteryDump(res) + const value = parseBatteryDump(res) - return value - } - catch (error) { - console.warn(error?.message || error) - return {} - } + return value } function init() { diff --git a/package.json b/package.json index bd1aae1..a794ac8 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@antfu/eslint-config": "3.8.0", - "@devicefarmer/adbkit": "3.2.6", + "@devicefarmer/adbkit": "3.3.8", "@electron-toolkit/preload": "3.0.1", "@electron-toolkit/utils": "3.0.0", "@electron/remote": "2.1.2", diff --git a/src/components/ControlBar/index.vue b/src/components/ControlBar/index.vue index 0838d5b..9a33203 100644 --- a/src/components/ControlBar/index.vue +++ b/src/components/ControlBar/index.vue @@ -1,6 +1,6 @@