V
V
Vit2014-02-03 14:29:07
Mobile development
Vit, 2014-02-03 14:29:07

How to display encrypted resources in WebView?

Good afternoon.
A somewhat unusual problem arose. The mobile application has a WebView in which you need to show a page with pictures. But the fact is that pictures on a mobile device must be stored in encrypted form. It seems to me that in WebView it is somehow necessary to replace the file reading function in order to transparently decrypt it on the fly. But it is not clear how to do this, and whether this is even possible.
Mobile platforms of interest: iOS, Android, Windows 8.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
constv, 2014-02-03
@constv

Under Android, I did this, in the sqlite database of the application I stored the pictures in encrypted form. Before displaying information, I decoded the picture, converted it to base64, generated the page code programmatically and slipped the WebView

byte[] bb;
...
String test =Base64.encodeBytes(bb);
String html = "<img src=\"data:image/jpeg;base64,"+test+"\" />";

A
Alexey Storozhev, 2014-02-03
@storoj

Public API is very unlikely to succeed.
Although it seems like it was somehow possible to intercept all NSURLConnection, I would search on this topic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question