diff --git a/.gitignore b/.gitignore index 25ed3657..6932dd10 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ build/ user.gradle local.properties .directory +play-services-core/release \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3f174192..b70af530 100644 --- a/build.gradle +++ b/build.gradle @@ -6,13 +6,13 @@ buildscript { ext.safeParcelVersion = '1.6.0' - ext.kotlinVersion = '1.3.72' + ext.kotlinVersion = '1.4.31' ext.coroutineVersion = '1.3.7' ext.annotationVersion = '1.1.0' ext.appcompatVersion = '1.1.0' - ext.fragmentVersion = '1.2.5' - ext.lifecycleVersion = '2.2.0' + ext.fragmentVersion = '1.3.0' + ext.lifecycleVersion = '2.3.0' ext.mediarouterVersion = '1.1.0' ext.navigationVersion = '2.3.0' ext.preferenceVersion = '1.1.1' @@ -35,7 +35,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:4.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion" } diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index 47d7ead1..1ac08ee7 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -37,6 +37,6 @@ dependencies { api project(':play-services-tasks') api project(':play-services-base-api') - implementation "androidx.fragment:fragment:$fragmentVersion" - implementation 'com.google.android.gms:play-services-base:17.5.0' + implementation "androidx.fragment:fragment:${fragmentVersion}" + implementation 'com.google.android.gms:play-services-base:17.6.0' } diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle index 246534d0..02116217 100644 --- a/play-services-basement/build.gradle +++ b/play-services-basement/build.gradle @@ -22,7 +22,7 @@ dependencies { api "org.microg:safe-parcel:1.7.0" implementation "androidx.annotation:annotation:$annotationVersion" - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31' } android { diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index c69867bb..5ea27117 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' dependencies { - implementation 'com.squareup.wire:wire-runtime:3.5.0' + implementation 'com.squareup.wire:wire-runtime:3.6.0' implementation 'de.hdodenhof:circleimageview:3.1.0' implementation "org.microg.gms:conscrypt-gmscore:2.5.1" implementation "androidx.annotation:annotation:$annotationVersion" @@ -38,14 +38,14 @@ dependencies { // AndroidX UI implementation "androidx.appcompat:appcompat:1.2.0" - implementation "androidx.mediarouter:mediarouter:1.2.0" + implementation "androidx.mediarouter:mediarouter:1.2.2" implementation "androidx.preference:preference-ktx:$preferenceVersion" - implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2' - implementation 'androidx.navigation:navigation-ui-ktx:2.3.2' + implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3' + implementation 'androidx.navigation:navigation-ui-ktx:2.3.3' implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion" - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31' implementation project(path: ':play-services-basement') api project(':play-services-location-api') diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 5e323cd7..0f7699b3 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -279,7 +279,6 @@ - - - - + + + + + + + + + + + (PREF_CHECKIN)?.setOnPreferenceClickListener { findNavController().navigate(requireContext(), R.id.openCheckinSettings) true @@ -40,7 +42,7 @@ class SettingsFragment : ResourceSettingsFragment() { findPreference(PREF_ABOUT)?.summary = getString(R.string.about_version_str, AboutFragment.getSelfVersion(context)) findPreference(PREF_CAST_DOUBLE_FIX_ENABLED)?.setOnPreferenceChangeListener { _, newValue -> - context?.packageManager?.setComponentEnabledSetting( + pm?.setComponentEnabledSetting( ComponentName(requireActivity().applicationContext, CastMediaRouteProviderService::class.java), when (newValue) { true -> PackageManager.COMPONENT_ENABLED_STATE_DISABLED @@ -49,6 +51,25 @@ class SettingsFragment : ResourceSettingsFragment() { PackageManager.DONT_KILL_APP) true } + + findPreference(PREF_CAST_HIDE_LAUNCHER_ICON)?.apply { + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { + setOnPreferenceChangeListener { _, newValue -> + pm.setComponentEnabledSetting( + ComponentName.createRelative(requireActivity(), "org.microg.gms.ui.SettingsActivityLauncher"), + when (newValue) { + true -> PackageManager.COMPONENT_ENABLED_STATE_DISABLED + else -> PackageManager.COMPONENT_ENABLED_STATE_ENABLED + }, + PackageManager.DONT_KILL_APP + ) + true + } + } else { + preferenceScreen.removePreference(this) + } + + } } override fun onResume() { @@ -76,6 +97,7 @@ class SettingsFragment : ResourceSettingsFragment() { const val PREF_GCM = "pref_gcm" const val PREF_CHECKIN = "pref_checkin" const val PREF_CAST_DOUBLE_FIX_ENABLED = "pref_cast_double_fix_enabled" + const val PREF_CAST_HIDE_LAUNCHER_ICON = "pref_hide_launcher_icon" const val BRAND_SPOOF_FIX_ENABLED = "brand_spoof_fix_enabled" } diff --git a/play-services-core/src/main/res/drawable/ic_baseline_hide_source_24.xml b/play-services-core/src/main/res/drawable/ic_baseline_hide_source_24.xml new file mode 100644 index 00000000..273167f3 --- /dev/null +++ b/play-services-core/src/main/res/drawable/ic_baseline_hide_source_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index a0d50745..dd79f6a6 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -102,6 +102,7 @@ This can take a couple of minutes." About Vanced microG Cast duplication fix + Hide microG icon in the app launcher Huawei diff --git a/play-services-core/src/main/res/xml/preferences_start.xml b/play-services-core/src/main/res/xml/preferences_start.xml index ee780e76..7ea2cfa3 100755 --- a/play-services-core/src/main/res/xml/preferences_start.xml +++ b/play-services-core/src/main/res/xml/preferences_start.xml @@ -48,6 +48,11 @@ android:icon="@drawable/ic_cast_black" android:summary="@string/pref_cast_double_fix_summary" android:defaultValue="false"/> +