Skip to content

Commit 6485e47

Browse files
committed
feat: connect to first device if given device was not found
1 parent 4edc325 commit 6485e47

File tree

1 file changed

+1
-1
lines changed
  • src/main/kotlin/app/revanced/utils/adb

1 file changed

+1
-1
lines changed

src/main/kotlin/app/revanced/utils/adb/Adb.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal class Adb(
1717
private val device: JadbDevice
1818

1919
init {
20-
device = JadbConnection().devices.find { it.serial == deviceName }
20+
device = JadbConnection().devices.let { device -> device.find { it.serial == deviceName } ?: device.first() }
2121
?: throw IllegalArgumentException("No such device with name $deviceName")
2222

2323
if (!modeInstall && device.run("su -h", false) != 0)

0 commit comments

Comments
 (0)