summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2024-09-19 12:45:07 -0400
committerBrian Potchik <brian@vector35.com>2024-09-19 12:45:07 -0400
commit43d5fb9103cde2941948f3e7dfb1b38bb67fac23 (patch)
tree0de7716c72495071d09a277cff0329dffc4c8506
parentafb41a37f9f6fa9e3c2d8df35fa9c9ae215299ee (diff)
Add additional testing and handling for object settings.
-rw-r--r--binaryninjaapi.h5
-rw-r--r--python/settings.py6
-rw-r--r--rust/examples/dwarf/dwarf_import/src/lib.rs6
-rw-r--r--rust/examples/pdb-ng/src/lib.rs1
-rw-r--r--ui/settingsview.h4
-rw-r--r--view/macho/universalview.cpp1
6 files changed, 10 insertions, 13 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 4126c8cd..78d04d86 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -16041,8 +16041,9 @@ namespace BinaryNinja {
Property JSON Data Type Prerequisite Optional {Allowed Values} and Notes
================== ====================================== ================== ======== =======================================================================
"title" string None No Concise Setting Title
- "type" string None No {"array", "boolean", "number", "string"}
- "elementType" string "type" is "array" No {"string"}
+ "type" string None No {"array", "boolean", "number", "string", "object"}
+ "sorted" boolean "type" is "array" Yes Automatically sort list items (default is false)
+ "isSerialized" boolean "type" is "string" Yes Treat the string as a serialized JSON object
"enum" array : {string} "type" is "array" Yes Enumeration definitions
"enumDescriptions" array : {string} "type" is "array" Yes Enumeration descriptions that match "enum" array
"minValue" number "type" is "number" Yes Specify 0 to infer unsigned (default is signed)
diff --git a/python/settings.py b/python/settings.py
index 6a2227ae..8737e652 100644
--- a/python/settings.py
+++ b/python/settings.py
@@ -66,9 +66,9 @@ class Settings:
Property JSON Data Type Prerequisite Optional {Allowed Values} and Notes
=================== ====================================== ================== ======== =======================================================================
"title" string None No Concise Setting Title
- "type" string None No {"array", "boolean", "number", "string"}
- "elementType" string "type" is "array" No {"string"}
- "sorted" boolean "type" is "array" Yes Automatically sort list items (default is true)
+ "type" string None No {"array", "boolean", "number", "string", "object"}
+ "sorted" boolean "type" is "array" Yes Automatically sort list items (default is false)
+ "isSerialized" boolean "type" is "string" Yes Treat the string as a serialized JSON object
"enum" array : {string} "type" is "string" Yes Enumeration definitions
"enumDescriptions" array : {string} "type" is "string" Yes Enumeration descriptions that match "enum" array
"minValue" number "type" is "number" Yes Specify 0 to infer unsigned (default is signed)
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs
index 74f2065e..114084a1 100644
--- a/rust/examples/dwarf/dwarf_import/src/lib.rs
+++ b/rust/examples/dwarf/dwarf_import/src/lib.rs
@@ -551,8 +551,8 @@ pub extern "C" fn CorePluginInit() -> bool {
r#"{
"title" : "Debuginfod Server URLs",
"type" : "array",
- "elementType" : "string",
- "default" : [],
+ "sorted" : true,
+ "default" : [],
"description" : "Servers to use for fetching DWARF debug info for files with a .note.gnu.build-id section.",
"ignore" : []
}"#,
@@ -574,7 +574,7 @@ pub extern "C" fn CorePluginInit() -> bool {
r#"{
"title" : "Debug File Directories",
"type" : "array",
- "elementType" : "string",
+ "sorted" : true,
"default" : [],
"description" : "Paths to folder containing DWARF debug info stored by build id.",
"ignore" : []
diff --git a/rust/examples/pdb-ng/src/lib.rs b/rust/examples/pdb-ng/src/lib.rs
index e2e3ec44..cd457d06 100644
--- a/rust/examples/pdb-ng/src/lib.rs
+++ b/rust/examples/pdb-ng/src/lib.rs
@@ -755,7 +755,6 @@ fn init_plugin() -> bool {
r#"{
"title" : "Symbol Server List",
"type" : "array",
- "elementType" : "string",
"sorted" : false,
"default" : ["https://msdl.microsoft.com/download/symbols"],
"aliases" : ["pdb.symbol-server-list", "pdb.symbolServerList"],
diff --git a/ui/settingsview.h b/ui/settingsview.h
index 5fa88e0a..b0f209b3 100644
--- a/ui/settingsview.h
+++ b/ui/settingsview.h
@@ -170,7 +170,6 @@ class BINARYNINJAUIAPI SettingsEditor : public QWidget
QDoubleSpinBox* m_doubleSpinBox = nullptr;
QSpinBox* m_spinBox = nullptr;
QComboBox* m_comboBox = nullptr;
- QLineEdit* m_arrayText = nullptr;
QTableWidget* m_objectTable = nullptr;
std::set<QString> m_validComboSelections;
std::vector<std::pair<std::string, Json::ValueType>> m_objectTableColumns;
@@ -212,9 +211,8 @@ class BINARYNINJAUIAPI SettingsEditor : public QWidget
void updateFormatedNumberSetting();
void updateDoubleNumberSetting(double value);
void updateIntNumberSetting(int value);
- void updateArraySetting();
void updateObjectSetting();
- void addArrayStringSetting(const QString& text);
+ void addArraySetting(const QString& text);
void resetSetting();
void resetAllSettings(BNSettingsScope scope);
diff --git a/view/macho/universalview.cpp b/view/macho/universalview.cpp
index ac637c75..b2c0c23b 100644
--- a/view/macho/universalview.cpp
+++ b/view/macho/universalview.cpp
@@ -113,7 +113,6 @@ void BinaryNinja::InitUniversalViewType()
R"({
"title" : "Universal Mach-O Architecture Preference",
"type" : "array",
- "elementType" : "string",
"sorted" : false,
"default" : [],
"description" : "Specify an architecture preference for automatic loading of a Mach-O file from a Universal archive. By default, the first object file in the listing is loaded.",