Initial working code, version 1.0.0

This commit is contained in:
Neo authored and Amrit Panesar committed 2020-11-16 11:46:52 -08:00
1 parent d2051a8b78
commit 1471136799
13 files changed
+16794

No files matched your search

+2
View File
@@ -1,3 +1,5 @@
*.xcf
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
+69
View File
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
namespace mononucleosis_pro
{
class Keygen
{
public const int SUBLIME_TEXT = 0;
public const int VISUAL_STUDIO_CODE = 1;
private static readonly byte[] VSCGUIDBytes = new byte[] { 111, 15, 51, 253, 65, 63, 29, 66, 159, 229, 222, 116, 45, 12, 84, 192 };
private static readonly MD5 MD5 = MD5.Create();
private static readonly Guid VSCGUID = new Guid(VSCGUIDBytes);
public string Generate(int type, string email)
{
switch (type)
{
case SUBLIME_TEXT:
return generateSublime(email);
case VISUAL_STUDIO_CODE:
return generateVSCode(email);
default:
return "";
}
}
private string generateSublime(string input)
{
string output = BitConverter.ToString(MD5.ComputeHash(Encoding.UTF8.GetBytes(input))).Replace("-", "").Substring(0, 25).ToLower();
return licenseFormat(output);
}
private string generateVSCode(string input)
{
input = VSCGUID.ToString() + input;
string output = BitConverter.ToString(MD5.ComputeHash(Encoding.UTF8.GetBytes(input))).Replace("-", "").Substring(0, 25).ToLower();
return licenseFormat(output);
}
private string licenseFormat(string input)
{
string output = "";
for (int i = 0; i <= input.Length + 1; i++)
{
if (i % 5 == 0)
{
if (i + 5 < input.Length)
{
output += input.Substring(i, 5) + "-";
}
else
{
output += input.Substring(i);
}
}
}
return output;
}
}
}
+150
View File
@@ -0,0 +1,150 @@
namespace mononucleosis_pro
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
this.btnGenerate = new System.Windows.Forms.Button();
this.txtEmail = new System.Windows.Forms.TextBox();
this.lblEmail = new System.Windows.Forms.Label();
this.txtLicense = new System.Windows.Forms.TextBox();
this.lblLicense = new System.Windows.Forms.Label();
this.lblVersion = new System.Windows.Forms.Label();
this.cbxVersion = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// btnGenerate
//
this.btnGenerate.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btnGenerate.Location = new System.Drawing.Point(104, 146);
this.btnGenerate.Name = "btnGenerate";
this.btnGenerate.Size = new System.Drawing.Size(76, 23);
this.btnGenerate.TabIndex = 0;
this.btnGenerate.Text = "&Generate";
this.btnGenerate.UseVisualStyleBackColor = true;
this.btnGenerate.Click += new System.EventHandler(this.btnGenerate_Click);
//
// txtEmail
//
this.txtEmail.Anchor = System.Windows.Forms.AnchorStyles.None;
this.txtEmail.Location = new System.Drawing.Point(12, 72);
this.txtEmail.Name = "txtEmail";
this.txtEmail.Size = new System.Drawing.Size(260, 23);
this.txtEmail.TabIndex = 2;
this.txtEmail.Text = "me@example.com";
this.txtEmail.Click += new System.EventHandler(this.txtEmail_Click);
this.txtEmail.TextChanged += new System.EventHandler(this.txtEmail_TextChanged);
this.txtEmail.Enter += new System.EventHandler(this.txtEmail_Enter);
//
// lblEmail
//
this.lblEmail.AutoSize = true;
this.lblEmail.Location = new System.Drawing.Point(12, 54);
this.lblEmail.Name = "lblEmail";
this.lblEmail.Size = new System.Drawing.Size(36, 15);
this.lblEmail.TabIndex = 5;
this.lblEmail.Text = "Email";
//
// txtLicense
//
this.txtLicense.Anchor = System.Windows.Forms.AnchorStyles.None;
this.txtLicense.Location = new System.Drawing.Point(12, 116);
this.txtLicense.Name = "txtLicense";
this.txtLicense.ReadOnly = true;
this.txtLicense.Size = new System.Drawing.Size(260, 23);
this.txtLicense.TabIndex = 3;
this.txtLicense.Click += new System.EventHandler(this.txtLicense_Click);
//
// lblLicense
//
this.lblLicense.AutoSize = true;
this.lblLicense.Location = new System.Drawing.Point(12, 98);
this.lblLicense.Name = "lblLicense";
this.lblLicense.Size = new System.Drawing.Size(46, 15);
this.lblLicense.TabIndex = 6;
this.lblLicense.Text = "License";
//
// lblVersion
//
this.lblVersion.AutoSize = true;
this.lblVersion.Location = new System.Drawing.Point(12, 9);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(45, 15);
this.lblVersion.TabIndex = 4;
this.lblVersion.Text = "Version";
//
// cbxVersion
//
this.cbxVersion.Anchor = System.Windows.Forms.AnchorStyles.None;
this.cbxVersion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbxVersion.FormattingEnabled = true;
this.cbxVersion.Items.AddRange(new object[] {
"Sublime Text 3",
"Visual Studio Code"});
this.cbxVersion.Location = new System.Drawing.Point(13, 27);
this.cbxVersion.Name = "cbxVersion";
this.cbxVersion.Size = new System.Drawing.Size(259, 23);
this.cbxVersion.TabIndex = 1;
this.cbxVersion.SelectedIndexChanged += new System.EventHandler(this.cbxVersion_SelectedIndexChanged);
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 181);
this.Controls.Add(this.cbxVersion);
this.Controls.Add(this.lblVersion);
this.Controls.Add(this.lblLicense);
this.Controls.Add(this.txtLicense);
this.Controls.Add(this.lblEmail);
this.Controls.Add(this.txtEmail);
this.Controls.Add(this.btnGenerate);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Main";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Mononucleosis Pro";
this.Load += new System.EventHandler(this.Main_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnGenerate;
private System.Windows.Forms.TextBox txtEmail;
private System.Windows.Forms.Label lblEmail;
private System.Windows.Forms.TextBox txtLicense;
private System.Windows.Forms.Label lblLicense;
private System.Windows.Forms.Label lblVersion;
private System.Windows.Forms.ComboBox cbxVersion;
}
}
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace mononucleosis_pro
{
public partial class Main : Form
{
Keygen keygen = new Keygen();
public Main()
{
InitializeComponent();
}
private void Main_Load(object sender, EventArgs e)
{
this.cbxVersion.SelectedIndex = Keygen.SUBLIME_TEXT;
btnGenerate.PerformClick();
}
private void txtEmail_Enter(object sender, EventArgs e)
{
txtEmail.SelectAll();
}
private void txtEmail_Click(object sender, EventArgs e)
{
txtEmail.SelectAll();
}
private void txtLicense_Click(object sender, EventArgs e)
{
txtLicense.SelectAll();
}
private void cbxVersion_SelectedIndexChanged(object sender, EventArgs e)
{
generate();
}
private void txtEmail_TextChanged(object sender, EventArgs e)
{
generate();
}
private void btnGenerate_Click(object sender, EventArgs e)
{
generate();
txtLicense.SelectAll();
}
private void generate()
{
txtLicense.Text = keygen.Generate(cbxVersion.SelectedIndex, txtEmail.Text);
}
}
}
+16414
View File
File diff suppressed because it is too large. Load diff
+23
View File
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace mononucleosis_pro
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
}
}
+34
View File
@@ -1,2 +1,36 @@
# mononucleosis-pro
Generates keys for an aptly named **color scheme**?
![logo, f in chat](img/logo.png)
`Press F to pay respects`
## Instructions
### Sublime Text 3
* Open *Sublime Text 3* and ensure you have `Theme - <package name>` installed
* Open up the user preferences for the theme `(Preferences > Package Settings > Theme - <package name> > Settings - User)`
* Copy the following text into the file, with the placeholder values changed appropriately
```json
{
"email": "{add your email here}",
"license_key": "{add your license key here}"
}
```
* Save the file and restart *Sublime Text 3*
* You should see a thank you pop-up message and you are now running an activated theme.
![sublime text 3](img/st3.png)
### Visual Studio Code
* Open *Visual Studio Code* and ensure you have `<package name>` installed.
* Press `Ctrl+Shift+P` to open the command palette.
* Search for `<package name>` and select the option `<package name> - enter license.`
* Follow the prompts on-screen to enter your email and license key.
* You should see a thank you pop-up message and you are now running an activated theme.
![visual studio code](img/vsc.png)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 958 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

+12
View File
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>mononucleosis_pro</RootNamespace>
<UseWindowsForms>true</UseWindowsForms>
<StartupObject>mononucleosis_pro.Program</StartupObject>
<ApplicationIcon>img\icon.ico</ApplicationIcon>
</PropertyGroup>
</Project>
+25
View File
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30330.147
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mononucleosis-pro", "mononucleosis-pro.csproj", "{504B5D1E-BEE0-40D2-9CF6-138F4F5CBDA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{504B5D1E-BEE0-40D2-9CF6-138F4F5CBDA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{504B5D1E-BEE0-40D2-9CF6-138F4F5CBDA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{504B5D1E-BEE0-40D2-9CF6-138F4F5CBDA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{504B5D1E-BEE0-40D2-9CF6-138F4F5CBDA1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B54B56FE-205A-4DC4-B2C3-8F7112374967}
EndGlobalSection
EndGlobal