mirror of
https://github.com/palera1n/palera1n.git
synced 2026-11-21 04:43:41 +01:00
refactor: libciderra1n support (#764)
* refactor refactor: remove wdi refactor: move openra1n to its own library refactor: move everything standalone file to src root * submodule * okay these shouldnt of been included * remove * readd * fix openra1n libusb * liteusb for ra1ncovery * fix action * token * whatever lwra bw apwxidix * I knew this was gonna happen * fix mac build * what if this doesnt work * okay bro * lzma resources * rename * use idevice++, fix multiple devices, enter recovery * whatever * fix * --force-enable-ssv * improve exploit stuff, mirror tui logic to gui also cooool logging for libopenra1n * fix idevice windows build * lets not be fancy * new idevice patch * easier to read * lets hope this action works! * remove useless ifs * not required for non tui * PLEASE COMPILE * gsed lmao * this might work idk * whatever bro * ah * amd fix * fix ts * fix * licensing * update paleinfo * LETS NOT do that * forgot a file
This commit is contained in:
128 files changed
+12054
-3114
No files matched your search
+29
-2
@@ -1,10 +1,37 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_GUI
|
||||
|
||||
#include "AppFrame.hpp"
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "../utils.h"
|
||||
#include "../event.hpp"
|
||||
#include "../globals.h"
|
||||
#include "../events/event.hpp"
|
||||
|
||||
wxDEFINE_EVENT(EVT_DEVICE_STATE_UPDATE, wxCommandEvent);
|
||||
|
||||
|
||||
+28
-1
@@ -1,10 +1,37 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef APPFRAME_H
|
||||
#define APPFRAME_H
|
||||
|
||||
#ifdef WITH_GUI
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "../event.hpp"
|
||||
#include "../events/event.hpp"
|
||||
|
||||
#include "MainPanel.hpp"
|
||||
#include "SettingsPanel.hpp"
|
||||
|
||||
+28
-1
@@ -1,8 +1,35 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DEVICEPANEL_H
|
||||
#define DEVICEPANEL_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "../event.hpp"
|
||||
#include "../events/event.hpp"
|
||||
|
||||
class MainFrame;
|
||||
class DevicePanel : public wxPanel
|
||||
|
||||
+137
-149
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_GUI
|
||||
|
||||
#include "DfuPanel.hpp"
|
||||
@@ -5,9 +32,8 @@
|
||||
#include "AppFrame.hpp"
|
||||
#include "DevicePanel.hpp"
|
||||
|
||||
#include "../event.hpp"
|
||||
#include "../events/event.hpp"
|
||||
#include "../sequence.hpp"
|
||||
#include "../utils.h"
|
||||
#include "../globals.h"
|
||||
#include "../paleinfo.h"
|
||||
|
||||
@@ -19,19 +45,17 @@
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/statline.h>
|
||||
|
||||
#include "../gen/images/atv_std_brd.h"
|
||||
#include "../gen/images/ipad.h"
|
||||
#include "../gen/images/ipadmini.h"
|
||||
#include "../gen/images/iphone6s.h"
|
||||
#include "../gen/images/iphone7.h"
|
||||
#include "../gen/images/iphone8.h"
|
||||
#include "../gen/images/iphonese.h"
|
||||
#include "../gen/images/iphonex.h"
|
||||
#include "../gen/images/ipodtouch.h"
|
||||
#include "../gen/images/siriremote.h"
|
||||
#include "../gen/images/logo.h"
|
||||
|
||||
#include <libirecovery.h>
|
||||
#include "../gen/embedded/atv_std_brd.h"
|
||||
#include "../gen/embedded/ipad.h"
|
||||
#include "../gen/embedded/ipadmini.h"
|
||||
#include "../gen/embedded/iphone6s.h"
|
||||
#include "../gen/embedded/iphone7.h"
|
||||
#include "../gen/embedded/iphone8.h"
|
||||
#include "../gen/embedded/iphonese.h"
|
||||
#include "../gen/embedded/iphonex.h"
|
||||
#include "../gen/embedded/ipodtouch.h"
|
||||
#include "../gen/embedded/siriremote.h"
|
||||
#include "../gen/embedded/logo.h"
|
||||
|
||||
DfuPanel::DfuPanel(MainFrame* frame, wxWindow* parent)
|
||||
: DevicePanel(frame, parent)
|
||||
@@ -40,7 +64,7 @@ DfuPanel::DfuPanel(MainFrame* frame, wxWindow* parent)
|
||||
|
||||
auto* root = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto* left = new wxBoxSizer(wxVERTICAL);
|
||||
wxMemoryInputStream stream(images_logo_png, images_logo_png_len);
|
||||
wxMemoryInputStream stream(embedded_logo_png, embedded_logo_png_len);
|
||||
wxImage img(stream, wxBITMAP_TYPE_PNG);
|
||||
wxBitmap bmp(img);
|
||||
auto* logo = new wxStaticBitmap(this, wxID_ANY, bmp);
|
||||
@@ -131,20 +155,20 @@ void DfuPanel::SetDeviceState(const DeviceState& state)
|
||||
if (m_isEnteringDfu && state.mode == DeviceMode::DFU)
|
||||
{
|
||||
m_isEnteringDfu = false;
|
||||
m_headerText->SetLabel("Device entered DFU mode successfully.\n");
|
||||
m_headerText->SetLabel("Device entered DFU mode successfully.");
|
||||
|
||||
m_index = m_sequence.steps.size();
|
||||
m_stepRemaining = -1;
|
||||
m_actionExecutedIndex = -1;
|
||||
|
||||
const wxColour kInactive =
|
||||
const wxColour inactive =
|
||||
wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
|
||||
|
||||
for (auto* lbl : m_stepLabels)
|
||||
lbl->SetForegroundColour(kInactive);
|
||||
lbl->SetForegroundColour(inactive);
|
||||
|
||||
for (auto* lbl : m_buttonLabels)
|
||||
lbl->SetForegroundColour(kInactive);
|
||||
lbl->SetForegroundColour(inactive);
|
||||
|
||||
if (!m_stagnentTimer.IsRunning())
|
||||
m_stagnentTimer.StartOnce(3000);
|
||||
@@ -194,10 +218,10 @@ void DfuPanel::OnShow(wxShowEvent& event)
|
||||
|
||||
void DfuPanel::LoadDevice(const std::string& productType)
|
||||
{
|
||||
const wxColour kActive =
|
||||
const wxColour active =
|
||||
wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
|
||||
|
||||
const wxColour kInactive =
|
||||
const wxColour inactive =
|
||||
wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
|
||||
|
||||
m_sequence = ParseSequence(productType);
|
||||
@@ -221,53 +245,53 @@ void DfuPanel::LoadDevice(const std::string& productType)
|
||||
|
||||
if (m_sequence.imageName == "ipadmini")
|
||||
{
|
||||
imageData = images_ipadmini_png;
|
||||
imageSize = images_ipadmini_png_len;
|
||||
imageData = embedded_ipadmini_png;
|
||||
imageSize = embedded_ipadmini_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "ipad")
|
||||
{
|
||||
imageData = images_ipad_png;
|
||||
imageSize = images_ipad_png_len;
|
||||
imageData = embedded_ipad_png;
|
||||
imageSize = embedded_ipad_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "iphonese")
|
||||
{
|
||||
imageData = images_iphonese_png;
|
||||
imageSize = images_iphonese_png_len;
|
||||
imageData = embedded_iphonese_png;
|
||||
imageSize = embedded_iphonese_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "iphone6s")
|
||||
{
|
||||
imageData = images_iphone6s_png;
|
||||
imageSize = images_iphone6s_png_len;
|
||||
imageData = embedded_iphone6s_png;
|
||||
imageSize = embedded_iphone6s_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "iphone7")
|
||||
{
|
||||
imageData = images_iphone7_png;
|
||||
imageSize = images_iphone7_png_len;
|
||||
imageData = embedded_iphone7_png;
|
||||
imageSize = embedded_iphone7_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "iphone8")
|
||||
{
|
||||
imageData = images_iphone8_png;
|
||||
imageSize = images_iphone8_png_len;
|
||||
imageData = embedded_iphone8_png;
|
||||
imageSize = embedded_iphone8_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "iphonex")
|
||||
{
|
||||
imageData = images_iphonex_png;
|
||||
imageSize = images_iphonex_png_len;
|
||||
imageData = embedded_iphonex_png;
|
||||
imageSize = embedded_iphonex_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "ipodtouch")
|
||||
{
|
||||
imageData = images_ipodtouch_png;
|
||||
imageSize = images_ipodtouch_png_len;
|
||||
imageData = embedded_ipodtouch_png;
|
||||
imageSize = embedded_ipodtouch_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "siriremote")
|
||||
{
|
||||
imageData = images_siriremote_png;
|
||||
imageSize = images_siriremote_png_len;
|
||||
imageData = embedded_siriremote_png;
|
||||
imageSize = embedded_siriremote_png_len;
|
||||
}
|
||||
else if (m_sequence.imageName == "atv_std_brd")
|
||||
{
|
||||
imageData = images_atv_std_brd_png;
|
||||
imageSize = images_atv_std_brd_png_len;
|
||||
imageData = embedded_atv_std_brd_png;
|
||||
imageSize = embedded_atv_std_brd_png_len;
|
||||
}
|
||||
|
||||
if (imageData)
|
||||
@@ -318,7 +342,7 @@ void DfuPanel::LoadDevice(const std::string& productType)
|
||||
label
|
||||
);
|
||||
|
||||
lbl->SetForegroundColour(i == 0 ? kActive : kInactive);
|
||||
lbl->SetForegroundColour(i == 0 ? active : inactive);
|
||||
|
||||
m_stepsSizer->Add(lbl, 0, wxTOP, 5);
|
||||
m_stepLabels.push_back(lbl);
|
||||
@@ -340,7 +364,6 @@ void DfuPanel::StartSequence(const DfuSequence& seq)
|
||||
m_actionExecutedIndex = -1;
|
||||
|
||||
RunStep();
|
||||
m_timer.StartOnce(1000);
|
||||
}
|
||||
|
||||
void DfuPanel::RunStep()
|
||||
@@ -348,108 +371,91 @@ void DfuPanel::RunStep()
|
||||
if (m_sequence.steps.empty())
|
||||
return;
|
||||
|
||||
const wxColour kActive =
|
||||
const wxColour active =
|
||||
wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
|
||||
|
||||
const wxColour kInactive =
|
||||
const wxColour inactive =
|
||||
wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
|
||||
|
||||
if (m_index < m_sequence.steps.size())
|
||||
{
|
||||
if (m_stepRemaining < 0)
|
||||
{
|
||||
m_stepRemaining = m_sequence.steps[m_index].duration;
|
||||
}
|
||||
else if (m_stepRemaining > 0)
|
||||
{
|
||||
--m_stepRemaining;
|
||||
}
|
||||
|
||||
if (m_stepRemaining == 0)
|
||||
{
|
||||
++m_index;
|
||||
|
||||
if (m_index < m_sequence.steps.size())
|
||||
m_stepRemaining = m_sequence.steps[m_index].duration;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_index >= m_sequence.steps.size())
|
||||
{
|
||||
for (auto* lbl : m_stepLabels)
|
||||
lbl->SetForegroundColour(kInactive);
|
||||
|
||||
Layout();
|
||||
Refresh();
|
||||
lbl->SetForegroundColour(inactive);
|
||||
|
||||
m_timer.Stop();
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_stepLabels.size(); ++i)
|
||||
{
|
||||
auto* lbl = m_stepLabels[i];
|
||||
const auto& step = m_sequence.steps[i];
|
||||
|
||||
lbl->SetForegroundColour(i == m_index ? active : inactive);
|
||||
|
||||
int remaining = step.duration;
|
||||
|
||||
if (i == m_index)
|
||||
remaining = m_stepRemaining;
|
||||
else if (i < m_index)
|
||||
remaining = 0;
|
||||
|
||||
lbl->SetLabel(wxString::Format(
|
||||
"%zu. %s (%d)",
|
||||
i + 1,
|
||||
step.description,
|
||||
remaining
|
||||
));
|
||||
}
|
||||
|
||||
for (auto* lbl : m_buttonLabels)
|
||||
lbl->SetForegroundColour(inactive);
|
||||
|
||||
for (const auto& buttonId : m_sequence.steps[m_index].activeButtons)
|
||||
{
|
||||
for (const auto& btn : m_sequence.buttons)
|
||||
{
|
||||
if (btn.id != buttonId)
|
||||
continue;
|
||||
|
||||
for (auto* lbl : m_buttonLabels)
|
||||
{
|
||||
if (lbl->GetLabel() == btn.name)
|
||||
lbl->SetForegroundColour(active);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto& step = m_sequence.steps[m_index];
|
||||
|
||||
if (m_stepRemaining < 0)
|
||||
m_stepRemaining = step.duration;
|
||||
|
||||
if (m_stepRemaining > 0)
|
||||
--m_stepRemaining;
|
||||
|
||||
bool finished = (m_stepRemaining == 0);
|
||||
size_t completedIndex = m_index;
|
||||
|
||||
if (finished)
|
||||
if (!step.action.empty() &&
|
||||
m_actionExecutedIndex != static_cast<int>(m_index))
|
||||
{
|
||||
++m_index;
|
||||
m_stepRemaining = -1;
|
||||
}
|
||||
m_actionExecutedIndex = m_index;
|
||||
|
||||
for (size_t i = 0; i < m_stepLabels.size(); i++)
|
||||
{
|
||||
auto* lbl = m_stepLabels[i];
|
||||
|
||||
if (i == m_index)
|
||||
{
|
||||
lbl->SetForegroundColour(kActive);
|
||||
|
||||
lbl->SetLabel(wxString::Format(
|
||||
"%zu. %s (%d)",
|
||||
i + 1,
|
||||
m_sequence.steps[i].description,
|
||||
m_stepRemaining < 0 ? m_sequence.steps[i].duration : m_stepRemaining
|
||||
));
|
||||
}
|
||||
else if (finished && i == completedIndex)
|
||||
{
|
||||
lbl->SetForegroundColour(kInactive);
|
||||
|
||||
lbl->SetLabel(wxString::Format(
|
||||
"%zu. %s (0)",
|
||||
i + 1,
|
||||
m_sequence.steps[i].description
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
lbl->SetForegroundColour(kInactive);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto* lbl : m_buttonLabels)
|
||||
lbl->SetForegroundColour(kInactive);
|
||||
|
||||
const auto& activeStep =
|
||||
(m_index < m_sequence.steps.size())
|
||||
? m_sequence.steps[m_index]
|
||||
: m_sequence.steps.back();
|
||||
|
||||
for (const auto& buttonId : activeStep.activeButtons)
|
||||
{
|
||||
for (const auto& btn : m_sequence.buttons)
|
||||
{
|
||||
if (btn.id == buttonId)
|
||||
{
|
||||
for (auto* lbl : m_buttonLabels)
|
||||
{
|
||||
if (lbl->GetLabel() == btn.name)
|
||||
lbl->SetForegroundColour(kActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_index < m_sequence.steps.size())
|
||||
{
|
||||
const auto& activeStep = m_sequence.steps[m_index];
|
||||
|
||||
if (!activeStep.action.empty() && m_actionExecutedIndex != m_index)
|
||||
{
|
||||
m_actionExecutedIndex = m_index;
|
||||
|
||||
if (activeStep.action == "reboot")
|
||||
{
|
||||
Reboot();
|
||||
}
|
||||
}
|
||||
if (step.action == "reboot")
|
||||
Reboot();
|
||||
}
|
||||
|
||||
Layout();
|
||||
@@ -468,25 +474,7 @@ void DfuPanel::Reboot()
|
||||
if (!state.connected || state.mode != DeviceMode::Recovery)
|
||||
return;
|
||||
|
||||
irecv_client_t client = nullptr;
|
||||
|
||||
int attempts = 0;
|
||||
const int max_attempts = 8;
|
||||
|
||||
while (attempts < max_attempts)
|
||||
{
|
||||
if (irecv_open_with_ecid(&client, state.ecid) == IRECV_E_SUCCESS)
|
||||
break;
|
||||
|
||||
attempts++;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
||||
}
|
||||
|
||||
if (!client) return;
|
||||
irecv_setenv(client, "auto-boot", "true");
|
||||
irecv_saveenv(client);
|
||||
irecv_reboot(client);
|
||||
irecv_close(client);
|
||||
exit_recovery();
|
||||
}).detach();
|
||||
}
|
||||
|
||||
|
||||
+28
-1
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DFUPANEL_H
|
||||
#define DFUPANEL_H
|
||||
|
||||
@@ -5,7 +32,7 @@
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "DevicePanel.hpp"
|
||||
#include "../event.hpp"
|
||||
#include "../events/event.hpp"
|
||||
#include "../sequence.hpp"
|
||||
|
||||
class DfuPanel;
|
||||
|
||||
+53
-22
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_GUI
|
||||
|
||||
#include "ExploitPanel.hpp"
|
||||
@@ -19,16 +46,15 @@ using std::atomic_bool;
|
||||
#include <memory>
|
||||
|
||||
#include "AppFrame.hpp"
|
||||
#include "../m8/run.h"
|
||||
#include "../utils.h"
|
||||
#include "../gen/images/logo.h"
|
||||
#include "../exploit.h"
|
||||
#include "../gen/embedded/logo.h"
|
||||
|
||||
ExploitPanel::ExploitPanel(MainFrame* frame, wxWindow* parent)
|
||||
: DevicePanel(frame, parent)
|
||||
{
|
||||
auto* root = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto* left = new wxBoxSizer(wxVERTICAL);
|
||||
wxMemoryInputStream stream(images_logo_png, images_logo_png_len);
|
||||
wxMemoryInputStream stream(embedded_logo_png, embedded_logo_png_len);
|
||||
wxImage img(stream, wxBITMAP_TYPE_PNG);
|
||||
wxBitmap bmp(img);
|
||||
auto* logo = new wxStaticBitmap(this, wxID_ANY, bmp);
|
||||
@@ -89,45 +115,50 @@ void ExploitPanel::StartExploit()
|
||||
return;
|
||||
}
|
||||
|
||||
auto state = std::make_shared<shared_t>();
|
||||
atomic_init(&state->stage, STAGE_RESET);
|
||||
atomic_init(&state->stop, false);
|
||||
atomic_init(&state->result, 0);
|
||||
auto stage = std::make_shared<std::atomic<int>>(STAGE_RESET);
|
||||
auto result = std::make_shared<std::atomic<int>>(0);
|
||||
|
||||
auto isFinished = std::make_shared<std::atomic<bool>>(false);
|
||||
|
||||
std::thread worker([state, isFinished]()
|
||||
std::thread worker([stage, result]()
|
||||
{
|
||||
exploit(state.get());
|
||||
isFinished->store(true);
|
||||
int ret = exploit(reinterpret_cast<int*>(stage.get()));
|
||||
result->store(ret);
|
||||
stage->store(ret == 0 ? STAGE_DONE : STAGE_ERROR);
|
||||
});
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int stage = atomic_load(&state->stage);
|
||||
int progress = stage_to_progress(stage);
|
||||
bool finished = isFinished->load();
|
||||
int currentStage = stage->load();
|
||||
int progress = stage_to_progress(currentStage);
|
||||
|
||||
wxTheApp->CallAfter([this, stage, progress, finished]()
|
||||
wxTheApp->CallAfter([this, currentStage, progress, stage, result]()
|
||||
{
|
||||
m_statusText->SetLabel(stage_to_string(stage));
|
||||
if (currentStage == STAGE_ERROR) {
|
||||
const char* error = err_to_string(result->load());
|
||||
m_statusText->SetLabel(
|
||||
wxString::Format("%s (%s)", stage_to_string(currentStage), error)
|
||||
);
|
||||
m_progressBar->SetValue(0);
|
||||
m_backButton->Enable();
|
||||
return;
|
||||
}
|
||||
|
||||
m_statusText->SetLabel(stage_to_string(currentStage));
|
||||
m_progressBar->SetValue(progress);
|
||||
|
||||
if (finished || stage == STAGE_DONE) {
|
||||
if (currentStage == STAGE_DONE) {
|
||||
m_backButton->Enable();
|
||||
}
|
||||
});
|
||||
|
||||
if (stage == STAGE_DONE || finished) {
|
||||
atomic_store(&state->stop, true);
|
||||
if (currentStage == STAGE_DONE || currentStage == STAGE_ERROR)
|
||||
break;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
|
||||
if (worker.joinable())
|
||||
worker.join();
|
||||
|
||||
}).detach();
|
||||
}
|
||||
|
||||
|
||||
+28
-1
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EXPLOITPANEL_HPP
|
||||
#define EXPLOITPANEL_HPP
|
||||
|
||||
@@ -5,7 +32,7 @@
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "DevicePanel.hpp"
|
||||
#include "../event.hpp"
|
||||
#include "../events/event.hpp"
|
||||
|
||||
class ExploitPanel;
|
||||
class ExploitPanel : public DevicePanel
|
||||
|
||||
+45
-21
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_GUI
|
||||
|
||||
#include "MainPanel.hpp"
|
||||
@@ -12,11 +39,10 @@
|
||||
#include "AppFrame.hpp"
|
||||
#include "DevicePanel.hpp"
|
||||
|
||||
#include "../event.hpp"
|
||||
#include "../events/event.hpp"
|
||||
#include "../globals.h"
|
||||
#include "../utils.h"
|
||||
#include "../paleinfo.h"
|
||||
#include "../gen/images/logo.h"
|
||||
#include "../gen/embedded/logo.h"
|
||||
|
||||
const char* deviceTextString = "No device connected";
|
||||
const char* deviceTextString2 = "Please connect a device to get started.\nEnsure version range is 15.0+";
|
||||
@@ -29,7 +55,7 @@ MainPanel::MainPanel(MainFrame* frame, wxWindow* parent)
|
||||
auto* left = new wxBoxSizer(wxVERTICAL);
|
||||
auto* right = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxMemoryInputStream stream(images_logo_png, images_logo_png_len);
|
||||
wxMemoryInputStream stream(embedded_logo_png, embedded_logo_png_len);
|
||||
wxImage img(stream, wxBITMAP_TYPE_PNG);
|
||||
wxBitmap bmp(img);
|
||||
|
||||
@@ -185,23 +211,21 @@ void MainPanel::SetDeviceState(const DeviceState& state)
|
||||
|
||||
if (m_deviceTitle && m_deviceSubtitle)
|
||||
{
|
||||
if (!state.connected)
|
||||
if (state.multipleDevices || state.connectedDeviceCount > 1)
|
||||
{
|
||||
if (state.connectedDeviceCount > 1)
|
||||
{
|
||||
m_deviceTitle->SetLabel("Multiple devices detected");
|
||||
m_deviceSubtitle->SetLabel(
|
||||
wxString::Format(
|
||||
"%u USB devices connected. Disconnect extras and keep only one device attached.",
|
||||
state.connectedDeviceCount
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceTitle->SetLabel(deviceTextString);
|
||||
m_deviceSubtitle->SetLabel(deviceTextString2);
|
||||
}
|
||||
m_deviceTitle->SetLabel("Multiple devices detected");
|
||||
m_deviceSubtitle->SetLabel(
|
||||
wxString::Format(
|
||||
"%u devices connected. Please only connect one device.\n",
|
||||
state.connectedDeviceCount
|
||||
)
|
||||
);
|
||||
m_startButton->Enable(false);
|
||||
}
|
||||
else if (!state.connected)
|
||||
{
|
||||
m_deviceTitle->SetLabel(deviceTextString);
|
||||
m_deviceSubtitle->SetLabel(deviceTextString2);
|
||||
m_startButton->Enable(false);
|
||||
}
|
||||
else
|
||||
@@ -209,7 +233,7 @@ void MainPanel::SetDeviceState(const DeviceState& state)
|
||||
const std::string versionString =
|
||||
state.productVersion.empty() ? "Unknown" : state.productVersion;
|
||||
const std::string productString =
|
||||
state.productType.empty() ? "Unknown" : state.productType;
|
||||
state.displayName.empty() ? (state.productType.empty() ? "Unknown" : state.productType) : state.displayName;
|
||||
const std::string ecidString = state.ecid != 0 ? ("ECID: " + std::to_string(state.ecid)) : "ECID: Unknown";
|
||||
|
||||
switch (state.mode)
|
||||
|
||||
+28
-1
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MAINPANEL_H
|
||||
#define MAINPANEL_H
|
||||
|
||||
@@ -5,7 +32,7 @@
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "DevicePanel.hpp"
|
||||
#include "../event.hpp"
|
||||
#include "../events/event.hpp"
|
||||
|
||||
class MainPanel;
|
||||
class MainPanel : public DevicePanel
|
||||
|
||||
+42
-31
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_GUI
|
||||
|
||||
#include "RecoveryPanel.hpp"
|
||||
@@ -13,15 +40,10 @@
|
||||
#include "AppFrame.hpp"
|
||||
#include "DevicePanel.hpp"
|
||||
|
||||
#include "../event.hpp"
|
||||
#include "../utils.h"
|
||||
#include "../events/event.hpp"
|
||||
#include "../globals.h"
|
||||
#include "../paleinfo.h"
|
||||
#include "../gen/images/logo.h"
|
||||
|
||||
#include <libimobiledevice/libimobiledevice.h>
|
||||
#include <libimobiledevice/lockdown.h>
|
||||
#include <libirecovery.h>
|
||||
#include "../gen/embedded/logo.h"
|
||||
|
||||
RecoveryPanel::RecoveryPanel(MainFrame* frame, wxWindow* parent)
|
||||
: DevicePanel(frame, parent)
|
||||
@@ -29,7 +51,7 @@ RecoveryPanel::RecoveryPanel(MainFrame* frame, wxWindow* parent)
|
||||
Bind(wxEVT_SHOW, &RecoveryPanel::OnShow, this);
|
||||
auto* root = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto* left = new wxBoxSizer(wxVERTICAL);
|
||||
wxMemoryInputStream stream(images_logo_png, images_logo_png_len);
|
||||
wxMemoryInputStream stream(embedded_logo_png, embedded_logo_png_len);
|
||||
wxImage img(stream, wxBITMAP_TYPE_PNG);
|
||||
wxBitmap bmp(img);
|
||||
auto* logo = new wxStaticBitmap(this, wxID_ANY, bmp);
|
||||
@@ -133,30 +155,19 @@ void RecoveryPanel::EnterRecoveryMode()
|
||||
std::thread([this]()
|
||||
{
|
||||
const auto deviceState = GetDeviceState();
|
||||
if (!deviceState.connected)
|
||||
return;
|
||||
|
||||
idevice_t device = nullptr;
|
||||
lockdownd_client_t client = nullptr;
|
||||
|
||||
if (idevice_new(&device, deviceState.udid.c_str()) != IDEVICE_E_SUCCESS)
|
||||
return;
|
||||
|
||||
if (lockdownd_client_new_with_handshake(
|
||||
device,
|
||||
&client,
|
||||
"palera1n") != LOCKDOWN_E_SUCCESS)
|
||||
{
|
||||
idevice_free(device);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!deviceState.connected) return;
|
||||
m_isEnteringRecovery = true;
|
||||
|
||||
lockdownd_enter_recovery(client);
|
||||
|
||||
lockdownd_client_free(client);
|
||||
idevice_free(device);
|
||||
bool success = enter_recovery();
|
||||
if (!success)
|
||||
{
|
||||
wxTheApp->CallAfter([this]()
|
||||
{
|
||||
m_isEnteringRecovery = false;
|
||||
m_statusText->SetLabel("Failed to enter recovery mode.");
|
||||
m_backButton->Enable();
|
||||
m_nextButton->Enable();
|
||||
});
|
||||
}
|
||||
}).detach();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef RECOVERYPANEL_H
|
||||
#define RECOVERYPANEL_H
|
||||
|
||||
|
||||
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_GUI
|
||||
|
||||
#include "SettingsPanel.hpp"
|
||||
@@ -10,17 +37,16 @@
|
||||
|
||||
#include "AppFrame.hpp"
|
||||
#include "DevicePanel.hpp"
|
||||
#include "../utils.h"
|
||||
#include "../globals.h"
|
||||
#include "../paleinfo.h"
|
||||
#include "../gen/images/logo.h"
|
||||
#include "../gen/embedded/logo.h"
|
||||
|
||||
SettingsPanel::SettingsPanel(MainFrame* frame, wxWindow* parent)
|
||||
: DevicePanel(frame, parent)
|
||||
{
|
||||
auto* root = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto* left = new wxBoxSizer(wxVERTICAL);
|
||||
wxMemoryInputStream stream(images_logo_png, images_logo_png_len);
|
||||
wxMemoryInputStream stream(embedded_logo_png, embedded_logo_png_len);
|
||||
wxImage img(stream, wxBITMAP_TYPE_PNG);
|
||||
wxBitmap bmp(img);
|
||||
auto* logo = new wxStaticBitmap(this, wxID_ANY, bmp);
|
||||
@@ -120,7 +146,6 @@ SettingsPanel::SettingsPanel(MainFrame* frame, wxWindow* parent)
|
||||
{
|
||||
wxString value = e.GetString();
|
||||
if (value.length() > (sizeof(boot_args) - 0x20)) {
|
||||
LOG_ERROR("Boot arguments too long");
|
||||
return;
|
||||
}
|
||||
snprintf(boot_args, sizeof(boot_args), "%s", value.ToStdString().c_str());
|
||||
|
||||
@@ -1,3 +1,30 @@
|
||||
/*
|
||||
* palera1n - https://palera.in
|
||||
*
|
||||
* Copyright (C) 2026 palera1n team
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SETTINGSPANEL_H
|
||||
#define SETTINGSPANEL_H
|
||||
|
||||
|
||||
Reference in new issue
Block a user