Closed Umaid1 closed 8 years ago
Loading HTML file in iFrame should be encrypted or you need to add condition in "isCryptFiles" that if URL is outside the application (as everything within app is encrypted) return false (Don't try to decrypt). code like this
private boolean isOutsideCall(String uri) {
if(uri.startsWith("file")){
return false;
}
return true;
}
private boolean isCryptFiles(String uri) {
if(isOutsideCall(uri))
return false;
for (String ext: CRYPT_FILES) {
if (uri.endsWith(ext)) {
return true;
}
}
return false;
}
Another thing which I observe that if website having Middle Man Attack security then it response like that which you have pointed out(showing the code in iFrame). For that we need to override another function through which we skip this plugin for OUTSIDE calls.
@Override
public Boolean shouldAllowBridgeAccess(String url) {
if(url.equals("http://localhost/")){
return true;
}
return null;
}
Here we check if the request URL is not from Localhost then skip this plugin.
Thank you dear. It worked !
Thanks for answer.
I am trying to open my iFrame URL but it is displaying on HTML in browser, unable to figure out how to show proper iFrame within the browser while using crypt-file. Source enclosed below.
@Override public CordovaResourceApi.OpenForReadResult handleOpenForRead(Uri uri) throws IOException { String uriStr = this.tofileUri(this.launchUri);