PushEventsTransmitter.java
3.76 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
package com.arellomobile.android.push;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import com.arellomobile.android.push.utils.GeneralUtils;
import java.io.PrintStream;
import java.lang.reflect.Method;
public class PushEventsTransmitter
{
static void a(Context paramContext, String paramString)
{
if (a(paramContext))
{
a(paramContext, paramString, "REGISTER_EVENT");
return;
}
a(paramContext, paramString, "REGISTER_EVENT", null);
}
static void a(Context paramContext, String paramString, Bundle paramBundle)
{
a(paramContext, paramString, "PUSH_RECEIVE_EVENT", paramBundle);
}
private static void a(Context paramContext, String paramString1, String paramString2)
{
String str = paramContext.getPackageName();
Intent localIntent = new Intent(str + ".com.arellomobile.android.push.REGISTER_BROAD_CAST_ACTION");
localIntent.putExtra(paramString2, paramString1);
localIntent.setPackage(str);
if (GeneralUtils.checkStickyBroadcastPermissions(paramContext))
{
paramContext.sendStickyBroadcast(localIntent);
return;
}
Log.w(PushEventsTransmitter.class.getSimpleName(), "No android.permission.BROADCAST_STICKY. Reverting to simple broadcast");
paramContext.sendBroadcast(localIntent);
}
private static void a(Context paramContext, String paramString1, String paramString2, Bundle paramBundle)
{
Intent localIntent = new Intent(paramContext, MessageActivity.class);
if (paramBundle != null) {
localIntent.putExtras(paramBundle);
}
localIntent.putExtra(paramString2, paramString1);
localIntent.setFlags(268435456);
try
{
paramString1 = Class.forName("com.arellomobile.android.push.PushwooshProxy");
if (paramString1 != null)
{
paramString2 = paramString1.getMethod("getInstanceOrNull", new Class[0]).invoke(null, null);
if (paramString2 != null) {
paramString1.getMethod("checkMessage", new Class[] { Intent.class }).invoke(paramString2, new Object[] { localIntent });
}
}
}
catch (Exception paramString1)
{
for (;;) {}
}
paramContext.startActivity(localIntent);
}
private static boolean a(Context paramContext)
{
try
{
paramContext = paramContext.getPackageManager().getApplicationInfo(paramContext.getApplicationContext().getPackageName(), 128);
if (paramContext.metaData != null)
{
boolean bool = paramContext.metaData.getBoolean("PW_BROADCAST_REGISTRATION", true);
System.out.println("Using broadcast registration: " + bool);
return bool;
}
return true;
}
catch (Exception paramContext)
{
paramContext.printStackTrace();
}
return true;
}
static void b(Context paramContext, String paramString)
{
if (a(paramContext))
{
a(paramContext, paramString, "REGISTER_ERROR_EVENT");
return;
}
a(paramContext, paramString, "REGISTER_ERROR_EVENT", null);
}
static void c(Context paramContext, String paramString)
{
if (a(paramContext))
{
a(paramContext, paramString, "UNREGISTER_EVENT");
return;
}
a(paramContext, paramString, "UNREGISTER_EVENT", null);
}
static void d(Context paramContext, String paramString)
{
if (a(paramContext))
{
a(paramContext, paramString, "UNREGISTER_ERROR_EVENT");
return;
}
a(paramContext, paramString, "UNREGISTER_ERROR_EVENT", null);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/arellomobile/android/push/PushEventsTransmitter.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/