1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Upgrade ACRA

This commit is contained in:
wb9688 2020-05-01 18:26:12 +02:00
parent 0cae58ce8e
commit 7b81e98581
5 changed files with 9 additions and 16 deletions

View File

@ -200,7 +200,7 @@ dependencies {
implementation "com.nononsenseapps:filepicker:4.2.1"
implementation "ch.acra:acra:4.9.2"
implementation "ch.acra:acra-core:5.5.0"
implementation "io.reactivex.rxjava2:rxjava:2.2.19"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"

View File

@ -16,9 +16,9 @@ import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import org.acra.ACRA;
import org.acra.config.ACRAConfiguration;
import org.acra.config.ACRAConfigurationException;
import org.acra.config.ConfigurationBuilder;
import org.acra.config.CoreConfiguration;
import org.acra.config.CoreConfigurationBuilder;
import org.acra.sender.ReportSenderFactory;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.downloader.Downloader;
@ -202,7 +202,7 @@ public class App extends Application {
private void initACRA() {
try {
final ACRAConfiguration acraConfig = new ConfigurationBuilder(this)
final CoreConfiguration acraConfig = new CoreConfigurationBuilder(this)
.setReportSenderFactoryClasses(REPORT_SENDER_FACTORY_CLASSES)
.setBuildConfigClass(BuildConfig.class)
.build();

View File

@ -4,7 +4,7 @@ import android.content.Context;
import androidx.annotation.NonNull;
import org.acra.collector.CrashReportData;
import org.acra.data.CrashReportData;
import org.acra.sender.ReportSender;
import org.schabi.newpipe.R;

View File

@ -4,7 +4,7 @@ import android.content.Context;
import androidx.annotation.NonNull;
import org.acra.config.ACRAConfiguration;
import org.acra.config.CoreConfiguration;
import org.acra.sender.ReportSender;
import org.acra.sender.ReportSenderFactory;
@ -31,7 +31,7 @@ import org.acra.sender.ReportSenderFactory;
public class AcraReportSenderFactory implements ReportSenderFactory {
@NonNull
public ReportSender create(@NonNull final Context context,
@NonNull final ACRAConfiguration config) {
@NonNull final CoreConfiguration config) {
return new AcraReportSender();
}
}

View File

@ -32,7 +32,7 @@ import com.google.android.material.snackbar.Snackbar;
import com.grack.nanojson.JsonWriter;
import org.acra.ReportField;
import org.acra.collector.CrashReportData;
import org.acra.data.CrashReportData;
import org.schabi.newpipe.ActivityCommunicator;
import org.schabi.newpipe.BuildConfig;
import org.schabi.newpipe.MainActivity;
@ -149,14 +149,7 @@ public class ErrorActivity extends AppCompatActivity {
public static void reportError(final Context context, final CrashReportData report,
final ErrorInfo errorInfo) {
// get key first (don't ask about this solution)
ReportField key = null;
for (ReportField k : report.keySet()) {
if (k.toString().equals("STACK_TRACE")) {
key = k;
}
}
String[] el = new String[]{report.get(key).toString()};
String[] el = new String[]{report.getString(ReportField.STACK_TRACE)};
Intent intent = new Intent(context, ErrorActivity.class);
intent.putExtra(ERROR_INFO, errorInfo);