diff --git a/app/build.gradle b/app/build.gradle index 804e69c..463b777 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,8 +5,6 @@ plugins { id 'kotlin-android' id 'kotlin-parcelize' id 'com.google.devtools.ksp' - id 'com.google.gms.google-services' - id 'com.google.firebase.crashlytics' id 'com.github.triplet.play' } @@ -47,10 +45,6 @@ android { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release - firebaseCrashlytics { - nativeSymbolUploadEnabled true - unstrippedNativeLibsDir true - } } } @@ -104,10 +98,7 @@ dependencies { implementation('org.smali:dexlib2:2.5.2') { exclude group: 'com.google.guava', module: 'guava' } - implementation('com.google.guava:guava:32.1.2-android') - - implementation platform('com.google.firebase:firebase-bom:32.4.0') - implementation 'com.google.firebase:firebase-crashlytics-ktx' + implementation 'com.google.guava:guava:32.1.2-android' implementation 'com.google.android.play:app-update-ktx:2.1.0' } diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 474a84b..0000000 --- a/app/google-services.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "project_info": { - "project_number": "548801210715", - "project_id": "sing-b0x", - "storage_bucket": "sing-b0x.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:548801210715:android:2c3bce07700eecb54d527e", - "android_client_info": { - "package_name": "io.nekohasekai.sfa" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "AIzaSyDzb5nuF2qyw-AW0opn4Ymi2QGuJ6dZyYo" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/app/src/main/java/io/nekohasekai/sfa/constant/SettingsKey.kt b/app/src/main/java/io/nekohasekai/sfa/constant/SettingsKey.kt index 7d21044..88a0952 100644 --- a/app/src/main/java/io/nekohasekai/sfa/constant/SettingsKey.kt +++ b/app/src/main/java/io/nekohasekai/sfa/constant/SettingsKey.kt @@ -4,7 +4,6 @@ object SettingsKey { const val SELECTED_PROFILE = "selected_profile" const val SERVICE_MODE = "service_mode" - const val ERROR_REPORTING_ENABLED = "error_reporting_enabled" const val CHECK_UPDATE_ENABLED = "check_update_enabled" const val DISABLE_MEMORY_LIMIT = "disable_memory_limit" diff --git a/app/src/main/java/io/nekohasekai/sfa/database/Settings.kt b/app/src/main/java/io/nekohasekai/sfa/database/Settings.kt index fbd9f03..44622f6 100644 --- a/app/src/main/java/io/nekohasekai/sfa/database/Settings.kt +++ b/app/src/main/java/io/nekohasekai/sfa/database/Settings.kt @@ -38,11 +38,6 @@ object Settings { var serviceMode by dataStore.string(SettingsKey.SERVICE_MODE) { ServiceMode.NORMAL } var startedByUser by dataStore.boolean(SettingsKey.STARTED_BY_USER) - const val ERROR_REPORTING_UNKNOWN = -1 - const val ERROR_REPORTING_ALLOWED = 0 - const val ERROR_REPORTING_DISALLOWED = 1 - - var errorReportingEnabled by dataStore.int(SettingsKey.ERROR_REPORTING_ENABLED) { ERROR_REPORTING_UNKNOWN } var checkUpdateEnabled by dataStore.boolean(SettingsKey.CHECK_UPDATE_ENABLED) { true } var disableMemoryLimit by dataStore.boolean(SettingsKey.DISABLE_MEMORY_LIMIT) diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt b/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt index 2d6e87d..6dce6a1 100644 --- a/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt +++ b/app/src/main/java/io/nekohasekai/sfa/ui/MainActivity.kt @@ -22,8 +22,6 @@ import com.google.android.play.core.appupdate.AppUpdateOptions import com.google.android.play.core.install.model.AppUpdateType import com.google.android.play.core.install.model.InstallStatus import com.google.android.play.core.install.model.UpdateAvailability -import com.google.firebase.crashlytics.ktx.crashlytics -import com.google.firebase.ktx.Firebase import io.nekohasekai.libbox.Libbox import io.nekohasekai.libbox.ProfileContent import io.nekohasekai.sfa.Application @@ -180,11 +178,7 @@ class MainActivity : AbstractActivity(), ServiceConnection.Callback { private fun startIntegration() { lifecycleScope.launch(Dispatchers.IO) { - if (Settings.errorReportingEnabled == Settings.ERROR_REPORTING_UNKNOWN) { - withContext(Dispatchers.Main) { - confirmErrorReportingIntegration() - } - } else if (Settings.checkUpdateEnabled) { + if (Settings.checkUpdateEnabled) { checkUpdate() } } @@ -232,22 +226,6 @@ class MainActivity : AbstractActivity(), ServiceConnection.Callback { } } - private fun confirmErrorReportingIntegration() { - val builder = MaterialAlertDialogBuilder(this).setTitle(getString(R.string.error_reporting)) - .setMessage(R.string.error_reporting_message) - .setPositiveButton(getString(R.string.ok)) { _, _ -> - lifecycleScope.launch(Dispatchers.IO) { - Settings.errorReportingEnabled = Settings.ERROR_REPORTING_ALLOWED - Firebase.crashlytics.setCrashlyticsCollectionEnabled(true) - } - }.setNegativeButton(getString(R.string.no_thanks)) { _, _ -> - lifecycleScope.launch(Dispatchers.IO) { - Settings.errorReportingEnabled = Settings.ERROR_REPORTING_DISALLOWED - } - } - runCatching { builder.show() } - } - @SuppressLint("NewApi") fun startService() { if (!ServiceNotification.checkPermission()) { diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt b/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt index 8159c20..acd5164 100644 --- a/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt +++ b/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt @@ -11,8 +11,6 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.core.view.isGone import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope -import com.google.firebase.crashlytics.ktx.crashlytics -import com.google.firebase.ktx.Firebase import io.nekohasekai.libbox.Libbox import io.nekohasekai.sfa.Application import io.nekohasekai.sfa.R @@ -66,14 +64,6 @@ class SettingsFragment : Fragment() { Settings.checkUpdateEnabled = newValue } } - binding.errorReportingEnabled.addTextChangedListener { - lifecycleScope.launch(Dispatchers.IO) { - val newValue = EnabledType.valueOf(it).boolValue - Settings.errorReportingEnabled = - if (newValue) Settings.ERROR_REPORTING_ALLOWED else Settings.ERROR_REPORTING_DISALLOWED - Firebase.crashlytics.setCrashlyticsCollectionEnabled(newValue) - } - } binding.disableMemoryLimit.addTextChangedListener { lifecycleScope.launch(Dispatchers.IO) { val newValue = EnabledType.valueOf(it).boolValue @@ -115,7 +105,6 @@ class SettingsFragment : Fragment() { (activity.getExternalFilesDir(null) ?: activity.filesDir) .walkTopDown().filter { it.isFile }.map { it.length() }.sum() ) - val errorReportingEnabled = Settings.errorReportingEnabled == Settings.ERROR_REPORTING_ALLOWED val checkUpdateEnabled = Settings.checkUpdateEnabled val removeBackgroundPermissionPage = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Application.powerManager.isIgnoringBatteryOptimizations(Application.application.packageName) @@ -124,8 +113,6 @@ class SettingsFragment : Fragment() { } withContext(Dispatchers.Main) { binding.dataSizeText.text = dataSize - binding.errorReportingEnabled.text = EnabledType.from(errorReportingEnabled).name - binding.errorReportingEnabled.setSimpleItems(R.array.enabled) binding.checkUpdateEnabled.text = EnabledType.from(checkUpdateEnabled).name binding.checkUpdateEnabled.setSimpleItems(R.array.enabled) binding.disableMemoryLimit.text = EnabledType.from(!Settings.disableMemoryLimit).name diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 359b1ed..571922b 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -51,23 +51,6 @@ - - - - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f3b1b72..e0878e7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -83,8 +83,6 @@ Core Data Size Check Update - Error Reporting - Would you like to allow sing to send error reports to developers via Firebase Crashlytics? App Settings About Android client for sing-box, the universal proxy platform. diff --git a/build.gradle b/build.gradle index 4a4020f..416a661 100644 --- a/build.gradle +++ b/build.gradle @@ -2,8 +2,6 @@ buildscript { dependencies { classpath "gradle.plugin.com.betomorrow.gradle:appcenter-plugin:2.0.4" - // https://github.com/invertase/react-native-firebase/issues/6983 - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' } } @@ -12,7 +10,6 @@ plugins { id 'com.android.library' version '8.1.2' apply false id 'org.jetbrains.kotlin.android' version '1.9.0' apply false id 'com.google.devtools.ksp' version '1.9.0-1.0.12' apply false - id 'com.google.gms.google-services' version '4.4.0' apply false id 'com.github.triplet.play' version '3.8.4' apply false }