ACRA: add more fields to crash reports, but no user identifying info

extended info on things we already have:
* PRODUCT is another name for BRAND/PHONE_MODEL
* TOTAL_MEM_SIZE can be derived from hardware name
* DISPLAY is also available by looking up the hardware
* STACK_TRACE_HASH should make automated sorting easier

new info:
* PACKAGE_NAME is only new info if the user is using a whitelabel app
* AVAILABLE_MEM_SIZE can be used to track users, but only when provided at
  high resolution, e.g. once per second or higher.  Most users only send a
  single crash report.  High frequency reporters send under 100, which is
  still orders of magnatude below what is needed to track users.
This commit is contained in:
Hans-Christoph Steiner 2018-02-01 14:28:08 +01:00
parent b11cc6ab28
commit 0f98e1e125
2 changed files with 21 additions and 10 deletions

View File

@ -41,13 +41,14 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.WindowManager;
import android.widget.Toast;
import com.nostra13.universalimageloader.cache.disc.impl.LimitedAgeDiskCache;
import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import info.guardianproject.netcipher.NetCipher;
import info.guardianproject.netcipher.proxy.OrbotHelper;
import org.acra.ACRA;
import org.acra.ReportField;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
import org.apache.commons.net.util.SubnetUtils;
@ -64,6 +65,7 @@ import org.fdroid.fdroid.installer.InstallHistoryService;
import org.fdroid.fdroid.net.ImageLoaderForUIL;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.views.hiding.HidingManager;
import sun.net.www.protocol.bluetooth.Handler;
import java.io.IOException;
import java.net.URL;
@ -72,14 +74,25 @@ import java.net.URLStreamHandlerFactory;
import java.security.Security;
import java.util.List;
import info.guardianproject.netcipher.NetCipher;
import info.guardianproject.netcipher.proxy.OrbotHelper;
import sun.net.www.protocol.bluetooth.Handler;
@ReportsCrashes(mailTo = "reports@f-droid.org",
mode = ReportingInteractionMode.DIALOG,
reportDialogClass = org.fdroid.fdroid.acra.CrashReportActivity.class,
reportSenderFactoryClasses = org.fdroid.fdroid.acra.CrashReportSenderFactory.class
reportSenderFactoryClasses = org.fdroid.fdroid.acra.CrashReportSenderFactory.class,
customReportContent = {
ReportField.USER_COMMENT,
ReportField.PACKAGE_NAME,
ReportField.APP_VERSION_NAME,
ReportField.ANDROID_VERSION,
ReportField.PRODUCT,
ReportField.BRAND,
ReportField.PHONE_MODEL,
ReportField.DISPLAY,
ReportField.TOTAL_MEM_SIZE,
ReportField.AVAILABLE_MEM_SIZE,
ReportField.CUSTOM_DATA,
ReportField.STACK_TRACE_HASH,
ReportField.STACK_TRACE,
}
)
public class FDroidApp extends Application {

View File

@ -5,8 +5,6 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import org.acra.ACRAConstants;
import org.acra.ReportField;
import org.acra.collections.ImmutableSet;
import org.acra.collector.CrashReportData;
@ -38,7 +36,7 @@ public class CrashReportSender implements ReportSender {
private String[] buildSubjectBody(Context context, CrashReportData errorContent) {
ImmutableSet fields = this.config.getReportFields();
if (fields.isEmpty()) {
fields = new ImmutableSet<ReportField>(ACRAConstants.DEFAULT_MAIL_REPORT_FIELDS);
return new String[]{"No ACRA Report Fields found."};
}
String subject = context.getPackageName() + " Crash Report";