Added option to turn off native ARC

pull/212/head
M66B 2 years ago
parent 32945cc721
commit 876ee65c90

@ -227,6 +227,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swLogarithmicBackoff;
private SwitchCompat swExactAlarms;
private SwitchCompat swNativeDkim;
private SwitchCompat swNativeArc;
private SwitchCompat swInfra;
private SwitchCompat swDupMsgId;
private EditText etKeywords;
@ -287,7 +288,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top",
"keep_alive_poll", "empty_pool", "idle_done", "fast_fetch",
"max_backoff_power", "logarithmic_backoff",
"exact_alarms", "native_dkim", "infra", "dkim_verify", "dup_msgids", "global_keywords", "test_iab"
"exact_alarms", "native_dkim", "native_arc", "infra", "dkim_verify", "dup_msgids", "global_keywords", "test_iab"
};
private final static String[] RESET_QUESTIONS = new String[]{
@ -462,6 +463,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swLogarithmicBackoff = view.findViewById(R.id.swLogarithmicBackoff);
swExactAlarms = view.findViewById(R.id.swExactAlarms);
swNativeDkim = view.findViewById(R.id.swNativeDkim);
swNativeArc = view.findViewById(R.id.swNativeArc);
swInfra = view.findViewById(R.id.swInfra);
swDupMsgId = view.findViewById(R.id.swDupMsgId);
etKeywords = view.findViewById(R.id.etKeywords);
@ -1701,6 +1703,15 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("native_dkim", checked).apply();
swNativeArc.setEnabled(checked && swNativeDkim.isEnabled());
}
});
swNativeArc.setEnabled(!BuildConfig.PLAY_STORE_RELEASE);
swNativeArc.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("native_arc", checked).apply();
}
});
@ -2425,6 +2436,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swLogarithmicBackoff.setChecked(prefs.getBoolean("logarithmic_backoff", true));
swExactAlarms.setChecked(prefs.getBoolean("exact_alarms", true));
swNativeDkim.setChecked(prefs.getBoolean("native_dkim", false));
swNativeArc.setChecked(prefs.getBoolean("native_arc", true));
swInfra.setChecked(prefs.getBoolean("infra", false));
swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false));
etKeywords.setText(prefs.getString("global_keywords", null));

@ -2028,7 +2028,9 @@ public class MessageHelper {
Log.i("DKIM signers=" + TextUtils.join(",", signers));
if (signers.size() == 0) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean native_arc = prefs.getBoolean("native_arc", true);
if (signers.size() == 0 && native_arc) {
// https://datatracker.ietf.org/doc/html/rfc8617#section-5.2
boolean ok = true; // Until it is not
Map<Integer, String> as = new HashMap<>();
@ -2065,6 +2067,8 @@ public class MessageHelper {
if (!ok)
break;
}
ok = (ok && as.size() > 0);
Log.i("ARC as=" + as.size() + " aar=" + aar.size() + " ams=" + ams.size() + " ok=" + ok);
if (ok &&

@ -1863,6 +1863,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNativeDkim" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNativeArc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_native_dkim"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNativeDkimHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swInfra"
android:layout_width="0dp"
@ -1871,7 +1883,7 @@
android:text="@string/title_advanced_infra"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNativeDkimHint"
app:layout_constraintTop_toBottomOf="@id/swNativeArc"
app:switchPadding="12dp" />
<androidx.constraintlayout.helper.widget.Flow

Loading…
Cancel
Save