一个安卓程序反编译后的部分代码,关键是序列号(Guid),没事你试试!
import java.util.Date;public class SerialNumber
{
private Date mAuthExpireDate;
private Date mBeginDate;
private String mGuid;
private Date mUseExpireDate;
public Date getAuthExpireDate()
{
return this.mAuthExpireDate;
}
public Date getBeginDate()
{
return this.mBeginDate;
}
public String getGuid()
{
return this.mGuid;
}
public Date getUseExpireDate()
{
return this.mUseExpireDate;
}
public void setAuthExpireDate(Date paramDate)
{
this.mAuthExpireDate = paramDate;
}
public void setBeginDate(Date paramDate)
{
this.mBeginDate = paramDate;
}
public void setGuid(String paramString)
{
this.mGuid = paramString;
}
public void setUseExpireDate(Date paramDate)
{
this.mUseExpireDate = paramDate;
}
}
import com.hw.smart.core.DateUtil;
import com.hw.smart.core.xml.XmlParser;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
public class SerialNumberXmlParser extends XmlParser
{
private SerialNumber mItem = null;
private List<SerialNumber> mItems = null;
private String mTagName;
public SerialNumberXmlParser(InputStream paramInputStream)
{
super(paramInputStream);
}
public SerialNumberXmlParser(String paramString)
{
super(paramString);
}
protected void endTag()
{
this.mTagName = this.mParser.getName();
if (this.mTagName.equals("SerialNumber"))
{
this.mItems.add(this.mItem);
this.mItem = null;
}
this.mTagName = "";
}
public List<SerialNumber> getItems()
{
if (this.mItems == null);
try
{
parser();
return this.mItems;
}
catch (XmlPullParserException localXmlPullParserException)
{
while (true)
localXmlPullParserException.printStackTrace();
}
catch (IOException localIOException)
{
while (true)
localIOException.printStackTrace();
}
}
protected void startDocument()
{
this.mItems = new ArrayList();
}
protected void startTag()
{
this.mTagName = this.mParser.getName();
if (this.mTagName.equals("SerialNumber"))
this.mItem = new SerialNumber();
}
protected void text()
{
String str = this.mParser.getText();
if (this.mTagName.equals("Guid"))
this.mItem.setGuid(str);
do
{
return;
if (this.mTagName.equals("BeginDate"))
{
this.mItem.setBeginDate(DateUtil.parseDate(str, DateUtil.YMD));
return;
}
if (this.mTagName.equals("AuthExpireDate"))
{
this.mItem.setAuthExpireDate(DateUtil.parseDate(str, DateUtil.YMD));
return;
}
}
while (!this.mTagName.equals("UseExpireDate"));
this.mItem.setUseExpireDate(DateUtil.parseDate(str, DateUtil.YMD));
}
}
重点是要生成一个可用的序列号,已知可用的有两组如下:
Guid BeginDate AuthExpireDate UseExpireDate
1330-1779-4488-2101 2014-7-11 2014-12-31 2014-12-31
SA12-EB54-4561-Y121 2015-1-1 2015-7-10 2015-7-10
有能根据以上算法,自定义时间生成序列号的,可以的来试试?
package org.jsoup.helper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Document.OutputSettings;
import org.jsoup.nodes.Element;
import org.jsoup.parser.Parser;
import org.jsoup.select.Elements;
public class DataUtil
{
private static final int bufferSize = 131072;
private static final Pattern charsetPattern = Pattern.compile("(?i)\\bcharset=\\s*\"?([^\\s;\"]*)");
static final String defaultCharset = "UTF-8";
static String getCharsetFromContentType(String paramString)
{
String str;
if (paramString == null)
str = null;
do
{
do
{
return str;
Matcher localMatcher = charsetPattern.matcher(paramString);
if (!localMatcher.find())
break;
str = localMatcher.group(1).trim();
}
while (Charset.isSupported(str));
str = str.toUpperCase(Locale.ENGLISH);
}
while (Charset.isSupported(str));
return null;
}
// ERROR //
public static Document load(java.io.File paramFile, String paramString1, String paramString2)
throws IOException
{
// Byte code:
// 0: aconst_null
// 1: astore_3
// 2: new 72 java/io/FileInputStream
// 5: dup
// 6: aload_0
// 7: invokespecial 75 java/io/FileInputStream:<init> (Ljava/io/File;)V
// 10: astore 4
// 12: aload 4
// 14: invokestatic 79 org/jsoup/helper/DataUtil:readToByteBuffer (Ljava/io/InputStream;)Ljava/nio/ByteBuffer;
// 17: aload_1
// 18: aload_2
// 19: invokestatic 85 org/jsoup/parser/Parser:htmlParser ()Lorg/jsoup/parser/Parser;
// 22: invokestatic 89 org/jsoup/helper/DataUtil:parseByteData (Ljava/nio/ByteBuffer;Ljava/lang/String;Ljava/lang/String;Lorg/jsoup/parser/Parser;)Lorg/jsoup/nodes/Document;
// 25: astore 6
// 27: aload 4
// 29: ifnull +8 -> 37
// 32: aload 4
// 34: invokevirtual 92 java/io/FileInputStream:close ()V
// 37: aload 6
// 39: areturn
// 40: astore 5
// 42: aload_3
// 43: ifnull +7 -> 50
// 46: aload_3
// 47: invokevirtual 92 java/io/FileInputStream:close ()V
// 50: aload 5
// 52: athrow
// 53: astore 5
// 55: aload 4
// 57: astore_3
// 58: goto -16 -> 42
//
// Exception table:
// from to target type
// 2 12 40 finally
// 12 27 53 finally
}
public static Document load(InputStream paramInputStream, String paramString1, String paramString2)
throws IOException
{
return parseByteData(readToByteBuffer(paramInputStream), paramString1, paramString2, Parser.htmlParser());
}
public static Document load(InputStream paramInputStream, String paramString1, String paramString2, Parser paramParser)
throws IOException
{
return parseByteData(readToByteBuffer(paramInputStream), paramString1, paramString2, paramParser);
}
static Document parseByteData(ByteBuffer paramByteBuffer, String paramString1, String paramString2, Parser paramParser)
{
String str1;
Element localElement;
String str2;
if (paramString1 == null)
{
str1 = Charset.forName("UTF-8").decode(paramByteBuffer).toString();
localDocument = paramParser.parseInput(str1, paramString2);
localElement = localDocument.select("meta, meta").first();
if (localElement != null)
{
if (!localElement.hasAttr("http-equiv"))
break label168;
str2 = getCharsetFromContentType(localElement.attr("content"));
if ((str2 != null) && (str2.length() != 0) && (!str2.equals("UTF-8")))
{
paramString1 = str2;
paramByteBuffer.rewind();
str1 = Charset.forName(str2).decode(paramByteBuffer).toString();
}
}
}
for (Document localDocument = null; ; localDocument = null)
{
if (localDocument == null)
{
if ((str1.length() > 0) && (str1.charAt(0) == 65279))
str1 = str1.substring(1);
localDocument = paramParser.parseInput(str1, paramString2);
localDocument.outputSettings().charset(paramString1);
}
return localDocument;
label168: str2 = localElement.attr("charset");
break;
Validate.notEmpty(paramString1, "Must set charset arg to character set of file to parse. Set to null to attempt to detect from HTML");
str1 = Charset.forName(paramString1).decode(paramByteBuffer).toString();
}
}
static ByteBuffer readToByteBuffer(InputStream paramInputStream)
throws IOException
{
return readToByteBuffer(paramInputStream, 0);
}
static ByteBuffer readToByteBuffer(InputStream paramInputStream, int paramInt)
throws IOException
{
boolean bool;
int i;
label18: byte[] arrayOfByte;
ByteArrayOutputStream localByteArrayOutputStream;
int j;
if (paramInt >= 0)
{
bool = true;
Validate.isTrue(bool, "maxSize must be 0 (unlimited) or larger");
if (paramInt <= 0)
break label66;
i = 1;
arrayOfByte = new byte;
localByteArrayOutputStream = new ByteArrayOutputStream(131072);
j = paramInt;
}
while (true)
{
int k = paramInputStream.read(arrayOfByte);
if (k == -1);
while (true)
{
return ByteBuffer.wrap(localByteArrayOutputStream.toByteArray());
bool = false;
break;
label66: i = 0;
break label18;
if (i == 0)
break label102;
if (k <= j)
break label95;
localByteArrayOutputStream.write(arrayOfByte, 0, j);
}
label95: j -= k;
label102: localByteArrayOutputStream.write(arrayOfByte, 0, k);
}
}
} import android.text.TextUtils;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class DesCrypt
implements ICrypt
{
public static byte[] String2Byte(String paramString)
{
boolean bool = TextUtils.isEmpty(paramString);
byte[] arrayOfByte = null;
if (bool);
while (true)
{
return arrayOfByte;
int i = paramString.length() % 2;
arrayOfByte = null;
if (i != 1)
{
arrayOfByte = new byte;
int j = 0;
try
{
while (j < paramString.length())
{
arrayOfByte[(j / 2)] = Integer.decode("0x" + paramString.substring(j, j + 2)).byteValue();
j += 2;
}
}
catch (Exception localException)
{
localException.printStackTrace();
}
}
}
return null;
}
public static String byte2HexString(byte[] paramArrayOfByte)
{
if (paramArrayOfByte == null)
return "";
StringBuffer localStringBuffer = new StringBuffer();
int i = 0;
if (i >= paramArrayOfByte.length)
return localStringBuffer.toString();
String str = Integer.toHexString(0xFF & paramArrayOfByte);
if (str.length() == 1)
localStringBuffer.append("0" + str);
while (true)
{
i++;
break;
localStringBuffer.append(str);
}
}
public String decode(String paramString1, String paramString2)
{
byte[] arrayOfByte = String2Byte(paramString1);
if (arrayOfByte == null)
return "";
try
{
IvParameterSpec localIvParameterSpec = new IvParameterSpec(paramString2.getBytes("UTF-8"));
SecretKeySpec localSecretKeySpec = new SecretKeySpec(paramString2.getBytes("UTF-8"), "DES");
Cipher localCipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
localCipher.init(2, localSecretKeySpec, localIvParameterSpec);
String str = new String(localCipher.doFinal(arrayOfByte));
return str;
}
catch (Exception localException)
{
localException.printStackTrace();
}
return paramString1;
}
public String encode(String paramString1, String paramString2)
{
try
{
IvParameterSpec localIvParameterSpec = new IvParameterSpec(paramString2.getBytes("UTF-8"));
SecretKeySpec localSecretKeySpec = new SecretKeySpec(paramString2.getBytes("UTF-8"), "DES");
Cipher localCipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
localCipher.init(1, localSecretKeySpec, localIvParameterSpec);
String str = byte2HexString(localCipher.doFinal(paramString1.getBytes()));
return str;
}
catch (Exception localException)
{
localException.printStackTrace();
}
return paramString1;
}
} 这个估计有用 这玩意好 等待大牛分析 不懂,太有学问了! 缺少
import com.hw.smart.core.DateUtil;
import com.hw.smart.core.xml.XmlParser;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException; package com.hw.smart.core.xml;
import android.text.TextUtils;
import android.util.Xml;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
public class XmlParser
{
public String Encoding = "utf-8";
protected XmlPullParser mParser = null;
private InputStream mStream;
private String mXml;
public XmlParser(InputStream paramInputStream)
{
this.mStream = paramInputStream;
}
public XmlParser(String paramString)
{
this.mXml = paramString;
}
protected void endTag()
{
}
protected void parser()
throws XmlPullParserException, IOException
{
this.mParser = Xml.newPullParser();
if (this.mStream != null)
this.mParser.setInput(this.mStream, this.Encoding);
int i;
while (true)
{
i = this.mParser.getEventType();
if (i != 1)
break;
return;
if (!TextUtils.isEmpty(this.mXml))
this.mParser.setInput(new StringReader(this.mXml));
}
if (i == 0)
startDocument();
while (true)
{
i = this.mParser.next();
break;
if (i == 2)
startTag();
else if (i == 4)
text();
else if (i == 3)
endTag();
}
}
protected void startDocument()
{
}
protected void startTag()
{
}
protected void text()
{
}
} public class DesCrypt
implements ICrypt
缺少ICrypt
页:
[1]
2