mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
CB-6388: Handle binary data correctly in LOAD_URL bridge
This commit is contained in:
parent
0add4af208
commit
b872df0f31
@ -494,9 +494,22 @@ public class NativeToJsMessageQueue {
|
||||
.append(success)
|
||||
.append(",")
|
||||
.append(status)
|
||||
.append(",[")
|
||||
.append(pluginResult.getMessage())
|
||||
.append("],")
|
||||
.append(",[");
|
||||
switch (pluginResult.getMessageType()) {
|
||||
case PluginResult.MESSAGE_TYPE_BINARYSTRING:
|
||||
sb.append("atob('")
|
||||
.append(pluginResult.getMessage())
|
||||
.append("')");
|
||||
break;
|
||||
case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
|
||||
sb.append("cordova.require('cordova/base64').toArrayBuffer('")
|
||||
.append(pluginResult.getMessage())
|
||||
.append("')");
|
||||
break;
|
||||
default:
|
||||
sb.append(pluginResult.getMessage());
|
||||
}
|
||||
sb.append("],")
|
||||
.append(pluginResult.getKeepCallback())
|
||||
.append(");");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user