WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5bc2a6e

Browse files
committed
线刷增加SuperEmpty支持
1 parent 07e02c5 commit 5bc2a6e

File tree

1 file changed

+48
-12
lines changed

1 file changed

+48
-12
lines changed

UotanToolbox/Features/Wiredflash/WiredflashView.axaml.cs

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,36 @@ private async void StartTXTFlash(object sender, RoutedEventArgs args)
349349
return;
350350
}
351351
}
352+
if (succ)
353+
{
354+
for (int i = 0 + c; i < fbdflashparts.Length; i++)
355+
{
356+
if (fbdflashparts[i].Contains(' '))
357+
{
358+
string[] partandpath = fbdflashparts[i].Split(' ', StringSplitOptions.RemoveEmptyEntries);
359+
if ((!partandpath[1].Contains("delete")) && (!partandpath[1].Contains("create")))
360+
{
361+
if (partandpath[0].Contains("super_empty"))
362+
{
363+
await Fastboot($"-s {Global.thisdevice} wipe-super \"{fbdtxt[..fbdtxt.LastIndexOf('/')]}{partandpath[1]}\"");
364+
}
365+
}
366+
}
367+
else
368+
{
369+
if (fbdflashparts[i].Contains("super_empty"))
370+
{
371+
await Fastboot($"-s {Global.thisdevice} wipe-super \"{imgpath}/{fbdflashparts[i]}.img\"");
372+
}
373+
}
374+
FileHelper.Write(fastboot_log_path, output);
375+
if (output.Contains("FAILED") || output.Contains("error"))
376+
{
377+
succ = false;
378+
break;
379+
}
380+
}
381+
}
352382
string slot = "";
353383
FileHelper.Write(update_status, await CallExternalProgram.Fastboot($"-s {Global.thisdevice} getvar snapshot-update-status"));
354384
string active = await CallExternalProgram.Fastboot($"-s {Global.thisdevice} getvar current-slot");
@@ -451,25 +481,31 @@ private async void StartTXTFlash(object sender, RoutedEventArgs args)
451481
string[] partandpath = fbdflashparts[i].Split(' ', StringSplitOptions.RemoveEmptyEntries);
452482
if ((!partandpath[1].Contains("delete")) && (!partandpath[1].Contains("create")))
453483
{
454-
if (partandpath[0].Contains("vbmeta"))
455-
{
456-
await Fastboot($"-s {Global.thisdevice} --disable-verity --disable-verification flash {partandpath[0]} \"{fbdtxt[..fbdtxt.LastIndexOf('/')]}{partandpath[1]}\"");
457-
}
458-
else
484+
if (!partandpath[0].Contains("super_empty"))
459485
{
460-
await Fastboot($"-s {Global.thisdevice} flash {partandpath[0]} \"{fbdtxt[..fbdtxt.LastIndexOf('/')]}{partandpath[1]}\"");
486+
if (partandpath[0].Contains("vbmeta"))
487+
{
488+
await Fastboot($"-s {Global.thisdevice} --disable-verity --disable-verification flash {partandpath[0]} \"{fbdtxt[..fbdtxt.LastIndexOf('/')]}{partandpath[1]}\"");
489+
}
490+
else
491+
{
492+
await Fastboot($"-s {Global.thisdevice} flash {partandpath[0]} \"{fbdtxt[..fbdtxt.LastIndexOf('/')]}{partandpath[1]}\"");
493+
}
461494
}
462495
}
463496
}
464497
else
465498
{
466-
if (fbdflashparts[i].Contains("vbmeta"))
499+
if (!fbdflashparts[i].Contains("super_empty"))
467500
{
468-
await Fastboot($"-s {Global.thisdevice} --disable-verity --disable-verification flash {fbdflashparts[i]} \"{imgpath}/{fbdflashparts[i]}.img\"");
469-
}
470-
else
471-
{
472-
await Fastboot($"-s {Global.thisdevice} flash {fbdflashparts[i]} \"{imgpath}/{fbdflashparts[i]}.img\"");
501+
if (fbdflashparts[i].Contains("vbmeta"))
502+
{
503+
await Fastboot($"-s {Global.thisdevice} --disable-verity --disable-verification flash {fbdflashparts[i]} \"{imgpath}/{fbdflashparts[i]}.img\"");
504+
}
505+
else
506+
{
507+
await Fastboot($"-s {Global.thisdevice} flash {fbdflashparts[i]} \"{imgpath}/{fbdflashparts[i]}.img\"");
508+
}
473509
}
474510
}
475511
FileHelper.Write(fastboot_log_path, output);

0 commit comments

Comments
 (0)