mirror of
https://github.com/SagerNet/sing-box-for-android.git
synced 2025-04-03 20:07:38 +03:00
Remove google services
This commit is contained in:
parent
fb705ed8a4
commit
56a27728b9
9 changed files with 2 additions and 103 deletions
|
@ -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'
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -51,23 +51,6 @@
|
|||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/errorReportingEnabled"
|
||||
style="@style/Widget.Material3.TextInputLayout.FilledBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="@string/error_reporting">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:text="@string/disabled"
|
||||
app:simpleItems="@array/enabled" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
|
|
@ -83,8 +83,6 @@
|
|||
<string name="core">Core</string>
|
||||
<string name="core_data_size">Data Size</string>
|
||||
<string name="check_update">Check Update</string>
|
||||
<string name="error_reporting">Error Reporting</string>
|
||||
<string name="error_reporting_message">Would you like to allow sing to send error reports to developers via Firebase Crashlytics?</string>
|
||||
<string name="title_app_settings">App Settings</string>
|
||||
<string name="about_title">About</string>
|
||||
<string name="app_description">Android client for sing-box, the universal proxy platform.</string>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue