zzg.java
6.34 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package com.google.firebase.iid;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.support.annotation.VisibleForTesting;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.support.v4.util.SimpleArrayMap;
import android.util.Log;
import java.util.LinkedList;
import java.util.Queue;
public class zzg
{
private static zzg c;
@VisibleForTesting
final Queue<Intent> a = new LinkedList();
@VisibleForTesting
final Queue<Intent> b = new LinkedList();
private final SimpleArrayMap<String, String> d = new SimpleArrayMap();
private Boolean e = null;
private int a(Context paramContext, Intent paramIntent)
{
synchronized (this.d)
{
??? = (String)this.d.get(paramIntent.getAction());
??? = ???;
if (??? == null)
{
??? = paramContext.getPackageManager().resolveService(paramIntent, 0);
if ((??? == null) || (((ResolveInfo)???).serviceInfo == null)) {
Log.e("FirebaseInstanceId", "Failed to resolve target intent service, skipping classname enforcement");
}
}
}
try
{
boolean bool;
if (this.e == null)
{
if (paramContext.checkCallingOrSelfPermission("android.permission.WAKE_LOCK") == 0)
{
bool = true;
label87:
this.e = Boolean.valueOf(bool);
}
}
else {
if (!this.e.booleanValue()) {
break label406;
}
}
label368:
label406:
for (paramContext = WakefulBroadcastReceiver.startWakefulService(paramContext, paramIntent);; paramContext = paramContext.startService(paramIntent))
{
if (paramContext != null) {
break label415;
}
Log.e("FirebaseInstanceId", "Error while delivering the message: ServiceIntent not found.");
return 404;
paramContext = finally;
throw paramContext;
??? = ((ResolveInfo)???).serviceInfo;
if ((!paramContext.getPackageName().equals(((ServiceInfo)???).packageName)) || (((ServiceInfo)???).name == null))
{
??? = String.valueOf(((ServiceInfo)???).packageName);
??? = String.valueOf(((ServiceInfo)???).name);
Log.e("FirebaseInstanceId", String.valueOf(???).length() + 94 + String.valueOf(???).length() + "Error resolving target intent service, skipping classname enforcement. Resolved service was: " + (String)??? + "/" + (String)???);
break;
}
??? = ((ServiceInfo)???).name;
??? = ???;
if (((String)???).startsWith("."))
{
??? = String.valueOf(paramContext.getPackageName());
??? = String.valueOf(???);
if (((String)???).length() == 0) {
break label368;
}
??? = ((String)???).concat((String)???);
}
for (;;)
{
synchronized (this.d)
{
this.d.put(paramIntent.getAction(), ???);
if (Log.isLoggable("FirebaseInstanceId", 3))
{
??? = String.valueOf(???);
if (((String)???).length() != 0) {
"Restricting intent to a specific service: ".concat((String)???);
}
}
else
{
paramIntent.setClassName(paramContext.getPackageName(), (String)???);
break;
??? = new String((String)???);
}
}
new String("Restricting intent to a specific service: ");
}
bool = false;
break label87;
}
label415:
return -1;
}
catch (SecurityException paramContext)
{
Log.e("FirebaseInstanceId", "Error while delivering the message to the serviceIntent", paramContext);
}
return 401;
}
private static PendingIntent a(Context paramContext, int paramInt1, String paramString, Intent paramIntent, int paramInt2)
{
Intent localIntent = new Intent(paramContext, FirebaseInstanceIdInternalReceiver.class);
localIntent.setAction(paramString);
localIntent.putExtra("wrapped_intent", paramIntent);
return PendingIntent.getBroadcast(paramContext, paramInt1, localIntent, paramInt2);
}
public static PendingIntent zza(Context paramContext, int paramInt1, Intent paramIntent, int paramInt2)
{
return a(paramContext, paramInt1, "com.google.firebase.INSTANCE_ID_EVENT", paramIntent, paramInt2);
}
public static zzg zzabU()
{
try
{
if (c == null) {
c = new zzg();
}
zzg localzzg = c;
return localzzg;
}
finally {}
}
public static PendingIntent zzb(Context paramContext, int paramInt1, Intent paramIntent, int paramInt2)
{
return a(paramContext, paramInt1, "com.google.firebase.MESSAGING_EVENT", paramIntent, paramInt2);
}
public Intent zzabV()
{
return (Intent)this.a.poll();
}
public Intent zzabW()
{
return (Intent)this.b.poll();
}
public int zzb(Context paramContext, String paramString, Intent paramIntent)
{
int i = -1;
switch (paramString.hashCode())
{
default:
switch (i)
{
default:
paramContext = String.valueOf(paramString);
if (paramContext.length() == 0) {}
break;
}
break;
}
for (paramContext = "Unknown service action: ".concat(paramContext);; paramContext = new String("Unknown service action: "))
{
Log.w("FirebaseInstanceId", paramContext);
return 500;
if (!paramString.equals("com.google.firebase.INSTANCE_ID_EVENT")) {
break;
}
i = 0;
break;
if (!paramString.equals("com.google.firebase.MESSAGING_EVENT")) {
break;
}
i = 1;
break;
this.a.offer(paramIntent);
for (;;)
{
paramString = new Intent(paramString);
paramString.setPackage(paramContext.getPackageName());
return a(paramContext, paramString);
this.b.offer(paramIntent);
}
}
}
public void zzf(Context paramContext, Intent paramIntent)
{
zzb(paramContext, "com.google.firebase.INSTANCE_ID_EVENT", paramIntent);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/firebase/iid/zzg.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/