Debug encrypted message structure

pull/209/head
M66B 2 years ago
parent 3808e41e67
commit 37ffe55680

@ -8168,8 +8168,17 @@ public class FragmentMessages extends FragmentBase
String protect_subject = parts.getProtectedSubject();
// Write decrypted body
boolean debug = prefs.getBoolean("debug", false);
boolean download_plain = prefs.getBoolean("download_plain", false);
String html = parts.getHtml(context, download_plain);
if (html == null && (debug || BuildConfig.DEBUG)) {
int textColorLink = Helper.resolveColor(context, android.R.attr.textColorLink);
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
MessageHelper.getStructure(imessage, ssb, 0, textColorLink);
html = HtmlHelper.toHtml(ssb, context);
}
Helper.writeText(message.getFile(context), html);
Log.i("pgp html=" + (html == null ? null : html.length()));
@ -8863,8 +8872,17 @@ public class FragmentMessages extends FragmentBase
// Write decrypted body
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean debug = prefs.getBoolean("debug", false);
boolean download_plain = prefs.getBoolean("download_plain", false);
String html = parts.getHtml(context, download_plain);
if (html == null && (debug || BuildConfig.DEBUG)) {
int textColorLink = Helper.resolveColor(context, android.R.attr.textColorLink);
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
MessageHelper.getStructure(imessage, ssb, 0, textColorLink);
html = HtmlHelper.toHtml(ssb, context);
}
Helper.writeText(message.getFile(context), html);
Log.i("s/mime html=" + (html == null ? null : html.length()));

Loading…
Cancel
Save