Exploit databaseDownload repository ZIP
GH-7d1d061134d2f84a23cf4a0e171249e3
aabdeldayem1/ftc-2023
Sources for CVE-2019-11358
1,181 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files86
aabdeldayem1/ftc-2023Revision 7e849a22dcb6
- ↑..Parent directory
- images/
- samples/
- FtcBlocksProjects_common.js
- FtcBlocks_common.js
- acceleration.js
- acceleration_sensor.js
- analog_input.js
- analog_output.js
- android_accelerometer.js
- android_gyroscope.js
- android_orientation.js
- android_sound_pool.js
- android_text_to_speech.js
- angular_velocity.js
- bno055imu.js
- bno055imu_parameters.js
- clipboard_util.js
- color.js
- color_range_sensor.js
- color_sensor.js
- compass_sensor.js
- cr_servo.js
- dbg_log.js
- dc_motor.js
- digital_channel.js
- distance_sensor.js
- elapsed_time.js
- elapsed_time2.js
- file_manager.js
- gamepad.js
- gyro_sensor.js
- hardware_util.js
- images.css
- ir_seeker_sensor.js
- led.js
- led_effect.js
- light_sensor.js
- linear_op_mode.js
- locale.js
- magnetic_flux.js
- matrix_f.js
- misc.js
- mr_i2c_compass_sensor.js
- mr_i2c_range_sensor.js
- navigation.js
- open_gl_matrix.js
- optical_distance_sensor.js
- orientation.js
- pidf_coefficients.js
- position.js
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
TeamCode/build/intermediates/assets/debug/blocks/light_sensor.js
JavaScript · 6,988 bytes/**
* @license
* Copyright 2016 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview FTC robot blocks related to light sensor.
* @author lizlooney@google.com (Liz Looney)
*/
// The following are generated dynamically in HardwareUtil.fetchJavaScriptForHardware():
// createLightSensorDropdown
// The following are defined in vars.js:
// createNonEditableField
// functionColor
// getPropertyColor
Blockly.Blocks['lightSensor_getProperty'] = {
init: function() {
var PROPERTY_CHOICES = [
['LightDetected', 'LightDetected'],
['RawLightDetected', 'RawLightDetected'],
['RawLightDetectedMax', 'RawLightDetectedMax'],
];
this.setOutput(true); // no type, for compatibility
this.appendDummyInput()
.appendField(createLightSensorDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(new Blockly.FieldDropdown(PROPERTY_CHOICES), 'PROP');
this.setColour(getPropertyColor);
// Assign 'this' to a variable for use in the tooltip closure below.
var thisBlock = this;
var TOOLTIPS = [
['LightDetected', 'Returns a numeric value between 0.0 and 1.0 representing the amount ' +
'of light detected by the light sensor.'],
['RawLightDetected', 'Returns a signal whose strength is proportional to the intensity ' +
'of the light measured.'],
['RawLightDetectedMax', 'Returns the maximum value that can be returned for ' +
'RawLightDetected.'],
];
this.setTooltip(function() {
var key = thisBlock.getFieldValue('PROP');
for (var i = 0; i < TOOLTIPS.length; i++) {
if (TOOLTIPS[i][0] == key) {
return TOOLTIPS[i][1];
}
}
return '';
});
}
};
Blockly.JavaScript['lightSensor_getProperty'] = function(block) {
var identifier = block.getFieldValue('IDENTIFIER');
var property = block.getFieldValue('PROP');
var code = identifier + '.get' + property + '()';
return [code, Blockly.JavaScript.ORDER_FUNCTION_CALL];
};
Blockly.FtcJava['lightSensor_getProperty'] = function(block) {
var identifier = Blockly.FtcJava.importDeclareAssign_(block, 'IDENTIFIER', 'LightSensor');
var property = block.getFieldValue('PROP');
var code = identifier + '.get' + property + '()';
return [code, Blockly.FtcJava.ORDER_FUNCTION_CALL];
};
Blockly.Blocks['lightSensor_getProperty_Number'] = {
init: function() {
var PROPERTY_CHOICES = [
['LightDetected', 'LightDetected'],
['RawLightDetected', 'RawLightDetected'],
['RawLightDetectedMax', 'RawLightDetectedMax'],
];
this.setOutput(true, 'Number');
this.appendDummyInput()
.appendField(createLightSensorDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(new Blockly.FieldDropdown(PROPERTY_CHOICES), 'PROP');
this.setColour(getPropertyColor);
// Assign 'this' to a variable for use in the closures below.
var thisBlock = this;
var TOOLTIPS = [
['LightDetected', 'Returns a numeric value between 0.0 and 1.0 representing the amount ' +
'of light detected by the light sensor.'],
['RawLightDetected', 'Returns a signal whose strength is proportional to the intensity ' +
'of the light measured.'],
['RawLightDetectedMax', 'Returns the maximum value that can be returned for ' +
'RawLightDetected.'],
];
this.setTooltip(function() {
var key = thisBlock.getFieldValue('PROP');
for (var i = 0; i < TOOLTIPS.length; i++) {
if (TOOLTIPS[i][0] == key) {
return TOOLTIPS[i][1];
}
}
return '';
});
this.getFtcJavaOutputType = function() {
var property = thisBlock.getFieldValue('PROP');
switch (property) {
case 'LightDetected':
case 'RawLightDetected':
case 'RawLightDetectedMax':
return 'double';
default:
throw 'Unexpected property ' + property + ' (lightSensor_getProperty_Number getOutputType).';
}
};
}
};
Blockly.JavaScript['lightSensor_getProperty_Number'] =
Blockly.JavaScript['lightSensor_getProperty'];
Blockly.FtcJava['lightSensor_getProperty_Number'] =
Blockly.FtcJava['lightSensor_getProperty'];
// Functions
Blockly.Blocks['lightSensor_enableLed'] = {
init: function() {
this.appendDummyInput()
.appendField('call')
.appendField(createLightSensorDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(createNonEditableField('enableLed'));
this.appendValueInput('ENABLE') // no type, for compatibility
.appendField('enable')
.setAlign(Blockly.ALIGN_RIGHT);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(functionColor);
this.setTooltip('Enable the LED light. Not all light sensors support this feature.');
}
};
Blockly.JavaScript['lightSensor_enableLed'] = function(block) {
var identifier = block.getFieldValue('IDENTIFIER');
var enable = Blockly.JavaScript.valueToCode(
block, 'ENABLE', Blockly.JavaScript.ORDER_NONE);
return identifier + '.enableLed(' + enable + ');\n';
};
Blockly.FtcJava['lightSensor_enableLed'] = function(block) {
var identifier = Blockly.FtcJava.importDeclareAssign_(block, 'IDENTIFIER', 'LightSensor');
var enable = Blockly.FtcJava.valueToCode(
block, 'ENABLE', Blockly.FtcJava.ORDER_NONE);
return identifier + '.enableLed(' + enable + ');\n';
};
Blockly.Blocks['lightSensor_enableLed_Boolean'] = {
init: function() {
this.appendDummyInput()
.appendField('call')
.appendField(createLightSensorDropdown(), 'IDENTIFIER')
.appendField('.')
.appendField(createNonEditableField('enableLed'));
this.appendValueInput('ENABLE').setCheck('Boolean')
.appendField('enable')
.setAlign(Blockly.ALIGN_RIGHT);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setColour(functionColor);
this.setTooltip('Enable the LED light. Not all light sensors support this feature.');
}
};
Blockly.JavaScript['lightSensor_enableLed_Boolean'] =
Blockly.JavaScript['lightSensor_enableLed'];
Blockly.FtcJava['lightSensor_enableLed_Boolean'] =
Blockly.FtcJava['lightSensor_enableLed'];