Region.java
3.64 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package com.radiusnetworks.ibeacon;
public class Region
{
protected Integer major;
protected Integer minor;
protected String proximityUuid;
protected String uniqueId;
protected Region() {}
protected Region(Region paramRegion)
{
this.major = paramRegion.major;
this.minor = paramRegion.minor;
this.proximityUuid = paramRegion.proximityUuid;
this.uniqueId = paramRegion.uniqueId;
}
public Region(String paramString1, String paramString2, Integer paramInteger1, Integer paramInteger2)
{
this.major = paramInteger1;
this.minor = paramInteger2;
this.proximityUuid = normalizeProximityUuid(paramString2);
this.uniqueId = paramString1;
if (paramString1 == null) {
throw new NullPointerException("uniqueId may not be null");
}
}
public static String normalizeProximityUuid(String paramString)
{
if (paramString == null) {
return null;
}
String str = paramString.toLowerCase().replaceAll("[\\-\\s]", "");
if (str.length() != 32) {
throw new RuntimeException("UUID: " + paramString + " is too short. Must contain exactly 32 hex digits, and there are this value has " + str.length() + " digits.");
}
if (!str.matches("^[a-fA-F0-9]*$")) {
throw new RuntimeException("UUID: " + paramString + " contains invalid characters. Must be dashes, a-f and 0-9 characters only.");
}
paramString = new StringBuilder();
paramString.append(str.substring(0, 8));
paramString.append('-');
paramString.append(str.substring(8, 12));
paramString.append('-');
paramString.append(str.substring(12, 16));
paramString.append('-');
paramString.append(str.substring(16, 20));
paramString.append('-');
paramString.append(str.substring(20, 32));
return paramString.toString();
}
public Object clone()
{
return new Region(this);
}
public boolean equals(Object paramObject)
{
if ((paramObject instanceof Region)) {
return ((Region)paramObject).uniqueId.equals(this.uniqueId);
}
return false;
}
public Integer getMajor()
{
return this.major;
}
public Integer getMinor()
{
return this.minor;
}
public String getProximityUuid()
{
return this.proximityUuid;
}
public String getUniqueId()
{
return this.uniqueId;
}
public int hashCode()
{
return this.uniqueId.hashCode();
}
public boolean matchesIBeacon(IBeacon paramIBeacon)
{
if ((this.proximityUuid != null) && (!paramIBeacon.getProximityUuid().equals(this.proximityUuid))) {
if (IBeaconManager.debug) {
new StringBuilder("unmatching proxmityUuids: ").append(paramIBeacon.getProximityUuid()).append(" != ").append(this.proximityUuid);
}
}
do
{
do
{
return false;
if ((this.major == null) || (paramIBeacon.getMajor() == this.major.intValue())) {
break;
}
} while (!IBeaconManager.debug);
new StringBuilder("unmatching major: ").append(paramIBeacon.getMajor()).append(" != ").append(this.major);
return false;
if ((this.minor == null) || (paramIBeacon.getMinor() == this.minor.intValue())) {
break;
}
} while (!IBeaconManager.debug);
new StringBuilder("unmatching minor: ").append(paramIBeacon.getMajor()).append(" != ").append(this.minor);
return false;
return true;
}
public String toString()
{
return "proximityUuid: " + this.proximityUuid + " major: " + this.major + " minor:" + this.minor;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/radiusnetworks/ibeacon/Region.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/