mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-22 18:19:49 +02:00
feat: add tui (#758)
This commit also contains an entire redesign of the GUI interface, which now contains a sidebar for all panels. Hopefully checkra1n approves :)
This commit is contained in:
42 files changed
+2895
-487
No files matched your search
+27
-40
@@ -3,6 +3,10 @@
|
||||
#include "ExploitPanel.hpp"
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/mstream.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/statline.h>
|
||||
|
||||
#include <thread>
|
||||
#ifdef __cplusplus
|
||||
@@ -17,42 +21,19 @@ using std::atomic_bool;
|
||||
#include "AppFrame.hpp"
|
||||
#include "../m8/run.h"
|
||||
#include "../utils.h"
|
||||
|
||||
static const char* stage_to_string(int stage)
|
||||
{
|
||||
switch (stage) {
|
||||
case STAGE_SETUP: return "Checking if device is ready";
|
||||
case STAGE_SPRAY: return "Setting up the exploit (this is the heap spray)";
|
||||
case STAGE_PATCH: return "Right before trigger (this is the real bug setup)";
|
||||
case STAGE_YOLODFU: return "Booting PongoOS...";
|
||||
case STAGE_PONGO: return "Booting...";
|
||||
case STAGE_DONE: return "Done.";
|
||||
default: return "Idle.";
|
||||
}
|
||||
}
|
||||
|
||||
static int stage_to_progress(int stage)
|
||||
{
|
||||
switch (stage) {
|
||||
case STAGE_SETUP: return 30;
|
||||
case STAGE_SPRAY: return 40;
|
||||
case STAGE_PATCH: return 50;
|
||||
case STAGE_YOLODFU: return 60;
|
||||
case STAGE_PONGO: return 70;
|
||||
case STAGE_DONE: return 100;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
#include "../gen/images/logo.h"
|
||||
|
||||
ExploitPanel::ExploitPanel(MainFrame* frame, wxWindow* parent)
|
||||
: DevicePanel(frame, parent)
|
||||
{
|
||||
auto* root = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
auto* descriptionText = new wxStaticText(this, wxID_ANY,
|
||||
"Installing jailbreak, this will take a moment. If the device asks for a passcode\n"
|
||||
"please enter it. Do not disconnect the device until finished."
|
||||
);
|
||||
auto* root = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto* left = new wxBoxSizer(wxVERTICAL);
|
||||
wxMemoryInputStream stream(images_logo_png, images_logo_png_len);
|
||||
wxImage img(stream, wxBITMAP_TYPE_PNG);
|
||||
wxBitmap bmp(img);
|
||||
auto* logo = new wxStaticBitmap(this, wxID_ANY, bmp);
|
||||
auto* logoText = new wxStaticText(this, wxID_ANY, "Jailbreak");
|
||||
auto* right = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
m_statusText = new wxStaticText(this, wxID_ANY, stage_to_string(STAGE_RESET));
|
||||
|
||||
@@ -68,16 +49,22 @@ ExploitPanel::ExploitPanel(MainFrame* frame, wxWindow* parent)
|
||||
frame->ShowMain();
|
||||
});
|
||||
|
||||
root->Add(descriptionText, 0, wxALL, 10);
|
||||
root->Add(m_statusText, 0, wxALL, 10);
|
||||
root->Add(m_progressBar, 0, wxALL | wxEXPAND, 20);
|
||||
left->Add(new wxStaticText(this, wxID_ANY, "Installing jailbreak, this will take a moment. If the device asks for a passcode please enter it. Do not disconnect the device until finished.",
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxST_WRAP
|
||||
), 0, wxALL, 10);
|
||||
left->Add(m_statusText, 0, wxALL, 10);
|
||||
left->Add(m_progressBar, 0, wxALL | wxEXPAND, 20);
|
||||
|
||||
root->AddStretchSpacer();
|
||||
auto* bottomRow = new wxBoxSizer(wxHORIZONTAL);
|
||||
bottomRow->AddStretchSpacer();
|
||||
bottomRow->Add(m_backButton, 0, wxRIGHT | wxBOTTOM, 12);
|
||||
right->Add(logo, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP | wxLEFT | wxRIGHT, 10);
|
||||
right->Add(logoText, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP, 5);
|
||||
right->AddStretchSpacer();
|
||||
right->Add(m_backButton, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);
|
||||
|
||||
root->Add(bottomRow, 0, wxEXPAND);
|
||||
root->Add(left, 1, wxEXPAND);
|
||||
root->Add(new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL), 0, wxEXPAND | wxTOP | wxBOTTOM, 10);
|
||||
root->Add(right, 0, wxEXPAND);
|
||||
|
||||
SetSizer(root);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user