e.java
3.09 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
package com.instabug.library.e.a;
import android.content.Context;
import com.instabug.library.e.c;
import com.instabug.library.e.c.a;
import com.instabug.library.e.c.b;
import com.instabug.library.e.c.d;
import com.instabug.library.e.d;
import com.instabug.library.internal.a.b;
import com.instabug.library.util.InstabugSDKLogger;
import java.io.IOException;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
public class e
{
private static e a;
private com.instabug.library.e.a b = new com.instabug.library.e.a();
public static e a()
{
if (a == null) {
a = new e();
}
return a;
}
public void a(Context paramContext, String paramString, int paramInt, JSONArray paramJSONArray, final c.a<d, Throwable> parama)
throws JSONException, IOException
{
InstabugSDKLogger.d(this, "Syncing messages with server");
c localc = this.b.a(paramContext, c.b.g, c.d.b);
localc.a("device_token", new com.instabug.library.internal.module.a().a(paramContext).l());
localc.a("last_email_created_at", paramString);
localc.a("emails_count", Integer.valueOf(paramInt));
if ((paramJSONArray != null) && (paramJSONArray.length() != 0)) {
localc.a("read_emails", paramJSONArray);
}
this.b.a(localc).subscribeOn(Schedulers.io()).subscribe(new Subscriber()
{
public final void onCompleted()
{
InstabugSDKLogger.d(this, "syncMessages request completed");
}
public final void onError(Throwable paramAnonymousThrowable)
{
InstabugSDKLogger.d(this, "syncMessages request got error: " + paramAnonymousThrowable.getMessage());
parama.a(paramAnonymousThrowable);
}
public final void onStart()
{
InstabugSDKLogger.d(this, "syncMessages request started");
}
});
}
public void a(final Context paramContext, String paramString1, String paramString2, final c.a<Boolean, Throwable> parama)
throws JSONException, IOException
{
InstabugSDKLogger.d(this, "Sending message");
c localc = this.b.a(paramContext, c.b.f, c.d.b);
localc.a(localc.a().replaceAll(":issue_number", paramString2));
localc.a("device_token", new com.instabug.library.internal.module.a().a(paramContext).l());
localc.a("email", new JSONObject().put("body", paramString1));
this.b.a(localc).subscribe(new Subscriber()
{
public final void onCompleted()
{
InstabugSDKLogger.d(this, "sendMessage request completed");
}
public final void onError(Throwable paramAnonymousThrowable)
{
InstabugSDKLogger.d(this, "sendMessage request got error: " + paramAnonymousThrowable.getMessage());
parama.a(paramAnonymousThrowable);
}
public final void onStart()
{
InstabugSDKLogger.d(this, "sendMessage request started");
}
});
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/e/a/e.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/