Add opt-in crash reporting via ACRA

Fixes #398.
This commit is contained in:
Daniel Martí 2015-12-26 19:16:47 +01:00
parent 76cda91e64
commit b22466ee66
5 changed files with 28 additions and 0 deletions

View File

@ -1,5 +1,7 @@
### 0.98 (upcoming release)
* Add opt-in crash reporting via ACRA
* Add support for HTTP basic authentication of repos
* Fix repo updating on older devices with little memory

View File

@ -376,6 +376,12 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".FDroid" />
</activity>
<activity android:name="org.acra.CrashReportDialog"
android:theme="@style/AlertDialogThemeDark"
android:process=":error_report"
android:launchMode="singleInstance"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true" />
<activity
android:label="@string/menu_swap"
android:name=".views.swap.SwapWorkflowActivity"

View File

@ -20,6 +20,9 @@ dependencies {
compile 'cc.mvdan.accesspoint:library:0.1.3'
compile 'commons-net:commons-net:3.4'
compile 'org.openhab.jmdns:jmdns:3.4.2'
compile('ch.acra:acra:4.7.0') {
exclude module: 'support-v4'
}
androidTestCompile 'commons-io:commons-io:2.2'
}
@ -71,6 +74,7 @@ if (!hasProperty('sourceDeps')) {
'com.madgag.spongycastle:pkix:6aba9b2210907a3d46dd3dcac782bb3424185290468d102d5207ebdc9796a905',
'com.madgag.spongycastle:prov:029f26cd6b67c06ffa05702d426d472c141789001bcb15b7262ed86c868e5643',
'com.madgag.spongycastle:core:9b6b7ac856b91bcda2ede694eccd26cefb0bf0b09b89f13cda05b5da5ff68c6b',
'ch.acra:acra:7ab8ee487aabce180b42af16d1db8fcb3f40970ba3dfa5d4d07e835cea4a4f67',
]
}

View File

@ -379,4 +379,10 @@
<string name="theme_light">Light</string>
<string name="theme_dark">Dark</string>
<string name="theme_night">Night</string>
<string name="crash_dialog_title">F-Droid has crashed</string>
<string name="crash_dialog_text">An unexpected error occurred
forcing the application to stop. Would you like to e-mail the
details to help fix the issue?</string>
<string name="crash_dialog_comment_prompt">You can add extra information and comments here:</string>
</resources>

View File

@ -43,6 +43,9 @@ import com.nostra13.universalimageloader.cache.disc.naming.FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.utils.StorageUtils;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
import org.apache.commons.net.util.SubnetUtils;
import org.fdroid.fdroid.Preferences.ChangeListener;
@ -62,6 +65,12 @@ import java.util.Locale;
import sun.net.www.protocol.bluetooth.Handler;
@ReportsCrashes(mailTo = "team@f-droid.org",
mode = ReportingInteractionMode.DIALOG,
resDialogTitle = R.string.crash_dialog_title,
resDialogText = R.string.crash_dialog_text,
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt
)
public class FDroidApp extends Application {
private static final String TAG = "FDroidApp";
@ -183,6 +192,7 @@ public class FDroidApp extends Application {
}
updateLanguage();
super.onCreate();
ACRA.init(this);
// Needs to be setup before anything else tries to access it.
// Perhaps the constructor is a better place, but then again,