Show full client ID

pull/194/merge
M66B 3 years ago
parent ffa613ca2c
commit 43ceb4e576

@ -743,14 +743,7 @@ public class EmailService implements AutoCloseable {
try {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean client_id = prefs.getBoolean("client_id", true);
Map<String, String> id = new LinkedHashMap<>();
id.put("name", context.getString(R.string.app_name));
id.put("version", BuildConfig.VERSION_NAME);
id.put("os", "Android");
id.put("os-version", Build.VERSION.RELEASE);
Map<String, String> sid = istore.id(client_id ? id : null);
Map<String, String> sid = istore.id(client_id ? getId(context) : null);
if (sid != null) {
Map<String, String> crumb = new HashMap<>();
for (String key : sid.keySet()) {
@ -804,6 +797,15 @@ public class EmailService implements AutoCloseable {
throw new NoSuchProviderException(protocol);
}
static Map<String, String> getId(Context context) {
Map<String, String> id = new LinkedHashMap<>();
id.put("name", context.getString(R.string.app_name));
id.put("version", BuildConfig.VERSION_NAME);
id.put("os", "Android");
id.put("os-version", Build.VERSION.RELEASE);
return id;
}
static String getDefaultEhlo() {
if (BuildConfig.APPLICATION_ID.startsWith("eu.faircode.email"))
return "dummy.faircode.eu";

@ -439,7 +439,14 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
// Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
tvClientId.setText(getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME);
StringBuilder sb = new StringBuilder();
for (String value : EmailService.getId(getContext()).values()) {
if (sb.length() > 0)
sb.append(' ');
sb.append(value);
}
tvClientId.setText(sb);
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);

Loading…
Cancel
Save