Skip to content

Commit

Permalink
feat: connect to first device if given device was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Jan 15, 2023
1 parent 4edc325 commit 6485e47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/utils/adb/Adb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class Adb(
private val device: JadbDevice

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

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

0 comments on commit 6485e47

Please sign in to comment.