[G2 Themes and Apps] fma965:
Hey Guys, Here is a small application i created as i was fed up with the slow rom installs due to the format line of the updater-script

Requires NET Framework 4.5

Put simply this small application will patch the .zip

Replacing the line below
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");

With the following line
delete_recursive("/system");

It supports manually browsing to the zip file
It supports dragging the zip file on to the exe
It supports right clicking the zip file and selecting "Patch ROM Zip File"

Note: Make sure to run the exe directly once to enable right click context menu. No installation required.

1.1
Fixed small issue with .zip detection

1.0
Initial Release

Released by Cyanlabs for XDA-Developers.

http://cyanlabs.co.uk

Download Here - http://kitchen.cyanlabs.co.uk/LG_G2/index.php?dir=G2+Tools+By+Cyanlabs/

It knocks off around 5-10minutes of flashing time and only takes about 10 seconds to patch :)

Use this file to remove the context menu entry RemoveContextMenu.reg (it will be re-added upon launching the application again)

Source:

Imports System.IO.Compression
Imports System.IO
Imports Microsoft.Win32

Public Class Form1
Dim FileToModify As String = ""
Private Sub NsButton1_Click(sender As Object, e As EventArgs) Handles NsButton1.Click
Using dialog As New OpenFileDialog
dialog.Title = "Select ROM Zip File"
dialog.Filter = "Zip Files (*.zip)|*.zip"
dialog.RestoreDirectory = True
If dialog.ShowDialog() <> DialogResult.OK Then Return
ModifyFiles(dialog.FileName)
End Using
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WriteRegistryHandler()
Try
FileToModify = My.Application.CommandLineArgs(0)
If FileToModify.Contains(".zip") Then
ModifyFiles(FileToModify, True)
Else
MsgBox("Invalid file selected!")
End If

Catch ex As Exception
End Try
End Sub

Sub ModifyFiles(update As String, Optional close As Boolean = False)
Try
Using archive As ZipArchive = ZipFile.OpenRead(update)
Dim File As ZipArchiveEntry = archive.GetEntry("META-INF/com/google/android/updater-script")
If System.IO.File.Exists(Application.StartupPath & "\" & File.Name) Then System.IO.File.Delete(Application.StartupPath & "\" & File.Name)
File.ExtractToFile(Application.StartupPath & "\" & File.Name)
archive.Dispose()
End Using
Catch ex As NullReferenceException
MsgBox("no updater-script found")
Application.Exit()
End Try

Try
Dim reader As New StreamReader(Application.StartupPath & "\updater-script")
Dim s = reader.ReadToEnd().Replace("format(""ext4"", ""EMMC"", ""/dev/block/platform/msm_sdcc.1/by-name/system"", ""0"", ""/system"");", "delete_recursive(""/system"");")
reader.Close()

If System.IO.File.Exists(Application.StartupPath & "\updater-script") Then System.IO.File.Delete(Application.StartupPath & "\updater-script")

Dim writer As New StreamWriter(Application.StartupPath & "\updater-script")
writer.Write(s)
writer.Close()

Using archive As ZipArchive = ZipFile.Open(update, ZipArchiveMode.Update)
archive.GetEntry("META-INF/com/google/android/updater-script").Delete()
archive.CreateEntryFromFile(Application.StartupPath & "\updater-script", "META-INF/com/google/android/updater-script")
End Using
If close Then MsgBox("Patched Successfully!", MsgBoxStyle.Information, "Success")
Application.Exit()

Catch ex As Exception
MsgBox(ex.Message)
Application.Exit()
End Try
End Sub

Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click, Label1.Click
Process.Start("http://cyanlabs.co.uk")
End Sub

Sub WriteRegistryHandler()
Registry.CurrentUser.CreateSubKey("Software\Classes\CompressedFolder\shell\Patch ROM Zip File\command")
Registry.CurrentUser.OpenSubKey("Software\Classes\CompressedFolder\shell\Patch ROM Zip File\", True).SetValue("Icon", """" & Application.ExecutablePath & """")
Registry.CurrentUser.OpenSubKey("Software\Classes\CompressedFolder\shell\Patch ROM Zip File\command", True).SetValue("", """" & Application.ExecutablePath & """ ""%1""")
End Sub
End Class

Linux version