Remove splitarray
This commit is contained in:
parent
6e0b5d97bd
commit
5ecb50f6a5
1 changed files with 4 additions and 17 deletions
21
revanced.ps1
21
revanced.ps1
|
@ -71,21 +71,6 @@ function renderForm([String[]]$items, [String]$label, [String]$title, [System.Wi
|
|||
return $false
|
||||
}
|
||||
|
||||
function splitArray([String[]]$array, $splitter = $null, [int]$row = 0) {
|
||||
$returnVal = New-Object System.Collections.ArrayList
|
||||
if ($null -eq $splitter) {
|
||||
foreach ($i in $array) {
|
||||
$returnVal.Add(@($i.Split()[$row])) | Out-Null
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($i in $array) {
|
||||
$returnVal.Add(@($i.Split($splitter)[$row])) | Out-Null
|
||||
}
|
||||
}
|
||||
return $returnVal
|
||||
}
|
||||
|
||||
class config {
|
||||
[String]$patches = "none"
|
||||
[String]$integrations = "none"
|
||||
|
@ -229,9 +214,11 @@ function main {
|
|||
|
||||
[String]$selectedDevice = ''
|
||||
if ($devices.Length -eq 0) {throw "No devices found"}
|
||||
elseif ($devices.Length -eq 1) {$selectedDevice = (splitArray -array $devices)[0]}
|
||||
elseif ($devices.Length -eq 1) {
|
||||
$selectedDevice = ($devices | ForEach-Object {$_.split()[0]})[0]
|
||||
}
|
||||
else {
|
||||
$selectedDevice = (renderForm -items (splitArray -array $devices) -label "Select deployment target" -title "Installer for ReVanced - target" -mode One)
|
||||
$selectedDevice = (renderForm -items ($devices | ForEach-Object {$_.split()[0]}) -label "Select deployment target" -title "Installer for ReVanced - target" -mode One)
|
||||
}
|
||||
|
||||
# install to device
|
||||
|
|
Reference in a new issue