Android load encrypted HTML+JS to webview from asset folder

Viewed 788

I have a "SIMPLE" problem which I tried for days to resolve but I didn't. I have an HTML with Javascript file encrypted with AES into my asset folder and what I want to do, is loading it into a webview after having decrypted it. I can't use load URL because loadUrl() needs a filePath and my file is encrypted so i can't give it since I have to decrypt it before

webView.loadUrl("file:///android_asset/encrypted.html"); 

so after I tried with

loadData(htmlJsString, "text/html", "UTF-8");

where htmlJsString is the encrypted.html file as a decrypted string but doing so only HTML code is working while javascript is not working( webView.setJavaScriptEnabled(true); ).

So in few words how can I load an encrypted HTML+JS into my webView from asset folder?

1 Answers
Related