adb: refactor the core slightly\n\nThis fixes the slight connection issue, and fully fixes the device detection issues