LCOV - code coverage report
Current view: top level - _classes/controller/deep_link - url_scheme_io.dart Coverage Total Hit
Test: lcov.info Lines: 18.2 % 11 2
Test Date: 2026-11-14 15:03:01 Functions: - 0 0

            Line data    Source code
       1              : // Copyright 2026 The terCAD team. All rights reserved.
       2              : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
       3              : 
       4              : import 'dart:io';
       5              : 
       6              : // Android, iOS, macOS (Info.plist / manifest), Linux (desktop file) and the MSIX package declare the scheme on install.
       7              : // The unpackaged Windows build registers it for the current user, pointing at its own executable.
       8            1 : Future<void> registerUrlScheme(String scheme) async {
       9            1 :   if (!Platform.isWindows) {
      10              :     return;
      11              :   }
      12            0 :   final executable = Platform.resolvedExecutable;
      13            0 :   if (executable.toLowerCase().contains(r'\windowsapps\')) {
      14              :     return;
      15              :   }
      16            0 :   final key = r'HKCU\Software\Classes\' + scheme;
      17            0 :   for (final arguments in [
      18            0 :     ['add', key, '/ve', '/d', 'URL:Fingrom', '/f'],
      19            0 :     ['add', key, '/v', 'URL Protocol', '/d', '', '/f'],
      20            0 :     ['add', '$key\\shell\\open\\command', '/ve', '/d', '"$executable" "%1"', '/f'],
      21            0 :   ]) {
      22            0 :     await Process.run('reg', arguments);
      23              :   }
      24              : }
        

Generated by: LCOV version 2.0-1