Show/print full original message

This commit is contained in:
M66B 2019-05-21 17:38:48 +02:00
parent a569efa6c4
commit 986dbfcac9
3 changed files with 0 additions and 29 deletions

View File

@ -1251,7 +1251,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
String html = Helper.readText(file);
html = HtmlHelper.getHtmlEmbedded(context, id, html);
html = HtmlHelper.removeTracking(context, html);
return new String[]{message.subject, html};
}

View File

@ -1761,7 +1761,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
OriginalMessage original = new OriginalMessage();
original.html = Helper.readText(file);
original.html = HtmlHelper.getHtmlEmbedded(context, id, original.html);
original.html = HtmlHelper.removeTracking(context, original.html);
Document doc = Jsoup.parse(original.html);
original.has_images = (doc.select("img").size() > 0);

View File

@ -84,33 +84,6 @@ public class HtmlHelper {
private static final ExecutorService executor = Executors.newSingleThreadExecutor(Helper.backgroundThreadFactory);
static String removeTracking(Context context, String html) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean paranoid = prefs.getBoolean("paranoid", true);
if (!paranoid)
return html;
Document document = Jsoup.parse(html);
// Remove tracking pixels
for (Element img : document.select("img"))
if (isTrackingPixel(img))
img.removeAttr("src");
// Remove Javascript
for (Element e : document.select("*"))
for (Attribute a : e.attributes()) {
String v = a.getValue();
if (v != null && v.trim().toLowerCase().startsWith("javascript:"))
e.removeAttr(a.getKey());
}
// Remove scripts
document.select("script").remove();
return document.outerHtml();
}
static String sanitize(Context context, String html) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean paranoid = prefs.getBoolean("paranoid", true);