Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.nio.ByteBuffer;
- import java.nio.IntBuffer;
- import java.security.SecureRandom;
- import java.util.Arrays;
- import android.support.annotation.NonNull;
- import android.util.Base64;
- import java.util.concurrent.atomic.AtomicReference;
- import android.support.v7.widget.helper.ItemTouchHelper.Callback;
- import javax.crypto.spec.IvParameterSpec;
- import javax.crypto.spec.PBEKeySpec;
- import javax.crypto.spec.SecretKeySpec;
- import java.security.Key;
- import javax.crypto.Cipher;
- import javax.crypto.Mac;
- import javax.crypto.SecretKey;
- import javax.crypto.SecretKeyFactory;
- import java.security.InvalidKeyException;
- import java.security.NoSuchAlgorithmException;
- public class HelloWorld
- {
- //rK7g5nQOnVKEJly17CcB50fnA11SO5ofR0Z6aQDzoaXoYgEAAPV-ME5TDAR2Z2kpiC9apbjp3md_muDXp3SrLAdlfpTe125CGw==;ATIuNC4wAAAAADE0MDEw
- static String postbody = ("username=fgjhghh&password=vfhjhhg&grant_type=password&edidSessionId=76f11486-55de-434b-8240-02b929943a3f&client_id=befcbc59-53ac-4db3-8292-7cab81a13d5e&client_secret=td");
- static String optString = "V6y8yuKPUmrkCc47d2u7Tj-7T8t3neFvjBJfkw==";
- static String bArr2 = "Um729YCRdXGftuhmvNK8o0e6J__xxL9dBTiULA==";
- static byte[] aOptStringbArr2;
- public volatile static byte[] f11159a;
- static byte[] aPostBodyF11159a;
- public volatile static byte[] f11160b;
- public static byte[] m13163a(String str) {
- try {
- return Base64.decode(str, 10);
- } catch (Exception e) {
- return Base64.decode("", 10);
- }
- }
- public static byte[] m13164a(byte[] bArr, byte[] bArr2) {
- byte[] bArr3 = null;
- if (bArr2 != null) {
- try {
- Key secretKeySpec = new SecretKeySpec(bArr2, m13133c());
- Mac instance = Mac.getInstance(m13133c());
- instance.init(secretKeySpec);
- bArr3 = instance.doFinal(bArr);
- } catch (InvalidKeyException e) {
- System.out.println("M10");
- } catch (NoSuchAlgorithmException e2) {
- System.out.println("M11");
- } catch (Exception e3) {
- System.out.println("M100");
- }
- }
- return bArr3;
- }
- //=======
- public static String m13133c() {
- return m13131a(new byte[]{(byte) -68, (byte) 86, (byte) 32, (byte) -52, (byte) 122, (byte) 55, (byte) -50, (byte) 55, (byte) 96, (byte) 70, (byte) 24, (byte) 46, (byte) 27, (byte) 104, (byte) 22, (byte) -119}, f10457d);
- }
- private static SecretKey f10457d = m13129C();
- private static byte[] f10456c = new byte[]{(byte) 114, (byte) -122, (byte) 70, Byte.MAX_VALUE, (byte) -11, (byte) 40, (byte) -11, (byte) -37, (byte) -49, (byte) 26, (byte) -40, (byte) -47, (byte) -19, (byte) 9, (byte) -127, (byte) 94};
- private static String m13131a(byte[] bArr, SecretKey secretKey) {
- if (!(bArr == null || secretKey == null)) {
- try {
- Cipher instance = Cipher.getInstance("AES/CBC/PKCS5Padding");
- instance.init(2, secretKey, new IvParameterSpec(f10456c));
- return new String(instance.doFinal(bArr), "UTF-8");
- } catch (Exception e) {
- }
- }
- return "";
- }
- private static SecretKey m13129C() {
- int i = 0;
- try {
- int[] iArr = new int[]{368, 296, 179, 528, 3, 318, 564, 1, 292, 536, 439, 192, 633, 333, 40, 556, 325, 277, 16, 536, 275, 343, 40, 522, 41, 268, 577, 414, 72, 618, 307, 312, 45, 521, 307, 28, 567, 33, 256, 620, 21, 340, 526, 336, 357, 12, 552, 299, 408, 236, 554, 383, 278, 6, 559, 393, 2, 638, 414, 82, 596, 436, 138, 629, 439, 30, 604, 268};
- ByteBuffer allocate = ByteBuffer.allocate(48);
- IntBuffer allocate2 = IntBuffer.allocate(48);
- int i2 = 1;
- int i3 = 0;
- for (int i4 = 0; i4 < 68; i4++) {
- if (iArr[i4] > 510) {
- i3++;
- i2 = 1;
- } else if (i2 != 0) {
- if (iArr[i4] > 255) {
- allocate2.put((200 - iArr[i4]) + 255);
- } else {
- allocate2.put(iArr[i4] + Callback.DEFAULT_DRAG_ANIMATION_DURATION);
- }
- i2 = 0;
- } else if (iArr[i4] > 255) {
- allocate2.put((allocate2.get((i4 - 1) - i3) - iArr[i4]) + 255);
- } else {
- allocate2.put(allocate2.get((i4 - 1) - i3) + iArr[i4]);
- }
- }
- int[] array = allocate2.array();
- int length = array.length;
- while (i < length) {
- allocate.put(Integer.valueOf(array[i]).byteValue());
- i++;
- }
- return new SecretKeySpec(Arrays.copyOfRange(SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1").generateSecret(new PBEKeySpec(Base64.encodeToString(allocate.array(), 1).toCharArray(), new byte[]{(byte) 97, (byte) -55, (byte) -80, (byte) 22, (byte) 33, (byte) -116, (byte) 52, (byte) 59, (byte) -104, (byte) -41, (byte) -39, (byte) 22, (byte) -32, (byte) -98, (byte) 61, (byte) -99, (byte) 42, (byte) 124, (byte) 31, (byte) -5, (byte) 10, (byte) -53, (byte) 61, (byte) -120, (byte) -85, (byte) 62, (byte) 73, (byte) -87, (byte) -6, (byte) -36, (byte) -22, (byte) -104}, 1024, 128)).getEncoded(), 0, 16), "AES");
- } catch (Exception e) {
- return null;
- }
- }
- public final static String m14504a(@NonNull byte[] bArr, @NonNull byte[] bArr2) {
- int i = 1;
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append(m14491b(bArr, bArr2));
- ByteBuffer allocate = ByteBuffer.allocate(15);
- ByteBuffer allocate2 = ByteBuffer.allocate(9);
- allocate2.put("2.4.0".getBytes());
- allocate2.flip();
- allocate.put(Integer.valueOf(1).byteValue());
- allocate.put(allocate2.array());
- i = 0;
- allocate.put(Integer.toString(i).getBytes());
- allocate.put(m14522a());
- allocate.flip();
- String a = m13158a(allocate.array());
- if (a.length() > 0) {
- stringBuilder.append(";").append(a);
- }
- return stringBuilder.toString();
- }
- private static String m14491b(@NonNull byte[] bArr, @NonNull byte[] bArr2) {
- byte[] bArr3 = new byte[(bArr.length + bArr2.length)];
- int i = 0;
- while (i < bArr3.length) {
- bArr3[i] = i < bArr.length ? bArr[i] : bArr2[i - bArr.length];
- i++;
- }
- return m13158a(bArr3);
- }
- public static String m13158a(byte[] bArr) {
- try {
- return Base64.encodeToString(bArr, 10);
- } catch (Exception e) {
- return "";
- }
- }
- public final static byte[] m14522a() {
- ByteBuffer allocate = ByteBuffer.allocate(4);
- allocate.put(((String) "FF").getBytes()); //затестить 80/10 20/10 FF/10
- allocate.put(((String) "10").getBytes());
- allocate.flip();
- return allocate.array();
- }
- //========
- public static void main(String[] args)
- {
- aOptStringbArr2 = m13164a(m13163a(optString), m13163a(bArr2));
- f11159a = aOptStringbArr2;
- f11160b = "ABUcwOliAQAAXpqxbtCTpMx8IXwrha0NmvC70zudXiLCLxfywvJRUejj".getBytes(); //uuid в байтах
- aPostBodyF11159a = m13164a(postbody.getBytes(), f11159a);
- //System.out.println(Arrays.toString(m13163a(optString)).getBytes());
- System.out.println(m14504a(aPostBodyF11159a,f11160b));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement