Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Sentry #354

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1054,31 +1054,6 @@ THE SOFTWARE.
limitations under the License.


## sentry-android

MIT License

Copyright (c) 2019 Sentry
Copyright (c) 2015 Salomon BRYS for Android ANRWatchDog

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


## slf4j

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Project dependencies:
* [retrofit2](https://github.com/square/retrofit)
* [gson](https://github.com/google/gson)
* [streamsupport](https://github.com/streamsupport/streamsupport)
* [sentry-android](https://github.com/getsentry/sentry-java)
* [slf4j](https://github.com/qos-ch/slf4j)
* [logback-android](https://github.com/tony19/logback-android)
* [mockito](https://github.com/mockito/mockito)
Expand Down
2 changes: 0 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ dependencies {
// liboqs
implementation project(path: ':liboqs-android')

// For crash logging.
implementation 'io.sentry:sentry-android:6.13.1'
implementation "androidx.multidex:multidex:2.0.1"
}

Expand Down
2 changes: 0 additions & 2 deletions core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
tools:overrideLibrary="com.google.zxing.client.android"
tools:ignore="GoogleAppIndexingWarning, HardcodedDebugMode">

<meta-data android:name="io.sentry.auto-init" android:value="false" />

<activity
android:name="net.ivpn.core.v2.timepicker.TimePickerActivity"
android:exported="false"
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/net/ivpn/core/IVPNApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.navigation.NavGraph
import net.ivpn.core.common.FeatureConfig
import net.ivpn.core.common.dagger.ApplicationComponent
import net.ivpn.core.common.dagger.DaggerApplicationComponent
import net.ivpn.core.common.logger.CrashLoggingController
import net.ivpn.core.common.navigation.CustomNavigation
import net.ivpn.core.v2.signup.SignUpController
import net.ivpn.core.v2.updates.UpdatesController
Expand Down Expand Up @@ -42,7 +41,6 @@ object IVPNApplication {
lateinit var updatesController: UpdatesController
lateinit var customNavigation: CustomNavigation
lateinit var moduleNavGraph: NavGraph
lateinit var crashLoggingController: CrashLoggingController
lateinit var config: FeatureConfig

fun initBy(application: Application): ApplicationComponent{
Expand All @@ -67,10 +65,6 @@ object IVPNApplication {
updatesController = controller
}

fun applyCrashController(crashController: CrashLoggingController) {
this.crashLoggingController = crashController
}

fun applyFeatureConfig(config: FeatureConfig) {
this.config = config
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class EncryptedSettingsPreference @Inject constructor(val preference: Preference
private const val IS_MIGRATED = "IS_MIGRATED"

private const val SETTINGS_LOGGING = "SETTINGS_LOGGING"
private const val SETTINGS_SENTRY = "SETTINGS_SENTRY"
private const val SETTINGS_MULTI_HOP = "SETTINGS_MULTI_HOP"
private const val SETTINGS_MULTI_HOP_SAME_PROVIDER_ALLOWED = "SETTINGS_MULTI_HOP_SAME_PROVIDER_ALLOWED"
private const val SETTINGS_KILL_SWITCH = "SETTINGS_KILL_SWITCH"
Expand Down Expand Up @@ -452,16 +451,6 @@ class EncryptedSettingsPreference @Inject constructor(val preference: Preference
return sharedPreferences.getString(LAST_USED_IP, null)
}

fun enableSentry(value: Boolean) {
sharedPreferences.edit()
.putBoolean(SETTINGS_SENTRY, value)
.apply()
}

fun isSentryEnabled(): Boolean {
return sharedPreferences.getBoolean(SETTINGS_SENTRY, false)
}

fun getFilter(): String? {
return sharedPreferences.getString(SETTINGS_FILTER, null)
}
Expand Down Expand Up @@ -515,9 +504,6 @@ class EncryptedSettingsPreference @Inject constructor(val preference: Preference
if (oldPreference.contains(SETTINGS_LOGGING)) {
putSettingLogging(oldPreference.getBoolean(SETTINGS_LOGGING, false))
}
if (oldPreference.contains(SETTINGS_SENTRY)) {
enableSentry(oldPreference.getBoolean(SETTINGS_SENTRY, true))
}
if (oldPreference.contains(SETTINGS_MULTI_HOP)) {
putSettingMultiHop(oldPreference.getBoolean(SETTINGS_MULTI_HOP, false))
}
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/net/ivpn/core/common/prefs/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ class Settings @Inject constructor(
settingsPreference.putSettingStartOnBoot(value)
}

var isSentryEnabled: Boolean
get() = settingsPreference.isSentryEnabled()
set(value) {
settingsPreference.enableSentry(value)
}

var isAntiSurveillanceEnabled: Boolean
get() = settingsPreference.getIsAntiSurveillanceEnabled()
set(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public void resetComponents() {
protocolController.reset();
IVPNApplication.updatesController.resetComponent();
logUtil.resetAll();
IVPNApplication.crashLoggingController.reset();
mockLocationController.reset();

NotificationManagerCompat.from(IVPNApplication.application).cancelAll();
Expand Down
20 changes: 0 additions & 20 deletions core/src/main/java/net/ivpn/core/v2/viewmodel/LoggingViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,14 @@ class LoggingViewModel @Inject constructor(
) : ViewModel() {

val isLoggingEnabled = ObservableBoolean()
val isCrashLoggingEnabled = ObservableBoolean()
val isSentrySupported = ObservableBoolean()

var enableLoggingListener = CompoundButton.OnCheckedChangeListener { _: CompoundButton?, value: Boolean -> enableLogging(value) }
var enableCrashLoggingListener = CompoundButton.OnCheckedChangeListener { _: CompoundButton?, value: Boolean -> enableCrashLogging(value) }

init {
}

fun onResume() {
isLoggingEnabled.set(getLoggingValue())
isCrashLoggingEnabled.set(isSentryEnabled())
isSentrySupported.set(getSentrySupport())
}

fun getLogFileUri(context: Context?): Uri {
Expand All @@ -60,29 +55,14 @@ class LoggingViewModel @Inject constructor(

fun reset() {
isLoggingEnabled.set(getLoggingValue())
isCrashLoggingEnabled.set(isSentryEnabled())
isSentrySupported.set(getSentrySupport())
}

private fun getLoggingValue(): Boolean {
return logUtil.isLoggingEnabled
}

private fun isSentryEnabled(): Boolean {
return IVPNApplication.crashLoggingController.isEnabled
}

private fun getSentrySupport(): Boolean {
return IVPNApplication.crashLoggingController.isSupported
}

private fun enableLogging(value: Boolean) {
isLoggingEnabled.set(value)
logUtil.enableLogging(value)
}

private fun enableCrashLogging(value: Boolean) {
isCrashLoggingEnabled.set(value)
IVPNApplication.crashLoggingController.setState(value)
}
}
53 changes: 0 additions & 53 deletions core/src/main/res/layout/settings_section_logging.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,59 +27,6 @@
android:layout_height="wrap_content"
android:text="@string/settings_logging" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="@{logging.isSentrySupported ? View.VISIBLE : View.GONE}">

<TextView
android:id="@+id/textView9"
style="@style/SettingsOptionTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:text="@string/settings_enable_crashes"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
style="@style/SettingsOptionDescription"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:text="@string/settings_crash_logging_description"
android:textAlignment="viewStart"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/enable_crashes"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView9" />

<androidx.appcompat.widget.SwitchCompat
android:id="@+id/enable_crashes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:checked="@{logging.isCrashLoggingEnabled()}"
android:thumb="@drawable/common_thumb_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:onChanged="@{logging.enableCrashLoggingListener}"
app:track="@drawable/common_track_selector" />
</androidx.constraintlayout.widget.ConstraintLayout>


<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/color_section_divider"
android:visibility="@{logging.isSentrySupported ? View.VISIBLE : View.GONE}" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<string name="settings_version">VERSION</string>
<string name="settings_color_theme">Color theme</string>
<string name="settings_enable_logging">Enable logging</string>
<string name="settings_enable_crashes">Enable crash logging</string>
<string name="settings_enable_multi_hop">Multi-hop connection</string>
<string name="settings_multihop_same_provider_title">Multi-hop same provider restriction</string>
<string name="settings_multihop_same_provider_description">Allow to use servers from the same provider to build Multi-hop chain.</string>
Expand All @@ -56,7 +55,6 @@
<string name="settings_send_logs">SEND LOGS</string>
<string name="settings_split_tunneling">Split tunneling</string>
<string name="settings_do_not_collect_your_data">We can\'t see these until you send them to us.</string>
<string name="settings_crash_logging_description">Anonymous crash logs will be sent to IVPN to help us improve the application.</string>
<string name="settings_split_tunneling_description">Choose which apps you want to use with IVPN.</string>
<string name="settings_kill_switch_description">Allow using internet only when IVPN connection is enabled.</string>
<string name="settings_always_on_vpn_description">Can help to improve protection.</string>
Expand Down
2 changes: 0 additions & 2 deletions fakekeystore.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
sentry.dsn=

release.store.file=''
release.key.alias=''
release.key.password=''
Expand Down
1 change: 0 additions & 1 deletion fdroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ android {
versionName "2.10.9"
ndkVersion "25.1.8937393"

manifestPlaceholders = [SENTRY_DSN: keystoreProperties['sentry.dsn']]
buildConfigField "String", "BILLING_PUBLIC_KEY", keystoreProperties['billing.public.key']
multiDexEnabled true
}
Expand Down
10 changes: 0 additions & 10 deletions fdroid/src/main/java/net/ivpn/client/FDroidIVPNApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package net.ivpn.client
import androidx.multidex.MultiDexApplication
import net.ivpn.client.dagger.DaggerFDroidComponent
import net.ivpn.client.dagger.FDroidComponent
import net.ivpn.client.logging.StubCrashLoggingController
import net.ivpn.client.navigation.FDroidNavigation
import net.ivpn.client.signup.FDroidSignUpViewModel
import net.ivpn.client.updates.StubUpdatesViewModel
Expand All @@ -44,8 +43,6 @@ class FDroidIVPNApplication: MultiDexApplication() {
@Inject
lateinit var signup: FDroidSignUpViewModel

var crashController = StubCrashLoggingController()

var updates = StubUpdatesViewModel()

override fun onCreate() {
Expand All @@ -55,8 +52,6 @@ class FDroidIVPNApplication: MultiDexApplication() {
initFeatureConfig()
initComponents(appComponent)
initUpdatesController()
//Init crash controller at first
initCrashLogging()
IVPNApplication.initBaseComponents()
initSignUpController()
IVPNApplication.customNavigation = FDroidNavigation()
Expand All @@ -78,9 +73,4 @@ class FDroidIVPNApplication: MultiDexApplication() {
private fun initFeatureConfig() {
IVPNApplication.applyFeatureConfig(FDroidFeatureConfig())
}

private fun initCrashLogging() {
crashController.init()
IVPNApplication.crashLoggingController = crashController
}
}

This file was deleted.

Loading
Loading