|
|
@ -6,6 +6,8 @@ import android.content.Intent;
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Environment;
|
|
|
|
import android.os.Environment;
|
|
|
|
|
|
|
|
import android.provider.MediaStore;
|
|
|
|
|
|
|
|
import android.util.Base64;
|
|
|
|
|
|
|
|
|
|
|
|
import com.xypower.common.FilesUtils;
|
|
|
|
import com.xypower.common.FilesUtils;
|
|
|
|
import com.xypower.common.JSONUtils;
|
|
|
|
import com.xypower.common.JSONUtils;
|
|
|
@ -15,7 +17,6 @@ import org.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Base64;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
@ -388,26 +389,20 @@ public class UpdateSysConfigUtil {
|
|
|
|
//拍照时间表修改
|
|
|
|
//拍照时间表修改
|
|
|
|
public static void setPhotoSchedules(int channel, String msg) {
|
|
|
|
public static void setPhotoSchedules(int channel, String msg) {
|
|
|
|
if (StringUtils.isNotEmpty(msg)) {
|
|
|
|
if (StringUtils.isNotEmpty(msg)) {
|
|
|
|
byte[] decode = new byte[0];
|
|
|
|
byte[] decode = Base64.decode(msg, Base64.DEFAULT);
|
|
|
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
|
|
|
|
|
|
|
decode = Base64.getDecoder().decode(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (decode != null && decode.length > 0) {
|
|
|
|
if (decode != null && decode.length > 0) {
|
|
|
|
String path = getScheduleDir(channel);
|
|
|
|
String path = getScheduleDir(channel);
|
|
|
|
JSONUtils.saveByte(path, decode);
|
|
|
|
FilesUtils.writeFile(path, decode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取拍照时间表
|
|
|
|
//获取拍照时间表
|
|
|
|
public static String getPhotoSchedules(int channel) {
|
|
|
|
public static String getPhotoSchedules(int channel) {
|
|
|
|
String msg = "";
|
|
|
|
String msg = "";
|
|
|
|
String path = getScheduleDir(channel);
|
|
|
|
String path = getScheduleDir(channel);
|
|
|
|
byte[] bytes = JSONUtils.loadByte(path);
|
|
|
|
byte[] bytes = FilesUtils.readAllBytes(path);
|
|
|
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
|
|
|
msg = Base64.encodeToString(bytes, Base64.DEFAULT);
|
|
|
|
msg = Base64.getEncoder().encodeToString(bytes);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return msg;
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|