From 7443020c86411217a89a15617a9a8643ac3de3c5 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 08:54:48 +0400 Subject: [PATCH 01/11] fixed preferences --- .../src/main/res/xml/preferences_account.xml | 0 .../src/main/res/xml/preferences_auth.xml | 6 +-- .../src/main/res/xml/preferences_gcm.xml | 0 .../main/res/xml/preferences_gcm_advanced.xml | 0 .../main/res/xml/preferences_google_more.xml | 0 .../src/main/res/xml/preferences_start.xml | 43 +++++++++---------- 6 files changed, 24 insertions(+), 25 deletions(-) mode change 100644 => 100755 play-services-core/src/main/res/xml/preferences_account.xml mode change 100644 => 100755 play-services-core/src/main/res/xml/preferences_auth.xml mode change 100644 => 100755 play-services-core/src/main/res/xml/preferences_gcm.xml mode change 100644 => 100755 play-services-core/src/main/res/xml/preferences_gcm_advanced.xml mode change 100644 => 100755 play-services-core/src/main/res/xml/preferences_google_more.xml mode change 100644 => 100755 play-services-core/src/main/res/xml/preferences_start.xml diff --git a/play-services-core/src/main/res/xml/preferences_account.xml b/play-services-core/src/main/res/xml/preferences_account.xml old mode 100644 new mode 100755 diff --git a/play-services-core/src/main/res/xml/preferences_auth.xml b/play-services-core/src/main/res/xml/preferences_auth.xml old mode 100644 new mode 100755 index f3d707b1..7ff14e56 --- a/play-services-core/src/main/res/xml/preferences_auth.xml +++ b/play-services-core/src/main/res/xml/preferences_auth.xml @@ -18,16 +18,16 @@ - + - + - + diff --git a/play-services-core/src/main/res/xml/preferences_gcm.xml b/play-services-core/src/main/res/xml/preferences_gcm.xml old mode 100644 new mode 100755 diff --git a/play-services-core/src/main/res/xml/preferences_gcm_advanced.xml b/play-services-core/src/main/res/xml/preferences_gcm_advanced.xml old mode 100644 new mode 100755 diff --git a/play-services-core/src/main/res/xml/preferences_google_more.xml b/play-services-core/src/main/res/xml/preferences_google_more.xml old mode 100644 new mode 100755 diff --git a/play-services-core/src/main/res/xml/preferences_start.xml b/play-services-core/src/main/res/xml/preferences_start.xml old mode 100644 new mode 100755 index c08f2f62..9501282c --- a/play-services-core/src/main/res/xml/preferences_start.xml +++ b/play-services-core/src/main/res/xml/preferences_start.xml @@ -14,40 +14,39 @@ ~ limitations under the License. --> - + - - - + + - - - + + android:title="@string/service_name_mcs" /> + - + android:targetClass="org.microg.gms.ui.GoogleMoreFragment$AsActivity" + android:targetPackage="com.mgoogle.android.gms" /> + - - + - - + android:title="@string/pref_about_title" /> From e19000db170eacce4167e4fb7206927f3b337302 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 09:08:17 +0400 Subject: [PATCH 02/11] fixed missing resources --- .../src/main/res/drawable/dots_horizontal.xml | 14 ++++++++++++++ .../src/main/res/drawable/ic_info_outline.xml | 17 +++++++++++++++++ .../res/layout/preference_category_no_label.xml | 9 +++++++++ .../src/main/res/values-de/strings.xml | 1 + .../src/main/res/values-fr/strings.xml | 1 + .../src/main/res/values-it/strings.xml | 1 + .../src/main/res/values-pl/strings.xml | 1 + .../src/main/res/values-ru/strings.xml | 1 + .../src/main/res/values-uk/strings.xml | 1 + .../src/main/res/values/strings.xml | 1 + 10 files changed, 47 insertions(+) create mode 100755 play-services-core/src/main/res/drawable/dots_horizontal.xml create mode 100755 play-services-core/src/main/res/drawable/ic_info_outline.xml create mode 100755 play-services-core/src/main/res/layout/preference_category_no_label.xml diff --git a/play-services-core/src/main/res/drawable/dots_horizontal.xml b/play-services-core/src/main/res/drawable/dots_horizontal.xml new file mode 100755 index 00000000..4110aed7 --- /dev/null +++ b/play-services-core/src/main/res/drawable/dots_horizontal.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/play-services-core/src/main/res/drawable/ic_info_outline.xml b/play-services-core/src/main/res/drawable/ic_info_outline.xml new file mode 100755 index 00000000..8e049cce --- /dev/null +++ b/play-services-core/src/main/res/drawable/ic_info_outline.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/play-services-core/src/main/res/layout/preference_category_no_label.xml b/play-services-core/src/main/res/layout/preference_category_no_label.xml new file mode 100755 index 00000000..31b8b654 --- /dev/null +++ b/play-services-core/src/main/res/layout/preference_category_no_label.xml @@ -0,0 +1,9 @@ + + + + diff --git a/play-services-core/src/main/res/values-de/strings.xml b/play-services-core/src/main/res/values-de/strings.xml index 50206420..1b5a120e 100755 --- a/play-services-core/src/main/res/values-de/strings.xml +++ b/play-services-core/src/main/res/values-de/strings.xml @@ -70,6 +70,7 @@ Dies kann einige Minuten dauern." Infos Google-Dienste + Mehr Batterieoptimierung aktiv Google Cloud Messaging ist aktiv aber Batterieoptimierungen wurden für microG nicht deaktiviert. Damit Push-Nachrichten zugestellt werden können, muss Batterieoptimierung deaktiviert werden. diff --git a/play-services-core/src/main/res/values-fr/strings.xml b/play-services-core/src/main/res/values-fr/strings.xml index 8ed002af..2c0b402e 100755 --- a/play-services-core/src/main/res/values-fr/strings.xml +++ b/play-services-core/src/main/res/values-fr/strings.xml @@ -69,6 +69,7 @@ Ceci peut prendre plusieurs minutes." À propos Services Google + Plus Optimisations de la batterie activées Vous avez activé Google Cloud Messaging mais l’optimisation de la batterie est activée pour microG Services Core. Afin de recevoir les notifications push vous devriez désactiver les optimisations de la batterie. diff --git a/play-services-core/src/main/res/values-it/strings.xml b/play-services-core/src/main/res/values-it/strings.xml index eb179ddd..60fe63e3 100755 --- a/play-services-core/src/main/res/values-it/strings.xml +++ b/play-services-core/src/main/res/values-it/strings.xml @@ -77,6 +77,7 @@ Questa operazione può richiedere alcuni minuti." Informazioni Servizi Google + Impostazioni avanzate Ottimizzazioni della batteria abilitate Hai abilitato il servizio di messaggistica cloud di Google, tuttavia le ottimizzazioni della batteria sono abilitate per microG. Al fine di garantire la ricezione delle notisfiche push, dovresti slezionare l\'opzione per ignorare le ottimizzazioni della batteria. diff --git a/play-services-core/src/main/res/values-pl/strings.xml b/play-services-core/src/main/res/values-pl/strings.xml index 52a6ef93..b28f2e85 100755 --- a/play-services-core/src/main/res/values-pl/strings.xml +++ b/play-services-core/src/main/res/values-pl/strings.xml @@ -69,6 +69,7 @@ To zajmie kilka minut. O programie Usługi Google + Więcej Optymalizacja baterii włączona Aktywowałeś usługę Google Cloud Messaging, ale optymalizacja baterii dla usługi microG jest włączona. Aby powiadomienia ‘push’ działały, powinieneś wyłączyć optymalizację baterii dla microG. diff --git a/play-services-core/src/main/res/values-ru/strings.xml b/play-services-core/src/main/res/values-ru/strings.xml index 3132606e..9ceaa714 100755 --- a/play-services-core/src/main/res/values-ru/strings.xml +++ b/play-services-core/src/main/res/values-ru/strings.xml @@ -77,6 +77,7 @@ О программе Google сервисы + Ещё Активна оптимизация энергопотребления Вы включили Google Cloud Messaging, но у вас активна оптимизация энергопотребления для microG Services Core. Чтобы получать push-уведомления вам необходимо разрешить приложению работать в фоновом режиме. diff --git a/play-services-core/src/main/res/values-uk/strings.xml b/play-services-core/src/main/res/values-uk/strings.xml index e1fc3fa0..dac8e22e 100755 --- a/play-services-core/src/main/res/values-uk/strings.xml +++ b/play-services-core/src/main/res/values-uk/strings.xml @@ -76,6 +76,7 @@ Про Сервіси Google + Додатково Увімкнута оптимізація енергоспоживання Ви увімкнули Google Cloud Messaging але лиши оптимізацію енергоспоживання активним для microG Services Core. Аби отримувати push-сповіщення необхідно вимкнути оптимізацію енергоспоживання. diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index 6f752299..e3c599bd 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -79,6 +79,7 @@ This can take a couple of minutes." About Google Services + More Battery optimizations enabled You enabled Google Cloud Messaging but have battery optimizations active for microG Services Core. For push notifications to arrive you should ignore battery optimizations. From d5ec9f8e7bc5a3268242dc0a35c726ed6e28ff0e Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 09:33:53 +0400 Subject: [PATCH 03/11] fixed kotlin file detection --- play-services-core/build.gradle | 5 +- ...hBar.kt => PreferenceSwitchBarCallback.kt} | 0 .../layout/device_registration_fragment.xml | 41 ++++++++++ .../main/res/layout/preference_switch_bar.xml | 73 +++++++++++++++++ .../layout/push_notification_app_fragment.xml | 82 +++++++++++++++++++ .../res/layout/push_notification_fragment.xml | 45 ++++++++++ 6 files changed, 244 insertions(+), 2 deletions(-) rename play-services-core/src/main/kotlin/org/microg/gms/ui/{PreferenceSwitchBar.kt => PreferenceSwitchBarCallback.kt} (100%) create mode 100755 play-services-core/src/main/res/layout/device_registration_fragment.xml create mode 100755 play-services-core/src/main/res/layout/preference_switch_bar.xml create mode 100755 play-services-core/src/main/res/layout/push_notification_app_fragment.xml create mode 100755 play-services-core/src/main/res/layout/push_notification_fragment.xml diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 4b1bfdc4..d647d6f7 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -15,6 +15,8 @@ */ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' dependencies { implementation "com.squareup.wire:wire-runtime:1.6.1" @@ -55,8 +57,6 @@ android { minSdkVersion androidMinSdk targetSdkVersion androidTargetSdk - multiDexEnabled true - ndk { abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" } @@ -70,6 +70,7 @@ android { sourceSets { main { java.srcDirs += 'src/main/protos-java' + java.srcDirs += 'src/main/kotlin' } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PreferenceSwitchBar.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PreferenceSwitchBarCallback.kt similarity index 100% rename from play-services-core/src/main/kotlin/org/microg/gms/ui/PreferenceSwitchBar.kt rename to play-services-core/src/main/kotlin/org/microg/gms/ui/PreferenceSwitchBarCallback.kt diff --git a/play-services-core/src/main/res/layout/device_registration_fragment.xml b/play-services-core/src/main/res/layout/device_registration_fragment.xml new file mode 100755 index 00000000..0f0648dc --- /dev/null +++ b/play-services-core/src/main/res/layout/device_registration_fragment.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + diff --git a/play-services-core/src/main/res/layout/preference_switch_bar.xml b/play-services-core/src/main/res/layout/preference_switch_bar.xml new file mode 100755 index 00000000..08ad6530 --- /dev/null +++ b/play-services-core/src/main/res/layout/preference_switch_bar.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/play-services-core/src/main/res/layout/push_notification_app_fragment.xml b/play-services-core/src/main/res/layout/push_notification_app_fragment.xml new file mode 100755 index 00000000..4f63f961 --- /dev/null +++ b/play-services-core/src/main/res/layout/push_notification_app_fragment.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/play-services-core/src/main/res/layout/push_notification_fragment.xml b/play-services-core/src/main/res/layout/push_notification_fragment.xml new file mode 100755 index 00000000..e9611b83 --- /dev/null +++ b/play-services-core/src/main/res/layout/push_notification_fragment.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + From 7cf14ca4010c25d70c721f6e77b4173296a43f74 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 09:47:50 +0400 Subject: [PATCH 04/11] fixed missing dependencies --- play-services-core/build.gradle | 6 ++ .../microg/gms/provision/ProvisionService.kt | 0 .../org/microg/gms/ui/AppIconPreference.kt | 0 .../gms/ui/DeviceRegistrationFragment.kt | 4 +- .../DeviceRegistrationPreferencesFragment.kt | 2 +- .../gms/ui/PreferenceSwitchBarCallback.kt | 0 .../gms/ui/PushNotificationAllAppsFragment.kt | 2 +- .../gms/ui/PushNotificationAppFragment.kt | 4 +- .../PushNotificationAppPreferencesFragment.kt | 2 +- .../microg/gms/ui/PushNotificationFragment.kt | 4 +- .../ui/PushNotificationPreferencesFragment.kt | 2 +- .../org/microg/gms/ui/SafetyNetFragment.kt | 61 ------------------- .../gms/ui/SafetyNetPreferencesFragment.kt | 17 ------ 13 files changed, 16 insertions(+), 88 deletions(-) mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/AppIconPreference.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/PreferenceSwitchBarCallback.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppPreferencesFragment.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt mode change 100644 => 100755 play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationPreferencesFragment.kt delete mode 100644 play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetFragment.kt delete mode 100644 play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetPreferencesFragment.kt diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index d647d6f7..d5e969d8 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -42,8 +42,14 @@ dependencies { implementation "androidx.appcompat:appcompat:$appcompatVersion" implementation "androidx.mediarouter:mediarouter:$mediarouterVersion" implementation "androidx.preference:preference:$preferenceVersion" + implementation "androidx.navigation:navigation-fragment:$navigationVersion" implementation "androidx.navigation:navigation-ui:$navigationVersion" + implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion" + implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion" + + implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" } android { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt b/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt old mode 100644 new mode 100755 diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/AppIconPreference.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/AppIconPreference.kt old mode 100644 new mode 100755 diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt old mode 100644 new mode 100755 index 5cece629..74c4eb9b --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt @@ -11,8 +11,8 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope -import com.google.android.gms.R -import com.google.android.gms.databinding.DeviceRegistrationFragmentBinding +import com.mgoogle.android.gms.R +import com.mgoogle.android.gms.databinding.DeviceRegistrationFragmentBinding import org.microg.gms.checkin.CheckinPrefs class DeviceRegistrationFragment : Fragment(R.layout.device_registration_fragment) { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt old mode 100644 new mode 100755 index b1f53234..64a486ae --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt @@ -11,7 +11,7 @@ import android.text.format.DateUtils import androidx.preference.Preference import androidx.preference.PreferenceCategory import androidx.preference.PreferenceFragmentCompat -import com.google.android.gms.R +import com.mgoogle.android.gms.R import org.microg.gms.checkin.CheckinPrefs import org.microg.gms.checkin.LastCheckinInfo diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PreferenceSwitchBarCallback.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PreferenceSwitchBarCallback.kt old mode 100644 new mode 100755 diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt old mode 100644 new mode 100755 index a55b007d..712ea417 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt @@ -14,7 +14,7 @@ import androidx.navigation.fragment.findNavController import androidx.preference.Preference import androidx.preference.PreferenceCategory import androidx.preference.PreferenceFragmentCompat -import com.google.android.gms.R +import com.mgoogle.android.gms.R import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.microg.gms.gcm.GcmDatabase diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt old mode 100644 new mode 100755 index 5699ec07..818ed177 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt @@ -17,8 +17,8 @@ import androidx.appcompat.content.res.AppCompatResources import androidx.fragment.app.Fragment import androidx.fragment.app.findFragment import androidx.lifecycle.lifecycleScope -import com.google.android.gms.R -import com.google.android.gms.databinding.PushNotificationAppFragmentBinding +import com.mgoogle.android.gms.R +import com.mgoogle.android.gms.databinding.PushNotificationAppFragmentBinding class PushNotificationAppFragment : Fragment(R.layout.push_notification_fragment) { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppPreferencesFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppPreferencesFragment.kt old mode 100644 new mode 100755 index b327349e..1c9ad6c0 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppPreferencesFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppPreferencesFragment.kt @@ -13,7 +13,7 @@ import androidx.preference.Preference import androidx.preference.PreferenceCategory import androidx.preference.PreferenceFragmentCompat import androidx.preference.TwoStatePreference -import com.google.android.gms.R +import com.mgoogle.android.gms.R import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.microg.gms.gcm.GcmDatabase diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt old mode 100644 new mode 100755 index 6345c62b..d89f7d58 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt @@ -9,8 +9,8 @@ import android.view.* import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController -import com.google.android.gms.R -import com.google.android.gms.databinding.PushNotificationFragmentBinding +import com.mgoogle.android.gms.R +import com.mgoogle.android.gms.databinding.PushNotificationFragmentBinding import org.microg.gms.checkin.CheckinPrefs import org.microg.gms.gcm.GcmPrefs diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationPreferencesFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationPreferencesFragment.kt old mode 100644 new mode 100755 index 9021ffb5..a28c28bf --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationPreferencesFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationPreferencesFragment.kt @@ -14,7 +14,7 @@ import androidx.navigation.fragment.findNavController import androidx.preference.Preference import androidx.preference.PreferenceCategory import androidx.preference.PreferenceFragmentCompat -import com.google.android.gms.R +import com.mgoogle.android.gms.R import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.microg.gms.gcm.GcmDatabase diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetFragment.kt deleted file mode 100644 index b611a1ac..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetFragment.kt +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.ui - -import android.os.Bundle -import android.view.* -import androidx.fragment.app.Fragment -import androidx.navigation.fragment.findNavController -import com.google.android.gms.R -import com.google.android.gms.databinding.SafetyNetFragmentBinding -import org.microg.gms.checkin.CheckinPrefs -import org.microg.gms.snet.SafetyNetPrefs - -class SafetyNetFragment : Fragment(R.layout.safety_net_fragment) { - - private lateinit var binding: SafetyNetFragmentBinding - - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - binding = SafetyNetFragmentBinding.inflate(inflater, container, false) - binding.switchBarCallback = object : PreferenceSwitchBarCallback { - override fun onChecked(newStatus: Boolean) { - SafetyNetPrefs.get(requireContext()).isEnabled = newStatus - binding.safetynetEnabled = newStatus - } - } - return binding.root - } - - override fun onResume() { - super.onResume() - binding.checkinEnabled = CheckinPrefs.get(requireContext()).isEnabled - binding.safetynetEnabled = SafetyNetPrefs.get(requireContext()).isEnabled - } - - override fun onActivityCreated(savedInstanceState: Bundle?) { - super.onActivityCreated(savedInstanceState) - setHasOptionsMenu(true) - } - - override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { - menu.add(0, MENU_ADVANCED, 0, R.string.menu_advanced) - super.onCreateOptionsMenu(menu, inflater) - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - MENU_ADVANCED -> { - findNavController().navigate(R.id.openSafetyNetAdvancedSettings) - true - } - else -> super.onOptionsItemSelected(item) - } - } - - companion object { - private const val MENU_ADVANCED = Menu.FIRST - } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetPreferencesFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetPreferencesFragment.kt deleted file mode 100644 index 2a4b4ab2..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/SafetyNetPreferencesFragment.kt +++ /dev/null @@ -1,17 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.ui - -import android.os.Bundle -import androidx.preference.PreferenceFragmentCompat -import com.google.android.gms.R - -class SafetyNetPreferencesFragment : PreferenceFragmentCompat() { - - override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { - addPreferencesFromResource(R.xml.preferences_safetynet) - } -} From 9f08f8cc159226136ab73472cac7aa42a8eb1e7b Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 10:07:45 +0400 Subject: [PATCH 05/11] fixed missing resources --- .../microg/gms/provision/ProvisionService.kt | 2 - .../src/main/res/values-de/strings.xml | 2 + .../src/main/res/values-fr/strings.xml | 2 + .../src/main/res/values-it/strings.xml | 3 +- .../src/main/res/values-pt-rBR/strings.xml | 2 + .../src/main/res/values/strings.xml | 5 +++ .../xml/preferences_device_registration.xml | 24 +++++++++++ .../xml/preferences_push_notifications.xml | 40 +++++++++++++++++ ...references_push_notifications_all_apps.xml | 39 +++++++++++++++++ .../preferences_push_notifications_app.xml | 43 +++++++++++++++++++ 10 files changed, 159 insertions(+), 3 deletions(-) create mode 100755 play-services-core/src/main/res/xml/preferences_device_registration.xml create mode 100755 play-services-core/src/main/res/xml/preferences_push_notifications.xml create mode 100755 play-services-core/src/main/res/xml/preferences_push_notifications_all_apps.xml create mode 100755 play-services-core/src/main/res/xml/preferences_push_notifications_app.xml diff --git a/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt b/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt index 9cfd43c1..4fff1603 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt @@ -14,7 +14,6 @@ import androidx.lifecycle.lifecycleScope import kotlinx.coroutines.delay import org.microg.gms.checkin.CheckinPrefs import org.microg.gms.gcm.GcmPrefs -import org.microg.gms.snet.SafetyNetPrefs class ProvisionService : LifecycleService() { private fun Bundle.getBooleanOrNull(key: String): Boolean? { @@ -31,7 +30,6 @@ class ProvisionService : LifecycleService() { intent?.extras?.getBooleanOrNull("checkin_enabled")?.let { CheckinPrefs.setEnabled(this@ProvisionService, it) } intent?.extras?.getBooleanOrNull("gcm_enabled")?.let { GcmPrefs.setEnabled(this@ProvisionService, it) } - intent?.extras?.getBooleanOrNull("safetynet_enabled")?.let { SafetyNetPrefs.get(this@ProvisionService).isEnabled = it } // What else? delay(2 * 1000) // Wait 2 seconds to give provisioning some extra time diff --git a/play-services-core/src/main/res/values-de/strings.xml b/play-services-core/src/main/res/values-de/strings.xml index 1b5a120e..e30f6e9b 100755 --- a/play-services-core/src/main/res/values-de/strings.xml +++ b/play-services-core/src/main/res/values-de/strings.xml @@ -101,6 +101,8 @@ Dies kann einige Minuten dauern." Einige Apps registrieren sich nicht automatisch erneut und haben keine Möglichkeit dies manuell anzustoßen. Diese Apps funktionieren eventuell nach dem abmelden nicht mehr richtig.\nFortsetzen? Du hast einer App die Erlaubnis der Registrierung entzogen, die bereits registriert ist.\nWillst du diese App jetzt auch abmelden damit sie zukünftig keine Push-Nachrichten erhält? Nachrichten: %1$d (%2$d bytes) + Nicht verbunden + Verbunden seit %1$s offizieller Server Dritt-Server diff --git a/play-services-core/src/main/res/values-fr/strings.xml b/play-services-core/src/main/res/values-fr/strings.xml index 2c0b402e..c7422cd2 100755 --- a/play-services-core/src/main/res/values-fr/strings.xml +++ b/play-services-core/src/main/res/values-fr/strings.xml @@ -99,5 +99,7 @@ Ceci peut prendre plusieurs minutes." Certaines applications ne se réenregistrent pas et/ou ne fournisse pas de moyens de le faire manuellement. Ces applications peuvent ne plus fonctionner correctement après le désenregistrement.\nContinuer ? Vous avez empêché une application déjà enregistrée de s’enregistrer pour recevoir des notifications push.\nVoulez-vous la désenregistrer maintenant pour qu’elle ne reçoive plus de notifications push à l’avenir ? Messages : %1$d (%2$d octets) + Déconnecté + Connecté depuis %1$s diff --git a/play-services-core/src/main/res/values-it/strings.xml b/play-services-core/src/main/res/values-it/strings.xml index 60fe63e3..994a92dd 100755 --- a/play-services-core/src/main/res/values-it/strings.xml +++ b/play-services-core/src/main/res/values-it/strings.xml @@ -111,7 +111,8 @@ Questa operazione può richiedere alcuni minuti." Alcune applicazioni non rinnovano automaticamente la registrazione e/o non forniscono un\'opzione per farlo manualmente. Queste applicazioni potrebbero non funzionare correttamente a seguito della de-registrazione.\nContinuare? Hai negato ad una applicazione già registrata di registrarsi alle notifiche push.\nDesideri de-registrarla così che non riceva più notifiche push in futuro? Messaggi: %1$d (%2$d bytes) - + Disconnesso + Connesso da %1$s Server ufficiale Server di terze parti Certificato auto-firmato diff --git a/play-services-core/src/main/res/values-pt-rBR/strings.xml b/play-services-core/src/main/res/values-pt-rBR/strings.xml index bbfbf676..9f8d406c 100755 --- a/play-services-core/src/main/res/values-pt-rBR/strings.xml +++ b/play-services-core/src/main/res/values-pt-rBR/strings.xml @@ -88,5 +88,7 @@ Isso pode demorar alguns minutos." Algumas aplicações não registam automaticamente e/ou não fornecem uma opção para fazê-lo manualmente. Esses aplicativos podem não funcionar corretamente após o cancelamento do registro.\nContinuar? Você negou um app para se registrar para notificações push que já está registrado.\nDeseja cancelar o registo agora para que não receba mensagens de envio no futuro? Mensagens: %1$d (%2$d bytes) + Desconectado + Conectado desde %1$s diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index e3c599bd..3bad8f82 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -81,6 +81,9 @@ This can take a couple of minutes." Google Services More + Not registered + Last registration: %1$s + Battery optimizations enabled You enabled Google Cloud Messaging but have battery optimizations active for microG Services Core. For push notifications to arrive you should ignore battery optimizations. Ignore optimizations @@ -113,6 +116,8 @@ This can take a couple of minutes." Some apps do not automatically re-register and/or do not provide an option to do so manually. These apps might not work correctly after unregistering.\nContinue? You denied an app to register for push notifications that is already registered.\nDo you want to unregister it now so it does not receive push messages in the future? Messages: %1$d (%2$d bytes) + Disconnected + Connected since %1$s Networks to use for push notifications diff --git a/play-services-core/src/main/res/xml/preferences_device_registration.xml b/play-services-core/src/main/res/xml/preferences_device_registration.xml new file mode 100755 index 00000000..92c2023f --- /dev/null +++ b/play-services-core/src/main/res/xml/preferences_device_registration.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/play-services-core/src/main/res/xml/preferences_push_notifications.xml b/play-services-core/src/main/res/xml/preferences_push_notifications.xml new file mode 100755 index 00000000..e9384ea5 --- /dev/null +++ b/play-services-core/src/main/res/xml/preferences_push_notifications.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + diff --git a/play-services-core/src/main/res/xml/preferences_push_notifications_all_apps.xml b/play-services-core/src/main/res/xml/preferences_push_notifications_all_apps.xml new file mode 100755 index 00000000..9a93c8db --- /dev/null +++ b/play-services-core/src/main/res/xml/preferences_push_notifications_all_apps.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + diff --git a/play-services-core/src/main/res/xml/preferences_push_notifications_app.xml b/play-services-core/src/main/res/xml/preferences_push_notifications_app.xml new file mode 100755 index 00000000..907fd211 --- /dev/null +++ b/play-services-core/src/main/res/xml/preferences_push_notifications_app.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + From b7e69df6ffde56c13d7e5b99322035b4a53a4e1a Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 10:17:03 +0400 Subject: [PATCH 06/11] added strings --- .../src/main/res/drawable/ic_expand_apps.xml | 19 +++++++++++++++++++ .../res/layout/preference_progress_bar.xml | 17 +++++++++++++++++ .../src/main/res/values/strings.xml | 9 +++++++++ 3 files changed, 45 insertions(+) create mode 100755 play-services-core/src/main/res/drawable/ic_expand_apps.xml create mode 100755 play-services-core/src/main/res/layout/preference_progress_bar.xml diff --git a/play-services-core/src/main/res/drawable/ic_expand_apps.xml b/play-services-core/src/main/res/drawable/ic_expand_apps.xml new file mode 100755 index 00000000..20634f05 --- /dev/null +++ b/play-services-core/src/main/res/drawable/ic_expand_apps.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/play-services-core/src/main/res/layout/preference_progress_bar.xml b/play-services-core/src/main/res/layout/preference_progress_bar.xml new file mode 100755 index 00000000..bd0eb7e0 --- /dev/null +++ b/play-services-core/src/main/res/layout/preference_progress_bar.xml @@ -0,0 +1,17 @@ + + + + + + + diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index 3bad8f82..3abc24bf 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -121,6 +121,15 @@ This can take a couple of minutes." Networks to use for push notifications + Allow registration + Allow the app to register for push notifications. + Start app on push message + Start the app while in background to receive the incoming push messages. + Apps using push notifications + Registered apps + Unregistered apps + Networks to use for push notifications + official server third-party server self-signed certificate From 40e3bdb814675a9100cf9e201cc61d235ca86870 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 10:24:57 +0400 Subject: [PATCH 07/11] fixed string duplication --- play-services-core/src/main/res/values/strings.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index 3abc24bf..195e9044 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -119,8 +119,6 @@ This can take a couple of minutes." Disconnected Connected since %1$s - Networks to use for push notifications - Allow registration Allow the app to register for push notifications. Start app on push message From 872739e449ba3bc5d133af610b4dba264533744a Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 10:34:29 +0400 Subject: [PATCH 08/11] added more missing strings --- play-services-core/src/main/res/values/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index 195e9044..98fbb870 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -62,6 +62,7 @@ This can take a couple of minutes." Advanced None + See all Mobile network Wi-Fi @@ -106,6 +107,9 @@ This can take a couple of minutes." About Vanced microG + Registers your device to Google services and creates a unique device identifier. Vanced microG strips identifying bits other than your Google account name from registration data. + Status + Unregister Not registered No messages received so far From fc2b5d419e691082743725b1094a1ccb58ee15db Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 29 Jul 2020 11:00:23 +0400 Subject: [PATCH 09/11] possible fix of attribute parsing --- .../src/main/res/layout/preference_switch_bar.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-services-core/src/main/res/layout/preference_switch_bar.xml b/play-services-core/src/main/res/layout/preference_switch_bar.xml index 08ad6530..b9bcfe13 100755 --- a/play-services-core/src/main/res/layout/preference_switch_bar.xml +++ b/play-services-core/src/main/res/layout/preference_switch_bar.xml @@ -39,7 +39,7 @@ android:paddingLeft="?attr/listPreferredItemPaddingLeft" android:paddingEnd="?attr/listPreferredItemPaddingEnd" android:paddingRight="?attr/listPreferredItemPaddingRight" - app:backgroundColorAttr="@{checked ? androidx.appcompat.R.attr.colorControlActivated : (enabled ? androidx.appcompat.R.attr.colorButtonNormal : androidx.appcompat.R.attr.colorControlHighlight)}" + app:backgroundColorAttr="@{checked ? android.R.attr.colorControlActivated : (enabled ? android.R.attr.colorButtonNormal : android.R.attr.colorControlHighlight)}" tools:background="?attr/colorControlActivated"> Date: Wed, 29 Jul 2020 11:09:07 +0400 Subject: [PATCH 10/11] fixed attribute --- .../src/main/res/layout/preference_switch_bar.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-services-core/src/main/res/layout/preference_switch_bar.xml b/play-services-core/src/main/res/layout/preference_switch_bar.xml index b9bcfe13..f5146da0 100755 --- a/play-services-core/src/main/res/layout/preference_switch_bar.xml +++ b/play-services-core/src/main/res/layout/preference_switch_bar.xml @@ -39,7 +39,7 @@ android:paddingLeft="?attr/listPreferredItemPaddingLeft" android:paddingEnd="?attr/listPreferredItemPaddingEnd" android:paddingRight="?attr/listPreferredItemPaddingRight" - app:backgroundColorAttr="@{checked ? android.R.attr.colorControlActivated : (enabled ? android.R.attr.colorButtonNormal : android.R.attr.colorControlHighlight)}" + app:backgroundColor="@{checked ? android.R.attr.colorControlActivated : (enabled ? android.R.attr.colorButtonNormal : android.R.attr.colorControlHighlight)}" tools:background="?attr/colorControlActivated"> Date: Wed, 29 Jul 2020 11:42:10 +0400 Subject: [PATCH 11/11] bumped up version code --- build.gradle | 2 +- .../src/main/res/layout/preference_switch_bar.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 11d45680..1af97c5d 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ allprojects { group = 'org.microg.gms' version = "0.2.11.202414-vanced" - ext.appVersionCode = 194301000 + ext.appVersionCode = 21124414 ext.isReleaseVersion = false } diff --git a/play-services-core/src/main/res/layout/preference_switch_bar.xml b/play-services-core/src/main/res/layout/preference_switch_bar.xml index f5146da0..d14e81d9 100755 --- a/play-services-core/src/main/res/layout/preference_switch_bar.xml +++ b/play-services-core/src/main/res/layout/preference_switch_bar.xml @@ -39,7 +39,7 @@ android:paddingLeft="?attr/listPreferredItemPaddingLeft" android:paddingEnd="?attr/listPreferredItemPaddingEnd" android:paddingRight="?attr/listPreferredItemPaddingRight" - app:backgroundColor="@{checked ? android.R.attr.colorControlActivated : (enabled ? android.R.attr.colorButtonNormal : android.R.attr.colorControlHighlight)}" + android:background="@{checked ? android.R.attr.colorControlActivated : (enabled ? android.R.attr.colorButtonNormal : android.R.attr.colorControlHighlight)}" tools:background="?attr/colorControlActivated">