BodyObservable$BodyObserver.smali
5.3 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
213
.class Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;
.super Ljava/lang/Object;
.source "BodyObservable.java"
# interfaces
.implements Lio/reactivex/Observer;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lretrofit2/adapter/rxjava2/BodyObservable;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0xa
name = "BodyObserver"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<R:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;",
"Lio/reactivex/Observer<",
"Lretrofit2/Response<",
"TR;>;>;"
}
.end annotation
# instance fields
.field private final observer:Lio/reactivex/Observer;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lio/reactivex/Observer<",
"-TR;>;"
}
.end annotation
.end field
.field private terminated:Z
# direct methods
.method constructor <init>(Lio/reactivex/Observer;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lio/reactivex/Observer<",
"-TR;>;)V"
}
.end annotation
.line 41
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 42
iput-object p1, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->observer:Lio/reactivex/Observer;
return-void
.end method
# virtual methods
.method public onComplete()V
.locals 1
.line 65
iget-boolean v0, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->terminated:Z
if-nez v0, :cond_0
.line 66
iget-object v0, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->observer:Lio/reactivex/Observer;
invoke-interface {v0}, Lio/reactivex/Observer;->onComplete()V
:cond_0
return-void
.end method
.method public onError(Ljava/lang/Throwable;)V
.locals 2
.line 71
iget-boolean v0, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->terminated:Z
if-nez v0, :cond_0
.line 72
iget-object v0, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->observer:Lio/reactivex/Observer;
invoke-interface {v0, p1}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
goto :goto_0
.line 75
:cond_0
new-instance v0, Ljava/lang/AssertionError;
const-string v1, "This should never happen! Report as a bug with the full stacktrace."
invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
.line 78
invoke-virtual {v0, p1}, Ljava/lang/Throwable;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
.line 79
invoke-static {v0}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
:goto_0
return-void
.end method
.method public bridge synthetic onNext(Ljava/lang/Object;)V
.locals 0
.line 37
check-cast p1, Lretrofit2/Response;
invoke-virtual {p0, p1}, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->onNext(Lretrofit2/Response;)V
return-void
.end method
.method public onNext(Lretrofit2/Response;)V
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lretrofit2/Response<",
"TR;>;)V"
}
.end annotation
.line 50
invoke-virtual {p1}, Lretrofit2/Response;->isSuccessful()Z
move-result v0
if-eqz v0, :cond_0
.line 51
iget-object v0, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->observer:Lio/reactivex/Observer;
invoke-virtual {p1}, Lretrofit2/Response;->body()Ljava/lang/Object;
move-result-object p1
invoke-interface {v0, p1}, Lio/reactivex/Observer;->onNext(Ljava/lang/Object;)V
goto :goto_0
:cond_0
const/4 v0, 0x1
.line 53
iput-boolean v0, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->terminated:Z
.line 54
new-instance v1, Lretrofit2/adapter/rxjava2/HttpException;
invoke-direct {v1, p1}, Lretrofit2/adapter/rxjava2/HttpException;-><init>(Lretrofit2/Response;)V
.line 56
:try_start_0
iget-object p1, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->observer:Lio/reactivex/Observer;
invoke-interface {p1, v1}, Lio/reactivex/Observer;->onError(Ljava/lang/Throwable;)V
:try_end_0
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception p1
.line 58
invoke-static {p1}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V
.line 59
new-instance v2, Lio/reactivex/exceptions/CompositeException;
const/4 v3, 0x2
new-array v3, v3, [Ljava/lang/Throwable;
const/4 v4, 0x0
aput-object v1, v3, v4
aput-object p1, v3, v0
invoke-direct {v2, v3}, Lio/reactivex/exceptions/CompositeException;-><init>([Ljava/lang/Throwable;)V
invoke-static {v2}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
:goto_0
return-void
.end method
.method public onSubscribe(Lio/reactivex/disposables/Disposable;)V
.locals 1
.line 46
iget-object v0, p0, Lretrofit2/adapter/rxjava2/BodyObservable$BodyObserver;->observer:Lio/reactivex/Observer;
invoke-interface {v0, p1}, Lio/reactivex/Observer;->onSubscribe(Lio/reactivex/disposables/Disposable;)V
return-void
.end method