Skip to content

Commit 0df01a3

Browse files
committed
update
and added IosMultiAppAuth to proto
1 parent 409222a commit 0df01a3

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

play-services-wearable/core/src/main/java/org/microg/gms/wearable/CapabilityManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ public int addWithType(String capability, CapabilityType type) {
127127
byte[] data = existingData.getByteArray("data", 0, 0);
128128
CapabilityType existingType = CapabilityType.fromBytes(data);
129129

130-
if (existingType == CapabilityType.STATIC || type == CapabilityType.DYNAMIC) {
130+
if (existingType == type)
131+
return CommonStatusCodes.SUCCESS;
132+
133+
if (existingType == CapabilityType.STATIC)
131134
return WearableStatusCodes.DUPLICATE_CAPABILITY;
132-
}
133135
}
134136
} finally {
135137
existingData.close();

play-services-wearable/core/src/main/java/org/microg/gms/wearable/MessageHandler.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.microg.gms.wearable.WearableConnection.calculateDigest;
2020
import static org.microg.gms.wearable.WearableImpl.ROLE_CLIENT;
2121
import static org.microg.gms.wearable.WearableImpl.ROLE_SERVER;
22+
import static org.microg.gms.wearable.WearableImpl.TYPE_NETWORK;
2223
import static org.microg.gms.wearable.WearableServiceImpl.DATA_SYNC_PROGRESS_PATH;
2324

2425
import android.content.Context;
@@ -90,13 +91,15 @@ private static Connect buildConnect(Context ctx, WearableImpl wearable,
9091
Connect.Builder b = new Connect.Builder()
9192
.name(Build.MODEL) // TODO: Should be hostname, but seems to be irrelevant
9293
.id(wearable.getLocalNodeId())
93-
.networkId(config.nodeId)
9494
.peerAndroidId(androidId)
9595
.unknown4(3)
96-
.peerVersion(2)
96+
.peerVersion(ConnectHandshake.PEER_VERSION)
9797
.peerMinimumVersion(0)
9898
.androidSdkVersion(Build.VERSION.SDK_INT);
9999

100+
if (config.type == TYPE_NETWORK && config.address != null)
101+
b.networkId(config.address);
102+
100103
if (config.migrating && config.role == ROLE_SERVER) {
101104
String prevPeerNodeId = wearable.getClockworkNodePreferences().getPeerNodeId();
102105
b.migrating(true);

play-services-wearable/core/src/main/java/org/microg/gms/wearable/TransportConnectionHandler.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ public void handle(WearableConnection connection) {
8585

8686
config.peerNodeId = peerNodeId;
8787
config.connected = true;
88-
89-
if (config.nodeId == null || config.nodeId.isEmpty()) {
90-
config.nodeId = wearable.getLocalNodeId();
91-
}
88+
//
89+
// if (config.nodeId == null || config.nodeId.isEmpty()) {
90+
// config.nodeId = wearable.getLocalNodeId();
91+
// }
92+
config.nodeId = peerNodeId;
9293

9394
try {
9495
wearable.updateConfiguration(config);

play-services-wearable/core/src/main/java/org/microg/gms/wearable/WearableImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ public DataTransport getDataTransport(String peerNodeId) {
277277
}
278278

279279
public String getLocalNodeId() {
280-
ConnectionConfiguration[] cfgs = getConfigurations();
281-
if (cfgs != null) {
282-
for (ConnectionConfiguration c : cfgs) {
283-
if (c.nodeId != null && !c.nodeId.isEmpty()) return c.nodeId;
284-
}
285-
}
280+
// ConnectionConfiguration[] cfgs = getConfigurations();
281+
// if (cfgs != null) {
282+
// for (ConnectionConfiguration c : cfgs) {
283+
// if (c.nodeId != null && !c.nodeId.isEmpty()) return c.nodeId;
284+
// }
285+
// }
286286
return clockworkNodePreferences.getLocalNodeId();
287287
}
288288

0 commit comments

Comments
 (0)