You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Matthew Ma (JIRA)" <ji...@apache.org> on 2016/03/23 19:48:25 UTC
[jira] [Created] (CB-10939) BridgeSecret is 0 when cordova is
injected as inline script on emulators only
Matthew Ma created CB-10939:
-------------------------------
Summary: BridgeSecret is 0 when cordova is injected as inline script on emulators only
Key: CB-10939
URL: https://issues.apache.org/jira/browse/CB-10939
Project: Apache Cordova
Issue Type: Bug
Components: Android
Affects Versions: 5.1.1
Environment: Cordova 6.0.0
cordova android 5.1.1
[cordova-plugin-fastrde-injectview|https://www.npmjs.com/package/cordova-plugin-fastrde-injectview] plugin.
Reporter: Matthew Ma
Priority: Minor
The [injectview|https://www.npmjs.com/package/cordova-plugin-fastrde-injectview] plugin looks great to me because I want to open an external website.
The plugin injects cordova and its plugin js into the webview as inline script. I got device ready event and the cordova demo app looks good.
However, I found out I can't not use things like navigator.camera.getPicture or navigator.notification.alert. After ruling out common mistake and I start to step the code.
It turns out the bridgesecret in the js is 0 so it doesn't pass the
{code:java}
if (!verifySecret("exec()", bridgeSecret)) {
return null;
}
{code}
in CordovaBridge.java. If I comment out these three lines, things works fine.
If I don't use remote website but use local www, this works fine.(without remove the injectView plugin) Also, I DON'T have this problem on my actual android lollipop phone, where the bridgesecret is a good random number. Only on emulators such as AVD and Visual Studio Android Emulator.
So, this issue only happens on emulator with the injected inline javascript plugin.
Any thought?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org