admin
2021-01-04 aa6ef62aef83e277d4171df1d9f0803f91738216
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package com.newvideo.util.video;
 
import java.util.Random;
 
public class PPTVKey {
    public static int a(byte abyte0[], int i) {
        int j = 0;
        int k = 0;
        for (; j < i; j++)
            k ^= abyte0[j] << 8 * (j % 4);
 
        return k;
    }
 
    public static int a(byte abyte0[], int i, byte abyte1[], int j) {
        if (j < 1 + i * 2)
            return 0;
        for (int k = 0; k < i; k++) {
            abyte1[k * 2] = (byte) (0xf & abyte0[k]);
            abyte1[1 + k * 2] = (byte) (0xf & abyte0[k] >> 4);
        }
 
        int l = 0;
        while (l < i * 2) {
            byte byte0 = abyte1[l];
            byte byte1;
            if (abyte1[l] > 9)
                byte1 = 87;
            else
                byte1 = 48;
            abyte1[l] = (byte) (byte0 + byte1);
            l++;
        }
        abyte1[i * 2] = 0;
        return 1;
    }
 
    public static String getKey(long l) {
        byte abyte0[] = new byte[16];
        byte abyte1[] = new byte[16];
        byte abyte2[] = new byte[33];
        int i = 0;
        while (i < 16) {
            byte byte0;
            if (i < "qqqqqww".length())
                byte0 = (byte) "qqqqqww".charAt(i);
            else
                byte0 = 0;
            abyte1[i] = byte0;
            i++;
        }
        a((int) (l / 1000L - 100L), abyte0, 16);
        Random random = new Random();
        for (int j = 0; j < 16; j++)
            if (abyte0[j] == 0)
                abyte0[j] = (byte) random.nextInt(256);
 
        b(abyte0, 16, abyte1, 16);
        a(abyte0, 16, abyte2, 33);
        return new String(abyte2, 0, 32);
    }
 
    public static void a(int i, byte abyte0[], int j) {
        int k = 0;
        while (k < j && k < 8) {
            abyte0[k] = (byte) (0xf & i >> 28 - 4 * (k % 8));
            byte byte0 = abyte0[k];
            byte byte1;
            if (abyte0[k] > 9)
                byte1 = 87;
            else
                byte1 = 48;
            abyte0[k] = (byte) (byte0 + byte1);
            k++;
        }
    }
 
    public static long b(long l) {
        return 0xffffffffL & l;
    }
 
    public static void b(byte abyte0[], int i, byte abyte1[], int j) {
        long l = a(abyte1, j);
        long l1 = l << 8 | l >> 24;
        long l2 = l << 16 | l >> 16;
        long l3 = l << 24 | l >> 8;
        for (int k = 0; k + 16 <= i; k += 16) {
            long l4 = 0L;
            long l5 = 0L;
            long l6 = 0L;
            for (int i1 = 0; i1 < 4; i1++) {
                l4 |= (long) (0xff & abyte0[k + i1]) << i1 * 8;
                l5 |= (long) (0xff & abyte0[4 + (k + i1)]) << i1 * 8;
            }
 
            for (int j1 = 0; j1 < 32; j1++) {
                l6 = b(l6 - 0x61c88647L);
                l4 = b(l4
                        + (b(b(l + b(l5 << 4)) ^ b(l5 + l6)) ^ b(l1
                                + b(l5 >> 5))));
                l5 = b(l5
                        + (b(b(l2 + b(l4 << 4)) ^ b(l4 + l6)) ^ b(l3
                                + b(l4 >> 5))));
            }
 
            for (int k1 = 0; k1 < 4; k1++) {
                abyte0[k + k1] = (byte) (int) (255L & l4 >> k1 * 8);
                abyte0[4 + (k + k1)] = (byte) (int) (255L & l5 >> k1 * 8);
            }
 
        }
 
    }
}