-
Notifications
You must be signed in to change notification settings - Fork 133
IEP-1613 Encrypted Flash: regular flash command is not separated from encrypted-flash command #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e749ed7
9ad0b8b
b344771
0f51993
fa16fdd
1e29540
a03cfa1
2709d05
8e51b38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,22 +39,22 @@ public interface IDFConstants | |||||||||||||||||||||
| * idf python file | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String IDF_PYTHON_SCRIPT = "idf.py"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * idf.py list targets | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String IDF_LIST_TARGETS_CMD = "--list-targets"; //$NON-NLS-1$ | ||||||||||||||||||||||
| String IDF_LIST_TARGETS_CMD = "--list-targets"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * idf_monitor python file | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String IDF_MONITOR_PYTHON_SCRIPT = "idf_monitor.py"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * idf sysviewtrace_proc script file | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String IDF_SYSVIEW_TRACE_SCRIPT = "sysviewtrace_proc.py"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * idf app_trace_folder | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
|
|
@@ -64,17 +64,17 @@ public interface IDFConstants | |||||||||||||||||||||
| * idf tools file | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String IDF_TOOLS_SCRIPT = "idf_tools.py"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * idf_monitor.py | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String IDF_MONITOR_SCRIPT = "idf_monitor.py"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * idf size file | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String IDF_SIZE_SCRIPT = "idf_size.py"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * idf tools.json file for installable tools | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
|
|
@@ -84,9 +84,11 @@ public interface IDFConstants | |||||||||||||||||||||
| * <IDF_PATH>/tools | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String TOOLS_FOLDER = "tools"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String FLASH_CMD = "flash"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
Comment on lines
88
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainEncrypted command name likely incorrect; align with idf.py target "encrypted-app-flash". idf.py exposes "encrypted-app" and "encrypted-app-flash" targets; "encrypted-flash" is not a known target. Using the wrong subcommand will fail at runtime. Recommend switching the value to "encrypted-app-flash" (keep the constant name if you want to minimize ripples), and audit call sites. Apply: - String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$
+ String FLASH_ENCRYPTED_CMD = "encrypted-app-flash"; //$NON-NLS-1$To double-check usages and docs across the repo: 🏁 Script executed: #!/bin/bash
# Look for potential mismatches
rg -nP -C2 '(encrypted[-_]app[-_]flash|encrypted[-_]flash|FLASH_ENCRYPTED_CMD|flash_command)'Length of output: 3520 Replace incorrect “encrypted-flash” constant and update UI tooltip --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFConstants.java
+++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFConstants.java
@@ -88,7 +88,7 @@
String FLASH_CMD = "flash"; //$NON-NLS-1$
- String FLASH_ENCRYPTED_CMD = "encrypted-flash"; //$NON-NLS-1$
+ String FLASH_ENCRYPTED_CMD = "encrypted-app-flash"; //$NON-NLS-1$Also update the Messages.properties tooltip so it reflects the two valid targets (“flash” and “encrypted-app-flash”): --- a/bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/nls/Messages.properties
+++ b/bundles/com.espressif.idf.terminal.connector.serial/src/com/espressif/idf/terminal/connector/serial/nls/Messages.properties
@@ -15,1 +15,1 @@
-SerialSettingsPage_EncryptionOptionTooltip1=Enable Flash Encryption. Ctrl+F and Ctrl+A will trigger the encrypted-flash and encrypted-app-flash commands.
+SerialSettingsPage_EncryptionOptionTooltip1=Enable Flash Encryption. Ctrl+F and Ctrl+A will trigger the flash and encrypted-app-flash commands.Audit any other references to “encrypted-flash” to ensure consistency. 📝 Committable suggestion
Suggested change
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * <IDF_PATH>/tools/cmake | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
|
|
@@ -106,7 +108,7 @@ public interface IDFConstants | |||||||||||||||||||||
| * Json config menu file name | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String KCONFIG_MENUS_JSON = "kconfig_menus.json"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * sdk config json file | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
|
|
@@ -130,28 +132,28 @@ public interface IDFConstants | |||||||||||||||||||||
| String TOOLS_INSTALL_CMD = "install"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String TOOLS_INSTALL_ALL_CMD = "all"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String TOOLS_INSTALL_PYTHON_CMD = "install-python-env"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String TOOLS_LIST_CMD = "list"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String TOOLS_EXPORT_FORMAT_KEYVALUE = "key-value"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String TOOLS_EXPORT_CMD_FORMAT = "--format"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String TOOLS_EXPORT_CMD_FORMAT_VAL = TOOLS_EXPORT_CMD_FORMAT + "=" + TOOLS_EXPORT_FORMAT_KEYVALUE; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String PYTHON_CMD = "python"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String PYTHON3_CMD = "python3"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * <IDF_PATH>/components | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String COMPONENTS_FOLDER = "components"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String ESP_CORE_DUMP_FOLDER = "espcoredump"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String ESP_CORE_DUMP_SCRIPT = "espcoredump.py"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
|
|
@@ -172,13 +174,13 @@ public interface IDFConstants | |||||||||||||||||||||
| String ESP_TOOL_CHIP_ID_CMD = "chip_id"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String ESP_TOOL_ERASE_FLASH_CMD = "erase_flash"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String ESP_WRITE_FLASH_CMD = "write_flash"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * Property to store project custom build directory | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| String BUILD_DIR_PROPERTY = "idf.buildDirectory.property"; //$NON-NLS-1$ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| String PROECT_DESCRIPTION_JSON = "project_description.json"; //$NON-NLS-1$ | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -717,37 +717,80 @@ public static void updateEspressifPrefPageOpenocdPath() | |
|
|
||
| public static String getCurrentTarget() | ||
| { | ||
| IProject project = null; | ||
| IProject project = getProjectFromActiveLaunchConfig(); | ||
| if (project == null) | ||
| { | ||
| Logger.log(Messages.IDFUtil_CantFindProjectMsg); | ||
| return null; | ||
| } | ||
| return new SDKConfigJsonReader(project).getValue("IDF_TARGET"); //$NON-NLS-1$ | ||
| } | ||
sigmaaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public static boolean isFlashEncrypted() | ||
| { | ||
| ILaunchConfiguration configuration; | ||
| try | ||
| { | ||
| configuration = getActiveLaunchConfiguration(); | ||
|
|
||
| return configuration != null | ||
| && configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false); | ||
| } | ||
| catch (CoreException e) | ||
| { | ||
| Logger.log(e); | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
|
Comment on lines
+729
to
+745
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainMake isFlashEncrypted resilient: fall back to sdkconfig (SECURE_FLASH_ENC_ENABLED) when launch attribute is absent Current logic relies solely on the launch attribute; if it’s unset, encryption may be incorrectly treated as disabled. Add a fallback to sdkconfig with tolerant boolean parsing. Apply: public static boolean isFlashEncrypted()
{
- ILaunchConfiguration configuration;
- try
- {
- configuration = getActiveLaunchConfiguration();
-
- return configuration != null
- && configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false);
- }
- catch (CoreException e)
- {
- Logger.log(e);
- }
-
- return false;
+ try {
+ ILaunchConfiguration configuration = getActiveLaunchConfiguration();
+ boolean enabled = configuration != null
+ && configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false);
+ if (enabled) {
+ return true;
+ }
+ // Fallback to sdkconfig if the launch attribute is absent/false
+ IProject project = getProjectFromActiveLaunchConfig();
+ if (project == null) {
+ return false;
+ }
+ String v = new SDKConfigJsonReader(project).getValue("SECURE_FLASH_ENC_ENABLED"); //$NON-NLS-1$
+ if (v == null) {
+ return false;
+ }
+ v = v.trim();
+ return "true".equalsIgnoreCase(v) || "1".equals(v) || "y".equalsIgnoreCase(v) || "yes".equalsIgnoreCase(v);
+ } catch (CoreException e) {
+ Logger.log(e);
+ return false;
+ }
}🏁 Script executed: #!/bin/bash
# Verify that the launch attribute is actually set somewhere.
rg -nP -C2 'FLASH_ENCRYPTION_ENABLED'
# Heuristic: look for setAttribute calls touching it
rg -nP -C2 'setAttribute\(\s*IDFLaunchConstants\.FLASH_ENCRYPTION_ENABLED'Length of output: 3862 🏁 Script executed: #!/bin/bash
# Search for SDKConfigJsonReader class declaration
rg -n "class SDKConfigJsonReader"
# Search for any references to SDKConfigJsonReader
rg -n "SDKConfigJsonReader"
# Search for getProjectFromActiveLaunchConfig method
rg -n "getProjectFromActiveLaunchConfig"
# Verify getActiveLaunchConfiguration definition in IDFUtil.java
rg -n -C2 "getActiveLaunchConfiguration" bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/IDFUtil.javaLength of output: 4611 Make isFlashEncrypted resilient: fallback to sdkconfig when launch attribute is absent Add a secondary lookup in isFlashEncrypted() to read SECURE_FLASH_ENC_ENABLED via SDKConfigJsonReader(project) whenever the FLASH_ENCRYPTION_ENABLED launch attribute is false or unset. Ensure getProjectFromActiveLaunchConfig() handles null, and update IDFUtilTest to mock SDKConfigJsonReader for this new path. 🤖 Prompt for AI Agents |
||
|
|
||
| /** | ||
| * Returns the active project from the currently selected launch configuration. | ||
| */ | ||
| public static IProject getProjectFromActiveLaunchConfig() | ||
| { | ||
| try | ||
| { | ||
| ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class); | ||
| ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration(); | ||
| if (activeConfig == null || activeConfig.getMappedResources() == null) | ||
| ILaunchConfiguration activeConfig = getActiveLaunchConfiguration(); | ||
| if (activeConfig == null) | ||
| { | ||
| Logger.log(Messages.IDFUtil_CantFindProjectMsg); | ||
| return StringUtil.EMPTY; | ||
| return null; | ||
| } | ||
|
|
||
| IResource[] resources = activeConfig.getMappedResources(); | ||
| if (resources == null || resources.length == 0) | ||
| { | ||
| Logger.log("No mapped resources in active launch configuration."); //$NON-NLS-1$ | ||
| return null; | ||
| } | ||
| project = activeConfig.getMappedResources()[0].getProject(); | ||
| Logger.log("Project:: " + project); //$NON-NLS-1$ | ||
|
|
||
| IProject project = resources[0].getProject(); | ||
| Logger.log("Active project: " + project); //$NON-NLS-1$ | ||
| return project; | ||
| } | ||
| catch (CoreException e) | ||
| { | ||
| Logger.log(e); | ||
| return null; | ||
| } | ||
| return new SDKConfigJsonReader(project).getValue("IDF_TARGET"); //$NON-NLS-1$ | ||
| } | ||
|
|
||
| public static IProject getProjectFromActiveLaunchConfig() throws CoreException | ||
| private static ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException | ||
| { | ||
| final ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class); | ||
| ILaunchConfiguration launchConfiguration = launchBarManager.getActiveLaunchConfiguration(); | ||
| IResource[] mappedResources = launchConfiguration.getMappedResources(); | ||
| if (mappedResources != null && mappedResources[0].getProject() != null) | ||
| ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class); | ||
| if (launchBarManager == null) | ||
| { | ||
| return mappedResources[0].getProject(); | ||
| Logger.log("LaunchBarManager service not found."); //$NON-NLS-1$ | ||
| return null; | ||
| } | ||
|
|
||
| return null; | ||
| ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration(); | ||
| if (activeConfig == null) | ||
| { | ||
| Logger.log("No active launch configuration."); //$NON-NLS-1$ | ||
| return null; | ||
| } | ||
| return activeConfig; | ||
| } | ||
|
|
||
| public static String getGitExecutablePathFromSystem() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,12 +54,14 @@ | |
| import org.eclipse.swt.events.SelectionEvent; | ||
| import org.eclipse.swt.layout.GridData; | ||
| import org.eclipse.swt.layout.GridLayout; | ||
| import org.eclipse.swt.program.Program; | ||
| import org.eclipse.swt.widgets.Button; | ||
| import org.eclipse.swt.widgets.Combo; | ||
| import org.eclipse.swt.widgets.Composite; | ||
| import org.eclipse.swt.widgets.Display; | ||
| import org.eclipse.swt.widgets.Group; | ||
| import org.eclipse.swt.widgets.Label; | ||
| import org.eclipse.swt.widgets.Link; | ||
| import org.eclipse.swt.widgets.Text; | ||
| import org.eclipse.ui.dialogs.ElementListSelectionDialog; | ||
| import org.eclipse.ui.ide.IDEEncoding; | ||
|
|
@@ -79,6 +81,7 @@ | |
| @SuppressWarnings("restriction") | ||
| public class CMakeMainTab2 extends GenericMainTab | ||
| { | ||
| private static final String DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML = "https://docs.espressif.com/projects/espressif-ide/en/latest/flashdevice.html#customize-flash-arguments"; //$NON-NLS-1$ | ||
| private static final String DEFAULT_JTAG_CONFIG_OPTIONS = String.format("-s ${%s} ${%s}", //$NON-NLS-1$ | ||
| OpenocdDynamicVariable.OPENOCD_SCRIPTS, JtagDynamicVariable.JTAG_FLASH_ARGS); | ||
| private Combo flashOverComboButton; | ||
|
|
@@ -94,6 +97,7 @@ public class CMakeMainTab2 extends GenericMainTab | |
| private TextWithButton dfuArgumentsField; | ||
| private Button checkOpenSerialMonitorButton; | ||
| private Combo fEncodingCombo; | ||
| private Button flashEncryptionCheckbox; | ||
|
|
||
| public enum FlashInterface | ||
| { | ||
|
|
@@ -230,9 +234,27 @@ protected void createUartComposite(Composite parent) | |
| uartAgrumentsField = new TextWithButton(parent, SWT.WRAP | SWT.BORDER); | ||
|
|
||
| createArgumentComponent(defaultComposite, uartAgrumentsField); | ||
| createFlashEncryptionCheckbox(defaultComposite); | ||
| createVerticalSpacer(defaultComposite, 1); | ||
| } | ||
|
|
||
| private void createFlashEncryptionCheckbox(Composite parent) | ||
| { | ||
| Group flashGroup = new Group(parent, SWT.NONE); | ||
| flashGroup.setText(Messages.CMakeMainTab2_FlashEncryptionGroup); | ||
| flashGroup.setLayout(new GridLayout(1, false)); | ||
| flashGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); | ||
|
|
||
| flashEncryptionCheckbox = new Button(flashGroup, SWT.CHECK); | ||
| flashEncryptionCheckbox.setText(Messages.CMakeMainTab2_FlashEncryptionCheckbox); | ||
| flashEncryptionCheckbox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); | ||
|
|
||
|
Comment on lines
+248
to
+251
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Persist checkbox changes This checkbox never calls flashEncryptionCheckbox = new Button(flashGroup, SWT.CHECK);
flashEncryptionCheckbox.setText(Messages.CMakeMainTab2_FlashEncryptionCheckbox);
flashEncryptionCheckbox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+ flashEncryptionCheckbox.addListener(SWT.Selection, e -> updateLaunchConfigurationDialog());🤖 Prompt for AI Agents |
||
| Link flashEncryptionNote = new Link(flashGroup, SWT.WRAP); | ||
| flashEncryptionNote.setText(Messages.CMakeMainTab2_FlashEncryptionNote); | ||
|
|
||
| flashEncryptionNote.addListener(SWT.Selection, e -> Program.launch(DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML)); | ||
| } | ||
|
|
||
|
Comment on lines
+241
to
+257
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Missing selection listener and visibility logic for the note. The note is always visible; there’s no linkage to the checkbox state. Add a listener to show/hide the note and relayout. Apply: - Link flashEncryptionNote = new Link(flashGroup, SWT.WRAP);
- flashEncryptionNote.setText(Messages.CMakeMainTab2_FlashEncryptionNote);
-
- flashEncryptionNote.addListener(SWT.Selection, e -> Program.launch(DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML));
+ flashEncryptionNote = new Link(flashGroup, SWT.WRAP);
+ flashEncryptionNote.setText(Messages.CMakeMainTab2_FlashEncryptionNote);
+ flashEncryptionNote.addListener(SWT.Selection, e -> Program.launch(DOCS_ESPRESSIF_FLASH_ENCRYPTION_HTML));
+ // Toggle note visibility with checkbox
+ flashEncryptionCheckbox.addListener(SWT.Selection, e -> refreshFlashEncryptionNoteVisibility(flashGroup));
+ refreshFlashEncryptionNoteVisibility(flashGroup);And declare a field: - private Button flashEncryptionCheckbox;
+ private Button flashEncryptionCheckbox;
+ private Link flashEncryptionNote;Add helper (outside changed ranges, shown for completeness): private void refreshFlashEncryptionNoteVisibility(Composite container) {
boolean visible = flashEncryptionCheckbox.getSelection();
flashEncryptionNote.setVisible(visible);
GridData gd = (GridData) flashEncryptionNote.getLayoutData();
if (gd == null) {
gd = new GridData(SWT.FILL, SWT.TOP, true, false);
flashEncryptionNote.setLayoutData(gd);
}
gd.exclude = !visible;
container.layout(true, true);
if (mainComposite != null) {
mainComposite.layout(true, true);
}
}🤖 Prompt for AI Agents |
||
| protected void createJtagflashComposite(Composite parent) | ||
| { | ||
|
|
||
|
|
@@ -541,6 +563,8 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) | |
| wc.setAttribute(IDFLaunchConstants.OPEN_SERIAL_MONITOR, checkOpenSerialMonitorButton.getSelection()); | ||
| if (checkOpenSerialMonitorButton.getSelection()) | ||
| wc.setAttribute(IDFLaunchConstants.SERIAL_MONITOR_ENCODING, fEncodingCombo.getText()); | ||
| wc.setAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, flashEncryptionCheckbox.getSelection()); | ||
|
|
||
| wc.doSave(); | ||
| } | ||
| catch (CoreException e) | ||
|
|
@@ -553,13 +577,28 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) | |
| public void initializeFrom(ILaunchConfiguration configuration) | ||
| { | ||
| super.initializeFrom(configuration); | ||
| updateFlashEncryptionGroup(configuration); | ||
| updateStartSerialMonitorGroup(configuration); | ||
| updateProjetFromConfig(configuration); | ||
| updateFlashOverStatus(configuration); | ||
| updateArgumentsWithDefaultFlashCommand(configuration); | ||
| switchUI(FlashInterface.values()[flashOverComboButton.getSelectionIndex()]); | ||
| } | ||
|
|
||
| private void updateFlashEncryptionGroup(ILaunchConfiguration configuration) | ||
| { | ||
| boolean isFlashEncryptionEnabled = false; | ||
| try | ||
| { | ||
| isFlashEncryptionEnabled = configuration.getAttribute(IDFLaunchConstants.FLASH_ENCRYPTION_ENABLED, false); | ||
| } | ||
| catch (CoreException e) | ||
| { | ||
| Logger.log(e); | ||
| } | ||
| flashEncryptionCheckbox.setSelection(isFlashEncryptionEnabled); | ||
| } | ||
|
|
||
| private void updateProjetFromConfig(ILaunchConfiguration configuration) | ||
| { | ||
| String projectName = StringUtil.EMPTY; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align flash_command description with actual target name
Once the constant is fixed to
encrypted-app-flash, the localization string needs the same wording so the UI matches reality.📝 Committable suggestion
🤖 Prompt for AI Agents