CLSUUID.java
2.81 KB
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
package com.crashlytics.android.core;
import android.os.Process;
import io.fabric.sdk.android.services.common.CommonUtils;
import io.fabric.sdk.android.services.common.IdManager;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicLong;
class CLSUUID
{
private static String _clsId;
private static final AtomicLong _sequenceNumber = new AtomicLong(0L);
public CLSUUID(IdManager paramIdManager)
{
Object localObject = new byte[10];
populateTime((byte[])localObject);
populateSequenceNumber((byte[])localObject);
populatePID((byte[])localObject);
paramIdManager = CommonUtils.sha1(paramIdManager.getAppInstallIdentifier());
localObject = CommonUtils.hexify((byte[])localObject);
_clsId = String.format(Locale.US, "%s-%s-%s-%s", new Object[] { ((String)localObject).substring(0, 12), ((String)localObject).substring(12, 16), ((String)localObject).subSequence(16, 20), paramIdManager.substring(0, 12) }).toUpperCase(Locale.US);
}
private static byte[] convertLongToFourByteBuffer(long paramLong)
{
ByteBuffer localByteBuffer = ByteBuffer.allocate(4);
localByteBuffer.putInt((int)paramLong);
localByteBuffer.order(ByteOrder.BIG_ENDIAN);
localByteBuffer.position(0);
return localByteBuffer.array();
}
private static byte[] convertLongToTwoByteBuffer(long paramLong)
{
ByteBuffer localByteBuffer = ByteBuffer.allocate(2);
localByteBuffer.putShort((short)(int)paramLong);
localByteBuffer.order(ByteOrder.BIG_ENDIAN);
localByteBuffer.position(0);
return localByteBuffer.array();
}
private void populatePID(byte[] paramArrayOfByte)
{
byte[] arrayOfByte = convertLongToTwoByteBuffer(Integer.valueOf(Process.myPid()).shortValue());
paramArrayOfByte[8] = arrayOfByte[0];
paramArrayOfByte[9] = arrayOfByte[1];
}
private void populateSequenceNumber(byte[] paramArrayOfByte)
{
byte[] arrayOfByte = convertLongToTwoByteBuffer(_sequenceNumber.incrementAndGet());
paramArrayOfByte[6] = arrayOfByte[0];
paramArrayOfByte[7] = arrayOfByte[1];
}
private void populateTime(byte[] paramArrayOfByte)
{
long l = new Date().getTime();
byte[] arrayOfByte = convertLongToFourByteBuffer(l / 1000L);
paramArrayOfByte[0] = arrayOfByte[0];
paramArrayOfByte[1] = arrayOfByte[1];
paramArrayOfByte[2] = arrayOfByte[2];
paramArrayOfByte[3] = arrayOfByte[3];
arrayOfByte = convertLongToTwoByteBuffer(l % 1000L);
paramArrayOfByte[4] = arrayOfByte[0];
paramArrayOfByte[5] = arrayOfByte[1];
}
public String toString()
{
return _clsId;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/crashlytics/android/core/CLSUUID.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/