├── .fvm └── fvm_config.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── bug_report_zh.md │ ├── config.yml │ ├── feature_request.md │ └── feature_request_zh.md └── workflows │ ├── build.yml │ ├── build_linux.yml │ ├── build_macos.yml │ ├── build_windows.yml │ ├── release.yml │ ├── scripts │ ├── linux_integration_setup.sh │ ├── macos_integration_setup.sh │ └── windows_integration_setup.bat │ └── test.yml ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── _repo_assets └── logo.png ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── minecraft_cube_desktop │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── build.yaml ├── build_dependencies ├── linux │ ├── DEBIAN │ │ └── control │ └── usr │ │ └── local │ │ └── lib │ │ └── minecraft_cube_desktop │ │ └── .empty └── windows │ ├── msvcp140.dll │ ├── vcruntime140.dll │ └── vcruntime140_1.dll ├── concepts ├── concept ├── concept.svg └── concept.xml ├── dart_test.yaml ├── fonts ├── NotoSans │ └── NotoSans-Regular.ttf ├── NotoSansSC │ └── NotoSansSC-Regular.otf ├── NotoSansTC │ └── NotoSansTC-Regular.otf └── Roboto │ ├── LICENSE.txt │ ├── Roboto-Black.ttf │ ├── Roboto-Bold.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-Regular.ttf │ └── Roboto-Thin.ttf ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── _consts │ ├── common.i18n.dart │ ├── localization.dart │ └── localization.i18n.dart ├── _gen │ ├── assets.gen.dart │ ├── fonts.gen.dart │ └── version.gen.dart ├── _theme │ └── color_palette.dart ├── _utilities │ └── console_line_util.dart ├── _widgets │ └── cube_text_field.dart ├── main.dart └── pages │ └── app_page │ ├── app.dart │ ├── app_selector_page.dart │ ├── app_selector_page.i18n.dart │ ├── bloc │ └── locale_bloc.dart │ ├── pages │ ├── about_page │ │ ├── about_page.dart │ │ └── about_page.i18n.dart │ ├── craft_page │ │ ├── craft_page.dart │ │ ├── craft_page.i18n.dart │ │ └── pages │ │ │ └── craft_navi_page │ │ │ ├── _blocs │ │ │ └── navi_page_bloc.dart │ │ │ ├── craft_navi_page.dart │ │ │ └── pages │ │ │ ├── base_page.dart │ │ │ ├── base_page.i18n.dart │ │ │ ├── description_page.dart │ │ │ ├── description_page.i18n.dart │ │ │ ├── installer_name_page.dart │ │ │ ├── installer_name_page.i18n.dart │ │ │ ├── map_download_page.dart │ │ │ ├── map_download_page.i18n.dart │ │ │ ├── mod_pack_page.dart │ │ │ ├── mod_pack_page.i18n.dart │ │ │ ├── mod_setting_page.dart │ │ │ ├── mod_setting_page.i18n.dart │ │ │ ├── navi_page.i18n.dart │ │ │ ├── preview_page.dart │ │ │ ├── preview_page.i18n.dart │ │ │ ├── server_download_page.dart │ │ │ ├── server_download_page.i18n.dart │ │ │ ├── server_type_page.dart │ │ │ └── server_type_page.i18n.dart │ ├── info_page │ │ ├── info_page.dart │ │ ├── info_page.i18n.dart │ │ ├── sections │ │ │ ├── info_section │ │ │ │ ├── bloc │ │ │ │ │ └── app_updater_bloc.dart │ │ │ │ ├── info_section.dart │ │ │ │ ├── language_dialog.dart │ │ │ │ ├── language_dialog.i18n.dart │ │ │ │ ├── release_note_dialog.dart │ │ │ │ └── release_note_dialog.i18n.dart │ │ │ ├── network_section │ │ │ │ ├── bloc │ │ │ │ │ ├── network_gateway_ip_bloc.dart │ │ │ │ │ ├── network_internal_ip_bloc.dart │ │ │ │ │ └── network_public_ip_bloc.dart │ │ │ │ ├── network_section.dart │ │ │ │ └── network_section.i18n.dart │ │ │ └── system_section │ │ │ │ ├── bloc │ │ │ │ ├── cpu_info_bloc.dart │ │ │ │ ├── gpu_info_bloc.dart │ │ │ │ ├── memory_info_bloc.dart │ │ │ │ ├── portable_java_info_bloc.dart │ │ │ │ └── system_java_info_bloc.dart │ │ │ │ ├── system_section.dart │ │ │ │ └── system_section.i18n.dart │ │ └── widgets │ │ │ ├── info_icon_button.dart │ │ │ ├── info_icon_link.dart │ │ │ └── info_title.dart │ └── server_page │ │ ├── bloc │ │ ├── cube_properties_bloc.dart │ │ ├── installation_cubit.dart │ │ ├── installation_cubit.i18n.dart │ │ ├── installer_manager_cubit.dart │ │ ├── server_bloc.dart │ │ ├── server_management_launcher_cubit.dart │ │ ├── server_properties_bloc.dart │ │ └── servers_dropdown_bloc.dart │ │ ├── consts │ │ ├── app_cube_properties.dart │ │ ├── app_cube_properties.i18n.dart │ │ ├── app_server_properties.dart │ │ ├── app_server_properties.i18n.dart │ │ ├── minecraft_command.dart │ │ └── minecraft_command.i18n.dart │ │ ├── machine │ │ ├── server_machine.dart │ │ └── states │ │ │ ├── configuration_loader_state.dart │ │ │ ├── configuration_loader_state.i18n.dart │ │ │ ├── eula_ask_state.dart │ │ │ ├── eula_ask_state.i18n.dart │ │ │ ├── eula_stage_state.dart │ │ │ ├── eula_stage_state.i18n.dart │ │ │ ├── forge_install_state.dart │ │ │ ├── forge_install_state.i18n.dart │ │ │ ├── idle_state.dart │ │ │ ├── istate.dart │ │ │ ├── jar_analyzer_state.dart │ │ │ ├── jar_analyzer_state.i18n.dart │ │ │ ├── jar_dangerous_ask_state.dart │ │ │ ├── jar_dangerous_ask_state.i18n.dart │ │ │ ├── java_duplicator_state.dart │ │ │ ├── java_duplicator_state.i18n.dart │ │ │ ├── java_printer_state.dart │ │ │ ├── java_printer_state.i18n.dart │ │ │ ├── post_duplicate_cleaner_state.dart │ │ │ ├── post_process_cleaner_state.dart │ │ │ ├── pre_duplicate_cleaner_state.dart │ │ │ ├── pre_duplicate_cleaner_state.i18n.dart │ │ │ ├── pre_process_cleaner_state.dart │ │ │ ├── pre_process_cleaner_state.i18n.dart │ │ │ ├── server_state.dart │ │ │ └── server_state.i18n.dart │ │ ├── server_page.dart │ │ ├── server_page.i18n.dart │ │ └── widgets │ │ ├── dangerous_alert_dialog.dart │ │ ├── dangerous_alert_dialog.i18n.dart │ │ ├── eula_agreement_dialog.dart │ │ ├── eula_agreement_dialog.i18n.dart │ │ ├── minecraft_command_text_field.dart │ │ ├── property_dialogs.dart │ │ ├── property_dialogs.i18n.dart │ │ ├── property_list_tile.dart │ │ ├── server_creation_dialog.dart │ │ ├── server_creation_dialog.i18n.dart │ │ └── servers_dropdown.dart │ └── widgets │ ├── app_nav_button.dart │ └── app_selector.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── linux_local_dev_setup.sh ├── linux_local_full_setup.sh ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── 1024.png │ │ ├── 128.png │ │ ├── 16.png │ │ ├── 256.png │ │ ├── 32.png │ │ ├── 512.png │ │ ├── 64.png │ │ ├── Contents.json │ │ ├── appstore.png │ │ └── playstore.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── macos_local_dev_setup.sh ├── macos_local_full_setup.sh ├── melos.yaml ├── packages ├── app_updater_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── app_updater_repository.dart │ │ └── src │ │ │ └── app_updater_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── app_updater_repository_ig_test.dart │ │ └── app_updater_repository_test.dart ├── console_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── console_repository.dart │ │ └── src │ │ │ └── console_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── console_repository_ig_test.dart │ │ └── console_repository_test.dart ├── cube_api │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── cube_api.dart │ │ └── src │ │ │ ├── archive │ │ │ └── archive.dart │ │ │ ├── common │ │ │ ├── common.dart │ │ │ └── network_status │ │ │ │ └── network_status.dart │ │ │ ├── const │ │ │ └── const.dart │ │ │ ├── data │ │ │ ├── common_property │ │ │ │ └── common_property.dart │ │ │ ├── cube │ │ │ │ └── cube_properties.dart │ │ │ ├── data.dart │ │ │ ├── installer │ │ │ │ ├── installer.dart │ │ │ │ └── src │ │ │ │ │ ├── installer.dart │ │ │ │ │ ├── installer.g.dart │ │ │ │ │ ├── model_pack.dart │ │ │ │ │ ├── model_pack.g.dart │ │ │ │ │ ├── model_setting.dart │ │ │ │ │ └── model_setting.g.dart │ │ │ ├── jar │ │ │ │ ├── jar_archive_info.dart │ │ │ │ └── jar_type.dart │ │ │ └── server │ │ │ │ ├── server_configuration.dart │ │ │ │ └── server_configuration.g.dart │ │ │ ├── property │ │ │ ├── property.dart │ │ │ └── src │ │ │ │ ├── property.dart │ │ │ │ └── property_manager.dart │ │ │ ├── ticker │ │ │ └── ticker.dart │ │ │ └── utilities │ │ │ ├── src │ │ │ ├── file.dart │ │ │ ├── process.dart │ │ │ └── stream.dart │ │ │ └── utilities.dart │ ├── pubspec.yaml │ └── test │ │ ├── archive │ │ └── archive_it_test.dart │ │ ├── data │ │ ├── cube │ │ │ ├── cube_properties_ig_test.dart │ │ │ └── cube_properties_test.dart │ │ └── installer │ │ │ └── installer_test.dart │ │ ├── property │ │ ├── property_manager_ig_test.dart │ │ └── property_manager_test.dart │ │ └── ticker │ │ └── ticker_test.dart ├── cube_properties_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── cube_properties_repository.dart │ │ └── src │ │ │ └── cube_properties_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── cube_properties_repository_ig_test.dart │ │ └── cube_properties_repository_test.dart ├── duplicate_cleaner_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── duplicate_cleaner_repository.dart │ │ └── src │ │ │ └── duplicate_cleaner_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── duplicate_cleaner_repository_ig_test.dart │ │ └── duplicate_cleaner_repository_test.dart ├── eula_stage_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── eula_stage_repository.dart │ │ └── src │ │ │ └── eula_stage_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── eula_stage_repository_ig_test.dart │ │ └── eula_stage_repository_test.dart ├── forge_installer_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── forge_installer_repository.dart │ │ └── src │ │ │ └── forge_installer_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── forge_installer_repository_ig_test.dart │ │ └── forge_installer_repository_test.dart ├── installer_creator_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── installer_creator_repository.dart │ │ └── src │ │ │ └── installer_creator_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── installer_creator_repository_ig_test.dart │ │ └── installer_creator_repository_test.dart ├── installer_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── installer_repository.dart │ │ └── src │ │ │ └── installer_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── installer_repository_ig_test.dart │ │ └── installer_repository_test.dart ├── jar_analyzer_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── jar_analyzer_repository.dart │ │ └── src │ │ │ └── jar_analyzer_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── jar_analyzer_repository_ig_test.dart │ │ └── jar_analyzer_repository_test.dart ├── java_duplicator_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── java_duplicator_repository.dart │ │ └── src │ │ │ └── java_duplicator_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── java_duplicator_repository_ig_test.dart │ │ └── java_duplicator_repository_test.dart ├── java_info_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── java_info_repository.dart │ │ └── src │ │ │ ├── java_info.dart │ │ │ └── java_info_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── java_info_repository_ig_test.dart │ │ └── java_info_repository_test.dart ├── java_printer_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── java_printer_repository.dart │ │ └── src │ │ │ └── java_printer_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── java_printer_repository_ig_test.dart │ │ └── java_printer_repository_test.dart ├── launcher_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── launcher_repository.dart │ │ └── src │ │ │ └── launcher_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── launcher_repository_ig_test.dart │ │ └── launcher_repository_test.dart ├── locale_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── locale_repository.dart │ │ └── src │ │ │ └── locale_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── locale_repository_ig_test.dart │ │ └── locale_repository_test.dart ├── network_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── network_repository.dart │ │ └── src │ │ │ ├── network_interface_wrapper.dart │ │ │ └── network_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── network_repository_ig_test.dart │ │ └── network_repository_test.dart ├── picker_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── picker_repository.dart │ │ └── src │ │ │ └── picker_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── picker_repository_ig_test.dart │ │ └── picker_repository_test.dart ├── process_cleaner_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── process_cleaner_repository.dart │ │ └── src │ │ │ └── process_cleaner_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── process_cleaner_repository_ig_test.dart │ │ └── process_cleaner_repository_test.dart ├── server_configuration_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── server_configuration_repository.dart │ │ └── src │ │ │ └── server_configuration_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── server_configuration_repository_ig_test.dart │ │ └── server_configuration_repository_test.dart ├── server_management_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── server_management_repository.dart │ │ └── src │ │ │ ├── installer_file.dart │ │ │ └── server_management_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── server_management_repository_ig_test.dart │ │ └── server_management_repository_test.dart ├── server_properties_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── server_properties_repository.dart │ │ └── src │ │ │ └── server_properties_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── server_properties_repository_ig_test.dart │ │ └── server_properties_repository_test.dart ├── server_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── env.bat │ ├── lib │ │ ├── server_repository.dart │ │ └── src │ │ │ └── server_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── consts.dart │ │ ├── server_repository_ig_test.dart │ │ └── server_repository_test.dart ├── system_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ │ ├── src │ │ │ ├── cpu_info.dart │ │ │ ├── memory_info.dart │ │ │ └── system_repository.dart │ │ └── system_repository.dart │ ├── pubspec.yaml │ └── test │ │ ├── system_repository_ig_test.dart │ │ └── system_repository_test.dart ├── test_utilities │ ├── analysis_options.yaml │ ├── lib │ │ ├── src │ │ │ ├── process_terminator.dart │ │ │ ├── test_resource_server.dart │ │ │ └── test_utilities.dart │ │ └── test_utilities.dart │ └── pubspec.yaml └── vanilla_server_repository │ ├── analysis_options.yaml │ ├── dart_test.yaml │ ├── lib │ ├── src │ │ ├── vanilla_manifest │ │ │ ├── vanilla_manifest.dart │ │ │ ├── vanilla_manifest_info.dart │ │ │ ├── vanilla_manifest_info.g.dart │ │ │ ├── vanilla_manifest_version_info.dart │ │ │ └── vanilla_manifest_version_info.g.dart │ │ ├── vanilla_server │ │ │ ├── vanilla_server.dart │ │ │ ├── vanilla_server_downloads_info.dart │ │ │ ├── vanilla_server_downloads_info.g.dart │ │ │ ├── vanilla_server_downloads_server_info.dart │ │ │ ├── vanilla_server_downloads_server_info.g.dart │ │ │ ├── vanilla_server_info.dart │ │ │ └── vanilla_server_info.g.dart │ │ └── vanilla_server_repository.dart │ └── vanilla_server_repository.dart │ ├── pubspec.yaml │ └── test │ ├── vanilla_manifest_info_test.dart │ ├── vanilla_server_info_test.dart │ ├── vanilla_server_repository_ig_test.dart │ └── vanilla_server_repository_test.dart ├── pubspec.yaml ├── release_dependencies ├── changelog.md ├── history.md ├── info.yml └── java.yml ├── resources ├── about.png ├── about_me.png ├── forum.png └── logo.png ├── test └── lib │ └── pages │ └── app_page │ ├── bloc │ └── locale_bloc_test.dart │ └── pages │ ├── info_page │ └── sections │ │ ├── info_section │ │ └── bloc │ │ │ └── app_updater_bloc_test.dart │ │ ├── network_section │ │ └── bloc │ │ │ ├── network_gateway_ip_bloc_test.dart │ │ │ ├── network_internal_ip_bloc_test.dart │ │ │ └── network_public_ip_bloc_test.dart │ │ └── system_section │ │ └── bloc │ │ ├── cpu_info_bloc_test.dart │ │ ├── gpu_info_bloc_test.dart │ │ ├── memory_info_bloc_test.dart │ │ ├── portable_java_info_bloc_test.dart │ │ └── system_java_info_bloc_test.dart │ └── server_page │ ├── bloc │ ├── cube_properties_bloc_test.dart │ ├── installation_cubit_test.dart │ ├── installer_manager_cubit_test.dart │ ├── server_bloc_test.dart │ ├── server_managment_launcher_cubit_test.dart │ ├── server_properties_bloc_test.dart │ └── servers_dropdown_bloc_test.dart │ └── machine │ ├── server_machine_test.dart │ └── states │ ├── configuration_loader_state_test.dart │ ├── eula_ask_state_test.dart │ ├── eula_stage_state_test.dart │ ├── forge_install_state_test.dart │ ├── idle_state_test.dart │ ├── jar_analyzer_state_test.dart │ ├── jar_dangerous_ask_state_test.dart │ ├── java_duplicator_state_test.dart │ ├── java_printer_state_test.dart │ ├── post_duplicate_cleaner_state_test.dart │ ├── post_process_cleaner_state_test.dart │ ├── pre_duplicate_cleaner_state_test.dart │ ├── pre_process_cleaner_state_test.dart │ └── server_state_test.dart ├── test_experience.md ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ └── Icon-512.png ├── index.html └── manifest.json ├── windows ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── runner │ ├── CMakeLists.txt │ ├── Runner.rc │ ├── flutter_window.cpp │ ├── flutter_window.h │ ├── main.cpp │ ├── resource.h │ ├── resources │ └── app_icon.ico │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ └── win32_window.h ├── windows_local_dev_setup.bat └── windows_local_full_setup.bat /.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "3.7.0", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🐞 Bug Report 3 | about: Create a report to help us improve. 4 | title: "fix: " 5 | labels: "bug, triage" 6 | --- 7 | 8 | 11 | 12 | ### Issue Summary 13 | 14 | 17 | 18 | ### Steps to Reproduce 19 | 20 | 1. (for example) Open app 21 | 2. Click something then goes wrong 22 | 3. ... 23 | 24 | Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead? 25 | 26 | - I have confirmed that this issue can be reproduced as described on master branch: (yes / no / not sure) 27 | 28 | ### Technical details 29 | 30 | - app version: Please refer to the banner in about page 31 | - os version: 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report_zh.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🐞 錯誤回報 3 | about: 填寫回報單幫助軟體進步. 4 | title: "fix: " 5 | labels: "bug" 6 | --- 7 | 8 | 11 | 12 | ### 問題描述 13 | 14 | 17 | 18 | ### 發生問題的步驟 19 | 20 | 1. (譬如) 打開軟體 21 | 2. 點了開啟伺服器,整個軟體瞬間崩潰 22 | 3. ... 23 | 24 | 若有時間,可稍加說明,本來預期的軟體行為。 25 | 26 | - Master branch 有當前的問題嗎 : (是/否/不確定) 27 | 28 | ### Technical details 29 | 30 | - 軟體版本: (可於關於頁看到) 31 | - 作業系統版本: 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🚀 Feature request 3 | about: A new feature to be added to the project 4 | title: "feat: " 5 | labels: "feature request, triage" 6 | --- 7 | 8 | ### Is your proposal related to a problem? 9 | 10 | 14 | 15 | (Write your answer here.) 16 | 17 | ### Describe alternatives you've considered 18 | 19 | 22 | 23 | (Write your answer here.) 24 | 25 | ### Additional context 26 | 27 | 31 | 32 | (Write your answer here.) 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request_zh.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🚀 新功能 3 | about: 請詳細描述想要的新功能 4 | title: "feat: " 5 | labels: "feature" 6 | --- 7 | 8 | ### 這個功能是為了解決什麼問題 9 | 10 | 13 | 14 | (在這裡寫下你的回答) 15 | 16 | ### 想要的解決方法 17 | 18 | 21 | 22 | (在這裡描述你提出的解決方案) 23 | 24 | ### 補充 25 | 26 | 30 | 31 | (在這裡寫下你的回答) 32 | -------------------------------------------------------------------------------- /.github/workflows/build_macos.yml: -------------------------------------------------------------------------------- 1 | name: Build executables (MacOS) 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | postfix: 7 | required: true 8 | type: string 9 | 10 | jobs: 11 | build_macos: 12 | runs-on: macos-latest 13 | # needs: 14 | # - test_heavy_macos 15 | env: 16 | MACHINE_OS: macos 17 | steps: 18 | - uses: actions/checkout@v3 19 | - uses: subosito/flutter-action@v2.8.0 20 | with: 21 | channel: 'stable' 22 | - name: Doctor 23 | run: flutter doctor -v 24 | - name: Install Dependencies 25 | run: | 26 | flutter config --enable-macos-desktop 27 | flutter packages get 28 | - name: Build release 29 | run: | 30 | flutter build -v ${{ env.MACHINE_OS }} --release 31 | - name: Copy essentials to Macos and package (Release) 32 | run: | 33 | mkdir ${{ github.workspace }}/build/macos/Build/Products/minecraft_cube_desktop 34 | mv ${{ github.workspace }}/build/macos/Build/Products/Release/minecraft_cube_desktop.app ${{ github.workspace }}/build/macos/Build/Products/minecraft_cube_desktop/minecraft_cube_desktop.app 35 | - name: Upload MacOS artifaces (Release) 36 | # if: startsWith(matrix.os, 'macOS') 37 | uses: actions/upload-artifact@v3 38 | with: 39 | name: macos-release-${{ inputs.postfix }} 40 | path: ${{ github.workspace }}/build/macos/Build/Products/minecraft_cube_desktop -------------------------------------------------------------------------------- /.github/workflows/build_windows.yml: -------------------------------------------------------------------------------- 1 | name: Build executables (Windows) 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | postfix: 7 | required: true 8 | type: string 9 | 10 | jobs: 11 | build_windows: 12 | runs-on: windows-latest 13 | # needs: 14 | # - test_heavy_windows 15 | env: 16 | MACHINE_OS: windows 17 | steps: 18 | - uses: actions/checkout@v3 19 | - uses: subosito/flutter-action@v2.8.0 20 | with: 21 | channel: 'stable' 22 | - name: Doctor 23 | run: flutter doctor -v 24 | - name: Install Dependencies 25 | run: | 26 | flutter config --enable-windows-desktop 27 | flutter packages get 28 | - name: Build release 29 | run: | 30 | flutter build -v ${{ env.MACHINE_OS }} --release 31 | - name: Copy essentials to Windows artifacs (Release) 32 | run: | 33 | cp -Path ${{ github.workspace }}/build_dependencies/windows/* ${{ github.workspace }}/build/windows/runner/Release/ 34 | mkdir ${{ github.workspace }}/build/windows/runner/minecraft_cube_desktop/minecraft_cube_desktop 35 | mv -Path ${{ github.workspace }}/build/windows/runner/Release/* ${{ github.workspace }}/build/windows/runner/minecraft_cube_desktop/minecraft_cube_desktop 36 | - name: Upload Windows artifaces (Release) 37 | uses: actions/upload-artifact@v3 38 | with: 39 | name: windows-release-${{ inputs.postfix }} 40 | path: ${{ github.workspace }}/build/windows/runner/minecraft_cube_desktop -------------------------------------------------------------------------------- /.github/workflows/scripts/linux_integration_setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # wget https://dl.dropboxusercontent.com/s/i0s17qbooewf8le/minimal_resources.zip 4 | 5 | # unzip minimal_resources.zip 6 | 7 | chmod +x minimal_resources/process_cleaner_repository/cube_java_linux 8 | 9 | wget https://cdn.azul.com/zulu/bin/zulu8.60.0.21-ca-jdk8.0.322-linux_x64.zip 10 | 11 | unzip zulu8.60.0.21-ca-jdk8.0.322-linux_x64.zip 12 | 13 | wget https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-linux_x64.zip 14 | 15 | unzip zulu17.32.13-ca-jdk17.0.2-linux_x64.zip 16 | -------------------------------------------------------------------------------- /.github/workflows/scripts/macos_integration_setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # curl -o minimal_resources.zip https://dl.dropboxusercontent.com/s/i0s17qbooewf8le/minimal_resources.zip 4 | 5 | # unzip minimal_resources.zip 6 | 7 | chmod +x minimal_resources/process_cleaner_repository/cube_java_macos 8 | 9 | curl -o zulu8.60.0.21-ca-jdk8.0.322-macosx_x64.zip https://cdn.azul.com/zulu/bin/zulu8.60.0.21-ca-jdk8.0.322-macosx_x64.zip 10 | 11 | unzip zulu8.60.0.21-ca-jdk8.0.322-macosx_x64.zip 12 | 13 | curl -o zulu17.32.13-ca-jdk17.0.2-macosx_x64.zip https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-macosx_x64.zip 14 | 15 | unzip zulu17.32.13-ca-jdk17.0.2-macosx_x64.zip -------------------------------------------------------------------------------- /.github/workflows/scripts/windows_integration_setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | curl https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-win_x64.zip -o java17.zip 4 | tar -xf java17.zip 5 | @REM set JAVA_17=%PROJECT_PATH%\zulu17.32.13-ca-jdk17.0.2-win_x64\bin\java.exe 6 | 7 | 8 | curl https://cdn.azul.com/zulu/bin/zulu8.60.0.21-ca-jdk8.0.322-win_x64.zip -o java8.zip 9 | tar -xf java8.zip 10 | @REM set JAVA_8=%PROJECT_PATH%\zulu8.60.0.21-ca-jdk8.0.322-win_x64\bin\java.exe 11 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /_repo_assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/_repo_assets/logo.png -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/minecraft_cube_desktop/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.minecraft_cube_desktop 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /build.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | $default: 3 | builders: 4 | build_version: 5 | options: 6 | output: lib/_gen/version.gen.dart 7 | -------------------------------------------------------------------------------- /build_dependencies/linux/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: minecraft-cube-desktop 2 | Version: 1.0 3 | Architecture: amd64 4 | Maintainer: Tokenyet(Dowen) 5 | Description: Server management tool for minecraft 6 | Depends: libgtk-3-0, libblkid1, liblzma5 7 | -------------------------------------------------------------------------------- /build_dependencies/linux/usr/local/lib/minecraft_cube_desktop/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/build_dependencies/linux/usr/local/lib/minecraft_cube_desktop/.empty -------------------------------------------------------------------------------- /build_dependencies/windows/msvcp140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/build_dependencies/windows/msvcp140.dll -------------------------------------------------------------------------------- /build_dependencies/windows/vcruntime140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/build_dependencies/windows/vcruntime140.dll -------------------------------------------------------------------------------- /build_dependencies/windows/vcruntime140_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/build_dependencies/windows/vcruntime140_1.dll -------------------------------------------------------------------------------- /concepts/concept: -------------------------------------------------------------------------------- 1 | 主畫面功能: 2 | Java列表, 系統, 建議zulu, 開啟資料夾 3 | 4 | 主要流程: 5 | [給定 folder, installer?] 6 | 清除 CubeJava process {processCleanerCubit} 7 | 清除 CubeJava executable {cubeJavaCleanerCubit} 8 | 檢查 Eula {eulaCheckerCubit} 9 | 檢查 Jar [jarFile] {jarCheckerBloc} 10 | 決定 Java [javaExecutable, arguments, ] {javaDeciderCubit} - configuration_loader_repository 11 | 檢查 Java {javaCheckerCubit} - java_printer_repository 12 | 複製 Java [javaExecutable => cube_java] {javaDuplicatorCubit} - java_duplicator_repository 13 | 中繼 Jar (安裝 Forge) [restart flow?] {forgeThresholdCubit} - forge_installer_repository 14 | 伺服器管理 [javaExecutable + jarFile + arguments] {serverBloc} - server_repository 15 | 16 | **使用安裝包安裝 {installerCubit} - installer_repository 17 | 18 | 不管如何結束都要走以下流程 19 | 清除 CubeJava process 20 | 清除 CubeJava executable 21 | 22 | ** 23 | 當測試依賴於 Java 版本就要靠環境設定 24 | 25 | 26 | *** 27 | java/xxx/sadas/bin/java 28 | servers/projectname/server.jar 29 | 30 | servers/projectname: ../../java/xxx/sadas/bin/java -jar server.jar -------------------------------------------------------------------------------- /dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /fonts/NotoSans/NotoSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/NotoSans/NotoSans-Regular.ttf -------------------------------------------------------------------------------- /fonts/NotoSansSC/NotoSansSC-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/NotoSansSC/NotoSansSC-Regular.otf -------------------------------------------------------------------------------- /fonts/NotoSansTC/NotoSansTC-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/NotoSansTC/NotoSansTC-Regular.otf -------------------------------------------------------------------------------- /fonts/Roboto/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/Roboto/Roboto-Black.ttf -------------------------------------------------------------------------------- /fonts/Roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/Roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /fonts/Roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/Roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /fonts/Roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/Roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /fonts/Roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/Roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /fonts/Roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/fonts/Roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/_consts/common.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const cancel = 'cancel'; 5 | const confirm = 'confirm'; 6 | 7 | extension Localization on String { 8 | static final _t = Translations.from( 9 | AppLocalization.enUS.name, 10 | { 11 | cancel: { 12 | AppLocalization.enUS.name: 'Cancel', 13 | AppLocalization.zhTW.name: '取消', 14 | }, 15 | confirm: { 16 | AppLocalization.enUS.name: 'Confirm', 17 | AppLocalization.zhTW.name: '確認', 18 | }, 19 | }, 20 | ); 21 | 22 | String get ci18n => localize(this, _t); 23 | } 24 | -------------------------------------------------------------------------------- /lib/_consts/localization.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.i18n.dart'; 3 | 4 | enum AppLanguage { 5 | zhTW, 6 | enUS, 7 | } 8 | 9 | extension AppLanguageExt on AppLanguage { 10 | String get name { 11 | switch (this) { 12 | case AppLanguage.zhTW: 13 | return localizationZhTw.i18n; 14 | case AppLanguage.enUS: 15 | return localizationEnUs.i18n; 16 | default: 17 | throw UnimplementedError(); 18 | } 19 | } 20 | } 21 | 22 | extension LocaleExt on Locale { 23 | String get name { 24 | String result = languageCode.toLowerCase(); 25 | final country = countryCode; 26 | if (country != null) { 27 | result += '_${country.toLowerCase()}'; 28 | } 29 | return result; 30 | } 31 | } 32 | 33 | class AppLocalization { 34 | static Locale enUS = const Locale('en', 'US'); 35 | static Locale zhTW = const Locale('zh', 'TW'); 36 | } 37 | -------------------------------------------------------------------------------- /lib/_consts/localization.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const localizationZhTw = 'localizationZhTw'; 5 | const localizationEnUs = 'localizationEnUs'; 6 | 7 | extension Localization on String { 8 | static final _t = Translations.from( 9 | AppLocalization.enUS.name, 10 | { 11 | localizationZhTw: { 12 | AppLocalization.enUS.name: 'Traditional Chinese', 13 | AppLocalization.zhTW.name: '繁體中文', 14 | }, 15 | localizationEnUs: { 16 | AppLocalization.enUS.name: 'English', 17 | AppLocalization.zhTW.name: '英文', 18 | }, 19 | }, 20 | ); 21 | 22 | String get i18n => localize(this, _t); 23 | } 24 | -------------------------------------------------------------------------------- /lib/_gen/fonts.gen.dart: -------------------------------------------------------------------------------- 1 | /// GENERATED CODE - DO NOT MODIFY BY HAND 2 | /// ***************************************************** 3 | /// FlutterGen 4 | /// ***************************************************** 5 | 6 | // ignore_for_file: directives_ordering,unnecessary_import 7 | 8 | class FontFamily { 9 | FontFamily._(); 10 | 11 | /// Font family: NotoSans 12 | static const String notoSans = 'NotoSans'; 13 | 14 | /// Font family: NotoSansSC 15 | static const String notoSansSC = 'NotoSansSC'; 16 | 17 | /// Font family: NotoSansTC 18 | static const String notoSansTC = 'NotoSansTC'; 19 | 20 | /// Font family: Roboto 21 | static const String roboto = 'Roboto'; 22 | } 23 | -------------------------------------------------------------------------------- /lib/_gen/version.gen.dart: -------------------------------------------------------------------------------- 1 | // Generated code. Do not modify. 2 | const packageVersion = '1.3.0'; 3 | -------------------------------------------------------------------------------- /lib/_theme/color_palette.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | class ColorPalette { 4 | static const Color primarySwatch = Color(0xff5F4339); 5 | static const Color primaryColor = Color(0xff5F4339); 6 | static const Color accentColor = Color(0xff1F120D); 7 | static const Color secondaryColor = Color(0xff9E8278); 8 | static const Color fontColor = Color(0xffeaeadf); 9 | static const Color fontSinyColor = Color(0xffffff00); 10 | static const Color bgColor = Color(0xfff4f4f4); 11 | } 12 | -------------------------------------------------------------------------------- /lib/_utilities/console_line_util.dart: -------------------------------------------------------------------------------- 1 | import 'package:console_repository/console_repository.dart'; 2 | 3 | Iterable generateOneLineConsoleLine(String text) { 4 | return [ 5 | ConsoleLine( 6 | texts: [ 7 | ConsoleText( 8 | text: text, 9 | ) 10 | ], 11 | ) 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /lib/pages/app_page/app_selector_page.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const appSelectorPageTypeInfo = 'appSelectorPageTypeInfo'; 5 | const appSelectorPageTypeServer = 'appSelectorPageTypeServer'; 6 | const appSelectorPageTypeCraft = 'appSelectorPageTypeCraft'; 7 | const appSelectorPageTypeAbout = 'appSelectorPageTypeAbout'; 8 | const appTitle = 'appTitle'; 9 | 10 | extension Localization on String { 11 | static final _t = Translations.from( 12 | AppLocalization.enUS.name, 13 | { 14 | appTitle: { 15 | AppLocalization.enUS.name: 'Minecraft Cube', 16 | AppLocalization.zhTW.name: '創世神魔方', 17 | }, 18 | appSelectorPageTypeInfo: { 19 | AppLocalization.enUS.name: 'Info', 20 | AppLocalization.zhTW.name: '資訊欄', 21 | }, 22 | appSelectorPageTypeServer: { 23 | AppLocalization.enUS.name: 'Server', 24 | AppLocalization.zhTW.name: '伺服器', 25 | }, 26 | appSelectorPageTypeCraft: { 27 | AppLocalization.enUS.name: 'Craft', 28 | AppLocalization.zhTW.name: '製作', 29 | }, 30 | appSelectorPageTypeAbout: { 31 | AppLocalization.enUS.name: 'About', 32 | AppLocalization.zhTW.name: '關於', 33 | }, 34 | }, 35 | ); 36 | 37 | String get i18n => localize(this, _t); 38 | } 39 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/craft_page/pages/craft_navi_page/pages/base_page.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const craftBasePageBack = 'craftBasePageBack'; 5 | const craftBasePageInstruction = 'craftBasePageInstruction'; 6 | const craftBasePageNext = 'craftInstallerNamePageNext'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | craftBasePageBack: { 13 | AppLocalization.enUS.name: 'Back', 14 | AppLocalization.zhTW.name: '回選單', 15 | }, 16 | craftBasePageInstruction: { 17 | AppLocalization.enUS.name: 'Instruction:', 18 | AppLocalization.zhTW.name: '說明:', 19 | }, 20 | craftBasePageNext: { 21 | AppLocalization.enUS.name: 'Next', 22 | AppLocalization.zhTW.name: '下一步', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/info_page/sections/info_section/language_dialog.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const languageDialogSelectLanguage = 'languageDialogSelectLanguage'; 5 | const languageDialogCancel = 'languageDialogCancel'; 6 | const languageDialogConfirm = 'languageDialogConfirm'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | languageDialogSelectLanguage: { 13 | AppLocalization.enUS.name: 'Select Lang', 14 | AppLocalization.zhTW.name: '選擇語言', 15 | }, 16 | languageDialogCancel: { 17 | AppLocalization.enUS.name: 'Cancel', 18 | AppLocalization.zhTW.name: '取消', 19 | }, 20 | languageDialogConfirm: { 21 | AppLocalization.enUS.name: 'Confirm', 22 | AppLocalization.zhTW.name: '確定', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/info_page/sections/info_section/release_note_dialog.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const releaseNoteDialogDownload = 'releaseNoteDialogDownload'; 5 | const releaseNotDialogDownloadLink = 'releaseNotDialogDownloadLink'; 6 | 7 | extension Localization on String { 8 | static final _t = Translations.from( 9 | AppLocalization.enUS.name, 10 | { 11 | releaseNoteDialogDownload: { 12 | AppLocalization.enUS.name: 'Download', 13 | AppLocalization.zhTW.name: '前往下載頁', 14 | }, 15 | releaseNotDialogDownloadLink: { 16 | AppLocalization.enUS.name: 17 | 'https://minecraftscepter.github.io/changelogs?lang=en', 18 | AppLocalization.zhTW.name: 19 | 'https://minecraftscepter.github.io/changelogs?lang=zhTW', 20 | } 21 | }, 22 | ); 23 | 24 | String get i18n => localize(this, _t); 25 | } 26 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/info_page/sections/network_section/network_section.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const networkSectionPublicIp = 'networkSectionPublicIp'; 5 | const networkSectionInternalIp = 'networkSectionInternalIp'; 6 | const networkSectionGatewayIp = 'networkSectionGatewayIp'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | networkSectionPublicIp: { 13 | AppLocalization.enUS.name: 'Public Ip', 14 | AppLocalization.zhTW.name: '公開地址', 15 | }, 16 | networkSectionInternalIp: { 17 | AppLocalization.enUS.name: 'Internal Ip', 18 | AppLocalization.zhTW.name: '內部地址', 19 | }, 20 | networkSectionGatewayIp: { 21 | AppLocalization.enUS.name: 'Gateway Ip', 22 | AppLocalization.zhTW.name: '閘道地址', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/info_page/sections/system_section/bloc/gpu_info_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | import 'package:cube_api/cube_api.dart'; 3 | import 'package:equatable/equatable.dart'; 4 | import 'package:system_repository/system_repository.dart'; 5 | 6 | abstract class GpuInfoEvent extends Equatable { 7 | const GpuInfoEvent(); 8 | @override 9 | List get props => []; 10 | } 11 | 12 | class GpuInfoStarted extends GpuInfoEvent { 13 | const GpuInfoStarted(); 14 | } 15 | 16 | class GpuInfoState extends Equatable { 17 | const GpuInfoState({ 18 | this.info = '', 19 | this.status = NetworkStatus.uninit, 20 | }); 21 | final String info; 22 | final NetworkStatus status; 23 | 24 | GpuInfoState copyWith({ 25 | String? info, 26 | NetworkStatus? status, 27 | }) { 28 | return GpuInfoState( 29 | info: info ?? this.info, 30 | status: status ?? this.status, 31 | ); 32 | } 33 | 34 | @override 35 | List get props => [info, status]; 36 | } 37 | 38 | class GpuInfoBloc extends Bloc { 39 | GpuInfoBloc({ 40 | required SystemRepository systemRepository, 41 | }) : _systemRepository = systemRepository, 42 | super(const GpuInfoState()) { 43 | on((event, emit) async { 44 | emit(state.copyWith(status: NetworkStatus.inProgress)); 45 | try { 46 | final info = await _systemRepository.getGpuInfo(); 47 | emit(state.copyWith(status: NetworkStatus.success, info: info)); 48 | } catch (_) { 49 | emit(state.copyWith(status: NetworkStatus.failure)); 50 | } 51 | }); 52 | } 53 | 54 | final SystemRepository _systemRepository; 55 | } 56 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/info_page/widgets/info_icon_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class InfoIconButton extends StatelessWidget { 4 | const InfoIconButton({ 5 | Key? key, 6 | required this.name, 7 | required this.icon, 8 | this.padding, 9 | this.onPressed, 10 | }) : super(key: key); 11 | final VoidCallback? onPressed; 12 | final EdgeInsetsGeometry? padding; 13 | final String name; 14 | final IconData icon; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return RawMaterialButton( 19 | constraints: const BoxConstraints(minWidth: 48), 20 | onPressed: onPressed, 21 | child: Row( 22 | children: [ 23 | Container( 24 | decoration: BoxDecoration( 25 | color: Colors.white, 26 | border: Border.all(color: Colors.black), 27 | borderRadius: BorderRadius.circular(16), 28 | ), 29 | padding: padding, 30 | child: Icon(icon), 31 | ), 32 | const SizedBox( 33 | width: 4, 34 | ), 35 | Text( 36 | name, 37 | style: Theme.of(context) 38 | .textTheme 39 | .titleSmall! 40 | .copyWith(color: Colors.black), 41 | ) 42 | ], 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/info_page/widgets/info_icon_link.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:launcher_repository/launcher_repository.dart'; 4 | 5 | class InfoIconLink extends StatelessWidget { 6 | const InfoIconLink({ 7 | Key? key, 8 | required this.url, 9 | required this.text, 10 | required this.icon, 11 | }) : super(key: key); 12 | final String url; 13 | final String text; 14 | final Widget icon; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return RawMaterialButton( 19 | child: Row( 20 | children: [ 21 | Container( 22 | decoration: BoxDecoration( 23 | color: Colors.white, 24 | border: Border.all(color: Colors.black), 25 | borderRadius: BorderRadius.circular(4), 26 | boxShadow: kElevationToShadow[2], 27 | ), 28 | padding: const EdgeInsets.all(1), 29 | child: icon, 30 | ), 31 | const SizedBox( 32 | width: 4, 33 | ), 34 | Text( 35 | text, 36 | style: Theme.of(context) 37 | .textTheme 38 | .titleMedium! 39 | .copyWith(color: Colors.black), 40 | ) 41 | ], 42 | ), 43 | onPressed: () async { 44 | final launcher = context.read(); 45 | if (await launcher.canLaunch(path: url)) { 46 | await launcher.launch(path: url); 47 | } 48 | }, 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/info_page/widgets/info_title.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class InfoTitle extends StatelessWidget { 4 | const InfoTitle({Key? key, required this.icon, required this.title}) 5 | : super(key: key); 6 | final IconData icon; 7 | final String title; 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final textTheme = Theme.of(context).textTheme; 12 | return Column( 13 | mainAxisSize: MainAxisSize.min, 14 | crossAxisAlignment: CrossAxisAlignment.stretch, 15 | children: [ 16 | Row( 17 | children: [ 18 | Icon(icon), 19 | Text( 20 | title, 21 | style: textTheme.titleLarge!, 22 | ), 23 | ], 24 | ), 25 | Divider( 26 | color: textTheme.bodyLarge!.color, 27 | ) 28 | ], 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/consts/app_cube_properties.dart: -------------------------------------------------------------------------------- 1 | import 'package:cube_api/cube_api.dart'; 2 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/consts/app_cube_properties.i18n.dart'; 3 | 4 | Iterable getAppCubeProperties() { 5 | return [ 6 | StringServerProperty( 7 | name: cubeJava.i18n, 8 | fieldName: 'Java', 9 | value: 'java', 10 | selectables: { 11 | cubeSystemjava.i18n: 'java', 12 | }, 13 | description: cubeJavaDesc.i18n, 14 | ), 15 | StringServerProperty( 16 | name: cubeXmx.i18n, 17 | fieldName: 'Xmx', 18 | value: '4g', 19 | description: cubeXmxDesc.i18n, 20 | ), 21 | StringServerProperty( 22 | name: cubeXms.i18n, 23 | fieldName: 'Xms', 24 | value: '256m', 25 | description: cubeXmsDesc.i18n, 26 | ) 27 | ]; 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/configuration_loader_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const configurationLoaderProgress = 'configurationLoaderProgress'; 5 | const configurationLoaderSuccess = 'configurationLoaderSuccess'; 6 | const configurationLoaderFailure = 'configurationLoaderFailure'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | configurationLoaderProgress: { 13 | AppLocalization.enUS.name: 'Load cube.properties...', 14 | AppLocalization.zhTW.name: '讀取 Cube 設定檔...', 15 | }, 16 | configurationLoaderSuccess: { 17 | AppLocalization.enUS.name: 'Load Complete...', 18 | AppLocalization.zhTW.name: '讀取完成', 19 | }, 20 | configurationLoaderFailure: { 21 | AppLocalization.enUS.name: 'Load Failure...', 22 | AppLocalization.zhTW.name: '讀取失敗', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/eula_ask_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const eulaAskAgreeProgress = 'eulaAskAgreeProgress'; 5 | const eulaAskAgreeSuccess = 'eulaAskAgreeSuccess'; 6 | const eulaAskAgreeFailure = 'eulaAskAgreeFailure'; 7 | const eulaAskDisagree = 'eulaAskDisagree'; 8 | 9 | extension Localization on String { 10 | static final _t = Translations.from( 11 | AppLocalization.enUS.name, 12 | { 13 | eulaAskAgreeProgress: { 14 | AppLocalization.enUS.name: 'Agree Eula...', 15 | AppLocalization.zhTW.name: '同意終端用戶協議...', 16 | }, 17 | eulaAskAgreeSuccess: { 18 | AppLocalization.enUS.name: 'Pass...', 19 | AppLocalization.zhTW.name: '完成', 20 | }, 21 | eulaAskAgreeFailure: { 22 | AppLocalization.enUS.name: 'Failure...', 23 | AppLocalization.zhTW.name: '失敗', 24 | }, 25 | eulaAskDisagree: { 26 | AppLocalization.enUS.name: 'Not agree, then check eula.txt manually.', 27 | AppLocalization.zhTW.name: '不同意終端用戶協議...請自行閱讀專案下的 eula.txt', 28 | } 29 | }, 30 | ); 31 | 32 | String get i18n => localize(this, _t); 33 | } 34 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/eula_stage_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const eulaStageProgress = 'eulaStageProgress'; 5 | const eulaStageSuccess = 'eulaStageSuccess'; 6 | const eulaStageFailure = 'eulaStageFailure'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | eulaStageProgress: { 13 | AppLocalization.enUS.name: 'Check Eula...', 14 | AppLocalization.zhTW.name: '檢查終端用戶協議...', 15 | }, 16 | eulaStageSuccess: { 17 | AppLocalization.enUS.name: 'Pass...', 18 | AppLocalization.zhTW.name: '檢查完成', 19 | }, 20 | eulaStageFailure: { 21 | AppLocalization.enUS.name: 'Failure...', 22 | AppLocalization.zhTW.name: '檢查失敗', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/forge_install_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const forgeInstallProgress = 'forgeInstallProgress'; 5 | const forgeInstallForgeSuccess = 'forgeInstallForgeSuccess'; 6 | const forgeInstallPassSuccess = 'forgeInstallPassSuccess'; 7 | const forgeInstallFailure = 'forgeInstallFailure'; 8 | 9 | extension Localization on String { 10 | static final _t = Translations.from( 11 | AppLocalization.enUS.name, 12 | { 13 | forgeInstallProgress: { 14 | AppLocalization.enUS.name: 'Check forge...', 15 | AppLocalization.zhTW.name: '檢查 forge...', 16 | }, 17 | forgeInstallForgeSuccess: { 18 | AppLocalization.enUS.name: 'Install forge successfuuly...', 19 | AppLocalization.zhTW.name: '成功安裝 forge', 20 | }, 21 | forgeInstallPassSuccess: { 22 | AppLocalization.enUS.name: 'Pass forge...', 23 | AppLocalization.zhTW.name: '通過 forge...', 24 | }, 25 | forgeInstallFailure: { 26 | AppLocalization.enUS.name: 'Process forge failure...', 27 | AppLocalization.zhTW.name: '處理 forge 時發生錯誤', 28 | }, 29 | }, 30 | ); 31 | 32 | String get i18n => localize(this, _t); 33 | } 34 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/idle_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/server_machine.dart'; 2 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/istate.dart'; 3 | 4 | class IdleState extends IState { 5 | IdleState({required ServerMachine machine}) : super(machine: machine); 6 | 7 | @override 8 | void start() { 9 | machine.state = machine.preProcessCleanerState; 10 | machine.state.start(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/istate.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/server_machine.dart'; 4 | 5 | // enum ServerState { 6 | // idle, 7 | // preProcess, 8 | // preDuplicate, 9 | // eulaStage, 10 | // eulaAsk, 11 | // jarAnalyze, 12 | // configurationLoad, 13 | // javaPrint, 14 | // javaDuplicate, 15 | // forgeInstall, 16 | // server, 17 | // postProcess, 18 | // postDuplicate, 19 | // } 20 | 21 | abstract class IState { 22 | IState({required this.machine}); 23 | final ServerMachine machine; 24 | FutureOr agree() {} 25 | FutureOr disagree() {} 26 | FutureOr stop() {} 27 | FutureOr start() {} 28 | FutureOr input(String command) {} 29 | 30 | // ServerState get pureState; 31 | } 32 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/jar_analyzer_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const jarAnalyzerProgress = 'jarAnalyzerProgress'; 5 | const jarAnalyzerSuccess = 'jarAnalyzerSuccess'; 6 | const jarAnalyzerFailure = 'jarAnalyzerFailure'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | jarAnalyzerProgress: { 13 | AppLocalization.enUS.name: 'Analyze executors...', 14 | AppLocalization.zhTW.name: '分析執行檔...', 15 | }, 16 | jarAnalyzerSuccess: { 17 | AppLocalization.enUS.name: 'Analyze Complete...', 18 | AppLocalization.zhTW.name: '分析完成', 19 | }, 20 | jarAnalyzerFailure: { 21 | AppLocalization.enUS.name: 'Failure...', 22 | AppLocalization.zhTW.name: '分析失敗', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/jar_dangerous_ask_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:cube_api/cube_api.dart'; 2 | import 'package:minecraft_cube_desktop/_utilities/console_line_util.dart'; 3 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/server_machine.dart'; 4 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/istate.dart'; 5 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/jar_dangerous_ask_state.i18n.dart'; 6 | import 'package:server_configuration_repository/server_configuration_repository.dart'; 7 | 8 | class JarDangerousAskState extends IState { 9 | final ServerConfigurationRepository serverConfigurationRepository; 10 | JarDangerousAskState( 11 | ServerMachine machine, { 12 | required this.serverConfigurationRepository, 13 | }) : super(machine: machine); 14 | 15 | @override 16 | Future agree() async { 17 | machine.addLog( 18 | generateOneLineConsoleLine( 19 | jarDangerousAskAgree.i18n, 20 | ), 21 | ); 22 | final path = machine.projectPath; 23 | if (path != null) { 24 | await serverConfigurationRepository.saveConfiguration( 25 | directory: path, 26 | configuration: const ServerConfiguration(isAgreeDangerous: true), 27 | ); 28 | } 29 | machine.state = machine.configurationLoaderState; 30 | machine.state.start(); 31 | } 32 | 33 | @override 34 | void disagree() { 35 | machine.addLog( 36 | generateOneLineConsoleLine( 37 | jarDangerousAskDisagree.i18n, 38 | ), 39 | ); 40 | machine.state = machine.idleState; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/jar_dangerous_ask_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const jarDangerousAskAgree = 'jarDangerousAskAgree'; 5 | const jarDangerousAskDisagree = 'jarDangerousAskDisagree'; 6 | 7 | extension Localization on String { 8 | static final _t = Translations.from( 9 | AppLocalization.enUS.name, 10 | { 11 | jarDangerousAskAgree: { 12 | AppLocalization.enUS.name: 'You agree to execute the jar...', 13 | AppLocalization.zhTW.name: '同意執行未知 jar...', 14 | }, 15 | jarDangerousAskDisagree: { 16 | AppLocalization.enUS.name: 17 | 'Not agree, please check the jar carefully...', 18 | AppLocalization.zhTW.name: '不同意,請至專案底下檢查 jar...', 19 | } 20 | }, 21 | ); 22 | 23 | String get i18n => localize(this, _t); 24 | } 25 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/java_duplicator_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const javaDuplicatorProgress = 'javaDuplicatorProgress'; 5 | const javaDuplicatorSuccess = 'javaDuplicatorSuccess'; 6 | const javaDuplicatorFailure = 'javaDuplicatorFailure'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | javaDuplicatorProgress: { 13 | AppLocalization.enUS.name: 'Clone java executor...', 14 | AppLocalization.zhTW.name: '複製 Java...', 15 | }, 16 | javaDuplicatorSuccess: { 17 | AppLocalization.enUS.name: 'Clone complete...', 18 | AppLocalization.zhTW.name: '複製完成...', 19 | }, 20 | javaDuplicatorFailure: { 21 | AppLocalization.enUS.name: 'Clone Failure...', 22 | AppLocalization.zhTW.name: '複製失敗...', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/java_printer_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const javaPrinterProgress = 'javaPrinterProgress'; 5 | const javaPrinterSuccess = 'javaPrinterSuccess'; 6 | const javaPrinterFailure = 'javaPrinterFailure'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | javaPrinterProgress: { 13 | AppLocalization.enUS.name: 'Dump java version...', 14 | AppLocalization.zhTW.name: '傾印 Java 版本...', 15 | }, 16 | javaPrinterSuccess: { 17 | AppLocalization.enUS.name: 'Dump complete...', 18 | AppLocalization.zhTW.name: '傾印完成', 19 | }, 20 | javaPrinterFailure: { 21 | AppLocalization.enUS.name: 'Dump Failure...', 22 | AppLocalization.zhTW.name: '傾印失敗', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/post_duplicate_cleaner_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:duplicate_cleaner_repository/duplicate_cleaner_repository.dart'; 2 | import 'package:minecraft_cube_desktop/_utilities/console_line_util.dart'; 3 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/server_machine.dart'; 4 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/istate.dart'; 5 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/pre_duplicate_cleaner_state.i18n.dart'; 6 | 7 | class PostDuplicateCleanerState extends IState { 8 | PostDuplicateCleanerState( 9 | ServerMachine machine, { 10 | required this.duplicateCleanerRepository, 11 | }) : super(machine: machine); 12 | final DuplicateCleanerRepository duplicateCleanerRepository; 13 | 14 | @override 15 | Future start() async { 16 | machine.addLog( 17 | generateOneLineConsoleLine( 18 | preDuplicateCleanerProgress.i18n, 19 | ), 20 | ); 21 | try { 22 | await duplicateCleanerRepository.deleteCubeJava(); 23 | 24 | machine.addLog( 25 | generateOneLineConsoleLine( 26 | preDuplicateCleanerSuccess.i18n, 27 | ), 28 | ); 29 | machine.state = machine.idleState; 30 | } catch (_) { 31 | machine.addLog( 32 | generateOneLineConsoleLine( 33 | preDuplicateCleanerFailure.i18n, 34 | ), 35 | ); 36 | machine.state = machine.idleState; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/post_process_cleaner_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:minecraft_cube_desktop/_utilities/console_line_util.dart'; 2 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/server_machine.dart'; 3 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/istate.dart'; 4 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/pre_process_cleaner_state.i18n.dart'; 5 | import 'package:process_cleaner_repository/process_cleaner_repository.dart'; 6 | 7 | class PostProcessCleanerState extends IState { 8 | PostProcessCleanerState( 9 | ServerMachine machine, { 10 | required this.processCleanerRepository, 11 | }) : super(machine: machine); 12 | final ProcessCleanerRepository processCleanerRepository; 13 | 14 | @override 15 | Future start() async { 16 | machine.addLog( 17 | generateOneLineConsoleLine( 18 | preProcessCleanerProgress.i18n, 19 | ), 20 | ); 21 | try { 22 | await processCleanerRepository.killJavaProcesses(); 23 | machine.addLog( 24 | generateOneLineConsoleLine( 25 | preProcessCleanerSuccess.i18n, 26 | ), 27 | ); 28 | machine.state = machine.postDuplicateCleanerState; 29 | machine.state.start(); 30 | } catch (_) { 31 | machine.addLog( 32 | generateOneLineConsoleLine( 33 | preProcessCleanerFailure.i18n, 34 | ), 35 | ); 36 | machine.state = machine.idleState; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/pre_duplicate_cleaner_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:duplicate_cleaner_repository/duplicate_cleaner_repository.dart'; 2 | import 'package:minecraft_cube_desktop/_utilities/console_line_util.dart'; 3 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/server_machine.dart'; 4 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/istate.dart'; 5 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/pre_duplicate_cleaner_state.i18n.dart'; 6 | 7 | class PreDuplicateCleanerState extends IState { 8 | PreDuplicateCleanerState( 9 | ServerMachine machine, { 10 | required this.duplicateCleanerRepository, 11 | }) : super(machine: machine); 12 | final DuplicateCleanerRepository duplicateCleanerRepository; 13 | 14 | @override 15 | Future start() async { 16 | machine.addLog( 17 | generateOneLineConsoleLine( 18 | preDuplicateCleanerProgress.i18n, 19 | ), 20 | ); 21 | try { 22 | await duplicateCleanerRepository.deleteCubeJava(); 23 | 24 | machine.addLog( 25 | generateOneLineConsoleLine( 26 | preDuplicateCleanerSuccess.i18n, 27 | ), 28 | ); 29 | machine.state = machine.eulaStageState; 30 | machine.state.start(); 31 | } catch (_) { 32 | machine.addLog( 33 | generateOneLineConsoleLine( 34 | preDuplicateCleanerFailure.i18n, 35 | ), 36 | ); 37 | machine.state = machine.idleState; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/pre_duplicate_cleaner_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const preDuplicateCleanerProgress = 'preDuplicateCleanerProgress'; 5 | const preDuplicateCleanerSuccess = 'preDuplicateCleanerSuccess'; 6 | const preDuplicateCleanerFailure = 'preDuplicateCleanerFailure'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | preDuplicateCleanerProgress: { 13 | AppLocalization.enUS.name: 'Clean Duplicates...', 14 | AppLocalization.zhTW.name: '清除複製體...', 15 | }, 16 | preDuplicateCleanerSuccess: { 17 | AppLocalization.enUS.name: 'Clean Success...', 18 | AppLocalization.zhTW.name: '清除完成', 19 | }, 20 | preDuplicateCleanerFailure: { 21 | AppLocalization.enUS.name: 'Clean Failure...', 22 | AppLocalization.zhTW.name: '清除失敗', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/pre_process_cleaner_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:minecraft_cube_desktop/_utilities/console_line_util.dart'; 2 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/server_machine.dart'; 3 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/istate.dart'; 4 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/machine/states/pre_process_cleaner_state.i18n.dart'; 5 | import 'package:process_cleaner_repository/process_cleaner_repository.dart'; 6 | 7 | class PreProcessCleanerState extends IState { 8 | PreProcessCleanerState( 9 | ServerMachine machine, { 10 | required this.processCleanerRepository, 11 | }) : super(machine: machine); 12 | final ProcessCleanerRepository processCleanerRepository; 13 | 14 | @override 15 | Future start() async { 16 | machine.addLog( 17 | generateOneLineConsoleLine( 18 | preProcessCleanerProgress.i18n, 19 | ), 20 | ); 21 | try { 22 | await processCleanerRepository.killJavaProcesses(); 23 | machine.addLog( 24 | generateOneLineConsoleLine( 25 | preProcessCleanerSuccess.i18n, 26 | ), 27 | ); 28 | machine.state = machine.preDuplicateCleanerState; 29 | machine.state.start(); 30 | } catch (_) { 31 | machine.addLog( 32 | generateOneLineConsoleLine( 33 | preProcessCleanerFailure.i18n, 34 | ), 35 | ); 36 | machine.state = machine.idleState; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/pre_process_cleaner_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const preProcessCleanerProgress = 'preProcessCleanerProgress'; 5 | const preProcessCleanerSuccess = 'preProcessCleanerSuccess'; 6 | const preProcessCleanerFailure = 'preProcessCleanerFailure'; 7 | 8 | extension Localization on String { 9 | static final _t = Translations.from( 10 | AppLocalization.enUS.name, 11 | { 12 | preProcessCleanerProgress: { 13 | AppLocalization.enUS.name: 'Clean Process...', 14 | AppLocalization.zhTW.name: '清除程序...', 15 | }, 16 | preProcessCleanerSuccess: { 17 | AppLocalization.enUS.name: 'Clean Success...', 18 | AppLocalization.zhTW.name: '清除完成', 19 | }, 20 | preProcessCleanerFailure: { 21 | AppLocalization.enUS.name: 'Clean Failure...', 22 | AppLocalization.zhTW.name: '清除失敗', 23 | }, 24 | }, 25 | ); 26 | 27 | String get i18n => localize(this, _t); 28 | } 29 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/machine/states/server_state.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const serverStateProgress = 'serverStateProgress'; 5 | const serverStateSuccess = 'serverStateSuccess'; 6 | const serverStateExitCodeFailure = 'serverStateExitCodeFailure'; 7 | const serverStateUnexpectedFailure = 'serverStateUnexpectedFailure'; 8 | 9 | extension Localization on String { 10 | static final _t = Translations.from( 11 | AppLocalization.enUS.name, 12 | { 13 | serverStateProgress: { 14 | AppLocalization.enUS.name: 'Starting Server...', 15 | AppLocalization.zhTW.name: '啟動伺服器...', 16 | }, 17 | serverStateSuccess: { 18 | AppLocalization.enUS.name: 'Server close safely.', 19 | AppLocalization.zhTW.name: '伺服器安全關閉', 20 | }, 21 | serverStateExitCodeFailure: { 22 | AppLocalization.enUS.name: 'Server Close unexpectedly(1)', 23 | AppLocalization.zhTW.name: '無法預期的關閉(1)', 24 | }, 25 | serverStateUnexpectedFailure: { 26 | AppLocalization.enUS.name: 'Server Close unexpectedly(2)', 27 | AppLocalization.zhTW.name: '無法預期的關閉(2)', 28 | }, 29 | }, 30 | ); 31 | 32 | String get i18n => localize(this, _t); 33 | } 34 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/widgets/dangerous_alert_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:minecraft_cube_desktop/pages/app_page/pages/server_page/widgets/dangerous_alert_dialog.i18n.dart'; 3 | 4 | class DangerousAlertDialog extends StatelessWidget { 5 | const DangerousAlertDialog({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Theme( 10 | data: ThemeData.light(), 11 | child: AlertDialog( 12 | title: Text(serverPageJarDangerousDialogTitle.i18n), 13 | content: Text( 14 | serverPageJarDangerousDialogNotify.i18n, 15 | ), 16 | actions: [ 17 | TextButton( 18 | child: Text(serverPageJarDangerousDialogReject.i18n), 19 | onPressed: () { 20 | Navigator.of(context).pop(false); 21 | }, 22 | ), 23 | TextButton( 24 | child: Text(serverPageJarDangerousDialogAgree.i18n), 25 | onPressed: () async { 26 | Navigator.of(context).pop(true); 27 | }, 28 | ) 29 | ], 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/pages/app_page/pages/server_page/widgets/dangerous_alert_dialog.i18n.dart: -------------------------------------------------------------------------------- 1 | import 'package:i18n_extension/i18n_extension.dart'; 2 | import 'package:minecraft_cube_desktop/_consts/localization.dart'; 3 | 4 | const serverPageJarDangerousDialogTitle = 'serverPageJarDangerousDialogTitle'; 5 | const serverPageJarDangerousDialogNotify = 'serverPageJarDangerousDialogNotify'; 6 | const serverPageJarDangerousDialogReject = 'serverPageJarDangerousDialogReject'; 7 | const serverPageJarDangerousDialogAgree = 'serverPageJarDangerousDialogAgree'; 8 | 9 | extension Localization on String { 10 | static final _t = Translations.from( 11 | AppLocalization.enUS.name, 12 | { 13 | serverPageJarDangerousDialogTitle: { 14 | AppLocalization.enUS.name: 'Unknown jar', 15 | AppLocalization.zhTW.name: '無法辨識的 jar', 16 | }, 17 | serverPageJarDangerousDialogNotify: { 18 | AppLocalization.enUS.name: 19 | 'Warning: you should take full care of this action, since this is not recognized as a valid jar.', 20 | AppLocalization.zhTW.name: '警告: 請注意此操作,無法辨識的 jar。', 21 | }, 22 | serverPageJarDangerousDialogReject: { 23 | AppLocalization.enUS.name: 'Reject', 24 | AppLocalization.zhTW.name: '拒絕', 25 | }, 26 | serverPageJarDangerousDialogAgree: { 27 | AppLocalization.enUS.name: 'Agree', 28 | AppLocalization.zhTW.name: '同意', 29 | }, 30 | }, 31 | ); 32 | 33 | String get i18n => localize(this, _t); 34 | } 35 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) desktop_window_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin"); 16 | desktop_window_plugin_register_with_registrar(desktop_window_registrar); 17 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 19 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 20 | g_autoptr(FlPluginRegistrar) window_size_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin"); 22 | window_size_plugin_register_with_registrar(window_size_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | desktop_window 7 | url_launcher_linux 8 | window_size 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /linux_local_dev_setup.sh: -------------------------------------------------------------------------------- 1 | # need to manual set in terminal... 2 | chmod +x minimal_resources/process_cleaner_repository/cube_java_linux 3 | export DART_TEST_RESOURCES=$PWD/minimal_resources 4 | export JAVA_17=$PWD/zulu17.32.13-ca-jdk17.0.2-linux_x64/bin/java 5 | export JAVA_8=$PWD/zulu8.60.0.21-ca-jdk8.0.322-linux_x64/bin/java 6 | export JAVA_VERSION=pass 7 | 8 | -------------------------------------------------------------------------------- /linux_local_full_setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget https://dl.dropboxusercontent.com/s/i0s17qbooewf8le/minimal_resources.zip 4 | 5 | unzip minimal_resources.zip 6 | 7 | chmod +x minimal_resources/process_cleaner_repository/cube_java_linux 8 | 9 | wget https://cdn.azul.com/zulu/bin/zulu8.60.0.21-ca-jdk8.0.322-linux_x64.zip 10 | 11 | unzip zulu8.60.0.21-ca-jdk8.0.322-linux_x64.zip 12 | 13 | wget https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-linux_x64.zip 14 | 15 | unzip zulu17.32.13-ca-jdk17.0.2-linux_x64.zip 16 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import desktop_window 9 | import url_launcher_macos 10 | import window_size 11 | 12 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 13 | DesktopWindowPlugin.register(with: registry.registrar(forPlugin: "DesktopWindowPlugin")) 14 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 15 | WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin")) 16 | } 17 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/64.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | {"images":[{"size":"128x128","expected-size":"128","filename":"128.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"256x256","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"128x128","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"256x256","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"512x512","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"16","filename":"16.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"64","filename":"64.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"512x512","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"}]} -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/appstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/appstore.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/macos/Runner/Assets.xcassets/AppIcon.appiconset/playstore.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = minecraft_cube_desktop 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.minecraftCubeDesktop 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | com.apple.security.network.client 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.server 8 | 9 | com.apple.security.network.client 10 | 11 | com.apple.security.files.user-selected.read-write 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /macos_local_dev_setup.sh: -------------------------------------------------------------------------------- 1 | # need to manual set in terminal... 2 | chmod +x minimal_resources/process_cleaner_repository/cube_java_linux 3 | export DART_TEST_RESOURCES=$PWD/minimal_resources 4 | export JAVA_17=$PWD/zulu17.32.13-ca-jdk17.0.2-macosx_x64/bin/java 5 | export JAVA_8=$PWD/zulu8.60.0.21-ca-jdk8.0.322-macosx_x64/bin/java 6 | export JAVA_VERSION=pass -------------------------------------------------------------------------------- /macos_local_full_setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | curl -o minimal_resources.zip https://dl.dropboxusercontent.com/s/i0s17qbooewf8le/minimal_resources.zip 4 | 5 | unzip minimal_resources.zip 6 | 7 | chmod +x minimal_resources/process_cleaner_repository/cube_java_macos 8 | 9 | curl -o zulu8.60.0.21-ca-jdk8.0.322-macosx_x64.zip https://cdn.azul.com/zulu/bin/zulu8.60.0.21-ca-jdk8.0.322-macosx_x64.zip 10 | 11 | unzip zulu8.60.0.21-ca-jdk8.0.322-macosx_x64.zip 12 | 13 | curl -o zulu17.32.13-ca-jdk17.0.2-macosx_x64.zip https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-macosx_x64.zip 14 | 15 | unzip zulu17.32.13-ca-jdk17.0.2-macosx_x64.zip -------------------------------------------------------------------------------- /packages/app_updater_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/app_updater_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/app_updater_repository/lib/app_updater_repository.dart: -------------------------------------------------------------------------------- 1 | library app_updater_repository; 2 | 3 | export 'src/app_updater_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/app_updater_repository/lib/src/app_updater_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:version/version.dart'; 3 | 4 | /// Compare basic version / Expose release note 5 | /// 6 | /// From: https://github.com/MinecraftCube/MinecraftCubeDesktop/tree/version_info 7 | class AppUpdaterRepository { 8 | AppUpdaterRepository({Dio? dio}) : _dio = dio ?? Dio(); 9 | final Dio _dio; 10 | 11 | Future hasGreaterVersion({required String version}) async { 12 | final Version appVersion = Version.parse(version); 13 | final versionResponse = await _dio.get( 14 | 'https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/version_info/version', 15 | ); 16 | final rawLatestVersion = versionResponse.data; 17 | if (rawLatestVersion == null) return false; 18 | 19 | final Version latestVersion = Version.parse(rawLatestVersion); 20 | return latestVersion > appVersion; 21 | } 22 | 23 | Future getLatestRelease({required String fullLocale}) async { 24 | final latestReleaseUrl = 25 | 'https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/version_info/$fullLocale/LATEST_RELEASE.md'; 26 | final latestNoteResponse = await _dio.get(latestReleaseUrl); 27 | return latestNoteResponse.data; 28 | } 29 | 30 | // Another support, skip version... 31 | } 32 | -------------------------------------------------------------------------------- /packages/app_updater_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: app_updater_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | dio: ^4.0.4 17 | version: ^2.0.0 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | flutter_lints: ^2.0.1 23 | mocktail: ^0.3.0 24 | test_utilities: 25 | path: ../test_utilities 26 | -------------------------------------------------------------------------------- /packages/app_updater_repository/test/app_updater_repository_ig_test.dart: -------------------------------------------------------------------------------- 1 | @Tags(['integration']) 2 | 3 | // This should be removed, once https://github.com/invertase/melos/issues/261 and https://github.com/flutter/flutter/issues/100467 sloved. 4 | 5 | import 'package:flutter_test/flutter_test.dart'; 6 | 7 | void main() { 8 | test('dummy test for melos#261 and flutter#100467', () {}); 9 | } 10 | -------------------------------------------------------------------------------- /packages/console_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/console_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/console_repository/lib/console_repository.dart: -------------------------------------------------------------------------------- 1 | library console_repository; 2 | 3 | export './src/console_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/console_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: console_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | test_utilities: 13 | path: ../test_utilities 14 | ansi_up: ^1.0.0 15 | equatable: ^2.0.3 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | flutter_lints: ^2.0.1 21 | mocktail: ^0.3.0 22 | -------------------------------------------------------------------------------- /packages/console_repository/test/console_repository_ig_test.dart: -------------------------------------------------------------------------------- 1 | @Tags(['integration']) 2 | 3 | // This should be removed, once https://github.com/invertase/melos/issues/261 and https://github.com/flutter/flutter/issues/100467 sloved. 4 | 5 | import 'package:flutter_test/flutter_test.dart'; 6 | 7 | void main() { 8 | test('dummy test for melos#261 and flutter#100467', () {}); 9 | } 10 | -------------------------------------------------------------------------------- /packages/cube_api/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/cube_api/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/cube_api/lib/cube_api.dart: -------------------------------------------------------------------------------- 1 | library cube_api; 2 | 3 | export 'src/data/data.dart'; 4 | export 'src/archive/archive.dart'; 5 | export 'src/property/property.dart'; 6 | export 'src/utilities/utilities.dart'; 7 | export 'src/common/common.dart'; 8 | export 'src/ticker/ticker.dart'; 9 | export 'src/const/const.dart'; 10 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/common/common.dart: -------------------------------------------------------------------------------- 1 | export './network_status/network_status.dart'; 2 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/common/network_status/network_status.dart: -------------------------------------------------------------------------------- 1 | enum NetworkStatus { uninit, inProgress, success, failure } 2 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/const/const.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/data.dart: -------------------------------------------------------------------------------- 1 | export './jar/jar_archive_info.dart'; 2 | export './jar/jar_type.dart'; 3 | export './cube/cube_properties.dart'; 4 | export './installer/installer.dart'; 5 | export 'common_property/common_property.dart'; 6 | export './server/server_configuration.dart'; 7 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/installer/installer.dart: -------------------------------------------------------------------------------- 1 | export './src/installer.dart'; 2 | export './src/model_pack.dart'; 3 | export './src/model_setting.dart'; 4 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/installer/src/installer.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'installer.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Installer _$InstallerFromJson(Map json) => Installer( 10 | json['name'] as String, 11 | json['description'] as String, 12 | $enumDecode(_$JarTypeEnumMap, json['type']), 13 | json['serverPath'] as String, 14 | mapZipPath: json['mapZipPath'] as String?, 15 | modelSettings: (json['modelSettings'] as List?) 16 | ?.map((e) => ModelSetting.fromJson(e as Map)) 17 | .toList() ?? 18 | const [], 19 | modelPack: json['modelPack'] == null 20 | ? null 21 | : ModelPack.fromJson(json['modelPack'] as Map), 22 | ); 23 | 24 | Map _$InstallerToJson(Installer instance) => { 25 | 'name': instance.name, 26 | 'description': instance.description, 27 | 'type': _$JarTypeEnumMap[instance.type], 28 | 'serverPath': instance.serverPath, 29 | 'modelSettings': instance.modelSettings, 30 | 'modelPack': instance.modelPack, 31 | 'mapZipPath': instance.mapZipPath, 32 | }; 33 | 34 | const _$JarTypeEnumMap = { 35 | JarType.vanilla: 'vanilla', 36 | JarType.forgeInstaller: 'forgeInstaller', 37 | JarType.forge: 'forge', 38 | JarType.unknown: 'unknown', 39 | }; 40 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/installer/src/model_pack.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'model_pack.g.dart'; 5 | 6 | @JsonSerializable() 7 | class ModelPack extends Equatable { 8 | const ModelPack({ 9 | required this.path, 10 | this.description, 11 | }); 12 | final String path; 13 | final String? description; 14 | 15 | factory ModelPack.fromJson(Map json) => 16 | _$ModelPackFromJson(json); 17 | 18 | Map toJson() => _$ModelPackToJson(this); 19 | 20 | ModelPack copyWith({ 21 | String? path, 22 | String? description, 23 | }) { 24 | return ModelPack( 25 | path: path ?? this.path, 26 | description: description ?? this.description, 27 | ); 28 | } 29 | 30 | @override 31 | List get props => [path, description]; 32 | } 33 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/installer/src/model_pack.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'model_pack.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ModelPack _$ModelPackFromJson(Map json) => ModelPack( 10 | path: json['path'] as String, 11 | description: json['description'] as String?, 12 | ); 13 | 14 | Map _$ModelPackToJson(ModelPack instance) => { 15 | 'path': instance.path, 16 | 'description': instance.description, 17 | }; 18 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/installer/src/model_setting.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'model_setting.g.dart'; 5 | 6 | @JsonSerializable() 7 | class ModelSetting extends Equatable { 8 | const ModelSetting({ 9 | required this.name, 10 | required this.program, 11 | required this.path, 12 | }); 13 | final String name; 14 | final String program; 15 | final String path; 16 | 17 | factory ModelSetting.fromJson(Map json) => 18 | _$ModelSettingFromJson(json); 19 | 20 | Map toJson() => _$ModelSettingToJson(this); 21 | 22 | @override 23 | List get props => [name, program, path]; 24 | 25 | ModelSetting copyWith({ 26 | String? name, 27 | String? program, 28 | String? path, 29 | }) { 30 | return ModelSetting( 31 | name: name ?? this.name, 32 | program: program ?? this.program, 33 | path: path ?? this.path, 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/installer/src/model_setting.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'model_setting.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ModelSetting _$ModelSettingFromJson(Map json) => ModelSetting( 10 | name: json['name'] as String, 11 | program: json['program'] as String, 12 | path: json['path'] as String, 13 | ); 14 | 15 | Map _$ModelSettingToJson(ModelSetting instance) => 16 | { 17 | 'name': instance.name, 18 | 'program': instance.program, 19 | 'path': instance.path, 20 | }; 21 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/jar/jar_archive_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:cube_api/src/data/jar/jar_type.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | 4 | class JarArchiveInfo extends Equatable { 5 | final JarType type; 6 | final String executable; 7 | const JarArchiveInfo({ 8 | required this.type, 9 | required this.executable, 10 | }); 11 | 12 | @override 13 | List get props => [type, executable]; 14 | 15 | JarArchiveInfo copyWith({ 16 | JarType? type, 17 | String? executable, 18 | }) { 19 | return JarArchiveInfo( 20 | type: type ?? this.type, 21 | executable: executable ?? this.executable, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/jar/jar_type.dart: -------------------------------------------------------------------------------- 1 | enum JarType { vanilla, forgeInstaller, forge, forge1182, unknown } 2 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/server/server_configuration.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | /// This allows the `User` class to access private members in 5 | /// the generated file. The value for this is *.g.dart, where 6 | /// the star denotes the source file name. 7 | part 'server_configuration.g.dart'; 8 | 9 | @JsonSerializable() 10 | class ServerConfiguration extends Equatable { 11 | final bool? isAgreeDangerous; 12 | const ServerConfiguration({ 13 | this.isAgreeDangerous, 14 | }); 15 | 16 | factory ServerConfiguration.fromJson(Map json) => 17 | _$ServerConfigurationFromJson(json); 18 | 19 | Map toJson() => _$ServerConfigurationToJson(this); 20 | 21 | @override 22 | List get props => [isAgreeDangerous]; 23 | } 24 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/data/server/server_configuration.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'server_configuration.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ServerConfiguration _$ServerConfigurationFromJson(Map json) => 10 | ServerConfiguration( 11 | isAgreeDangerous: json['isAgreeDangerous'] as bool?, 12 | ); 13 | 14 | Map _$ServerConfigurationToJson( 15 | ServerConfiguration instance) => 16 | { 17 | 'isAgreeDangerous': instance.isAgreeDangerous, 18 | }; 19 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/property/property.dart: -------------------------------------------------------------------------------- 1 | export './src/property.dart'; 2 | export './src/property_manager.dart'; 3 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/property/src/property.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class Property extends Equatable { 4 | final String name; 5 | final String value; 6 | 7 | const Property({ 8 | required this.name, 9 | required this.value, 10 | }); 11 | 12 | Property copyWith({ 13 | String? name, 14 | String? value, 15 | }) { 16 | return Property( 17 | name: name ?? this.name, 18 | value: value ?? this.value, 19 | ); 20 | } 21 | 22 | @override 23 | List get props => [name, value]; 24 | } 25 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/property/src/property_manager.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:cube_api/src/property/src/property.dart'; 4 | import 'package:file/file.dart'; 5 | import 'package:file/local.dart'; 6 | 7 | class PropertyManager { 8 | const PropertyManager({FileSystem? fileSystem}) 9 | : _fileSystem = fileSystem ?? const LocalFileSystem(); 10 | final FileSystem _fileSystem; 11 | 12 | Stream loadProperty({required String filePath}) async* { 13 | File file = _fileSystem.file(filePath); 14 | if (!await file.exists()) return; 15 | final content = await file.readAsString(); 16 | final lines = const LineSplitter().convert(content); 17 | for (final line in lines) { 18 | if (line.startsWith('#')) continue; 19 | final keyValue = line.split('='); 20 | if (keyValue.length == 2) { 21 | final key = keyValue[0]; 22 | final value = keyValue[1]; 23 | yield Property(name: key, value: value); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/ticker/ticker.dart: -------------------------------------------------------------------------------- 1 | class Ticker { 2 | const Ticker(); 3 | Stream loop({required int period}) { 4 | return Stream.periodic(Duration(seconds: period), (x) => x); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/utilities/src/file.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:path/path.dart' as p; 3 | 4 | Future deleteDirectory(String path) async { 5 | final isAbsolute = p.isAbsolute(path); 6 | final prefix = Platform.isWindows && isAbsolute ? r'\\?\' : ''; 7 | await Directory(prefix + path).delete(recursive: true); 8 | } 9 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/utilities/src/process.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | /// Auto convert [stderr] and [stdout] to String? If any 4 | /// 5 | /// throws [StdoutException] when [exitCode] is not equal to 0 6 | String? transformProcessResult(ProcessResult result) { 7 | final stderr = result.stderr; 8 | final stdout = result.stdout; 9 | String? output; 10 | if (stderr is String && stderr.isNotEmpty) output = stderr; 11 | if (stdout is String && stdout.isNotEmpty) output = stdout; 12 | if (result.exitCode != 0) { 13 | throw StdoutException(output ?? ''); 14 | } 15 | return output; 16 | } 17 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/utilities/src/stream.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'package:async/async.dart'; 4 | 5 | Stream mergeStream( 6 | Stream> streamA, 7 | Stream> streamB, { 8 | StreamTransformer, String>? decoderA, 9 | StreamTransformer, String>? decoderB, 10 | }) { 11 | return StreamGroup.merge([ 12 | streamA.transform(decoderA ?? utf8.decoder), 13 | streamB.transform(decoderB ?? utf8.decoder), 14 | ]); 15 | } 16 | -------------------------------------------------------------------------------- /packages/cube_api/lib/src/utilities/utilities.dart: -------------------------------------------------------------------------------- 1 | export './src/stream.dart'; 2 | export './src/file.dart'; 3 | export './src/process.dart'; 4 | -------------------------------------------------------------------------------- /packages/cube_api/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cube_api 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | intl: ^0.17.0 17 | process: 18 | git: 19 | url: https://github.com/Tokenyet/process.dart.git 20 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 21 | test_utilities: 22 | path: ../test_utilities 23 | archive: ^3.2.2 24 | json_annotation: ^4.4.0 25 | async: ^2.8.2 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | flutter_lints: ^2.0.1 31 | mocktail: ^0.3.0 32 | build_runner: ^2.1.7 33 | json_serializable: ^6.1.4 34 | -------------------------------------------------------------------------------- /packages/cube_api/test/ticker/ticker_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:cube_api/src/ticker/ticker.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | group('Ticker', () { 6 | const ticker = Ticker(); 7 | group('loop', () { 8 | test('ticker emits 3 ticks from 6 seconds with period of 2', () async { 9 | int counter = 0; 10 | final sub = ticker.loop(period: 2).listen(((_) => counter++)); 11 | await Future.delayed(const Duration(seconds: 7)); 12 | await sub.cancel(); 13 | expect(counter, 3); 14 | }); 15 | test('ticker emits 2 ticks from 6 seconds with period of 3', () async { 16 | int counter = 0; 17 | final sub = ticker.loop(period: 3).listen(((_) => counter++)); 18 | await Future.delayed(const Duration(seconds: 7)); 19 | await sub.cancel(); 20 | expect(counter, 2); 21 | }); 22 | }); 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /packages/cube_properties_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/cube_properties_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/cube_properties_repository/lib/cube_properties_repository.dart: -------------------------------------------------------------------------------- 1 | library cube_properties_repository; 2 | 3 | export 'src/cube_properties_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/cube_properties_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cube_properties_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | test_utilities: 17 | path: ../test_utilities 18 | cube_api: 19 | path: ../cube_api 20 | 21 | dev_dependencies: 22 | flutter_test: 23 | sdk: flutter 24 | flutter_lints: ^2.0.1 25 | mocktail: ^0.3.0 26 | -------------------------------------------------------------------------------- /packages/duplicate_cleaner_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/duplicate_cleaner_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/duplicate_cleaner_repository/lib/duplicate_cleaner_repository.dart: -------------------------------------------------------------------------------- 1 | library duplicate_cleaner_repository; 2 | 3 | export 'src/duplicate_cleaner_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/duplicate_cleaner_repository/lib/src/duplicate_cleaner_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:file/file.dart'; 2 | import 'package:file/local.dart'; 3 | import 'package:path/path.dart'; 4 | 5 | class DuplicateCleanerRepository { 6 | DuplicateCleanerRepository({ 7 | FileSystem? fileSystem, 8 | }) : _fileSystem = fileSystem ?? const LocalFileSystem(); 9 | final FileSystem _fileSystem; 10 | // ignore: constant_identifier_names, non_constant_identifier_names 11 | final JAVA_PORTABLE_FOLDER = 'java'; 12 | 13 | Future deleteCubeJava() async { 14 | // target bin/cube_java 15 | final currentDir = _fileSystem.directory( 16 | join(_fileSystem.currentDirectory.path, JAVA_PORTABLE_FOLDER), 17 | ); 18 | if (!await currentDir.exists()) return; 19 | 20 | final files = []; 21 | final reg = RegExp(r'bin[\/|\\|]+cube_java[^\/|\\]*$'); 22 | await for (final entity in currentDir.list(recursive: true)) { 23 | if (entity is File) { 24 | final path = entity.path; 25 | if (reg.hasMatch(path)) files.add(entity); 26 | } 27 | } 28 | for (final file in files) { 29 | await file.delete(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/duplicate_cleaner_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: duplicate_cleaner_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | flutter_lints: ^2.0.1 27 | mocktail: ^0.3.0 28 | -------------------------------------------------------------------------------- /packages/eula_stage_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/eula_stage_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/eula_stage_repository/lib/eula_stage_repository.dart: -------------------------------------------------------------------------------- 1 | library eula_stage_repository; 2 | 3 | export 'src/eula_stage_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/eula_stage_repository/lib/src/eula_stage_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:file/file.dart'; 2 | import 'package:file/local.dart'; 3 | import 'package:intl/intl.dart'; 4 | import 'package:path/path.dart'; 5 | 6 | class EulaStageRepository { 7 | EulaStageRepository({ 8 | FileSystem? fileSystem, 9 | }) : _fileSystem = fileSystem ?? const LocalFileSystem(); 10 | final FileSystem _fileSystem; 11 | 12 | Future checkEulaAt({required String folder}) async { 13 | Directory dir = _fileSystem.directory(folder); 14 | if (!await dir.exists()) return false; 15 | File file = _fileSystem.file(join(folder, 'eula.txt')); 16 | if (!await file.exists()) return false; 17 | final content = await file.readAsString(); 18 | RegExp validEulaReg = RegExp(r'^eula=true\ *$', multiLine: true); 19 | return validEulaReg.hasMatch(content); 20 | } 21 | 22 | Future writeEulaAt({required String folder}) async { 23 | Directory dir = _fileSystem.directory(folder); 24 | if (!await dir.exists()) await dir.create(recursive: true); 25 | File file = _fileSystem.file(join(folder, 'eula.txt')); 26 | await file.create(); 27 | await file.writeAsString(_generateEulaTemplate()); 28 | } 29 | } 30 | 31 | String _generateEulaTemplate() { 32 | final currentCST = DateTime.now().toUtc().subtract(const Duration(hours: 6)); 33 | return '''#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula). 34 | #${DateFormat(r"EEE MMM d HH:mm:ss 'CST' yyyy").format(currentCST)} 35 | eula=true'''; 36 | } 37 | -------------------------------------------------------------------------------- /packages/eula_stage_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: eula_stage_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | test_utilities: 17 | path: ../test_utilities 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | flutter_lints: ^2.0.1 23 | mocktail: ^0.3.0 24 | -------------------------------------------------------------------------------- /packages/forge_installer_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/forge_installer_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/forge_installer_repository/lib/forge_installer_repository.dart: -------------------------------------------------------------------------------- 1 | library forge_installer_repository; 2 | 3 | export 'src/forge_installer_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/forge_installer_repository/lib/src/forge_installer_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:cube_api/cube_api.dart'; 2 | import 'package:path/path.dart'; 3 | import 'package:process/process.dart'; 4 | 5 | class ForgeInstallationException implements Exception {} 6 | 7 | class ForgeInstallerRepository { 8 | ForgeInstallerRepository({ 9 | ProcessManager? processManager, 10 | }) : _processManager = processManager ?? const LocalProcessManager(); 11 | final ProcessManager _processManager; 12 | 13 | Stream installForge({ 14 | required String javaExecutablePath, 15 | required JarArchiveInfo jarArchiveInfo, 16 | }) async* { 17 | if (jarArchiveInfo.type != JarType.forgeInstaller) return; 18 | final executable = jarArchiveInfo.executable; 19 | final p = await _processManager.start( 20 | [javaExecutablePath, '-jar', basename(executable), '--installServer'], 21 | runInShell: true, 22 | workingDirectory: dirname(executable), 23 | ); 24 | final stream = mergeStream(p.stdout, p.stderr); 25 | await for (final feedback in stream) { 26 | yield feedback; 27 | } 28 | final exitCode = await p.exitCode; 29 | p.kill(); 30 | 31 | if (exitCode != 0) throw ForgeInstallationException(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/forge_installer_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: forge_installer_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | test_utilities: 17 | path: ../test_utilities 18 | process: 19 | git: 20 | url: https://github.com/Tokenyet/process.dart.git 21 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 22 | cube_api: 23 | path: ../cube_api 24 | 25 | dev_dependencies: 26 | flutter_test: 27 | sdk: flutter 28 | flutter_lints: ^2.0.1 29 | mocktail: ^0.3.0 30 | -------------------------------------------------------------------------------- /packages/installer_creator_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/installer_creator_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/installer_creator_repository/lib/installer_creator_repository.dart: -------------------------------------------------------------------------------- 1 | library installer_creator_repository; 2 | 3 | export 'src/installer_creator_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/installer_creator_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: installer_creator_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | equatable: ^2.0.3 15 | path: ^1.8.0 16 | file: ^6.1.2 17 | intl: ^0.17.0 18 | dio: ^4.0.4 19 | test_utilities: 20 | path: ../test_utilities 21 | process: 22 | git: 23 | url: https://github.com/Tokenyet/process.dart.git 24 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 25 | cube_api: 26 | path: ../cube_api 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | flutter_lints: ^2.0.1 32 | mocktail: ^0.3.0 33 | -------------------------------------------------------------------------------- /packages/installer_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/installer_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/installer_repository/lib/installer_repository.dart: -------------------------------------------------------------------------------- 1 | library installer_repository; 2 | 3 | export 'src/installer_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/installer_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: installer_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | dio: ^4.0.4 17 | test_utilities: 18 | path: ../test_utilities 19 | process: 20 | git: 21 | url: https://github.com/Tokenyet/process.dart.git 22 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 23 | cube_api: 24 | path: ../cube_api 25 | archive: ^3.2.2 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | flutter_lints: ^2.0.1 31 | mocktail: ^0.3.0 32 | -------------------------------------------------------------------------------- /packages/jar_analyzer_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/jar_analyzer_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/jar_analyzer_repository/lib/jar_analyzer_repository.dart: -------------------------------------------------------------------------------- 1 | library jar_analyzer_repository; 2 | 3 | export 'src/jar_analyzer_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/jar_analyzer_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: jar_analyzer_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | platform: ^3.1.0 17 | test_utilities: 18 | path: ../test_utilities 19 | cube_api: 20 | path: ../cube_api 21 | 22 | dev_dependencies: 23 | flutter_test: 24 | sdk: flutter 25 | flutter_lints: ^2.0.1 26 | mocktail: ^0.3.0 27 | -------------------------------------------------------------------------------- /packages/java_duplicator_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/java_duplicator_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/java_duplicator_repository/lib/java_duplicator_repository.dart: -------------------------------------------------------------------------------- 1 | library java_duplicator_repository; 2 | 3 | export 'src/java_duplicator_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/java_duplicator_repository/lib/src/java_duplicator_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:file/file.dart'; 2 | import 'package:file/local.dart'; 3 | import 'package:path/path.dart' as p; 4 | 5 | class JavaDuplicatorRepository { 6 | JavaDuplicatorRepository({ 7 | FileSystem? fileSystem, 8 | }) : _fileSystem = fileSystem ?? const LocalFileSystem(); 9 | final FileSystem _fileSystem; 10 | 11 | Future cloneCubeJava({required String javaExecutablePath}) async { 12 | // target bin/cube_java 13 | if (javaExecutablePath == 'java') return javaExecutablePath; 14 | final file = _fileSystem.file( 15 | javaExecutablePath, 16 | ); 17 | if (!await file.exists()) return javaExecutablePath; 18 | 19 | final isContainExe = file.basename.contains('.exe'); 20 | final timestamp = DateTime.now().millisecondsSinceEpoch; 21 | final copiedFile = await file.copy( 22 | p.join(file.dirname, 'cube_java_$timestamp${isContainExe ? '.exe' : ''}'), 23 | ); 24 | // This MUST be absolute path. If this is relative path someday, reconsturct the test and relative pipeline... 25 | return copiedFile.absolute.path; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/java_duplicator_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: java_duplicator_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | flutter_lints: ^2.0.1 27 | mocktail: ^0.3.0 28 | -------------------------------------------------------------------------------- /packages/java_info_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/java_info_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/java_info_repository/lib/java_info_repository.dart: -------------------------------------------------------------------------------- 1 | library java_info_repository; 2 | 3 | export 'src/java_info_repository.dart'; 4 | export 'src/java_info.dart'; 5 | -------------------------------------------------------------------------------- /packages/java_info_repository/lib/src/java_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class JavaInfo extends Equatable { 4 | const JavaInfo({ 5 | required this.executablePaths, 6 | required this.name, 7 | this.output = '', 8 | }); 9 | final List executablePaths; 10 | final String name; 11 | final String output; 12 | 13 | @override 14 | List get props => [executablePaths, name, output]; 15 | 16 | JavaInfo copyWith({ 17 | List? executablePaths, 18 | String? name, 19 | String? output, 20 | }) { 21 | return JavaInfo( 22 | executablePaths: executablePaths ?? this.executablePaths, 23 | name: name ?? this.name, 24 | output: output ?? this.output, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/java_info_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: java_info_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | dart_ipify: ^1.1.1 23 | dio: ^4.0.4 24 | validators: ^3.0.0 25 | cube_api: 26 | path: ../cube_api 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | flutter_lints: ^2.0.1 32 | mocktail: ^0.3.0 33 | -------------------------------------------------------------------------------- /packages/java_printer_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/java_printer_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/java_printer_repository/lib/java_printer_repository.dart: -------------------------------------------------------------------------------- 1 | library java_printer_repository; 2 | 3 | export 'src/java_printer_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/java_printer_repository/lib/src/java_printer_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:process/process.dart'; 2 | 3 | class JavaPrinterRepository { 4 | const JavaPrinterRepository({ 5 | ProcessManager? processManager, 6 | }) : _processManager = processManager ?? const LocalProcessManager(); 7 | final ProcessManager _processManager; 8 | 9 | Future getVersionInfo({required String javaExecutablePath}) async { 10 | final result = await _processManager.run( 11 | [javaExecutablePath, '-version'], 12 | runInShell: true, 13 | includeParentEnvironment: true, 14 | ); 15 | final stdout = result.stdout; 16 | final stderr = result.stderr; 17 | if (result.exitCode != 0) { 18 | if (stderr != null && stderr is String && stderr.isNotEmpty) { 19 | throw Exception(stderr); 20 | } 21 | throw Exception('get version error'); 22 | } 23 | 24 | if (stdout is String && stdout.isNotEmpty) return stdout; 25 | if (stderr is String && stderr.isNotEmpty) return stderr; 26 | return 'missing version info...'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/java_printer_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: java_printer_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | flutter_lints: ^2.0.1 27 | mocktail: ^0.3.0 28 | -------------------------------------------------------------------------------- /packages/java_printer_repository/test/java_printer_repository_ig_test.dart: -------------------------------------------------------------------------------- 1 | @Tags(['integration']) 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:java_printer_repository/java_printer_repository.dart'; 4 | import 'package:process/process.dart'; 5 | 6 | void main() { 7 | group('JavaPrinterRepository', () { 8 | late ProcessManager processManager; 9 | late JavaPrinterRepository repository; 10 | 11 | setUp( 12 | () { 13 | processManager = const LocalProcessManager(); 14 | repository = JavaPrinterRepository( 15 | processManager: processManager, 16 | ); 17 | }, 18 | ); 19 | 20 | group('constructor', () { 21 | test('instantiates internal process when not injected', () { 22 | expect(const JavaPrinterRepository(), isNotNull); 23 | }); 24 | }); 25 | 26 | group('getJavaVersion', () { 27 | test('return correct java info', () async { 28 | expect( 29 | await repository.getVersionInfo(javaExecutablePath: 'java'), 30 | matches( 31 | RegExp(r'version \".*\"'), 32 | ), 33 | ); 34 | }); 35 | }); 36 | }); 37 | } 38 | -------------------------------------------------------------------------------- /packages/launcher_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/launcher_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/launcher_repository/lib/launcher_repository.dart: -------------------------------------------------------------------------------- 1 | library launcher_repository; 2 | 3 | export 'src/launcher_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/launcher_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: launcher_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | url_launcher: ^6.1.2 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | flutter_lints: ^2.0.1 28 | mocktail: ^0.3.0 29 | -------------------------------------------------------------------------------- /packages/launcher_repository/test/launcher_repository_ig_test.dart: -------------------------------------------------------------------------------- 1 | @Tags(['integration']) 2 | 3 | // This should be removed, once https://github.com/invertase/melos/issues/261 and https://github.com/flutter/flutter/issues/100467 sloved. 4 | 5 | import 'package:flutter_test/flutter_test.dart'; 6 | 7 | void main() { 8 | test('dummy test for melos#261 and flutter#100467', () {}); 9 | } 10 | -------------------------------------------------------------------------------- /packages/locale_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/locale_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/locale_repository/lib/locale_repository.dart: -------------------------------------------------------------------------------- 1 | library locale_repository; 2 | 3 | export 'src/locale_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/locale_repository/lib/src/locale_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:cube_api/cube_api.dart'; 4 | import 'package:file/file.dart'; 5 | import 'package:file/local.dart'; 6 | 7 | class LocaleRepository { 8 | const LocaleRepository({ 9 | FileSystem? fileSystem, 10 | PropertyManager? propertyManager, 11 | }) : _propertyManager = propertyManager ?? const PropertyManager(), 12 | _fileSystem = fileSystem ?? const LocalFileSystem(); 13 | final PropertyManager _propertyManager; 14 | final FileSystem _fileSystem; 15 | static const filename = 'lang.properties'; 16 | 17 | Future read() async { 18 | final properties = []; 19 | await for (final prop 20 | in _propertyManager.loadProperty(filePath: filename)) { 21 | properties.add(prop); 22 | } 23 | if (properties.isEmpty) return null; 24 | String? lang; 25 | String? country; 26 | for (final prop in properties) { 27 | if (prop.name == 'lang') { 28 | lang = prop.value; 29 | } 30 | if (prop.name == 'country') { 31 | country = prop.value; 32 | } 33 | } 34 | if (lang == null) return null; 35 | return Locale(lang, country); 36 | } 37 | 38 | Future write({required String lang, required String country}) async { 39 | String content = '# Language Configuration\n'; 40 | content += 'lang=$lang\n'; 41 | content += 'country=$country'; 42 | await _fileSystem.file(filename).create(); 43 | await _fileSystem.file(filename).writeAsString(content); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/locale_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: locale_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | test_utilities: 17 | path: ../test_utilities 18 | cube_api: 19 | path: ../cube_api 20 | 21 | dev_dependencies: 22 | flutter_test: 23 | sdk: flutter 24 | flutter_lints: ^2.0.1 25 | mocktail: ^0.3.0 26 | -------------------------------------------------------------------------------- /packages/network_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/network_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/network_repository/lib/network_repository.dart: -------------------------------------------------------------------------------- 1 | library network_repository; 2 | 3 | export 'src/network_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/network_repository/lib/src/network_interface_wrapper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | class NetworkInterfaceWrapper { 4 | const NetworkInterfaceWrapper(); 5 | 6 | /// Whether the [list] method is supported. 7 | /// 8 | /// The [list] method is currently unsupported on Android. 9 | bool get supported => NetworkInterface.listSupported; 10 | 11 | /// Query the system for [NetworkInterface]s. 12 | /// 13 | /// If [includeLoopback] is `true`, the returned list will include the 14 | /// loopback device. Default is `false`. 15 | /// 16 | /// If [includeLinkLocal] is `true`, the list of addresses of the returned 17 | /// [NetworkInterface]s, may include link local addresses. Default is `false`. 18 | /// 19 | /// If [type] is either [InternetAddressType.IPv4] or 20 | /// [InternetAddressType.IPv6] it will only lookup addresses of the 21 | /// specified type. Default is [InternetAddressType.any]. 22 | Future> list({ 23 | bool includeLoopback = false, 24 | bool includeLinkLocal = false, 25 | InternetAddressType type = InternetAddressType.any, 26 | }) async { 27 | return NetworkInterface.list( 28 | includeLinkLocal: includeLinkLocal, 29 | includeLoopback: includeLoopback, 30 | type: type, 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/network_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: network_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | dart_ipify: ^1.1.1 23 | dio: ^4.0.4 24 | validators: ^3.0.0 25 | 26 | dev_dependencies: 27 | flutter_test: 28 | sdk: flutter 29 | flutter_lints: ^2.0.1 30 | mocktail: ^0.3.0 31 | -------------------------------------------------------------------------------- /packages/picker_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/picker_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/picker_repository/lib/picker_repository.dart: -------------------------------------------------------------------------------- 1 | library picker_repository; 2 | 3 | export 'src/picker_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/picker_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: picker_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | test_utilities: 17 | path: ../test_utilities 18 | cube_api: 19 | path: ../cube_api 20 | file_picker: ^4.4.0 21 | 22 | dev_dependencies: 23 | flutter_test: 24 | sdk: flutter 25 | flutter_lints: ^2.0.1 26 | mocktail: ^0.3.0 27 | -------------------------------------------------------------------------------- /packages/picker_repository/test/picker_repository_ig_test.dart: -------------------------------------------------------------------------------- 1 | @Tags(['integration']) 2 | 3 | // This should be removed, once https://github.com/invertase/melos/issues/261 and https://github.com/flutter/flutter/issues/100467 sloved. 4 | 5 | import 'package:flutter_test/flutter_test.dart'; 6 | 7 | void main() { 8 | test('dummy test for melos#261 and flutter#100467', () {}); 9 | } 10 | -------------------------------------------------------------------------------- /packages/process_cleaner_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/process_cleaner_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/process_cleaner_repository/lib/process_cleaner_repository.dart: -------------------------------------------------------------------------------- 1 | library process_cleaner_repository; 2 | 3 | export 'src/process_cleaner_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/process_cleaner_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: process_cleaner_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | flutter_lints: ^2.0.1 27 | mocktail: ^0.3.0 28 | -------------------------------------------------------------------------------- /packages/server_configuration_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/server_configuration_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/server_configuration_repository/lib/server_configuration_repository.dart: -------------------------------------------------------------------------------- 1 | library server_configuration_repository; 2 | 3 | export 'src/server_configuration_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/server_configuration_repository/lib/src/server_configuration_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:cube_api/cube_api.dart'; 4 | import 'package:file/file.dart'; 5 | import 'package:file/local.dart'; 6 | import 'package:path/path.dart' as p; 7 | 8 | class ServerConfigurationRepository { 9 | ServerConfigurationRepository({ 10 | FileSystem? fileSystem, 11 | }) : _fileSystem = fileSystem ?? const LocalFileSystem(); 12 | final FileSystem _fileSystem; 13 | 14 | Future getConfiguration({ 15 | required String directory, 16 | }) async { 17 | final file = _fileSystem.file( 18 | p.join(directory, 'cube.conf'), 19 | ); 20 | if (!await file.exists()) return null; 21 | return ServerConfiguration.fromJson( 22 | jsonDecode(await file.readAsString()), 23 | ); 24 | } 25 | 26 | Future saveConfiguration({ 27 | required String directory, 28 | required ServerConfiguration configuration, 29 | }) async { 30 | final file = _fileSystem.file( 31 | p.join(directory, 'cube.conf'), 32 | ); 33 | await file.create(recursive: true); 34 | await file.writeAsString(jsonEncode(configuration.toJson())); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/server_configuration_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: server_configuration_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | test_utilities: 17 | path: ../test_utilities 18 | cube_api: 19 | path: ../cube_api 20 | 21 | dev_dependencies: 22 | flutter_test: 23 | sdk: flutter 24 | flutter_lints: ^2.0.1 25 | mocktail: ^0.3.0 26 | -------------------------------------------------------------------------------- /packages/server_management_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/server_management_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/server_management_repository/lib/server_management_repository.dart: -------------------------------------------------------------------------------- 1 | library server_management_repository; 2 | 3 | export 'src/server_management_repository.dart'; 4 | export 'src/installer_file.dart'; 5 | -------------------------------------------------------------------------------- /packages/server_management_repository/lib/src/installer_file.dart: -------------------------------------------------------------------------------- 1 | import 'package:cube_api/cube_api.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | 4 | class InstallerFile extends Equatable { 5 | final Installer installer; 6 | final String path; 7 | const InstallerFile({ 8 | required this.installer, 9 | required this.path, 10 | }); 11 | 12 | @override 13 | List get props => [installer, path]; 14 | } 15 | -------------------------------------------------------------------------------- /packages/server_management_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: server_management_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | dio: ^4.0.4 17 | test_utilities: 18 | path: ../test_utilities 19 | process: 20 | git: 21 | url: https://github.com/Tokenyet/process.dart.git 22 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 23 | cube_api: 24 | path: ../cube_api 25 | jar_analyzer_repository: 26 | path: ../jar_analyzer_repository 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | flutter_lints: ^2.0.1 32 | mocktail: ^0.3.0 33 | -------------------------------------------------------------------------------- /packages/server_properties_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/server_properties_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/server_properties_repository/lib/server_properties_repository.dart: -------------------------------------------------------------------------------- 1 | library server_properties_repository; 2 | 3 | export 'src/server_properties_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/server_properties_repository/lib/src/server_properties_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:cube_api/cube_api.dart'; 2 | import 'package:file/file.dart'; 3 | import 'package:file/local.dart'; 4 | import 'package:intl/intl.dart'; 5 | import 'package:path/path.dart' as p; 6 | 7 | class ServerPropertiesRepository { 8 | ServerPropertiesRepository({ 9 | FileSystem? fileSystem, 10 | PropertyManager? propertyManager, 11 | }) : _propertyManager = propertyManager ?? const PropertyManager(), 12 | _fileSystem = fileSystem ?? const LocalFileSystem(); 13 | final PropertyManager _propertyManager; 14 | final FileSystem _fileSystem; 15 | 16 | Stream getProperties({required String directory}) { 17 | return _propertyManager.loadProperty( 18 | filePath: p.join(directory, 'server.properties'), 19 | ); 20 | } 21 | 22 | Future saveProperties({ 23 | required String directory, 24 | required Iterable properties, 25 | }) async { 26 | final currentCST = 27 | DateTime.now().toUtc().subtract(const Duration(hours: 6)); 28 | final serverPropertiesFile = 29 | _fileSystem.file(p.join(directory, 'server.properties')); 30 | String result = 31 | '# Minecraft server properties (Managed by MinecraftCube)\n# ${DateFormat(r"EEE MMM d HH:mm:ss 'CST' yyyy").format(currentCST)}\n'; 32 | for (final prop in properties) { 33 | result += '${prop.name}=${prop.value}\n'; 34 | } 35 | await serverPropertiesFile.writeAsString(result); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/server_properties_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: server_properties_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | test_utilities: 17 | path: ../test_utilities 18 | cube_api: 19 | path: ../cube_api 20 | 21 | dev_dependencies: 22 | flutter_test: 23 | sdk: flutter 24 | flutter_lints: ^2.0.1 25 | mocktail: ^0.3.0 26 | -------------------------------------------------------------------------------- /packages/server_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/server_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/server_repository/env.bat: -------------------------------------------------------------------------------- 1 | set /p DART_TEST_RESOURCES="Set resources location:" 2 | set /p JAVA_VERSION="Set java version:" 3 | set /p JAVA_8="Set java 8 location:" 4 | set /p JAVA_17="Set java 17 location:" -------------------------------------------------------------------------------- /packages/server_repository/lib/server_repository.dart: -------------------------------------------------------------------------------- 1 | library server_repository; 2 | 3 | export 'src/server_repository.dart'; 4 | -------------------------------------------------------------------------------- /packages/server_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: server_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | intl: ^0.17.0 16 | dio: ^4.0.4 17 | test_utilities: 18 | path: ../test_utilities 19 | process: 20 | git: 21 | url: https://github.com/Tokenyet/process.dart.git 22 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 23 | cube_api: 24 | path: ../cube_api 25 | 26 | dev_dependencies: 27 | flutter_test: 28 | sdk: flutter 29 | flutter_lints: ^2.0.1 30 | mocktail: ^0.3.0 31 | -------------------------------------------------------------------------------- /packages/server_repository/test/consts.dart: -------------------------------------------------------------------------------- 1 | class TestEnviroments { 2 | static String javaVersion = 'JAVA_VERSION'; 3 | static String java8Path = 'JAVA_8'; 4 | static String java17Path = 'JAVA_17'; 5 | } 6 | -------------------------------------------------------------------------------- /packages/system_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/system_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/system_repository/lib/src/cpu_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class CpuInfo extends Equatable { 4 | const CpuInfo({ 5 | this.name = '', 6 | this.load = -1, 7 | }); 8 | final String name; 9 | final double load; 10 | 11 | @override 12 | List get props => [name, load]; 13 | 14 | CpuInfo copyWith({ 15 | String? name, 16 | double? load, 17 | }) { 18 | return CpuInfo( 19 | name: name ?? this.name, 20 | load: load ?? this.load, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/system_repository/lib/src/memory_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class MemoryInfo extends Equatable { 4 | final double? totalSize; 5 | final double? freeSize; 6 | const MemoryInfo({ 7 | this.totalSize = -1, 8 | this.freeSize = -1, 9 | }); 10 | 11 | MemoryInfo copyWith({ 12 | double? totalSize, 13 | double? freeSize, 14 | }) { 15 | return MemoryInfo( 16 | totalSize: totalSize ?? this.totalSize, 17 | freeSize: freeSize ?? this.freeSize, 18 | ); 19 | } 20 | 21 | @override 22 | List get props => [totalSize, freeSize]; 23 | } 24 | -------------------------------------------------------------------------------- /packages/system_repository/lib/system_repository.dart: -------------------------------------------------------------------------------- 1 | library system_repository; 2 | 3 | export 'src/system_repository.dart'; 4 | export 'src/cpu_info.dart'; 5 | export 'src/memory_info.dart'; 6 | -------------------------------------------------------------------------------- /packages/system_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: system_repository 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | dart_ipify: ^1.1.1 23 | dio: ^4.0.4 24 | validators: ^3.0.0 25 | cube_api: 26 | path: ../cube_api 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | flutter_lints: ^2.0.1 32 | mocktail: ^0.3.0 33 | -------------------------------------------------------------------------------- /packages/system_repository/test/system_repository_ig_test.dart: -------------------------------------------------------------------------------- 1 | @Tags(['integration']) 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:system_repository/src/system_repository.dart'; 5 | 6 | void main() { 7 | group('SystemRepository (integration not sure)', () { 8 | late SystemRepository repository; 9 | 10 | setUp( 11 | () { 12 | repository = const SystemRepository(); 13 | }, 14 | ); 15 | 16 | group('constructor', () { 17 | test('instantiates internal process when not injected', () { 18 | expect(const SystemRepository(), isNotNull); 19 | }); 20 | }); 21 | 22 | group('getCpuInfo', () { 23 | test('return correct CpuInfo', () async { 24 | final cpu = await repository.getCpuInfo(); 25 | expect( 26 | cpu.name, 27 | isNotEmpty, 28 | ); 29 | expect( 30 | cpu.load, 31 | greaterThan(0), 32 | ); 33 | }); 34 | }); 35 | group('getMemoryInfo', () { 36 | test('return correct MemoryInfo', () async { 37 | final memoryInfo = await repository.getMemoryInfo(); 38 | expect( 39 | memoryInfo.freeSize, 40 | greaterThan(0), 41 | ); 42 | expect(memoryInfo.totalSize, greaterThan(0)); 43 | }); 44 | }); 45 | group('getGpuInfo', () { 46 | test('return correct GpuName (nogui?)', () async { 47 | expect( 48 | await repository.getGpuInfo(), 49 | isNotEmpty, 50 | ); 51 | }); 52 | }); 53 | }); 54 | } 55 | -------------------------------------------------------------------------------- /packages/test_utilities/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/test_utilities/lib/src/test_resource_server.dart: -------------------------------------------------------------------------------- 1 | // import 'dart:io'; 2 | 3 | import 'package:dhttpd/dhttpd.dart'; 4 | import 'package:meta/meta.dart'; 5 | // import 'package:path/path.dart'; 6 | 7 | class TestResourceServer { 8 | late final Dhttpd httpServer; 9 | late final String rootPath; 10 | final int port; 11 | TestResourceServer(this.port, this.rootPath); 12 | @mustCallSuper 13 | Future init() async { 14 | httpServer = await Dhttpd.start(path: rootPath, port: port); 15 | } 16 | 17 | @mustCallSuper 18 | Future dispose() async { 19 | await httpServer.destroy(); 20 | } 21 | 22 | String getUrl(String relativeFilePath, {bool useHttpPrefix = true}) { 23 | final prefix = useHttpPrefix ? 'http://' : ''; 24 | return '$prefix${httpServer.host}:${httpServer.port}/$relativeFilePath'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/test_utilities/lib/src/test_utilities.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io' as io; 2 | 3 | import 'package:file/file.dart'; 4 | import 'package:file/local.dart'; 5 | import 'package:path/path.dart'; 6 | 7 | // ignore: constant_identifier_names 8 | const _TEMP = 'DART_TEST_TEMP'; 9 | // ignore: constant_identifier_names 10 | const _RESOURCES = 'DART_TEST_RESOURCES'; 11 | 12 | class TestUtilities { 13 | factory TestUtilities() { 14 | return _singleton; 15 | } 16 | 17 | TestUtilities._internal() { 18 | rootTemp = io.Platform.environment[_TEMP] ?? 19 | join(io.Directory.current.path, 'test_temp'); 20 | rootResources = io.Platform.environment[_RESOURCES] ?? 21 | join(io.Directory.current.path, 'test_resources'); 22 | _system = const LocalFileSystem(); 23 | } 24 | 25 | Directory getTestProjectDir({required String name}) { 26 | return _system.directory(join(rootTemp, name)); 27 | } 28 | 29 | static final TestUtilities _singleton = TestUtilities._internal(); 30 | 31 | late final FileSystem _system; 32 | late final String rootTemp; 33 | late final String rootResources; 34 | } 35 | -------------------------------------------------------------------------------- /packages/test_utilities/lib/test_utilities.dart: -------------------------------------------------------------------------------- 1 | library test_utilities; 2 | 3 | export 'src/test_utilities.dart'; 4 | export 'src/process_terminator.dart'; 5 | export 'src/test_resource_server.dart'; 6 | export 'package:io/io.dart' hide ProcessManager; 7 | -------------------------------------------------------------------------------- /packages/test_utilities/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: test_utilities 2 | description: A Dart Repository which the process cleanup domain. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | io: 1.0.3 21 | dhttpd: ^4.0.1 22 | meta: ^1.7.0 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | flutter_lints: ^2.0.1 28 | mocktail: ^0.3.0 29 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | library_prefixes: false 6 | omit_local_variable_types: false 7 | require_trailing_commas: true 8 | # prefer_relative_imports: false 9 | # lines_longer_than_80_chars: false 10 | # public_member_api_docs: false 11 | # avoid_types_on_closure_parameters: false 12 | analyzer: 13 | exclude: [lib/**.g.dart, test/**.mocks.dart] 14 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/dart_test.yaml: -------------------------------------------------------------------------------- 1 | file_reporters: 2 | json: reports/test-results.json 3 | tags: 4 | utility: 5 | repository: 6 | page: 7 | component: 8 | slow: 9 | unittest: 10 | integration: 11 | widget: 12 | debug: 13 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_manifest/vanilla_manifest.dart: -------------------------------------------------------------------------------- 1 | export './vanilla_manifest_info.dart'; 2 | export './vanilla_manifest_version_info.dart'; 3 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_manifest/vanilla_manifest_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | import 'package:vanilla_server_repository/vanilla_server_repository.dart'; 4 | 5 | part 'vanilla_manifest_info.g.dart'; 6 | 7 | @JsonSerializable() 8 | class VanillaManifestInfo extends Equatable { 9 | const VanillaManifestInfo({ 10 | required this.versions, 11 | }); 12 | final List versions; 13 | 14 | factory VanillaManifestInfo.fromJson(Map json) => 15 | _$VanillaManifestInfoFromJson(json); 16 | 17 | Map toJson() => _$VanillaManifestInfoToJson(this); 18 | 19 | @override 20 | List get props => [versions]; 21 | } 22 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_manifest/vanilla_manifest_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vanilla_manifest_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | VanillaManifestInfo _$VanillaManifestInfoFromJson(Map json) => 10 | VanillaManifestInfo( 11 | versions: (json['versions'] as List) 12 | .map((e) => 13 | VanillaManifestVersionInfo.fromJson(e as Map)) 14 | .toList(), 15 | ); 16 | 17 | Map _$VanillaManifestInfoToJson( 18 | VanillaManifestInfo instance) => 19 | { 20 | 'versions': instance.versions, 21 | }; 22 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_manifest/vanilla_manifest_version_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'vanilla_manifest_version_info.g.dart'; 5 | 6 | @JsonSerializable() 7 | class VanillaManifestVersionInfo extends Equatable { 8 | const VanillaManifestVersionInfo({ 9 | required this.id, 10 | required this.type, 11 | required this.url, 12 | required this.time, 13 | required this.releaseTime, 14 | }); 15 | final String id; 16 | final String type; 17 | final String url; 18 | final DateTime time; 19 | final DateTime releaseTime; 20 | 21 | factory VanillaManifestVersionInfo.fromJson(Map json) => 22 | _$VanillaManifestVersionInfoFromJson(json); 23 | 24 | Map toJson() => _$VanillaManifestVersionInfoToJson(this); 25 | 26 | @override 27 | List get props { 28 | return [ 29 | id, 30 | type, 31 | url, 32 | time, 33 | releaseTime, 34 | ]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_manifest/vanilla_manifest_version_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vanilla_manifest_version_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | VanillaManifestVersionInfo _$VanillaManifestVersionInfoFromJson( 10 | Map json) => 11 | VanillaManifestVersionInfo( 12 | id: json['id'] as String, 13 | type: json['type'] as String, 14 | url: json['url'] as String, 15 | time: DateTime.parse(json['time'] as String), 16 | releaseTime: DateTime.parse(json['releaseTime'] as String), 17 | ); 18 | 19 | Map _$VanillaManifestVersionInfoToJson( 20 | VanillaManifestVersionInfo instance) => 21 | { 22 | 'id': instance.id, 23 | 'type': instance.type, 24 | 'url': instance.url, 25 | 'time': instance.time.toIso8601String(), 26 | 'releaseTime': instance.releaseTime.toIso8601String(), 27 | }; 28 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server/vanilla_server.dart: -------------------------------------------------------------------------------- 1 | export './vanilla_server_info.dart'; 2 | export './vanilla_server_downloads_info.dart'; 3 | export './vanilla_server_downloads_server_info.dart'; 4 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server/vanilla_server_downloads_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | import 'package:vanilla_server_repository/vanilla_server_repository.dart'; 4 | 5 | part 'vanilla_server_downloads_info.g.dart'; 6 | 7 | @JsonSerializable() 8 | class VanillaServerDownloadsInfo extends Equatable { 9 | const VanillaServerDownloadsInfo({ 10 | required this.server, 11 | }); 12 | final VanillaServerDownloadsServerInfo server; 13 | 14 | factory VanillaServerDownloadsInfo.fromJson(Map json) => 15 | _$VanillaServerDownloadsInfoFromJson(json); 16 | 17 | Map toJson() => _$VanillaServerDownloadsInfoToJson(this); 18 | 19 | @override 20 | List get props => [server]; 21 | } 22 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server/vanilla_server_downloads_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vanilla_server_downloads_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | VanillaServerDownloadsInfo _$VanillaServerDownloadsInfoFromJson( 10 | Map json) => 11 | VanillaServerDownloadsInfo( 12 | server: VanillaServerDownloadsServerInfo.fromJson( 13 | json['server'] as Map), 14 | ); 15 | 16 | Map _$VanillaServerDownloadsInfoToJson( 17 | VanillaServerDownloadsInfo instance) => 18 | { 19 | 'server': instance.server, 20 | }; 21 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server/vanilla_server_downloads_server_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'vanilla_server_downloads_server_info.g.dart'; 5 | 6 | @JsonSerializable() 7 | class VanillaServerDownloadsServerInfo extends Equatable { 8 | const VanillaServerDownloadsServerInfo({ 9 | required this.sha1, 10 | required this.size, 11 | required this.url, 12 | }); 13 | 14 | final String sha1; 15 | final int size; 16 | final String url; 17 | 18 | factory VanillaServerDownloadsServerInfo.fromJson( 19 | Map json, 20 | ) => 21 | _$VanillaServerDownloadsServerInfoFromJson(json); 22 | 23 | Map toJson() => 24 | _$VanillaServerDownloadsServerInfoToJson(this); 25 | 26 | @override 27 | List get props => [sha1, size, url]; 28 | } 29 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server/vanilla_server_downloads_server_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vanilla_server_downloads_server_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | VanillaServerDownloadsServerInfo _$VanillaServerDownloadsServerInfoFromJson( 10 | Map json) => 11 | VanillaServerDownloadsServerInfo( 12 | sha1: json['sha1'] as String, 13 | size: json['size'] as int, 14 | url: json['url'] as String, 15 | ); 16 | 17 | Map _$VanillaServerDownloadsServerInfoToJson( 18 | VanillaServerDownloadsServerInfo instance) => 19 | { 20 | 'sha1': instance.sha1, 21 | 'size': instance.size, 22 | 'url': instance.url, 23 | }; 24 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server/vanilla_server_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | import 'package:vanilla_server_repository/vanilla_server_repository.dart'; 4 | 5 | part 'vanilla_server_info.g.dart'; 6 | 7 | @JsonSerializable() 8 | class VanillaServerInfo extends Equatable { 9 | const VanillaServerInfo({ 10 | required this.downloads, 11 | }); 12 | 13 | final VanillaServerDownloadsInfo downloads; 14 | 15 | factory VanillaServerInfo.fromJson(Map json) => 16 | _$VanillaServerInfoFromJson(json); 17 | 18 | Map toJson() => _$VanillaServerInfoToJson(this); 19 | 20 | @override 21 | List get props => [downloads]; 22 | } 23 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server/vanilla_server_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vanilla_server_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | VanillaServerInfo _$VanillaServerInfoFromJson(Map json) => 10 | VanillaServerInfo( 11 | downloads: VanillaServerDownloadsInfo.fromJson( 12 | json['downloads'] as Map), 13 | ); 14 | 15 | Map _$VanillaServerInfoToJson(VanillaServerInfo instance) => 16 | { 17 | 'downloads': instance.downloads, 18 | }; 19 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/src/vanilla_server_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:vanilla_server_repository/vanilla_server_repository.dart'; 3 | 4 | class VanillaServerRepository { 5 | VanillaServerRepository({ 6 | Dio? dio, 7 | }) : dio = dio ?? Dio(); 8 | 9 | static const _manifestUrl = 10 | 'https://launchermeta.mojang.com/mc/game/version_manifest_v2.json'; 11 | 12 | final Dio dio; 13 | 14 | Future> getServers() async { 15 | final response = await dio.get(_manifestUrl); 16 | 17 | final vanillaManifestInfo = VanillaManifestInfo.fromJson(response.data); 18 | 19 | return vanillaManifestInfo.versions; 20 | } 21 | 22 | Future getServerByVersionInfo({ 23 | required String url, 24 | }) async { 25 | final response = await dio.get(url); 26 | 27 | final vanillaServerInfo = VanillaServerInfo.fromJson(response.data); 28 | 29 | return vanillaServerInfo.downloads.server; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/lib/vanilla_server_repository.dart: -------------------------------------------------------------------------------- 1 | library vanilla_server_repository; 2 | 3 | export 'src/vanilla_server_repository.dart'; 4 | export 'src/vanilla_manifest/vanilla_manifest.dart'; 5 | export 'src/vanilla_server/vanilla_server.dart'; 6 | -------------------------------------------------------------------------------- /packages/vanilla_server_repository/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: vanilla_server_repository 2 | description: A Dart Repository which fetching data from vanilla. 3 | 4 | publish_to: none 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.14.0 <3.0.0" 10 | 11 | dependencies: 12 | equatable: ^2.0.3 13 | path: ^1.8.0 14 | file: ^6.1.2 15 | platform: ^3.1.0 16 | process: 17 | git: 18 | url: https://github.com/Tokenyet/process.dart.git 19 | ref: 9a9b873604a0c8f58d1419e160146885fd8392b6 20 | test_utilities: 21 | path: ../test_utilities 22 | dart_ipify: ^1.1.1 23 | dio: ^4.0.4 24 | validators: ^3.0.0 25 | cube_api: 26 | path: ../cube_api 27 | json_annotation: ^4.7.0 28 | 29 | dev_dependencies: 30 | flutter_test: 31 | sdk: flutter 32 | flutter_lints: ^2.0.1 33 | mocktail: ^0.3.0 34 | build_runner: ^2.1.7 35 | json_serializable: ^6.1.4 36 | -------------------------------------------------------------------------------- /release_dependencies/changelog.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /release_dependencies/history.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /release_dependencies/info.yml: -------------------------------------------------------------------------------- 1 | version: 0.1.0 2 | -------------------------------------------------------------------------------- /release_dependencies/java.yml: -------------------------------------------------------------------------------- 1 | - 16: 2 | windows: https://cdn.azul.com/zulu/bin/zulu16.32.15-ca-jdk16.0.2-win_x64.zip 3 | linux: https://cdn.azul.com/zulu/bin/zulu16.32.15-ca-jdk16.0.2-linux_x64.tar.gz 4 | macos: https://cdn.azul.com/zulu/bin/zulu16.32.15-ca-jdk16.0.2-macosx_x64.tar.gz 5 | - 8: 6 | windows: https://cdn.azul.com/zulu/bin/zulu8.56.0.21-ca-jdk8.0.302-win_x64.zip 7 | linux: https://cdn.azul.com/zulu/bin/zulu8.56.0.21-ca-jdk8.0.302-linux_x64.tar.gz 8 | macos: https://cdn.azul.com/zulu/bin/zulu8.56.0.21-ca-jdk8.0.302-macosx_x64.tar.gz 9 | -------------------------------------------------------------------------------- /resources/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/resources/about.png -------------------------------------------------------------------------------- /resources/about_me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/resources/about_me.png -------------------------------------------------------------------------------- /resources/forum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/resources/forum.png -------------------------------------------------------------------------------- /resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/resources/logo.png -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "minecraft_cube_desktop", 3 | "short_name": "minecraft_cube_desktop", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | DesktopWindowPluginRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("DesktopWindowPlugin")); 16 | UrlLauncherWindowsRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 18 | WindowSizePluginRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("WindowSizePlugin")); 20 | } 21 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | desktop_window 7 | url_launcher_windows 8 | window_size 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } else { 15 | AllocConsole(); 16 | ShowWindow(GetConsoleWindow(), SW_HIDE); 17 | } 18 | 19 | // Initialize COM, so that it is available for use in the library and/or 20 | // plugins. 21 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(project); 31 | Win32Window::Point origin(10, 10); 32 | Win32Window::Size size(1280, 720); 33 | if (!window.CreateAndShow(L"minecraft_cube_desktop", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | ::MSG msg; 39 | while (::GetMessage(&msg, nullptr, 0, 0)) { 40 | ::TranslateMessage(&msg); 41 | ::DispatchMessage(&msg); 42 | } 43 | 44 | ::CoUninitialize(); 45 | return EXIT_SUCCESS; 46 | } 47 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinecraftCube/MinecraftCubeDesktop/326eeedf3de537896ff5053c590fef21625707ec/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows_local_dev_setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set PROJECT_PATH=%CD% 4 | set DART_TEST_RESOURCES=%PROJECT_PATH%\minimal_resources 5 | set JAVA_17=%PROJECT_PATH%\zulu17.32.13-ca-jdk17.0.2-win_x64\bin\java.exe 6 | set JAVA_8=%PROJECT_PATH%\zulu8.60.0.21-ca-jdk8.0.322-win_x64\bin\java.exe 7 | set JAVA_VERSION=pass 8 | -------------------------------------------------------------------------------- /windows_local_full_setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | curl https://dl.dropboxusercontent.com/s/i0s17qbooewf8le/minimal_resources.zip -o minimal_resources.zip 4 | 5 | tar -xf minimal_resources.zip 6 | 7 | set PROJECT_PATH=%CD% 8 | set DART_TEST_RESOURCES=%PROJECT_PATH%\minimal_resources 9 | 10 | echo Project Path=%PROJECT_PATH% 11 | echo TEST RESOURCES: %DART_TEST_RESOURCES% 12 | 13 | 14 | curl https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-win_x64.zip -o java17.zip 15 | tar -xf java17.zip 16 | set JAVA_17=%PROJECT_PATH%\zulu17.32.13-ca-jdk17.0.2-win_x64\bin\java.exe 17 | 18 | 19 | curl https://cdn.azul.com/zulu/bin/zulu8.60.0.21-ca-jdk8.0.322-win_x64.zip -o java8.zip 20 | tar -xf java8.zip 21 | set JAVA_8=%PROJECT_PATH%\zulu8.60.0.21-ca-jdk8.0.322-win_x64\bin\java.exe 22 | 23 | set JAVA_VERSION=pass 24 | --------------------------------------------------------------------------------