Skip to content

Commit e25e686

Browse files
[JENKINS-74173][JENKINS-74174][JENKINS-74175] Address CSP violations (#234)
* [JENKINS-74174] Migrate legacy `checkUrl` in `AndroidEmulator/global.jelly` * [JENKINS-74173] Migrate legacy `checkUrl` in `UninstallBuilder/config.jelly` * [JENKINS-74175] Migrate legacy `checkUrl` in `AndroidEmulator/config.jelly`
1 parent 6957ff5 commit e25e686

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

src/main/java/hudson/plugins/android_emulator/AndroidEmulator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,8 @@ private ValidationResult doCheckScreenDensity(String density, boolean allowVaria
10291029
}
10301030

10311031
public FormValidation doCheckScreenResolution(@QueryParameter String value,
1032-
@QueryParameter String density, @QueryParameter String osVersion) {
1033-
return doCheckScreenResolution(value, density, osVersion, true).getFormValidation();
1032+
@QueryParameter String screenDensity, @QueryParameter String osVersion) {
1033+
return doCheckScreenResolution(value, screenDensity, osVersion, true).getFormValidation();
10341034
}
10351035

10361036
private ValidationResult doCheckScreenResolution(String resolution, String density,

src/main/resources/hudson/plugins/android_emulator/AndroidEmulator/config.jelly

+10-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
help="/plugin/android-emulator/help-emulatorNamed.html">
77
<f:nested>
88
<f:entry title="${%AVD name}" field="avdName" description="${%Enter the name of an existing Android emulator configuration}">
9-
<f:textbox checkUrl="'descriptorByName/AndroidEmulator/checkAvdName?value='+escape(this.value)"/>
9+
<f:textbox checkUrl="descriptorByName/AndroidEmulator/checkAvdName" checkDependsOn=""/>
1010
</f:entry>
1111
</f:nested>
1212
</f:radioBlock>
@@ -18,37 +18,35 @@
1818
<f:entry title="${%Android OS version}" help="/plugin/android-emulator/help-osVersion.html">
1919
<f:editableComboBox id="android-emulator.osVersion" field="osVersion"
2020
items="${descriptor.androidVersions}"
21-
checkUrl="'descriptorByName/AndroidEmulator/checkOsVersion?value='+escape(this.value)" />
21+
checkUrl="descriptorByName/AndroidEmulator/checkOsVersion" checkDependsOn="" />
2222
</f:entry>
2323
<f:entry title="${%Screen density}" help="/plugin/android-emulator/help-screenDensity.html">
24-
<f:editableComboBox name="android-emulator.screenDensity" field="screenDensity"
24+
<f:editableComboBox id="android-emulator.screenDensity" field="screenDensity"
2525
items="${descriptor.deviceDensities}"
26-
checkUrl="'descriptorByName/AndroidEmulator/checkScreenDensity?value='+escape(this.value)" />
26+
checkUrl="descriptorByName/AndroidEmulator/checkScreenDensity" checkDependsOn="" />
2727
</f:entry>
2828
<f:entry title="${%Screen resolution}" help="/plugin/android-emulator/help-screenResolution.html">
2929
<f:editableComboBox id="android-emulator.screenResolution" field="screenResolution"
3030
items="${descriptor.deviceResolutions}"
31-
checkUrl="'descriptorByName/AndroidEmulator/checkScreenResolution?value='+ escape(this.value)
32-
+'&amp;density='+ escape(findMatchingFormInput(this,'android-emulator.screenDensity').value)
33-
+'&amp;osVersion='+ escape(document.getElementById('android-emulator.osVersion').value)" />
31+
checkUrl="descriptorByName/AndroidEmulator/checkScreenResolution" checkDependsOn="osVersion screenDensity"/>
3432
</f:entry>
3533
<f:entry title="${%Device Definition}" help="/plugin/android-emulator/help-deviceDefinition.html">
3634
<f:textbox name="android-emulator.deviceDefinition" value="${instance.deviceDefinition}" style="width:6em"
37-
checkUrl="'descriptorByName/AndroidEmulator/checkDeviceDefinition?value='+escape(this.value)" />
35+
checkUrl="descriptorByName/AndroidEmulator/checkDeviceDefinition" checkDependsOn=""/>
3836
</f:entry>
3937
<f:entry title="${%Device locale}" help="/plugin/android-emulator/help-deviceLocale.html">
4038
<f:editableComboBox id="android-emulator.deviceLocale" field="deviceLocale"
4139
items="${descriptor.emulatorLocales}"
42-
checkUrl="'descriptorByName/AndroidEmulator/checkDeviceLocale?value='+escape(this.value)" />
40+
checkUrl="descriptorByName/AndroidEmulator/checkDeviceLocale" checkDependsOn=""/>
4341
</f:entry>
4442
<f:entry title="${%SD card size}" help="/plugin/android-emulator/help-sdCard.html">
4543
<f:textbox name="android-emulator.sdCardSize" value="${instance.sdCardSize}" style="width:6em"
46-
checkUrl="'descriptorByName/AndroidEmulator/checkSdCardSize?value='+escape(this.value)" />
44+
checkUrl="descriptorByName/AndroidEmulator/checkSdCardSize" checkDependsOn=""/>
4745
</f:entry>
4846
<f:entry title="${%Target ABI}" help="/plugin/android-emulator/help-targetAbi.html">
4947
<f:editableComboBox id="android-emulator.targetAbi" field="targetAbi"
5048
items="${descriptor.targetAbis}"
51-
checkUrl="'descriptorByName/AndroidEmulator/checkTargetAbi?value='+escape(this.value)" />
49+
checkUrl="descriptorByName/AndroidEmulator/checkTargetAbi" checkDependsOn="" />
5250
</f:entry>
5351
<f:entry title="${%Emulator name suffix}" help="/plugin/android-emulator/help-avdNameSuffix.html">
5452
<f:textbox name="android-emulator.avdNameSuffix" value="${instance.avdNameSuffix}" style="width:12em" />
@@ -109,7 +107,7 @@
109107
<f:textbox />
110108
</f:entry>
111109
<f:entry title="${%Emulator executable}" field="executable">
112-
<f:editableComboBox items="${descriptor.executables}" checkUrl="'descriptorByName/AndroidEmulator/checkExecutable?value='+escape(this.value)" />
110+
<f:editableComboBox items="${descriptor.executables}" checkUrl="descriptorByName/AndroidEmulator/checkExecutable" checkDependsOn="" />
113111
</f:entry>
114112
</f:advanced>
115113
</f:section>

src/main/resources/hudson/plugins/android_emulator/AndroidEmulator/global.jelly

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
<f:entry title="${%Android SDK root}"
77
description="${%Enter the path to the root of an Android SDK installation}"
88
help="/plugin/android-emulator/help-sdkRoot.html">
9-
<input class="setting-input validated" name="android-emulator.androidHome"
10-
type="text" value="${descriptor.androidHome}"
11-
checkUrl="'buildWrapper/AndroidEmulator/checkAndroidHome?value='+escape(this.value)" />
9+
<f:textbox name="android-emulator.androidHome" value="${descriptor.androidHome}"
10+
checkUrl="buildWrapper/AndroidEmulator/checkAndroidHome" checkDependsOn=""/>
1211
</f:entry>
1312

1413
<f:entry help="/plugin/android-emulator/help-installSdk.html">

src/main/resources/hudson/plugins/android_emulator/UninstallBuilder/config.jelly

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<f:entry title="${%Package ID}">
55
<f:textbox name="android-emulator.packageId" value="${instance.packageId}"
6-
checkUrl="'descriptorByName/UninstallBuilder/checkPackageId?value='+escape(this.value)"/>
6+
checkUrl="descriptorByName/UninstallBuilder/checkPackageId" checkDependsOn=""/>
77
<f:description>${%ID of the Android package to be uninstalled}</f:description>
88
</f:entry>
99

0 commit comments

Comments
 (0)