Skip to content

Commit

Permalink
google-usb-driver: Add version 13
Browse files Browse the repository at this point in the history
  • Loading branch information
brian6932 committed Nov 8, 2023
1 parent 1a59b75 commit be9beef
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions bucket/google-usb-driver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "13",
"description": "The Google USB Driver is required to perform adb debugging on Windows with Google devices.",
"homepage": "https://developer.android.com/studio/run/win-usb",
"license": "Proprietary",
"url": "https://dl.google.com/android/repository/usb_driver_r13-windows.zip",
"hash": "360b01d3dfb6c41621a3a64ae570dfac2c9a40cca1b5a1f136ae90d02f5e9e0b",
"extract_dir": "usb_driver",
"pre_install": "if (!$global) { Write-Host -Foreground Red \"$app should be installed globally.\"; break }",
"installer": {
"script": [
"using namespace System.Security.Cryptography.X509Certificates",
"# Add cert first before installing driver",
"$cert = (Get-AuthenticodeSignature \"$dir/androidwinusb$(if ($architecture -eq '32bit') { '86' } else { 'a64' }).cat\").SignerCertificate",
"if (!(Get-ChildItem Cert:/CurrentUser/TrustedPublisher -Recurse | Where-Object { $_.Thumbprint -eq $cert.Thumbprint })) {",
" Write-Host 'Cert not found, adding to trusted store...'",
" $store = [X509Store]::new([StoreName]::TrustedPublisher, [StoreLocation]::CurrentUser)",
" $store.Open([OpenFlags]::ReadWrite)",
" $store.Add($cert.Export([X509ContentType]::Cert))",
" $store.Close()",
"}",
"",
"Write-Host 'Installing driver...'",
"Invoke-ExternalCommand pnputil -ArgumentList @('/add-driver', \"$dir/android_winusb.inf\", '/install') -RunAs -ContinueExitCodes @{ 3010 = 'A system reboot is required to finalize the installation.' } | Out-Null"
]
},
"uninstaller": {
"script": [
"if ($cmd -ne 'uninstall') { return }",
"pnputil.exe /delete-driver \"$dir/android_winusb.inf\" /uninstall | Out-Null"
]
},
"checkver": {
"regex": "\"https://dl\\.google\\.com/android/repository/usb_driver_r([\\d]+)-windows\\.zip\""
},
"autoupdate": {
"url": "https://dl.google.com/android/repository/usb_driver_r$version-windows.zip"
}
}

0 comments on commit be9beef

Please sign in to comment.