quick code reformat
This commit is contained in:
1 parent
f77ce971d8
commit
6a2ab0d873
2 files changed
+14
-14
No files matched your search
@@ -238,21 +238,21 @@ namespace FrappeMocha
|
|||||||
|
|
||||||
public string GenLicenseAndroid(int itype, string param_company, LicenseTypes license)
|
public string GenLicenseAndroid(int itype, string param_company, LicenseTypes license)
|
||||||
{
|
{
|
||||||
char type = (char)(itype + (int)'0');
|
char type = (char) (itype + (int) '0');
|
||||||
string param_lickey = type.ToString();
|
string param_lickey = type.ToString();
|
||||||
long sum = 0;
|
long sum = 0;
|
||||||
byte[] byteArray = this.StrToByteArray(param_company);
|
byte[] byteArray = this.StrToByteArray(param_company);
|
||||||
for (int index = 0; index < byteArray.Length; ++index)
|
for (int index = 0; index < byteArray.Length; ++index)
|
||||||
{
|
{
|
||||||
if ((long)byteArray[index] >= 65 && (long)byteArray[index] <= 90)
|
if ((long) byteArray[index] >= 65 && (long) byteArray[index] <= 90)
|
||||||
byteArray[index] += 32; // this is basically str.toLower()
|
byteArray[index] += 32; // this is basically str.toLower()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int index = 0; index < byteArray.Length; ++index)
|
for (int index = 0; index < byteArray.Length; ++index)
|
||||||
{
|
{
|
||||||
if ((ulong)byteArray[index] >= 65 && (ulong)byteArray[index] <= 122)
|
if ((ulong) byteArray[index] >= 65 && (ulong) byteArray[index] <= 122)
|
||||||
{
|
{
|
||||||
sum += byteArray[index] + (uint)license;
|
sum += byteArray[index] + (uint) license;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sum = sum * param_lickey[0];
|
sum = sum * param_lickey[0];
|
||||||
@@ -317,14 +317,14 @@ namespace FrappeMocha
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < param_lickey.Length; i++)
|
for (int i = 0; i < param_lickey.Length; i++)
|
||||||
{
|
{
|
||||||
bArr2[i] = (byte)param_lickey[i];
|
bArr2[i] = (byte) param_lickey[i];
|
||||||
}
|
}
|
||||||
for (int i2 = 0; i2 < param_company.Length; i2++)
|
for (int i2 = 0; i2 < param_company.Length; i2++)
|
||||||
{
|
{
|
||||||
bArr[i2] = (byte)param_company[i2];
|
bArr[i2] = (byte) param_company[i2];
|
||||||
if (param_company[i2] >= 'A' && param_company[i2] <= 'Z')
|
if (param_company[i2] >= 'A' && param_company[i2] <= 'Z')
|
||||||
{
|
{
|
||||||
bArr[i2] = (byte)(bArr[i2] + 32);
|
bArr[i2] = (byte) (bArr[i2] + 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long j = 0;
|
long j = 0;
|
||||||
@@ -332,7 +332,7 @@ namespace FrappeMocha
|
|||||||
{
|
{
|
||||||
if (bArr[i3] >= 65 && bArr[i3] <= 122)
|
if (bArr[i3] >= 65 && bArr[i3] <= 122)
|
||||||
{
|
{
|
||||||
j += (bArr[i3] + (long)license);
|
j += (bArr[i3] + (long) license);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long j2 = j * bArr2[0];
|
long j2 = j * bArr2[0];
|
||||||
@@ -343,7 +343,7 @@ namespace FrappeMocha
|
|||||||
}
|
}
|
||||||
string sb = "";
|
string sb = "";
|
||||||
sb += param_lickey[0];
|
sb += param_lickey[0];
|
||||||
sb += (object)j3;
|
sb += (object) j3;
|
||||||
if (param_lickey.StartsWith(sb))
|
if (param_lickey.StartsWith(sb))
|
||||||
{
|
{
|
||||||
// lictype = bArr2[0] - 48;
|
// lictype = bArr2[0] - 48;
|
||||||
|
|||||||
+5
-5
@@ -141,7 +141,6 @@ namespace FrappeMocha
|
|||||||
case 19:
|
case 19:
|
||||||
this.keygen(Keygen.LicenseTypes.LicenseAndroidBarcode);
|
this.keygen(Keygen.LicenseTypes.LicenseAndroidBarcode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,11 +247,12 @@ namespace FrappeMocha
|
|||||||
|
|
||||||
private void MainForm_KeyPress(object sender, KeyPressEventArgs e)
|
private void MainForm_KeyPress(object sender, KeyPressEventArgs e)
|
||||||
{
|
{
|
||||||
Array.Copy(this.ficus, 1, this.ficus, 0, this.ficus.Length -1);
|
Array.Copy(this.ficus, 1, this.ficus, 0, this.ficus.Length - 1);
|
||||||
this.ficus[ficus.Length -1] = e.KeyChar;
|
this.ficus[ficus.Length - 1] = e.KeyChar;
|
||||||
if (new string (ficus) == "spicey")
|
if (new string(ficus) == "spicey")
|
||||||
{
|
{
|
||||||
switch (MessageBox.Show("Would you like a little salt, as a treat?", "Orly?", MessageBoxButtons.YesNoCancel,
|
switch (MessageBox.Show("Would you like a little salt, as a treat?", "Orly?",
|
||||||
|
MessageBoxButtons.YesNoCancel,
|
||||||
MessageBoxIcon.Question))
|
MessageBoxIcon.Question))
|
||||||
{
|
{
|
||||||
case DialogResult.Yes:
|
case DialogResult.Yes:
|
||||||
|
|||||||
Reference in new issue
Block a user