From 1ed0e6e7ec6faccfd12952c756a3719c395d4737 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 20 Jul 2022 01:01:18 +0200 Subject: [PATCH] Fix adb no devices detection now throws when there are no devices connected --- revanced.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/revanced.ps1 b/revanced.ps1 index dfdb803..67d3fb8 100644 --- a/revanced.ps1 +++ b/revanced.ps1 @@ -220,11 +220,13 @@ function main { # devices $devices = adb devices + if ($devices.Length -eq 2) { + throw "No devices found" + } $devices = $devices[1..($devices.length-2)] [String]$selectedDevice = '' - if ($devices.Length -eq 0) {throw "No devices found"} - elseif ($devices.Length -eq 1) { + if ($devices.Length -eq 1) { $selectedDevice = ($devices | ForEach-Object {$_.split()[0]})[0] } else {