-
Notifications
You must be signed in to change notification settings - Fork 5
/
MainWindow.cs
107 lines (87 loc) · 2.96 KB
/
MainWindow.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using System;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;
namespace IPSW_Restorer
{
public partial class MainWindow : Form
{
private string ipswFilePath;
public MainWindow()
{
InitializeComponent();
}
private void MainWindow_Load(object sender, EventArgs e)
{
StringBuilder information = new StringBuilder();
information.AppendLine("- iOS 10<= support.");
information.AppendLine("- No iTunes needed.");
information.AppendLine("- Using a precompiled version for Windows! / https://github.com/elrhk/Libimobiledevice-idevicerestore-for-Windows");
information.AppendLine("- Using libimobiledevice, libirecovery & idevicerestore.");
MessageBox.Show(information.ToString(), "IPSW Restore about", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void fileButton_Click(object sender, EventArgs e)
{
openIPSW.Filter = "IPSW files|*.ipsw;*.zip";
if(openIPSW.ShowDialog() == DialogResult.OK)
{
ipswFilePath = openIPSW.FileName;
}
}
private void button1_Click(object sender, EventArgs e)
{
StringBuilder cmd = new StringBuilder();
// cmd.Append("idevicrestore.exe ");
// Step 1
if (latestFirmware.Checked)
{
cmd.Append("-l ");
}
else if (ipswFilePath == null)
{
MessageBox.Show("No ipsw selected!", "Select one option in the first step", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// Step 2
if(basebandOption.Checked)
{
cmd.Append("-x ");
}
if(tssFromCydia.Checked)
{
cmd.Append("-s ");
}
if(fetchTSS.Checked)
{
cmd.Append("-t ");
}
if(limer4in.Checked)
{
cmd.Append("-p ");
}
if(fullyRestore.Checked)
{
cmd.Append("-e ");
}
if(ipswFilePath != null)
{
cmd.Append(" \"" + ipswFilePath + "\" ");
}
var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "idevicerestore.exe",
Arguments = cmd.ToString()
}
};
process.Start();
process.WaitForExit();
MessageBox.Show("Everything done!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://github.com/BananaProject/idevicerestore-gui/");
}
}
}