Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 3fde42e

Browse files
committed
Remove error reporting
1 parent 3c2595a commit 3fde42e

File tree

5 files changed

+18
-30
lines changed

5 files changed

+18
-30
lines changed

app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'com.android.application'
33
id 'com.mikepenz.aboutlibraries.plugin'
4-
id "io.sentry.android.gradle" version "3.1.5"
4+
// id "io.sentry.android.gradle" version "3.1.5"
55
}
66

77
android {
@@ -79,12 +79,12 @@ aboutLibraries {
7979
additionalLicenses = ["LGPL_3_0_only"]
8080
}
8181

82-
sentry {
82+
/*sentry {
8383
ignoredBuildTypes = ["debug"]
8484
8585
includeProguardMapping = true
8686
87-
autoUploadProguardMapping = isLocalSentry
87+
autoUploadProguardMapping = false // isLocalSentry
8888
8989
tracingInstrumentation {
9090
enabled = false
@@ -93,7 +93,7 @@ sentry {
9393
autoInstallation {
9494
enabled = false
9595
}
96-
}
96+
}*/
9797

9898
configurations {
9999
implementation.exclude group: 'org.jetbrains' , module: 'annotations'
@@ -127,8 +127,8 @@ dependencies {
127127
implementation 'com.github.Fox2Code:AndroidANSI:1.0.1'
128128

129129
// Error reporting
130-
implementation 'io.sentry:sentry-android:6.4.1'
131-
implementation 'io.sentry:sentry-android-fragment:6.4.1'
130+
/*implementation 'io.sentry:sentry-android:6.4.1'
131+
implementation 'io.sentry:sentry-android-fragment:6.4.1'*/
132132

133133
// Markdown
134134
implementation "io.noties.markwon:core:4.6.2"

app/src/main/java/com/fox2code/mmm/MainApplication.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import com.fox2code.rosettax.LanguageSwitcher;
2929
import com.topjohnwu.superuser.Shell;
3030

31-
import java.io.IOException;
32-
import java.io.Writer;
3331
import java.text.SimpleDateFormat;
3432
import java.util.Date;
3533
import java.util.Locale;
@@ -45,12 +43,6 @@
4543
import io.noties.markwon.syntax.SyntaxHighlightPlugin;
4644
import io.noties.prism4j.Prism4j;
4745
import io.noties.prism4j.annotations.PrismBundle;
48-
import io.sentry.JsonObjectWriter;
49-
import io.sentry.NoOpLogger;
50-
import io.sentry.TypeCheckHint;
51-
import io.sentry.android.core.SentryAndroid;
52-
import io.sentry.android.fragment.FragmentLifecycleIntegration;
53-
import io.sentry.hints.DiskFlushNotification;
5446

5547
@PrismBundle(
5648
includeAll = true,
@@ -188,10 +180,10 @@ public static void setHasGottenRootAccess(boolean bool) {
188180
getSharedPreferences().edit().putBoolean("has_root_access", bool).apply();
189181
}
190182

191-
public static boolean isCrashReportingEnabled() {
183+
/*public static boolean isCrashReportingEnabled() {
192184
return getSharedPreferences().getBoolean("pref_crash_reporting",
193185
BuildConfig.DEFAULT_ENABLE_CRASH_REPORTING && !BuildConfig.DEBUG);
194-
}
186+
}*/
195187

196188
public static SharedPreferences getBootSharedPreferences() {
197189
return bootSharedPreferences;
@@ -368,7 +360,7 @@ public void onCreate() {
368360
}, "Emoji compat init.").start();
369361
}
370362

371-
SentryAndroid.init(this, options -> {
363+
/*SentryAndroid.init(this, options -> {
372364
options.addIntegration(new FragmentLifecycleIntegration(this, true, false));
373365
// Note: Sentry library only take a screenshot of Fox Magisk Module Manager.
374366
// The screen shot doesn't and cannot contain other applications (if in multi windows)
@@ -434,7 +426,7 @@ public void close() {}
434426
return null;
435427
}
436428
});
437-
});
429+
});*/
438430
}
439431

440432
@Override

app/src/main/java/com/fox2code/mmm/installer/InstallerActivity.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@
5050
import java.util.zip.ZipFile;
5151
import java.util.zip.ZipInputStream;
5252

53-
import io.sentry.Breadcrumb;
54-
import io.sentry.Sentry;
55-
import io.sentry.SentryLevel;
56-
5753
public class InstallerActivity extends FoxActivity {
5854
private static final String TAG = "InstallerActivity";
5955
public LinearProgressIndicator progressIndicator;
@@ -108,7 +104,7 @@ protected void onCreate(Bundle savedInstanceState) {
108104
}
109105
Log.i(TAG, "Install link: " + target);
110106
// Note: Sentry only send this info on crash.
111-
if (MainApplication.isCrashReportingEnabled()) {
107+
/*if (MainApplication.isCrashReportingEnabled()) {
112108
Breadcrumb breadcrumb = new Breadcrumb();
113109
breadcrumb.setType("install");
114110
breadcrumb.setData("target", target);
@@ -117,7 +113,7 @@ protected void onCreate(Bundle savedInstanceState) {
117113
breadcrumb.setCategory("app.action.preinstall");
118114
breadcrumb.setLevel(SentryLevel.INFO);
119115
Sentry.addBreadcrumb(breadcrumb);
120-
}
116+
}*/
121117
boolean urlMode = target.startsWith("http://") || target.startsWith("https://");
122118
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
123119
setTitle(name);
@@ -455,7 +451,7 @@ private void doInstall(File file, boolean noExtensions, boolean rootless) {
455451
installCommand).to(installerController, installerMonitor);
456452
}
457453
// Note: Sentry only send this info on crash.
458-
if (MainApplication.isCrashReportingEnabled()) {
454+
/*if (MainApplication.isCrashReportingEnabled()) {
459455
Breadcrumb breadcrumb = new Breadcrumb();
460456
breadcrumb.setType("install");
461457
breadcrumb.setData("moduleId", moduleId == null ? "<null>" : moduleId);
@@ -468,7 +464,7 @@ private void doInstall(File file, boolean noExtensions, boolean rootless) {
468464
breadcrumb.setCategory("app.action.install");
469465
breadcrumb.setLevel(SentryLevel.INFO);
470466
Sentry.addBreadcrumb(breadcrumb);
471-
}
467+
}*/
472468
if (mmtReborn && magiskCmdLine) {
473469
Log.w(TAG, "mmtReborn and magiskCmdLine may not work well together");
474470
}

app/src/main/java/com/fox2code/mmm/settings/SettingsActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
132132
return true;
133133
});
134134
// Crash reporting
135-
TwoStatePreference crashReportingPreference = findPreference("pref_crash_reporting");
135+
/*TwoStatePreference crashReportingPreference = findPreference("pref_crash_reporting");
136136
crashReportingPreference.setChecked(MainApplication.isCrashReportingEnabled());
137137
crashReportingPreference.setOnPreferenceChangeListener((preference, newValue) -> {
138138
devModeStepFirstBootIgnore = true;
139139
devModeStep = 0;
140140
return true;
141-
});
141+
});*/
142142
Preference enableBlur = findPreference("pref_enable_blur");
143143
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
144144
enableBlur.setSummary(R.string.require_android_6);

app/src/main/res/xml/root_preferences.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@
116116
app:summary="@string/prevent_reboot_desc"
117117
app:title="@string/prevent_reboot_pref" />
118118
<!-- Crash reporting -->
119-
<SwitchPreferenceCompat
119+
<!--<SwitchPreferenceCompat
120120
app:defaultValue="true"
121121
app:icon="@drawable/ic_baseline_bug_report_24"
122122
app:key="pref_crash_reporting"
123123
app:singleLineTitle="false"
124124
app:summary="@string/crash_reporting_desc"
125-
app:title="@string/crash_reporting" />
125+
app:title="@string/crash_reporting" />-->
126126
<!-- Purposely crash the app -->
127127
<Preference
128128
app:icon="@drawable/ic_baseline_bug_report_24"

0 commit comments

Comments
 (0)