@onekeyfe/react-native-jpush 6.7.0-alpha.435 → 6.7.0-alpha.444

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -200,114 +200,6 @@ public class ReactNativeJpushProtocolTest {
200
200
  assertTrue(propPayload.length > 2);
201
201
  }
202
202
 
203
- @Test
204
- public void testLiveJiguangCloudHandshakeWhenNetworkReachable() throws Exception {
205
- String sisJson = "";
206
- DatagramSocket udp = null;
207
- try {
208
- String reqJson = JCoreWireCodec.buildSisRequestJson(
209
- 1,
210
- DEMO_TEST_APP_KEY,
211
- 0L,
212
- "",
213
- Collections.<String>emptyList(),
214
- 1
215
- );
216
- byte[] reqPkt = JCoreWireCodec.encodeUdpSisPacket(reqJson, JCoreCrypto.nextPositiveSeed24());
217
- udp = new DatagramSocket();
218
- udp.setSoTimeout(2500);
219
- InetAddress addr = InetAddress.getByName("s.jpush.cn");
220
- udp.send(new DatagramPacket(reqPkt, reqPkt.length, addr, 19000));
221
- byte[] buf = new byte[4096];
222
- DatagramPacket respPkt = new DatagramPacket(buf, buf.length);
223
- udp.receive(respPkt);
224
- byte[] received = Arrays.copyOf(respPkt.getData(), respPkt.getLength());
225
- sisJson = JCoreWireCodec.decodeUdpSisPacket(received);
226
- } catch (Throwable networkUnavailable) {
227
- // Skip live cloud assertions when running in an offline or firewall-restricted CI container.
228
- return;
229
- } finally {
230
- if (udp != null) {
231
- udp.close();
232
- }
233
- }
234
-
235
- assertTrue(sisJson.contains("\"ips\""));
236
- Set<String> ips = JCoreWireCodec.extractJsonStringArray(sisJson, "ips");
237
- assertTrue(!ips.isEmpty());
238
-
239
- String firstIpPort = ips.iterator().next();
240
- int colon = firstIpPort.lastIndexOf(':');
241
- String host = firstIpPort.substring(0, colon);
242
- int port = Integer.parseInt(firstIpPort.substring(colon + 1));
243
-
244
- Socket tcp = new Socket();
245
- try {
246
- tcp.connect(new InetSocketAddress(host, port), 3000);
247
- tcp.setSoTimeout(5000);
248
- InputStream in = tcp.getInputStream();
249
- OutputStream out = tcp.getOutputStream();
250
-
251
- int seed = JCoreCrypto.nextRegisterSeed();
252
- JCoreWireCodec.setLastRegisterSeed(seed);
253
- byte[] regBody = JCoreWireCodec.buildRegisterPayload(
254
- DEMO_TEST_APP_KEY,
255
- "developer-default",
256
- DEMO_TEST_PACKAGE_NAME,
257
- "msgbench_auto_001"
258
- );
259
- byte[] regFrame = JCoreWireCodec.encodeFrame(
260
- JCoreWireCodec.CMD_REGISTER,
261
- JCoreWireCodec.VER_REGISTER,
262
- 101L,
263
- seed,
264
- 0L,
265
- regBody
266
- );
267
- out.write(regFrame);
268
- out.flush();
269
-
270
- JCoreWireCodec.DecodedFrame regRespFrame = JCoreWireCodec.readFrameFromStream(in, 0L);
271
- assertNotNull(regRespFrame);
272
- JCoreWireCodec.RegisterResponse regResp = JCoreWireCodec.parseRegisterResponse(regRespFrame);
273
- assertNotNull(regResp);
274
- assertEquals(0L, (long) regResp.statusCode);
275
- assertTrue(regResp.uid > 0L);
276
- assertTrue(regResp.registrationId != null && !regResp.registrationId.isEmpty());
277
-
278
- byte[] loginBody = JCoreWireCodec.buildLoginPayload(
279
- regResp.password,
280
- DEMO_TEST_APP_KEY,
281
- regResp.deviceId,
282
- "CN"
283
- );
284
- byte[] loginFrame = JCoreWireCodec.encodeFrame(
285
- JCoreWireCodec.CMD_LOGIN,
286
- JCoreWireCodec.VER_LOGIN,
287
- 102L,
288
- 0,
289
- regResp.uid,
290
- loginBody
291
- );
292
- out.write(loginFrame);
293
- out.flush();
294
-
295
- JCoreWireCodec.DecodedFrame loginRespFrame = JCoreWireCodec.readFrameFromStream(in, regResp.uid);
296
- assertNotNull(loginRespFrame);
297
- JCoreWireCodec.LoginResponse loginResp = JCoreWireCodec.parseLoginResponse(loginRespFrame);
298
- assertNotNull(loginResp);
299
- assertEquals(0L, (long) loginResp.statusCode);
300
- assertTrue(loginResp.sessionId != 0);
301
- } catch (Throwable tcpUnavailable) {
302
- // Ignore transient external network drop after UDP SIS succeeds.
303
- } finally {
304
- try {
305
- tcp.close();
306
- } catch (Throwable ignored) {
307
- }
308
- }
309
- }
310
-
311
203
  @Test
312
204
  public void testEmptyRegistrationBeforeHandshakeMultiRuntimeEventsAndManifestExportedFalse() throws Exception {
313
205
  // 1. Fresh state before TCP Register (cmd=0) must return "" for getRegistrationID (no fake 1a0018970a...)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-jpush",
3
- "version": "6.7.0-alpha.435",
3
+ "version": "6.7.0-alpha.444",
4
4
  "description": "Clean-room JPush and JCore React Native Nitro module for OneKey",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -24,6 +24,7 @@
24
24
  "react-native.config.js",
25
25
  "!ios/build",
26
26
  "!android/build",
27
+ "!android/fcm/build",
27
28
  "!android/gradle",
28
29
  "!android/gradlew",
29
30
  "!android/gradlew.bat",
@@ -93,7 +94,7 @@
93
94
  "typescript": "^5.9.2"
94
95
  },
95
96
  "peerDependencies": {
96
- "@onekeyfe/react-native-native-logger": "6.7.0-alpha.435",
97
+ "@onekeyfe/react-native-native-logger": "6.7.0-alpha.444",
97
98
  "react": "*",
98
99
  "react-native": "*",
99
100
  "react-native-nitro-modules": "0.37.0"