[HN Gopher] Android developers no longer need Windows USB drivers
       ___________________________________________________________________
        
       Android developers no longer need Windows USB drivers
        
       Author : titaniumtown
       Score  : 145 points
       Date   : 2023-12-30 09:29 UTC (13 hours ago)
        
 (HTM) web link (fabiensanglard.net)
 (TXT) w3m dump (fabiensanglard.net)
        
       | Semaphor wrote:
       | That explains it, I was wondering why things suddenly worked. Not
       | just relevant for devs, but also people who want a better and/or
       | more private android experience than what vendors offer.
        
         | 8organicbits wrote:
         | Do you have a good method for cleaning things up? I usually
         | factory reset any new phone and then uninstall via adb the
         | obvious pre-installed spyware/adware/junk (facebook, chrome,
         | candycrush, etc). But it's hard to know what else I can
         | uninstall. I usually go overkill, uninstall most things, see
         | what broke, factory reset again, and then uninstall a little
         | less on the next round. But surely there's a better way.
        
           | Semaphor wrote:
           | I unlock the bootloader and install a custom rom (pretty much
           | exclusively LineageOS nowadays, I'd try GrapheneOS, but I'd
           | have to spend far more on the phone than I'm willing to get
           | that). That is everything cleaned ;) I only buy phones with
           | LineageOS support.
        
             | pxeboot wrote:
             | GrapheneOS is no harder to install or use than LineageOS.
             | If anything, it is easier, since the documentation is far
             | better and almost always applicable to all supported
             | devices.
        
               | Semaphor wrote:
               | It's not about hard/easy, it's the supported devices. I
               | spend very little on phones (current one is a OnePlus
               | Nord, which I bought for 250EUR) as I don't like to use
               | them.
        
               | 8organicbits wrote:
               | Graphene is Google Pixel only still. The current cheapest
               | available looks like the Pixel 7A at PS379 (new). So I
               | agree, the added cost doesn't seem worth it.
               | 
               | https://store.google.com/config/pixel_7a
        
             | Xeamek wrote:
             | Does it come with it's own version of the 'core apps'
             | (calendar, phone, calculator etc.) or do You install and
             | use some third party apps from app store?
        
               | Tade0 wrote:
               | You can install a custom Google Apps package, e.g.:
               | 
               | https://nikgapps.com/
        
               | Xeamek wrote:
               | At that point why would I go for the trouble of
               | installing custom rom though?
        
               | scns wrote:
               | Because you can choose how many of them you want. None,
               | only the Play Store or the whole shebang.
        
               | Semaphor wrote:
               | Besides what sibling said, and lack of bloatware, I find
               | LineageOS to simply be better than original ROMs. Just
               | using vol up/down to move the cursor is already a godsend
               | for me.
               | 
               | I've also been using CyanogenMod/LineageOS since my first
               | android (HTC Desire Z/T-Mobile G2, damn do I miss that
               | full keyboard) and it's great to be able to always use
               | the same OS.
        
               | opan wrote:
               | You'll get AOSP versions of the basics, though some
               | things like the camera app might actually be
               | made/modified by Lineage. I run LineageOS with no gapps
               | and find it to be quite usable. I get most apps from
               | F-Droid, but there's also Aurora Store (installable from
               | F-Droid) if you need anything from the Play Store.
        
         | tjoff wrote:
         | Or if you want to use scrcpy, which I find indispensable.
         | 
         | https://github.com/Genymobile/scrcpy
        
           | yonatan8070 wrote:
           | Scrcpy is an awesome tool, but I never found a use for it in
           | my workflow (built a couple of small, unpublished Android
           | apps)
           | 
           | What do you use it for that makes it better than just picking
           | up your device?
        
             | sir_brickalot wrote:
             | I just had a strong use case: a broken screen.
             | 
             | A combination of Google Assistant, Talkback, USB-C-to-USB-
             | A-Adapter and Keyboard, a Bluetooth keyboard, scrcpy,
             | Anydesk and a new Pixel phone for practicing helped get
             | some data off the device and even do a migration to the new
             | phone. Needed all of the above and a lot of trial and error
             | and time!!
        
             | tjoff wrote:
             | I do most of my meetings on my phone, and enlarging the
             | screen if someone is sharing their screen works pretty well
             | (it's not perfect, but more than enough for presentations).
             | But I can of course transfer the call to my PC if need be.
             | 
             | But I just have scrcpy up in a window on one of my
             | screens/workspace constantly. The keyboard shortcuts work
             | quite well and I don't have to break my flow just to do
             | something on my phone. Clipboard is synced as well.
             | 
             | If I get a notification I can check what it is about
             | without taking my hands of my keyboard etc.
             | 
             | I'm sure it sounds a bit convoluted, and each usecase
             | (meetings, notifications etc.) have other better/more-
             | native solutions but the experience all in all is a game-
             | changer.
             | 
             | To the point where "just picking up your device" is too
             | much of a bother. Why not do it through scrcpy instead?
             | Quicker, proper keyboard etc. and the mouse works really
             | well. To the point where I kind of miss right-click is
             | "back" when I'm outside the scrcpy window.
        
       | nodja wrote:
       | TL;DR: Android only needs winusb to work, before Windows 8 (2012)
       | windows only used Vendor ID and Product ID to decide what driver
       | to load, so you had to install a new .inf driver file for every
       | new device. Newer versions ask the device for a Microsoft OS
       | Descriptors (MOD) payload that tell windows what drivers to load,
       | usually winusb and MTP. The devices need to support this, the
       | author says the pixels started supporting this since the Pixel 2
       | (2017).
        
         | cylemons wrote:
         | > windows only used Vendor ID and Product ID to decide what
         | driver to load
         | 
         | Even if you plug in standard device classes like HID?
        
       | grishka wrote:
       | I remember being annoyed at this. However, this was a solved
       | problem a long time ago -- sometime after I switched to macOS and
       | stopped paying attention to the Windows side of things, there
       | started appearing universal ADB drivers.
        
         | diggan wrote:
         | I remember being annoyed at this too, then I stopped doing
         | Android development so I also consider it a solved problem.
        
           | GlacierFox wrote:
           | I remember being annoyed at the development process in
           | general so I stopped developing and now live in stasis inside
           | a glass egg.
        
             | faitswulff wrote:
             | Do you happen to have a Nix flake for that egg setup?
        
             | nefarious_ends wrote:
             | I remember being annoyed in general, but then I ascended
             | beyond human emotions and now exist as a being of pure
             | logic. I make PWAs instead.
        
               | serf wrote:
               | lucky you, personally I just stopped at "I remember being
               | annoyed.", and have been stuck here for years.
        
       | dmarinus wrote:
       | Android should have used HID to have better compatibility with
       | Windows. But I guess the Android developers were on Linux so it
       | wasn't such a big problem for them. Glad it's fixed on Windows
       | now.
        
         | iforgotpassword wrote:
         | (ab)using hid for anything it's not been designed for usually
         | is a pita, especially if you want decent throughput.
        
       | pjmlp wrote:
       | This has been a solved problem for several years now.
        
       | FpUser wrote:
       | I used raw HID protocol in my USB connected device. This worked
       | on all versions of Windows. Granted it is not suitable for every
       | need but worked just fine for my case.
        
       | marcodiego wrote:
       | The USB driver scene on windows is confusing and sometimes even
       | dangerous. I've seen some students unable to use Arduino clones
       | on windows when they worked perfectly on Linux. I then found
       | this: https://learnarduinonow.com/2014/10/24/does-windows-ftdi-
       | upd... (TLDR: windows auto-installs a driver that will brick your
       | device if they think it is "counterfeit") and decided plugging
       | something other than a storage device (if you trust the system to
       | be free from viruses) on a windows machine is something that
       | should be done as a last resort only.
        
       | karmakaze wrote:
       | Link for reference:
       | 
       | > Bingxing Wang's awesome driver[0].
       | 
       |  _Windows Precision Touchpad Implementation for Apple MacBook
       | family /Magic Trackpad 2_
       | 
       | [0] https://github.com/imbushuo/mac-precision-touchpad
        
         | refulgentis wrote:
         | Karmakaze is very apt ;) -- taking the quote, which is a link,
         | and extracting it to a comment with the link "for reference",
         | but really it's to harvest karma from people who didn't read
         | the article
        
           | fragmede wrote:
           | And then, you pointing it out so you can get in on the karma
           | train as well! And then this comment, made just for the
           | points, which are worth so much that I'm trading in my cheap
           | car for a flashy new one next week!
        
           | karmakaze wrote:
           | Akshully.. it's my way of bookmarking/remembering this for
           | later when I'll want it again And thought it might be useful
           | to highlight (or discuss).
        
         | DiabloD3 wrote:
         | I was using that for years.
         | 
         | Apple _hates their own customers_ for not having written that
         | themselves, and forcing us to use some half-assed driver
         | included in Bootcamp that made the whole thing seem state-of-
         | the-art circa Windows 98.
         | 
         | That said, my MBPr eventually phased out of Windows support
         | (Intel GPU drivers aged out; more and more apps were
         | losing/removing acceleration features due to
         | (unfixed/unfixable) driver and hw bugs, didn't meet Win11 CPU
         | requirements but ran Win11 fine), it now runs Linux with
         | Waylandized KDE; Linux supports the entire feature set of these
         | trackpads without any work).
         | 
         | But yeah, imbushuo is doing some serious work and deserves
         | recognition.
        
           | wkat4242 wrote:
           | I always thought apple provided crap drivers to make macOS
           | look better. They also drop driver support way too quickly
           | and go out of their way to block boot Camp installations with
           | Windows versions that are newer than they 'support' (whatever
           | little their support is actually worth)
        
             | DiabloD3 wrote:
             | Bootcamp is a joke. Every Intel Mac runs a complete EFI
             | impl based on the stock Intel one, and can just boot
             | Windows without Bootcamp.
             | 
             | Also the only way to install using GPT, as Bootcamp's
             | bootloader hides the GPT header (and OSX uses 2 out of the
             | 4 MBR partition slots) and forces Window to use "legacy
             | single partition mode", which means no Bitlockering C:\ as
             | the EFI boot partition (required since Vista, no matter if
             | it is a EFI/GPT or Legacy Bios/MBR machine) is where ntldr
             | lives now (same way in the MBR days you had /boot on a
             | different unecrypted partition, so you can boot linux, load
             | the initrd, and then unlock the root partition); Windows
             | uses 3 partitions, EFI boot, C:\, and the recovery
             | partition.
             | 
             | Once I realized that, I blanked the entire disk, and purged
             | OSX forever. I made that decision 10 years ago (the MBPr is
             | still alive!), and I never looked back.
        
       | ineptech wrote:
       | No longer, as of when? I was working on this exact problem two
       | days ago, using an old Lenovo M7 for a magic mirror project for a
       | gift. I went through every relevant SO article and gave up
       | without getting it to show up for adb, so it's odd to see this
       | declared a solved problem.
        
         | kllrnohj wrote:
         | Requires the device to support the extended USB information
         | query. Pixel devices do, at least, presumably your random
         | Lenovo doesn't though for some reason so you'd need a "driver"
         | (even though all the INF does is say "use the standard winusb
         | driver")
        
       | wkat4242 wrote:
       | I really love adb. It's so damn useful. You can even reroute
       | ports through a VPN running on the phone. It's like a swiss army
       | knife. And I'm not even an android developer lol
       | 
       | It's one of the biggest reasons I prefer android. That and the
       | work profile that allows me to compartmentalise all work stuff
       | and other privacy invading shit without needing a second phone.
        
         | dotancohen wrote:
         | Tell us more about this work profile. Is this on all Android
         | phones?
        
           | vetinari wrote:
           | It should be nowadays; but to provision it, you need MDM.
           | 
           | https://www.android.com/enterprise/work-profile/
        
             | lern_too_spel wrote:
             | Not necessarily.
             | 
             | https://github.com/googlesamples/android-testdpc
             | 
             | https://gitea.angry.im/PeterCxy/Shelter
             | 
             | https://secure-system.gitlab.io/Insular/
        
             | wkat4242 wrote:
             | No you don't! You can just use the island (or insular) app
             | to leverage it for your own purposes
        
           | mmh0000 wrote:
           | https://source.android.com/docs/devices/admin/multi-user
           | 
           | https://sensepost.com/blog/2020/multiple-android-user-
           | profil...
        
           | wkat4242 wrote:
           | It is yes. It's a separate profile which is open at the same
           | time as the regular profile (unlike the multi user function
           | of Android where only one is open at the same time)
           | 
           | It separates your app list and files into two sections, work
           | and personal. The work apps get a briefcase overlay icon.
           | 
           | I use it to separate my work apps and to shield privacy
           | invading apps from my main profile. You can use the insular
           | or island apps to invoke it on pretty much any phone. Even
           | AOSP has it. MDM can also invoke it, which is what it's
           | intended for.
           | 
           | It also allows you to turn off the whole work profile with
           | one button. Great if you do use it for work and you want to
           | have a quiet weekend. The benefit for your employer is that
           | it stops you from copying work data to private apps.
           | 
           | If you do use it for work it stops your employer from seeing
           | your personal side like what apps you have installed. This
           | can be pretty privacy invasive. For example if you have
           | tinder or Grindr installed. I work in MDM management and on
           | apple I can see this. On Android when work profile is used I
           | can't.
        
       | inemesitaffia wrote:
       | I've been using wireless adb since 4.4
        
       ___________________________________________________________________
       (page generated 2023-12-30 23:00 UTC)