|
21 | 21 |
|
22 | 22 | import android.content.Context; |
23 | 23 | import android.content.res.AssetManager; |
24 | | -import net.sqlcipher.database.SQLiteDatabase; |
25 | 24 | import android.net.Uri; |
26 | 25 | import android.text.TextUtils; |
27 | 26 | import android.util.Pair; |
|
39 | 38 | import com.google.gson.GsonBuilder; |
40 | 39 | import com.google.gson.reflect.TypeToken; |
41 | 40 |
|
| 41 | +import net.sqlcipher.database.SQLiteDatabase; |
| 42 | + |
42 | 43 | import java.io.BufferedReader; |
43 | 44 | import java.io.File; |
44 | 45 | import java.io.IOException; |
@@ -155,7 +156,7 @@ public void handle(Socket socket) throws IOException { |
155 | 156 | } |
156 | 157 | } |
157 | 158 |
|
158 | | - public void setCustomDatabaseFiles(HashMap<String, Pair<File, String>> customDatabaseFiles){ |
| 159 | + public void setCustomDatabaseFiles(HashMap<String, Pair<File, String>> customDatabaseFiles) { |
159 | 160 | mCustomDatabaseFiles = customDatabaseFiles; |
160 | 161 | } |
161 | 162 |
|
@@ -185,17 +186,17 @@ private void closeDatabase() { |
185 | 186 |
|
186 | 187 | private String getDBListResponse() { |
187 | 188 | mDatabaseFiles = DatabaseFileProvider.getDatabaseFiles(mContext); |
188 | | - if(mCustomDatabaseFiles!=null){ |
| 189 | + if (mCustomDatabaseFiles != null) { |
189 | 190 | mDatabaseFiles.putAll(mCustomDatabaseFiles); |
190 | 191 | } |
191 | 192 | Response response = new Response(); |
192 | 193 | if (mDatabaseFiles != null) { |
193 | 194 | for (HashMap.Entry<String, Pair<File, String>> entry : mDatabaseFiles.entrySet()) { |
194 | | - String[] dbEntry = { entry.getKey(), entry.getValue().second != "" ? "true" : "false" }; |
| 195 | + String[] dbEntry = {entry.getKey(), !entry.getValue().second.equals("") ? "true" : "false"}; |
195 | 196 | response.rows.add(dbEntry); |
196 | 197 | } |
197 | 198 | } |
198 | | - response.rows.add(new String[] { Constants.APP_SHARED_PREFERENCES, "false" }); |
| 199 | + response.rows.add(new String[]{Constants.APP_SHARED_PREFERENCES, "false"}); |
199 | 200 | response.isSuccessful = true; |
200 | 201 | return mGson.toJson(response); |
201 | 202 | } |
@@ -238,7 +239,7 @@ private String executeQueryAndGetResponse(String route) { |
238 | 239 | if (query != null) { |
239 | 240 | String[] statements = query.split(";"); |
240 | 241 |
|
241 | | - for (int i=0; i<statements.length; i++) { |
| 242 | + for (int i = 0; i < statements.length; i++) { |
242 | 243 |
|
243 | 244 | String aQuery = statements[i].trim(); |
244 | 245 | first = aQuery.split(" ")[0].toLowerCase(); |
|
0 commit comments