rhcp011235

Untitled

May 31st, 2025
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.64 KB | None | 0 0
  1. using System;
  2. using System.ComponentModel;
  3. using System.Diagnostics;
  4. using System.Drawing;
  5. using System.IO;
  6. using System.Runtime.CompilerServices;
  7. using System.Threading;
  8. using System.Windows.Forms;
  9. using iTips.Ref;
  10. using Microsoft.VisualBasic;
  11.  
  12. namespace iTips
  13. {
  14. // Token: 0x02000006 RID: 6
  15. [NullableContext(1)]
  16. [Nullable(0)]
  17. public class Form1 : Form
  18. {
  19. // Token: 0x06000007 RID: 7 RVA: 0x000020FC File Offset: 0x000002FC
  20. public Form1()
  21. {
  22. this.InitializeComponent();
  23. this.button2.Hide();
  24. this.APP_UUID();
  25. }
  26.  
  27. // Token: 0x06000008 RID: 8 RVA: 0x00002148 File Offset: 0x00000348
  28. private void APP_UUID()
  29. {
  30. this.label3.TextAlign = 32;
  31. string myuuidAsString = Guid.NewGuid().ToString().ToUpper();
  32. this.label3.Text = "APP_UUID: " + myuuidAsString;
  33. }
  34.  
  35. // Token: 0x06000009 RID: 9 RVA: 0x00002194 File Offset: 0x00000394
  36. private void CommonConnectDevice(object sender, DeviceCommonConnectEventArgs args)
  37. {
  38. bool flag = args.Message == ConnectNotificationMessage.Connected;
  39. if (flag)
  40. {
  41. this.currentiOSDevice = args.Device;
  42. base.Invoke(delegate()
  43. {
  44. this.button2.Show();
  45. this.label2.Text = string.Concat(new string[]
  46. {
  47. " Device Connected: ",
  48. this.currentiOSDevice.ProductType,
  49. " iOS ",
  50. this.currentiOSDevice.ProductVersion,
  51. "\n\n IMEI: ",
  52. this.currentiOSDevice.InternationalMobileEquipmentIdentity,
  53. " MEID: ",
  54. this.currentiOSDevice.MobileEquipmentIdentifier,
  55. "\n\n UDID: ",
  56. this.currentiOSDevice.UniqueDeviceID,
  57. " SN: ",
  58. this.currentiOSDevice.SerialNumber,
  59. "\n\n\n"
  60. });
  61. bool flag3 = this.currentiOSDevice.ActivationState == "Activated";
  62. if (flag3)
  63. {
  64. }
  65. this.UDID = this.currentiOSDevice.UniqueDeviceID;
  66. });
  67. }
  68. else
  69. {
  70. bool flag2 = args.Message == ConnectNotificationMessage.Disconnected;
  71. if (flag2)
  72. {
  73. base.Invoke(delegate()
  74. {
  75. this.button2.Hide();
  76. this.label2.Text = "There is not Device Connected";
  77. this.UDID = null;
  78. });
  79. }
  80. }
  81. }
  82.  
  83. // Token: 0x0600000A RID: 10 RVA: 0x000021F4 File Offset: 0x000003F4
  84. private void RecoveryConnectDevice(object sender, DeviceRecoveryConnectEventArgs args)
  85. {
  86. bool flag = args.Message == ConnectNotificationMessage.Connected;
  87. if (flag)
  88. {
  89. base.Invoke(delegate()
  90. {
  91. });
  92. }
  93. bool flag2 = args.Message == ConnectNotificationMessage.Disconnected;
  94. if (flag2)
  95. {
  96. base.Invoke(delegate()
  97. {
  98. });
  99. }
  100. }
  101.  
  102. // Token: 0x0600000B RID: 11 RVA: 0x0000226C File Offset: 0x0000046C
  103. private void ListenError(object sender, ListenErrorEventHandlerEventArgs args)
  104. {
  105. bool flag = args.ErrorType == ListenErrorEventType.StartListen;
  106. if (flag)
  107. {
  108. this.Error(args.ErrorMessage);
  109. throw new Exception(args.ErrorMessage);
  110. }
  111. }
  112.  
  113. // Token: 0x0600000C RID: 12 RVA: 0x000022A1 File Offset: 0x000004A1
  114. private void Error(string msg)
  115. {
  116. this.AppendLine(" [ERROR] {0}", Color.FromArgb(182, 29, 28), new object[]
  117. {
  118. msg
  119. });
  120. }
  121.  
  122. // Token: 0x0600000D RID: 13 RVA: 0x000022C8 File Offset: 0x000004C8
  123. private void AppendLine(string format, Color foreground, params object[] args)
  124. {
  125. base.Invoke(delegate()
  126. {
  127. this.AppendLine(format, foreground, args);
  128. });
  129. string text = string.Format(format, args);
  130. }
  131.  
  132. // Token: 0x0600000E RID: 14 RVA: 0x0000231D File Offset: 0x0000051D
  133. private void label1_Click(object sender, EventArgs e)
  134. {
  135. }
  136.  
  137. // Token: 0x0600000F RID: 15 RVA: 0x00002320 File Offset: 0x00000520
  138. private void label2_Click(object sender, EventArgs e)
  139. {
  140. }
  141.  
  142. // Token: 0x06000010 RID: 16 RVA: 0x00002324 File Offset: 0x00000524
  143. private void Form1_Load(object sender, EventArgs e)
  144. {
  145. DropShadow dropShadow = new DropShadow();
  146. dropShadow.ApplyShadows(this);
  147. this.DoubleBuffered = true;
  148. this.manager.CommonConnectEvent += this.CommonConnectDevice;
  149. this.manager.RecoveryConnectEvent += this.RecoveryConnectDevice;
  150. this.manager.ListenErrorEvent += new EventHandler<ListenErrorEventHandlerEventArgs>(this.ListenError);
  151. new Thread(new ThreadStart(this.manager.StartListen))
  152. {
  153. IsBackground = true
  154. }.Start();
  155. }
  156.  
  157. // Token: 0x06000011 RID: 17 RVA: 0x000023B8 File Offset: 0x000005B8
  158. public void Start()
  159. {
  160. string libPath = "lib";
  161. string udidFilePath = Path.Combine(libPath, "udid.txt");
  162. string restoreLogPath = Path.Combine(libPath, "restore_log.txt");
  163. int udidExitCode = Form1.RunCommand(Path.Combine(libPath, "ideviceinfo.exe"), "-k UniqueDeviceID", udidFilePath);
  164. bool flag = !File.Exists(udidFilePath) || new FileInfo(udidFilePath).Length == 0L;
  165. if (flag)
  166. {
  167. this.button2.Text = "Failed!";
  168. Form1.ShowErrorMsg("Error", "UDID file not found or empty.");
  169. }
  170. else
  171. {
  172. string udidContent = File.ReadAllText(udidFilePath);
  173. bool flag2 = udidContent.IndexOf("ERROR", 5) >= 0;
  174. if (flag2)
  175. {
  176. this.button2.Text = "Failed!";
  177. Form1.ShowErrorMsg("Error", udidContent);
  178. }
  179. else
  180. {
  181. string uuid = udidContent.Trim();
  182. bool flag3 = string.IsNullOrEmpty(uuid);
  183. if (flag3)
  184. {
  185. this.button2.Text = "Failed!";
  186. Form1.ShowErrorMsg("UDID Empty", udidContent);
  187. }
  188. else
  189. {
  190. string args = "restore -u " + uuid + " -s a50b5348f06d8c6528556309344370375eadb495 --system --reboot --settings lib";
  191. int restoreExitCode = Form1.RunCommand(Path.Combine(libPath, "idevicebackup2.exe"), args, restoreLogPath);
  192. string restoreLog = File.Exists(restoreLogPath) ? File.ReadAllText(restoreLogPath) : "";
  193. bool flag4 = restoreLog.IndexOf("ERROR", 5) >= 0;
  194. if (flag4)
  195. {
  196. this.button2.Text = "Failed!";
  197. Form1.ShowErrorMsg("Restore Error", restoreLog);
  198. }
  199. else
  200. {
  201. this.button2.Text = "SUCCESSFULLY!";
  202. Form1.ShowSuccessMsg("Successfully!");
  203. }
  204. }
  205. }
  206. }
  207. }
  208.  
  209. // Token: 0x06000012 RID: 18 RVA: 0x00002558 File Offset: 0x00000758
  210. private static int RunCommand(string exePath, string arguments, string outputFilePath)
  211. {
  212. int result;
  213. try
  214. {
  215. using (Process process = new Process())
  216. {
  217. process.StartInfo.FileName = exePath;
  218. process.StartInfo.Arguments = arguments;
  219. process.StartInfo.RedirectStandardOutput = true;
  220. process.StartInfo.RedirectStandardError = true;
  221. process.StartInfo.UseShellExecute = false;
  222. process.StartInfo.CreateNoWindow = true;
  223. using (StreamWriter outputStream = new StreamWriter(outputFilePath, false))
  224. {
  225. process.OutputDataReceived += delegate(object sender, DataReceivedEventArgs args)
  226. {
  227. bool flag = args.Data != null;
  228. if (flag)
  229. {
  230. outputStream.WriteLine(args.Data);
  231. }
  232. };
  233. process.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs args)
  234. {
  235. bool flag = args.Data != null;
  236. if (flag)
  237. {
  238. outputStream.WriteLine(args.Data);
  239. }
  240. };
  241. process.Start();
  242. process.BeginOutputReadLine();
  243. process.BeginErrorReadLine();
  244. process.WaitForExit();
  245. result = process.ExitCode;
  246. }
  247. }
  248. }
  249. catch (Exception ex)
  250. {
  251. File.WriteAllText(outputFilePath, "ERROR: " + ex.Message);
  252. result = -1;
  253. }
  254. return result;
  255. }
  256.  
  257. // Token: 0x06000013 RID: 19 RVA: 0x00002684 File Offset: 0x00000884
  258. private static void ShowErrorMsg(string title, string message)
  259. {
  260. bool flag = message.Length > 1000;
  261. if (flag)
  262. {
  263. message = message.Substring(0, 1000) + "...";
  264. }
  265. Interaction.MsgBox(message, 16, title);
  266. }
  267.  
  268. // Token: 0x06000014 RID: 20 RVA: 0x000026C7 File Offset: 0x000008C7
  269. private static void ShowSuccessMsg(string message)
  270. {
  271. Interaction.MsgBox(message, 64, "Info");
  272. }
  273.  
  274. // Token: 0x06000015 RID: 21 RVA: 0x000026D8 File Offset: 0x000008D8
  275. private void button2_Click(object sender, EventArgs e)
  276. {
  277. this.button2.Text = "Processing...";
  278. this.button2.Enabled = false;
  279. Thread.Sleep(5000);
  280. this.Start();
  281. }
  282.  
  283. // Token: 0x06000016 RID: 22 RVA: 0x0000270C File Offset: 0x0000090C
  284. protected override void Dispose(bool disposing)
  285. {
  286. bool flag = disposing && this.components != null;
  287. if (flag)
  288. {
  289. this.components.Dispose();
  290. }
  291. base.Dispose(disposing);
  292. }
  293.  
  294. // Token: 0x06000017 RID: 23 RVA: 0x00002744 File Offset: 0x00000944
  295. private void InitializeComponent()
  296. {
  297. ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
  298. this.button1 = new Button();
  299. this.label1 = new Label();
  300. this.label2 = new Label();
  301. this.label3 = new Label();
  302. this.button2 = new Button();
  303. base.SuspendLayout();
  304. this.button1.Location = new Point(123, 175);
  305. this.button1.Name = "button1";
  306. this.button1.Size = new Size(213, 37);
  307. this.button1.TabIndex = 0;
  308. this.button1.Text = "button1";
  309. this.button1.UseVisualStyleBackColor = true;
  310. this.label1.AutoSize = true;
  311. this.label1.Font = new Font("Segoe UI", 9.75f, 0, 3);
  312. this.label1.Location = new Point(74, 28);
  313. this.label1.Name = "label1";
  314. this.label1.Size = new Size(72, 17);
  315. this.label1.TabIndex = 1;
  316. this.label1.Text = "APP_UUID: ";
  317. this.label1.TextAlign = 32;
  318. this.label1.Click += new EventHandler(this.label1_Click);
  319. this.label2.Dock = 5;
  320. this.label2.Font = new Font("Segoe UI", 9.75f, 0, 3);
  321. this.label2.Location = new Point(0, 0);
  322. this.label2.Name = "label2";
  323. this.label2.Size = new Size(533, 236);
  324. this.label2.TabIndex = 2;
  325. this.label2.Text = "There is not Device Connected";
  326. this.label2.TextAlign = 32;
  327. this.label2.Click += new EventHandler(this.label2_Click);
  328. this.label3.AutoSize = true;
  329. this.label3.Font = new Font("Segoe UI", 9.75f, 0, 3);
  330. this.label3.Location = new Point(104, 11);
  331. this.label3.Name = "label3";
  332. this.label3.Size = new Size(72, 17);
  333. this.label3.TabIndex = 3;
  334. this.label3.Text = "APP_UUID: ";
  335. this.button2.Cursor = Cursors.Hand;
  336. this.button2.Location = new Point(140, 161);
  337. this.button2.Name = "button2";
  338. this.button2.Size = new Size(259, 23);
  339. this.button2.TabIndex = 6;
  340. this.button2.Text = "Start Blocking";
  341. this.button2.UseVisualStyleBackColor = true;
  342. this.button2.Click += new EventHandler(this.button2_Click);
  343. base.AutoScaleDimensions = new SizeF(7f, 15f);
  344. base.AutoScaleMode = 1;
  345. base.ClientSize = new Size(533, 236);
  346. base.Controls.Add(this.button2);
  347. base.Controls.Add(this.label3);
  348. base.Controls.Add(this.label2);
  349. base.Controls.Add(this.label1);
  350. base.Controls.Add(this.button1);
  351. base.FormBorderStyle = 2;
  352. base.Icon = (Icon)resources.GetObject("$this.Icon");
  353. base.MaximizeBox = false;
  354. base.Name = "Form1";
  355. this.Text = "iTips Helper | made with \ud83d\udc96 from @christianmuhi7";
  356. base.Load += new EventHandler(this.Form1_Load);
  357. base.ResumeLayout(false);
  358. base.PerformLayout();
  359. }
  360.  
  361. // Token: 0x04000004 RID: 4
  362. private iOSDevice currentiOSDevice;
  363.  
  364. // Token: 0x04000005 RID: 5
  365. private string UDID = "";
  366.  
  367. // Token: 0x04000006 RID: 6
  368. private iOSDeviceManager manager = new iOSDeviceManager();
  369.  
  370. // Token: 0x04000007 RID: 7
  371. [Nullable(0)]
  372. private IContainer components = null;
  373.  
  374. // Token: 0x04000008 RID: 8
  375. [Nullable(0)]
  376. private Button button1;
  377.  
  378. // Token: 0x04000009 RID: 9
  379. [Nullable(0)]
  380. private Label label1;
  381.  
  382. // Token: 0x0400000A RID: 10
  383. [Nullable(0)]
  384. private Label label2;
  385.  
  386. // Token: 0x0400000B RID: 11
  387. [Nullable(0)]
  388. private Label label3;
  389.  
  390. // Token: 0x0400000C RID: 12
  391. [Nullable(0)]
  392. private Button button2;
  393. }
  394. }
Advertisement
Add Comment
Please, Sign In to add comment