b.java
5.04 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
package com.instabug.library.internal.d.a;
import android.content.Context;
import android.os.Environment;
import com.instabug.library.e.c.a;
import com.instabug.library.model.a.a;
import com.instabug.library.util.InstabugSDKLogger;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import rx.Subscription;
public class b
{
public static LinkedHashMap<String, a> a = new LinkedHashMap();
public static a a()
{
if (!e.a().b("assets_memory_cache"))
{
InstabugSDKLogger.d(h.class, "In-memory assets cache not found, create it");
e.a().a(new a("assets_memory_cache"));
InstabugSDKLogger.d(h.class, "In-memory assets created successfully");
}
InstabugSDKLogger.d(h.class, "In-memory assets cache found");
return (a)e.a().a("assets_memory_cache");
}
public static com.instabug.library.model.a a(Context paramContext, String paramString, a.a parama)
{
paramContext = new File(c(paramContext), String.valueOf(paramString.hashCode()));
return new com.instabug.library.model.a(String.valueOf(paramString.hashCode()), parama, paramString, paramContext);
}
public static void a(Context paramContext)
{
paramContext = c(paramContext).listFiles();
if (paramContext == null) {}
for (;;)
{
return;
int j = paramContext.length;
int i = 0;
while (i < j)
{
paramContext[i].delete();
i += 1;
}
}
}
public static void a(Context paramContext, com.instabug.library.model.a parama, b paramb)
{
Object localObject = (com.instabug.library.model.a)a().d(parama.a());
if (localObject != null)
{
InstabugSDKLogger.d(b.class, "Get file from cache");
paramb.a((com.instabug.library.model.a)localObject);
return;
}
localObject = parama.a();
if (a.get(localObject) != null) {}
for (int i = 1; i != 0; i = 0)
{
InstabugSDKLogger.d(b.class, "File currently downloading, wait download to finish");
paramContext = ((a)a.get(parama.a())).c();
paramContext.add(paramb);
((a)a.get(parama.a())).a(paramContext);
return;
}
InstabugSDKLogger.d(b.class, "File not exist download it");
localObject = new a();
((a)localObject).a(parama);
List localList = ((a)localObject).c();
localList.add(paramb);
((a)localObject).a(localList);
((a)localObject).a(com.instabug.library.e.a.b.a().a(paramContext, parama, new c.a() {}));
a.put(((a)localObject).a().a(), localObject);
}
public static void a(com.instabug.library.model.a parama)
{
a().a(parama.a(), parama);
}
public static void b()
{
Iterator localIterator = a.entrySet().iterator();
while (localIterator.hasNext()) {
((a)((Map.Entry)localIterator.next()).getValue()).b().unsubscribe();
}
}
public static void b(Context paramContext)
{
if (e.a().b("assets_memory_cache")) {
e.a().a("assets_memory_cache").a();
}
a(paramContext);
}
private static File c(Context paramContext)
{
if ((Environment.getExternalStorageState().equals("mounted")) && (paramContext.getExternalCacheDir() != null)) {
InstabugSDKLogger.d(b.class, "Media Mounted");
}
for (paramContext = paramContext.getExternalCacheDir().getPath();; paramContext = paramContext.getCacheDir().getAbsolutePath())
{
paramContext = new File(paramContext + "/instabug/assetCache");
File localFile;
if (!paramContext.exists())
{
boolean bool = paramContext.mkdirs();
InstabugSDKLogger.d(b.class, "Is created: " + bool);
localFile = new File(paramContext, ".nomedia");
}
try
{
localFile.createNewFile();
return paramContext;
}
catch (IOException localIOException)
{
localIOException.printStackTrace();
}
InstabugSDKLogger.d(b.class, "External storage not available, saving file to internal storage.");
}
return paramContext;
}
public static class a
{
com.instabug.library.model.a a;
Subscription b;
List<b.b> c = new ArrayList();
public a a(com.instabug.library.model.a parama)
{
this.a = parama;
return this;
}
public a a(List<b.b> paramList)
{
this.c = paramList;
return this;
}
public a a(Subscription paramSubscription)
{
this.b = paramSubscription;
return this;
}
public com.instabug.library.model.a a()
{
return this.a;
}
public Subscription b()
{
return this.b;
}
public List<b.b> c()
{
return this.c;
}
}
public static abstract interface b
{
public abstract void a(com.instabug.library.model.a parama);
public abstract void a(Throwable paramThrowable);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/internal/d/a/b.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/