What changed, and why it matters
This commit fixes formatting in a build configuration template and tightens the script that enables optional cryptocurrency features. It changes how the script recognizes marker comments so it only matches exact lines, not partial ones, and removes an unused helper function. There is no indication this is a security fix or that it addresses any vulnerability.
No security action required. Treat as a routine build-tooling/maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates scripts/app_config/templates/pubspec.template.yaml to standardize comment spacing for conditional dependency blocks (e.g., %%ENABLE_FROST%%, %%ENABLE_XEL%%) and renames one marker from %%ENABLE_MWEB%% to %%ENABLE_MWEBD%%. In tool/process_pubspec_deps.dart, the marker detection logic changes from line.contains(...) to line.trim() == ..., making matching exact and less error-prone. It also deletes the unused _genFile function. No dependency versions, cryptographic code, or runtime behavior of the wallet itself is changed.
Changed components
scripts/app_config/templates/pubspec.template.yamltool/process_pubspec_deps.dartInspect captured patch +18 / −54
diff --git a/scripts/app_config/templates/pubspec.template.yaml b/scripts/app_config/templates/pubspec.template.yaml
index 39da588..7161067 100644
--- a/scripts/app_config/templates/pubspec.template.yaml
+++ b/scripts/app_config/templates/pubspec.template.yaml
@@ -24,56 +24,56 @@ dependencies:
mutex: ^3.0.0
web_socket_channel: ^2.4.0
-# %%ENABLE_FROST%%
+# %%ENABLE_FROST%%
# frostdart:
# path: ./crypto_plugins/frostdart
-# %%END_ENABLE_FROST%%
+# %%END_ENABLE_FROST%%
-# %%ENABLE_XEL%%
+# %%ENABLE_XEL%%
# xelis_flutter:
# git:
# url: https://github.com/cypherstack/xelis-flutter-ffi.git
# ref: 5dd5c50713160fa15fb06ff44886ae035eed62fd
-# %%END_ENABLE_XEL%%
+# %%END_ENABLE_XEL%%
-# %%ENABLE_FIRO%%
+# %%ENABLE_FIRO%%
# flutter_libsparkmobile:
# git:
# url: https://github.com/cypherstack/flutter_libsparkmobile.git
# ref: 84a139a25ab1691762002fafcae351e3d444a5c7
-# %%END_ENABLE_FIRO%%
+# %%END_ENABLE_FIRO%%
-# %%ENABLE_EPIC%%
+# %%ENABLE_EPIC%%
# flutter_libepiccash:
# path: ./crypto_plugins/flutter_libepiccash
-# %%END_ENABLE_EPIC%%
+# %%END_ENABLE_EPIC%%
# %%ENABLE_MWC%%
# flutter_libmwc:
# path: ./crypto_plugins/flutter_libmwc
# %%END_ENABLE_MWC%%
-# %%ENABLE_TOR%%
+# %%ENABLE_TOR%%
# tor_ffi_plugin:
# git:
# url: https://github.com/cypherstack/tor.git
# ref: 21077186e6bf773ec8a7cd57ef149b2cee5daa7b
-# %%END_ENABLE_TOR%%
+# %%END_ENABLE_TOR%%
-# %%ENABLE_XMR%%
+# %%ENABLE_XMR%%
# cs_monero: 1.0.0-pre.3
# cs_monero_flutter_libs: 1.0.0-pre.0
# monero_rpc: ^2.0.0
-# %%END_ENABLE_XMR%%
+# %%END_ENABLE_XMR%%
-# %%ENABLE_SAL%%
+# %%ENABLE_SAL%%
# cs_salvium: ^1.2.1
# cs_salvium_flutter_libs: ^1.0.4
-# %%END_ENABLE_SAL%%
+# %%END_ENABLE_SAL%%
-# %%ENABLE_MWEB%%
+# %%ENABLE_MWEBD%%
# flutter_mwebd: ^0.0.1-pre.8
-# %%END_ENABLE_MWEB%%
+# %%END_ENABLE_MWEBD%%
# cs_monero compat (unpublished)
compat:
diff --git a/tool/process_pubspec_deps.dart b/tool/process_pubspec_deps.dart
index 279dfe2..80110b7 100644
--- a/tool/process_pubspec_deps.dart
+++ b/tool/process_pubspec_deps.dart
@@ -27,7 +27,7 @@ void _process(final String filePath, final List<String> enableCoinMarkers) {
// Check if line starts any marker block
for (final marker in enableCoinMarkers) {
- if (line.contains('# %%ENABLE_$marker%%')) {
+ if (line.trim() == "# %%ENABLE_$marker%%") {
activeMarker = marker;
markerSet = true;
updatedLines.add(line);
@@ -39,7 +39,7 @@ void _process(final String filePath, final List<String> enableCoinMarkers) {
// Check if line ends the active marker block
if (activeMarker != null &&
- line.contains('# %%END_ENABLE_$activeMarker%%')) {
+ line.trim() == "# %%END_ENABLE_$activeMarker%%") {
activeMarker = null;
updatedLines.add(line);
continue;
@@ -58,39 +58,3 @@ void _process(final String filePath, final List<String> enableCoinMarkers) {
'Updated pubspec.yaml with enabled blocks: ${enableCoinMarkers.join(", ")}',
);
}
-
-void _genFile(String outputFilePath, String template, bool on) {
- final lines = File(template).readAsLinesSync();
-
- // add empty line and gen warning
-
- final List<String> updatedLines = [
- "// GENERATED CODE - DO NOT MODIFY BY HAND",
- "",
- ];
-
- final keepMarker = on ? "ON" : "OFF";
-
- bool? keepLine;
-
- for (final line in lines) {
- if (line.trim() == "//$keepMarker") {
- keepLine = true;
- continue;
- }
-
- if (line.trim() == "//END_$keepMarker") {
- keepLine = false;
- continue;
- }
-
- if (keepLine != false) {
- updatedLines.add(line);
- }
- }
-
- // add empty line
- if (updatedLines.last.isNotEmpty) updatedLines.add("");
-
- File(outputFilePath).writeAsStringSync(updatedLines.join('\n'));
-}
Why this scored 12/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.