From 6037181e8a09af90200e8151e0d211cac701af0b Mon Sep 17 00:00:00 2001 From: Oizaro <45825534+Oizaro@users.noreply.github.com> Date: Wed, 5 Aug 2020 01:57:23 +0200 Subject: [PATCH] Update to latest upstream --- README.md | 2 +- build.gradle | 2 + .../src/main/AndroidManifest.xml | 4 +- play-services-core-proto/build.gradle | 25 + .../src/main/proto}/auth.proto | 0 .../src/main/proto}/checkin.proto | 0 .../src/main/proto}/mcs.proto | 0 .../src/main/proto}/snet.proto | 0 play-services-core/build.gradle | 4 +- .../gms/auth/AskPermissionActivity.java | 2 +- .../org/microg/gms/checkin/CheckinClient.java | 10 +- .../org/microg/gms/gcm/McsInputStream.java | 15 +- .../org/microg/gms/gcm/McsOutputStream.java | 5 +- .../java/org/microg/gms/gcm/McsService.java | 27 +- .../kotlin/org/microg/gms/ui/Constants.kt | 8 + .../gms/ui/PushNotificationAllAppsFragment.kt | 6 +- .../gms/ui/PushNotificationAppFragment.kt | 9 +- .../PushNotificationAppPreferencesFragment.kt | 2 +- .../ui/PushNotificationPreferencesFragment.kt | 10 +- .../main/kotlin/org/microg/gms/ui/Utils.kt | 19 + .../org/microg/gms/auth/ConsentData.java | 243 --- .../microg/gms/checkin/CheckinRequest.java | 1680 ----------------- .../microg/gms/checkin/CheckinResponse.java | 490 ----- .../org/microg/gms/gcm/mcs/AppData.java | 83 - .../org/microg/gms/gcm/mcs/Close.java | 43 - .../microg/gms/gcm/mcs/DataMessageStanza.java | 492 ----- .../org/microg/gms/gcm/mcs/ErrorInfo.java | 111 -- .../org/microg/gms/gcm/mcs/Extension.java | 93 - .../org/microg/gms/gcm/mcs/HeartbeatAck.java | 99 - .../microg/gms/gcm/mcs/HeartbeatConfig.java | 97 - .../org/microg/gms/gcm/mcs/HeartbeatPing.java | 105 -- .../org/microg/gms/gcm/mcs/HeartbeatStat.java | 99 - .../org/microg/gms/gcm/mcs/IqStanza.java | 255 --- .../org/microg/gms/gcm/mcs/LoginRequest.java | 387 ---- .../org/microg/gms/gcm/mcs/LoginResponse.java | 197 -- .../org/microg/gms/gcm/mcs/SelectiveAck.java | 68 - .../org/microg/gms/gcm/mcs/Setting.java | 90 - .../org/microg/gms/gcm/mcs/StreamAck.java | 44 - .../microg/gms/gcm/mcs/StreamErrorStanza.java | 83 - .../src/main/res/values-it/strings.xml | 68 +- settings.gradle | 1 + 41 files changed, 145 insertions(+), 4833 deletions(-) create mode 100644 play-services-core-proto/build.gradle rename {play-services-core/src/main/protos-repo => play-services-core-proto/src/main/proto}/auth.proto (100%) rename {play-services-core/src/main/protos-repo => play-services-core-proto/src/main/proto}/checkin.proto (100%) rename {play-services-core/src/main/protos-repo => play-services-core-proto/src/main/proto}/mcs.proto (100%) rename {play-services-core/src/main/protos-repo => play-services-core-proto/src/main/proto}/snet.proto (100%) create mode 100644 play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt create mode 100644 play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/auth/ConsentData.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinRequest.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinResponse.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/AppData.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Close.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/DataMessageStanza.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/ErrorInfo.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Extension.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatAck.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatConfig.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatPing.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatStat.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/IqStanza.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginRequest.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginResponse.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/SelectiveAck.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Setting.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamAck.java delete mode 100644 play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamErrorStanza.java diff --git a/README.md b/README.md index 8f070e1d..3d38fd0c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This fork tweaks MicroG to be usable by applications that require Google authent - Maps & Location - SafetyNet - Self-Check - - TapandPay + - TapAndPay - Wallet - Wear-Api - Removed all permissions, as none are required for Google authentication diff --git a/build.gradle b/build.gradle index d933843d..337efdcc 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ buildscript { ext.supportLibraryVersion = "28.0.0" ext.slf4jVersion = "1.7.25" + ext.wireVersion = '3.2.2' ext.androidBuildGradleVersion = "4.0.1" @@ -41,6 +42,7 @@ buildscript { dependencies { classpath "com.android.tools.build:gradle:$androidBuildGradleVersion" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" + classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion" } } diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml index 559a33ba..3ab02d97 100644 --- a/play-services-base/src/main/AndroidManifest.xml +++ b/play-services-base/src/main/AndroidManifest.xml @@ -18,11 +18,11 @@ - + - TODO_LIST_STRING = new ArrayList(); // TODO + private static final List TODO_LIST_CHECKIN = new ArrayList(); // TODO private static final String SERVICE_URL = "https://android.clients.google.com/checkin"; public static CheckinResponse request(CheckinRequest request) throws IOException { @@ -60,7 +62,7 @@ public class CheckinClient { Log.d(TAG, "-- Request --\n" + request); OutputStream os = new GZIPOutputStream(connection.getOutputStream()); - os.write(request.toByteArray()); + os.write(request.encode()); os.close(); if (connection.getResponseCode() != 200) { @@ -72,7 +74,7 @@ public class CheckinClient { } InputStream is = connection.getInputStream(); - CheckinResponse response = new Wire().parseFrom(new GZIPInputStream(is), CheckinResponse.class); + CheckinResponse response = CheckinResponse.ADAPTER.decode(new GZIPInputStream(is)); is.close(); return response; } @@ -108,10 +110,10 @@ public class CheckinClient { .timeMs(new Date().getTime()) .build())) .lastCheckinMs(checkinInfo.lastCheckin) - .requestedGroup((List) TODO) + .requestedGroup(TODO_LIST_STRING) .roaming(phoneInfo.roaming) .simOperator(phoneInfo.simOperator) - .stat((List) TODO) + .stat(TODO_LIST_CHECKIN) .userNumber(0) .build()) .deviceConfiguration(new CheckinRequest.DeviceConfig.Builder() diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java index 571c6502..c1913ba3 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java @@ -146,23 +146,22 @@ public class McsInputStream extends Thread implements Closeable { } private static Message read(int mcsTag, byte[] bytes, int len) throws IOException { - Wire wire = new Wire(); try { switch (mcsTag) { case MCS_HEARTBEAT_PING_TAG: - return wire.parseFrom(bytes, 0, len, HeartbeatPing.class); + return HeartbeatPing.ADAPTER.decode(bytes); case MCS_HEARTBEAT_ACK_TAG: - return wire.parseFrom(bytes, 0, len, HeartbeatAck.class); + return HeartbeatAck.ADAPTER.decode(bytes); case MCS_LOGIN_REQUEST_TAG: - return wire.parseFrom(bytes, 0, len, LoginRequest.class); + return LoginRequest.ADAPTER.decode(bytes); case MCS_LOGIN_RESPONSE_TAG: - return wire.parseFrom(bytes, 0, len, LoginResponse.class); + return LoginResponse.ADAPTER.decode(bytes); case MCS_CLOSE_TAG: - return wire.parseFrom(bytes, 0, len, Close.class); + return Close.ADAPTER.decode(bytes); case MCS_IQ_STANZA_TAG: - return wire.parseFrom(bytes, 0, len, IqStanza.class); + return IqStanza.ADAPTER.decode(bytes); case MCS_DATA_MESSAGE_STANZA_TAG: - return wire.parseFrom(bytes, 0, len, DataMessageStanza.class); + return DataMessageStanza.ADAPTER.decode(bytes); default: Log.w(TAG, "Unknown tag: " + mcsTag); return null; diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java index 67b26047..a4867b6d 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java @@ -111,8 +111,9 @@ public class McsOutputStream extends Thread implements Handler.Callback, Closeab initialized = true; } os.write(tag); - writeVarint(os, message.getSerializedSize()); - os.write(message.toByteArray()); + byte[] bytes = message.encode(); + writeVarint(os, bytes.length); + os.write(bytes); os.flush(); streamId++; } 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 9e0da3ea..238c1c55 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,7 +43,6 @@ 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; @@ -107,7 +106,7 @@ import static org.microg.gms.gcm.McsConstants.MSG_TEARDOWN; public class McsService extends Service implements Handler.Callback { private static final String TAG = "GmsGcmMcsSvc"; - public static final String SELF_CATEGORY = "com.mgoogle.android.gsf.gtalkservice"; + public static final String SELF_CATEGORY = "com.google.android.gsf.gtalkservice"; public static final String IDLE_NOTIFICATION = "IdleNotification"; public static final String FROM_FIELD = "gcm@android.com"; @@ -319,10 +318,24 @@ public class McsService extends Service implements Handler.Callback { return START_REDELIVER_INTENT; } + @RequiresApi(api = Build.VERSION_CODES.O) + private Notification buildForegroundNotification() { + NotificationChannel channel = new NotificationChannel("foreground-service", "Foreground Service", 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") + .setSmallIcon(android.R.drawable.stat_notify_sync) + .build(); + } + private void handleSendMessage(Intent intent) { String messageId = intent.getStringExtra(EXTRA_MESSAGE_ID); String collapseKey = intent.getStringExtra(EXTRA_COLLAPSE_KEY); + Messenger messenger = intent.getParcelableExtra(EXTRA_MESSENGER); intent.removeExtra(EXTRA_MESSENGER); Parcelable app = intent.getParcelableExtra(EXTRA_APP); @@ -379,7 +392,7 @@ public class McsService extends Service implements Handler.Callback { if (!key.startsWith("google.")) { Object val = extras.get(key); if (val instanceof String) { - appData.add(new AppData(key, (String) val)); + appData.add(new AppData.Builder().key(key).value((String) val).build()); } } } @@ -400,7 +413,7 @@ public class McsService extends Service implements Handler.Callback { .app_data(appData).build(); send(MCS_DATA_MESSAGE_STANZA_TAG, msg); - database.noteAppMessage(packageName, msg.getSerializedSize()); + database.noteAppMessage(packageName, DataMessageStanza.ADAPTER.encodedSize(msg)); } catch (Exception e) { Log.w(TAG, e); } @@ -488,14 +501,14 @@ public class McsService extends Service implements Handler.Callback { .resource(Long.toString(info.androidId)) .user(Long.toString(info.androidId)) .use_rmq2(true) - .setting(Collections.singletonList(new Setting("new_vc", "1"))) + .setting(Collections.singletonList(new Setting.Builder().name("new_vc").value("1").build())) .received_persistent_id(GcmPrefs.get(this).getLastPersistedIds()) .build(); } private void handleAppMessage(DataMessageStanza msg) { String packageName = msg.category; - database.noteAppMessage(packageName, msg.getSerializedSize()); + database.noteAppMessage(packageName, DataMessageStanza.ADAPTER.encodedSize(msg)); GcmDatabase.App app = database.getApp(packageName); Intent intent = new Intent(); @@ -560,7 +573,7 @@ public class McsService extends Service implements Handler.Callback { .sent(System.currentTimeMillis() / 1000) .ttl(0) .category(SELF_CATEGORY) - .app_data(Collections.singletonList(new AppData(IDLE_NOTIFICATION, "false"))); + .app_data(Collections.singletonList(new AppData.Builder().key(IDLE_NOTIFICATION).value("false").build())); if (inputStream.newStreamIdAvailable()) { msgResponse.last_stream_id_received(inputStream.getStreamId()); } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt new file mode 100644 index 00000000..a316804f --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.ui + +const val TAG = "GmsUi" \ No newline at end of file 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 index 712ea417..4c38a6f0 100755 --- 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 @@ -56,11 +56,7 @@ class PushNotificationAllAppsFragment : PreferenceFragmentCompat() { val context = requireContext() val apps = withContext(Dispatchers.IO) { val res = database.appList.map { app -> - try { - app to context.packageManager.getApplicationInfo(app.packageName, 0) - } catch (ignored: Exception) { - app to null - } + app to context.packageManager.getApplicationInfoIfExists(app.packageName) }.map { (app, applicationInfo) -> val pref = AppIconPreference(context) pref.title = applicationInfo?.loadLabel(context.packageManager) ?: app.packageName 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 index 818ed177..567bfe28 100755 --- 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 @@ -15,7 +15,6 @@ import android.view.View import android.view.ViewGroup import androidx.appcompat.content.res.AppCompatResources import androidx.fragment.app.Fragment -import androidx.fragment.app.findFragment import androidx.lifecycle.lifecycleScope import com.mgoogle.android.gms.R import com.mgoogle.android.gms.databinding.PushNotificationAppFragmentBinding @@ -34,7 +33,11 @@ class PushNotificationAppFragment : Fragment(R.layout.push_notification_fragment intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS val uri: Uri = Uri.fromParts("package", packageName, null) intent.data = uri - context!!.startActivity(intent) + try { + context!!.startActivity(intent) + } catch (e: Exception) { + Log.w(TAG, "Failed to launch app", e) + } } } childFragmentManager.findFragmentById(R.id.sub_preferences)?.arguments = arguments @@ -45,7 +48,7 @@ class PushNotificationAppFragment : Fragment(R.layout.push_notification_fragment super.onResume() lifecycleScope.launchWhenResumed { val pm = requireContext().packageManager - val applicationInfo = packageName?.let { pm.getApplicationInfo(it, 0) } + val applicationInfo = pm.getApplicationInfoIfExists(packageName) binding.appName = applicationInfo?.loadLabel(pm)?.toString() ?: packageName binding.appIcon = applicationInfo?.loadIcon(pm) ?: AppCompatResources.getDrawable(requireContext(), android.R.mipmap.sym_def_app_icon) 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 index 1c9ad6c0..dba51e9e 100755 --- 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 @@ -71,7 +71,7 @@ class PushNotificationAppPreferencesFragment : PreferenceFragmentCompat() { private fun showUnregisterConfirm(unregisterConfirmDesc: Int) { val pm = requireContext().packageManager - val applicationInfo = packageName?.let { pm.getApplicationInfo(it, 0) } + val applicationInfo = pm.getApplicationInfoIfExists(packageName) AlertDialog.Builder(requireContext()) .setTitle(getString(R.string.gcm_unregister_confirm_title, applicationInfo?.loadLabel(pm) ?: packageName)) 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 index a28c28bf..4a971a57 100755 --- 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 @@ -80,12 +80,10 @@ class PushNotificationPreferencesFragment : PreferenceFragmentCompat() { val (apps, showAll) = withContext(Dispatchers.IO) { val apps = database.appList.sortedByDescending { it.lastMessageTimestamp } val res = apps.map { app -> - try { - app to context.packageManager.getApplicationInfo(app.packageName, 0) - } catch (ignored: Exception) { - null - } - }.filterNotNull().take(3).mapIndexed { idx, (app, applicationInfo) -> + app to context.packageManager.getApplicationInfoIfExists(app.packageName) + }.mapNotNull { (app, info) -> + if (info == null) null else app to info + }.take(3).mapIndexed { idx, (app, applicationInfo) -> val pref = AppIconPreference(context) pref.order = idx pref.title = applicationInfo.loadLabel(context.packageManager) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt new file mode 100644 index 00000000..a80c7ef9 --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.ui + +import android.content.pm.ApplicationInfo +import android.content.pm.PackageManager +import android.util.Log + +fun PackageManager.getApplicationInfoIfExists(packageName: String?, flags: Int = 0): ApplicationInfo? = packageName?.let { + try { + getApplicationInfo(it, flags) + } catch (e: Exception) { + Log.w(TAG, "Package does not exist", e) + null + } +} \ No newline at end of file diff --git a/play-services-core/src/main/protos-java/org/microg/gms/auth/ConsentData.java b/play-services-core/src/main/protos-java/org/microg/gms/auth/ConsentData.java deleted file mode 100644 index e32bd4e0..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/auth/ConsentData.java +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/auth.proto -package org.microg.gms.auth; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; -import java.util.Collections; -import java.util.List; - -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; - -public final class ConsentData extends Message { - - public static final List DEFAULT_SCOPES = Collections.emptyList(); - - @ProtoField(tag = 1) - public final AppDetails app; - - @ProtoField(tag = 2, label = REPEATED, messageType = ScopeDetails.class) - public final List scopes; - - public ConsentData(AppDetails app, List scopes) { - this.app = app; - this.scopes = immutableCopyOf(scopes); - } - - private ConsentData(Builder builder) { - this(builder.app, builder.scopes); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ConsentData)) return false; - ConsentData o = (ConsentData) other; - return equals(app, o.app) - && equals(scopes, o.scopes); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = app != null ? app.hashCode() : 0; - result = result * 37 + (scopes != null ? scopes.hashCode() : 1); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public AppDetails app; - public List scopes; - - public Builder() { - } - - public Builder(ConsentData message) { - super(message); - if (message == null) return; - this.app = message.app; - this.scopes = copyOf(message.scopes); - } - - public Builder app(AppDetails app) { - this.app = app; - return this; - } - - public Builder scopes(List scopes) { - this.scopes = checkForNulls(scopes); - return this; - } - - @Override - public ConsentData build() { - return new ConsentData(this); - } - } - - public static final class AppDetails extends Message { - - public static final String DEFAULT_TITLE = ""; - public static final String DEFAULT_EMAIL = ""; - - @ProtoField(tag = 1, type = STRING) - public final String title; - - @ProtoField(tag = 3, type = STRING) - public final String email; - - public AppDetails(String title, String email) { - this.title = title; - this.email = email; - } - - private AppDetails(Builder builder) { - this(builder.title, builder.email); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof AppDetails)) return false; - AppDetails o = (AppDetails) other; - return equals(title, o.title) - && equals(email, o.email); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = title != null ? title.hashCode() : 0; - result = result * 37 + (email != null ? email.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String title; - public String email; - - public Builder() { - } - - public Builder(AppDetails message) { - super(message); - if (message == null) return; - this.title = message.title; - this.email = message.email; - } - - public Builder title(String title) { - this.title = title; - return this; - } - - public Builder email(String email) { - this.email = email; - return this; - } - - @Override - public AppDetails build() { - return new AppDetails(this); - } - } - } - - public static final class ScopeDetails extends Message { - - public static final String DEFAULT_TITLE = ""; - public static final String DEFAULT_DESCRIPTION = ""; - public static final String DEFAULT_ID = ""; - - @ProtoField(tag = 1, type = STRING) - public final String title; - - @ProtoField(tag = 2, type = STRING) - public final String description; - - @ProtoField(tag = 6, type = STRING) - public final String id; - - public ScopeDetails(String title, String description, String id) { - this.title = title; - this.description = description; - this.id = id; - } - - private ScopeDetails(Builder builder) { - this(builder.title, builder.description, builder.id); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ScopeDetails)) return false; - ScopeDetails o = (ScopeDetails) other; - return equals(title, o.title) - && equals(description, o.description) - && equals(id, o.id); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = title != null ? title.hashCode() : 0; - result = result * 37 + (description != null ? description.hashCode() : 0); - result = result * 37 + (id != null ? id.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String title; - public String description; - public String id; - - public Builder() { - } - - public Builder(ScopeDetails message) { - super(message); - if (message == null) return; - this.title = message.title; - this.description = message.description; - this.id = message.id; - } - - public Builder title(String title) { - this.title = title; - return this; - } - - public Builder description(String description) { - this.description = description; - return this; - } - - public Builder id(String id) { - this.id = id; - return this; - } - - @Override - public ScopeDetails build() { - return new ScopeDetails(this); - } - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinRequest.java b/play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinRequest.java deleted file mode 100644 index fe984f57..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinRequest.java +++ /dev/null @@ -1,1680 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/checkin.proto -package org.microg.gms.checkin; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; -import java.util.Collections; -import java.util.List; - -import static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.FIXED64; -import static com.squareup.wire.Message.Datatype.FLOAT; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; -import static com.squareup.wire.Message.Label.REQUIRED; - -/** - * Sample data, if provided, is fished from a Nexus 7 (2013) / flo running Android 5.0 - */ -public final class CheckinRequest extends Message { - - public static final String DEFAULT_IMEI = ""; - public static final Long DEFAULT_ANDROIDID = 0L; - public static final String DEFAULT_DIGEST = ""; - public static final String DEFAULT_DESIREDBUILD = ""; - public static final String DEFAULT_LOCALE = ""; - public static final Long DEFAULT_LOGGINGID = 0L; - public static final String DEFAULT_MARKETCHECKIN = ""; - public static final List DEFAULT_MACADDRESS = Collections.emptyList(); - public static final String DEFAULT_MEID = ""; - public static final List DEFAULT_ACCOUNTCOOKIE = Collections.emptyList(); - public static final String DEFAULT_TIMEZONE = ""; - public static final Long DEFAULT_SECURITYTOKEN = 0L; - public static final Integer DEFAULT_VERSION = 0; - public static final List DEFAULT_OTACERT = Collections.emptyList(); - public static final String DEFAULT_SERIAL = ""; - public static final String DEFAULT_ESN = ""; - public static final List DEFAULT_MACADDRESSTYPE = Collections.emptyList(); - public static final Integer DEFAULT_FRAGMENT = 0; - public static final String DEFAULT_USERNAME = ""; - public static final Integer DEFAULT_USERSERIALNUMBER = 0; - - /** - * unused - */ - @ProtoField(tag = 1, type = STRING) - public final String imei; - - /** - * Gservices["android_id"] or 0 on first-checkin - */ - @ProtoField(tag = 2, type = INT64) - public final Long androidId; - - /** - * Gservices["digest"] or "" - */ - @ProtoField(tag = 3, type = STRING) - public final String digest; - - @ProtoField(tag = 4, label = REQUIRED) - public final Checkin checkin; - - /** - * unused - */ - @ProtoField(tag = 5, type = STRING) - public final String desiredBuild; - - /** - * Locale.toString - */ - @ProtoField(tag = 6, type = STRING) - public final String locale; - - /** - * GoogleSettingsContract.Partner["logging_id2"] (choosen randomly on first checkin) - * eg. 12561488293572742346 - */ - @ProtoField(tag = 7, type = INT64) - public final Long loggingId; - - /** - * unused - */ - @ProtoField(tag = 8, type = STRING) - public final String marketCheckin; - - /** - * NetworkInfo.getExtraInfo, WifiInfo.getMacAddress (12 hex-digits) - * eg. d850e6abcdef - */ - @ProtoField(tag = 9, type = STRING, label = REPEATED) - public final List macAddress; - - /** - * TelephonyManager.getDeviceId (14 hex-digits), not set on tablets - */ - @ProtoField(tag = 10, type = STRING) - public final String meid; - - /** - * "[]" followed by "", empty string on first checkin - */ - @ProtoField(tag = 11, type = STRING, label = REPEATED) - public final List accountCookie; - - /** - * TimeZone.getId - * eg. GMT - */ - @ProtoField(tag = 12, type = STRING) - public final String timeZone; - - /** - * security token as given on first checkin, not set on first checkin - */ - @ProtoField(tag = 13, type = FIXED64) - public final Long securityToken; - - /** - * use 3 - */ - @ProtoField(tag = 14, type = INT32) - public final Integer version; - - /** - * SHA-1 of each in /system/etc/security/otacerts.zip or "--IOException--" or "--no-output--" - * eg. dKXTm1QH9QShGQwBM/4rg6/lCNQ= - */ - @ProtoField(tag = 15, type = STRING, label = REPEATED) - public final List otaCert; - - /** - * Build.SERIAL != "unknown" - * eg. 07d90b18 - */ - @ProtoField(tag = 16, type = STRING) - public final String serial; - - /** - * TelephonyManager.getDeviceId (8 hex-digits), not set on tablets - */ - @ProtoField(tag = 17, type = STRING) - public final String esn; - - @ProtoField(tag = 18) - public final DeviceConfig deviceConfiguration; - - /** - * "ethernet" or "wifi" - */ - @ProtoField(tag = 19, type = STRING, label = REPEATED) - public final List macAddressType; - - /** - * unknown, use 0 on pre- and first-checkin, and 1 for later checkins - * also present on pre-checkin - */ - @ProtoField(tag = 20, type = INT32, label = REQUIRED) - public final Integer fragment; - - /** - * unknown - */ - @ProtoField(tag = 21, type = STRING) - public final String userName; - - /** - * UserManager.getUserSerialNumber - * eg. 0 - */ - @ProtoField(tag = 22, type = INT32) - public final Integer userSerialNumber; - - public CheckinRequest(String imei, Long androidId, String digest, Checkin checkin, String desiredBuild, String locale, Long loggingId, String marketCheckin, List macAddress, String meid, List accountCookie, String timeZone, Long securityToken, Integer version, List otaCert, String serial, String esn, DeviceConfig deviceConfiguration, List macAddressType, Integer fragment, String userName, Integer userSerialNumber) { - this.imei = imei; - this.androidId = androidId; - this.digest = digest; - this.checkin = checkin; - this.desiredBuild = desiredBuild; - this.locale = locale; - this.loggingId = loggingId; - this.marketCheckin = marketCheckin; - this.macAddress = immutableCopyOf(macAddress); - this.meid = meid; - this.accountCookie = immutableCopyOf(accountCookie); - this.timeZone = timeZone; - this.securityToken = securityToken; - this.version = version; - this.otaCert = immutableCopyOf(otaCert); - this.serial = serial; - this.esn = esn; - this.deviceConfiguration = deviceConfiguration; - this.macAddressType = immutableCopyOf(macAddressType); - this.fragment = fragment; - this.userName = userName; - this.userSerialNumber = userSerialNumber; - } - - private CheckinRequest(Builder builder) { - this(builder.imei, builder.androidId, builder.digest, builder.checkin, builder.desiredBuild, builder.locale, builder.loggingId, builder.marketCheckin, builder.macAddress, builder.meid, builder.accountCookie, builder.timeZone, builder.securityToken, builder.version, builder.otaCert, builder.serial, builder.esn, builder.deviceConfiguration, builder.macAddressType, builder.fragment, builder.userName, builder.userSerialNumber); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof CheckinRequest)) return false; - CheckinRequest o = (CheckinRequest) other; - return equals(imei, o.imei) - && equals(androidId, o.androidId) - && equals(digest, o.digest) - && equals(checkin, o.checkin) - && equals(desiredBuild, o.desiredBuild) - && equals(locale, o.locale) - && equals(loggingId, o.loggingId) - && equals(marketCheckin, o.marketCheckin) - && equals(macAddress, o.macAddress) - && equals(meid, o.meid) - && equals(accountCookie, o.accountCookie) - && equals(timeZone, o.timeZone) - && equals(securityToken, o.securityToken) - && equals(version, o.version) - && equals(otaCert, o.otaCert) - && equals(serial, o.serial) - && equals(esn, o.esn) - && equals(deviceConfiguration, o.deviceConfiguration) - && equals(macAddressType, o.macAddressType) - && equals(fragment, o.fragment) - && equals(userName, o.userName) - && equals(userSerialNumber, o.userSerialNumber); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = imei != null ? imei.hashCode() : 0; - result = result * 37 + (androidId != null ? androidId.hashCode() : 0); - result = result * 37 + (digest != null ? digest.hashCode() : 0); - result = result * 37 + (checkin != null ? checkin.hashCode() : 0); - result = result * 37 + (desiredBuild != null ? desiredBuild.hashCode() : 0); - result = result * 37 + (locale != null ? locale.hashCode() : 0); - result = result * 37 + (loggingId != null ? loggingId.hashCode() : 0); - result = result * 37 + (marketCheckin != null ? marketCheckin.hashCode() : 0); - result = result * 37 + (macAddress != null ? macAddress.hashCode() : 1); - result = result * 37 + (meid != null ? meid.hashCode() : 0); - result = result * 37 + (accountCookie != null ? accountCookie.hashCode() : 1); - result = result * 37 + (timeZone != null ? timeZone.hashCode() : 0); - result = result * 37 + (securityToken != null ? securityToken.hashCode() : 0); - result = result * 37 + (version != null ? version.hashCode() : 0); - result = result * 37 + (otaCert != null ? otaCert.hashCode() : 1); - result = result * 37 + (serial != null ? serial.hashCode() : 0); - result = result * 37 + (esn != null ? esn.hashCode() : 0); - result = result * 37 + (deviceConfiguration != null ? deviceConfiguration.hashCode() : 0); - result = result * 37 + (macAddressType != null ? macAddressType.hashCode() : 1); - result = result * 37 + (fragment != null ? fragment.hashCode() : 0); - result = result * 37 + (userName != null ? userName.hashCode() : 0); - result = result * 37 + (userSerialNumber != null ? userSerialNumber.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String imei; - public Long androidId; - public String digest; - public Checkin checkin; - public String desiredBuild; - public String locale; - public Long loggingId; - public String marketCheckin; - public List macAddress; - public String meid; - public List accountCookie; - public String timeZone; - public Long securityToken; - public Integer version; - public List otaCert; - public String serial; - public String esn; - public DeviceConfig deviceConfiguration; - public List macAddressType; - public Integer fragment; - public String userName; - public Integer userSerialNumber; - - public Builder() { - } - - public Builder(CheckinRequest message) { - super(message); - if (message == null) return; - this.imei = message.imei; - this.androidId = message.androidId; - this.digest = message.digest; - this.checkin = message.checkin; - this.desiredBuild = message.desiredBuild; - this.locale = message.locale; - this.loggingId = message.loggingId; - this.marketCheckin = message.marketCheckin; - this.macAddress = copyOf(message.macAddress); - this.meid = message.meid; - this.accountCookie = copyOf(message.accountCookie); - this.timeZone = message.timeZone; - this.securityToken = message.securityToken; - this.version = message.version; - this.otaCert = copyOf(message.otaCert); - this.serial = message.serial; - this.esn = message.esn; - this.deviceConfiguration = message.deviceConfiguration; - this.macAddressType = copyOf(message.macAddressType); - this.fragment = message.fragment; - this.userName = message.userName; - this.userSerialNumber = message.userSerialNumber; - } - - /** - * unused - */ - public Builder imei(String imei) { - this.imei = imei; - return this; - } - - /** - * Gservices["android_id"] or 0 on first-checkin - */ - public Builder androidId(Long androidId) { - this.androidId = androidId; - return this; - } - - /** - * Gservices["digest"] or "" - */ - public Builder digest(String digest) { - this.digest = digest; - return this; - } - - public Builder checkin(Checkin checkin) { - this.checkin = checkin; - return this; - } - - /** - * unused - */ - public Builder desiredBuild(String desiredBuild) { - this.desiredBuild = desiredBuild; - return this; - } - - /** - * Locale.toString - */ - public Builder locale(String locale) { - this.locale = locale; - return this; - } - - /** - * GoogleSettingsContract.Partner["logging_id2"] (choosen randomly on first checkin) - * eg. 12561488293572742346 - */ - public Builder loggingId(Long loggingId) { - this.loggingId = loggingId; - return this; - } - - /** - * unused - */ - public Builder marketCheckin(String marketCheckin) { - this.marketCheckin = marketCheckin; - return this; - } - - /** - * NetworkInfo.getExtraInfo, WifiInfo.getMacAddress (12 hex-digits) - * eg. d850e6abcdef - */ - public Builder macAddress(List macAddress) { - this.macAddress = checkForNulls(macAddress); - return this; - } - - /** - * TelephonyManager.getDeviceId (14 hex-digits), not set on tablets - */ - public Builder meid(String meid) { - this.meid = meid; - return this; - } - - /** - * "[]" followed by "", empty string on first checkin - */ - public Builder accountCookie(List accountCookie) { - this.accountCookie = checkForNulls(accountCookie); - return this; - } - - /** - * TimeZone.getId - * eg. GMT - */ - public Builder timeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * security token as given on first checkin, not set on first checkin - */ - public Builder securityToken(Long securityToken) { - this.securityToken = securityToken; - return this; - } - - /** - * use 3 - */ - public Builder version(Integer version) { - this.version = version; - return this; - } - - /** - * SHA-1 of each in /system/etc/security/otacerts.zip or "--IOException--" or "--no-output--" - * eg. dKXTm1QH9QShGQwBM/4rg6/lCNQ= - */ - public Builder otaCert(List otaCert) { - this.otaCert = checkForNulls(otaCert); - return this; - } - - /** - * Build.SERIAL != "unknown" - * eg. 07d90b18 - */ - public Builder serial(String serial) { - this.serial = serial; - return this; - } - - /** - * TelephonyManager.getDeviceId (8 hex-digits), not set on tablets - */ - public Builder esn(String esn) { - this.esn = esn; - return this; - } - - public Builder deviceConfiguration(DeviceConfig deviceConfiguration) { - this.deviceConfiguration = deviceConfiguration; - return this; - } - - /** - * "ethernet" or "wifi" - */ - public Builder macAddressType(List macAddressType) { - this.macAddressType = checkForNulls(macAddressType); - return this; - } - - /** - * unknown, use 0 on pre- and first-checkin, and 1 for later checkins - * also present on pre-checkin - */ - public Builder fragment(Integer fragment) { - this.fragment = fragment; - return this; - } - - /** - * unknown - */ - public Builder userName(String userName) { - this.userName = userName; - return this; - } - - /** - * UserManager.getUserSerialNumber - * eg. 0 - */ - public Builder userSerialNumber(Integer userSerialNumber) { - this.userSerialNumber = userSerialNumber; - return this; - } - - @Override - public CheckinRequest build() { - checkRequiredFields(); - return new CheckinRequest(this); - } - } - - public static final class Checkin extends Message { - - public static final Long DEFAULT_LASTCHECKINMS = 0L; - public static final List DEFAULT_EVENT = Collections.emptyList(); - public static final List DEFAULT_STAT = Collections.emptyList(); - public static final List DEFAULT_REQUESTEDGROUP = Collections.emptyList(); - public static final String DEFAULT_CELLOPERATOR = ""; - public static final String DEFAULT_SIMOPERATOR = ""; - public static final String DEFAULT_ROAMING = ""; - public static final Integer DEFAULT_USERNUMBER = 0; - - /** - * empty Build on pre-checkin - */ - @ProtoField(tag = 1, label = REQUIRED) - public final Checkin.Build build; - - /** - * last checkin ms or 0 if first checkin - * eg. 0 - */ - @ProtoField(tag = 2, type = INT64) - public final Long lastCheckinMs; - - /** - * eg. ("event_log_start",~,1424612602652) on first checkin - */ - @ProtoField(tag = 3, label = REPEATED, messageType = Checkin.Event.class) - public final List event; - - /** - * unknown, n/a on first checkin - */ - @ProtoField(tag = 4, label = REPEATED, messageType = Checkin.Statistic.class) - public final List stat; - - /** - * unused - */ - @ProtoField(tag = 5, type = STRING, label = REPEATED) - public final List requestedGroup; - - /** - * TelephonyManager.getNetworkOperator != null|empty - */ - @ProtoField(tag = 6, type = STRING) - public final String cellOperator; - - /** - * TelephonyManager.getSimOperator != null|empty - */ - @ProtoField(tag = 7, type = STRING) - public final String simOperator; - - /** - * "WIFI::" | ("mobile" | "notmobile" | "unknown") + "-" + ("roaming" | "notroaming" | "unknown") - */ - @ProtoField(tag = 8, type = STRING) - public final String roaming; - - /** - * UserHandle.myUserId - * eg. 0 - */ - @ProtoField(tag = 9, type = INT32) - public final Integer userNumber; - - public Checkin(Checkin.Build build, Long lastCheckinMs, List event, List stat, List requestedGroup, String cellOperator, String simOperator, String roaming, Integer userNumber) { - this.build = build; - this.lastCheckinMs = lastCheckinMs; - this.event = immutableCopyOf(event); - this.stat = immutableCopyOf(stat); - this.requestedGroup = immutableCopyOf(requestedGroup); - this.cellOperator = cellOperator; - this.simOperator = simOperator; - this.roaming = roaming; - this.userNumber = userNumber; - } - - private Checkin(Builder builder) { - this(builder.build, builder.lastCheckinMs, builder.event, builder.stat, builder.requestedGroup, builder.cellOperator, builder.simOperator, builder.roaming, builder.userNumber); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Checkin)) return false; - Checkin o = (Checkin) other; - return equals(build, o.build) - && equals(lastCheckinMs, o.lastCheckinMs) - && equals(event, o.event) - && equals(stat, o.stat) - && equals(requestedGroup, o.requestedGroup) - && equals(cellOperator, o.cellOperator) - && equals(simOperator, o.simOperator) - && equals(roaming, o.roaming) - && equals(userNumber, o.userNumber); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = build != null ? build.hashCode() : 0; - result = result * 37 + (lastCheckinMs != null ? lastCheckinMs.hashCode() : 0); - result = result * 37 + (event != null ? event.hashCode() : 1); - result = result * 37 + (stat != null ? stat.hashCode() : 1); - result = result * 37 + (requestedGroup != null ? requestedGroup.hashCode() : 1); - result = result * 37 + (cellOperator != null ? cellOperator.hashCode() : 0); - result = result * 37 + (simOperator != null ? simOperator.hashCode() : 0); - result = result * 37 + (roaming != null ? roaming.hashCode() : 0); - result = result * 37 + (userNumber != null ? userNumber.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Checkin.Build build; - public Long lastCheckinMs; - public List event; - public List stat; - public List requestedGroup; - public String cellOperator; - public String simOperator; - public String roaming; - public Integer userNumber; - - public Builder() { - } - - public Builder(Checkin message) { - super(message); - if (message == null) return; - this.build = message.build; - this.lastCheckinMs = message.lastCheckinMs; - this.event = copyOf(message.event); - this.stat = copyOf(message.stat); - this.requestedGroup = copyOf(message.requestedGroup); - this.cellOperator = message.cellOperator; - this.simOperator = message.simOperator; - this.roaming = message.roaming; - this.userNumber = message.userNumber; - } - - /** - * empty Build on pre-checkin - */ - public Builder build(Checkin.Build build) { - this.build = build; - return this; - } - - /** - * last checkin ms or 0 if first checkin - * eg. 0 - */ - public Builder lastCheckinMs(Long lastCheckinMs) { - this.lastCheckinMs = lastCheckinMs; - return this; - } - - /** - * eg. ("event_log_start",~,1424612602652) on first checkin - */ - public Builder event(List event) { - this.event = checkForNulls(event); - return this; - } - - /** - * unknown, n/a on first checkin - */ - public Builder stat(List stat) { - this.stat = checkForNulls(stat); - return this; - } - - /** - * unused - */ - public Builder requestedGroup(List requestedGroup) { - this.requestedGroup = checkForNulls(requestedGroup); - return this; - } - - /** - * TelephonyManager.getNetworkOperator != null|empty - */ - public Builder cellOperator(String cellOperator) { - this.cellOperator = cellOperator; - return this; - } - - /** - * TelephonyManager.getSimOperator != null|empty - */ - public Builder simOperator(String simOperator) { - this.simOperator = simOperator; - return this; - } - - /** - * "WIFI::" | ("mobile" | "notmobile" | "unknown") + "-" + ("roaming" | "notroaming" | "unknown") - */ - public Builder roaming(String roaming) { - this.roaming = roaming; - return this; - } - - /** - * UserHandle.myUserId - * eg. 0 - */ - public Builder userNumber(Integer userNumber) { - this.userNumber = userNumber; - return this; - } - - @Override - public Checkin build() { - checkRequiredFields(); - return new Checkin(this); - } - } - - public static final class Build extends Message { - - public static final String DEFAULT_FINGERPRINT = ""; - public static final String DEFAULT_HARDWARE = ""; - public static final String DEFAULT_BRAND = ""; - public static final String DEFAULT_RADIO = ""; - public static final String DEFAULT_BOOTLOADER = ""; - public static final String DEFAULT_CLIENTID = ""; - public static final Long DEFAULT_TIME = 0L; - public static final Integer DEFAULT_PACKAGEVERSIONCODE = 0; - public static final String DEFAULT_DEVICE = ""; - public static final Integer DEFAULT_SDKVERSION = 0; - public static final String DEFAULT_MODEL = ""; - public static final String DEFAULT_MANUFACTURER = ""; - public static final String DEFAULT_PRODUCT = ""; - public static final Boolean DEFAULT_OTAINSTALLED = false; - - /** - * Build.FINGERPRINT - * eg. google/razor/flo:5.0.1/LRX22C/1602158:user/release-keys - */ - @ProtoField(tag = 1, type = STRING) - public final String fingerprint; - - /** - * Build.HARDWARE - * eg. flo - */ - @ProtoField(tag = 2, type = STRING) - public final String hardware; - - /** - * Build.BRAND - * eg. google - */ - @ProtoField(tag = 3, type = STRING) - public final String brand; - - /** - * Build.getRadioVersion() - */ - @ProtoField(tag = 4, type = STRING) - public final String radio; - - /** - * Build.BOOTLOADER - * eg. FLO-04.04 - */ - @ProtoField(tag = 5, type = STRING) - public final String bootloader; - - /** - * GoogleSettingsContract.Partner["client_id"] - * eg. android-google - */ - @ProtoField(tag = 6, type = STRING) - public final String clientId; - - /** - * Build.TIME / 1000L - * eg. 1416533192 - */ - @ProtoField(tag = 7, type = INT64) - public final Long time; - - /** - * PackageInfo.versionCode - * eg. 6188736 - */ - @ProtoField(tag = 8, type = INT32) - public final Integer packageVersionCode; - - /** - * Build.DEVICE - * eg. flo - */ - @ProtoField(tag = 9, type = STRING) - public final String device; - - /** - * Build.VERSION.SDK_INT - * eg. 21 - */ - @ProtoField(tag = 10, type = INT32) - public final Integer sdkVersion; - - /** - * Build.MODEL - * eg. Nexus 7 - */ - @ProtoField(tag = 11, type = STRING) - public final String model; - - /** - * Build.MANUFACTURER - * eg. asus - */ - @ProtoField(tag = 12, type = STRING) - public final String manufacturer; - - /** - * Build.PRODUCT - * eg. razor - */ - @ProtoField(tag = 13, type = STRING) - public final String product; - - /** - * fileExists("/system/recovery-from-boot.p") - * eg. false - */ - @ProtoField(tag = 14, type = BOOL) - public final Boolean otaInstalled; - - public Build(String fingerprint, String hardware, String brand, String radio, String bootloader, String clientId, Long time, Integer packageVersionCode, String device, Integer sdkVersion, String model, String manufacturer, String product, Boolean otaInstalled) { - this.fingerprint = fingerprint; - this.hardware = hardware; - this.brand = brand; - this.radio = radio; - this.bootloader = bootloader; - this.clientId = clientId; - this.time = time; - this.packageVersionCode = packageVersionCode; - this.device = device; - this.sdkVersion = sdkVersion; - this.model = model; - this.manufacturer = manufacturer; - this.product = product; - this.otaInstalled = otaInstalled; - } - - private Build(Builder builder) { - this(builder.fingerprint, builder.hardware, builder.brand, builder.radio, builder.bootloader, builder.clientId, builder.time, builder.packageVersionCode, builder.device, builder.sdkVersion, builder.model, builder.manufacturer, builder.product, builder.otaInstalled); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Build)) return false; - Build o = (Build) other; - return equals(fingerprint, o.fingerprint) - && equals(hardware, o.hardware) - && equals(brand, o.brand) - && equals(radio, o.radio) - && equals(bootloader, o.bootloader) - && equals(clientId, o.clientId) - && equals(time, o.time) - && equals(packageVersionCode, o.packageVersionCode) - && equals(device, o.device) - && equals(sdkVersion, o.sdkVersion) - && equals(model, o.model) - && equals(manufacturer, o.manufacturer) - && equals(product, o.product) - && equals(otaInstalled, o.otaInstalled); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = fingerprint != null ? fingerprint.hashCode() : 0; - result = result * 37 + (hardware != null ? hardware.hashCode() : 0); - result = result * 37 + (brand != null ? brand.hashCode() : 0); - result = result * 37 + (radio != null ? radio.hashCode() : 0); - result = result * 37 + (bootloader != null ? bootloader.hashCode() : 0); - result = result * 37 + (clientId != null ? clientId.hashCode() : 0); - result = result * 37 + (time != null ? time.hashCode() : 0); - result = result * 37 + (packageVersionCode != null ? packageVersionCode.hashCode() : 0); - result = result * 37 + (device != null ? device.hashCode() : 0); - result = result * 37 + (sdkVersion != null ? sdkVersion.hashCode() : 0); - result = result * 37 + (model != null ? model.hashCode() : 0); - result = result * 37 + (manufacturer != null ? manufacturer.hashCode() : 0); - result = result * 37 + (product != null ? product.hashCode() : 0); - result = result * 37 + (otaInstalled != null ? otaInstalled.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String fingerprint; - public String hardware; - public String brand; - public String radio; - public String bootloader; - public String clientId; - public Long time; - public Integer packageVersionCode; - public String device; - public Integer sdkVersion; - public String model; - public String manufacturer; - public String product; - public Boolean otaInstalled; - - public Builder() { - } - - public Builder(Build message) { - super(message); - if (message == null) return; - this.fingerprint = message.fingerprint; - this.hardware = message.hardware; - this.brand = message.brand; - this.radio = message.radio; - this.bootloader = message.bootloader; - this.clientId = message.clientId; - this.time = message.time; - this.packageVersionCode = message.packageVersionCode; - this.device = message.device; - this.sdkVersion = message.sdkVersion; - this.model = message.model; - this.manufacturer = message.manufacturer; - this.product = message.product; - this.otaInstalled = message.otaInstalled; - } - - /** - * Build.FINGERPRINT - * eg. google/razor/flo:5.0.1/LRX22C/1602158:user/release-keys - */ - public Builder fingerprint(String fingerprint) { - this.fingerprint = fingerprint; - return this; - } - - /** - * Build.HARDWARE - * eg. flo - */ - public Builder hardware(String hardware) { - this.hardware = hardware; - return this; - } - - /** - * Build.BRAND - * eg. google - */ - public Builder brand(String brand) { - this.brand = brand; - return this; - } - - /** - * Build.getRadioVersion() - */ - public Builder radio(String radio) { - this.radio = radio; - return this; - } - - /** - * Build.BOOTLOADER - * eg. FLO-04.04 - */ - public Builder bootloader(String bootloader) { - this.bootloader = bootloader; - return this; - } - - /** - * GoogleSettingsContract.Partner["client_id"] - * eg. android-google - */ - public Builder clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Build.TIME / 1000L - * eg. 1416533192 - */ - public Builder time(Long time) { - this.time = time; - return this; - } - - /** - * PackageInfo.versionCode - * eg. 6188736 - */ - public Builder packageVersionCode(Integer packageVersionCode) { - this.packageVersionCode = packageVersionCode; - return this; - } - - /** - * Build.DEVICE - * eg. flo - */ - public Builder device(String device) { - this.device = device; - return this; - } - - /** - * Build.VERSION.SDK_INT - * eg. 21 - */ - public Builder sdkVersion(Integer sdkVersion) { - this.sdkVersion = sdkVersion; - return this; - } - - /** - * Build.MODEL - * eg. Nexus 7 - */ - public Builder model(String model) { - this.model = model; - return this; - } - - /** - * Build.MANUFACTURER - * eg. asus - */ - public Builder manufacturer(String manufacturer) { - this.manufacturer = manufacturer; - return this; - } - - /** - * Build.PRODUCT - * eg. razor - */ - public Builder product(String product) { - this.product = product; - return this; - } - - /** - * fileExists("/system/recovery-from-boot.p") - * eg. false - */ - public Builder otaInstalled(Boolean otaInstalled) { - this.otaInstalled = otaInstalled; - return this; - } - - @Override - public Build build() { - return new Build(this); - } - } - } - - public static final class Event extends Message { - - public static final String DEFAULT_TAG = ""; - public static final String DEFAULT_VALUE = ""; - public static final Long DEFAULT_TIMEMS = 0L; - - @ProtoField(tag = 1, type = STRING) - public final String tag; - - @ProtoField(tag = 2, type = STRING) - public final String value; - - @ProtoField(tag = 3, type = INT64) - public final Long timeMs; - - public Event(String tag, String value, Long timeMs) { - this.tag = tag; - this.value = value; - this.timeMs = timeMs; - } - - private Event(Builder builder) { - this(builder.tag, builder.value, builder.timeMs); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Event)) return false; - Event o = (Event) other; - return equals(tag, o.tag) - && equals(value, o.value) - && equals(timeMs, o.timeMs); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = tag != null ? tag.hashCode() : 0; - result = result * 37 + (value != null ? value.hashCode() : 0); - result = result * 37 + (timeMs != null ? timeMs.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String tag; - public String value; - public Long timeMs; - - public Builder() { - } - - public Builder(Event message) { - super(message); - if (message == null) return; - this.tag = message.tag; - this.value = message.value; - this.timeMs = message.timeMs; - } - - public Builder tag(String tag) { - this.tag = tag; - return this; - } - - public Builder value(String value) { - this.value = value; - return this; - } - - public Builder timeMs(Long timeMs) { - this.timeMs = timeMs; - return this; - } - - @Override - public Event build() { - return new Event(this); - } - } - } - - public static final class Statistic extends Message { - - public static final String DEFAULT_TAG = ""; - public static final Integer DEFAULT_COUNT = 0; - public static final Float DEFAULT_SUM = 0F; - - @ProtoField(tag = 1, type = STRING, label = REQUIRED) - public final String tag; - - @ProtoField(tag = 2, type = INT32) - public final Integer count; - - @ProtoField(tag = 3, type = FLOAT) - public final Float sum; - - public Statistic(String tag, Integer count, Float sum) { - this.tag = tag; - this.count = count; - this.sum = sum; - } - - private Statistic(Builder builder) { - this(builder.tag, builder.count, builder.sum); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Statistic)) return false; - Statistic o = (Statistic) other; - return equals(tag, o.tag) - && equals(count, o.count) - && equals(sum, o.sum); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = tag != null ? tag.hashCode() : 0; - result = result * 37 + (count != null ? count.hashCode() : 0); - result = result * 37 + (sum != null ? sum.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String tag; - public Integer count; - public Float sum; - - public Builder() { - } - - public Builder(Statistic message) { - super(message); - if (message == null) return; - this.tag = message.tag; - this.count = message.count; - this.sum = message.sum; - } - - public Builder tag(String tag) { - this.tag = tag; - return this; - } - - public Builder count(Integer count) { - this.count = count; - return this; - } - - public Builder sum(Float sum) { - this.sum = sum; - return this; - } - - @Override - public Statistic build() { - checkRequiredFields(); - return new Statistic(this); - } - } - } - } - - public static final class DeviceConfig extends Message { - - public static final Integer DEFAULT_TOUCHSCREEN = 0; - public static final Integer DEFAULT_KEYBOARDTYPE = 0; - public static final Integer DEFAULT_NAVIGATION = 0; - public static final Integer DEFAULT_SCREENLAYOUT = 0; - public static final Boolean DEFAULT_HASHARDKEYBOARD = false; - public static final Boolean DEFAULT_HASFIVEWAYNAVIGATION = false; - public static final Integer DEFAULT_DENSITYDPI = 0; - public static final Integer DEFAULT_GLESVERSION = 0; - public static final List DEFAULT_SHAREDLIBRARY = Collections.emptyList(); - public static final List DEFAULT_AVAILABLEFEATURE = Collections.emptyList(); - public static final List DEFAULT_NATIVEPLATFORM = Collections.emptyList(); - public static final Integer DEFAULT_WIDTHPIXELS = 0; - public static final Integer DEFAULT_HEIGHTPIXELS = 0; - public static final List DEFAULT_LOCALE = Collections.emptyList(); - public static final List DEFAULT_GLEXTENSION = Collections.emptyList(); - public static final Integer DEFAULT_DEVICECLASS = 0; - public static final Integer DEFAULT_MAXAPKDOWNLOADSIZEMB = 0; - - /** - * ConfigurationInfo.reqTouchScreen - * eg. 3 - */ - @ProtoField(tag = 1, type = INT32) - public final Integer touchScreen; - - /** - * ConfigurationInfo.reqKeyboardType - * eg. 1 - */ - @ProtoField(tag = 2, type = INT32) - public final Integer keyboardType; - - /** - * ConfigurationInfo.reqNavigation - * eg. 1 - */ - @ProtoField(tag = 3, type = INT32) - public final Integer navigation; - - /** - * ConfigurationInfo.screenLayout - * eg. 3 - */ - @ProtoField(tag = 4, type = INT32) - public final Integer screenLayout; - - /** - * ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD - * eg. 0 - */ - @ProtoField(tag = 5, type = BOOL) - public final Boolean hasHardKeyboard; - - /** - * ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV - * eg. 0 - */ - @ProtoField(tag = 6, type = BOOL) - public final Boolean hasFiveWayNavigation; - - /** - * DisplayMetrics.densityDpi - * eg. 320 - */ - @ProtoField(tag = 7, type = INT32) - public final Integer densityDpi; - - /** - * ConfigurationInfo.reqGlEsVersion - * eg. 196608 - */ - @ProtoField(tag = 8, type = INT32) - public final Integer glEsVersion; - - /** - * PackageManager.getSystemSharedLibraryNames - * eg. "android.test.runner", "com.android.future.usb.accessory", "com.android.location.provider", - * "com.android.media.remotedisplay", "com.android.mediadrm.signer", "com.google.android.maps", - * "com.google.android.media.effects", "com.google.widevine.software.drm", "javax.obex" - */ - @ProtoField(tag = 9, type = STRING, label = REPEATED) - public final List sharedLibrary; - - /** - * PackageManager.getSystemAvailableFeatures - * eg. android.hardware.[...] - */ - @ProtoField(tag = 10, type = STRING, label = REPEATED) - public final List availableFeature; - - /** - * Build.CPU_ABI and Build.CPU_ABI2 != "unknown" - * eg. "armeabi-v7a", "armeabi" - */ - @ProtoField(tag = 11, type = STRING, label = REPEATED) - public final List nativePlatform; - - /** - * DisplayMetrics.widthPixels - * eg. 1200 - */ - @ProtoField(tag = 12, type = INT32) - public final Integer widthPixels; - - /** - * DisplayMetrics.heightPixels - * eg. 1824 - */ - @ProtoField(tag = 13, type = INT32) - public final Integer heightPixels; - - /** - * Context.getAssets.getLocales - * eg. [...], "en-US", [...] - */ - @ProtoField(tag = 14, type = STRING, label = REPEATED) - public final List locale; - - /** - * GLES10.glGetString(GLES10.GL_EXTENSIONS) - * eg. "GL_AMD_compressed_ATC_texture", [...] - */ - @ProtoField(tag = 15, type = STRING, label = REPEATED) - public final List glExtension; - - /** - * unused - */ - @ProtoField(tag = 16, type = INT32) - public final Integer deviceClass; - - /** - * unused - */ - @ProtoField(tag = 17, type = INT32) - public final Integer maxApkDownloadSizeMb; - - public DeviceConfig(Integer touchScreen, Integer keyboardType, Integer navigation, Integer screenLayout, Boolean hasHardKeyboard, Boolean hasFiveWayNavigation, Integer densityDpi, Integer glEsVersion, List sharedLibrary, List availableFeature, List nativePlatform, Integer widthPixels, Integer heightPixels, List locale, List glExtension, Integer deviceClass, Integer maxApkDownloadSizeMb) { - this.touchScreen = touchScreen; - this.keyboardType = keyboardType; - this.navigation = navigation; - this.screenLayout = screenLayout; - this.hasHardKeyboard = hasHardKeyboard; - this.hasFiveWayNavigation = hasFiveWayNavigation; - this.densityDpi = densityDpi; - this.glEsVersion = glEsVersion; - this.sharedLibrary = immutableCopyOf(sharedLibrary); - this.availableFeature = immutableCopyOf(availableFeature); - this.nativePlatform = immutableCopyOf(nativePlatform); - this.widthPixels = widthPixels; - this.heightPixels = heightPixels; - this.locale = immutableCopyOf(locale); - this.glExtension = immutableCopyOf(glExtension); - this.deviceClass = deviceClass; - this.maxApkDownloadSizeMb = maxApkDownloadSizeMb; - } - - private DeviceConfig(Builder builder) { - this(builder.touchScreen, builder.keyboardType, builder.navigation, builder.screenLayout, builder.hasHardKeyboard, builder.hasFiveWayNavigation, builder.densityDpi, builder.glEsVersion, builder.sharedLibrary, builder.availableFeature, builder.nativePlatform, builder.widthPixels, builder.heightPixels, builder.locale, builder.glExtension, builder.deviceClass, builder.maxApkDownloadSizeMb); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof DeviceConfig)) return false; - DeviceConfig o = (DeviceConfig) other; - return equals(touchScreen, o.touchScreen) - && equals(keyboardType, o.keyboardType) - && equals(navigation, o.navigation) - && equals(screenLayout, o.screenLayout) - && equals(hasHardKeyboard, o.hasHardKeyboard) - && equals(hasFiveWayNavigation, o.hasFiveWayNavigation) - && equals(densityDpi, o.densityDpi) - && equals(glEsVersion, o.glEsVersion) - && equals(sharedLibrary, o.sharedLibrary) - && equals(availableFeature, o.availableFeature) - && equals(nativePlatform, o.nativePlatform) - && equals(widthPixels, o.widthPixels) - && equals(heightPixels, o.heightPixels) - && equals(locale, o.locale) - && equals(glExtension, o.glExtension) - && equals(deviceClass, o.deviceClass) - && equals(maxApkDownloadSizeMb, o.maxApkDownloadSizeMb); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = touchScreen != null ? touchScreen.hashCode() : 0; - result = result * 37 + (keyboardType != null ? keyboardType.hashCode() : 0); - result = result * 37 + (navigation != null ? navigation.hashCode() : 0); - result = result * 37 + (screenLayout != null ? screenLayout.hashCode() : 0); - result = result * 37 + (hasHardKeyboard != null ? hasHardKeyboard.hashCode() : 0); - result = result * 37 + (hasFiveWayNavigation != null ? hasFiveWayNavigation.hashCode() : 0); - result = result * 37 + (densityDpi != null ? densityDpi.hashCode() : 0); - result = result * 37 + (glEsVersion != null ? glEsVersion.hashCode() : 0); - result = result * 37 + (sharedLibrary != null ? sharedLibrary.hashCode() : 1); - result = result * 37 + (availableFeature != null ? availableFeature.hashCode() : 1); - result = result * 37 + (nativePlatform != null ? nativePlatform.hashCode() : 1); - result = result * 37 + (widthPixels != null ? widthPixels.hashCode() : 0); - result = result * 37 + (heightPixels != null ? heightPixels.hashCode() : 0); - result = result * 37 + (locale != null ? locale.hashCode() : 1); - result = result * 37 + (glExtension != null ? glExtension.hashCode() : 1); - result = result * 37 + (deviceClass != null ? deviceClass.hashCode() : 0); - result = result * 37 + (maxApkDownloadSizeMb != null ? maxApkDownloadSizeMb.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer touchScreen; - public Integer keyboardType; - public Integer navigation; - public Integer screenLayout; - public Boolean hasHardKeyboard; - public Boolean hasFiveWayNavigation; - public Integer densityDpi; - public Integer glEsVersion; - public List sharedLibrary; - public List availableFeature; - public List nativePlatform; - public Integer widthPixels; - public Integer heightPixels; - public List locale; - public List glExtension; - public Integer deviceClass; - public Integer maxApkDownloadSizeMb; - - public Builder() { - } - - public Builder(DeviceConfig message) { - super(message); - if (message == null) return; - this.touchScreen = message.touchScreen; - this.keyboardType = message.keyboardType; - this.navigation = message.navigation; - this.screenLayout = message.screenLayout; - this.hasHardKeyboard = message.hasHardKeyboard; - this.hasFiveWayNavigation = message.hasFiveWayNavigation; - this.densityDpi = message.densityDpi; - this.glEsVersion = message.glEsVersion; - this.sharedLibrary = copyOf(message.sharedLibrary); - this.availableFeature = copyOf(message.availableFeature); - this.nativePlatform = copyOf(message.nativePlatform); - this.widthPixels = message.widthPixels; - this.heightPixels = message.heightPixels; - this.locale = copyOf(message.locale); - this.glExtension = copyOf(message.glExtension); - this.deviceClass = message.deviceClass; - this.maxApkDownloadSizeMb = message.maxApkDownloadSizeMb; - } - - /** - * ConfigurationInfo.reqTouchScreen - * eg. 3 - */ - public Builder touchScreen(Integer touchScreen) { - this.touchScreen = touchScreen; - return this; - } - - /** - * ConfigurationInfo.reqKeyboardType - * eg. 1 - */ - public Builder keyboardType(Integer keyboardType) { - this.keyboardType = keyboardType; - return this; - } - - /** - * ConfigurationInfo.reqNavigation - * eg. 1 - */ - public Builder navigation(Integer navigation) { - this.navigation = navigation; - return this; - } - - /** - * ConfigurationInfo.screenLayout - * eg. 3 - */ - public Builder screenLayout(Integer screenLayout) { - this.screenLayout = screenLayout; - return this; - } - - /** - * ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD - * eg. 0 - */ - public Builder hasHardKeyboard(Boolean hasHardKeyboard) { - this.hasHardKeyboard = hasHardKeyboard; - return this; - } - - /** - * ConfigurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV - * eg. 0 - */ - public Builder hasFiveWayNavigation(Boolean hasFiveWayNavigation) { - this.hasFiveWayNavigation = hasFiveWayNavigation; - return this; - } - - /** - * DisplayMetrics.densityDpi - * eg. 320 - */ - public Builder densityDpi(Integer densityDpi) { - this.densityDpi = densityDpi; - return this; - } - - /** - * ConfigurationInfo.reqGlEsVersion - * eg. 196608 - */ - public Builder glEsVersion(Integer glEsVersion) { - this.glEsVersion = glEsVersion; - return this; - } - - /** - * PackageManager.getSystemSharedLibraryNames - * eg. "android.test.runner", "com.android.future.usb.accessory", "com.android.location.provider", - * "com.android.media.remotedisplay", "com.android.mediadrm.signer", "com.google.android.maps", - * "com.google.android.media.effects", "com.google.widevine.software.drm", "javax.obex" - */ - public Builder sharedLibrary(List sharedLibrary) { - this.sharedLibrary = checkForNulls(sharedLibrary); - return this; - } - - /** - * PackageManager.getSystemAvailableFeatures - * eg. android.hardware.[...] - */ - public Builder availableFeature(List availableFeature) { - this.availableFeature = checkForNulls(availableFeature); - return this; - } - - /** - * Build.CPU_ABI and Build.CPU_ABI2 != "unknown" - * eg. "armeabi-v7a", "armeabi" - */ - public Builder nativePlatform(List nativePlatform) { - this.nativePlatform = checkForNulls(nativePlatform); - return this; - } - - /** - * DisplayMetrics.widthPixels - * eg. 1200 - */ - public Builder widthPixels(Integer widthPixels) { - this.widthPixels = widthPixels; - return this; - } - - /** - * DisplayMetrics.heightPixels - * eg. 1824 - */ - public Builder heightPixels(Integer heightPixels) { - this.heightPixels = heightPixels; - return this; - } - - /** - * Context.getAssets.getLocales - * eg. [...], "en-US", [...] - */ - public Builder locale(List locale) { - this.locale = checkForNulls(locale); - return this; - } - - /** - * GLES10.glGetString(GLES10.GL_EXTENSIONS) - * eg. "GL_AMD_compressed_ATC_texture", [...] - */ - public Builder glExtension(List glExtension) { - this.glExtension = checkForNulls(glExtension); - return this; - } - - /** - * unused - */ - public Builder deviceClass(Integer deviceClass) { - this.deviceClass = deviceClass; - return this; - } - - /** - * unused - */ - public Builder maxApkDownloadSizeMb(Integer maxApkDownloadSizeMb) { - this.maxApkDownloadSizeMb = maxApkDownloadSizeMb; - return this; - } - - @Override - public DeviceConfig build() { - return new DeviceConfig(this); - } - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinResponse.java b/play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinResponse.java deleted file mode 100644 index b98356a8..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/checkin/CheckinResponse.java +++ /dev/null @@ -1,490 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/checkin.proto -package org.microg.gms.checkin; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; -import java.util.Collections; -import java.util.List; -import okio.ByteString; - -import static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.BYTES; -import static com.squareup.wire.Message.Datatype.FIXED64; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; - -public final class CheckinResponse extends Message { - - public static final Boolean DEFAULT_STATSOK = false; - public static final List DEFAULT_INTENT = Collections.emptyList(); - public static final Long DEFAULT_TIMEMS = 0L; - public static final String DEFAULT_DIGEST = ""; - public static final List DEFAULT_SETTING = Collections.emptyList(); - public static final Boolean DEFAULT_MARKETOK = false; - public static final Long DEFAULT_ANDROIDID = 0L; - public static final Long DEFAULT_SECURITYTOKEN = 0L; - public static final Boolean DEFAULT_SETTINGSDIFF = false; - public static final List DEFAULT_DELETESETTING = Collections.emptyList(); - public static final String DEFAULT_VERSIONINFO = ""; - public static final String DEFAULT_DEVICEDATAVERSIONINFO = ""; - - @ProtoField(tag = 1, type = BOOL) - public final Boolean statsOk; - - @ProtoField(tag = 2, label = REPEATED, messageType = Intent.class) - public final List intent; - - @ProtoField(tag = 3, type = INT64) - public final Long timeMs; - - @ProtoField(tag = 4, type = STRING) - public final String digest; - - @ProtoField(tag = 5, label = REPEATED, messageType = GservicesSetting.class) - public final List setting; - - @ProtoField(tag = 6, type = BOOL) - public final Boolean marketOk; - - @ProtoField(tag = 7, type = FIXED64) - public final Long androidId; - - @ProtoField(tag = 8, type = FIXED64) - public final Long securityToken; - - @ProtoField(tag = 9, type = BOOL) - public final Boolean settingsDiff; - - @ProtoField(tag = 10, type = STRING, label = REPEATED) - public final List deleteSetting; - - @ProtoField(tag = 11, type = STRING) - public final String versionInfo; - - @ProtoField(tag = 12, type = STRING) - public final String deviceDataVersionInfo; - - public CheckinResponse(Boolean statsOk, List intent, Long timeMs, String digest, List setting, Boolean marketOk, Long androidId, Long securityToken, Boolean settingsDiff, List deleteSetting, String versionInfo, String deviceDataVersionInfo) { - this.statsOk = statsOk; - this.intent = immutableCopyOf(intent); - this.timeMs = timeMs; - this.digest = digest; - this.setting = immutableCopyOf(setting); - this.marketOk = marketOk; - this.androidId = androidId; - this.securityToken = securityToken; - this.settingsDiff = settingsDiff; - this.deleteSetting = immutableCopyOf(deleteSetting); - this.versionInfo = versionInfo; - this.deviceDataVersionInfo = deviceDataVersionInfo; - } - - private CheckinResponse(Builder builder) { - this(builder.statsOk, builder.intent, builder.timeMs, builder.digest, builder.setting, builder.marketOk, builder.androidId, builder.securityToken, builder.settingsDiff, builder.deleteSetting, builder.versionInfo, builder.deviceDataVersionInfo); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof CheckinResponse)) return false; - CheckinResponse o = (CheckinResponse) other; - return equals(statsOk, o.statsOk) - && equals(intent, o.intent) - && equals(timeMs, o.timeMs) - && equals(digest, o.digest) - && equals(setting, o.setting) - && equals(marketOk, o.marketOk) - && equals(androidId, o.androidId) - && equals(securityToken, o.securityToken) - && equals(settingsDiff, o.settingsDiff) - && equals(deleteSetting, o.deleteSetting) - && equals(versionInfo, o.versionInfo) - && equals(deviceDataVersionInfo, o.deviceDataVersionInfo); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = statsOk != null ? statsOk.hashCode() : 0; - result = result * 37 + (intent != null ? intent.hashCode() : 1); - result = result * 37 + (timeMs != null ? timeMs.hashCode() : 0); - result = result * 37 + (digest != null ? digest.hashCode() : 0); - result = result * 37 + (setting != null ? setting.hashCode() : 1); - result = result * 37 + (marketOk != null ? marketOk.hashCode() : 0); - result = result * 37 + (androidId != null ? androidId.hashCode() : 0); - result = result * 37 + (securityToken != null ? securityToken.hashCode() : 0); - result = result * 37 + (settingsDiff != null ? settingsDiff.hashCode() : 0); - result = result * 37 + (deleteSetting != null ? deleteSetting.hashCode() : 1); - result = result * 37 + (versionInfo != null ? versionInfo.hashCode() : 0); - result = result * 37 + (deviceDataVersionInfo != null ? deviceDataVersionInfo.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Boolean statsOk; - public List intent; - public Long timeMs; - public String digest; - public List setting; - public Boolean marketOk; - public Long androidId; - public Long securityToken; - public Boolean settingsDiff; - public List deleteSetting; - public String versionInfo; - public String deviceDataVersionInfo; - - public Builder() { - } - - public Builder(CheckinResponse message) { - super(message); - if (message == null) return; - this.statsOk = message.statsOk; - this.intent = copyOf(message.intent); - this.timeMs = message.timeMs; - this.digest = message.digest; - this.setting = copyOf(message.setting); - this.marketOk = message.marketOk; - this.androidId = message.androidId; - this.securityToken = message.securityToken; - this.settingsDiff = message.settingsDiff; - this.deleteSetting = copyOf(message.deleteSetting); - this.versionInfo = message.versionInfo; - this.deviceDataVersionInfo = message.deviceDataVersionInfo; - } - - public Builder statsOk(Boolean statsOk) { - this.statsOk = statsOk; - return this; - } - - public Builder intent(List intent) { - this.intent = checkForNulls(intent); - return this; - } - - public Builder timeMs(Long timeMs) { - this.timeMs = timeMs; - return this; - } - - public Builder digest(String digest) { - this.digest = digest; - return this; - } - - public Builder setting(List setting) { - this.setting = checkForNulls(setting); - return this; - } - - public Builder marketOk(Boolean marketOk) { - this.marketOk = marketOk; - return this; - } - - public Builder androidId(Long androidId) { - this.androidId = androidId; - return this; - } - - public Builder securityToken(Long securityToken) { - this.securityToken = securityToken; - return this; - } - - public Builder settingsDiff(Boolean settingsDiff) { - this.settingsDiff = settingsDiff; - return this; - } - - public Builder deleteSetting(List deleteSetting) { - this.deleteSetting = checkForNulls(deleteSetting); - return this; - } - - public Builder versionInfo(String versionInfo) { - this.versionInfo = versionInfo; - return this; - } - - public Builder deviceDataVersionInfo(String deviceDataVersionInfo) { - this.deviceDataVersionInfo = deviceDataVersionInfo; - return this; - } - - @Override - public CheckinResponse build() { - return new CheckinResponse(this); - } - } - - public static final class Intent extends Message { - - public static final String DEFAULT_ACTION = ""; - public static final String DEFAULT_DATAURI = ""; - public static final String DEFAULT_MIMETYPE = ""; - public static final String DEFAULT_JAVACLASS = ""; - public static final List DEFAULT_EXTRA = Collections.emptyList(); - - @ProtoField(tag = 1, type = STRING) - public final String action; - - @ProtoField(tag = 2, type = STRING) - public final String dataUri; - - @ProtoField(tag = 3, type = STRING) - public final String mimeType; - - @ProtoField(tag = 4, type = STRING) - public final String javaClass; - - @ProtoField(tag = 5, label = REPEATED, messageType = Intent.Extra.class) - public final List extra; - - public Intent(String action, String dataUri, String mimeType, String javaClass, List extra) { - this.action = action; - this.dataUri = dataUri; - this.mimeType = mimeType; - this.javaClass = javaClass; - this.extra = immutableCopyOf(extra); - } - - private Intent(Builder builder) { - this(builder.action, builder.dataUri, builder.mimeType, builder.javaClass, builder.extra); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Intent)) return false; - Intent o = (Intent) other; - return equals(action, o.action) - && equals(dataUri, o.dataUri) - && equals(mimeType, o.mimeType) - && equals(javaClass, o.javaClass) - && equals(extra, o.extra); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = action != null ? action.hashCode() : 0; - result = result * 37 + (dataUri != null ? dataUri.hashCode() : 0); - result = result * 37 + (mimeType != null ? mimeType.hashCode() : 0); - result = result * 37 + (javaClass != null ? javaClass.hashCode() : 0); - result = result * 37 + (extra != null ? extra.hashCode() : 1); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String action; - public String dataUri; - public String mimeType; - public String javaClass; - public List extra; - - public Builder() { - } - - public Builder(Intent message) { - super(message); - if (message == null) return; - this.action = message.action; - this.dataUri = message.dataUri; - this.mimeType = message.mimeType; - this.javaClass = message.javaClass; - this.extra = copyOf(message.extra); - } - - public Builder action(String action) { - this.action = action; - return this; - } - - public Builder dataUri(String dataUri) { - this.dataUri = dataUri; - return this; - } - - public Builder mimeType(String mimeType) { - this.mimeType = mimeType; - return this; - } - - public Builder javaClass(String javaClass) { - this.javaClass = javaClass; - return this; - } - - public Builder extra(List extra) { - this.extra = checkForNulls(extra); - return this; - } - - @Override - public Intent build() { - return new Intent(this); - } - } - - public static final class Extra extends Message { - - public static final String DEFAULT_NAME = ""; - public static final String DEFAULT_VALUE = ""; - - @ProtoField(tag = 6, type = STRING) - public final String name; - - @ProtoField(tag = 7, type = STRING) - public final String value; - - public Extra(String name, String value) { - this.name = name; - this.value = value; - } - - private Extra(Builder builder) { - this(builder.name, builder.value); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Extra)) return false; - Extra o = (Extra) other; - return equals(name, o.name) - && equals(value, o.value); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = name != null ? name.hashCode() : 0; - result = result * 37 + (value != null ? value.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String name; - public String value; - - public Builder() { - } - - public Builder(Extra message) { - super(message); - if (message == null) return; - this.name = message.name; - this.value = message.value; - } - - public Builder name(String name) { - this.name = name; - return this; - } - - public Builder value(String value) { - this.value = value; - return this; - } - - @Override - public Extra build() { - return new Extra(this); - } - } - } - } - - public static final class GservicesSetting extends Message { - - public static final ByteString DEFAULT_NAME = ByteString.EMPTY; - public static final ByteString DEFAULT_VALUE = ByteString.EMPTY; - - @ProtoField(tag = 1, type = BYTES) - public final ByteString name; - - @ProtoField(tag = 2, type = BYTES) - public final ByteString value; - - public GservicesSetting(ByteString name, ByteString value) { - this.name = name; - this.value = value; - } - - private GservicesSetting(Builder builder) { - this(builder.name, builder.value); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof GservicesSetting)) return false; - GservicesSetting o = (GservicesSetting) other; - return equals(name, o.name) - && equals(value, o.value); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = name != null ? name.hashCode() : 0; - result = result * 37 + (value != null ? value.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public ByteString name; - public ByteString value; - - public Builder() { - } - - public Builder(GservicesSetting message) { - super(message); - if (message == null) return; - this.name = message.name; - this.value = message.value; - } - - public Builder name(ByteString name) { - this.name = name; - return this; - } - - public Builder value(ByteString value) { - this.value = value; - return this; - } - - @Override - public GservicesSetting build() { - return new GservicesSetting(this); - } - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/AppData.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/AppData.java deleted file mode 100644 index 61864ae3..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/AppData.java +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REQUIRED; - -public final class AppData extends Message { - - public static final String DEFAULT_KEY = ""; - public static final String DEFAULT_VALUE = ""; - - @ProtoField(tag = 1, type = STRING, label = REQUIRED) - public final String key; - - @ProtoField(tag = 2, type = STRING, label = REQUIRED) - public final String value; - - public AppData(String key, String value) { - this.key = key; - this.value = value; - } - - private AppData(Builder builder) { - this(builder.key, builder.value); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof AppData)) return false; - AppData o = (AppData) other; - return equals(key, o.key) - && equals(value, o.value); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = key != null ? key.hashCode() : 0; - result = result * 37 + (value != null ? value.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String key; - public String value; - - public Builder() { - } - - public Builder(AppData message) { - super(message); - if (message == null) return; - this.key = message.key; - this.value = message.value; - } - - public Builder key(String key) { - this.key = key; - return this; - } - - public Builder value(String value) { - this.value = value; - return this; - } - - @Override - public AppData build() { - checkRequiredFields(); - return new AppData(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Close.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Close.java deleted file mode 100644 index 5293b0dd..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Close.java +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; - -/** - * TAG: 4 - */ -public final class Close extends Message { - - public Close() { - } - - private Close(Builder builder) { - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - return other instanceof Close; - } - - @Override - public int hashCode() { - return 0; - } - - public static final class Builder extends Message.Builder { - - public Builder() { - } - - public Builder(Close message) { - super(message); - } - - @Override - public Close build() { - return new Close(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/DataMessageStanza.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/DataMessageStanza.java deleted file mode 100644 index b8407dd7..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/DataMessageStanza.java +++ /dev/null @@ -1,492 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; -import java.util.Collections; -import java.util.List; -import okio.ByteString; - -import static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.BYTES; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; -import static com.squareup.wire.Message.Label.REQUIRED; - -/** - * TAG: 8 - */ -public final class DataMessageStanza extends Message { - - public static final Long DEFAULT_RMQ_ID = 0L; - public static final String DEFAULT_ID = ""; - public static final String DEFAULT_FROM = ""; - public static final String DEFAULT_TO = ""; - public static final String DEFAULT_CATEGORY = ""; - public static final String DEFAULT_TOKEN = ""; - public static final List DEFAULT_APP_DATA = Collections.emptyList(); - public static final Boolean DEFAULT_FROM_TRUSTED_SERVER = false; - public static final String DEFAULT_PERSISTENT_ID = ""; - public static final Integer DEFAULT_STREAM_ID = 0; - public static final Integer DEFAULT_LAST_STREAM_ID_RECEIVED = 0; - public static final String DEFAULT_PERMISSION = ""; - public static final String DEFAULT_REG_ID = ""; - public static final String DEFAULT_PKG_SIGNATURE = ""; - public static final String DEFAULT_CLIENT_ID = ""; - public static final Long DEFAULT_DEVICE_USER_ID = 0L; - public static final Integer DEFAULT_TTL = 0; - public static final Long DEFAULT_SENT = 0L; - public static final Integer DEFAULT_QUEUED = 0; - public static final Long DEFAULT_STATUS = 0L; - public static final ByteString DEFAULT_RAW_DATA = ByteString.EMPTY; - public static final Integer DEFAULT_DELAY = 0; - - /** - * Not used. - */ - @ProtoField(tag = 1, type = INT64) - public final Long rmq_id; - - /** - * This is the message ID, set by client, DMP.9 (message_id) - */ - @ProtoField(tag = 2, type = STRING) - public final String id; - - /** - * Project ID of the sender, DMP.1 - */ - @ProtoField(tag = 3, type = STRING, label = REQUIRED) - public final String from; - - /** - * Part of DMRequest - also the key in DataMessageProto. - */ - @ProtoField(tag = 4, type = STRING) - public final String to; - - /** - * Package name. DMP.2 - */ - @ProtoField(tag = 5, type = STRING, label = REQUIRED) - public final String category; - - /** - * The collapsed key, DMP.3 - */ - @ProtoField(tag = 6, type = STRING) - public final String token; - - /** - * User data + GOOGLE. prefixed special entries, DMP.4 - */ - @ProtoField(tag = 7, label = REPEATED, messageType = AppData.class) - public final List app_data; - - /** - * Not used. - */ - @ProtoField(tag = 8, type = BOOL) - public final Boolean from_trusted_server; - - /** - * Part of the ACK protocol, returned in DataMessageResponse on server side. - * It's part of the key of DMP. - */ - @ProtoField(tag = 9, type = STRING) - public final String persistent_id; - - /** - * In-stream ack. Increments on each message sent - a bit redundant - * Not used in DMP/DMR. - */ - @ProtoField(tag = 10, type = INT32) - public final Integer stream_id; - - @ProtoField(tag = 11, type = INT32) - public final Integer last_stream_id_received; - - /** - * Not used. - */ - @ProtoField(tag = 12, type = STRING) - public final String permission; - - /** - * Sent by the device shortly after registration. - */ - @ProtoField(tag = 13, type = STRING) - public final String reg_id; - - /** - * Not used. - */ - @ProtoField(tag = 14, type = STRING) - public final String pkg_signature; - - /** - * Not used. - */ - @ProtoField(tag = 15, type = STRING) - public final String client_id; - - /** - * serial number of the target user, DMP.8 - * It is the 'serial number' according to user manager. - */ - @ProtoField(tag = 16, type = INT64) - public final Long device_user_id; - - /** - * Time to live, in seconds. - */ - @ProtoField(tag = 17, type = INT32) - public final Integer ttl; - - /** - * Timestamp ( according to client ) when message was sent by app, in seconds - */ - @ProtoField(tag = 18, type = INT64) - public final Long sent; - - /** - * How long has the message been queued before the flush, in seconds. - * This is needed to account for the time difference between server and - * client: server should adjust 'sent' based on his 'receive' time. - */ - @ProtoField(tag = 19, type = INT32) - public final Integer queued; - - @ProtoField(tag = 20, type = INT64) - public final Long status; - - @ProtoField(tag = 21, type = BYTES) - public final ByteString raw_data; - - @ProtoField(tag = 22, type = INT32) - public final Integer delay; - - public DataMessageStanza(Long rmq_id, String id, String from, String to, String category, String token, List app_data, Boolean from_trusted_server, String persistent_id, Integer stream_id, Integer last_stream_id_received, String permission, String reg_id, String pkg_signature, String client_id, Long device_user_id, Integer ttl, Long sent, Integer queued, Long status, ByteString raw_data, Integer delay) { - this.rmq_id = rmq_id; - this.id = id; - this.from = from; - this.to = to; - this.category = category; - this.token = token; - this.app_data = immutableCopyOf(app_data); - this.from_trusted_server = from_trusted_server; - this.persistent_id = persistent_id; - this.stream_id = stream_id; - this.last_stream_id_received = last_stream_id_received; - this.permission = permission; - this.reg_id = reg_id; - this.pkg_signature = pkg_signature; - this.client_id = client_id; - this.device_user_id = device_user_id; - this.ttl = ttl; - this.sent = sent; - this.queued = queued; - this.status = status; - this.raw_data = raw_data; - this.delay = delay; - } - - private DataMessageStanza(Builder builder) { - this(builder.rmq_id, builder.id, builder.from, builder.to, builder.category, builder.token, builder.app_data, builder.from_trusted_server, builder.persistent_id, builder.stream_id, builder.last_stream_id_received, builder.permission, builder.reg_id, builder.pkg_signature, builder.client_id, builder.device_user_id, builder.ttl, builder.sent, builder.queued, builder.status, builder.raw_data, builder.delay); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof DataMessageStanza)) return false; - DataMessageStanza o = (DataMessageStanza) other; - return equals(rmq_id, o.rmq_id) - && equals(id, o.id) - && equals(from, o.from) - && equals(to, o.to) - && equals(category, o.category) - && equals(token, o.token) - && equals(app_data, o.app_data) - && equals(from_trusted_server, o.from_trusted_server) - && equals(persistent_id, o.persistent_id) - && equals(stream_id, o.stream_id) - && equals(last_stream_id_received, o.last_stream_id_received) - && equals(permission, o.permission) - && equals(reg_id, o.reg_id) - && equals(pkg_signature, o.pkg_signature) - && equals(client_id, o.client_id) - && equals(device_user_id, o.device_user_id) - && equals(ttl, o.ttl) - && equals(sent, o.sent) - && equals(queued, o.queued) - && equals(status, o.status) - && equals(raw_data, o.raw_data) - && equals(delay, o.delay); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = rmq_id != null ? rmq_id.hashCode() : 0; - result = result * 37 + (id != null ? id.hashCode() : 0); - result = result * 37 + (from != null ? from.hashCode() : 0); - result = result * 37 + (to != null ? to.hashCode() : 0); - result = result * 37 + (category != null ? category.hashCode() : 0); - result = result * 37 + (token != null ? token.hashCode() : 0); - result = result * 37 + (app_data != null ? app_data.hashCode() : 1); - result = result * 37 + (from_trusted_server != null ? from_trusted_server.hashCode() : 0); - result = result * 37 + (persistent_id != null ? persistent_id.hashCode() : 0); - result = result * 37 + (stream_id != null ? stream_id.hashCode() : 0); - result = result * 37 + (last_stream_id_received != null ? last_stream_id_received.hashCode() : 0); - result = result * 37 + (permission != null ? permission.hashCode() : 0); - result = result * 37 + (reg_id != null ? reg_id.hashCode() : 0); - result = result * 37 + (pkg_signature != null ? pkg_signature.hashCode() : 0); - result = result * 37 + (client_id != null ? client_id.hashCode() : 0); - result = result * 37 + (device_user_id != null ? device_user_id.hashCode() : 0); - result = result * 37 + (ttl != null ? ttl.hashCode() : 0); - result = result * 37 + (sent != null ? sent.hashCode() : 0); - result = result * 37 + (queued != null ? queued.hashCode() : 0); - result = result * 37 + (status != null ? status.hashCode() : 0); - result = result * 37 + (raw_data != null ? raw_data.hashCode() : 0); - result = result * 37 + (delay != null ? delay.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Long rmq_id; - public String id; - public String from; - public String to; - public String category; - public String token; - public List app_data; - public Boolean from_trusted_server; - public String persistent_id; - public Integer stream_id; - public Integer last_stream_id_received; - public String permission; - public String reg_id; - public String pkg_signature; - public String client_id; - public Long device_user_id; - public Integer ttl; - public Long sent; - public Integer queued; - public Long status; - public ByteString raw_data; - public Integer delay; - - public Builder() { - } - - public Builder(DataMessageStanza message) { - super(message); - if (message == null) return; - this.rmq_id = message.rmq_id; - this.id = message.id; - this.from = message.from; - this.to = message.to; - this.category = message.category; - this.token = message.token; - this.app_data = copyOf(message.app_data); - this.from_trusted_server = message.from_trusted_server; - this.persistent_id = message.persistent_id; - this.stream_id = message.stream_id; - this.last_stream_id_received = message.last_stream_id_received; - this.permission = message.permission; - this.reg_id = message.reg_id; - this.pkg_signature = message.pkg_signature; - this.client_id = message.client_id; - this.device_user_id = message.device_user_id; - this.ttl = message.ttl; - this.sent = message.sent; - this.queued = message.queued; - this.status = message.status; - this.raw_data = message.raw_data; - this.delay = message.delay; - } - - /** - * Not used. - */ - public Builder rmq_id(Long rmq_id) { - this.rmq_id = rmq_id; - return this; - } - - /** - * This is the message ID, set by client, DMP.9 (message_id) - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Project ID of the sender, DMP.1 - */ - public Builder from(String from) { - this.from = from; - return this; - } - - /** - * Part of DMRequest - also the key in DataMessageProto. - */ - public Builder to(String to) { - this.to = to; - return this; - } - - /** - * Package name. DMP.2 - */ - public Builder category(String category) { - this.category = category; - return this; - } - - /** - * The collapsed key, DMP.3 - */ - public Builder token(String token) { - this.token = token; - return this; - } - - /** - * User data + GOOGLE. prefixed special entries, DMP.4 - */ - public Builder app_data(List app_data) { - this.app_data = checkForNulls(app_data); - return this; - } - - /** - * Not used. - */ - public Builder from_trusted_server(Boolean from_trusted_server) { - this.from_trusted_server = from_trusted_server; - return this; - } - - /** - * Part of the ACK protocol, returned in DataMessageResponse on server side. - * It's part of the key of DMP. - */ - public Builder persistent_id(String persistent_id) { - this.persistent_id = persistent_id; - return this; - } - - /** - * In-stream ack. Increments on each message sent - a bit redundant - * Not used in DMP/DMR. - */ - public Builder stream_id(Integer stream_id) { - this.stream_id = stream_id; - return this; - } - - public Builder last_stream_id_received(Integer last_stream_id_received) { - this.last_stream_id_received = last_stream_id_received; - return this; - } - - /** - * Not used. - */ - public Builder permission(String permission) { - this.permission = permission; - return this; - } - - /** - * Sent by the device shortly after registration. - */ - public Builder reg_id(String reg_id) { - this.reg_id = reg_id; - return this; - } - - /** - * Not used. - */ - public Builder pkg_signature(String pkg_signature) { - this.pkg_signature = pkg_signature; - return this; - } - - /** - * Not used. - */ - public Builder client_id(String client_id) { - this.client_id = client_id; - return this; - } - - /** - * serial number of the target user, DMP.8 - * It is the 'serial number' according to user manager. - */ - public Builder device_user_id(Long device_user_id) { - this.device_user_id = device_user_id; - return this; - } - - /** - * Time to live, in seconds. - */ - public Builder ttl(Integer ttl) { - this.ttl = ttl; - return this; - } - - /** - * Timestamp ( according to client ) when message was sent by app, in seconds - */ - public Builder sent(Long sent) { - this.sent = sent; - return this; - } - - /** - * How long has the message been queued before the flush, in seconds. - * This is needed to account for the time difference between server and - * client: server should adjust 'sent' based on his 'receive' time. - */ - public Builder queued(Integer queued) { - this.queued = queued; - return this; - } - - public Builder status(Long status) { - this.status = status; - return this; - } - - public Builder raw_data(ByteString raw_data) { - this.raw_data = raw_data; - return this; - } - - public Builder delay(Integer delay) { - this.delay = delay; - return this; - } - - @Override - public DataMessageStanza build() { - checkRequiredFields(); - return new DataMessageStanza(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/ErrorInfo.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/ErrorInfo.java deleted file mode 100644 index 694a8768..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/ErrorInfo.java +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REQUIRED; - -public final class ErrorInfo extends Message { - - public static final Integer DEFAULT_CODE = 0; - public static final String DEFAULT_MESSAGE = ""; - public static final String DEFAULT_TYPE = ""; - - @ProtoField(tag = 1, type = INT32, label = REQUIRED) - public final Integer code; - - @ProtoField(tag = 2, type = STRING) - public final String message; - - @ProtoField(tag = 3, type = STRING) - public final String type; - - @ProtoField(tag = 4) - public final Extension extension; - - public ErrorInfo(Integer code, String message, String type, Extension extension) { - this.code = code; - this.message = message; - this.type = type; - this.extension = extension; - } - - private ErrorInfo(Builder builder) { - this(builder.code, builder.message, builder.type, builder.extension); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ErrorInfo)) return false; - ErrorInfo o = (ErrorInfo) other; - return equals(code, o.code) - && equals(message, o.message) - && equals(type, o.type) - && equals(extension, o.extension); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = code != null ? code.hashCode() : 0; - result = result * 37 + (message != null ? message.hashCode() : 0); - result = result * 37 + (type != null ? type.hashCode() : 0); - result = result * 37 + (extension != null ? extension.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer code; - public String message; - public String type; - public Extension extension; - - public Builder() { - } - - public Builder(ErrorInfo message) { - super(message); - if (message == null) return; - this.code = message.code; - this.message = message.message; - this.type = message.type; - this.extension = message.extension; - } - - public Builder code(Integer code) { - this.code = code; - return this; - } - - public Builder message(String message) { - this.message = message; - return this; - } - - public Builder type(String type) { - this.type = type; - return this; - } - - public Builder extension(Extension extension) { - this.extension = extension; - return this; - } - - @Override - public ErrorInfo build() { - checkRequiredFields(); - return new ErrorInfo(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Extension.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Extension.java deleted file mode 100644 index 21b87ea7..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Extension.java +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; -import okio.ByteString; - -import static com.squareup.wire.Message.Datatype.BYTES; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Label.REQUIRED; - -public final class Extension extends Message { - - public static final Integer DEFAULT_ID = 0; - public static final ByteString DEFAULT_DATA = ByteString.EMPTY; - - /** - * 12: SelectiveAck - * 13: StreamAck - */ - @ProtoField(tag = 1, type = INT32, label = REQUIRED) - public final Integer id; - - @ProtoField(tag = 2, type = BYTES, label = REQUIRED) - public final ByteString data; - - public Extension(Integer id, ByteString data) { - this.id = id; - this.data = data; - } - - private Extension(Builder builder) { - this(builder.id, builder.data); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Extension)) return false; - Extension o = (Extension) other; - return equals(id, o.id) - && equals(data, o.data); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = id != null ? id.hashCode() : 0; - result = result * 37 + (data != null ? data.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer id; - public ByteString data; - - public Builder() { - } - - public Builder(Extension message) { - super(message); - if (message == null) return; - this.id = message.id; - this.data = message.data; - } - - /** - * 12: SelectiveAck - * 13: StreamAck - */ - public Builder id(Integer id) { - this.id = id; - return this; - } - - public Builder data(ByteString data) { - this.data = data; - return this; - } - - @Override - public Extension build() { - checkRequiredFields(); - return new Extension(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatAck.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatAck.java deleted file mode 100644 index 29c8564d..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatAck.java +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; - -/** - * TAG: 1 - */ -public final class HeartbeatAck extends Message { - - public static final Integer DEFAULT_STREAM_ID = 0; - public static final Integer DEFAULT_LAST_STREAM_ID_RECEIVED = 0; - public static final Long DEFAULT_STATUS = 0L; - - @ProtoField(tag = 1, type = INT32) - public final Integer stream_id; - - @ProtoField(tag = 2, type = INT32) - public final Integer last_stream_id_received; - - @ProtoField(tag = 3, type = INT64) - public final Long status; - - public HeartbeatAck(Integer stream_id, Integer last_stream_id_received, Long status) { - this.stream_id = stream_id; - this.last_stream_id_received = last_stream_id_received; - this.status = status; - } - - private HeartbeatAck(Builder builder) { - this(builder.stream_id, builder.last_stream_id_received, builder.status); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof HeartbeatAck)) return false; - HeartbeatAck o = (HeartbeatAck) other; - return equals(stream_id, o.stream_id) - && equals(last_stream_id_received, o.last_stream_id_received) - && equals(status, o.status); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = stream_id != null ? stream_id.hashCode() : 0; - result = result * 37 + (last_stream_id_received != null ? last_stream_id_received.hashCode() : 0); - result = result * 37 + (status != null ? status.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer stream_id; - public Integer last_stream_id_received; - public Long status; - - public Builder() { - } - - public Builder(HeartbeatAck message) { - super(message); - if (message == null) return; - this.stream_id = message.stream_id; - this.last_stream_id_received = message.last_stream_id_received; - this.status = message.status; - } - - public Builder stream_id(Integer stream_id) { - this.stream_id = stream_id; - return this; - } - - public Builder last_stream_id_received(Integer last_stream_id_received) { - this.last_stream_id_received = last_stream_id_received; - return this; - } - - public Builder status(Long status) { - this.status = status; - return this; - } - - @Override - public HeartbeatAck build() { - return new HeartbeatAck(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatConfig.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatConfig.java deleted file mode 100644 index bc36f87f..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatConfig.java +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.STRING; - -public final class HeartbeatConfig extends Message { - - public static final Boolean DEFAULT_UPLOAD_STAT = false; - public static final String DEFAULT_IP = ""; - public static final Integer DEFAULT_INTERVAL_MS = 0; - - @ProtoField(tag = 1, type = BOOL) - public final Boolean upload_stat; - - @ProtoField(tag = 2, type = STRING) - public final String ip; - - @ProtoField(tag = 3, type = INT32) - public final Integer interval_ms; - - public HeartbeatConfig(Boolean upload_stat, String ip, Integer interval_ms) { - this.upload_stat = upload_stat; - this.ip = ip; - this.interval_ms = interval_ms; - } - - private HeartbeatConfig(Builder builder) { - this(builder.upload_stat, builder.ip, builder.interval_ms); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof HeartbeatConfig)) return false; - HeartbeatConfig o = (HeartbeatConfig) other; - return equals(upload_stat, o.upload_stat) - && equals(ip, o.ip) - && equals(interval_ms, o.interval_ms); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = upload_stat != null ? upload_stat.hashCode() : 0; - result = result * 37 + (ip != null ? ip.hashCode() : 0); - result = result * 37 + (interval_ms != null ? interval_ms.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Boolean upload_stat; - public String ip; - public Integer interval_ms; - - public Builder() { - } - - public Builder(HeartbeatConfig message) { - super(message); - if (message == null) return; - this.upload_stat = message.upload_stat; - this.ip = message.ip; - this.interval_ms = message.interval_ms; - } - - public Builder upload_stat(Boolean upload_stat) { - this.upload_stat = upload_stat; - return this; - } - - public Builder ip(String ip) { - this.ip = ip; - return this; - } - - public Builder interval_ms(Integer interval_ms) { - this.interval_ms = interval_ms; - return this; - } - - @Override - public HeartbeatConfig build() { - return new HeartbeatConfig(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatPing.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatPing.java deleted file mode 100644 index c203234a..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatPing.java +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; - -/** - * Common fields/comments: - * - * stream_id: no longer sent by server, each side keeps a counter - * last_stream_id_received: sent only if a packet was received since last time - * a last_stream was sent - * status: new bitmask including the 'idle' as bit 0. - * TAG: 0 - */ -public final class HeartbeatPing extends Message { - - public static final Integer DEFAULT_STREAM_ID = 0; - public static final Integer DEFAULT_LAST_STREAM_ID_RECEIVED = 0; - public static final Long DEFAULT_STATUS = 0L; - - @ProtoField(tag = 1, type = INT32) - public final Integer stream_id; - - @ProtoField(tag = 2, type = INT32) - public final Integer last_stream_id_received; - - @ProtoField(tag = 3, type = INT64) - public final Long status; - - public HeartbeatPing(Integer stream_id, Integer last_stream_id_received, Long status) { - this.stream_id = stream_id; - this.last_stream_id_received = last_stream_id_received; - this.status = status; - } - - private HeartbeatPing(Builder builder) { - this(builder.stream_id, builder.last_stream_id_received, builder.status); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof HeartbeatPing)) return false; - HeartbeatPing o = (HeartbeatPing) other; - return equals(stream_id, o.stream_id) - && equals(last_stream_id_received, o.last_stream_id_received) - && equals(status, o.status); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = stream_id != null ? stream_id.hashCode() : 0; - result = result * 37 + (last_stream_id_received != null ? last_stream_id_received.hashCode() : 0); - result = result * 37 + (status != null ? status.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer stream_id; - public Integer last_stream_id_received; - public Long status; - - public Builder() { - } - - public Builder(HeartbeatPing message) { - super(message); - if (message == null) return; - this.stream_id = message.stream_id; - this.last_stream_id_received = message.last_stream_id_received; - this.status = message.status; - } - - public Builder stream_id(Integer stream_id) { - this.stream_id = stream_id; - return this; - } - - public Builder last_stream_id_received(Integer last_stream_id_received) { - this.last_stream_id_received = last_stream_id_received; - return this; - } - - public Builder status(Long status) { - this.status = status; - return this; - } - - @Override - public HeartbeatPing build() { - return new HeartbeatPing(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatStat.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatStat.java deleted file mode 100644 index 2e504218..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/HeartbeatStat.java +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REQUIRED; - -public final class HeartbeatStat extends Message { - - public static final String DEFAULT_IP = ""; - public static final Boolean DEFAULT_TIMEOUT = false; - public static final Integer DEFAULT_INTERVAL_MS = 0; - - @ProtoField(tag = 1, type = STRING, label = REQUIRED) - public final String ip; - - @ProtoField(tag = 2, type = BOOL, label = REQUIRED) - public final Boolean timeout; - - @ProtoField(tag = 3, type = INT32, label = REQUIRED) - public final Integer interval_ms; - - public HeartbeatStat(String ip, Boolean timeout, Integer interval_ms) { - this.ip = ip; - this.timeout = timeout; - this.interval_ms = interval_ms; - } - - private HeartbeatStat(Builder builder) { - this(builder.ip, builder.timeout, builder.interval_ms); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof HeartbeatStat)) return false; - HeartbeatStat o = (HeartbeatStat) other; - return equals(ip, o.ip) - && equals(timeout, o.timeout) - && equals(interval_ms, o.interval_ms); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = ip != null ? ip.hashCode() : 0; - result = result * 37 + (timeout != null ? timeout.hashCode() : 0); - result = result * 37 + (interval_ms != null ? interval_ms.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String ip; - public Boolean timeout; - public Integer interval_ms; - - public Builder() { - } - - public Builder(HeartbeatStat message) { - super(message); - if (message == null) return; - this.ip = message.ip; - this.timeout = message.timeout; - this.interval_ms = message.interval_ms; - } - - public Builder ip(String ip) { - this.ip = ip; - return this; - } - - public Builder timeout(Boolean timeout) { - this.timeout = timeout; - return this; - } - - public Builder interval_ms(Integer interval_ms) { - this.interval_ms = interval_ms; - return this; - } - - @Override - public HeartbeatStat build() { - checkRequiredFields(); - return new HeartbeatStat(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/IqStanza.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/IqStanza.java deleted file mode 100644 index b881f7bc..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/IqStanza.java +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoEnum; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.ENUM; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REQUIRED; - -/** - * TAG: 7 - * IqRequest must contain a single extension. IqResponse may contain 0 or 1 - * extensions. - */ -public final class IqStanza extends Message { - - public static final Long DEFAULT_RMQ_ID = 0L; - public static final IqType DEFAULT_TYPE = IqType.GET; - public static final String DEFAULT_ID = ""; - public static final String DEFAULT_FROM = ""; - public static final String DEFAULT_TO = ""; - public static final String DEFAULT_PERSISTENT_ID = ""; - public static final Integer DEFAULT_STREAM_ID = 0; - public static final Integer DEFAULT_LAST_STREAM_ID_RECEIVED = 0; - public static final Long DEFAULT_ACCOUNT_ID = 0L; - public static final Long DEFAULT_STATUS = 0L; - - @ProtoField(tag = 1, type = INT64) - public final Long rmq_id; - - @ProtoField(tag = 2, type = ENUM, label = REQUIRED) - public final IqType type; - - @ProtoField(tag = 3, type = STRING, label = REQUIRED) - public final String id; - - @ProtoField(tag = 4, type = STRING) - public final String from; - - @ProtoField(tag = 5, type = STRING) - public final String to; - - @ProtoField(tag = 6) - public final ErrorInfo error; - - /** - * Only field used in the 38+ protocol (besides common last_stream_id_received, status, rmq_id) - */ - @ProtoField(tag = 7) - public final Extension extension; - - @ProtoField(tag = 8, type = STRING) - public final String persistent_id; - - @ProtoField(tag = 9, type = INT32) - public final Integer stream_id; - - @ProtoField(tag = 10, type = INT32) - public final Integer last_stream_id_received; - - @ProtoField(tag = 11, type = INT64) - public final Long account_id; - - @ProtoField(tag = 12, type = INT64) - public final Long status; - - public IqStanza(Long rmq_id, IqType type, String id, String from, String to, ErrorInfo error, Extension extension, String persistent_id, Integer stream_id, Integer last_stream_id_received, Long account_id, Long status) { - this.rmq_id = rmq_id; - this.type = type; - this.id = id; - this.from = from; - this.to = to; - this.error = error; - this.extension = extension; - this.persistent_id = persistent_id; - this.stream_id = stream_id; - this.last_stream_id_received = last_stream_id_received; - this.account_id = account_id; - this.status = status; - } - - private IqStanza(Builder builder) { - this(builder.rmq_id, builder.type, builder.id, builder.from, builder.to, builder.error, builder.extension, builder.persistent_id, builder.stream_id, builder.last_stream_id_received, builder.account_id, builder.status); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof IqStanza)) return false; - IqStanza o = (IqStanza) other; - return equals(rmq_id, o.rmq_id) - && equals(type, o.type) - && equals(id, o.id) - && equals(from, o.from) - && equals(to, o.to) - && equals(error, o.error) - && equals(extension, o.extension) - && equals(persistent_id, o.persistent_id) - && equals(stream_id, o.stream_id) - && equals(last_stream_id_received, o.last_stream_id_received) - && equals(account_id, o.account_id) - && equals(status, o.status); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = rmq_id != null ? rmq_id.hashCode() : 0; - result = result * 37 + (type != null ? type.hashCode() : 0); - result = result * 37 + (id != null ? id.hashCode() : 0); - result = result * 37 + (from != null ? from.hashCode() : 0); - result = result * 37 + (to != null ? to.hashCode() : 0); - result = result * 37 + (error != null ? error.hashCode() : 0); - result = result * 37 + (extension != null ? extension.hashCode() : 0); - result = result * 37 + (persistent_id != null ? persistent_id.hashCode() : 0); - result = result * 37 + (stream_id != null ? stream_id.hashCode() : 0); - result = result * 37 + (last_stream_id_received != null ? last_stream_id_received.hashCode() : 0); - result = result * 37 + (account_id != null ? account_id.hashCode() : 0); - result = result * 37 + (status != null ? status.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Long rmq_id; - public IqType type; - public String id; - public String from; - public String to; - public ErrorInfo error; - public Extension extension; - public String persistent_id; - public Integer stream_id; - public Integer last_stream_id_received; - public Long account_id; - public Long status; - - public Builder() { - } - - public Builder(IqStanza message) { - super(message); - if (message == null) return; - this.rmq_id = message.rmq_id; - this.type = message.type; - this.id = message.id; - this.from = message.from; - this.to = message.to; - this.error = message.error; - this.extension = message.extension; - this.persistent_id = message.persistent_id; - this.stream_id = message.stream_id; - this.last_stream_id_received = message.last_stream_id_received; - this.account_id = message.account_id; - this.status = message.status; - } - - public Builder rmq_id(Long rmq_id) { - this.rmq_id = rmq_id; - return this; - } - - public Builder type(IqType type) { - this.type = type; - return this; - } - - public Builder id(String id) { - this.id = id; - return this; - } - - public Builder from(String from) { - this.from = from; - return this; - } - - public Builder to(String to) { - this.to = to; - return this; - } - - public Builder error(ErrorInfo error) { - this.error = error; - return this; - } - - /** - * Only field used in the 38+ protocol (besides common last_stream_id_received, status, rmq_id) - */ - public Builder extension(Extension extension) { - this.extension = extension; - return this; - } - - public Builder persistent_id(String persistent_id) { - this.persistent_id = persistent_id; - return this; - } - - public Builder stream_id(Integer stream_id) { - this.stream_id = stream_id; - return this; - } - - public Builder last_stream_id_received(Integer last_stream_id_received) { - this.last_stream_id_received = last_stream_id_received; - return this; - } - - public Builder account_id(Long account_id) { - this.account_id = account_id; - return this; - } - - public Builder status(Long status) { - this.status = status; - return this; - } - - @Override - public IqStanza build() { - checkRequiredFields(); - return new IqStanza(this); - } - } - - public enum IqType - implements ProtoEnum { - GET(0), - SET(1), - RESULT(2), - IQ_ERROR(3); - - private final int value; - - private IqType(int value) { - this.value = value; - } - - @Override - public int getValue() { - return value; - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginRequest.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginRequest.java deleted file mode 100644 index 102d364c..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginRequest.java +++ /dev/null @@ -1,387 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoEnum; -import com.squareup.wire.ProtoField; -import java.util.Collections; -import java.util.List; - -import static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.ENUM; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; -import static com.squareup.wire.Message.Label.REQUIRED; - -/** - * TAG: 2 - */ -public final class LoginRequest extends Message { - - public static final String DEFAULT_ID = ""; - public static final String DEFAULT_DOMAIN = ""; - public static final String DEFAULT_USER = ""; - public static final String DEFAULT_RESOURCE = ""; - public static final String DEFAULT_AUTH_TOKEN = ""; - public static final String DEFAULT_DEVICE_ID = ""; - public static final Long DEFAULT_LAST_RMQ_ID = 0L; - public static final List DEFAULT_SETTING = Collections.emptyList(); - public static final Integer DEFAULT_COMPRESS = 0; - public static final List DEFAULT_RECEIVED_PERSISTENT_ID = Collections.emptyList(); - public static final Boolean DEFAULT_INCLUDE_STREAM_IDS = false; - public static final Boolean DEFAULT_ADAPTIVE_HEARTBEAT = false; - public static final Boolean DEFAULT_USE_RMQ2 = false; - public static final Long DEFAULT_ACCOUNT_ID = 0L; - public static final AuthService DEFAULT_AUTH_SERVICE = AuthService.ANDROID_ID; - public static final Integer DEFAULT_NETWORK_TYPE = 0; - public static final Long DEFAULT_STATUS = 0L; - - @ProtoField(tag = 1, type = STRING, label = REQUIRED) - public final String id; - - /** - * Must be present ( proto required ), may be empty - * string. - * mcs.android.com. - */ - @ProtoField(tag = 2, type = STRING, label = REQUIRED) - public final String domain; - - /** - * Decimal android ID - */ - @ProtoField(tag = 3, type = STRING, label = REQUIRED) - public final String user; - - @ProtoField(tag = 4, type = STRING, label = REQUIRED) - public final String resource; - - /** - * Secret - */ - @ProtoField(tag = 5, type = STRING, label = REQUIRED) - public final String auth_token; - - /** - * Format is: android-HEX_DEVICE_ID - * The user is the decimal value. - */ - @ProtoField(tag = 6, type = STRING) - public final String device_id; - - /** - * RMQ1 - no longer used - */ - @ProtoField(tag = 7, type = INT64) - public final Long last_rmq_id; - - @ProtoField(tag = 8, label = REPEATED, messageType = Setting.class) - public final List setting; - - @ProtoField(tag = 9, type = INT32) - public final Integer compress; - - @ProtoField(tag = 10, type = STRING, label = REPEATED) - public final List received_persistent_id; - - /** - * Replaced by "rmq2v" setting - */ - @ProtoField(tag = 11, type = BOOL) - public final Boolean include_stream_ids; - - @ProtoField(tag = 12, type = BOOL) - public final Boolean adaptive_heartbeat; - - @ProtoField(tag = 13) - public final HeartbeatStat heartbeat_stat; - - /** - * Must be true. - */ - @ProtoField(tag = 14, type = BOOL) - public final Boolean use_rmq2; - - @ProtoField(tag = 15, type = INT64) - public final Long account_id; - - /** - * ANDROID_ID = 2 - */ - @ProtoField(tag = 16, type = ENUM) - public final AuthService auth_service; - - @ProtoField(tag = 17, type = INT32) - public final Integer network_type; - - @ProtoField(tag = 18, type = INT64) - public final Long status; - - public LoginRequest(String id, String domain, String user, String resource, String auth_token, String device_id, Long last_rmq_id, List setting, Integer compress, List received_persistent_id, Boolean include_stream_ids, Boolean adaptive_heartbeat, HeartbeatStat heartbeat_stat, Boolean use_rmq2, Long account_id, AuthService auth_service, Integer network_type, Long status) { - this.id = id; - this.domain = domain; - this.user = user; - this.resource = resource; - this.auth_token = auth_token; - this.device_id = device_id; - this.last_rmq_id = last_rmq_id; - this.setting = immutableCopyOf(setting); - this.compress = compress; - this.received_persistent_id = immutableCopyOf(received_persistent_id); - this.include_stream_ids = include_stream_ids; - this.adaptive_heartbeat = adaptive_heartbeat; - this.heartbeat_stat = heartbeat_stat; - this.use_rmq2 = use_rmq2; - this.account_id = account_id; - this.auth_service = auth_service; - this.network_type = network_type; - this.status = status; - } - - private LoginRequest(Builder builder) { - this(builder.id, builder.domain, builder.user, builder.resource, builder.auth_token, builder.device_id, builder.last_rmq_id, builder.setting, builder.compress, builder.received_persistent_id, builder.include_stream_ids, builder.adaptive_heartbeat, builder.heartbeat_stat, builder.use_rmq2, builder.account_id, builder.auth_service, builder.network_type, builder.status); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof LoginRequest)) return false; - LoginRequest o = (LoginRequest) other; - return equals(id, o.id) - && equals(domain, o.domain) - && equals(user, o.user) - && equals(resource, o.resource) - && equals(auth_token, o.auth_token) - && equals(device_id, o.device_id) - && equals(last_rmq_id, o.last_rmq_id) - && equals(setting, o.setting) - && equals(compress, o.compress) - && equals(received_persistent_id, o.received_persistent_id) - && equals(include_stream_ids, o.include_stream_ids) - && equals(adaptive_heartbeat, o.adaptive_heartbeat) - && equals(heartbeat_stat, o.heartbeat_stat) - && equals(use_rmq2, o.use_rmq2) - && equals(account_id, o.account_id) - && equals(auth_service, o.auth_service) - && equals(network_type, o.network_type) - && equals(status, o.status); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = id != null ? id.hashCode() : 0; - result = result * 37 + (domain != null ? domain.hashCode() : 0); - result = result * 37 + (user != null ? user.hashCode() : 0); - result = result * 37 + (resource != null ? resource.hashCode() : 0); - result = result * 37 + (auth_token != null ? auth_token.hashCode() : 0); - result = result * 37 + (device_id != null ? device_id.hashCode() : 0); - result = result * 37 + (last_rmq_id != null ? last_rmq_id.hashCode() : 0); - result = result * 37 + (setting != null ? setting.hashCode() : 1); - result = result * 37 + (compress != null ? compress.hashCode() : 0); - result = result * 37 + (received_persistent_id != null ? received_persistent_id.hashCode() : 1); - result = result * 37 + (include_stream_ids != null ? include_stream_ids.hashCode() : 0); - result = result * 37 + (adaptive_heartbeat != null ? adaptive_heartbeat.hashCode() : 0); - result = result * 37 + (heartbeat_stat != null ? heartbeat_stat.hashCode() : 0); - result = result * 37 + (use_rmq2 != null ? use_rmq2.hashCode() : 0); - result = result * 37 + (account_id != null ? account_id.hashCode() : 0); - result = result * 37 + (auth_service != null ? auth_service.hashCode() : 0); - result = result * 37 + (network_type != null ? network_type.hashCode() : 0); - result = result * 37 + (status != null ? status.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String id; - public String domain; - public String user; - public String resource; - public String auth_token; - public String device_id; - public Long last_rmq_id; - public List setting; - public Integer compress; - public List received_persistent_id; - public Boolean include_stream_ids; - public Boolean adaptive_heartbeat; - public HeartbeatStat heartbeat_stat; - public Boolean use_rmq2; - public Long account_id; - public AuthService auth_service; - public Integer network_type; - public Long status; - - public Builder() { - } - - public Builder(LoginRequest message) { - super(message); - if (message == null) return; - this.id = message.id; - this.domain = message.domain; - this.user = message.user; - this.resource = message.resource; - this.auth_token = message.auth_token; - this.device_id = message.device_id; - this.last_rmq_id = message.last_rmq_id; - this.setting = copyOf(message.setting); - this.compress = message.compress; - this.received_persistent_id = copyOf(message.received_persistent_id); - this.include_stream_ids = message.include_stream_ids; - this.adaptive_heartbeat = message.adaptive_heartbeat; - this.heartbeat_stat = message.heartbeat_stat; - this.use_rmq2 = message.use_rmq2; - this.account_id = message.account_id; - this.auth_service = message.auth_service; - this.network_type = message.network_type; - this.status = message.status; - } - - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Must be present ( proto required ), may be empty - * string. - * mcs.android.com. - */ - public Builder domain(String domain) { - this.domain = domain; - return this; - } - - /** - * Decimal android ID - */ - public Builder user(String user) { - this.user = user; - return this; - } - - public Builder resource(String resource) { - this.resource = resource; - return this; - } - - /** - * Secret - */ - public Builder auth_token(String auth_token) { - this.auth_token = auth_token; - return this; - } - - /** - * Format is: android-HEX_DEVICE_ID - * The user is the decimal value. - */ - public Builder device_id(String device_id) { - this.device_id = device_id; - return this; - } - - /** - * RMQ1 - no longer used - */ - public Builder last_rmq_id(Long last_rmq_id) { - this.last_rmq_id = last_rmq_id; - return this; - } - - public Builder setting(List setting) { - this.setting = checkForNulls(setting); - return this; - } - - public Builder compress(Integer compress) { - this.compress = compress; - return this; - } - - public Builder received_persistent_id(List received_persistent_id) { - this.received_persistent_id = checkForNulls(received_persistent_id); - return this; - } - - /** - * Replaced by "rmq2v" setting - */ - public Builder include_stream_ids(Boolean include_stream_ids) { - this.include_stream_ids = include_stream_ids; - return this; - } - - public Builder adaptive_heartbeat(Boolean adaptive_heartbeat) { - this.adaptive_heartbeat = adaptive_heartbeat; - return this; - } - - public Builder heartbeat_stat(HeartbeatStat heartbeat_stat) { - this.heartbeat_stat = heartbeat_stat; - return this; - } - - /** - * Must be true. - */ - public Builder use_rmq2(Boolean use_rmq2) { - this.use_rmq2 = use_rmq2; - return this; - } - - public Builder account_id(Long account_id) { - this.account_id = account_id; - return this; - } - - /** - * ANDROID_ID = 2 - */ - public Builder auth_service(AuthService auth_service) { - this.auth_service = auth_service; - return this; - } - - public Builder network_type(Integer network_type) { - this.network_type = network_type; - return this; - } - - public Builder status(Long status) { - this.status = status; - return this; - } - - @Override - public LoginRequest build() { - checkRequiredFields(); - return new LoginRequest(this); - } - } - - public enum AuthService - implements ProtoEnum { - ANDROID_ID(2); - - private final int value; - - private AuthService(int value) { - this.value = value; - } - - @Override - public int getValue() { - return value; - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginResponse.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginResponse.java deleted file mode 100644 index 3ffebafe..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/LoginResponse.java +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; -import java.util.Collections; -import java.util.List; - -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; -import static com.squareup.wire.Message.Label.REQUIRED; - -/** - * TAG: 3 - */ -public final class LoginResponse extends Message { - - public static final String DEFAULT_ID = ""; - public static final String DEFAULT_JID = ""; - public static final List DEFAULT_SETTING = Collections.emptyList(); - public static final Integer DEFAULT_STREAM_ID = 0; - public static final Integer DEFAULT_LAST_STREAM_ID_RECEIVED = 0; - public static final Long DEFAULT_SERVER_TIMESTAMP = 0L; - - @ProtoField(tag = 1, type = STRING, label = REQUIRED) - public final String id; - - /** - * Not used. - */ - @ProtoField(tag = 2, type = STRING) - public final String jid; - - /** - * Null if login was ok. - */ - @ProtoField(tag = 3) - public final ErrorInfo error; - - @ProtoField(tag = 4, label = REPEATED, messageType = Setting.class) - public final List setting; - - @ProtoField(tag = 5, type = INT32) - public final Integer stream_id; - - /** - * Should be "1" - */ - @ProtoField(tag = 6, type = INT32) - public final Integer last_stream_id_received; - - @ProtoField(tag = 7) - public final HeartbeatConfig heartbeat_config; - - /** - * used by the client to synchronize with the server timestamp. - */ - @ProtoField(tag = 8, type = INT64) - public final Long server_timestamp; - - public LoginResponse(String id, String jid, ErrorInfo error, List setting, Integer stream_id, Integer last_stream_id_received, HeartbeatConfig heartbeat_config, Long server_timestamp) { - this.id = id; - this.jid = jid; - this.error = error; - this.setting = immutableCopyOf(setting); - this.stream_id = stream_id; - this.last_stream_id_received = last_stream_id_received; - this.heartbeat_config = heartbeat_config; - this.server_timestamp = server_timestamp; - } - - private LoginResponse(Builder builder) { - this(builder.id, builder.jid, builder.error, builder.setting, builder.stream_id, builder.last_stream_id_received, builder.heartbeat_config, builder.server_timestamp); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof LoginResponse)) return false; - LoginResponse o = (LoginResponse) other; - return equals(id, o.id) - && equals(jid, o.jid) - && equals(error, o.error) - && equals(setting, o.setting) - && equals(stream_id, o.stream_id) - && equals(last_stream_id_received, o.last_stream_id_received) - && equals(heartbeat_config, o.heartbeat_config) - && equals(server_timestamp, o.server_timestamp); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = id != null ? id.hashCode() : 0; - result = result * 37 + (jid != null ? jid.hashCode() : 0); - result = result * 37 + (error != null ? error.hashCode() : 0); - result = result * 37 + (setting != null ? setting.hashCode() : 1); - result = result * 37 + (stream_id != null ? stream_id.hashCode() : 0); - result = result * 37 + (last_stream_id_received != null ? last_stream_id_received.hashCode() : 0); - result = result * 37 + (heartbeat_config != null ? heartbeat_config.hashCode() : 0); - result = result * 37 + (server_timestamp != null ? server_timestamp.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String id; - public String jid; - public ErrorInfo error; - public List setting; - public Integer stream_id; - public Integer last_stream_id_received; - public HeartbeatConfig heartbeat_config; - public Long server_timestamp; - - public Builder() { - } - - public Builder(LoginResponse message) { - super(message); - if (message == null) return; - this.id = message.id; - this.jid = message.jid; - this.error = message.error; - this.setting = copyOf(message.setting); - this.stream_id = message.stream_id; - this.last_stream_id_received = message.last_stream_id_received; - this.heartbeat_config = message.heartbeat_config; - this.server_timestamp = message.server_timestamp; - } - - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Not used. - */ - public Builder jid(String jid) { - this.jid = jid; - return this; - } - - /** - * Null if login was ok. - */ - public Builder error(ErrorInfo error) { - this.error = error; - return this; - } - - public Builder setting(List setting) { - this.setting = checkForNulls(setting); - return this; - } - - public Builder stream_id(Integer stream_id) { - this.stream_id = stream_id; - return this; - } - - /** - * Should be "1" - */ - public Builder last_stream_id_received(Integer last_stream_id_received) { - this.last_stream_id_received = last_stream_id_received; - return this; - } - - public Builder heartbeat_config(HeartbeatConfig heartbeat_config) { - this.heartbeat_config = heartbeat_config; - return this; - } - - /** - * used by the client to synchronize with the server timestamp. - */ - public Builder server_timestamp(Long server_timestamp) { - this.server_timestamp = server_timestamp; - return this; - } - - @Override - public LoginResponse build() { - checkRequiredFields(); - return new LoginResponse(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/SelectiveAck.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/SelectiveAck.java deleted file mode 100644 index dad958be..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/SelectiveAck.java +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; -import java.util.Collections; -import java.util.List; - -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; - -/** - * Included in IQ sent after LoginResponse from server with ID 12. - */ -public final class SelectiveAck extends Message { - - public static final List DEFAULT_ID = Collections.emptyList(); - - @ProtoField(tag = 1, type = STRING, label = REPEATED) - public final List id; - - public SelectiveAck(List id) { - this.id = immutableCopyOf(id); - } - - private SelectiveAck(Builder builder) { - this(builder.id); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof SelectiveAck)) return false; - return equals(id, ((SelectiveAck) other).id); - } - - @Override - public int hashCode() { - int result = hashCode; - return result != 0 ? result : (hashCode = id != null ? id.hashCode() : 1); - } - - public static final class Builder extends Message.Builder { - - public List id; - - public Builder() { - } - - public Builder(SelectiveAck message) { - super(message); - if (message == null) return; - this.id = copyOf(message.id); - } - - public Builder id(List id) { - this.id = checkForNulls(id); - return this; - } - - @Override - public SelectiveAck build() { - return new SelectiveAck(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Setting.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Setting.java deleted file mode 100644 index 00c9eacc..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/Setting.java +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REQUIRED; - -/** - * MobileSettings class. - * "u:f", "u:b", "u:s" - multi user devices reporting foreground, background - * and stopped users. - * hbping: heatbeat ping interval - * rmq2v: include explicit stream IDs - */ -public final class Setting extends Message { - - public static final String DEFAULT_NAME = ""; - public static final String DEFAULT_VALUE = ""; - - @ProtoField(tag = 1, type = STRING, label = REQUIRED) - public final String name; - - @ProtoField(tag = 2, type = STRING, label = REQUIRED) - public final String value; - - public Setting(String name, String value) { - this.name = name; - this.value = value; - } - - private Setting(Builder builder) { - this(builder.name, builder.value); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Setting)) return false; - Setting o = (Setting) other; - return equals(name, o.name) - && equals(value, o.value); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = name != null ? name.hashCode() : 0; - result = result * 37 + (value != null ? value.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String name; - public String value; - - public Builder() { - } - - public Builder(Setting message) { - super(message); - if (message == null) return; - this.name = message.name; - this.value = message.value; - } - - public Builder name(String name) { - this.name = name; - return this; - } - - public Builder value(String value) { - this.value = value; - return this; - } - - @Override - public Setting build() { - checkRequiredFields(); - return new Setting(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamAck.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamAck.java deleted file mode 100644 index d1b65f0b..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamAck.java +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; - -/** - * Included in IQ with ID 13, sent from client or server after 10 unconfirmed - * messages. - */ -public final class StreamAck extends Message { - - public StreamAck() { - } - - private StreamAck(Builder builder) { - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - return other instanceof StreamAck; - } - - @Override - public int hashCode() { - return 0; - } - - public static final class Builder extends Message.Builder { - - public Builder() { - } - - public Builder(StreamAck message) { - super(message); - } - - @Override - public StreamAck build() { - return new StreamAck(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamErrorStanza.java b/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamErrorStanza.java deleted file mode 100644 index 0a836d7a..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/gcm/mcs/StreamErrorStanza.java +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by Wire protocol buffer compiler, do not edit. -// Source file: protos-repo/mcs.proto -package org.microg.gms.gcm.mcs; - -import com.squareup.wire.Message; -import com.squareup.wire.ProtoField; - -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REQUIRED; - -public final class StreamErrorStanza extends Message { - - public static final String DEFAULT_TYPE = ""; - public static final String DEFAULT_TEXT = ""; - - @ProtoField(tag = 1, type = STRING, label = REQUIRED) - public final String type; - - @ProtoField(tag = 2, type = STRING) - public final String text; - - public StreamErrorStanza(String type, String text) { - this.type = type; - this.text = text; - } - - private StreamErrorStanza(Builder builder) { - this(builder.type, builder.text); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof StreamErrorStanza)) return false; - StreamErrorStanza o = (StreamErrorStanza) other; - return equals(type, o.type) - && equals(text, o.text); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = type != null ? type.hashCode() : 0; - result = result * 37 + (text != null ? text.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String type; - public String text; - - public Builder() { - } - - public Builder(StreamErrorStanza message) { - super(message); - if (message == null) return; - this.type = message.type; - this.text = message.text; - } - - public Builder type(String type) { - this.type = type; - return this; - } - - public Builder text(String text) { - this.text = text; - return this; - } - - @Override - public StreamErrorStanza build() { - checkRequiredFields(); - return new StreamErrorStanza(this); - } - } -} 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 994a92dd..14efd6e1 100755 --- a/play-services-core/src/main/res/values-it/strings.xml +++ b/play-services-core/src/main/res/values-it/strings.xml @@ -16,7 +16,6 @@ Impostazioni di Vanced microG - Configurazione di Vanced 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. @@ -26,14 +25,14 @@ Ci dispiace… "Un\'applicazione sul tuo dispositivo sta tentando di accedere all\'account Google. -Se ciò era intenzionale, utilizzate il pulsante Accedi per collegarti alla pagina di autenticazione di Google, in caso contrario utilizza il pulsante Cancella per tornare all\'applicazione che ha aperto questa finestra di dialogo." +Se ciò era intenzionale, utilizza il pulsante Accedi per collegarti alla pagina di autenticazione di Google, in caso contrario utilizza il pulsante Cancella per tornare all\'applicazione che ha aperto questa finestra di dialogo." Accedi "Il tuo dispositivo sta stabilendo la connessione con i server di Google per autenticarti. Questa operazione può richiedere alcuni secondi." "Non disponi di una connessione ad internet. -Potrebbe trattarsi di un disservizio temporaneo oppure non essere il tuo dispositivo Android fornito di connessione dati. Riprova quando connessi ad una rete cellulare o ad una rete Wi-Fi." +Potrebbe trattarsi di un disservizio temporaneo oppure non essere il tuo dispositivo Android fornito di connessione dati. Riprova quando connesso ad una rete cellulare o ad una rete Wi-Fi." "C\è stato un problema di comunicazione con i server di Google. Try again later." @@ -50,71 +49,76 @@ Questa operazione può richiedere alcuni minuti." Invia messaggi C2DM ad altre applicazioni Scambia messaggi e riceve notifiche di sincronizzazione dai server Google Accesso esteso ai servizi Google - + Registrazione del dispositivo Messaggistica cloud Disabilitato Abilitato Automatico + Abilitato + Disabilitato Impostazioni avanzate - Nessuno + Nessuna + Mostra tutte Reti mobili Wi-Fi Roaming Altre reti - - - Sistema - - Ottimizzazioni della batteria ignorate: - Tocca qui per disabilitare le ottimizzazioni della batteria. Non selezionare questa opzione potrebbe comportare il malfunzionamento delle applicazioni. - - 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. + 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 selezionare l\'opzione per ignorare le ottimizzazioni della batteria. Ignora ottimizzazioni - + Preferenze dell\'account Informazioni personali e riservatezza Accesso e sicurezza Dai fiducia a Google per i permessi alle applicazioni - Quando disabilitato, viene interpellato l\'utente prima che ogni richiesta di autorizzazione da parte delle applicazioni venga inviata a Google. Alcune applicazioni potrebbero fallire nell\'utilizzare l\'account Google se questa opzione è disabilitata. + Quando questa opzione è disabilitata, viene interpellato l\'utente prima che ogni richiesta di autorizzazione da parte delle applicazioni venga inviata a Google. Alcune applicazioni potrebbero fallire nell\'utilizzare l\'account Google se questa opzione è disabilitata. Autorizza le applicazioni a visualizzare gli account - Quando abilitata tutte le applicazioni su questo dispositivo saranno in grado di visualizzare gli indirizzi di posta elettronica dell\'account Google senza autorizzazione preventiva. + Quando questa opzione è abilitata, tutte le applicazioni su questo dispositivo saranno in grado di visualizzare gli indirizzi di posta elettronica dell\'account Google senza autorizzazione preventiva. + + Registra il tuo dispositivo ai servizi Google e crea un identificativo univoco. Vengono rimossi da microG alcuni bit funzionali all\'identificazione dai dati di registrazione, oltre al nome dell\'account Google. + + Non registrato + Ultima registrazione: %1$s + + Stato + Impostazioni avanzate Account Aggiungi un account Google Il servizio di messaggistica cloud di Google è un fornitore di notifiche push utilizzato da molte applicazioni di terze parti. Per poterlo utlizzare devi abilitare la registrazione del dispositivo. Applicazioni che utilizzano il servizio di messaggistica cloud di Google Conferma le nuove applicazioni - Interroga l\'utente prima di registrare una nuova applicazione per le notifiche push. + Chiedi conferma all\'utente prima di registrare una nuova applicazione per le notifiche push. A proposito di microG - - De-registrazione + + Annulla la registrazione Non registrata Nessun messaggio ricevuto fino ad ora Ultimo messaggio: %1$s Registrata - Registrata da: %1$s - De-registrazione %1$s? - 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? + Registrata: %1$s + Annulla la registrazione di %1$s? + Alcune applicazioni non rinnovano automaticamente la registrazione e/o non forniscono un\'opzione per farlo manualmente. Queste applicazioni potrebbero non funzionare correttamente a seguito dell\'annullamento della registrazione.\nContinuare? + Hai negato ad un\'applicazione, già registrata in precedenza, di registrarsi per la ricezione delle notifiche push.\nDesideri annullare la registrazione 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 + Connesso %1$s - + Permetti la registrazione + Permetti all\'applicazione di registrarsi per la ricezione delle notifiche push. + Avvia alla ricezione + Avvia l\'applicazione in background in seguito alla ricezione delle notifiche push. + Applicazioni che utilizzano le notifiche push + Applicazioni registrate + Applicazioni non registrate + Reti da utilizzare per le notifiche push + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 013723e2..81aefbb8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,6 +9,7 @@ include ':play-services-iid-api' include ':play-services-base' include ':play-services-base-api' include ':play-services-tasks' +include ':play-services-core-proto' include ':play-services-base-core'