|
- //主要实现过程,其中paramString2为手机串号,paramLong为uin
- this.cSb = getMessageDigest((paramString2 + paramLong).getBytes()).substring(0, 7);
- String str = "PRAGMA key="" + this.cSb + "";";
- //
-
-
-
- package com.gracecode.android.signature.wechat;
-
- import java.security.MessageDigest;
-
- public final class MD5
- {
- public static final String getMessageDigest(byte[] paramArrayOfByte)
- {
- char[] arrayOfChar1 = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102 };
- try
- {
- MessageDigest localMessageDigest = MessageDigest.getInstance("MD5");
- localMessageDigest.update(paramArrayOfByte);
- byte[] arrayOfByte = localMessageDigest.digest();
- int i = arrayOfByte.length;
- char[] arrayOfChar2 = new char[i * 2];
- int j = 0;
- int k = 0;
- while (true)
- {
- if (j >= i)
- return new String(arrayOfChar2);
- int m = arrayOfByte[j];
- int n = k + 1;
- arrayOfChar2[k] = arrayOfChar1[(0xF & m >>> 4)];
- k = n + 1;
- arrayOfChar2[n] = arrayOfChar1[(m & 0xF)];
- j++;
- }
- }
- catch (Exception localException)
- {
- }
- return null;
- }
复制代码 |
|