mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-12-24 03:35:50 +01:00
Migrate to latest Wire library, build directly from proto
This commit is contained in:
parent
914a8307e9
commit
3c2119ce79
10
build.gradle
10
build.gradle
@ -22,12 +22,13 @@ buildscript {
|
||||
ext.preferenceVersion = '1.1.1'
|
||||
ext.recyclerviewVersion = '1.1.0'
|
||||
|
||||
ext.supportLibraryVersion = "28.0.0"
|
||||
ext.slf4jVersion = "1.7.25"
|
||||
ext.supportLibraryVersion = '28.0.0'
|
||||
ext.slf4jVersion = '1.7.25'
|
||||
ext.wireVersion = '3.2.2'
|
||||
|
||||
ext.androidBuildGradleVersion = "3.6.3"
|
||||
ext.androidBuildGradleVersion = '3.6.3'
|
||||
|
||||
ext.androidBuildVersionTools = "29.0.3"
|
||||
ext.androidBuildVersionTools = '29.0.3'
|
||||
|
||||
ext.androidMinSdk = 14
|
||||
ext.androidTargetSdk = 29
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
21
play-services-core-proto/build.gradle
Normal file
21
play-services-core-proto/build.gradle
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020, microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
apply plugin: 'com.squareup.wire'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
dependencies {
|
||||
implementation "com.squareup.wire:wire-runtime:$wireVersion"
|
||||
}
|
||||
|
||||
wire {
|
||||
kotlin {
|
||||
javaInterop = true
|
||||
}
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = 1.8
|
||||
}
|
@ -24,7 +24,7 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.squareup.wire:wire-runtime:1.6.1"
|
||||
implementation "com.squareup.wire:wire-runtime:$wireVersion"
|
||||
implementation "de.hdodenhof:circleimageview:1.3.0"
|
||||
implementation "org.conscrypt:conscrypt-android:2.1.0"
|
||||
// TODO: Switch to upstream once raw requests are merged
|
||||
@ -40,6 +40,7 @@ dependencies {
|
||||
implementation project(':firebase-dynamic-links-api')
|
||||
implementation project(':play-services-base-core')
|
||||
implementation project(':play-services-location-core')
|
||||
implementation project(':play-services-core-proto')
|
||||
implementation project(':play-services-core:microg-ui-tools') // deprecated
|
||||
implementation project(':play-services-api')
|
||||
implementation project(':play-services-cast-api')
|
||||
@ -91,7 +92,6 @@ android {
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs += 'src/main/protos-java'
|
||||
java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class AskPermissionActivity extends AccountAuthenticatorActivity {
|
||||
service = getIntent().getStringExtra(KEY_AUTHTOKEN);
|
||||
if (getIntent().hasExtra(EXTRA_CONSENT_DATA)) {
|
||||
try {
|
||||
consentData = new Wire().parseFrom(getIntent().getByteArrayExtra(EXTRA_CONSENT_DATA), ConsentData.class);
|
||||
consentData = ConsentData.ADAPTER.decode(getIntent().getByteArrayExtra(EXTRA_CONSENT_DATA));
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
|
@ -60,7 +60,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 +72,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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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++;
|
||||
}
|
||||
|
@ -392,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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -413,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);
|
||||
}
|
||||
@ -501,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();
|
||||
@ -573,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());
|
||||
}
|
||||
|
@ -78,10 +78,10 @@ public class Attestation {
|
||||
.signatureDigest(getPackageSignatures())
|
||||
.gmsVersionCode(Constants.MAX_REFERENCE_VERSION)
|
||||
//.googleCn(false)
|
||||
.seLinuxState(new SELinuxState(true, true))
|
||||
.seLinuxState(new SELinuxState.Builder().enabled(true).supported(true).build())
|
||||
.suCandidates(Collections.<FileState>emptyList())
|
||||
.build();
|
||||
return this.payload = payload.toByteArray();
|
||||
return this.payload = payload.encode();
|
||||
}
|
||||
|
||||
public byte[] getPayload() {
|
||||
@ -143,7 +143,7 @@ public class Attestation {
|
||||
if (payload == null) {
|
||||
throw new IllegalStateException("missing payload");
|
||||
}
|
||||
return attest(new AttestRequest(ByteString.of(payload), droidGaurdResult), apiKey).result;
|
||||
return attest(new AttestRequest.Builder().safetyNetData(ByteString.of(payload)).droidGuardResult(droidGaurdResult).build(), apiKey).result;
|
||||
}
|
||||
|
||||
private AttestResponse attest(AttestRequest request, String apiKey) throws IOException {
|
||||
@ -158,7 +158,7 @@ public class Attestation {
|
||||
connection.setRequestProperty("User-Agent", "SafetyNet/" + Constants.MAX_REFERENCE_VERSION + " (" + build.device + " " + build.id + "); gzip");
|
||||
|
||||
OutputStream os = connection.getOutputStream();
|
||||
os.write(request.toByteArray());
|
||||
os.write(request.encode());
|
||||
os.close();
|
||||
|
||||
if (connection.getResponseCode() != 200) {
|
||||
@ -179,7 +179,7 @@ public class Attestation {
|
||||
InputStream is = connection.getInputStream();
|
||||
byte[] bytes = Utils.readStreamToEnd(new GZIPInputStream(is));
|
||||
try {
|
||||
return new Wire().parseFrom(bytes, AttestResponse.class);
|
||||
return AttestResponse.ADAPTER.decode(bytes);
|
||||
} catch (IOException e) {
|
||||
Log.d(TAG, Base64.encodeToString(bytes, 0));
|
||||
throw e;
|
||||
|
@ -280,7 +280,7 @@ public class WearableImpl {
|
||||
.build()).hasAsset(true).build();
|
||||
activeConnections.get(nodeId).writeMessage(announceMessage);
|
||||
File assetFile = createAssetFile(asset.getDigest());
|
||||
String fileName = calculateDigest(announceMessage.toByteArray());
|
||||
String fileName = calculateDigest(announceMessage.encode());
|
||||
FileInputStream fis = new FileInputStream(assetFile);
|
||||
byte[] arr = new byte[12215];
|
||||
ByteString lastPiece = 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<ScopeDetails> DEFAULT_SCOPES = Collections.emptyList();
|
||||
|
||||
@ProtoField(tag = 1)
|
||||
public final AppDetails app;
|
||||
|
||||
@ProtoField(tag = 2, label = REPEATED, messageType = ScopeDetails.class)
|
||||
public final List<ScopeDetails> scopes;
|
||||
|
||||
public ConsentData(AppDetails app, List<ScopeDetails> 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<ConsentData> {
|
||||
|
||||
public AppDetails app;
|
||||
public List<ScopeDetails> 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<ScopeDetails> 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<AppDetails> {
|
||||
|
||||
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<ScopeDetails> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -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<Intent> DEFAULT_INTENT = Collections.emptyList();
|
||||
public static final Long DEFAULT_TIMEMS = 0L;
|
||||
public static final String DEFAULT_DIGEST = "";
|
||||
public static final List<GservicesSetting> 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<String> 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> 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<GservicesSetting> 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<String> 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> intent, Long timeMs, String digest, List<GservicesSetting> setting, Boolean marketOk, Long androidId, Long securityToken, Boolean settingsDiff, List<String> 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<CheckinResponse> {
|
||||
|
||||
public Boolean statsOk;
|
||||
public List<Intent> intent;
|
||||
public Long timeMs;
|
||||
public String digest;
|
||||
public List<GservicesSetting> setting;
|
||||
public Boolean marketOk;
|
||||
public Long androidId;
|
||||
public Long securityToken;
|
||||
public Boolean settingsDiff;
|
||||
public List<String> 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> 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<GservicesSetting> 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<String> 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<Intent.Extra> 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<Intent.Extra> extra;
|
||||
|
||||
public Intent(String action, String dataUri, String mimeType, String javaClass, List<Intent.Extra> 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<Intent> {
|
||||
|
||||
public String action;
|
||||
public String dataUri;
|
||||
public String mimeType;
|
||||
public String javaClass;
|
||||
public List<Intent.Extra> 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<Intent.Extra> 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<Extra> {
|
||||
|
||||
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<GservicesSetting> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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<AppData> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<Close> {
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(Close message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Close build() {
|
||||
return new Close(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<AppData> 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<AppData> 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<AppData> 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<DataMessageStanza> {
|
||||
|
||||
public Long rmq_id;
|
||||
public String id;
|
||||
public String from;
|
||||
public String to;
|
||||
public String category;
|
||||
public String token;
|
||||
public List<AppData> 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<AppData> 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<ErrorInfo> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<Extension> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<HeartbeatAck> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<HeartbeatConfig> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<HeartbeatPing> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<HeartbeatStat> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<IqStanza> {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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<Setting> DEFAULT_SETTING = Collections.emptyList();
|
||||
public static final Integer DEFAULT_COMPRESS = 0;
|
||||
public static final List<String> 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> setting;
|
||||
|
||||
@ProtoField(tag = 9, type = INT32)
|
||||
public final Integer compress;
|
||||
|
||||
@ProtoField(tag = 10, type = STRING, label = REPEATED)
|
||||
public final List<String> 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> setting, Integer compress, List<String> 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<LoginRequest> {
|
||||
|
||||
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> setting;
|
||||
public Integer compress;
|
||||
public List<String> 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> setting) {
|
||||
this.setting = checkForNulls(setting);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder compress(Integer compress) {
|
||||
this.compress = compress;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder received_persistent_id(List<String> 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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<Setting> 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> 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> 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<LoginResponse> {
|
||||
|
||||
public String id;
|
||||
public String jid;
|
||||
public ErrorInfo error;
|
||||
public List<Setting> 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> 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<String> DEFAULT_ID = Collections.emptyList();
|
||||
|
||||
@ProtoField(tag = 1, type = STRING, label = REPEATED)
|
||||
public final List<String> id;
|
||||
|
||||
public SelectiveAck(List<String> 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<SelectiveAck> {
|
||||
|
||||
public List<String> id;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(SelectiveAck message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.id = copyOf(message.id);
|
||||
}
|
||||
|
||||
public Builder id(List<String> id) {
|
||||
this.id = checkForNulls(id);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectiveAck build() {
|
||||
return new SelectiveAck(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<Setting> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<StreamAck> {
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(StreamAck message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamAck build() {
|
||||
return new StreamAck(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -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<StreamErrorStanza> {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/snet.proto
|
||||
package org.microg.gms.snet;
|
||||
|
||||
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.STRING;
|
||||
|
||||
public final class AttestRequest extends Message {
|
||||
|
||||
public static final ByteString DEFAULT_SAFETYNETDATA = ByteString.EMPTY;
|
||||
public static final String DEFAULT_DROIDGUARDRESULT = "";
|
||||
|
||||
@ProtoField(tag = 1, type = BYTES)
|
||||
public final ByteString safetyNetData;
|
||||
|
||||
@ProtoField(tag = 2, type = STRING)
|
||||
public final String droidGuardResult;
|
||||
|
||||
public AttestRequest(ByteString safetyNetData, String droidGuardResult) {
|
||||
this.safetyNetData = safetyNetData;
|
||||
this.droidGuardResult = droidGuardResult;
|
||||
}
|
||||
|
||||
private AttestRequest(Builder builder) {
|
||||
this(builder.safetyNetData, builder.droidGuardResult);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof AttestRequest)) return false;
|
||||
AttestRequest o = (AttestRequest) other;
|
||||
return equals(safetyNetData, o.safetyNetData)
|
||||
&& equals(droidGuardResult, o.droidGuardResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = safetyNetData != null ? safetyNetData.hashCode() : 0;
|
||||
result = result * 37 + (droidGuardResult != null ? droidGuardResult.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<AttestRequest> {
|
||||
|
||||
public ByteString safetyNetData;
|
||||
public String droidGuardResult;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(AttestRequest message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.safetyNetData = message.safetyNetData;
|
||||
this.droidGuardResult = message.droidGuardResult;
|
||||
}
|
||||
|
||||
public Builder safetyNetData(ByteString safetyNetData) {
|
||||
this.safetyNetData = safetyNetData;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder droidGuardResult(String droidGuardResult) {
|
||||
this.droidGuardResult = droidGuardResult;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttestRequest build() {
|
||||
return new AttestRequest(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/snet.proto
|
||||
package org.microg.gms.snet;
|
||||
|
||||
import com.squareup.wire.Message;
|
||||
import com.squareup.wire.ProtoField;
|
||||
|
||||
import static com.squareup.wire.Message.Datatype.STRING;
|
||||
|
||||
public final class AttestResponse extends Message {
|
||||
|
||||
public static final String DEFAULT_RESULT = "";
|
||||
|
||||
@ProtoField(tag = 2, type = STRING)
|
||||
public final String result;
|
||||
|
||||
public AttestResponse(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
private AttestResponse(Builder builder) {
|
||||
this(builder.result);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof AttestResponse)) return false;
|
||||
return equals(result, ((AttestResponse) other).result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
return result != 0 ? result : (hashCode = this.result != null ? this.result.hashCode() : 0);
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<AttestResponse> {
|
||||
|
||||
public String result;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(AttestResponse message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.result = message.result;
|
||||
}
|
||||
|
||||
public Builder result(String result) {
|
||||
this.result = result;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttestResponse build() {
|
||||
return new AttestResponse(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/snet.proto
|
||||
package org.microg.gms.snet;
|
||||
|
||||
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.STRING;
|
||||
|
||||
public final class FileState extends Message {
|
||||
|
||||
public static final String DEFAULT_FILENAME = "";
|
||||
public static final ByteString DEFAULT_DIGEST = ByteString.EMPTY;
|
||||
|
||||
@ProtoField(tag = 1, type = STRING)
|
||||
public final String fileName;
|
||||
|
||||
@ProtoField(tag = 2, type = BYTES)
|
||||
public final ByteString digest;
|
||||
|
||||
public FileState(String fileName, ByteString digest) {
|
||||
this.fileName = fileName;
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
private FileState(Builder builder) {
|
||||
this(builder.fileName, builder.digest);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof FileState)) return false;
|
||||
FileState o = (FileState) other;
|
||||
return equals(fileName, o.fileName)
|
||||
&& equals(digest, o.digest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = fileName != null ? fileName.hashCode() : 0;
|
||||
result = result * 37 + (digest != null ? digest.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<FileState> {
|
||||
|
||||
public String fileName;
|
||||
public ByteString digest;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(FileState message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.fileName = message.fileName;
|
||||
this.digest = message.digest;
|
||||
}
|
||||
|
||||
public Builder fileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder digest(ByteString digest) {
|
||||
this.digest = digest;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileState build() {
|
||||
return new FileState(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/snet.proto
|
||||
package org.microg.gms.snet;
|
||||
|
||||
import com.squareup.wire.Message;
|
||||
import com.squareup.wire.ProtoField;
|
||||
|
||||
import static com.squareup.wire.Message.Datatype.BOOL;
|
||||
|
||||
public final class SELinuxState extends Message {
|
||||
|
||||
public static final Boolean DEFAULT_SUPPORTED = false;
|
||||
public static final Boolean DEFAULT_ENABLED = false;
|
||||
|
||||
@ProtoField(tag = 1, type = BOOL)
|
||||
public final Boolean supported;
|
||||
|
||||
@ProtoField(tag = 2, type = BOOL)
|
||||
public final Boolean enabled;
|
||||
|
||||
public SELinuxState(Boolean supported, Boolean enabled) {
|
||||
this.supported = supported;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
private SELinuxState(Builder builder) {
|
||||
this(builder.supported, builder.enabled);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof SELinuxState)) return false;
|
||||
SELinuxState o = (SELinuxState) other;
|
||||
return equals(supported, o.supported)
|
||||
&& equals(enabled, o.enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = supported != null ? supported.hashCode() : 0;
|
||||
result = result * 37 + (enabled != null ? enabled.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<SELinuxState> {
|
||||
|
||||
public Boolean supported;
|
||||
public Boolean enabled;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(SELinuxState message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.supported = message.supported;
|
||||
this.enabled = message.enabled;
|
||||
}
|
||||
|
||||
public Builder supported(Boolean supported) {
|
||||
this.supported = supported;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder enabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SELinuxState build() {
|
||||
return new SELinuxState(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,186 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/snet.proto
|
||||
package org.microg.gms.snet;
|
||||
|
||||
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;
|
||||
|
||||
public final class SafetyNetData extends Message {
|
||||
|
||||
public static final ByteString DEFAULT_NONCE = ByteString.EMPTY;
|
||||
public static final String DEFAULT_PACKAGENAME = "";
|
||||
public static final List<ByteString> DEFAULT_SIGNATUREDIGEST = Collections.emptyList();
|
||||
public static final ByteString DEFAULT_FILEDIGEST = ByteString.EMPTY;
|
||||
public static final Integer DEFAULT_GMSVERSIONCODE = 0;
|
||||
public static final List<FileState> DEFAULT_SUCANDIDATES = Collections.emptyList();
|
||||
public static final Long DEFAULT_CURRENTTIMEMS = 0L;
|
||||
public static final Boolean DEFAULT_GOOGLECN = false;
|
||||
|
||||
@ProtoField(tag = 1, type = BYTES)
|
||||
public final ByteString nonce;
|
||||
|
||||
@ProtoField(tag = 2, type = STRING)
|
||||
public final String packageName;
|
||||
|
||||
@ProtoField(tag = 3, type = BYTES, label = REPEATED)
|
||||
public final List<ByteString> signatureDigest;
|
||||
|
||||
@ProtoField(tag = 4, type = BYTES)
|
||||
public final ByteString fileDigest;
|
||||
|
||||
@ProtoField(tag = 5, type = INT32)
|
||||
public final Integer gmsVersionCode;
|
||||
|
||||
@ProtoField(tag = 6, label = REPEATED, messageType = FileState.class)
|
||||
public final List<FileState> suCandidates;
|
||||
|
||||
@ProtoField(tag = 7)
|
||||
public final SELinuxState seLinuxState;
|
||||
|
||||
@ProtoField(tag = 8, type = INT64)
|
||||
public final Long currentTimeMs;
|
||||
|
||||
@ProtoField(tag = 9, type = BOOL)
|
||||
public final Boolean googleCn;
|
||||
|
||||
public SafetyNetData(ByteString nonce, String packageName, List<ByteString> signatureDigest, ByteString fileDigest, Integer gmsVersionCode, List<FileState> suCandidates, SELinuxState seLinuxState, Long currentTimeMs, Boolean googleCn) {
|
||||
this.nonce = nonce;
|
||||
this.packageName = packageName;
|
||||
this.signatureDigest = immutableCopyOf(signatureDigest);
|
||||
this.fileDigest = fileDigest;
|
||||
this.gmsVersionCode = gmsVersionCode;
|
||||
this.suCandidates = immutableCopyOf(suCandidates);
|
||||
this.seLinuxState = seLinuxState;
|
||||
this.currentTimeMs = currentTimeMs;
|
||||
this.googleCn = googleCn;
|
||||
}
|
||||
|
||||
private SafetyNetData(Builder builder) {
|
||||
this(builder.nonce, builder.packageName, builder.signatureDigest, builder.fileDigest, builder.gmsVersionCode, builder.suCandidates, builder.seLinuxState, builder.currentTimeMs, builder.googleCn);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof SafetyNetData)) return false;
|
||||
SafetyNetData o = (SafetyNetData) other;
|
||||
return equals(nonce, o.nonce)
|
||||
&& equals(packageName, o.packageName)
|
||||
&& equals(signatureDigest, o.signatureDigest)
|
||||
&& equals(fileDigest, o.fileDigest)
|
||||
&& equals(gmsVersionCode, o.gmsVersionCode)
|
||||
&& equals(suCandidates, o.suCandidates)
|
||||
&& equals(seLinuxState, o.seLinuxState)
|
||||
&& equals(currentTimeMs, o.currentTimeMs)
|
||||
&& equals(googleCn, o.googleCn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = nonce != null ? nonce.hashCode() : 0;
|
||||
result = result * 37 + (packageName != null ? packageName.hashCode() : 0);
|
||||
result = result * 37 + (signatureDigest != null ? signatureDigest.hashCode() : 1);
|
||||
result = result * 37 + (fileDigest != null ? fileDigest.hashCode() : 0);
|
||||
result = result * 37 + (gmsVersionCode != null ? gmsVersionCode.hashCode() : 0);
|
||||
result = result * 37 + (suCandidates != null ? suCandidates.hashCode() : 1);
|
||||
result = result * 37 + (seLinuxState != null ? seLinuxState.hashCode() : 0);
|
||||
result = result * 37 + (currentTimeMs != null ? currentTimeMs.hashCode() : 0);
|
||||
result = result * 37 + (googleCn != null ? googleCn.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<SafetyNetData> {
|
||||
|
||||
public ByteString nonce;
|
||||
public String packageName;
|
||||
public List<ByteString> signatureDigest;
|
||||
public ByteString fileDigest;
|
||||
public Integer gmsVersionCode;
|
||||
public List<FileState> suCandidates;
|
||||
public SELinuxState seLinuxState;
|
||||
public Long currentTimeMs;
|
||||
public Boolean googleCn;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(SafetyNetData message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.nonce = message.nonce;
|
||||
this.packageName = message.packageName;
|
||||
this.signatureDigest = copyOf(message.signatureDigest);
|
||||
this.fileDigest = message.fileDigest;
|
||||
this.gmsVersionCode = message.gmsVersionCode;
|
||||
this.suCandidates = copyOf(message.suCandidates);
|
||||
this.seLinuxState = message.seLinuxState;
|
||||
this.currentTimeMs = message.currentTimeMs;
|
||||
this.googleCn = message.googleCn;
|
||||
}
|
||||
|
||||
public Builder nonce(ByteString nonce) {
|
||||
this.nonce = nonce;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder packageName(String packageName) {
|
||||
this.packageName = packageName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder signatureDigest(List<ByteString> signatureDigest) {
|
||||
this.signatureDigest = checkForNulls(signatureDigest);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder fileDigest(ByteString fileDigest) {
|
||||
this.fileDigest = fileDigest;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder gmsVersionCode(Integer gmsVersionCode) {
|
||||
this.gmsVersionCode = gmsVersionCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder suCandidates(List<FileState> suCandidates) {
|
||||
this.suCandidates = checkForNulls(suCandidates);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder seLinuxState(SELinuxState seLinuxState) {
|
||||
this.seLinuxState = seLinuxState;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder currentTimeMs(Long currentTimeMs) {
|
||||
this.currentTimeMs = currentTimeMs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder googleCn(Boolean googleCn) {
|
||||
this.googleCn = googleCn;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SafetyNetData build() {
|
||||
return new SafetyNetData(this);
|
||||
}
|
||||
}
|
||||
}
|
21
play-services-wearable-proto/build.gradle
Normal file
21
play-services-wearable-proto/build.gradle
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020, microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
apply plugin: 'com.squareup.wire'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
dependencies {
|
||||
implementation "com.squareup.wire:wire-runtime:$wireVersion"
|
||||
}
|
||||
|
||||
wire {
|
||||
kotlin {
|
||||
javaInterop = true
|
||||
}
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.jvmTarget = 1.8
|
||||
}
|
@ -26,12 +26,6 @@ android {
|
||||
targetSdkVersion androidTargetSdk
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs += 'src/main/protos-java'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
@ -45,5 +39,6 @@ android {
|
||||
dependencies {
|
||||
api project(':play-services-base')
|
||||
api project(':play-services-wearable-api')
|
||||
implementation 'com.squareup.wire:wire-runtime:1.6.1'
|
||||
api project(':play-services-wearable-proto')
|
||||
implementation "com.squareup.wire:wire-runtime:$wireVersion"
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import android.util.SparseArray;
|
||||
|
||||
import com.google.android.gms.wearable.Asset;
|
||||
import com.google.android.gms.wearable.DataMap;
|
||||
import com.squareup.wire.Wire;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -33,7 +32,7 @@ public class DataBundleUtil {
|
||||
|
||||
public static DataMap readDataMap(byte[] bytes, List<Asset> assets) {
|
||||
try {
|
||||
return readDataMap(new Wire().parseFrom(bytes, DataBundle.class), assets);
|
||||
return readDataMap(DataBundle.ADAPTER.decode(bytes), assets);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@ -62,7 +61,7 @@ public class DataBundleUtil {
|
||||
public static AssetAnnotatedDataBundle createDataBundle(DataMap dataMap) {
|
||||
AssetAnnotatedDataBundle dataBundle = new AssetAnnotatedDataBundle();
|
||||
dataBundle.assets = new ArrayList<Asset>();
|
||||
dataBundle.dataBundle = new DataBundle(createEntryList(dataMap, dataBundle.assets));
|
||||
dataBundle.dataBundle = new DataBundle.Builder().entries(createEntryList(dataMap, dataBundle.assets)).build();
|
||||
return dataBundle;
|
||||
}
|
||||
|
||||
@ -554,7 +553,7 @@ public class DataBundleUtil {
|
||||
}
|
||||
|
||||
public byte[] getData() {
|
||||
return dataBundle.toByteArray();
|
||||
return dataBundle.encode();
|
||||
}
|
||||
}
|
||||
|
||||
@ -640,7 +639,7 @@ public class DataBundleUtil {
|
||||
}
|
||||
|
||||
DataBundleTypedValue createTyped(T value, List<Asset> assets) {
|
||||
return new DataBundleTypedValue(type, create(value, assets));
|
||||
return new DataBundleTypedValue.Builder().type(type).value(create(value, assets)).build();
|
||||
}
|
||||
|
||||
DataBundleValue loadAndCreate(DataMap dataMap, String key, List<Asset> assets) {
|
||||
@ -652,7 +651,7 @@ public class DataBundleUtil {
|
||||
}
|
||||
|
||||
DataBundleEntry loadAndCreateEntry(DataMap dataMap, String key, List<Asset> assets) {
|
||||
return new DataBundleEntry(key, loadAndCreateTyped(dataMap, key, assets));
|
||||
return new DataBundleEntry.Builder().key(key).typedValue(loadAndCreateTyped(dataMap, key, assets)).build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,64 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
import com.squareup.wire.Message;
|
||||
import com.squareup.wire.ProtoField;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.squareup.wire.Message.Label.REPEATED;
|
||||
|
||||
public final class DataBundle extends Message {
|
||||
|
||||
public static final List<DataBundleEntry> DEFAULT_ENTRIES = Collections.emptyList();
|
||||
|
||||
@ProtoField(tag = 1, label = REPEATED, messageType = DataBundleEntry.class)
|
||||
public final List<DataBundleEntry> entries;
|
||||
|
||||
public DataBundle(List<DataBundleEntry> entries) {
|
||||
this.entries = immutableCopyOf(entries);
|
||||
}
|
||||
|
||||
private DataBundle(Builder builder) {
|
||||
this(builder.entries);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundle)) return false;
|
||||
return equals(entries, ((DataBundle) other).entries);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
return result != 0 ? result : (hashCode = entries != null ? entries.hashCode() : 1);
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundle> {
|
||||
|
||||
public List<DataBundleEntry> entries;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundle message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.entries = copyOf(message.entries);
|
||||
}
|
||||
|
||||
public Builder entries(List<DataBundleEntry> entries) {
|
||||
this.entries = checkForNulls(entries);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundle build() {
|
||||
return new DataBundle(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
import com.squareup.wire.Message;
|
||||
import com.squareup.wire.ProtoField;
|
||||
|
||||
import static com.squareup.wire.Message.Datatype.STRING;
|
||||
|
||||
public final class DataBundleEntry extends Message {
|
||||
|
||||
public static final String DEFAULT_KEY = "";
|
||||
|
||||
@ProtoField(tag = 1, type = STRING)
|
||||
public final String key;
|
||||
|
||||
@ProtoField(tag = 2)
|
||||
public final DataBundleTypedValue typedValue;
|
||||
|
||||
public DataBundleEntry(String key, DataBundleTypedValue typedValue) {
|
||||
this.key = key;
|
||||
this.typedValue = typedValue;
|
||||
}
|
||||
|
||||
private DataBundleEntry(Builder builder) {
|
||||
this(builder.key, builder.typedValue);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundleEntry)) return false;
|
||||
DataBundleEntry o = (DataBundleEntry) other;
|
||||
return equals(key, o.key)
|
||||
&& equals(typedValue, o.typedValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = key != null ? key.hashCode() : 0;
|
||||
result = result * 37 + (typedValue != null ? typedValue.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundleEntry> {
|
||||
|
||||
public String key;
|
||||
public DataBundleTypedValue typedValue;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundleEntry message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.key = message.key;
|
||||
this.typedValue = message.typedValue;
|
||||
}
|
||||
|
||||
public Builder key(String key) {
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder typedValue(DataBundleTypedValue typedValue) {
|
||||
this.typedValue = typedValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundleEntry build() {
|
||||
return new DataBundleEntry(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
import com.squareup.wire.Message;
|
||||
import com.squareup.wire.ProtoField;
|
||||
|
||||
import static com.squareup.wire.Message.Datatype.INT32;
|
||||
|
||||
public final class DataBundleTypedValue extends Message {
|
||||
|
||||
public static final Integer DEFAULT_TYPE = 0;
|
||||
|
||||
@ProtoField(tag = 1, type = INT32)
|
||||
public final Integer type;
|
||||
|
||||
@ProtoField(tag = 2)
|
||||
public final DataBundleValue value;
|
||||
|
||||
public DataBundleTypedValue(Integer type, DataBundleValue value) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private DataBundleTypedValue(Builder builder) {
|
||||
this(builder.type, builder.value);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundleTypedValue)) return false;
|
||||
DataBundleTypedValue o = (DataBundleTypedValue) other;
|
||||
return equals(type, o.type)
|
||||
&& equals(value, o.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = type != null ? type.hashCode() : 0;
|
||||
result = result * 37 + (value != null ? value.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundleTypedValue> {
|
||||
|
||||
public Integer type;
|
||||
public DataBundleValue value;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundleTypedValue message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.type = message.type;
|
||||
this.value = message.value;
|
||||
}
|
||||
|
||||
public Builder type(Integer type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder value(DataBundleValue value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundleTypedValue build() {
|
||||
return new DataBundleTypedValue(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,259 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
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.DOUBLE;
|
||||
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;
|
||||
|
||||
public final class DataBundleValue extends Message {
|
||||
|
||||
public static final ByteString DEFAULT_BYTEARRAY = ByteString.EMPTY;
|
||||
public static final String DEFAULT_STRINGVAL = "";
|
||||
public static final Double DEFAULT_DOUBLEVAL = 0D;
|
||||
public static final Float DEFAULT_FLOATVAL = 0F;
|
||||
public static final Long DEFAULT_LONGVAL = 0L;
|
||||
public static final Integer DEFAULT_INTVAL = 0;
|
||||
public static final Integer DEFAULT_BYTEVAL = 0;
|
||||
public static final Boolean DEFAULT_BOOLEANVAL = false;
|
||||
public static final List<DataBundleEntry> DEFAULT_MAP = Collections.emptyList();
|
||||
public static final List<DataBundleTypedValue> DEFAULT_LIST = Collections.emptyList();
|
||||
public static final List<String> DEFAULT_STRINGARRAY = Collections.emptyList();
|
||||
public static final List<Long> DEFAULT_LONGARRAY = Collections.emptyList();
|
||||
public static final Integer DEFAULT_ASSETINDEX = 0;
|
||||
public static final List<Float> DEFAULT_FLOATARRAY = Collections.emptyList();
|
||||
|
||||
@ProtoField(tag = 1, type = BYTES)
|
||||
public final ByteString byteArray;
|
||||
|
||||
@ProtoField(tag = 2, type = STRING)
|
||||
public final String stringVal;
|
||||
|
||||
@ProtoField(tag = 3, type = DOUBLE)
|
||||
public final Double doubleVal;
|
||||
|
||||
@ProtoField(tag = 4, type = FLOAT)
|
||||
public final Float floatVal;
|
||||
|
||||
@ProtoField(tag = 5, type = INT64)
|
||||
public final Long longVal;
|
||||
|
||||
@ProtoField(tag = 6, type = INT32)
|
||||
public final Integer intVal;
|
||||
|
||||
@ProtoField(tag = 7, type = INT32)
|
||||
public final Integer byteVal;
|
||||
|
||||
@ProtoField(tag = 8, type = BOOL)
|
||||
public final Boolean booleanVal;
|
||||
|
||||
@ProtoField(tag = 9, label = REPEATED, messageType = DataBundleEntry.class)
|
||||
public final List<DataBundleEntry> map;
|
||||
|
||||
@ProtoField(tag = 10, label = REPEATED, messageType = DataBundleTypedValue.class)
|
||||
public final List<DataBundleTypedValue> list;
|
||||
|
||||
@ProtoField(tag = 11, type = STRING, label = REPEATED)
|
||||
public final List<String> stringArray;
|
||||
|
||||
@ProtoField(tag = 12, type = INT64, label = REPEATED)
|
||||
public final List<Long> longArray;
|
||||
|
||||
@ProtoField(tag = 13, type = INT32)
|
||||
public final Integer assetIndex;
|
||||
|
||||
@ProtoField(tag = 14, type = FLOAT, label = REPEATED)
|
||||
public final List<Float> floatArray;
|
||||
|
||||
public DataBundleValue(ByteString byteArray, String stringVal, Double doubleVal, Float floatVal, Long longVal, Integer intVal, Integer byteVal, Boolean booleanVal, List<DataBundleEntry> map, List<DataBundleTypedValue> list, List<String> stringArray, List<Long> longArray, Integer assetIndex, List<Float> floatArray) {
|
||||
this.byteArray = byteArray;
|
||||
this.stringVal = stringVal;
|
||||
this.doubleVal = doubleVal;
|
||||
this.floatVal = floatVal;
|
||||
this.longVal = longVal;
|
||||
this.intVal = intVal;
|
||||
this.byteVal = byteVal;
|
||||
this.booleanVal = booleanVal;
|
||||
this.map = immutableCopyOf(map);
|
||||
this.list = immutableCopyOf(list);
|
||||
this.stringArray = immutableCopyOf(stringArray);
|
||||
this.longArray = immutableCopyOf(longArray);
|
||||
this.assetIndex = assetIndex;
|
||||
this.floatArray = immutableCopyOf(floatArray);
|
||||
}
|
||||
|
||||
private DataBundleValue(Builder builder) {
|
||||
this(builder.byteArray, builder.stringVal, builder.doubleVal, builder.floatVal, builder.longVal, builder.intVal, builder.byteVal, builder.booleanVal, builder.map, builder.list, builder.stringArray, builder.longArray, builder.assetIndex, builder.floatArray);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundleValue)) return false;
|
||||
DataBundleValue o = (DataBundleValue) other;
|
||||
return equals(byteArray, o.byteArray)
|
||||
&& equals(stringVal, o.stringVal)
|
||||
&& equals(doubleVal, o.doubleVal)
|
||||
&& equals(floatVal, o.floatVal)
|
||||
&& equals(longVal, o.longVal)
|
||||
&& equals(intVal, o.intVal)
|
||||
&& equals(byteVal, o.byteVal)
|
||||
&& equals(booleanVal, o.booleanVal)
|
||||
&& equals(map, o.map)
|
||||
&& equals(list, o.list)
|
||||
&& equals(stringArray, o.stringArray)
|
||||
&& equals(longArray, o.longArray)
|
||||
&& equals(assetIndex, o.assetIndex)
|
||||
&& equals(floatArray, o.floatArray);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = byteArray != null ? byteArray.hashCode() : 0;
|
||||
result = result * 37 + (stringVal != null ? stringVal.hashCode() : 0);
|
||||
result = result * 37 + (doubleVal != null ? doubleVal.hashCode() : 0);
|
||||
result = result * 37 + (floatVal != null ? floatVal.hashCode() : 0);
|
||||
result = result * 37 + (longVal != null ? longVal.hashCode() : 0);
|
||||
result = result * 37 + (intVal != null ? intVal.hashCode() : 0);
|
||||
result = result * 37 + (byteVal != null ? byteVal.hashCode() : 0);
|
||||
result = result * 37 + (booleanVal != null ? booleanVal.hashCode() : 0);
|
||||
result = result * 37 + (map != null ? map.hashCode() : 1);
|
||||
result = result * 37 + (list != null ? list.hashCode() : 1);
|
||||
result = result * 37 + (stringArray != null ? stringArray.hashCode() : 1);
|
||||
result = result * 37 + (longArray != null ? longArray.hashCode() : 1);
|
||||
result = result * 37 + (assetIndex != null ? assetIndex.hashCode() : 0);
|
||||
result = result * 37 + (floatArray != null ? floatArray.hashCode() : 1);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundleValue> {
|
||||
|
||||
public ByteString byteArray;
|
||||
public String stringVal;
|
||||
public Double doubleVal;
|
||||
public Float floatVal;
|
||||
public Long longVal;
|
||||
public Integer intVal;
|
||||
public Integer byteVal;
|
||||
public Boolean booleanVal;
|
||||
public List<DataBundleEntry> map;
|
||||
public List<DataBundleTypedValue> list;
|
||||
public List<String> stringArray;
|
||||
public List<Long> longArray;
|
||||
public Integer assetIndex;
|
||||
public List<Float> floatArray;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundleValue message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.byteArray = message.byteArray;
|
||||
this.stringVal = message.stringVal;
|
||||
this.doubleVal = message.doubleVal;
|
||||
this.floatVal = message.floatVal;
|
||||
this.longVal = message.longVal;
|
||||
this.intVal = message.intVal;
|
||||
this.byteVal = message.byteVal;
|
||||
this.booleanVal = message.booleanVal;
|
||||
this.map = copyOf(message.map);
|
||||
this.list = copyOf(message.list);
|
||||
this.stringArray = copyOf(message.stringArray);
|
||||
this.longArray = copyOf(message.longArray);
|
||||
this.assetIndex = message.assetIndex;
|
||||
this.floatArray = copyOf(message.floatArray);
|
||||
}
|
||||
|
||||
public Builder byteArray(ByteString byteArray) {
|
||||
this.byteArray = byteArray;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder stringVal(String stringVal) {
|
||||
this.stringVal = stringVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder doubleVal(Double doubleVal) {
|
||||
this.doubleVal = doubleVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder floatVal(Float floatVal) {
|
||||
this.floatVal = floatVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder longVal(Long longVal) {
|
||||
this.longVal = longVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder intVal(Integer intVal) {
|
||||
this.intVal = intVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder byteVal(Integer byteVal) {
|
||||
this.byteVal = byteVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder booleanVal(Boolean booleanVal) {
|
||||
this.booleanVal = booleanVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder map(List<DataBundleEntry> map) {
|
||||
this.map = checkForNulls(map);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder list(List<DataBundleTypedValue> list) {
|
||||
this.list = checkForNulls(list);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder stringArray(List<String> stringArray) {
|
||||
this.stringArray = checkForNulls(stringArray);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder longArray(List<Long> longArray) {
|
||||
this.longArray = checkForNulls(longArray);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder assetIndex(Integer assetIndex) {
|
||||
this.assetIndex = assetIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder floatArray(List<Float> floatArray) {
|
||||
this.floatArray = checkForNulls(floatArray);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundleValue build() {
|
||||
return new DataBundleValue(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
include ':wearable-lib'
|
||||
|
||||
include ':play-services-basement'
|
||||
|
||||
include ':play-services-tasks'
|
||||
@ -17,11 +15,16 @@ include ':play-services-api'
|
||||
|
||||
include ':firebase-dynamic-links-api'
|
||||
|
||||
include ':play-services-core-proto'
|
||||
//include ':play-services-nearby-core-proto'
|
||||
include ':play-services-wearable-proto'
|
||||
|
||||
include ':play-services-base-core'
|
||||
include ':play-services-location-core'
|
||||
include ':play-services-maps-core-mapbox'
|
||||
include ':play-services-maps-core-vtm:vtm-microg-theme'
|
||||
include ':play-services-maps-core-vtm'
|
||||
include ':play-services-maps-core-vtm:vtm-microg-theme'
|
||||
//include ':play-services-nearby-core'
|
||||
|
||||
include ':play-services-core:microg-ui-tools' // Legacy
|
||||
include ':play-services-core'
|
||||
|
Loading…
Reference in New Issue
Block a user