|
|
|
@ -8,6 +8,7 @@ import android.net.NetworkInfo;
|
|
|
|
|
import android.os.Environment;
|
|
|
|
|
import android.os.PowerManager;
|
|
|
|
|
import android.os.SystemClock;
|
|
|
|
|
import android.telephony.TelephonyManager;
|
|
|
|
|
import android.text.TextUtils;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
import android.util.Pair;
|
|
|
|
@ -111,6 +112,10 @@ public class AppMaster {
|
|
|
|
|
return (System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000) / 1000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void selectSimCard(int number) {
|
|
|
|
|
TelephonyManager telephonyManager = (TelephonyManager)mService.getSystemService(Context.TELEPHONY_SERVICE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void start() {
|
|
|
|
|
|
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
@ -420,7 +425,8 @@ public class AppMaster {
|
|
|
|
|
SysApi.reboot(mService.getApplicationContext());
|
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_UPLOAD_LOGS)) {
|
|
|
|
|
String url = jsonObject.optString("url", null);
|
|
|
|
|
uploadLogs(url);
|
|
|
|
|
int noSpecData = jsonObject.optInt("noSpecData", 0);
|
|
|
|
|
uploadLogs(url, noSpecData == 0);
|
|
|
|
|
uploadMasterLogs(url);
|
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_SET_CMA)) {
|
|
|
|
|
String ip = jsonObject.optString("value_str", null);
|
|
|
|
@ -725,7 +731,7 @@ public class AppMaster {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void uploadLogs(String url) {
|
|
|
|
|
private void uploadLogs(String url, final boolean includingSpecData) {
|
|
|
|
|
String appDir = mService.buildAppDir();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
@ -746,7 +752,19 @@ public class AppMaster {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ZipUtils.ZipFolder(logDir, file);
|
|
|
|
|
ZipUtils.Filter filter = new ZipUtils.Filter() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean match(String fileName) {
|
|
|
|
|
if (!fileName.endsWith(".txt")) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!includingSpecData && fileName.startsWith("specdata")) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
ZipUtils.ZipFolder(logDir, file, filter);
|
|
|
|
|
|
|
|
|
|
if (!file.exists()) {
|
|
|
|
|
return;
|
|
|
|
@ -785,7 +803,13 @@ public class AppMaster {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ZipUtils.ZipFolder(logDir, file);
|
|
|
|
|
ZipUtils.Filter filter = new ZipUtils.Filter() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean match(String fileName) {
|
|
|
|
|
return fileName.endsWith(".txt");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
ZipUtils.ZipFolder(logDir, file, filter);
|
|
|
|
|
|
|
|
|
|
if (!file.exists()) {
|
|
|
|
|
return;
|
|
|
|
@ -817,7 +841,7 @@ public class AppMaster {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ZipUtils.ZipFolder(pathFile, file);
|
|
|
|
|
ZipUtils.ZipFolder(pathFile, file, null);
|
|
|
|
|
|
|
|
|
|
if (!file.exists()) {
|
|
|
|
|
return;
|
|
|
|
|