fix and add throw if nothing from the list selected

This commit is contained in:
Wroclaw 2022-07-19 18:04:03 +02:00
parent 5ecb50f6a5
commit 7f8d160661

View file

@ -159,9 +159,10 @@ function main {
elseif ($apks.getType().Name -eq 'String') {$selectedApk = $apks}
else {
$selectedApk = (renderForm -items $apks -label "Select apk file to patch" -title "Installer for ReVanced - apk selector" -mode One)
if (-not $selectedApk) {throw "No apk selected!"}
}
if (-not $selectedApk) {throw "No apk selected!"}
# Get available integrations
$integrationsList = New-Object System.Collections.ArrayList
@ -221,6 +222,8 @@ function main {
$selectedDevice = (renderForm -items ($devices | ForEach-Object {$_.split()[0]}) -label "Select deployment target" -title "Installer for ReVanced - target" -mode One)
}
if (-not $selectedDevice) {throw "No device selected"}
# install to device
$patcherArgs = "-jar", ".\app\revanced-cli.jar", "-a", ".\$selectedApk", "-c", "-d", "$selectedDevice", "-o", "$env:tmp\revanced.apk", "-m", ".\app\app-release-unsigned.apk", "-b", ".\app\revanced-patches.jar"