b.java
2.58 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
package com.instabug.library.migration;
import android.content.Context;
import com.instabug.library.u;
import com.instabug.library.util.InstabugSDKLogger;
import java.util.ArrayList;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
public final class b
{
private static final AbstractMigration[] a = { new a() };
public static void a(Context paramContext)
{
ArrayList localArrayList = new ArrayList();
AbstractMigration[] arrayOfAbstractMigration = a;
int j = arrayOfAbstractMigration.length;
int i = 0;
if (i < j)
{
AbstractMigration localAbstractMigration = arrayOfAbstractMigration[i];
localAbstractMigration.initialize(paramContext);
if ((localAbstractMigration.shouldMigrate()) && (localAbstractMigration.getMigrationVersion() > u.a().u()) && (localAbstractMigration.getMigrationVersion() <= 1)) {}
for (boolean bool = true;; bool = false)
{
InstabugSDKLogger.d(b.class, "Checking if should apply this migration: " + localAbstractMigration + ", result is " + bool + " last migration version is " + u.a().u() + " target migration version 1");
if (bool) {
localArrayList.add(localAbstractMigration.migrate());
}
i += 1;
break;
}
}
paramContext = a(localArrayList);
if (paramContext.length != 0)
{
Observable.merge(paramContext).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(new Subscriber()
{
public final void onCompleted()
{
InstabugSDKLogger.d(b.class, "All Migrations completed, setting lastMigrationVersion to 1");
u.a().a(1);
}
public final void onError(Throwable paramAnonymousThrowable)
{
InstabugSDKLogger.d(b.class, "Migration failed" + paramAnonymousThrowable.getMessage());
}
public final void onStart()
{
super.onStart();
}
});
return;
}
InstabugSDKLogger.d(b.class, "No migrations to run");
}
private static Observable[] a(ArrayList<Observable<String>> paramArrayList)
{
Observable[] arrayOfObservable = new Observable[paramArrayList.size()];
int i = 0;
while (i < paramArrayList.size())
{
arrayOfObservable[i] = ((Observable)paramArrayList.get(i));
i += 1;
}
return arrayOfObservable;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/migration/b.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/