if$a.java
7.67 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Build.VERSION;
import com.google.android.gms.internal.zzsv;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
final class if$a
extends SQLiteOpenHelper
{
if$a(if paramif, Context paramContext, String paramString)
{
super(paramContext, paramString, null, 1);
}
private static void a(SQLiteDatabase paramSQLiteDatabase)
{
int i = 0;
paramSQLiteDatabase = b(paramSQLiteDatabase, "properties");
while (i < 6)
{
String str = new String[] { "app_uid", "cid", "tid", "params", "adid", "hits_count" }[i];
if (!paramSQLiteDatabase.remove(str))
{
paramSQLiteDatabase = String.valueOf(str);
if (paramSQLiteDatabase.length() != 0) {}
for (paramSQLiteDatabase = "Database properties is missing required column: ".concat(paramSQLiteDatabase);; paramSQLiteDatabase = new String("Database properties is missing required column: ")) {
throw new SQLiteException(paramSQLiteDatabase);
}
}
i += 1;
}
if (!paramSQLiteDatabase.isEmpty()) {
throw new SQLiteException("Database properties table has extra columns");
}
}
/* Error */
private boolean a(SQLiteDatabase paramSQLiteDatabase, String paramString)
{
// Byte code:
// 0: aconst_null
// 1: astore 4
// 3: aload_1
// 4: ldc 72
// 6: iconst_1
// 7: anewarray 25 java/lang/String
// 10: dup
// 11: iconst_0
// 12: ldc 74
// 14: aastore
// 15: ldc 76
// 17: iconst_1
// 18: anewarray 25 java/lang/String
// 21: dup
// 22: iconst_0
// 23: aload_2
// 24: aastore
// 25: aconst_null
// 26: aconst_null
// 27: aconst_null
// 28: invokevirtual 82 android/database/sqlite/SQLiteDatabase:query (Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
// 31: astore_1
// 32: aload_1
// 33: astore 4
// 35: aload 4
// 37: astore_1
// 38: aload 4
// 40: invokeinterface 87 1 0
// 45: istore_3
// 46: aload 4
// 48: ifnull +10 -> 58
// 51: aload 4
// 53: invokeinterface 91 1 0
// 58: iload_3
// 59: ireturn
// 60: astore 5
// 62: aconst_null
// 63: astore 4
// 65: aload 4
// 67: astore_1
// 68: aload_0
// 69: getfield 12 if$a:a Lif;
// 72: ldc 93
// 74: aload_2
// 75: aload 5
// 77: invokevirtual 97 if:zzc (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
// 80: aload 4
// 82: ifnull +10 -> 92
// 85: aload 4
// 87: invokeinterface 91 1 0
// 92: iconst_0
// 93: ireturn
// 94: astore_1
// 95: aload 4
// 97: astore_2
// 98: aload_2
// 99: ifnull +9 -> 108
// 102: aload_2
// 103: invokeinterface 91 1 0
// 108: aload_1
// 109: athrow
// 110: astore 4
// 112: aload_1
// 113: astore_2
// 114: aload 4
// 116: astore_1
// 117: goto -19 -> 98
// 120: astore 5
// 122: goto -57 -> 65
// Local variable table:
// start length slot name signature
// 0 125 0 this a
// 0 125 1 paramSQLiteDatabase SQLiteDatabase
// 0 125 2 paramString String
// 45 14 3 bool boolean
// 1 95 4 localSQLiteDatabase SQLiteDatabase
// 110 5 4 localObject Object
// 60 16 5 localSQLiteException1 SQLiteException
// 120 1 5 localSQLiteException2 SQLiteException
// Exception table:
// from to target type
// 3 32 60 android/database/sqlite/SQLiteException
// 3 32 94 finally
// 38 46 110 finally
// 68 80 110 finally
// 38 46 120 android/database/sqlite/SQLiteException
}
private static Set<String> b(SQLiteDatabase paramSQLiteDatabase, String paramString)
{
HashSet localHashSet = new HashSet();
paramSQLiteDatabase = paramSQLiteDatabase.rawQuery(String.valueOf(paramString).length() + 22 + "SELECT * FROM " + paramString + " LIMIT 0", null);
try
{
paramString = paramSQLiteDatabase.getColumnNames();
int i = 0;
while (i < paramString.length)
{
localHashSet.add(paramString[i]);
i += 1;
}
return localHashSet;
}
finally
{
paramSQLiteDatabase.close();
}
}
public final SQLiteDatabase getWritableDatabase()
{
if (!if.a(this.a).a(3600000L)) {
throw new SQLiteException("Database open failed");
}
try
{
SQLiteDatabase localSQLiteDatabase = super.getWritableDatabase();
return localSQLiteDatabase;
}
catch (SQLiteException localSQLiteException1)
{
if.a(this.a).a();
this.a.zzbT("Opening the database failed, dropping the table and recreating it");
Object localObject = if.b(this.a);
this.a.getContext().getDatabasePath((String)localObject).delete();
try
{
localObject = super.getWritableDatabase();
if.a(this.a).a = 0L;
return (SQLiteDatabase)localObject;
}
catch (SQLiteException localSQLiteException2)
{
this.a.zze("Failed to open freshly created database", localSQLiteException2);
throw localSQLiteException2;
}
}
}
public final void onCreate(SQLiteDatabase paramSQLiteDatabase)
{
zzsv.zzca(paramSQLiteDatabase.getPath());
}
public final void onOpen(SQLiteDatabase paramSQLiteDatabase)
{
int j = 1;
Object localObject;
if (Build.VERSION.SDK_INT < 15) {
localObject = paramSQLiteDatabase.rawQuery("PRAGMA journal_mode=memory", null);
}
for (;;)
{
try
{
((Cursor)localObject).moveToFirst();
((Cursor)localObject).close();
if (!a(paramSQLiteDatabase, "hits2"))
{
paramSQLiteDatabase.execSQL(if.j());
if (a(paramSQLiteDatabase, "properties")) {
break;
}
paramSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS properties ( app_uid INTEGER NOT NULL, cid TEXT NOT NULL, tid TEXT NOT NULL, params TEXT NOT NULL, adid INTEGER NOT NULL, hits_count INTEGER NOT NULL, PRIMARY KEY (app_uid, cid, tid)) ;");
return;
}
}
finally
{
((Cursor)localObject).close();
}
localObject = b(paramSQLiteDatabase, "hits2");
int i = 0;
while (i < 4)
{
String str = new String[] { "hit_id", "hit_string", "hit_time", "hit_url" }[i];
if (!((Set)localObject).remove(str))
{
paramSQLiteDatabase = String.valueOf(str);
if (paramSQLiteDatabase.length() != 0) {}
for (paramSQLiteDatabase = "Database hits2 is missing required column: ".concat(paramSQLiteDatabase);; paramSQLiteDatabase = new String("Database hits2 is missing required column: ")) {
throw new SQLiteException(paramSQLiteDatabase);
}
}
i += 1;
}
if (!((Set)localObject).remove("hit_app_id")) {}
for (i = j; !((Set)localObject).isEmpty(); i = 0) {
throw new SQLiteException("Database hits2 has extra columns");
}
if (i != 0) {
paramSQLiteDatabase.execSQL("ALTER TABLE hits2 ADD COLUMN hit_app_id INTEGER");
}
}
a(paramSQLiteDatabase);
}
public final void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2) {}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/if$a.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/