From 4e3e1cc6d6f782c52122495f766db2af11f192ed Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Mon, 4 Jul 2022 01:48:17 +0200 Subject: [PATCH] Fix expected same ordering It is not guaranteened that integration list will bethe in the same order after updating --- revanced.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/revanced.ps1 b/revanced.ps1 index 4173efd..f5dbde5 100644 --- a/revanced.ps1 +++ b/revanced.ps1 @@ -189,9 +189,10 @@ function main { [System.Collections.ArrayList]$savedExclusions = New-Object System.Collections.ArrayList $savedExclusionsNames = $config.excluded foreach ($i in $integrationsList) { - if (($null -ne $savedExclusionsNames[0]) -and $i.StartsWith($savedExclusionsNames[0])) { - [void] $savedExclusions.Add($true) - $savedExclusionsNames.RemoveAt(0) + $integrationID = $i.Split(':')[0] + if (($savedExclusionsNames.Count -gt 1) -and $savedExclusionsNames.Contains($integrationID)) { + $savedExclusions.Add($true) + $savedExclusionsNames.Remove($integrationID) } else { [void] $savedExclusions.Add($false)