generated from ScoopInstaller/BucketTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |