mirror of
https://github.com/KokaKiwi/BarInsta
synced 2026-03-04 19:41:36 +00:00
Add sentry to github builds
This commit adds github and fdroid product flavors. Sentry is added only to github builds. Sentry is opt-in.
This commit is contained in:
parent
16ac573859
commit
5bdfb7df51
22 changed files with 553 additions and 216 deletions
|
|
@ -0,0 +1,40 @@
|
|||
package awais.instagrabber.fragments.settings;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import awais.instagrabber.fragments.settings.IFlavorSettings;
|
||||
import awais.instagrabber.fragments.settings.SettingCategory;
|
||||
|
||||
public final class FlavorSettings implements IFlavorSettings {
|
||||
|
||||
private static FlavorSettings instance;
|
||||
|
||||
private FlavorSettings() {
|
||||
}
|
||||
|
||||
public static FlavorSettings getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new FlavorSettings();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public List<Preference> getPreferences(@NonNull final Context context,
|
||||
@NonNull final FragmentManager fragmentManager,
|
||||
@NonNull final SettingCategory settingCategory) {
|
||||
// switch (settingCategory) {
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
56
app/src/fdroid/java/awaisomereport/CrashHandler.java
Normal file
56
app/src/fdroid/java/awaisomereport/CrashHandler.java
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package awaisomereport;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class CrashHandler implements ICrashHandler {
|
||||
private static final String TAG = CrashHandler.class.getSimpleName();
|
||||
|
||||
private final Application application;
|
||||
|
||||
public CrashHandler(@NonNull final Application application) {
|
||||
this.application = application;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uncaughtException(@NonNull final Thread t,
|
||||
@NonNull final Throwable exception,
|
||||
@NonNull final Thread.UncaughtExceptionHandler defaultEH) {
|
||||
CrashReporterHelper.startErrorReporterActivity(application, exception);
|
||||
// zipLogs();
|
||||
defaultEH.uncaughtException(t, exception);
|
||||
}
|
||||
|
||||
// public synchronized CrashReporter zipLogs() {
|
||||
// final File logDir = Utils.logCollector != null ? Utils.logCollector.getLogDir() :
|
||||
// new File(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? application.getDataDir() : application.getFilesDir(), "crashlogs");
|
||||
//
|
||||
// try (final FileOutputStream fos = new FileOutputStream(crashLogsZip);
|
||||
// final ZipOutputStream zos = new ZipOutputStream(fos)) {
|
||||
//
|
||||
// final File[] files = logDir.listFiles();
|
||||
//
|
||||
// if (files != null) {
|
||||
// zos.setLevel(5);
|
||||
// byte[] buffer;
|
||||
// for (final File file : files) {
|
||||
// if (file != null && file.length() > 0) {
|
||||
// buffer = new byte[1024];
|
||||
// try (final FileInputStream fis = new FileInputStream(file)) {
|
||||
// zos.putNextEntry(new ZipEntry(file.getName()));
|
||||
// int length;
|
||||
// while ((length = fis.read(buffer)) > 0) zos.write(buffer, 0, length);
|
||||
// zos.closeEntry();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } catch (final Exception e) {
|
||||
// if (BuildConfig.DEBUG) Log.e("AWAISKING_APP", "", e);
|
||||
// }
|
||||
//
|
||||
// return this;
|
||||
// }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue