From a44d82fd0d7d94d176cd8107ff8d6d3d52a330fd Mon Sep 17 00:00:00 2001 From: alves Date: Mon, 19 Jan 2026 14:22:36 +0800 Subject: [PATCH 01/20] feature remove not work code. --- src/slic3r/GUI/MsgDialog.cpp | 2 +- src/slic3r/GUI/ReleaseNote.cpp | 12 ------------ src/slic3r/GUI/UpdateDialogs.cpp | 4 ++-- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 31cff49156..f16795e8fd 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -172,7 +172,7 @@ Button* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, con btn->SetFocus(); btn_sizer->Add(btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(ButtonProps::ChoiceButtonGap())); btn->Bind(wxEVT_BUTTON, [this, btn_id](wxCommandEvent&) { EndModal(btn_id); }); - + btn->SetCursor(wxCURSOR_HAND); MsgButton *mb = new MsgButton; ButtonData *bd = new ButtonData; diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index f67f9a5d05..89df735d90 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -511,18 +511,6 @@ void UpdateVersionDialog::update_version_info(wxString release_note, wxString ve //bbs check whether the web display is used bool use_web_link = false; url_line = ""; - // Orca: not used in Orca Slicer - // auto split_array = splitWithStl(release_note.ToStdString(), "###"); - // if (split_array.size() >= 3) { - // for (auto i = 0; i < split_array.size(); i++) { - // std::string url = split_array[i]; - // if (std::strstr(url.c_str(), "http://") != NULL || std::strstr(url.c_str(), "https://") != NULL) { - // use_web_link = true; - // url_line = url; - // break; - // } - // } - // } if (use_web_link) { m_brand->Hide(); diff --git a/src/slic3r/GUI/UpdateDialogs.cpp b/src/slic3r/GUI/UpdateDialogs.cpp index 6f7c88151f..85d309a03b 100644 --- a/src/slic3r/GUI/UpdateDialogs.cpp +++ b/src/slic3r/GUI/UpdateDialogs.cpp @@ -154,7 +154,7 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector &updates, bool force_ m_butto_ok->SetFont(Label::Body_12); m_butto_ok->SetSize(wxSize(FromDIP(58), FromDIP(24))); m_butto_ok->SetMinSize(wxSize(FromDIP(58), FromDIP(24))); - + m_butto_ok->SetCursor(wxCURSOR_HAND); auto m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel->SetBackgroundColor(*wxWHITE); @@ -162,7 +162,7 @@ MsgUpdateConfig::MsgUpdateConfig(const std::vector &updates, bool force_ m_button_cancel->SetFont(Label::Body_12); m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24))); m_button_cancel->SetMinSize(wxSize(FromDIP(58), FromDIP(24))); - + m_button_cancel->SetCursor(wxCURSOR_HAND); sizer_button->Add(m_butto_ok, 0, wxALL, 5); sizer_button->Add(m_button_cancel, 0, wxALL, 5); From df5a423231eb92c9b924d3c58d78cb2befc946d1 Mon Sep 17 00:00:00 2001 From: alves Date: Wed, 21 Jan 2026 19:19:24 +0800 Subject: [PATCH 02/20] feature fix browser not get privacy flags bug. --- src/slic3r/GUI/SSWCP.cpp | 30 +++++++++++++++++++++++++----- src/slic3r/GUI/SSWCP.hpp | 6 +----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/SSWCP.cpp b/src/slic3r/GUI/SSWCP.cpp index bba9c19414..dde47f36ff 100644 --- a/src/slic3r/GUI/SSWCP.cpp +++ b/src/slic3r/GUI/SSWCP.cpp @@ -1421,7 +1421,10 @@ void SSWCP_Instance::sw_Unsubscribe_Filter() { } } } - + else + { + BOOST_LOG_TRIVIAL(warning) << "no this cmd for:" << cmd; + } send_to_js(); finish_job(); } @@ -3695,6 +3698,7 @@ void SSWCP_MachineOption_Instance::sw_GetTimelapseInstance() handle_general_fail(); } } + void SSWCP_MachineOption_Instance::CmdForwarding() { try { std::shared_ptr host = nullptr; @@ -3886,6 +3890,7 @@ void SSWCP_MachineConnect_Instance::sw_get_pin_code() self->send_to_js(); self->finish_job(); + std::string dc_msg = "success"; bool flag = mqtt_client->Disconnect(dc_msg); wxGetApp().CallAfter([mqtt_client]() { delete mqtt_client; }); @@ -4267,7 +4272,12 @@ void SSWCP_UserLogin_Instance::process() sw_GetUserLoginState(); } else if (m_cmd == "sw_SubscribeUserLoginState") { sw_SubscribeUserLoginState(); - } else { + } + else if (m_cmd == UPDATE_PRIVACY_STATUS) + { + sw_SubUserUpdatePrivacy(); + } + else { handle_general_fail(); } } @@ -4332,6 +4342,17 @@ void SSWCP_UserLogin_Instance::sw_GetUserLoginState() } } +void SSWCP_UserLogin_Instance::sw_SubUserUpdatePrivacy() +{ + try { + std::weak_ptr weak_ptr = shared_from_this(); + wxGetApp().m_user_update_privacy_subscribers[m_webview] = weak_ptr; + } catch (std::exception& e) { + handle_general_fail(); + } + +} + void SSWCP_UserLogin_Instance::sw_SubscribeUserLoginState() { try { @@ -5823,9 +5844,8 @@ std::unordered_set SSWCP::m_project_cmd_list = { "sw_NewProject", "sw_OpenProject", "sw_GetRecentProjects", "sw_OpenRecentFile", "sw_DeleteRecentFiles", "sw_SubscribeRecentFiles", }; -std::unordered_set SSWCP::m_login_cmd_list = { - "sw_UserLogin", "sw_UserLogout", "sw_GetUserLoginState", "sw_SubscribeUserLoginState" -}; +std::unordered_set SSWCP::m_login_cmd_list = {"sw_UserLogin", "sw_UserLogout", "sw_GetUserLoginState", + "sw_SubscribeUserLoginState", UPDATE_PRIVACY_STATUS}; std::unordered_set SSWCP::m_machine_manage_cmd_list = { "sw_GetLocalDevices", "sw_AddDevice", "sw_SubscribeLocalDevices", "sw_RenameDevice", "sw_SwitchModel", "sw_DeleteDevices" diff --git a/src/slic3r/GUI/SSWCP.hpp b/src/slic3r/GUI/SSWCP.hpp index f0f9b46c96..cc82c52b3a 100644 --- a/src/slic3r/GUI/SSWCP.hpp +++ b/src/slic3r/GUI/SSWCP.hpp @@ -310,9 +310,6 @@ private: void sw_mqtt_publish(); void sw_mqtt_set_engine(); - - - private: void clean_current_engine(); @@ -426,7 +423,7 @@ private: void sw_DeleteCameraTimelapse(); void sw_GetTimelapseInstance(); - void sw_DefectDetactionConfig(); + void sw_DefectDetactionConfig(); void CmdForwarding(); @@ -535,7 +532,6 @@ private: void sw_SubscribeUserLoginState(); void sw_SubUserUpdatePrivacy(); - }; // Instance class for homepage business From 5d6a6ca2b6b3a513d67c1521a5a13278a8c88bb3 Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 22 Jan 2026 11:11:09 +0800 Subject: [PATCH 03/20] feature privacy flags throw protocol to web. --- src/slic3r/GUI/GUI_App.cpp | 14 +++++--------- src/slic3r/GUI/GUI_App.hpp | 2 ++ src/slic3r/GUI/Preferences.cpp | 6 +++--- src/slic3r/GUI/SSWCP.cpp | 25 +++++++++++++++++++++---- src/slic3r/GUI/SSWCP.hpp | 3 +++ src/slic3r/GUI/WebGuideDialog.cpp | 2 +- 6 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 75feacd820..ea8aca89f8 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4045,18 +4045,14 @@ wxString GUI_App::get_international_url(const wxString& origin_url) { string dark_mode = wxGetApp().app_config->get("dark_color_mode"); - auto isAgree = wxGetApp().app_config->get("app", "privacy_policy_isagree"); - std::string useAgree = (isAgree == "true" ? "1" : "0"); - if (baseUrl.find("?") != std::string::npos) { return baseUrl + wxString::FromUTF8("&locale=") + lang + wxString::FromUTF8("-") + region + - wxString::FromUTF8("&dark_mode=" + dark_mode) + wxString::FromUTF8("&privacy_policy_isagree=" + useAgree); + wxString::FromUTF8("&dark_mode=" + dark_mode); } else { return baseUrl + wxString::FromUTF8("?locale=") + lang + wxString::FromUTF8("-") + region + - wxString::FromUTF8("&dark_mode=" + dark_mode) + wxString::FromUTF8("&privacy_policy_isagree=" + useAgree); + wxString::FromUTF8("&dark_mode=" + dark_mode); } - } bool GUI_App::is_user_login() @@ -6719,7 +6715,7 @@ bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage mainframe->refresh_plugin_tips(); // BBS: remove SLA related message } - auto isAgree = wxGetApp().app_config->get("app", "privacy_policy_isagree"); + auto isAgree = wxGetApp().app_config->get("app", PRIVACY_POLICY_FLAGS); user_update_privacy_notify(isAgree == "true"); BOOST_LOG_TRIVIAL(warning) << "run_wizard changed the privacy policy with: " << (isAgree); @@ -6932,7 +6928,7 @@ void GUI_App::user_update_privacy_notify(const bool& res) json data; - data["privacy_policy_isagree"] = res; + data[PRIVACY_POLICY_FLAGS] = res; for (const auto& instance : m_user_update_privacy_subscribers) { auto ptr = instance.second.lock(); @@ -6957,7 +6953,7 @@ void GUI_App::user_login_notify(const json& res) bool GUI_App::config_wizard_startup() { - auto isAgree = wxGetApp().app_config->get("app", "privacy_policy_isagree"); + auto isAgree = wxGetApp().app_config->get("app", PRIVACY_POLICY_FLAGS); user_update_privacy_notify(isAgree == "true"); BOOST_LOG_TRIVIAL(warning) << "config_wizard_startup changed the privacy policy with: " << (isAgree); if (!m_app_conf_exists || preset_bundle->printers.only_default_printers()) { diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 02b1721ecf..6052f68401 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -46,6 +46,8 @@ #define _MSW_DARK_MODE 1 #endif // _MSW_DARK_MODE +#define PRIVACY_POLICY_FLAGS "privacy_policy_isagree" + class wxMenuItem; class wxMenuBar; class wxTopLevelWindow; diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 41c7e34a93..45725d4b70 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -748,9 +748,9 @@ wxBoxSizer *PreferencesDialog::create_item_checkbox(wxString title, wxWindow *pa app_config->set_bool(param, checkbox->GetValue()); app_config->save(); - if (param == "privacy_policy_isagree") + if (param == PRIVACY_POLICY_FLAGS) { - app_config->set("app", "privacy_policy_isagree", checkbox->GetValue()); + app_config->set("app", PRIVACY_POLICY_FLAGS, checkbox->GetValue()); BOOST_LOG_TRIVIAL(warning) <<"create_item_checkbox changed the privacy policy with: "<<(checkbox->GetValue()?"true" : "false"); wxGetApp().user_update_privacy_notify(checkbox->GetValue()); } @@ -1300,7 +1300,7 @@ wxWindow* PreferencesDialog::create_general_page() std::string region = app_config->get("language"); auto title_user_experience = create_item_title(_L("User Experience"), page, _L("User Experience")); - auto item_priv_policy = create_item_checkbox(_L("Join Customer Experience Improvement Program."), page, _L(""), 50, "privacy_policy_isagree"); + auto item_priv_policy = create_item_checkbox(_L("Join Customer Experience Improvement Program."), page, _L(""), 50,PRIVACY_POLICY_FLAGS); wxHyperlinkCtrl* hyperlink = nullptr; if (region.empty() || region != "zh_CN") hyperlink = new wxHyperlinkCtrl(page, wxID_ANY, _L("What data would be collected?"), enUrl); diff --git a/src/slic3r/GUI/SSWCP.cpp b/src/slic3r/GUI/SSWCP.cpp index dde47f36ff..4de740574b 100644 --- a/src/slic3r/GUI/SSWCP.cpp +++ b/src/slic3r/GUI/SSWCP.cpp @@ -4273,9 +4273,10 @@ void SSWCP_UserLogin_Instance::process() } else if (m_cmd == "sw_SubscribeUserLoginState") { sw_SubscribeUserLoginState(); } - else if (m_cmd == UPDATE_PRIVACY_STATUS) - { + else if (m_cmd == UPDATE_PRIVACY_STATUS) { sw_SubUserUpdatePrivacy(); + } else if (m_cmd == GET_PRIVACY_STATUS) { + sw_GetUserUpdatePrivacy(); } else { handle_general_fail(); @@ -4341,6 +4342,22 @@ void SSWCP_UserLogin_Instance::sw_GetUserLoginState() handle_general_fail(); } } +void SSWCP_UserLogin_Instance::sw_GetUserUpdatePrivacy() +{ + json data; + auto isAgree = wxGetApp().app_config->get("app", PRIVACY_POLICY_FLAGS); + bool isUserAgree = false; + + if (isAgree == "true") + isUserAgree = true; + + data[PRIVACY_POLICY_FLAGS] = isUserAgree; + + m_res_data = data; + send_to_js(); + finish_job(); + +} void SSWCP_UserLogin_Instance::sw_SubUserUpdatePrivacy() { @@ -5844,8 +5861,8 @@ std::unordered_set SSWCP::m_project_cmd_list = { "sw_NewProject", "sw_OpenProject", "sw_GetRecentProjects", "sw_OpenRecentFile", "sw_DeleteRecentFiles", "sw_SubscribeRecentFiles", }; -std::unordered_set SSWCP::m_login_cmd_list = {"sw_UserLogin", "sw_UserLogout", "sw_GetUserLoginState", - "sw_SubscribeUserLoginState", UPDATE_PRIVACY_STATUS}; +std::unordered_set SSWCP::m_login_cmd_list = {"sw_UserLogin", "sw_UserLogout", "sw_GetUserLoginState", "sw_SubscribeUserLoginState", + UPDATE_PRIVACY_STATUS, GET_PRIVACY_STATUS}; std::unordered_set SSWCP::m_machine_manage_cmd_list = { "sw_GetLocalDevices", "sw_AddDevice", "sw_SubscribeLocalDevices", "sw_RenameDevice", "sw_SwitchModel", "sw_DeleteDevices" diff --git a/src/slic3r/GUI/SSWCP.hpp b/src/slic3r/GUI/SSWCP.hpp index cc82c52b3a..5e4182a0f3 100644 --- a/src/slic3r/GUI/SSWCP.hpp +++ b/src/slic3r/GUI/SSWCP.hpp @@ -26,6 +26,7 @@ using tcp = asio::ip::tcp; //WCP Interface definition #define UPDATE_PRIVACY_STATUS "sw_SubUserUpdatePrivacy" +#define GET_PRIVACY_STATUS "sw_GetUserUpdatePrivacy" #define UPLOAD_CAMERA_TIMELAPSE "sw_UploadCameraTimelapse" #define DELETE_CAMERA_TIMELAPSE "sw_DeleteCameraTimelapse" #define GETCAMERA_TIMELAPSE_INSTANCE "sw_GetCameraTimelapseInstance" @@ -531,6 +532,8 @@ private: void sw_SubscribeUserLoginState(); + void sw_GetUserUpdatePrivacy(); + void sw_SubUserUpdatePrivacy(); }; diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index e688e0ed82..9f3cfb3e32 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -639,7 +639,7 @@ int GuideFrame::SaveProfile() // m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "privacyuse", "1"); // } else // m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "privacyuse", "0"); - m_MainPtr->app_config->set("app", "privacy_policy_isagree", PrivacyUse); + m_MainPtr->app_config->set("app", PRIVACY_POLICY_FLAGS, PrivacyUse); BOOST_LOG_TRIVIAL(warning) << "SaveProfile changed the privacy policy with: " << (PrivacyUse ? "true" : "false"); wxGetApp().user_update_privacy_notify(PrivacyUse); m_MainPtr->app_config->set("region", m_Region); From 7496e9acd05516665aecd5512a8d851f8966d355 Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 22 Jan 2026 14:43:18 +0800 Subject: [PATCH 04/20] feature add function for web to get the machine storage space. --- src/slic3r/GUI/GUI_App.cpp | 5 +++-- src/slic3r/GUI/SSWCP.cpp | 36 +++++++++++++++++++++++++--------- src/slic3r/GUI/SSWCP.hpp | 3 ++- src/slic3r/Utils/MoonRaker.cpp | 24 +++++++++++++++++++++++ src/slic3r/Utils/MoonRaker.hpp | 3 +++ src/slic3r/Utils/PrintHost.hpp | 2 ++ 6 files changed, 61 insertions(+), 12 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index ea8aca89f8..d7f557bf4d 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4853,8 +4853,9 @@ void GUI_App::check_new_version_sf(bool show_tips, bool by_user) Semver server_version = get_version(version_info.version_str, matcher); - if (current_version >= server_version && by_user) { - this->no_new_version(); + if (current_version >= server_version) { + if(by_user) + this->no_new_version(); return; } diff --git a/src/slic3r/GUI/SSWCP.cpp b/src/slic3r/GUI/SSWCP.cpp index 4de740574b..3c53500bf1 100644 --- a/src/slic3r/GUI/SSWCP.cpp +++ b/src/slic3r/GUI/SSWCP.cpp @@ -2084,11 +2084,9 @@ void SSWCP_MachineOption_Instance::process() sw_ServerClientManagerSetUserinfo(); } else if (m_cmd == "sw_DefectDetactionConfig"){ sw_DefectDetactionConfig(); - } else if (m_cmd == GETCAMERA_TIMELAPSE_INSTANCE) { - CmdForwarding(); - } + } else if (m_cmd == GET_DEVICEDATA_STORAGESPACE) { - CmdForwarding(); + sw_GetDeviceDataStorageSpace(); } else { handle_general_fail(); @@ -3674,6 +3672,28 @@ void SSWCP_MachineOption_Instance::sw_UploadCameraTimelapse() handle_general_fail(); } } +void SSWCP_MachineOption_Instance::CmdForwarding() +{ + try { + std::shared_ptr host = nullptr; + wxGetApp().get_connect_host(host); + + if (!host) { + handle_general_fail(-1, "Connection lost!"); + return; + } + + auto weak_self = std::weak_ptr(shared_from_this()); + host->test_async_wcp_mqtt_moonraker(m_param_data, [weak_self](const json& response) { + auto self = weak_self.lock(); + if (self) { + SSWCP_Instance::on_mqtt_msg_arrived(self, response); + } + }); + } catch (std::exception& e) { + handle_general_fail(); + } +} void SSWCP_MachineOption_Instance::sw_GetTimelapseInstance() { @@ -3698,8 +3718,9 @@ void SSWCP_MachineOption_Instance::sw_GetTimelapseInstance() handle_general_fail(); } } +void SSWCP_MachineOption_Instance::sw_GetDeviceDataStorageSpace() +{ -void SSWCP_MachineOption_Instance::CmdForwarding() { try { std::shared_ptr host = nullptr; wxGetApp().get_connect_host(host); @@ -3710,7 +3731,7 @@ void SSWCP_MachineOption_Instance::CmdForwarding() { } auto weak_self = std::weak_ptr(shared_from_this()); - host->async_delete_camera_timelapse(m_param_data, [weak_self](const json& response) { + host->async_get_userdata_space(m_param_data, [weak_self](const json& response) { auto self = weak_self.lock(); if (self) { SSWCP_Instance::on_mqtt_msg_arrived(self, response); @@ -3721,7 +3742,6 @@ void SSWCP_MachineOption_Instance::CmdForwarding() { } } - void SSWCP_MachineOption_Instance::sw_DeleteCameraTimelapse() { try { @@ -5844,7 +5864,6 @@ std::unordered_set SSWCP::m_machine_option_cmd_list = { "sw_GetTimelapseInstance", "sw_ServerClientManagerSetUserinfo", "sw_DefectDetactionConfig", - GETCAMERA_TIMELAPSE_INSTANCE, GET_DEVICEDATA_STORAGESPACE }; @@ -5936,7 +5955,6 @@ void SSWCP::handle_web_message(std::string message, wxWebView* webview) { if (payload.count("event_id") && !payload["event_id"].is_null()) { event_id = payload["event_id"].get(); } - std::shared_ptr instance = create_sswcp_instance(cmd, header, params, event_id, webview); if (instance) { if (event_id != "") { diff --git a/src/slic3r/GUI/SSWCP.hpp b/src/slic3r/GUI/SSWCP.hpp index 5e4182a0f3..e010007c3e 100644 --- a/src/slic3r/GUI/SSWCP.hpp +++ b/src/slic3r/GUI/SSWCP.hpp @@ -29,7 +29,6 @@ using tcp = asio::ip::tcp; #define GET_PRIVACY_STATUS "sw_GetUserUpdatePrivacy" #define UPLOAD_CAMERA_TIMELAPSE "sw_UploadCameraTimelapse" #define DELETE_CAMERA_TIMELAPSE "sw_DeleteCameraTimelapse" -#define GETCAMERA_TIMELAPSE_INSTANCE "sw_GetCameraTimelapseInstance" #define GET_DEVICEDATA_STORAGESPACE "sw_GetDeviceDataStorageSpace" namespace Slic3r { namespace GUI { @@ -426,6 +425,8 @@ private: void sw_DefectDetactionConfig(); + void sw_GetDeviceDataStorageSpace(); + void CmdForwarding(); // Download machine file diff --git a/src/slic3r/Utils/MoonRaker.cpp b/src/slic3r/Utils/MoonRaker.cpp index d4c2140bda..afd1cd31a5 100644 --- a/src/slic3r/Utils/MoonRaker.cpp +++ b/src/slic3r/Utils/MoonRaker.cpp @@ -2399,6 +2399,30 @@ void Moonraker_Mqtt::async_get_timelapse_instance(const nlohmann::json& targets, } } +//get the mechine local storage space +void Moonraker_Mqtt::async_get_userdata_space(const nlohmann::json& targets, std::function callback) +{ + auto& wcp_loger = GUI::WCP_Logger::getInstance(); + std::string method = "camera.get_timelapse_instance"; + + json params = json::object(); + + params = targets; + + if (!send_to_request(method, params, true, callback, + [callback, &wcp_loger]() { + BOOST_LOG_TRIVIAL(warning) << "[Moonraker_Mqtt] get uoser storage space"; + wcp_loger.add_log("get uoser storage space timeout", false, "", "Moonraker_Mqtt", "warning"); + json res; + res["error"] = "timeout"; + callback(res); + }) &&callback) { + BOOST_LOG_TRIVIAL(error) << "[Moonraker_Mqtt]send the cmd to get uoser storage space fail"; + wcp_loger.add_log("send the cmd to get uoser storage space fail", false, "", "Moonraker_Mqtt", "error"); + callback(json::value_t::null); + } +} + // 请求删除延时摄影文件 void Moonraker_Mqtt::async_delete_camera_timelapse(const nlohmann::json& targets, std::function callback) diff --git a/src/slic3r/Utils/MoonRaker.hpp b/src/slic3r/Utils/MoonRaker.hpp index 784f682aac..7e04783c21 100644 --- a/src/slic3r/Utils/MoonRaker.hpp +++ b/src/slic3r/Utils/MoonRaker.hpp @@ -140,6 +140,7 @@ public: virtual void async_defect_detaction_config(const nlohmann::json& targets, std::function) {} + virtual void async_get_userdata_space(const nlohmann::json& targets, std::function) {} protected: // Internal upload implementations @@ -272,6 +273,8 @@ public: virtual void async_get_timelapse_instance(const nlohmann::json& targets, std::function) override; + virtual void async_get_userdata_space(const nlohmann::json& targets, std::function) override; + virtual void async_defect_detaction_config(const nlohmann::json& targets, std::function) override; void set_connection_lost(std::function callback) override; diff --git a/src/slic3r/Utils/PrintHost.hpp b/src/slic3r/Utils/PrintHost.hpp index 2ecb087ce0..4fe08be21a 100644 --- a/src/slic3r/Utils/PrintHost.hpp +++ b/src/slic3r/Utils/PrintHost.hpp @@ -170,6 +170,8 @@ public: virtual void async_delete_camera_timelapse(const nlohmann::json& targets, std::function) {} virtual void async_get_timelapse_instance(const nlohmann::json& targets, std::function) {} + + virtual void async_get_userdata_space(const nlohmann::json& targets, std::function) {} virtual void async_defect_detaction_config(const nlohmann::json& targets, std::function) {} From 2ddac783090162d9197eb6db6b8fc4d8e2ae6b4f Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 22 Jan 2026 15:59:20 +0800 Subject: [PATCH 05/20] feature add log info for server data error. --- src/slic3r/GUI/GUI_App.cpp | 5 ++++- src/slic3r/Utils/PresetUpdater.cpp | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index d7f557bf4d..8163c9eed1 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4876,7 +4876,10 @@ void GUI_App::check_new_version_sf(bool show_tips, bool by_user) if (by_user) evt->SetInt(UPDATE_BY_USER); GUI::wxGetApp().QueueEvent(evt); - } catch (...) {} + } catch (const std::exception& ex) { + std::string errorMsg = ex.what(); + BOOST_LOG_TRIVIAL(fatal) << "request server soft update data error:" << errorMsg; + } }) .perform_sync(); } diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 54ce378d9e..e222f3cb5e 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -814,7 +814,10 @@ void PresetUpdater::priv::sync_update_flutter_resource(bool isAuto_check) } } - } catch (...) {} + } catch (const std::exception& ex) { + std::string errorMsg = ex.what(); + BOOST_LOG_TRIVIAL(fatal) << "request server flutter update data error:" << errorMsg; + } }) .perform_sync(); } @@ -920,7 +923,10 @@ void PresetUpdater::priv::sync_config(bool isAuto_check) } } - } catch (...) {} + } catch (const std::exception& ex) { + std::string errorMsg = ex.what(); + BOOST_LOG_TRIVIAL(fatal) << "request server preset update data error:" << errorMsg; + } }) .perform_sync(); } From 2df0955debbe73013bda597115738c486749992f Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 22 Jan 2026 18:03:24 +0800 Subject: [PATCH 06/20] feature add machine storage space function and user data list function for web. --- src/slic3r/GUI/SSWCP.cpp | 8 ++++---- src/slic3r/GUI/SSWCP.hpp | 2 +- src/slic3r/Utils/MoonRaker.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/SSWCP.cpp b/src/slic3r/GUI/SSWCP.cpp index 3c53500bf1..57930222ed 100644 --- a/src/slic3r/GUI/SSWCP.cpp +++ b/src/slic3r/GUI/SSWCP.cpp @@ -2078,8 +2078,8 @@ void SSWCP_MachineOption_Instance::process() sw_UploadCameraTimelapse(); } else if (m_cmd == "sw_DeleteCameraTimelapse") { sw_DeleteCameraTimelapse(); - } else if (m_cmd == "sw_GetTimelapseInstance") { - sw_GetTimelapseInstance(); + } else if (m_cmd == "sw_GetCameraTimelapseInstance") { + sw_GetCameraTimelapseInstance(); } else if (m_cmd == "sw_ServerClientManagerSetUserinfo") { sw_ServerClientManagerSetUserinfo(); } else if (m_cmd == "sw_DefectDetactionConfig"){ @@ -3695,7 +3695,7 @@ void SSWCP_MachineOption_Instance::CmdForwarding() } } -void SSWCP_MachineOption_Instance::sw_GetTimelapseInstance() +void SSWCP_MachineOption_Instance::sw_GetCameraTimelapseInstance() { try { std::shared_ptr host = nullptr; @@ -5861,7 +5861,7 @@ std::unordered_set SSWCP::m_machine_option_cmd_list = { "sw_UpdateMachineFilamentInfo", "sw_UploadCameraTimelapse", "sw_DeleteCameraTimelapse", - "sw_GetTimelapseInstance", + "sw_GetCameraTimelapseInstance", "sw_ServerClientManagerSetUserinfo", "sw_DefectDetactionConfig", GET_DEVICEDATA_STORAGESPACE diff --git a/src/slic3r/GUI/SSWCP.hpp b/src/slic3r/GUI/SSWCP.hpp index e010007c3e..12717471ec 100644 --- a/src/slic3r/GUI/SSWCP.hpp +++ b/src/slic3r/GUI/SSWCP.hpp @@ -421,7 +421,7 @@ private: void sw_GetFileListPage(); void sw_UploadCameraTimelapse(); void sw_DeleteCameraTimelapse(); - void sw_GetTimelapseInstance(); + void sw_GetCameraTimelapseInstance(); void sw_DefectDetactionConfig(); diff --git a/src/slic3r/Utils/MoonRaker.cpp b/src/slic3r/Utils/MoonRaker.cpp index afd1cd31a5..efbc226ab6 100644 --- a/src/slic3r/Utils/MoonRaker.cpp +++ b/src/slic3r/Utils/MoonRaker.cpp @@ -2403,7 +2403,7 @@ void Moonraker_Mqtt::async_get_timelapse_instance(const nlohmann::json& targets, void Moonraker_Mqtt::async_get_userdata_space(const nlohmann::json& targets, std::function callback) { auto& wcp_loger = GUI::WCP_Logger::getInstance(); - std::string method = "camera.get_timelapse_instance"; + std::string method = "server.files.get_userdata_space"; json params = json::object(); From d43142b42ef120ac499c52fb09fbe93331932554 Mon Sep 17 00:00:00 2001 From: alves Date: Thu, 22 Jan 2026 18:44:33 +0800 Subject: [PATCH 07/20] fix bug on sign app not include the entitlements, and web show error on the mac os 26.x --- .github/workflows/build_orca.yml | 58 +++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 6599f4e4de..d08fe92e37 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -139,10 +139,60 @@ jobs: security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH - codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" + + # Sign Snapmaker Orca.app with entitlements (manual recursive signing, not using --deep) + APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" + ENTITLEMENTS_PATH="${{ github.workspace }}/scripts/disable_validation.entitlements" + + echo "Signing Frameworks..." + if [ -d "$APP_PATH/Contents/Frameworks" ]; then + find "$APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do + if [ -f "$item" ] || [ -d "$item" ]; then + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + fi + done + fi + + echo "Signing MacOS executables..." + if [ -d "$APP_PATH/Contents/MacOS" ]; then + find "$APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + done + fi + + echo "Signing main app with entitlements..." + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$APP_PATH" + + # Verify entitlements are embedded + echo "Verifying entitlements..." + if codesign -d --entitlements - "$APP_PATH" 2>&1 | grep -q "com.apple.security.network.client"; then + echo "✓ Entitlements successfully embedded" + else + echo "⚠ Warning: Entitlements may not be embedded correctly" + fi + # Sign Snapmaker_Orca_profile_validator.app if it exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then - codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app + VALIDATOR_APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app" + + echo "Signing profile validator Frameworks..." + if [ -d "$VALIDATOR_APP_PATH/Contents/Frameworks" ]; then + find "$VALIDATOR_APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do + if [ -f "$item" ] || [ -d "$item" ]; then + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + fi + done + fi + + echo "Signing profile validator MacOS executables..." + if [ -d "$VALIDATOR_APP_PATH/Contents/MacOS" ]; then + find "$VALIDATOR_APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + done + fi + + echo "Signing profile validator app with entitlements..." + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$VALIDATOR_APP_PATH" fi # Create main Snapmaker Orca DMG without the profile validator helper @@ -151,7 +201,7 @@ jobs: cp -R "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" "${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/" ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/Applications hdiutil create -volname "Snapmaker_Orca" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" - codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" # Create separate Snapmaker_Orca_profile_validator DMG if the app exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then @@ -160,7 +210,7 @@ jobs: cp -R ${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/ ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/Applications hdiutil create -volname "Snapmaker_Orca Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" - codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" fi # Notarize main DMG From 311de0b1c3e8cf26d7d5c96fbc1455e0f889e5c5 Mon Sep 17 00:00:00 2001 From: alves Date: Fri, 23 Jan 2026 10:22:17 +0800 Subject: [PATCH 08/20] feature update the translation. --- localization/i18n/zh_CN/Snapmaker_Orca_zh_CN.po | 11 ++++++++++- src/slic3r/GUI/MainFrame.cpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/localization/i18n/zh_CN/Snapmaker_Orca_zh_CN.po b/localization/i18n/zh_CN/Snapmaker_Orca_zh_CN.po index b04fe92447..23acc4eb2d 100644 --- a/localization/i18n/zh_CN/Snapmaker_Orca_zh_CN.po +++ b/localization/i18n/zh_CN/Snapmaker_Orca_zh_CN.po @@ -15313,7 +15313,7 @@ msgid "Please do not include the special characters #, *, ;, \\, /, :, \", <, >, msgstr "在文件名中勿使用特殊字符"#"*""";""\\""/" ":"\""<"">"或"|"。" msgid "The filename '%s' contains special characters (#, *, ;, \\, /, :, \", <, >, or |) which may cause issues.Do you wish to continue?" -msgstr "文件名"%s"包含特殊字符(# * ; \\ / : \" < > |)可能会导致问题。是否继续?" +msgstr "文件名”%s“包含特殊字符(# * ; \\ / : \" < > |)可能会导致问题。是否继续?" msgid "Connection has been disconnected and recovery attempt failed. Please reconnect." msgstr "已断开连接,尝试恢复连接失败。请重新连接。" @@ -15348,6 +15348,15 @@ msgstr "OrcaSlicer 基于来自 Bambu Lab 的 Bambu Studio 开发而来。" msgid "Printing by object with caution. This function may cause the print head to collide with printed parts during switching." msgstr "谨慎使用逐件打印,该功能可能会导致打印头切换时与打印件碰撞" +msgid "Check for Process Preset Updates" +msgstr "检查工艺预设新版本" + +msgid "Check for Web Resource Updates" +msgstr "检查Web资源新版本" + +msgid "Export Logs" +msgstr "日志导出" + #~ msgid "Improve shell precision by adjusting outer wall spacing. This also improves layer consistency." #~ msgstr "优化外墙刀路以提高外墙精度。这个优化同时减少层纹" diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index e934b41ae8..339f1c0009 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -2264,7 +2264,7 @@ static wxMenu* generate_help_menu() "", nullptr, []() { return true; }); append_menu_item( - helpMenu, wxID_ANY, _L("Check for Web ResourceUpdates"), _L("Check for Web ResourceUpdates"), + helpMenu, wxID_ANY, _L("Check for Web Resource Updates"), _L("Check for Web Resource Updates"), [](wxCommandEvent&) { wxGetApp().check_web_version(); }, From 602c8294a94fed2a2a9206c1fb5200df54ded830 Mon Sep 17 00:00:00 2001 From: alves Date: Fri, 23 Jan 2026 15:05:06 +0800 Subject: [PATCH 09/20] fix event error bug. --- src/slic3r/GUI/GUI_App.cpp | 9 --------- src/slic3r/Utils/PresetUpdater.cpp | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 8163c9eed1..f0b479d733 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -6690,15 +6690,6 @@ bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage { wxCHECK_MSG(mainframe != nullptr, false, "Internal error: Main frame not created / null"); - //if (reason == ConfigWizard::RR_USER) { - // //TODO: turn off it currently, maybe need to turn on in the future - // if (preset_updater->config_update(app_config->orig_version(), PresetUpdater::UpdateParams::FORCED_BEFORE_WIZARD) == PresetUpdater::R_ALL_CANCELED) - // return false; - //} - - //auto wizard_t = new ConfigWizard(mainframe); - //const bool res = wizard_t->run(reason, start_page); - std::string strFinish = wxGetApp().app_config->get("firstguide", "finish"); long pStyle = wxCAPTION | wxCLOSE_BOX | wxSYSTEM_MENU; if (strFinish == "false" || strFinish.empty()) diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index e222f3cb5e..fcf0491eea 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -795,7 +795,7 @@ void PresetUpdater::priv::sync_update_flutter_resource(bool isAuto_check) if (currentSoftVersion > maxSpVersion || currentSoftVersion < minSpVersion) { if (!isAuto_check) { - wxCommandEvent* evt = new wxCommandEvent(EVT_NO_PRESET_UPDATE); + wxCommandEvent* evt = new wxCommandEvent(EVT_NO_WEB_RESOURCE_UPDATE); GUI::wxGetApp().QueueEvent(evt); BOOST_LOG_TRIVIAL(info) << format("use check the web update."); @@ -1851,7 +1851,7 @@ void PresetUpdater::load_lutter_web(const std::string& zip_file, bool serverUpda Semver online_version = version_str; Semver current_version = ori_version_str; - if (/* current_version < online_version && */ ori_build_number_str < build_number_str) { + if (current_version < online_version) { auto source_folder_path = fs::path(dir_entry.path().parent_path()); auto target_folder_path = (boost::filesystem::path(data_dir()) / "web" / "flutter_web"); From 30ff6d16764f2a6dc95eb8fd92d86ca8bb42a7a0 Mon Sep 17 00:00:00 2001 From: alves Date: Fri, 23 Jan 2026 15:09:11 +0800 Subject: [PATCH 10/20] fix dmg signed error bug. --- .github/workflows/build_orca.yml | 100 +++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index d08fe92e37..b2bb032640 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -144,33 +144,70 @@ jobs: APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" ENTITLEMENTS_PATH="${{ github.workspace }}/scripts/disable_validation.entitlements" + # Verify entitlements file exists + if [ ! -f "$ENTITLEMENTS_PATH" ]; then + echo "Error: Entitlements file not found: $ENTITLEMENTS_PATH" + exit 1 + fi + echo "Using entitlements: $ENTITLEMENTS_PATH" + + # Sign Frameworks (must succeed, no silent failures) echo "Signing Frameworks..." if [ -d "$APP_PATH/Contents/Frameworks" ]; then find "$APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do if [ -f "$item" ] || [ -d "$item" ]; then - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + echo " Signing: $item" + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { + echo "Error: Failed to sign $item" + exit 1 + } fi done fi + # Sign MacOS executables (must succeed, no silent failures) echo "Signing MacOS executables..." if [ -d "$APP_PATH/Contents/MacOS" ]; then find "$APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + echo " Signing: $item" + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { + echo "Error: Failed to sign $item" + exit 1 + } done fi + # Sign main app with entitlements echo "Signing main app with entitlements..." - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$APP_PATH" + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$APP_PATH" || { + echo "Error: Failed to sign main app" + exit 1 + } + + # Verify signature + echo "Verifying signature..." + codesign --verify --verbose "$APP_PATH" || { + echo "Error: Signature verification failed" + exit 1 + } # Verify entitlements are embedded - echo "Verifying entitlements..." - if codesign -d --entitlements - "$APP_PATH" 2>&1 | grep -q "com.apple.security.network.client"; then + echo "Verifying entitlements are embedded..." + EMBEDDED_ENTITLEMENTS=$(codesign -d --entitlements - "$APP_PATH" 2>&1) + if echo "$EMBEDDED_ENTITLEMENTS" | grep -q "com.apple.security.network.client"; then echo "✓ Entitlements successfully embedded" + echo " Found network.client entitlement" else - echo "⚠ Warning: Entitlements may not be embedded correctly" + echo "✗ Error: Entitlements not embedded correctly" + echo " Embedded entitlements output:" + echo "$EMBEDDED_ENTITLEMENTS" | head -20 + exit 1 fi + # Display full entitlements for debugging + echo "Full embedded entitlements:" + codesign -d --entitlements - "$APP_PATH" 2>&1 | head -30 + # Sign Snapmaker_Orca_profile_validator.app if it exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then VALIDATOR_APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app" @@ -179,7 +216,11 @@ jobs: if [ -d "$VALIDATOR_APP_PATH/Contents/Frameworks" ]; then find "$VALIDATOR_APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do if [ -f "$item" ] || [ -d "$item" ]; then - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + echo " Signing: $item" + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { + echo "Error: Failed to sign $item" + exit 1 + } fi done fi @@ -187,12 +228,25 @@ jobs: echo "Signing profile validator MacOS executables..." if [ -d "$VALIDATOR_APP_PATH/Contents/MacOS" ]; then find "$VALIDATOR_APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true + echo " Signing: $item" + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { + echo "Error: Failed to sign $item" + exit 1 + } done fi echo "Signing profile validator app with entitlements..." - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$VALIDATOR_APP_PATH" + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$VALIDATOR_APP_PATH" || { + echo "Error: Failed to sign profile validator app" + exit 1 + } + + # Verify profile validator signature + codesign --verify --verbose "$VALIDATOR_APP_PATH" || { + echo "Error: Profile validator signature verification failed" + exit 1 + } fi # Create main Snapmaker Orca DMG without the profile validator helper @@ -201,7 +255,19 @@ jobs: cp -R "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" "${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/" ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/Applications hdiutil create -volname "Snapmaker_Orca" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" + + # Sign DMG (DMG files don't need entitlements, just signature) + echo "Signing DMG..." + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" || { + echo "Error: Failed to sign DMG" + exit 1 + } + + # Verify DMG signature + codesign --verify --verbose "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" || { + echo "Error: DMG signature verification failed" + exit 1 + } # Create separate Snapmaker_Orca_profile_validator DMG if the app exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then @@ -210,7 +276,19 @@ jobs: cp -R ${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/ ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/Applications hdiutil create -volname "Snapmaker_Orca Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" + + # Sign DMG (DMG files don't need entitlements, just signature) + echo "Signing profile validator DMG..." + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" || { + echo "Error: Failed to sign profile validator DMG" + exit 1 + } + + # Verify DMG signature + codesign --verify --verbose "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" || { + echo "Error: Profile validator DMG signature verification failed" + exit 1 + } fi # Notarize main DMG From 3764287b9a2495fcab759e02be4d49794ce25806 Mon Sep 17 00:00:00 2001 From: alves Date: Fri, 23 Jan 2026 16:35:54 +0800 Subject: [PATCH 11/20] feature update the preset check rule. and set the weak update dialog isn't modal. --- src/slic3r/GUI/GUI_App.cpp | 30 ++++++++++++++---------------- src/slic3r/GUI/GUI_App.hpp | 7 +++++++ src/slic3r/GUI/ReleaseNote.cpp | 20 +++++++++++++++++--- src/slic3r/GUI/ReleaseNote.hpp | 6 ++++++ src/slic3r/Utils/PresetUpdater.cpp | 3 +-- 5 files changed, 45 insertions(+), 21 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index f0b479d733..efc2846661 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -2516,24 +2516,16 @@ bool GUI_App::on_init_inner() skip_this_version = false; } } - if (!skip_this_version - || evt.GetInt() != 0) { - UpdateVersionDialog dialog(this->mainframe); + if (!skip_this_version || evt.GetInt() != 0) { wxString extmsg = wxString::FromUTF8(version_info.description); - dialog.update_version_info(extmsg, version_info.version_str); + m_updateDialog->update_version_info(extmsg, version_info.version_str); if (evt.GetInt() != 0) { - dialog.m_button_skip_version->Hide(); - } - switch (dialog.ShowModal()) - { - case wxID_YES: - wxLaunchDefaultBrowser(version_info.url); - break; - case wxID_NO: - break; - default: - ; + m_updateDialog->m_button_skip_version->Hide(); } + m_updateDialog->Raise(); + m_updateDialog->Show(); + m_updateDialog->setUrl(version_info.url); + } } }); @@ -2669,6 +2661,13 @@ bool GUI_App::on_init_inner() BOOST_LOG_TRIVIAL(info) << "create the main window"; mainframe = new MainFrame(); + m_updateDialog = new UpdateVersionDialog(mainframe); + m_updateDialog->Hide(); + m_updateDialog->Bind(EVT_DOWN_URL_PACK, [this](wxCommandEvent& event) { + auto downloadUlr = m_updateDialog->getUrl(); + wxLaunchDefaultBrowser(downloadUlr); + }); + // hide settings tabs after first Layout if (is_editor()) { mainframe->select_tab(size_t(0)); @@ -4859,7 +4858,6 @@ void GUI_App::check_new_version_sf(bool show_tips, bool by_user) return; } - //if (true) if (isForceUpgrade) { wxGetApp().app_config->set_bool("force_upgrade", version_info.force_upgrade); diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 6052f68401..40c61dd0c1 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -57,7 +57,13 @@ class wxBookCtrlBase; class Notebook; struct wxLanguageInfo; +namespace Slic3r { +namespace GUI { + class UpdateVersionDialog; +}; +}; +// namespace Slice3rnamespace GUI::Slice3rnamespace GUI namespace Slic3r { class AppConfig; @@ -719,6 +725,7 @@ private: PresetUpdater* preset_updater{ nullptr }; MainFrame* mainframe{ nullptr }; Plater* plater_{ nullptr }; + UpdateVersionDialog* m_updateDialog{nullptr}; PresetUpdater* get_preset_updater() { return preset_updater; } diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 10fb57d653..351ae4c16a 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -44,6 +44,7 @@ wxDEFINE_EVENT(EVT_UPDATE_NOZZLE, wxCommandEvent); wxDEFINE_EVENT(EVT_JUMP_TO_HMS, wxCommandEvent); wxDEFINE_EVENT(EVT_JUMP_TO_LIVEVIEW, wxCommandEvent); wxDEFINE_EVENT(EVT_UPDATE_TEXT_MSG, wxCommandEvent); +wxDEFINE_EVENT(EVT_DOWN_URL_PACK, wxCommandEvent); ReleaseNoteDialog::ReleaseNoteDialog(Plater *plater /*= nullptr*/) : DPIDialog(static_cast(wxGetApp().mainframe), wxID_ANY, _L("Release Note"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX) @@ -333,7 +334,13 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent) m_button_download->SetCursor(wxCURSOR_HAND); m_button_download->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { - EndModal(wxID_YES); + wxCommandEvent event(EVT_DOWN_URL_PACK); + + wxPostEvent(this, event); + if (isModal) + EndModal(wxID_NO); + else + Close(); }); m_button_skip_version = new Button(this, _L("Skip this Version")); @@ -347,7 +354,10 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent) m_button_skip_version->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { wxGetApp().set_skip_version(true); - EndModal(wxID_NO); + if (isModal) + EndModal(wxID_NO); + else + Close(); }); m_cb_stable_only = new CheckBox(this); @@ -377,7 +387,11 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent) m_button_cancel->SetCursor(wxCURSOR_HAND); m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { - EndModal(wxID_NO); + if (isModal) + EndModal(wxID_NO); + else + Close(); + }); m_sizer_main->Add(m_line_top, 0, wxEXPAND | wxBOTTOM, 0); diff --git a/src/slic3r/GUI/ReleaseNote.hpp b/src/slic3r/GUI/ReleaseNote.hpp index 9f211c86db..765a84cffd 100644 --- a/src/slic3r/GUI/ReleaseNote.hpp +++ b/src/slic3r/GUI/ReleaseNote.hpp @@ -51,6 +51,7 @@ wxDECLARE_EVENT(EVT_LOAD_VAMS_TRAY, wxCommandEvent); wxDECLARE_EVENT(EVT_JUMP_TO_HMS, wxCommandEvent); wxDECLARE_EVENT(EVT_JUMP_TO_LIVEVIEW, wxCommandEvent); wxDECLARE_EVENT(EVT_UPDATE_TEXT_MSG, wxCommandEvent); +wxDECLARE_EVENT(EVT_DOWN_URL_PACK, wxCommandEvent); class ReleaseNoteDialog : public DPIDialog { @@ -95,6 +96,10 @@ public: void update_version_info(wxString release_note, wxString version); std::vector splitWithStl(std::string str, std::string pattern); + void setDialogMode(bool mode) { isModal = mode; } + std::string getUrl() { return m_url; } + void setUrl(const std::string downloadUrl) { m_url = downloadUrl; } + std::string m_url{""}; wxStaticBitmap* m_brand{nullptr}; Label * m_text_up_info{nullptr}; wxWebView* m_vebview_release_note{nullptr}; @@ -108,6 +113,7 @@ public: Button* m_button_download; Button* m_button_cancel; std::string url_line; + bool isModal = true; }; class SecondaryCheckDialog : public DPIFrame diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index fcf0491eea..5e2cffceb0 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -1428,8 +1428,7 @@ Updates PresetUpdater::priv::get_config_updates(const Semver &old_slic3r_version } } - bool version_match = ((vendor_ver.maj() == cache_ver.maj()) && (vendor_ver.min() == cache_ver.min())); - if (version_match && (vendor_ver < cache_ver)) { + if (vendor_ver < cache_ver) { Semver min_ver = get_min_version_from_json(file_path); Semver soft_ver = Semver(std::string(Snapmaker_VERSION)); From 9b43bff570d1864fb4dc67f4b73b47ee45bbf8a2 Mon Sep 17 00:00:00 2001 From: alves Date: Tue, 27 Jan 2026 10:48:48 +0800 Subject: [PATCH 12/20] feature remove the gcode export logic,and remove the Smooth mode entrance. --- src/slic3r/GUI/ConfigManipulation.cpp | 2 +- src/slic3r/GUI/MainFrame.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index b094f65ddc..367cd9d26a 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -846,7 +846,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co apply(config, &new_conf); } toggle_line("overhang_reverse_threshold", has_detect_overhang_wall && allow_overhang_reverse && has_overhang_reverse && !has_overhang_reverse_internal_only); - toggle_line("timelapse_type", true); + toggle_line("timelapse_type", is_BBL_Printer); bool have_small_area_infill_flow_compensation = config->opt_bool("small_area_infill_flow_compensation"); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 339f1c0009..e244c54dd6 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1747,8 +1747,8 @@ wxBoxSizer* MainFrame::create_side_tools() { SidePopup* p = new SidePopup(this); - // if (wxGetApp().preset_bundle && !wxGetApp().preset_bundle->is_bbl_vendor()) - if (0) { + if (wxGetApp().preset_bundle && !wxGetApp().preset_bundle->is_bbl_vendor()) + //if (0) { // ThirdParty Buttons SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), ""); export_gcode_btn->SetCornerRadius(0); From 334237b10fe219cbc1e1f26efaa9337cb0df0cb5 Mon Sep 17 00:00:00 2001 From: alves Date: Tue, 27 Jan 2026 10:53:32 +0800 Subject: [PATCH 13/20] fix build failed error bug. --- src/slic3r/GUI/MainFrame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index e244c54dd6..a6d4c42bb8 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1748,7 +1748,8 @@ wxBoxSizer* MainFrame::create_side_tools() SidePopup* p = new SidePopup(this); if (wxGetApp().preset_bundle && !wxGetApp().preset_bundle->is_bbl_vendor()) - //if (0) { + //if (0) + { // ThirdParty Buttons SideButton* export_gcode_btn = new SideButton(p, _L("Export G-code file"), ""); export_gcode_btn->SetCornerRadius(0); From 6f001117130f7e162281989d4a13f2af61a3ba42 Mon Sep 17 00:00:00 2001 From: alves Date: Tue, 27 Jan 2026 11:03:25 +0800 Subject: [PATCH 14/20] feature add verify for sentry module. --- src/sentry_wrapper/SentryWrapper.cpp | 207 +++++++++++++++------------ 1 file changed, 119 insertions(+), 88 deletions(-) diff --git a/src/sentry_wrapper/SentryWrapper.cpp b/src/sentry_wrapper/SentryWrapper.cpp index 53cfc6544f..95894ecff6 100644 --- a/src/sentry_wrapper/SentryWrapper.cpp +++ b/src/sentry_wrapper/SentryWrapper.cpp @@ -30,7 +30,9 @@ #include #include #include +#include #include "common_func/common_func.hpp" +#include namespace Slic3r { @@ -63,67 +65,6 @@ static sentry_value_t on_crash_callback(const sentry_ucontext_t* uctx, sentry_va return log; } -static sentry_value_t before_send(sentry_value_t event, void* hint, void* data) -{ - sentry_value_t level_val = sentry_value_get_by_key(event, SENTRY_KEY_LEVEL); - std::string levelName = sentry_value_as_string(level_val); - - std::string eventLevel = sentry_value_as_string(sentry_value_get_by_key(event, SENTRY_KEY_LEVEL)); - - //module name - sentry_value_t moduleValue = sentry_value_get_by_key(event, "logger"); - std::string moduleName = sentry_value_as_string(moduleValue); - - if (MACHINE_MODULE == moduleName) - { - srand((unsigned int) time(0)); - int random_num = rand() % 100; - int randNumber = rand() % 100 + 1; - if (randNumber < 85) - { - sentry_value_decref(event); - return sentry_value_new_null(); - } - else - { - return event; - } - } - - if (!get_privacy_policy() && levelName == SENTRY_EVENT_TRACE) { - - sentry_value_decref(event); - return sentry_value_new_null(); - } - - if (SENTRY_EVENT_FATAL == eventLevel || - SENTRY_EVENT_ERROR == eventLevel || - SENTRY_EVENT_TRACE == eventLevel) - { - return event; - } - else if (SENTRY_EVENT_WARNING == eventLevel) - { - srand((unsigned int) time(0)); - int random_num = rand() % 100; - int randNumber = rand() % 100 + 1; - if (randNumber > 5) - { - sentry_value_decref(event); - return sentry_value_new_null(); - } - else - { - return event; - } - } - - //info trace debug not report - sentry_value_decref(event); - return sentry_value_new_null(); - -} - void initSentryEx() { sentry_options_t* options = sentry_options_new(); @@ -154,43 +95,134 @@ void initSentryEx() dataBaseDir = home_env; dataBaseDir = dataBaseDir + "/Library/Application Support/Snapmaker_Orca/SentryData"; #elif _WIN32 - wchar_t exeDir[MAX_PATH]; - ::GetModuleFileNameW(nullptr, exeDir, MAX_PATH); - std::wstring wsExeDir(exeDir); - int nPos = wsExeDir.find_last_of('\\'); - std::wstring wsDmpDir = wsExeDir.substr(0, nPos + 1); - std::wstring desDir = wsDmpDir + L"crashpad_handler.exe"; - wsDmpDir += L"dump"; + // Use extended path length support for Windows (up to 32767 characters) + const DWORD MAX_PATH_EXTENDED = 32767; + wchar_t exeDir[MAX_PATH_EXTENDED]; + DWORD pathLen = ::GetModuleFileNameW(nullptr, exeDir, MAX_PATH_EXTENDED); + + // GetModuleFileNameW returns 0 on error, or the number of characters written (excluding null terminator) + // If return value equals buffer size, the path was truncated + if (pathLen == 0) { + // Failed to get module path, use fallback + DWORD lastError = GetLastError(); + std::cout<< "Failed to get module file name, error: " << lastError; + handlerDir = ""; + dataBaseDir = ""; + } else if (pathLen >= MAX_PATH_EXTENDED) { + // Path was truncated, which shouldn't happen with MAX_PATH_EXTENDED + std::cout<< "Module file path too long or truncated, length: " << pathLen; + handlerDir = ""; + dataBaseDir = ""; + } else { + // Ensure null termination (GetModuleFileNameW should do this, but be safe) + exeDir[pathLen] = L'\0'; + + std::wstring wsExeDir(exeDir, pathLen); + size_t nPos = wsExeDir.find_last_of(L'\\'); + + if (nPos == std::wstring::npos) { + // No backslash found, use current directory as fallback + std::cout<< "No backslash found in executable path, using current directory"; + nPos = 0; + } + + // Ensure nPos + 1 doesn't exceed string length + if (nPos + 1 > wsExeDir.length()) { + std::cout<< "Invalid path position, using full path"; + nPos = wsExeDir.length(); + } + + std::wstring wsDmpDir = wsExeDir.substr(0, nPos + 1); + std::wstring desDir = wsDmpDir + L"crashpad_handler.exe"; + wsDmpDir += L"dump"; - auto wstringTostring = [](std::wstring wTmpStr) -> std::string { - std::string resStr = std::string(); - int len = WideCharToMultiByte(CP_UTF8, 0, wTmpStr.c_str(), -1, nullptr, 0, nullptr, nullptr); - if (len <= 0) - return std::string(); + auto wstringTostring = [](const std::wstring& wTmpStr) -> std::string { + if (wTmpStr.empty()) + return std::string(); + + int len = WideCharToMultiByte(CP_UTF8, 0, wTmpStr.c_str(), -1, nullptr, 0, nullptr, nullptr); + if (len <= 0) { + std::cout<< "WideCharToMultiByte failed, error: " << GetLastError(); + return std::string(); + } - std::string desStr(len, 0); - WideCharToMultiByte(CP_UTF8, 0, wTmpStr.c_str(), -1, &desStr[0], len, nullptr, nullptr); - resStr = desStr; + // Allocate buffer with size len (includes null terminator) + std::string desStr; + desStr.resize(len - 1); // Reserve space excluding null terminator + int result = WideCharToMultiByte(CP_UTF8, 0, wTmpStr.c_str(), -1, &desStr[0], len, nullptr, nullptr); + if (result == 0 || result != len) { + std::cout<< "WideCharToMultiByte conversion failed, error: " << GetLastError(); + return std::string(); + } + + // Remove null terminator if present (safely check before accessing) + if (!desStr.empty() && desStr.back() == '\0') + desStr.pop_back(); - return resStr; - }; + return desStr; + }; - handlerDir = wstringTostring(desDir); + handlerDir = wstringTostring(desDir); + } + // Get LocalAppData folder path PWSTR pszPath = nullptr; - char* path = new char[MAX_PATH](); + char* path = nullptr; size_t pathLength = 0; HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &pszPath); - if (SUCCEEDED(hr)) { - wcstombs_s(&pathLength, path, MAX_PATH, pszPath, MAX_PATH); + if (SUCCEEDED(hr) && pszPath != nullptr) { + // Calculate required buffer size first + size_t wcsLen = wcslen(pszPath); + if (wcsLen > 0 && wcsLen < SIZE_MAX / 3) { // Check for overflow + // Allocate buffer with extra space for safety + size_t requiredSize = wcsLen * 3 + 1; // UTF-8 can be up to 3 bytes per wchar + path = new (std::nothrow) char[requiredSize](); + + if (path != nullptr) { + errno_t err = wcstombs_s(&pathLength, path, requiredSize, pszPath, _TRUNCATE); + if (err != 0) { + std::cout<< "wcstombs_s failed, error: " << err; + delete[] path; + path = nullptr; + } + } else { + std::cout<< "Failed to allocate memory for path conversion"; + } + } else if (wcsLen == 0) { + std::cout<< "SHGetKnownFolderPath returned empty path"; + } else { + std::cout<< "Path length overflow detected: " << wcsLen; + } + // Always free the path returned by SHGetKnownFolderPath CoTaskMemFree(pszPath); - } + pszPath = nullptr; + } else { + std::cout<< "SHGetKnownFolderPath failed, hr: " << std::hex << hr; + // Ensure pszPath is freed even on failure (though it should be nullptr) + if (pszPath != nullptr) { + CoTaskMemFree(pszPath); + pszPath = nullptr; + } + } - std::string filePath = path; - std::string appName = "\\" + std::string("Snapmaker_Orca\\"); - dataBaseDir = filePath + appName; - delete[] path; + if (path != nullptr) { + std::string filePath = path; + std::string appName = "\\" + std::string("Snapmaker_Orca\\"); + dataBaseDir = filePath + appName; + delete[] path; + path = nullptr; + } else { + // Fallback: use temp directory + char tempPath[MAX_PATH]; + if (GetTempPathA(MAX_PATH, tempPath) != 0) { + dataBaseDir = std::string(tempPath) + "Snapmaker_Orca\\"; + std::cout<< "Using temp directory as fallback for Sentry data: " << dataBaseDir; + } else { + dataBaseDir = ""; + std::cout<< "Failed to get temp path, Sentry data directory will be empty"; + } + } #endif if (!handlerDir.empty()) @@ -211,7 +243,6 @@ void initSentryEx() sentry_options_set_auto_session_tracking(options, 0); sentry_options_set_symbolize_stacktraces(options, 1); sentry_options_set_on_crash(options, on_crash_callback, NULL); - sentry_options_set_before_send(options, before_send, NULL); sentry_options_set_sample_rate(options, 1.0); sentry_options_set_traces_sample_rate(options, 1.0); From a076af19cec28ba9d05d2f0154631e925fc886d7 Mon Sep 17 00:00:00 2001 From: alves Date: Tue, 27 Jan 2026 11:09:13 +0800 Subject: [PATCH 15/20] feature format code, and use hot update for profile resource. --- src/slic3r/Utils/PresetUpdater.cpp | 31 ++++++++++-------------------- src/slic3r/Utils/PresetUpdater.hpp | 2 +- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 5e2cffceb0..72c6498964 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -1723,7 +1723,7 @@ void PresetUpdater::sync_web_async(bool isAutoUpdata) GUI::wxGetApp().CallAfter([this] { std::string zipfilepath = this->p->cache_path.string() + "/flutter_web.zip"; BOOST_LOG_TRIVIAL(debug) << "[Orca Updater] sync_web_async completed, checking updates..."; - load_lutter_web(zipfilepath, true); + load_flutter_web(zipfilepath, true); }); }); } @@ -1807,7 +1807,7 @@ bool PresetUpdater::version_check_enabled() const } -void PresetUpdater::load_lutter_web(const std::string& zip_file, bool serverUpdate) +void PresetUpdater::load_flutter_web(const std::string& zip_file, bool serverUpdate) { boost::filesystem::path temp_path = boost::filesystem::temp_directory_path() / "orca_temp_flutter_import"; try { @@ -1944,6 +1944,7 @@ void PresetUpdater::load_lutter_web(const std::string& zip_file, bool serverUpda app->recreate_GUI(_L("Update web resources")); } + } catch (std::exception& e) { BOOST_LOG_TRIVIAL(error) << "Failed to importweb resources: " << e.what(); @@ -1964,7 +1965,7 @@ void PresetUpdater::import_flutter_web() std::string zip_file = dialog.GetPath().ToUTF8().data(); - load_lutter_web(zip_file); + load_flutter_web(zip_file); } void PresetUpdater::import_system_profile() @@ -2095,7 +2096,6 @@ void PresetUpdater::import_system_profile() } // 5. 执行更新并提示结果 - bool need_restart = false; if (!updates.updates.empty()) { std::vector updates_msg; for (const auto& update : updates.updates) { @@ -2103,9 +2103,6 @@ void PresetUpdater::import_system_profile() if (update.is_directory) continue; - if (update.can_install) { - need_restart = true; - } std::string changelog = update.change_log; updates_msg.emplace_back(update.vendor, update.version.config_version, update.descriptions, std::move(changelog)); } @@ -2116,12 +2113,16 @@ void PresetUpdater::import_system_profile() if (res == wxID_OK) { p->perform_updates(std::move(updates)); + // Use hot reload instead of restart + if (!reload_configs_update_gui()) { + BOOST_LOG_TRIVIAL(warning) << "[Orca Updater]:reload_configs_update_gui failed for system profiles"; + } else { + BOOST_LOG_TRIVIAL(info) << "[Orca Updater]:System profiles updated successfully via hot reload"; + } } else { boost::filesystem::remove_all(temp_path); return; } - - } wxString message; @@ -2133,18 +2134,6 @@ void PresetUpdater::import_system_profile() GUI::MessageDialog(nullptr, message).ShowModal(); } - if (need_restart) { - GUI::MessageDialog msg_wingow(nullptr, - _L("Updating the system resources requires application restart.") + "\n" + - _L("Do you want to continue?"), - L("System resource update"), wxICON_QUESTION | wxOK | wxCANCEL); - if (msg_wingow.ShowModal() == wxID_CANCEL) { - return; - } - - app->recreate_GUI(_L("Update system profiles")); - } - } catch (std::exception& e) { BOOST_LOG_TRIVIAL(error) << "Failed to import presets: " << e.what(); GUI::MessageDialog(nullptr, _L("Import Failed")).ShowModal(); diff --git a/src/slic3r/Utils/PresetUpdater.hpp b/src/slic3r/Utils/PresetUpdater.hpp index f309654c5d..327007a579 100644 --- a/src/slic3r/Utils/PresetUpdater.hpp +++ b/src/slic3r/Utils/PresetUpdater.hpp @@ -65,7 +65,7 @@ public: void import_flutter_web(); - void load_lutter_web(const std::string& zip_file,bool serverUpdate = false); + void load_flutter_web(const std::string& zip_file,bool serverUpdate = false); void sync_config_async(); From 2927ef8e37b7f8ed52b93addf4f54286339d0a26 Mon Sep 17 00:00:00 2001 From: alves Date: Tue, 27 Jan 2026 11:17:46 +0800 Subject: [PATCH 16/20] feature remove not work code. --- src/slic3r/GUI/Plater.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index dc458d26a2..26f953ff49 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -13818,16 +13818,6 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn, bool us upload_job = PrintHostJob(physical_printer_config); } - //if (wxGetApp().app_config->get("use_new_connect") == "true") { - // /*std::shared_ptr temp; - // wxGetApp().get_connect_host(temp); - // upload_job.printhost = std::unique_ptr(temp.get());*/ - // upload_job = PrintHostJob(wxGetApp().get_host_config()); - //} else { - // upload_job = PrintHostJob(physical_printer_config); // - //} - - if (upload_job.empty()) return; From 772291e05fbc2658a817572d58f76bd65484a548 Mon Sep 17 00:00:00 2001 From: alves Date: Tue, 27 Jan 2026 18:01:05 +0800 Subject: [PATCH 17/20] feature remove the webview invalid bury point. --- src/slic3r/GUI/MarkdownTip.cpp | 1 - src/slic3r/GUI/PrinterWebView.cpp | 1 - src/slic3r/GUI/ReleaseNote.cpp | 1 - src/slic3r/GUI/WebDeviceDialog.cpp | 2 +- src/slic3r/GUI/WebGuideDialog.cpp | 2 +- src/slic3r/GUI/WebPreprintDialog.cpp | 2 +- src/slic3r/GUI/WebPresetDialog.cpp | 2 +- src/slic3r/GUI/WebSMUserLoginDialog.cpp | 2 +- src/slic3r/GUI/WebUrlDialog.cpp | 2 +- src/slic3r/GUI/WebUserLoginDialog.cpp | 2 +- src/slic3r/GUI/WebViewDialog.cpp | 2 +- 11 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/MarkdownTip.cpp b/src/slic3r/GUI/MarkdownTip.cpp index bfd9608a0e..0ceee2a278 100644 --- a/src/slic3r/GUI/MarkdownTip.cpp +++ b/src/slic3r/GUI/MarkdownTip.cpp @@ -281,7 +281,6 @@ void MarkdownTip::OnError(wxWebViewEvent& event) case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break; } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":MarkdownTip error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init MarkdownTip webview fail", BP_WEB_VIEW); } void MarkdownTip::OnTimer(wxTimerEvent& event) diff --git a/src/slic3r/GUI/PrinterWebView.cpp b/src/slic3r/GUI/PrinterWebView.cpp index e2cb533bbd..685cf92685 100644 --- a/src/slic3r/GUI/PrinterWebView.cpp +++ b/src/slic3r/GUI/PrinterWebView.cpp @@ -185,7 +185,6 @@ void PrinterWebView::OnError(wxWebViewEvent &evt) break; } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":PrinterWebView error loading page %1% %2% %3% %4%") %evt.GetURL() %evt.GetTarget() %e %evt.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init PrinterWebView webview fail", BP_WEB_VIEW); } void PrinterWebView::OnLoaded(wxWebViewEvent &evt) diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 351ae4c16a..5015d4dad2 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -460,7 +460,6 @@ void UpdateVersionDialog::OnError(wxWebViewEvent& event) case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break; } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":UpdateVersionDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e %event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init UpdateVersionDialog webview fail", BP_WEB_VIEW); event.Skip(); } diff --git a/src/slic3r/GUI/WebDeviceDialog.cpp b/src/slic3r/GUI/WebDeviceDialog.cpp index c7addbad3a..d2cd54832f 100644 --- a/src/slic3r/GUI/WebDeviceDialog.cpp +++ b/src/slic3r/GUI/WebDeviceDialog.cpp @@ -118,7 +118,7 @@ void WebDeviceDialog::OnError(wxWebViewEvent &evt) case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break; } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebDeviceDialog error loading page %1% %2% %3% %4%") % evt.GetURL() % evt.GetTarget() % e %evt.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebDeviceDialog webview fail", BP_WEB_VIEW); + } void WebDeviceDialog::OnScriptMessage(wxWebViewEvent &evt) diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 9f3cfb3e32..5c405af516 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -611,7 +611,7 @@ void GuideFrame::OnError(wxWebViewEvent& event) } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":GuideFrame error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init GuideFrame webview fail", BP_WEB_VIEW); + } void GuideFrame::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt)) diff --git a/src/slic3r/GUI/WebPreprintDialog.cpp b/src/slic3r/GUI/WebPreprintDialog.cpp index 7068d93ab2..1ec1cfa56e 100644 --- a/src/slic3r/GUI/WebPreprintDialog.cpp +++ b/src/slic3r/GUI/WebPreprintDialog.cpp @@ -167,7 +167,7 @@ void WebPreprintDialog::OnError(wxWebViewEvent &event) } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebPreprintDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebPreprintDialog webview fail", BP_WEB_VIEW); + } void WebPreprintDialog::OnScriptMessage(wxWebViewEvent &evt) diff --git a/src/slic3r/GUI/WebPresetDialog.cpp b/src/slic3r/GUI/WebPresetDialog.cpp index b38bda9da4..b8f07a3da8 100644 --- a/src/slic3r/GUI/WebPresetDialog.cpp +++ b/src/slic3r/GUI/WebPresetDialog.cpp @@ -707,7 +707,7 @@ void WebPresetDialog::OnError(wxWebViewEvent& event) } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebPresetDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebPresetDialog webview fail", BP_WEB_VIEW); + } void WebPresetDialog::OnScriptResponseMessage(wxCommandEvent& WXUNUSED(evt)) diff --git a/src/slic3r/GUI/WebSMUserLoginDialog.cpp b/src/slic3r/GUI/WebSMUserLoginDialog.cpp index 79fa7c3450..9cf1474d8a 100644 --- a/src/slic3r/GUI/WebSMUserLoginDialog.cpp +++ b/src/slic3r/GUI/WebSMUserLoginDialog.cpp @@ -400,7 +400,7 @@ void SMUserLogin::OnError(wxWebViewEvent &event) case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break; } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":SMUserLogin error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init SMUserLogin webview fail", BP_WEB_VIEW); + } void SMUserLogin::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt)) diff --git a/src/slic3r/GUI/WebUrlDialog.cpp b/src/slic3r/GUI/WebUrlDialog.cpp index c6ea8de44b..d507a2401b 100644 --- a/src/slic3r/GUI/WebUrlDialog.cpp +++ b/src/slic3r/GUI/WebUrlDialog.cpp @@ -130,7 +130,7 @@ void WebUrlDialog::OnError(wxWebViewEvent &event) } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":WebUrlDialog error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebUrlDialog webview fail", BP_WEB_VIEW); + } void WebUrlDialog::OnScriptMessage(wxWebViewEvent &evt) diff --git a/src/slic3r/GUI/WebUserLoginDialog.cpp b/src/slic3r/GUI/WebUserLoginDialog.cpp index 86e02f7193..f0118926f2 100644 --- a/src/slic3r/GUI/WebUserLoginDialog.cpp +++ b/src/slic3r/GUI/WebUserLoginDialog.cpp @@ -374,7 +374,7 @@ void ZUserLogin::OnError(wxWebViewEvent &event) case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break; } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":ZUserLogin error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init ZUserLogin webview fail", BP_WEB_VIEW); + } void ZUserLogin::OnScriptResponseMessage(wxCommandEvent &WXUNUSED(evt)) diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp index ac4c26943b..3895fb65f4 100644 --- a/src/slic3r/GUI/WebViewDialog.cpp +++ b/src/slic3r/GUI/WebViewDialog.cpp @@ -908,7 +908,7 @@ void WebViewPanel::OnError(wxWebViewEvent& event) case wxWEBVIEW_NAV_ERR_OTHER: e = "wxWEBVIEW_NAV_ERR_OTHER"; break; } BOOST_LOG_TRIVIAL(fatal) << __FUNCTION__<< boost::format(":PrinterWebView error loading page %1% %2% %3% %4%") % event.GetURL() % event.GetTarget() %e % event.GetString(); - Slic3r::sentryReportLog(Slic3r::SENTRY_LOG_FATAL, "bury_point_init WebViewPanel webview fail", BP_WEB_VIEW); + } From a35316aba009f72d0d0a5525b6822be818ac7743 Mon Sep 17 00:00:00 2001 From: alves Date: Wed, 28 Jan 2026 09:42:36 +0800 Subject: [PATCH 18/20] feature signs for all build on mac os. --- .github/workflows/build_orca.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index b2bb032640..c2cddc2570 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -122,7 +122,7 @@ jobs: # Thanks to RaySajuuk, it's working now - name: Sign app and notary - if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' + if: inputs.os == 'macos-14' working-directory: ${{ github.workspace }} env: BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} @@ -303,7 +303,8 @@ jobs: fi - name: Create DMG without notary - if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' && github.ref != 'refs/heads/2.2.0' + #if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' && github.ref != 'refs/heads/2.2.0' + if: inputs.os == 'macos-14' working-directory: ${{ github.workspace }} run: | mkdir -p ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg From f52f346e40a8ce83f7da6b6a906bcce29e1727df Mon Sep 17 00:00:00 2001 From: alves Date: Wed, 28 Jan 2026 15:32:34 +0800 Subject: [PATCH 19/20] fix revert the changed for signs. --- .github/workflows/build_orca.yml | 105 ++++--------------------------- 1 file changed, 13 insertions(+), 92 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index c2cddc2570..d08fe92e37 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -122,7 +122,7 @@ jobs: # Thanks to RaySajuuk, it's working now - name: Sign app and notary - if: inputs.os == 'macos-14' + if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14' working-directory: ${{ github.workspace }} env: BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} @@ -144,70 +144,33 @@ jobs: APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" ENTITLEMENTS_PATH="${{ github.workspace }}/scripts/disable_validation.entitlements" - # Verify entitlements file exists - if [ ! -f "$ENTITLEMENTS_PATH" ]; then - echo "Error: Entitlements file not found: $ENTITLEMENTS_PATH" - exit 1 - fi - echo "Using entitlements: $ENTITLEMENTS_PATH" - - # Sign Frameworks (must succeed, no silent failures) echo "Signing Frameworks..." if [ -d "$APP_PATH/Contents/Frameworks" ]; then find "$APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do if [ -f "$item" ] || [ -d "$item" ]; then - echo " Signing: $item" - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { - echo "Error: Failed to sign $item" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true fi done fi - # Sign MacOS executables (must succeed, no silent failures) echo "Signing MacOS executables..." if [ -d "$APP_PATH/Contents/MacOS" ]; then find "$APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do - echo " Signing: $item" - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { - echo "Error: Failed to sign $item" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true done fi - # Sign main app with entitlements echo "Signing main app with entitlements..." - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$APP_PATH" || { - echo "Error: Failed to sign main app" - exit 1 - } - - # Verify signature - echo "Verifying signature..." - codesign --verify --verbose "$APP_PATH" || { - echo "Error: Signature verification failed" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$APP_PATH" # Verify entitlements are embedded - echo "Verifying entitlements are embedded..." - EMBEDDED_ENTITLEMENTS=$(codesign -d --entitlements - "$APP_PATH" 2>&1) - if echo "$EMBEDDED_ENTITLEMENTS" | grep -q "com.apple.security.network.client"; then + echo "Verifying entitlements..." + if codesign -d --entitlements - "$APP_PATH" 2>&1 | grep -q "com.apple.security.network.client"; then echo "✓ Entitlements successfully embedded" - echo " Found network.client entitlement" else - echo "✗ Error: Entitlements not embedded correctly" - echo " Embedded entitlements output:" - echo "$EMBEDDED_ENTITLEMENTS" | head -20 - exit 1 + echo "⚠ Warning: Entitlements may not be embedded correctly" fi - # Display full entitlements for debugging - echo "Full embedded entitlements:" - codesign -d --entitlements - "$APP_PATH" 2>&1 | head -30 - # Sign Snapmaker_Orca_profile_validator.app if it exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then VALIDATOR_APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app" @@ -216,11 +179,7 @@ jobs: if [ -d "$VALIDATOR_APP_PATH/Contents/Frameworks" ]; then find "$VALIDATOR_APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do if [ -f "$item" ] || [ -d "$item" ]; then - echo " Signing: $item" - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { - echo "Error: Failed to sign $item" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true fi done fi @@ -228,25 +187,12 @@ jobs: echo "Signing profile validator MacOS executables..." if [ -d "$VALIDATOR_APP_PATH/Contents/MacOS" ]; then find "$VALIDATOR_APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do - echo " Signing: $item" - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" || { - echo "Error: Failed to sign $item" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true done fi echo "Signing profile validator app with entitlements..." - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$VALIDATOR_APP_PATH" || { - echo "Error: Failed to sign profile validator app" - exit 1 - } - - # Verify profile validator signature - codesign --verify --verbose "$VALIDATOR_APP_PATH" || { - echo "Error: Profile validator signature verification failed" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$VALIDATOR_APP_PATH" fi # Create main Snapmaker Orca DMG without the profile validator helper @@ -255,19 +201,7 @@ jobs: cp -R "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" "${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/" ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/Applications hdiutil create -volname "Snapmaker_Orca" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" - - # Sign DMG (DMG files don't need entitlements, just signature) - echo "Signing DMG..." - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" || { - echo "Error: Failed to sign DMG" - exit 1 - } - - # Verify DMG signature - codesign --verify --verbose "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" || { - echo "Error: DMG signature verification failed" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" # Create separate Snapmaker_Orca_profile_validator DMG if the app exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then @@ -276,19 +210,7 @@ jobs: cp -R ${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/ ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/Applications hdiutil create -volname "Snapmaker_Orca Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" - - # Sign DMG (DMG files don't need entitlements, just signature) - echo "Signing profile validator DMG..." - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" || { - echo "Error: Failed to sign profile validator DMG" - exit 1 - } - - # Verify DMG signature - codesign --verify --verbose "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" || { - echo "Error: Profile validator DMG signature verification failed" - exit 1 - } + codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" fi # Notarize main DMG @@ -303,8 +225,7 @@ jobs: fi - name: Create DMG without notary - #if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' && github.ref != 'refs/heads/2.2.0' - if: inputs.os == 'macos-14' + if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' && github.ref != 'refs/heads/2.2.0' working-directory: ${{ github.workspace }} run: | mkdir -p ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg From 367178b6649c63a9eeee789d355aefe0929da05f Mon Sep 17 00:00:00 2001 From: alves Date: Wed, 28 Jan 2026 15:34:53 +0800 Subject: [PATCH 20/20] feature revert the entitlements changed for pack the dmg --- .github/workflows/build_orca.yml | 58 +++----------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index d08fe92e37..6599f4e4de 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -139,60 +139,10 @@ jobs: security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH - - # Sign Snapmaker Orca.app with entitlements (manual recursive signing, not using --deep) - APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" - ENTITLEMENTS_PATH="${{ github.workspace }}/scripts/disable_validation.entitlements" - - echo "Signing Frameworks..." - if [ -d "$APP_PATH/Contents/Frameworks" ]; then - find "$APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do - if [ -f "$item" ] || [ -d "$item" ]; then - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true - fi - done - fi - - echo "Signing MacOS executables..." - if [ -d "$APP_PATH/Contents/MacOS" ]; then - find "$APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true - done - fi - - echo "Signing main app with entitlements..." - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$APP_PATH" - - # Verify entitlements are embedded - echo "Verifying entitlements..." - if codesign -d --entitlements - "$APP_PATH" 2>&1 | grep -q "com.apple.security.network.client"; then - echo "✓ Entitlements successfully embedded" - else - echo "⚠ Warning: Entitlements may not be embedded correctly" - fi - + codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" # Sign Snapmaker_Orca_profile_validator.app if it exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then - VALIDATOR_APP_PATH="${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app" - - echo "Signing profile validator Frameworks..." - if [ -d "$VALIDATOR_APP_PATH/Contents/Frameworks" ]; then - find "$VALIDATOR_APP_PATH/Contents/Frameworks" -name "*.dylib" -o -name "*.framework" | while read -r item; do - if [ -f "$item" ] || [ -d "$item" ]; then - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true - fi - done - fi - - echo "Signing profile validator MacOS executables..." - if [ -d "$VALIDATOR_APP_PATH/Contents/MacOS" ]; then - find "$VALIDATOR_APP_PATH/Contents/MacOS" -type f -perm +111 | while read -r item; do - codesign --force --verbose --options runtime --timestamp --sign "$CERTIFICATE_ID" "$item" 2>/dev/null || true - done - fi - - echo "Signing profile validator app with entitlements..." - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "$VALIDATOR_APP_PATH" + codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app fi # Create main Snapmaker Orca DMG without the profile validator helper @@ -201,7 +151,7 @@ jobs: cp -R "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker Orca.app" "${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/" ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg/Applications hdiutil create -volname "Snapmaker_Orca" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" + codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_Mac_universal_${{ env.ver }}.dmg" # Create separate Snapmaker_Orca_profile_validator DMG if the app exists if [ -f "${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator" ]; then @@ -210,7 +160,7 @@ jobs: cp -R ${{ github.workspace }}/build/universal/Snapmaker_Orca/Snapmaker_Orca_profile_validator.app ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/ ln -sfn /Applications ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg/Applications hdiutil create -volname "Snapmaker_Orca Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/Snapmaker_Orca_profile_validator_dmg -ov -format UDZO "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" - codesign --force --verbose --options runtime --timestamp --entitlements "$ENTITLEMENTS_PATH" --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" + codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" "${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg" fi # Notarize main DMG