diff --git a/build-sctg.py b/build-sctg.py index c8b268ac07..c2aba4e4b0 100755 --- a/build-sctg.py +++ b/build-sctg.py @@ -115,11 +115,19 @@ def make_parser(): help='Build flutter package', default=False) parser.add_argument('--debug', action='store_true', help='Build flutter package with debug flag', default=False) + parser.add_argument('--no_customization', action='store_true', + help='Disable application customization', default=False) parser.add_argument( '--quic', action='store_true', help='Enable feature Quic' ) + API_SERVER = os.environ['API_SERVER'] + parser.add_argument( + '--disable_api_server_forced', + action='store_true', + help=f'Disable API server forced to https://{API_SERVER}/' + ) parser.add_argument( '--vram', action='store_true', @@ -481,9 +489,10 @@ def insert_line_after(file_path, search_string, new_line): with open(file_path, 'w') as file: file.writelines(lines) -def sctgdesk_customization(): +def sctgdesk_customization(args): MACOS_CODESIGN_IDENTITY = os.environ.get('MACOS_CODESIGN_IDENTITY') APP_NAME = os.environ['APP_NAME'] + APP_NAME_CAPITALIZED = APP_NAME.lower().capitalize() RENDEZVOUS_SERVER = os.environ['RENDEZVOUS_SERVER'] RS_PUB_KEY = os.environ['RS_PUB_KEY'] API_SERVER = os.environ['API_SERVER'] @@ -494,7 +503,6 @@ def sctgdesk_customization(): if match: TEAM_ID = match.group(1) replace_in_file('flutter/ios/Runner.xcodeproj/project.pbxproj',"HZF9JMC8YN",TEAM_ID) - replace_in_file('flutter/web/client.html', '__API_SERVER__', f'https://{API_SERVER}') replace_in_file('libs/hbb_common/src/config.rs', 'rs-ny.rustdesk.com', RENDEZVOUS_SERVER) replace_in_file('libs/hbb_common/src/config.rs', 'OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=', RS_PUB_KEY) replace_in_file('flutter/web/js/src/connection.ts', 'const PORT = 21116', 'const PORT = 21118') @@ -535,8 +543,12 @@ def sctgdesk_customization(): replace_in_all_typed_files('xcconfig', 'com.carriez', f'com.{ORG_NAME}'.lower()) replace_in_all_typed_files('desktop', 'RustDesk', f'{APP_NAME}') replace_in_all_typed_files('service', 'RustDesk', f'{APP_NAME}') - insert_line_after('src/common.rs','pub fn get_api_server',f' return format!("https://{API_SERVER}");') - insert_line_after('flutter/web/js/src/globals.js','function getApiServer()',f' return "https://{API_SERVER}";') + replace_in_file('flutter/lib/models/platform_model.dart', 'RustdeskImpl', f'{APP_NAME_CAPITALIZED}Impl') + replace_in_file('flutter/lib/models/native_model.dart', 'RustdeskImpl', f'{APP_NAME_CAPITALIZED}Impl') + if not args.disable_api_server_forced: + replace_in_file('flutter/web/client.html', '__API_SERVER__', f'https://{API_SERVER}') + insert_line_after('src/common.rs','pub fn get_api_server',f' return format!("https://{API_SERVER}");') + insert_line_after('flutter/web/js/src/globals.js','function getApiServer()',f' return "https://{API_SERVER}";') def build_ios_ipa(version, features): MACOS_CODESIGN_IDENTITY = os.environ.get('MACOS_CODESIGN_IDENTITY') @@ -652,7 +664,8 @@ def main(): web = args.web if not flutter: system2('python3 res/inline-sciter.py') - sctgdesk_customization() + if not args.no_customization: + sctgdesk_customization(args) print(args.skip_cargo) if args.skip_cargo: skip_cargo = True diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index a8b3f290c8..ae92dcfbc4 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -1186,7 +1186,7 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin { apiController, apiErrMsg.value, enabled, secure)), _LabeledTextField( context, 'Key', keyController, '', enabled, secure), - _OptionCheckBox(context, 'UDP mode', 'disable-udp-mode', + _OptionCheckBox(context, 'UDP mode', 'enable-tcp-mode', enabled: enabled), Row( mainAxisAlignment: MainAxisAlignment.end, @@ -1609,7 +1609,7 @@ class _AboutState extends State<_About> { child: SingleChildScrollView( controller: scrollController, physics: DraggableNeverScrollableScrollPhysics(), - child: _Card(title: '${translate('About')} RustDesk', children: [ + child: _Card(title: '${translate('About')} SCTGDesk', children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -1627,7 +1627,7 @@ class _AboutState extends State<_About> { .marginSymmetric(vertical: 4.0)), InkWell( onTap: () { - launchUrlString('https://rustdesk.com/privacy.html'); + launchUrlString('https://sctg.eu.org/privacy.html'); }, child: Text( translate('Privacy Statement'), @@ -1635,7 +1635,7 @@ class _AboutState extends State<_About> { ).marginSymmetric(vertical: 4.0)), InkWell( onTap: () { - launchUrlString('https://rustdesk.com'); + launchUrlString('https://sctg.eu.org'); }, child: Text( translate('Website'), @@ -1653,7 +1653,7 @@ class _AboutState extends State<_About> { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - 'Copyright © ${DateTime.now().toString().substring(0, 4)} Purslane Ltd.\n$license', + 'Copyright © ${DateTime.now().toString().substring(0, 4)} Sctg and Purslane Ltd.\n$license', style: const TextStyle(color: Colors.white), ), Text( diff --git a/src/rendezvous_mediator.rs b/src/rendezvous_mediator.rs index 30e71f2259..0064a2e036 100644 --- a/src/rendezvous_mediator.rs +++ b/src/rendezvous_mediator.rs @@ -387,8 +387,8 @@ impl RendezvousMediator { } pub fn is_udp_disabled() -> bool { - let option_tcp = Config::get_option("disable-udp-mode"); - log::debug!("disable-udp-mode: {}", option_tcp); + let option_tcp = Config::get_option("enable-tcp-mode"); + log::debug!("enable-tcp-mode: {}", option_tcp); if option_tcp == "N"{ return true; }else{