mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
@@ -303,12 +303,7 @@
|
||||
<string name="notify_sound_setting_disabled">None</string>
|
||||
<string name="choose_ringtone_title">Choose ringtone</string>
|
||||
|
||||
<!-- Settings Crash reports and feedback -->
|
||||
<string name="crash_report_settings_title">Crash reports</string>
|
||||
<string name="enable_acra_setting">Enable crash reporter</string>
|
||||
<string name="acra_syslog_setting">Send system logs</string>
|
||||
<string name="acra_user_email_setting">Optional contact email</string>
|
||||
<string name="acra_alwaysaccept_setting">Always send reports</string>
|
||||
<!-- Settings Feedback -->
|
||||
<string name="feedback_settings_title">Feedback</string>
|
||||
<string name="send_feedback">Send feedback</string>
|
||||
|
||||
|
||||
@@ -87,35 +87,6 @@
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/crash_report_settings_title">
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="acra.enable"
|
||||
android:title="@string/enable_acra_setting"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:dependency="acra.enable"
|
||||
android:key="acra.syslog.enable"
|
||||
android:title="@string/acra_syslog_setting"/>
|
||||
|
||||
<EditTextPreference
|
||||
android:dependency="acra.enable"
|
||||
android:key="acra.user.email"
|
||||
android:inputType="textEmailAddress"
|
||||
android:summary=""
|
||||
android:title="@string/acra_user_email_setting"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:dependency="acra.enable"
|
||||
android:key="acra.alwaysaccept"
|
||||
android:title="@string/acra_alwaysaccept_setting"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/feedback_settings_title">
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import static android.content.Context.WIFI_SERVICE;
|
||||
import static android.net.ConnectivityManager.TYPE_MOBILE;
|
||||
import static android.net.ConnectivityManager.TYPE_WIFI;
|
||||
import static android.net.wifi.WifiManager.WIFI_STATE_ENABLED;
|
||||
import static org.briarproject.util.StringUtils.scrubMacAddress;
|
||||
import static org.briarproject.util.PrivacyUtils.scrubMacAddress;
|
||||
|
||||
public class BriarReportPrimer implements ReportPrimer {
|
||||
|
||||
@@ -166,8 +166,10 @@ public class BriarReportPrimer implements ReportPrimer {
|
||||
if (wifiInfo != null) {
|
||||
int ip = wifiInfo.getIpAddress(); // Nice API, Google
|
||||
int ip1 = ip & 0xFF;
|
||||
int ip2 = (ip >> 8) & 0xFF;
|
||||
int ip3 = (ip >> 16) & 0xFF;
|
||||
int ip4 = (ip >> 24) & 0xFF;
|
||||
String address = ip1 + ".[scrubbed]." + ip4;
|
||||
String address = ip1 + "." + ip2 + "." + ip3 + "." + ip4;
|
||||
customData.put("Wi-Fi address", address);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.briarproject.android.report;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
@@ -20,12 +19,10 @@ import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.acra.ACRA;
|
||||
import org.acra.ReportField;
|
||||
import org.acra.collector.CrashReportData;
|
||||
import org.acra.dialog.BaseCrashReportDialog;
|
||||
import org.acra.file.CrashReportPersister;
|
||||
import org.acra.prefs.SharedPreferencesFactory;
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.util.UserFeedback;
|
||||
|
||||
@@ -55,7 +52,6 @@ public class DevReportActivity extends BaseCrashReportDialog
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(DevReportActivity.class.getName());
|
||||
|
||||
private static final String PREF_EXCLUDED_FIELDS = "excludedReportFields";
|
||||
private static final String STATE_REVIEWING = "reviewing";
|
||||
private static final Set<ReportField> requiredFields = new HashSet<>();
|
||||
|
||||
@@ -69,8 +65,7 @@ public class DevReportActivity extends BaseCrashReportDialog
|
||||
}
|
||||
|
||||
private AppCompatDelegate delegate;
|
||||
private SharedPreferencesFactory sharedPreferencesFactory;
|
||||
private Set<ReportField> excludedFields;
|
||||
private Set<ReportField> excludedFields = new HashSet<>();
|
||||
private EditText userCommentView = null;
|
||||
private EditText userEmailView = null;
|
||||
private CheckBox includeDebugReport = null;
|
||||
@@ -95,16 +90,6 @@ public class DevReportActivity extends BaseCrashReportDialog
|
||||
|
||||
getDelegate().setContentView(R.layout.activity_dev_report);
|
||||
|
||||
sharedPreferencesFactory = new SharedPreferencesFactory(
|
||||
getApplicationContext(), getConfig());
|
||||
|
||||
SharedPreferences prefs = sharedPreferencesFactory.create();
|
||||
excludedFields = new HashSet<>();
|
||||
for (String name : prefs.getStringSet(PREF_EXCLUDED_FIELDS,
|
||||
new HashSet<String>())) {
|
||||
excludedFields.add(ReportField.valueOf(name));
|
||||
}
|
||||
|
||||
Toolbar tb = (Toolbar) findViewById(R.id.toolbar);
|
||||
getDelegate().setSupportActionBar(tb);
|
||||
|
||||
@@ -164,9 +149,6 @@ public class DevReportActivity extends BaseCrashReportDialog
|
||||
}
|
||||
});
|
||||
|
||||
String userEmail = prefs.getString(ACRA.PREF_USER_EMAIL_ADDRESS, "");
|
||||
userEmailView.setText(userEmail);
|
||||
|
||||
if (state != null)
|
||||
reviewing = state.getBoolean(STATE_REVIEWING, isFeedback());
|
||||
|
||||
@@ -362,25 +344,15 @@ public class DevReportActivity extends BaseCrashReportDialog
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Boolean success) {
|
||||
final SharedPreferences prefs =
|
||||
sharedPreferencesFactory.create();
|
||||
final SharedPreferences.Editor prefEditor =
|
||||
prefs.edit();
|
||||
Set<String> fields = new HashSet<>();
|
||||
for (ReportField field : excludedFields) {
|
||||
fields.add(field.name());
|
||||
}
|
||||
prefEditor.putStringSet(PREF_EXCLUDED_FIELDS, fields);
|
||||
prefEditor.apply();
|
||||
|
||||
if (success) {
|
||||
// Retrieve user's comment and email address, if any
|
||||
String comment = "";
|
||||
if (userCommentView != null)
|
||||
comment = userCommentView.getText().toString();
|
||||
String email = "";
|
||||
if (userEmailView != null)
|
||||
if (userEmailView != null) {
|
||||
email = userEmailView.getText().toString();
|
||||
}
|
||||
sendCrash(comment, email);
|
||||
}
|
||||
finish();
|
||||
|
||||
Reference in New Issue
Block a user