参数通过base64编码传递

TempBranch
Matthew 9 months ago
parent 116af6163d
commit 0cd8952824

@ -230,6 +230,23 @@ public class BridgeProvider extends ContentProvider {
return res ? 1 : 0;
}
private String stringFromBase64(String decoded) {
if (TextUtils.isEmpty(decoded)) {
return null;
}
byte[] bytes = Base64.decode(decoded, Base64.DEFAULT);
String str = null;
try {
str = new String(bytes, "UTF-8");
} catch (Exception ex) {
ex.printStackTrace();
}
return str;
}
private int takePhoto(Uri uri, ContentValues values) {
String path = values.containsKey("path") ? values.getAsString("path") : null;
int channel = values.containsKey("channel") ? values.getAsInteger("channel").intValue() : 1;
@ -238,10 +255,10 @@ public class BridgeProvider extends ContentProvider {
int width = values.containsKey("width") ? values.getAsInteger("width").intValue() : 0;
int height = values.containsKey("height") ? values.getAsInteger("height").intValue() : 0;
String leftTopOsd = values.containsKey("leftTopOsd") ? values.getAsString("leftTopOsd") : null;
String rightTopOsd = values.containsKey("rightTopOsd") ? values.getAsString("rightTopOsd") : null;
String rightBottomOsd = values.containsKey("rightBottomOsd") ? values.getAsString("rightBottomOsd") : null;
String leftBottomOsd = values.containsKey("leftBottomOsd") ? values.getAsString("leftBottomOsd") : null;
String leftTopOsd = stringFromBase64(values.containsKey("leftTopOsd") ? values.getAsString("leftTopOsd") : null);
String rightTopOsd = stringFromBase64(values.containsKey("rightTopOsd") ? values.getAsString("rightTopOsd") : null);
String rightBottomOsd = stringFromBase64(values.containsKey("rightBottomOsd") ? values.getAsString("rightBottomOsd") : null);
String leftBottomOsd = stringFromBase64(values.containsKey("leftBottomOsd") ? values.getAsString("leftBottomOsd") : null);
String appPath = MicroPhotoContext.buildMpAppDir(getContext());
File configFile = new File(appPath);
@ -315,10 +332,10 @@ public class BridgeProvider extends ContentProvider {
long videoId = System.currentTimeMillis() / 1000;
String leftTopOsd = values.containsKey("leftTopOsd") ? values.getAsString("leftTopOsd") : null;
String rightTopOsd = values.containsKey("rightTopOsd") ? values.getAsString("rightTopOsd") : null;
String rightBottomOsd = values.containsKey("rightBottomOsd") ? values.getAsString("rightBottomOsd") : null;
String leftBottomOsd = values.containsKey("leftBottomOsd") ? values.getAsString("leftBottomOsd") : null;
String leftTopOsd = stringFromBase64(values.containsKey("leftTopOsd") ? values.getAsString("leftTopOsd") : null);
String rightTopOsd = stringFromBase64(values.containsKey("rightTopOsd") ? values.getAsString("rightTopOsd") : null);
String rightBottomOsd = stringFromBase64(values.containsKey("rightBottomOsd") ? values.getAsString("rightBottomOsd") : null);
String leftBottomOsd = stringFromBase64(values.containsKey("leftBottomOsd") ? values.getAsString("leftBottomOsd") : null);
if (cameraId == -1) {
cameraId = channel - 1;

Loading…
Cancel
Save