Drop play-services-core-proto dependency from play-services-base/core

Probably should never have ended up there. We have some minimal code duplication now,
but that can be tackled in the future
This commit is contained in:
Marvin W 2026-03-30 14:21:27 +02:00
parent 54db3914de
commit ef110b0329
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
6 changed files with 55 additions and 42 deletions

View file

@ -10,7 +10,6 @@ apply plugin: 'signing'
dependencies {
api project(':play-services-basement-ktx')
implementation project(":play-services-core-proto")
implementation "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"

View file

@ -17,15 +17,6 @@ data class LastCheckinInfo(
val deviceDataVersionInfo: String,
) {
constructor(r: CheckinResponse) : this(
lastCheckin = r.timeMs ?: 0L,
androidId = r.androidId ?: 0L,
securityToken = r.securityToken ?: 0L,
digest = r.digest ?: SettingsContract.CheckIn.INITIAL_DIGEST,
versionInfo = r.versionInfo ?: "",
deviceDataVersionInfo = r.deviceDataVersionInfo ?: "",
)
companion object {
@JvmStatic
fun read(context: Context): LastCheckinInfo {
@ -74,4 +65,4 @@ data class LastCheckinInfo(
put(SettingsContract.CheckIn.VERSION_INFO, versionInfo)
put(SettingsContract.CheckIn.DEVICE_DATA_VERSION_INFO, deviceDataVersionInfo)
}
}
}

View file

@ -1,26 +0,0 @@
/*
* SPDX-FileCopyrightText: 2025 e foundation
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.common
import org.microg.gms.checkin.DeviceConfig
fun DeviceConfiguration.asProto(): DeviceConfig = DeviceConfig(
availableFeature = availableFeatures,
densityDpi = densityDpi,
glEsVersion = glEsVersion,
glExtension = glExtensions,
hasFiveWayNavigation = hasFiveWayNavigation,
hasHardKeyboard = hasHardKeyboard,
heightPixels = heightPixels,
keyboardType = keyboardType,
locale = locales,
nativePlatform = nativePlatforms,
navigation = navigation,
screenLayout = screenLayout,
sharedLibrary = sharedLibraries,
touchScreen = touchScreen,
widthPixels = widthPixels
)

View file

@ -19,7 +19,6 @@ package org.microg.gms.checkin;
import android.content.Context;
import android.util.Log;
import org.microg.gms.common.DeviceConfigProtoKt;
import org.microg.gms.common.DeviceConfiguration;
import org.microg.gms.common.DeviceIdentifier;
import org.microg.gms.common.PhoneInfo;
@ -79,6 +78,26 @@ public class CheckinClient {
return response;
}
private static DeviceConfig createDeviceConfig(DeviceConfiguration deviceConfiguration) {
return new DeviceConfig.Builder()
.availableFeature(deviceConfiguration.availableFeatures)
.densityDpi(deviceConfiguration.densityDpi)
.glEsVersion(deviceConfiguration.glEsVersion)
.glExtension(deviceConfiguration.glExtensions)
.hasFiveWayNavigation(deviceConfiguration.hasFiveWayNavigation)
.hasHardKeyboard(deviceConfiguration.hasHardKeyboard)
.heightPixels(deviceConfiguration.heightPixels)
.keyboardType(deviceConfiguration.keyboardType)
.locale(deviceConfiguration.locales)
.nativePlatform(deviceConfiguration.nativePlatforms)
.navigation(deviceConfiguration.navigation)
.screenLayout(deviceConfiguration.screenLayout)
.sharedLibrary(deviceConfiguration.sharedLibraries)
.touchScreen(deviceConfiguration.touchScreen)
.widthPixels(deviceConfiguration.widthPixels)
.build();
}
public static CheckinRequest makeRequest(Context context, DeviceConfiguration deviceConfiguration,
DeviceIdentifier deviceIdent, PhoneInfo phoneInfo,
LastCheckinInfo checkinInfo, Locale locale,
@ -117,7 +136,7 @@ public class CheckinClient {
.stat(TODO_LIST_CHECKIN)
.userNumber(0)
.build())
.deviceConfiguration(DeviceConfigProtoKt.asProto(deviceConfiguration))
.deviceConfiguration(createDeviceConfig(deviceConfiguration))
.digest(checkinInfo.getDigest())
.esn(deviceIdent.esn)
.fragment(0)

View file

@ -27,6 +27,7 @@ import org.microg.gms.common.Constants;
import org.microg.gms.common.DeviceConfiguration;
import org.microg.gms.common.Utils;
import org.microg.gms.gservices.GServices;
import org.microg.gms.settings.SettingsContract;
import java.io.IOException;
import java.util.ArrayList;
@ -61,8 +62,19 @@ public class CheckinManager {
return handleResponse(context, CheckinClient.request(request));
}
private static LastCheckinInfo createLastCheckinInfo(CheckinResponse r) {
return new LastCheckinInfo(
r.timeMs != null ? r.timeMs : 0L,
r.androidId != null ? r.androidId: 0L,
r.securityToken != null ? r.securityToken : 0L,
r.digest != null ? r.digest: SettingsContract.CheckIn.INITIAL_DIGEST,
r.versionInfo != null ? r.versionInfo : "",
r.deviceDataVersionInfo != null ? r.deviceDataVersionInfo : ""
);
}
private static LastCheckinInfo handleResponse(Context context, CheckinResponse response) {
LastCheckinInfo info = new LastCheckinInfo(response);
LastCheckinInfo info = createLastCheckinInfo(response);
info.write(context);
ContentResolver resolver = context.getContentResolver();

View file

@ -34,7 +34,6 @@ import com.android.vending.installer.uninstallPackage
import kotlinx.coroutines.runBlocking
import org.microg.gms.auth.AuthConstants
import org.microg.gms.common.DeviceConfiguration
import org.microg.gms.common.asProto
import org.microg.gms.profile.Build
import org.microg.gms.profile.ProfileManager
import org.microg.vending.UploadDeviceConfigRequest
@ -57,6 +56,7 @@ import org.microg.vending.enterprise.Pending
import org.microg.vending.enterprise.UpdateAvailable
import org.microg.vending.enterprise.proto.AppInstallPolicy
import com.android.vending.installer.InstallService
import org.microg.gms.checkin.DeviceConfig
import org.microg.vending.proto.AppMeta
import org.microg.vending.proto.GetItemsRequest
import org.microg.vending.proto.RequestApp
@ -144,6 +144,24 @@ class WorkAppsActivity : ComponentActivity() {
unbindService(serviceConnection)
}
private fun DeviceConfiguration.asProto(): DeviceConfig = DeviceConfig(
availableFeature = availableFeatures,
densityDpi = densityDpi,
glEsVersion = glEsVersion,
glExtension = glExtensions,
hasFiveWayNavigation = hasFiveWayNavigation,
hasHardKeyboard = hasHardKeyboard,
heightPixels = heightPixels,
keyboardType = keyboardType,
locale = locales,
nativePlatform = nativePlatforms,
navigation = navigation,
screenLayout = screenLayout,
sharedLibrary = sharedLibraries,
touchScreen = touchScreen,
widthPixels = widthPixels
)
private fun load(account: Account) {
networkState = NetworkState.ACTIVE
Thread {
@ -295,4 +313,4 @@ class WorkAppsActivity : ComponentActivity() {
companion object {
const val TAG = "GmsVendingWorkApp"
}
}
}