├── ADB ├── Libs │ ├── 7z-x64.dll │ ├── 7z-x86.dll │ └── SevenZipSharp.dll ├── Properties │ ├── adb.7z │ ├── adb │ │ ├── adb.exe │ │ ├── AdbWinApi.dll │ │ └── AdbWinUsbApi.dll │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── AdbListener.cs ├── ADB.csproj ├── AdbExtract.cs ├── AdbAPI.cs ├── Adb.cs └── AdbDevice.cs ├── Stylo6MTKGoodies ├── Icons │ ├── icons8-application-window-50.png │ ├── icons8-application-window-100.png │ ├── icons8-application-window-100-inverted.png │ └── icons8-application-window-50-inverted.png ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── ToolStripMenuItem.cs ├── Title Bar │ ├── TransparentLabel.cs │ ├── NoFocusCueBotton.cs │ ├── DragBar.cs │ ├── AppIcon.cs │ └── WindowsDefaultTitleBarButton.cs ├── Program.cs ├── History.cs ├── frmAbout.cs ├── TaskKiller.cs ├── TextBoxLogger.cs ├── Stylo6.cs ├── app.manifest ├── Form1.cs ├── Stylo6MTKGoodies.csproj ├── Form1.resx ├── frmAbout.resx ├── MenuStrip.cs ├── frmAbout.Designer.cs └── CmdService.cs ├── AdbTester ├── App.config ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── AdbTester.csproj ├── COMPortScanner ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Program.cs ├── COMPortInfo.cs ├── UsbNotifaction.cs ├── COMPortScanner.csproj ├── AdbTesting.resx ├── AdbTesting.cs └── AdbTesting.Designer.cs ├── README.md ├── .gitattributes ├── Stylo6MTKGoodies.sln └── .gitignore /ADB/Libs/7z-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/ADB/Libs/7z-x64.dll -------------------------------------------------------------------------------- /ADB/Libs/7z-x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/ADB/Libs/7z-x86.dll -------------------------------------------------------------------------------- /ADB/Properties/adb.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/ADB/Properties/adb.7z -------------------------------------------------------------------------------- /ADB/Libs/SevenZipSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/ADB/Libs/SevenZipSharp.dll -------------------------------------------------------------------------------- /ADB/Properties/adb/adb.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/ADB/Properties/adb/adb.exe -------------------------------------------------------------------------------- /ADB/Properties/adb/AdbWinApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/ADB/Properties/adb/AdbWinApi.dll -------------------------------------------------------------------------------- /ADB/Properties/adb/AdbWinUsbApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/ADB/Properties/adb/AdbWinUsbApi.dll -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Icons/icons8-application-window-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/Stylo6MTKGoodies/Icons/icons8-application-window-50.png -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Icons/icons8-application-window-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/Stylo6MTKGoodies/Icons/icons8-application-window-100.png -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Icons/icons8-application-window-100-inverted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/Stylo6MTKGoodies/Icons/icons8-application-window-100-inverted.png -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Icons/icons8-application-window-50-inverted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mastercodeon314/Stylo6MTKGoodies/HEAD/Stylo6MTKGoodies/Icons/icons8-application-window-50-inverted.png -------------------------------------------------------------------------------- /AdbTester/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /COMPortScanner/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /COMPortScanner/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AdbTester/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using ADB; 7 | 8 | namespace AdbTester 9 | { 10 | internal class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | Adb adb = new Adb(); 15 | 16 | adb.InitalStatusCheck(); 17 | 18 | Console.ReadKey(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/ToolStripMenuItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Drawing; 7 | 8 | namespace Darkness 9 | { 10 | public class ToolStripMenuItem : System.Windows.Forms.ToolStripMenuItem 11 | { 12 | public ToolStripMenuItem() : base() 13 | { 14 | this.ForeColor = Color.Silver; 15 | this.BackColor = Color.FromArgb(255, 33, 33, 33); 16 | 17 | } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /COMPortScanner/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace COMPortScanner 8 | { 9 | internal static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new AdbTesting()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Title Bar/TransparentLabel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | namespace Stylo6MTKGoodies.TitleBar 8 | { 9 | public class TransparentLabel : Label 10 | { 11 | protected override void WndProc(ref Message m) 12 | { 13 | const int WM_NCHITTEST = 0x0084; 14 | const int HTTRANSPARENT = (-1); 15 | 16 | if (m.Msg == WM_NCHITTEST) 17 | { 18 | m.Result = (IntPtr)HTTRANSPARENT; 19 | } 20 | else 21 | { 22 | base.WndProc(ref m); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Title Bar/NoFocusCueBotton.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows.Forms; 3 | 4 | namespace Stylo6MTKGoodies.TitleBar 5 | { 6 | /// 7 | /// Modified button which has no focus rectangles when the form which contains this button loses fucus while the button was focused. 8 | /// 9 | [ToolboxItem(typeof(NoFocusCueBotton))] 10 | public class NoFocusCueBotton : Button 11 | { 12 | protected override bool ShowFocusCues => false; 13 | 14 | /// 15 | /// Creates a new instance of a 16 | /// 17 | public NoFocusCueBotton() { } 18 | 19 | public override void NotifyDefault(bool value) 20 | { 21 | base.NotifyDefault(false); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace Stylo6MTKGoodies 8 | { 9 | internal static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | // TODO build a prompt from this know file that will check to see after its created the file if there is only mtkclient\SPFlashTool\history.ini existing, 18 | // and no other files or folders along this path. 19 | History.DoHistory(Application.StartupPath + @"\mtkclient\SPFlashTool\history.ini"); 20 | Application.EnableVisualStyles(); 21 | Application.SetCompatibleTextRenderingDefault(false); 22 | Application.Run(new MainForm()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /COMPortScanner/COMPortInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace COMPortScanner 8 | { 9 | public class COMPortInfo 10 | { 11 | private string _portDescription; 12 | private string _portNumber; 13 | 14 | public string PortNumber { get { return _portNumber; } set { _portNumber = value; } } 15 | public string PortDescription { get { return _portDescription; } set { _portDescription = value; } } 16 | 17 | 18 | public string FriendlyName 19 | { 20 | get 21 | { 22 | return _portDescription + " (COM" + _portNumber + ")"; 23 | } 24 | } 25 | 26 | public string PortName 27 | { 28 | get 29 | { 30 | return "COM" + _portNumber; 31 | } 32 | } 33 | 34 | public COMPortInfo(string num, string desc) 35 | { 36 | this.PortNumber = num; 37 | this.PortDescription = desc; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Stylo6MTKGoodies.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /COMPortScanner/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace COMPortScanner.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/History.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using System.Windows.Forms; 8 | 9 | namespace Stylo6MTKGoodies 10 | { 11 | public class History 12 | { 13 | public static void DoHistory(string path) 14 | { 15 | 16 | StringBuilder stringBuilder = new StringBuilder(); 17 | stringBuilder.AppendLine("[RecentOpenFile]"); 18 | stringBuilder.AppendLine("lastDir=" + Application.StartupPath.Replace("\\", "\\\\") + @"\\mtkclient\\spflashtool\\MT6765_Android_scatter.txt"); 19 | stringBuilder.AppendLine("scatterHistory=" + Application.StartupPath.Replace("\\", "\\\\") + @"\\mtkclient\\spflashtool\\MT6765_Android_scatter.txt"); 20 | stringBuilder.AppendLine("authHistory=@Invalid()"); 21 | stringBuilder.AppendLine(); 22 | stringBuilder.AppendLine("[LastDAFilePath]"); 23 | stringBuilder.AppendLine("lastDir=" + Application.StartupPath.Replace("\\", "\\\\") + @"\\mtkclient\\spflashtool\\MTK_AllInOne_DA.bin"); 24 | 25 | File.WriteAllText(path, stringBuilder.ToString()); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ADB/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ADB")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ADB")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("afe748e5-955d-4e0d-8b50-4a0deef02ad2")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /AdbTester/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AdbTester")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AdbTester")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5d0a750a-c701-433b-b861-adddc23d3fef")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /COMPortScanner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("COMPortScanner")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("COMPortScanner")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c0f2711d-8767-427e-9187-cad7ea311177")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Stylo6MTKGoodies")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Stylo6MTKGoodies")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f968d5c7-f84c-4e4f-8a1b-1c3b2c9689ee")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/frmAbout.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace Stylo6MTKGoodies 13 | { 14 | public partial class frmAbout : Form 15 | { 16 | [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] 17 | private static extern IntPtr CreateRoundRectRgn 18 | ( 19 | int nLeftRect, // x-coordinate of upper-left corner 20 | int nTopRect, // y-coordinate of upper-left corner 21 | int nRightRect, // x-coordinate of lower-right corner 22 | int nBottomRect, // y-coordinate of lower-right corner 23 | int nWidthEllipse, // width of ellipse 24 | int nHeightEllipse // height of ellipse 25 | ); 26 | 27 | public frmAbout() 28 | { 29 | InitializeComponent(); 30 | 31 | appIcon1.SetDragForm(this); 32 | dragBar1.SetDragForm(this); 33 | dragBar2.SetDragForm(this); 34 | 35 | this.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); 36 | 37 | this.DoubleBuffered = true; 38 | 39 | infoBox.TextAlign = HorizontalAlignment.Center; 40 | 41 | this.VisibleChanged += FrmAbout_VisibleChanged; 42 | 43 | 44 | } 45 | 46 | private void FrmAbout_VisibleChanged(object sender, EventArgs e) 47 | { 48 | this.CenterToParent(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LG Stylo 6 MTK Goodies 2 | 3 | This is a .NET wrapper around bkerler's [mtkclient](https://github.com/bkerler/mtkclient) 4 | specifically designed for the LG Stylo 6. 5 | Install: 6 | 7 | In order to use this tool, you must have the MTK Serial Port driver, UsbDk, and python >=3.8. 8 | Refer to https://github.com/bkerler/mtkclient#install for further instructions. 9 | 10 | 11 | The tool relies on a prepackaged setup that has mtkclient and SPFlash tool bundled together, package included in release. 12 | 13 | Download that and extract its contents to a folder named mtkclient, this folder should reside alongside Stylo6MTKGoodies.exe. 14 | If you dowload the Release 7z from here or the github page, it will already come with this folder included. 15 | You only need to download this separately if you are building from the source. 16 | Usage: 17 | After the setup is said and done, power off your Stylo 6, then open the program. 18 | Next, click Force Brom 19 | Once you see this screen, plug the usb cable into the device 20 | ![image](https://user-images.githubusercontent.com/78676320/159809101-3618a1f3-8962-4615-96f1-b3059cef66ee.png) 21 | 22 | Next you will see this: 23 | 24 | ![image](https://user-images.githubusercontent.com/78676320/159809222-4db3b2bd-bbc0-409d-bbc4-63a0f505e518.png) 25 | 26 | Now the device is in brom mode. 27 | Unplug the usb cable, and preform a bootloader unlock, or reboot the device. 28 | 29 | Credits: 30 | 31 | Huge thanks to bkerler and everyone who helped make mtkclient, the core component in this app. 32 | 33 | Also a special thanks to warlockguitarman, who discovered the need to stall the boot sequence for mtkclient to connect. 34 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Title Bar/DragBar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Drawing; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | using System.Drawing.Drawing2D; 9 | using System.Drawing.Imaging; 10 | 11 | namespace Stylo6MTKGoodies.TitleBar 12 | { 13 | public class DragBar : Panel 14 | { 15 | private bool drag = false; // determine if we should be moving the form 16 | private Point startPoint = new Point(0, 0); // also for the moving 17 | Form dragForm = null; 18 | 19 | public void SetDragForm(Form form) 20 | { 21 | if (this.DesignMode == true) 22 | { 23 | //this.BackColor = Color.Gray; 24 | } 25 | else 26 | { 27 | dragForm = form; 28 | //this.BackColor = dragForm.BackColor; 29 | } 30 | } 31 | 32 | public DragBar() 33 | { 34 | this.MouseDown += AmgAppLogo_MouseDown; 35 | this.MouseUp += AmgAppLogo_MouseUp; 36 | this.MouseMove += AmgAppLogo_MouseMove; 37 | } 38 | 39 | private void AmgAppLogo_MouseMove(object sender, MouseEventArgs e) 40 | { 41 | if (this.drag) 42 | { // if we should be dragging it, we need to figure out some movement 43 | Point p1 = new Point(e.X, e.Y); 44 | Point p2 = dragForm.PointToScreen(p1); 45 | Point p3 = new Point(p2.X - this.startPoint.X, 46 | p2.Y - this.startPoint.Y); 47 | dragForm.Location = p3; 48 | } 49 | } 50 | 51 | private void AmgAppLogo_MouseUp(object sender, MouseEventArgs e) 52 | { 53 | if (e.Button == MouseButtons.Left) 54 | { 55 | this.drag = false; 56 | } 57 | } 58 | 59 | private void AmgAppLogo_MouseDown(object sender, MouseEventArgs e) 60 | { 61 | if (e.Button == MouseButtons.Left) 62 | { 63 | this.startPoint = e.Location; 64 | this.drag = true; 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /COMPortScanner/UsbNotifaction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace COMPortScanner 9 | { 10 | internal static class UsbNotification 11 | { 12 | public const int DbtDevicearrival = 0x8000; // system detected a new device 13 | public const int DbtDeviceremovecomplete = 0x8004; // device is gone 14 | public const int WmDevicechange = 0x0219; // device change event 15 | private const int DbtDevtypDeviceinterface = 5; 16 | private static readonly Guid GuidDevinterfaceUSBDevice = new Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED"); // USB devices 17 | private static IntPtr notificationHandle; 18 | 19 | /// 20 | /// Registers a window to receive notifications when USB devices are plugged or unplugged. 21 | /// 22 | /// Handle to the window receiving notifications. 23 | public static void RegisterUsbDeviceNotification(IntPtr windowHandle) 24 | { 25 | DevBroadcastDeviceinterface dbi = new DevBroadcastDeviceinterface 26 | { 27 | DeviceType = DbtDevtypDeviceinterface, 28 | Reserved = 0, 29 | ClassGuid = GuidDevinterfaceUSBDevice, 30 | Name = 0 31 | }; 32 | 33 | dbi.Size = Marshal.SizeOf(dbi); 34 | IntPtr buffer = Marshal.AllocHGlobal(dbi.Size); 35 | Marshal.StructureToPtr(dbi, buffer, true); 36 | 37 | notificationHandle = RegisterDeviceNotification(windowHandle, buffer, 0); 38 | } 39 | 40 | /// 41 | /// Unregisters the window for USB device notifications 42 | /// 43 | public static void UnregisterUsbDeviceNotification() 44 | { 45 | UnregisterDeviceNotification(notificationHandle); 46 | } 47 | 48 | [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] 49 | private static extern IntPtr RegisterDeviceNotification(IntPtr recipient, IntPtr notificationFilter, int flags); 50 | 51 | [DllImport("user32.dll")] 52 | private static extern bool UnregisterDeviceNotification(IntPtr handle); 53 | 54 | [StructLayout(LayoutKind.Sequential)] 55 | private struct DevBroadcastDeviceinterface 56 | { 57 | internal int Size; 58 | internal int DeviceType; 59 | internal int Reserved; 60 | internal Guid ClassGuid; 61 | internal short Name; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /AdbTester/AdbTester.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5D0A750A-C701-433B-B861-ADDDC23D3FEF} 8 | Exe 9 | AdbTester 10 | AdbTester 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | x64 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {afe748e5-955d-4e0d-8b50-4a0deef02ad2} 55 | ADB 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /ADB/AdbListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace ADB 9 | { 10 | public delegate Task AdbDevicesChangedDel(string[] deviceList); 11 | 12 | public class AdbListener 13 | { 14 | private string[] _lastDeviceList = null; 15 | public event AdbDevicesChangedDel AdbDevicesChanged; 16 | 17 | private AdbAPI api; 18 | private Task PollingTask; 19 | 20 | public AdbListener() 21 | { 22 | api = new AdbAPI(); 23 | getInitalDeviceList(); 24 | } 25 | 26 | CancellationTokenSource s_cts = new CancellationTokenSource(); 27 | 28 | 29 | public void StartPolling() 30 | { 31 | if (PollingTask == null) 32 | { 33 | s_cts = new CancellationTokenSource(); 34 | PollingTask = Task.Run(() => Api_PollDeviceList(), s_cts.Token); 35 | } 36 | else 37 | { 38 | if (PollingTask.Status != TaskStatus.Running) 39 | { 40 | s_cts = new CancellationTokenSource(); 41 | PollingTask = Task.Run(() => Api_PollDeviceList(), s_cts.Token); 42 | } 43 | } 44 | 45 | } 46 | 47 | public void StopPolling() 48 | { 49 | if (PollingTask != null) 50 | { 51 | if (PollingTask.Status == TaskStatus.Running) 52 | { 53 | s_cts.Cancel(); 54 | } 55 | } 56 | } 57 | 58 | private void getInitalDeviceList() 59 | { 60 | AdbAPI.GetDeviceListEvent += Api_GetDeviceListEvent; 61 | Task.Run(() => AdbAPI.GetDeviceList()); 62 | } 63 | 64 | private void Api_GetDeviceListEvent(string[] deviceList) 65 | { 66 | _lastDeviceList = deviceList; 67 | AdbAPI.GetDeviceListEvent -= Api_GetDeviceListEvent; 68 | } 69 | 70 | private async Task Api_PollDeviceList() 71 | { 72 | while (true) 73 | { 74 | if (s_cts.IsCancellationRequested) 75 | { 76 | break; 77 | } 78 | string[] devices = await AdbAPI.GetDeviceList(); 79 | bool isEqual = Enumerable.SequenceEqual(devices, _lastDeviceList); 80 | if (isEqual) 81 | { 82 | continue; 83 | } 84 | else 85 | { 86 | if (AdbDevicesChanged != null) 87 | { 88 | _lastDeviceList = devices; 89 | await AdbDevicesChanged(devices); 90 | } 91 | } 92 | } 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /COMPortScanner/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace COMPortScanner.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("COMPortScanner.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/TaskKiller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Threading.Tasks; 6 | using System.Threading; 7 | using System.Windows.Forms; 8 | using Microsoft.VisualStudio.Threading; 9 | 10 | namespace Stylo6MTKGoodies 11 | { 12 | public class TaskKiller : IDisposable 13 | { 14 | private Process _cmdProcess; 15 | 16 | private BackgroundWorker _cmdWorker; 17 | 18 | public TaskKiller() 19 | { 20 | _cmdWorker = new BackgroundWorker(); 21 | _cmdWorker.WorkerSupportsCancellation = true; 22 | _cmdWorker.WorkerReportsProgress = true; 23 | _cmdWorker.DoWork += _cmdWorker_DoWork; 24 | Application.ThreadExit += Application_ThreadExit; 25 | } 26 | 27 | private void Application_ThreadExit(object sender, EventArgs e) 28 | { 29 | //this.Dispose(); 30 | } 31 | 32 | public void Cancel() 33 | { 34 | if (_cmdWorker != null) 35 | { 36 | if (!_cmdProcess.HasExited) 37 | { 38 | _cmdWorker.CancelAsync(); 39 | } 40 | } 41 | } 42 | private void _cmdWorker_DoWork(object sender, DoWorkEventArgs e) 43 | { 44 | 45 | if (_cmdProcess != null) 46 | { 47 | if (!_cmdProcess.HasExited) 48 | { 49 | _cmdProcess.Kill(); 50 | _cmdProcess.Dispose(); 51 | } 52 | } 53 | 54 | ProcessStartInfo processStartInfo = new ProcessStartInfo(); 55 | processStartInfo.FileName = "taskkill"; 56 | processStartInfo.Arguments = "/IM " + e.Argument.ToString() + " /F"; 57 | processStartInfo.UseShellExecute = false; 58 | processStartInfo.CreateNoWindow = true; 59 | processStartInfo.RedirectStandardOutput = true; 60 | _cmdProcess = Process.Start(processStartInfo); 61 | 62 | string output = _cmdProcess.StandardOutput.ReadToEnd(); 63 | 64 | e.Cancel = true; 65 | if (_cmdProcess.HasExited == false) 66 | { 67 | _cmdProcess.Close(); 68 | } 69 | } 70 | 71 | public void ExecuteCommand(string command) 72 | { 73 | // Clears the buffer every time a new command is ran 74 | //_cmdOutput = String.Empty; 75 | 76 | _cmdWorker = new BackgroundWorker(); 77 | _cmdWorker.WorkerSupportsCancellation = true; 78 | _cmdWorker.DoWork += _cmdWorker_DoWork; 79 | 80 | _cmdWorker.RunWorkerAsync(command); 81 | } 82 | 83 | public void Dispose() 84 | { 85 | if (_cmdProcess != null) 86 | { 87 | _cmdProcess.Close(); 88 | _cmdProcess.Dispose(); 89 | } 90 | if (_cmdWorker != null) 91 | { 92 | _cmdWorker.CancelAsync(); 93 | 94 | while (_cmdWorker.IsBusy) Application.DoEvents(); 95 | 96 | _cmdWorker.Dispose(); 97 | _cmdWorker = null; 98 | } 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/TextBoxLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace Stylo6MTKGoodies 10 | { 11 | public class TextBoxLogger 12 | { 13 | private TextBox Output; 14 | private RichTextBox r_Output; 15 | 16 | private bool usingRichOutput = false; 17 | 18 | public TextBoxLogger(TextBox output) 19 | { 20 | this.Output = output; 21 | } 22 | 23 | public TextBoxLogger(RichTextBox output) 24 | { 25 | this.r_Output = output; 26 | usingRichOutput = true; 27 | } 28 | 29 | 30 | 31 | private delegate void SafeCallDelegate(string x); 32 | private delegate void SafeCallDelegateClear(); 33 | 34 | public void Log(string x) 35 | { 36 | if (usingRichOutput) 37 | { 38 | if (r_Output.InvokeRequired) 39 | { 40 | var d = new SafeCallDelegate(Log); 41 | r_Output.Invoke(d, new object[] { x }); 42 | } 43 | else 44 | { 45 | r_Output.AppendText(x.Replace("â–ˆ", "█")); 46 | r_Output.Select(r_Output.Text.Length, 0); 47 | r_Output.Update(); 48 | 49 | } 50 | } 51 | else 52 | { 53 | if (Output.InvokeRequired) 54 | { 55 | var d = new SafeCallDelegate(Log); 56 | Output.Invoke(d, new object[] { x }); 57 | } 58 | else 59 | { 60 | Output.AppendText(x.Replace("â–ˆ", "█")); 61 | } 62 | } 63 | 64 | } 65 | 66 | public void Clear() 67 | { 68 | if (usingRichOutput) 69 | { 70 | if (r_Output.InvokeRequired) 71 | { 72 | var d = new SafeCallDelegateClear(Clear); 73 | r_Output.Invoke(d); 74 | } 75 | else 76 | { 77 | r_Output.Clear(); 78 | } 79 | } 80 | else 81 | { 82 | if (Output.InvokeRequired) 83 | { 84 | var d = new SafeCallDelegateClear(Clear); 85 | Output.Invoke(d); 86 | } 87 | else 88 | { 89 | Output.Clear(); 90 | } 91 | } 92 | } 93 | 94 | public void Log(byte[] x) 95 | { 96 | StringBuilder b = new StringBuilder(); 97 | b.Append("{ "); 98 | 99 | for (int i = 0; i < x.Length; i++) 100 | { 101 | b.Append(x[i].ToString("X2")); 102 | 103 | if (i < x.Length - 1) 104 | { 105 | b.Append(", "); 106 | } 107 | } 108 | 109 | b.Append(" }"); 110 | 111 | this.Log(b.ToString()); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /ADB/ADB.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {AFE748E5-955D-4E0D-8B50-4A0DEEF02AD2} 8 | Library 9 | Properties 10 | ADB 11 | ADB 12 | v4.7.2 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | x64 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | Libs\SevenZipSharp.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | True 57 | True 58 | Resources.resx 59 | 60 | 61 | 62 | 63 | ResXFileCodeGenerator 64 | Resources.Designer.cs 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Stylo6.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | 8 | namespace Stylo6MTKGoodies 9 | { 10 | public class Stylo6 11 | { 12 | public event EventHandler CommandCompleted; 13 | 14 | private CmdService cmdService; 15 | public Stylo6(TextBox outputBox) 16 | { 17 | cmdService = new CmdService("cmd.exe", outputBox); 18 | cmdService.CommandCompleted += CmdService_CommandCompleted; 19 | } 20 | 21 | private void CmdService_CommandCompleted(object sender, EventArgs e) 22 | { 23 | if (this.CommandCompleted != null) 24 | { 25 | CommandCompleted(sender, e); 26 | } 27 | } 28 | 29 | public void ForceBrom(bool delay) 30 | { 31 | if (cmdService != null) 32 | { 33 | // python mtk payload 34 | cmdService.ExecuteCommand("payload", delay); 35 | } 36 | } 37 | 38 | public void ForceBrom() 39 | { 40 | if (cmdService != null) 41 | { 42 | // python mtk payload 43 | cmdService.ExecuteCommand("payload", true); 44 | } 45 | } 46 | 47 | public void UnlockBootloader() 48 | { 49 | // python mtk da seccfg unlock 50 | // python mtk xflash seccfg unlock 51 | if (cmdService != null) 52 | { 53 | // New version bootloader unlock command 54 | cmdService.ExecuteCommand("da seccfg unlock"); 55 | 56 | // Old version bootloader unlock command 57 | //cmdService.ExecuteCommand("xflash seccfg unlock"); 58 | } 59 | } 60 | 61 | public void LockBootloader() 62 | { 63 | // python mtk da seccfg lock 64 | // python mtk xflash seccfg lock 65 | if (cmdService != null) 66 | { 67 | // New version bootloader lock command 68 | cmdService.ExecuteCommand("da seccfg lock"); 69 | 70 | // Old version bootloader lock command 71 | //cmdService.ExecuteCommand("xflash seccfg lock"); 72 | } 73 | } 74 | 75 | public void Reboot() 76 | { 77 | if (cmdService != null) 78 | { 79 | // python mtk reset 80 | cmdService.ExecuteCommand("reset"); 81 | } 82 | } 83 | 84 | public void CarrierUnlock() 85 | { 86 | ExecuteMTKCommand("e nvdata,nvram,protect1,protect2"); 87 | } 88 | 89 | public void ExecuteMTKCommand(string command) 90 | { 91 | if (cmdService != null) 92 | { 93 | // Execute mtk command 94 | cmdService.ExecuteCommand(command); 95 | } 96 | } 97 | 98 | public void Cancel() 99 | { 100 | if (cmdService != null) 101 | { 102 | cmdService.Cancel(); 103 | } 104 | } 105 | 106 | public void Dispose() 107 | { 108 | if (cmdService != null) 109 | { 110 | cmdService.Dispose(); 111 | } 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 62 | 63 | 64 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Stylo6MTKGoodies/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace Stylo6MTKGoodies 13 | { 14 | public partial class MainForm : Form 15 | { 16 | [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] 17 | private static extern IntPtr CreateRoundRectRgn 18 | ( 19 | int nLeftRect, // x-coordinate of upper-left corner 20 | int nTopRect, // y-coordinate of upper-left corner 21 | int nRightRect, // x-coordinate of lower-right corner 22 | int nBottomRect, // y-coordinate of lower-right corner 23 | int nWidthEllipse, // width of ellipse 24 | int nHeightEllipse // height of ellipse 25 | ); 26 | 27 | public static MainForm Instance = null; 28 | 29 | Stylo6 stylo6; 30 | 31 | frmAbout aboutFrm = new frmAbout(); 32 | 33 | public MainForm() 34 | { 35 | Instance = this; 36 | aboutFrm.ShowInTaskbar = false; 37 | 38 | InitializeComponent(); 39 | 40 | appIcon1.SetDragForm(this); 41 | dragBar1.SetDragForm(this); 42 | dragBar2.SetDragForm(this); 43 | 44 | 45 | this.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20)); 46 | 47 | stylo6 = new Stylo6(outputBox); 48 | stylo6.CommandCompleted += CmdService_CommandCompleted; 49 | this.FormClosing += MainForm_FormClosing; 50 | this.DoubleBuffered = true; 51 | } 52 | 53 | private void CmdService_CommandCompleted(object sender, EventArgs e) 54 | { 55 | foreach (Button btn in this.Controls.OfType