|
|
@ -267,7 +267,7 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
|
|
|
AppConfig curAppConfig = retrieveAndSaveAppConfig();
|
|
|
|
AppConfig curAppConfig = retrieveAndSaveAppConfig();
|
|
|
|
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(appConfig.cmdid) || TextUtils.isEmpty(appConfig.server) || appConfig.port == 0) {
|
|
|
|
if (TextUtils.isEmpty(curAppConfig.cmdid) || TextUtils.isEmpty(curAppConfig.server) || curAppConfig.port == 0) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Intent intent = new Intent(MainActivity.this, MicroPhotoService.class);
|
|
|
|
Intent intent = new Intent(MainActivity.this, MicroPhotoService.class);
|
|
|
@ -576,15 +576,19 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
dataPath.mkdirs();
|
|
|
|
dataPath.mkdirs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inputStreamReader = new InputStreamReader(new FileInputStream(new File(appPath + "App.json")), "UTF-8");
|
|
|
|
|
|
|
|
bufferedReader = new BufferedReader(inputStreamReader);
|
|
|
|
|
|
|
|
String line;
|
|
|
|
|
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
while ((line = bufferedReader.readLine()) != null) {
|
|
|
|
File file = new File(dataPath, "App.json");
|
|
|
|
stringBuilder.append(line);
|
|
|
|
if (file.exists()) {
|
|
|
|
|
|
|
|
inputStreamReader = new InputStreamReader(new FileInputStream(file), "UTF-8");
|
|
|
|
|
|
|
|
bufferedReader = new BufferedReader(inputStreamReader);
|
|
|
|
|
|
|
|
String line;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ((line = bufferedReader.readLine()) != null) {
|
|
|
|
|
|
|
|
stringBuilder.append(line);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(stringBuilder.toString());
|
|
|
|
JSONObject jsonObject =stringBuilder.length() > 0 ? (new JSONObject(stringBuilder.toString())) : (new JSONObject());
|
|
|
|
|
|
|
|
|
|
|
|
jsonObject.put("CMDID", cmdid);
|
|
|
|
jsonObject.put("CMDID", cmdid);
|
|
|
|
jsonObject.put("Server", server);
|
|
|
|
jsonObject.put("Server", server);
|
|
|
|