Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-6388

LOAD_URL Bridge fails to return binary data

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.5.0
    • Component/s: cordova-android
    • Labels:
      None

      Description

      In LOAD_URL nativeToJs mode, the Android native side of the bridge incorrectly encodes binary data.

      It serializes the data to Base64, but fails to quote it, or provide any hints to the receiving JavaScript about what to do with the data.

      A typical message (from mobile spec, file.spec.86), ends up encoded like this:

      cordova.callbackFromNative('File1615636988',true,1,[4oKsw6sgLSBUaGVyZSBpcyBhbiBleGNlcHRpb24gdG8gZXZlcnkgcnVsZS4gIEV4Y2VwdCB0aGlzIG9uZS5iaW46AQA=],false);
      

      which immediately results in a syntax error when passed to the webview.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iclelland Ian Clelland
                Reporter:
                iclelland Ian Clelland
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: