From 1e233f01b40e5a106171efc7e95945ee1d8dd7a5 Mon Sep 17 00:00:00 2001
From: Oizaro <45825534+Oizaro@users.noreply.github.com>
Date: Sat, 22 Aug 2020 22:41:18 +0200
Subject: [PATCH 1/3] Update dependencies
---
build.gradle | 2 +-
play-services-base/build.gradle | 2 +-
play-services-basement/build.gradle | 2 +-
play-services-core/build.gradle | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/build.gradle b/build.gradle
index a3beae8d..5a46b66f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -50,7 +50,7 @@ allprojects {
group = 'org.microg.gms'
version = "0.2.11.202414-vanced"
- ext.appVersionCode = 202414023
+ ext.appVersionCode = 202414022
ext.isReleaseVersion = false
}
diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle
index f26a4e11..67a6c3a9 100644
--- a/play-services-base/build.gradle
+++ b/play-services-base/build.gradle
@@ -38,5 +38,5 @@ dependencies {
api project(':play-services-base-api')
implementation "androidx.fragment:fragment:$fragmentVersion"
- implementation "com.google.android.gms:play-services-base:17.3.0"
+ implementation 'com.google.android.gms:play-services-base:17.4.0'
}
diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle
index 474bebb1..42bff19a 100644
--- a/play-services-basement/build.gradle
+++ b/play-services-basement/build.gradle
@@ -22,7 +22,7 @@ dependencies {
api "org.microg:safe-parcel:$safeParcelVersion"
implementation "androidx.annotation:annotation:$annotationVersion"
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.0"
}
android {
diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle
index c8cc35b4..3cac2285 100644
--- a/play-services-core/build.gradle
+++ b/play-services-core/build.gradle
@@ -47,7 +47,7 @@ dependencies {
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"
implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion"
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.0"
implementation project(path: ':play-services-basement')
}
From 8703fb313860b62a75cb6f41d6bf78610ec305b4 Mon Sep 17 00:00:00 2001
From: Oizaro <45825534+Oizaro@users.noreply.github.com>
Date: Sun, 23 Aug 2020 21:11:58 +0200
Subject: [PATCH 2/3] Make notification translatable
---
play-services-base-core/build.gradle | 28 -------------------
.../src/main/AndroidManifest.xml | 9 ------
play-services-core/build.gradle | 1 -
.../microg/gms/AbstractGmsServiceBroker.java | 0
.../main/java/org/microg/gms/BaseService.java | 0
.../org/microg/gms/ChimeraSpoofProvider.java | 0
.../java/org/microg/gms/DummyService.java | 0
.../java/org/microg/gms/common/Build.java | 0
.../gms/common/DeviceConfiguration.java | 0
.../microg/gms/common/DeviceIdentifier.java | 0
.../gms/common/ForegroundServiceContext.java | 9 +++---
.../org/microg/gms/common/HttpFormClient.java | 0
.../microg/gms/common/MultiListenerProxy.java | 0
.../org/microg/gms/common/NonCancelToken.java | 0
.../org/microg/gms/common/PackageUtils.java | 0
.../java/org/microg/gms/common/PhoneInfo.java | 0
.../gms/common/RemoteListenerProxy.java | 0
.../java/org/microg/gms/common/Utils.java | 0
.../drawable/ic_foreground_notification.xml | 0
.../src/main/res/values-it/strings.xml | 5 ++++
.../src/main/res/values/strings.xml | 4 +++
settings.gradle | 2 --
22 files changed, 14 insertions(+), 44 deletions(-)
delete mode 100644 play-services-base-core/build.gradle
delete mode 100644 play-services-base-core/src/main/AndroidManifest.xml
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/BaseService.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/ChimeraSpoofProvider.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/DummyService.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/Build.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/DeviceConfiguration.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/DeviceIdentifier.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/ForegroundServiceContext.java (89%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/HttpFormClient.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/MultiListenerProxy.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/NonCancelToken.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/PackageUtils.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/PhoneInfo.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/RemoteListenerProxy.java (100%)
rename {play-services-base-core => play-services-core}/src/main/java/org/microg/gms/common/Utils.java (100%)
rename {play-services-base-core => play-services-core}/src/main/res/drawable/ic_foreground_notification.xml (100%)
diff --git a/play-services-base-core/build.gradle b/play-services-base-core/build.gradle
deleted file mode 100644
index a534bc64..00000000
--- a/play-services-base-core/build.gradle
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2020, microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- */
-
-apply plugin: 'com.android.library'
-
-dependencies {
- api project(':play-services-basement')
-
- implementation "androidx.annotation:annotation:$annotationVersion"
-}
-
-android {
- compileSdkVersion androidCompileSdk
- buildToolsVersion "$androidBuildVersionTools"
-
- defaultConfig {
- versionName version
- minSdkVersion androidMinSdk
- targetSdkVersion androidTargetSdk
- }
-
- compileOptions {
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- }
-}
diff --git a/play-services-base-core/src/main/AndroidManifest.xml b/play-services-base-core/src/main/AndroidManifest.xml
deleted file mode 100644
index 13255d7c..00000000
--- a/play-services-base-core/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle
index 3cac2285..aa79268c 100644
--- a/play-services-core/build.gradle
+++ b/play-services-core/build.gradle
@@ -30,7 +30,6 @@ dependencies {
// Specified manually due to
// https://github.com/vitalidze/chromecast-java-api-v2/issues/91
- implementation project(':play-services-base-core')
implementation project(':play-services-core-proto')
implementation project(':play-services-core:microg-ui-tools') // deprecated
implementation project(':play-services-api')
diff --git a/play-services-base-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java b/play-services-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java
rename to play-services-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/BaseService.java b/play-services-core/src/main/java/org/microg/gms/BaseService.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/BaseService.java
rename to play-services-core/src/main/java/org/microg/gms/BaseService.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java b/play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java
rename to play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/DummyService.java b/play-services-core/src/main/java/org/microg/gms/DummyService.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/DummyService.java
rename to play-services-core/src/main/java/org/microg/gms/DummyService.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/Build.java b/play-services-core/src/main/java/org/microg/gms/common/Build.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/Build.java
rename to play-services-core/src/main/java/org/microg/gms/common/Build.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java b/play-services-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java
rename to play-services-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java b/play-services-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java
rename to play-services-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java b/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
similarity index 89%
rename from play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
rename to play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
index 720e0d84..649818f1 100644
--- a/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
+++ b/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
@@ -10,6 +10,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
+import android.content.res.Resources;
import android.os.Build;
import android.os.PowerManager;
import android.provider.Settings;
@@ -17,7 +18,7 @@ import android.util.Log;
import androidx.annotation.RequiresApi;
-import org.microg.gms.base.core.R;
+import com.mgoogle.android.gms.R;
import java.util.List;
@@ -69,7 +70,7 @@ public class ForegroundServiceContext extends ContextWrapper {
@RequiresApi(api = Build.VERSION_CODES.O)
private static Notification buildForegroundNotification(Context context) {
- NotificationChannel channel = new NotificationChannel("foreground-service", "Foreground Service", NotificationManager.IMPORTANCE_MIN);
+ NotificationChannel channel = new NotificationChannel("foreground-service", Resources.getSystem().getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_MIN);
channel.setShowBadge(false);
channel.setLockscreenVisibility(0);
channel.setVibrationPattern(new long[0]);
@@ -81,8 +82,8 @@ public class ForegroundServiceContext extends ContextWrapper {
return new Notification.Builder(context, channel.getId())
.setOngoing(true)
.setContentIntent(pendingIntent)
- .setContentTitle("Running in background")
- .setContentText("Tap me to disable battery optimisations for microG")
+ .setContentTitle(Resources.getSystem().getString(R.string.notification_service_title))
+ .setContentText(Resources.getSystem().getString(R.string.notification_service_content))
.setSmallIcon(R.drawable.ic_foreground_notification)
.build();
}
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/HttpFormClient.java b/play-services-core/src/main/java/org/microg/gms/common/HttpFormClient.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/HttpFormClient.java
rename to play-services-core/src/main/java/org/microg/gms/common/HttpFormClient.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java b/play-services-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java
rename to play-services-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/NonCancelToken.java b/play-services-core/src/main/java/org/microg/gms/common/NonCancelToken.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/NonCancelToken.java
rename to play-services-core/src/main/java/org/microg/gms/common/NonCancelToken.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/PackageUtils.java b/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/PackageUtils.java
rename to play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/PhoneInfo.java b/play-services-core/src/main/java/org/microg/gms/common/PhoneInfo.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/PhoneInfo.java
rename to play-services-core/src/main/java/org/microg/gms/common/PhoneInfo.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java b/play-services-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java
rename to play-services-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java
diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/Utils.java b/play-services-core/src/main/java/org/microg/gms/common/Utils.java
similarity index 100%
rename from play-services-base-core/src/main/java/org/microg/gms/common/Utils.java
rename to play-services-core/src/main/java/org/microg/gms/common/Utils.java
diff --git a/play-services-base-core/src/main/res/drawable/ic_foreground_notification.xml b/play-services-core/src/main/res/drawable/ic_foreground_notification.xml
similarity index 100%
rename from play-services-base-core/src/main/res/drawable/ic_foreground_notification.xml
rename to play-services-core/src/main/res/drawable/ic_foreground_notification.xml
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 ab264d5c..e6acb930 100755
--- a/play-services-core/src/main/res/values-it/strings.xml
+++ b/play-services-core/src/main/res/values-it/strings.xml
@@ -16,6 +16,11 @@
Impostazioni di Vanced microG
+ Configura Vanced microG.
+
+ Servizio in Primo Piano
+ Esecuzione in secondo piano
+ Tocca per disattivare il risparmio energetico per microG
Giusto un secondo…
Continuando autorizzi questa applicazione e Google ad usare le tue informazioni in accordo con i rispettivi termini di servizio e politiche di riservatezza.
diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml
index 644cdf88..9c99e8a2 100755
--- a/play-services-core/src/main/res/values/strings.xml
+++ b/play-services-core/src/main/res/values/strings.xml
@@ -18,6 +18,10 @@
Vanced microG Settings
Setup Vanced microG.
+ Foreground Service
+ Running in background
+ Tap me to disable battery saving for microG
+
Just a sec…
By continuing, you allow this app and Google to use your information in accordance with their respective terms of service and privacy policies.
%1$s would like to:
diff --git a/settings.gradle b/settings.gradle
index 81aefbb8..cf6f6fa8 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -11,8 +11,6 @@ include ':play-services-base-api'
include ':play-services-tasks'
include ':play-services-core-proto'
-include ':play-services-base-core'
-
include ':play-services-core'
include ':play-services-core:microg-ui-tools'
From daa23d87bfc3a84396f5c88de8c3650ce93bd663 Mon Sep 17 00:00:00 2001
From: Oizaro <45825534+Oizaro@users.noreply.github.com>
Date: Sun, 23 Aug 2020 22:45:39 +0200
Subject: [PATCH 3/3] Fix
---
.../org/microg/gms/common/ForegroundServiceContext.java | 6 +++---
.../src/main/java/org/microg/gms/gcm/McsService.java | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java b/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
index 649818f1..bb97cc2e 100644
--- a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
+++ b/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java
@@ -70,7 +70,7 @@ public class ForegroundServiceContext extends ContextWrapper {
@RequiresApi(api = Build.VERSION_CODES.O)
private static Notification buildForegroundNotification(Context context) {
- NotificationChannel channel = new NotificationChannel("foreground-service", Resources.getSystem().getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_MIN);
+ NotificationChannel channel = new NotificationChannel("foreground-service", context.getResources().getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_MIN);
channel.setShowBadge(false);
channel.setLockscreenVisibility(0);
channel.setVibrationPattern(new long[0]);
@@ -82,8 +82,8 @@ public class ForegroundServiceContext extends ContextWrapper {
return new Notification.Builder(context, channel.getId())
.setOngoing(true)
.setContentIntent(pendingIntent)
- .setContentTitle(Resources.getSystem().getString(R.string.notification_service_title))
- .setContentText(Resources.getSystem().getString(R.string.notification_service_content))
+ .setContentTitle(context.getResources().getString(R.string.notification_service_title))
+ .setContentText(context.getResources().getString(R.string.notification_service_content))
.setSmallIcon(R.drawable.ic_foreground_notification)
.build();
}
diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java
index 238c1c55..c18a3e56 100644
--- a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java
+++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java
@@ -43,6 +43,7 @@ import android.util.Log;
import androidx.annotation.RequiresApi;
import androidx.legacy.content.WakefulBroadcastReceiver;
+import com.mgoogle.android.gms.R;
import com.squareup.wire.Message;
import org.microg.gms.checkin.LastCheckinInfo;
@@ -320,13 +321,13 @@ public class McsService extends Service implements Handler.Callback {
@RequiresApi(api = Build.VERSION_CODES.O)
private Notification buildForegroundNotification() {
- NotificationChannel channel = new NotificationChannel("foreground-service", "Foreground Service", NotificationManager.IMPORTANCE_LOW);
+ NotificationChannel channel = new NotificationChannel("foreground-service", getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_LOW);
channel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
channel.setShowBadge(false);
getSystemService(NotificationManager.class).createNotificationChannel(channel);
return new Notification.Builder(this, channel.getId())
.setOngoing(true)
- .setContentTitle("Running in background")
+ .setContentTitle(this.getResources().getString(R.string.notification_service_title))
.setSmallIcon(android.R.drawable.stat_notify_sync)
.build();
}