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

Fixed a crash when opening mg from the app info on the pad and clicki… #2572

Closed
Closed
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
3 changes: 3 additions & 0 deletions play-services-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ android {
buildConfigField "String", "RECAPTCHA_ENTERPRISE_PROJECT_ID", "\"${localProperties.get("recaptchaEnterpreise.projectId", "")}\""
buildConfigField "String", "RECAPTCHA_ENTERPRISE_SITE_KEY", "\"${localProperties.get("recaptchaEnterpreise.siteKey", "")}\""
buildConfigField "String", "RECAPTCHA_ENTERPRISE_API_KEY", "\"${localProperties.get("recaptchaEnterpreise.apiKey", "")}\""
buildConfigField "Boolean", "PREFERERENCE_JUMP_NAVIGATION", "false"

ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
Expand Down Expand Up @@ -156,12 +157,14 @@ android {
"huawei" {
dimension 'target'
versionNameSuffix "-hw"
buildConfigField "Boolean", "PREFERERENCE_JUMP_NAVIGATION", "true"
}
"huaweilh" {
dimension 'target'
versionNameSuffix "-lh"
versionCode appVersionCode - 1000
matchingFallbacks = ['huawei']
buildConfigField "Boolean", "PREFERERENCE_JUMP_NAVIGATION", "true"
}
"user" {
dimension 'target'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import com.google.android.gms.BuildConfig
import com.google.android.gms.R
import org.microg.gms.checkin.CheckinPreferences
import org.microg.gms.gcm.GcmDatabase
import org.microg.gms.gcm.GcmPrefs
import org.microg.gms.vending.VendingPreferences
import org.microg.gms.safetynet.SafetyNetPreferences
import org.microg.gms.ui.settings.SettingsProvider
import org.microg.gms.ui.settings.getAllSettingsProviders
Expand All @@ -27,6 +27,13 @@ class SettingsFragment : ResourceSettingsFragment() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
super.onCreatePreferences(savedInstanceState, rootKey)

if(BuildConfig.PREFERERENCE_JUMP_NAVIGATION) {
findPreference<Preference>(PREF_SELF_CHECK)!!.onPreferenceClickListener = Preference.OnPreferenceClickListener {
findNavController().navigate(requireContext(), R.id.openSelfcheck)
true
}
}

findPreference<Preference>(PREF_ACCOUNTS)!!.onPreferenceClickListener = Preference.OnPreferenceClickListener {
findNavController().navigate(requireContext(), R.id.accountManagerFragment)
true
Expand Down Expand Up @@ -135,6 +142,7 @@ class SettingsFragment : ResourceSettingsFragment() {
const val PREF_CHECKIN = "pref_checkin"
const val PREF_VENDING = "pref_vending"
const val PREF_ACCOUNTS = "pref_accounts"
const val PREF_SELF_CHECK = "pref_self_check"
}

init {
Expand Down
1 change: 1 addition & 0 deletions play-services-core/src/main/res/xml/preferences_start.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<PreferenceCategory android:layout="@layout/preference_category_no_label" android:key="prefcat_header">
<Preference
android:icon="@drawable/ic_check_list"
android:key="pref_self_check"
android:summary="@string/self_check_desc"
android:title="@string/self_check_title">
<intent
Expand Down