MyEclipse_6.5.1GA_E3.3.2_Installer _ Registration Algorithm

Source: Internet
Author: User

[Java]
Package com. jadyer. util;
 
Import java. io. BufferedReader;
Import java. io. IOException;
Import java. io. InputStreamReader;
Import java. text. DecimalFormat;
Import java. text. NumberFormat;
Import java. text. SimpleDateFormat;
Import java. util. Calendar;
 
/**
* MyEclipse_6.5.1GA_E3.3.2_Installer _ Registration Algorithm
* @ Create Oct 23,201 2 9:48:29 AM
* @ Author Xuan Yu */
Public class MyEclipseGen {
Private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf ). under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. think about it; pay for a license, avoid prosecution, and feel better about yourself. ";

Public String getSerial (String userId, String licenseNum ){
Calendar cal = Calendar. getInstance ();
Cal. add (1, 3 );
Cal. add (6,-1 );
NumberFormat nf = new DecimalFormat ("000 ");
LicenseNum = nf. format (Integer. valueOf (licenseNum ));
String verTime = new StringBuilder ("-"). append (new SimpleDateFormat ("yyMMdd "). format (cal. getTime ())). append ("0 "). toString ();
String type = "YE3MP -";
String need = new StringBuilder (userId. substring (0, 1 )). append (type ). append ("300 "). append (licenseNum ). append (verTime ). toString ();
String dx = new StringBuilder (need). append (LL). append (userId). toString ();
Int suf = this. decode (dx );
String code = new StringBuilder (need). append (String. valueOf (suf). toString ();
Return this. change (code );
}

Private int decode (String s ){
Int I;
Char [] ac;
Int j;
Int k;
I = 0;
Ac = s. toCharArray ();
J = 0;
K = ac. length;
While (j <k ){
I = (31 * I) + ac [j];
J ++;
}
Return Math. abs (I );
}

Private String change (String s ){
Byte [] abyte0;
Char [] ac;
Int I;
Int k;
Int j;
Abyte0 = s. getBytes ();
Ac = new char [s. length ()];
I = 0;
K = abyte0.length;
While (I <k ){
J = abyte0 [I];
If (j> = 48 & j <= 57 ){
J = (j-48) + 5) % 10) + 48;
} Else if (j> = 65 & j <= 90 ){
J = (j-65) + 13) % 26) + 65;
} Else if (j> = 97 & j <= 122 ){
J = (j-97) + 13) % 26) + 97;
}
Ac [I] = (char) j;
I ++;
}
Return String. valueOf (ac );
}

Public MyEclipseGen (){
Super ();
}
 
Public static void main (String [] args) throws IOException {
System. out. println ("Please Input Register Name :");
BufferedReader br = new BufferedReader (new InputStreamReader (System. in ));
String serialNo = new MyEclipseGen (). getSerial (br. readLine (), "1 ");
Br. close ();
System. out. println ("Your SerialNo Is: [" + serialNo + "]");
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.