| | | |
Offset 285, 74 lines modified | Offset 285, 67 lines modified |
285 | ····} | 285 | ····} |
286 | ···· | 286 | ···· |
287 | ····static·WifiAwareDataPathStateManager$AwareNetworkRequestInformation·processNetworkSpecifier(final·NetworkRequest·networkRequest,·final·WifiAwareNetworkSpecifier·wifiAwareNetworkSpecifier,·final·WifiAwareStateManager·wifiAwareStateManager,·final·WifiPermissionsUtil·wifiPermissionsUtil,·final·WifiPermissionsWrapper·wifiPermissionsWrapper,·final·boolean·b)·{ | 287 | ····static·WifiAwareDataPathStateManager$AwareNetworkRequestInformation·processNetworkSpecifier(final·NetworkRequest·networkRequest,·final·WifiAwareNetworkSpecifier·wifiAwareNetworkSpecifier,·final·WifiAwareStateManager·wifiAwareStateManager,·final·WifiPermissionsUtil·wifiPermissionsUtil,·final·WifiPermissionsWrapper·wifiPermissionsWrapper,·final·boolean·b)·{ |
288 | ········byte[]·peerDiscoveryMac·=·wifiAwareNetworkSpecifier.peerMac; | 288 | ········byte[]·peerDiscoveryMac·=·wifiAwareNetworkSpecifier.peerMac; |
289 | ········final·int·type·=·wifiAwareNetworkSpecifier.type; | 289 | ········final·int·type·=·wifiAwareNetworkSpecifier.type; |
290 | ········final·String·s·=·"processNetworkSpecifier:·networkSpecifier="; | 290 | ········final·String·s·=·"processNetworkSpecifier:·networkSpecifier="; |
291 | ········final·String·s2·=·"WifiAwareDataPathStMgr"; | 291 | ········final·String·s2·=·"WifiAwareDataPathStMgr"; |
292 | ········if·(type·<·0·||·type·>·3)·{ | 292 | ········if·(type·<·0·||·wifiAwareNetworkSpecifier.type·>·3)·{ |
293 | ············final·StringBuilder·sb·=·new·StringBuilder(); | 293 | ············final·StringBuilder·sb·=·new·StringBuilder(); |
294 | ············sb.append(s); | 294 | ············sb.append(s); |
295 | ············sb.append(wifiAwareNetworkSpecifier); | 295 | ············sb.append(wifiAwareNetworkSpecifier); |
296 | ············sb.append(",·invalid·'type'·value"); | 296 | ············sb.append(",·invalid·'type'·value"); |
297 | ············Log.e(s2,·sb.toString()); | 297 | ············Log.e(s2,·sb.toString()); |
298 | ············return·null; | 298 | ············return·null; |
299 | ········} | 299 | ········} |
300 | ········final·int·role·=·wifiAwareNetworkSpecifier.role; | 300 | ········final·int·role·=·wifiAwareNetworkSpecifier.role; |
301 | ········final·boolean·b2·=·true; | 301 | ········final·boolean·b2·=·true; |
302 | ········if·(role·&&·role·!=·(b2·?·1·:·0))·{ | 302 | ········if·(role·!=·0·&&·wifiAwareNetworkSpecifier.role·!=·(b2·?·1·:·0))·{ |
303 | ············final·StringBuilder·sb2·=·new·StringBuilder(); | 303 | ············final·StringBuilder·sb2·=·new·StringBuilder(); |
304 | ············sb2.append(s); | 304 | ············sb2.append(s); |
305 | ············sb2.append(wifiAwareNetworkSpecifier); | 305 | ············sb2.append(wifiAwareNetworkSpecifier); |
306 | ············sb2.append("·--·invalid·'role'·value"); | 306 | ············sb2.append("·--·invalid·'role'·value"); |
307 | ············Log.e(s2,·sb2.toString()); | 307 | ············Log.e(s2,·sb2.toString()); |
308 | ············return·null; | 308 | ············return·null; |
309 | ········} | 309 | ········} |
310 | ········final·int·role2·=·wifiAwareNetworkSpecifier.role; | 310 | ········final·int·role2·=·wifiAwareNetworkSpecifier.role; |
311 | ········final·int·n·=·2; | 311 | ········final·int·n·=·2; |
| 312 | ········if·(role2·==·0·&&·wifiAwareNetworkSpecifier.type·!=·0·&&·wifiAwareNetworkSpecifier.type·!=·n)·{ |
312 | ········if·(role2·==·0)·{ | |
313 | ············final·int·type2·=·wifiAwareNetworkSpecifier.type; | |
314 | ············if·(type2·!=·0·&&·type2·!=·n)·{ | |
315 | ················final·StringBuilder·sb3·=·new·StringBuilder(); | 313 | ············final·StringBuilder·sb3·=·new·StringBuilder(); |
316 | ················sb3.append(s); | 314 | ············sb3.append(s); |
317 | ················sb3.append(wifiAwareNetworkSpecifier); | 315 | ············sb3.append(wifiAwareNetworkSpecifier); |
318 | ················sb3.append("·--·invalid·'type'·value·for·INITIATOR·(only·IB·and·OOB·are·permitted)"); | 316 | ············sb3.append("·--·invalid·'type'·value·for·INITIATOR·(only·IB·and·OOB·are·permitted)"); |
319 | ················Log.e(s2,·sb3.toString()); | 317 | ············Log.e(s2,·sb3.toString()); |
320 | ················return·null; | 318 | ············return·null; |
321 | ············} | |
322 | ········} | 319 | ········} |
323 | ········final·WifiAwareClientState·client·=·wifiAwareStateManager.getClient(wifiAwareNetworkSpecifier.clientId); | 320 | ········final·WifiAwareClientState·client·=·wifiAwareStateManager.getClient(wifiAwareNetworkSpecifier.clientId); |
324 | ········if·(client·==·null)·{ | 321 | ········if·(client·==·null)·{ |
325 | ············final·StringBuilder·sb4·=·new·StringBuilder(); | 322 | ············final·StringBuilder·sb4·=·new·StringBuilder(); |
326 | ············sb4.append(s); | 323 | ············sb4.append(s); |
327 | ············sb4.append(wifiAwareNetworkSpecifier); | 324 | ············sb4.append(wifiAwareNetworkSpecifier); |
328 | ············sb4.append("·--·not·client·with·this·id·--·clientId="); | 325 | ············sb4.append("·--·not·client·with·this·id·--·clientId="); |
329 | ············sb4.append(wifiAwareNetworkSpecifier.clientId); | 326 | ············sb4.append(wifiAwareNetworkSpecifier.clientId); |
330 | ············Log.e(s2,·sb4.toString()); | 327 | ············Log.e(s2,·sb4.toString()); |
331 | ············return·null; | 328 | ············return·null; |
332 | ········} | 329 | ········} |
333 | ········final·int·uid·=·client.getUid(); | 330 | ········final·int·uid·=·client.getUid(); |
334 | ········final·String·callingPackage·=·client.getCallingPackage(); | 331 | ········final·String·callingPackage·=·client.getCallingPackage(); |
| 332 | ········if·(!b·&&·!wifiPermissionsUtil.isTargetSdkLessThan(client.getCallingPackage(),·28,·uid)·&&·wifiAwareNetworkSpecifier.type·!=·0·&&·wifiAwareNetworkSpecifier.type·!=·n)·{ |
335 | ········if·(!b·&&·!wifiPermissionsUtil.isTargetSdkLessThan(client.getCallingPackage(),·28,·uid))·{ | |
336 | ············final·int·type3·=·wifiAwareNetworkSpecifier.type; | |
337 | ············if·(type3·!=·0·&&·type3·!=·n)·{ | |
338 | ················final·StringBuilder·sb5·=·new·StringBuilder(); | 333 | ············final·StringBuilder·sb5·=·new·StringBuilder(); |
339 | ················sb5.append(s); | 334 | ············sb5.append(s); |
340 | ················sb5.append(wifiAwareNetworkSpecifier); | 335 | ············sb5.append(wifiAwareNetworkSpecifier); |
341 | ················sb5.append("·--·no·ANY·specifications·allowed·for·this·API·level"); | 336 | ············sb5.append("·--·no·ANY·specifications·allowed·for·this·API·level"); |
342 | ················Log.e(s2,·sb5.toString()); | 337 | ············Log.e(s2,·sb5.toString()); |
343 | ················return·null; | 338 | ············return·null; |
344 | ············} | |
345 | ········} | 339 | ········} |
346 | ········final·int·port·=·wifiAwareNetworkSpecifier.port; | 340 | ········if·(wifiAwareNetworkSpecifier.port·>=·0)·{ |
347 | ········if·(port·>=·0)·{ | |
348 | ············final·int·transportProtocol·=·wifiAwareNetworkSpecifier.transportProtocol; | 341 | ············final·int·transportProtocol·=·wifiAwareNetworkSpecifier.transportProtocol; |
349 | ············final·int·n2·=·-1; | 342 | ············final·int·n2·=·-1; |
350 | ············if·(transportProtocol·>=·n2)·{ | 343 | ············if·(transportProtocol·>=·n2)·{ |
351 | ················if·(port·!=·0·||·transportProtocol·!=·n2)·{ | 344 | ················if·(wifiAwareNetworkSpecifier.port·!=·0·||·wifiAwareNetworkSpecifier.transportProtocol·!=·n2)·{ |
352 | ····················if·(wifiAwareNetworkSpecifier.role·!=·(b2·?·1·:·0))·{ | 345 | ····················if·(wifiAwareNetworkSpecifier.role·!=·(b2·?·1·:·0))·{ |
353 | ························final·StringBuilder·sb6·=·new·StringBuilder(); | 346 | ························final·StringBuilder·sb6·=·new·StringBuilder(); |
354 | ························sb6.append(s); | 347 | ························sb6.append(s); |
355 | ························sb6.append(wifiAwareNetworkSpecifier); | 348 | ························sb6.append(wifiAwareNetworkSpecifier); |
356 | ························sb6.append("·--·port/transportProtocol·can·only·be·specified·on·responder"); | 349 | ························sb6.append("·--·port/transportProtocol·can·only·be·specified·on·responder"); |
357 | ························Log.e(s2,·sb6.toString()); | 350 | ························Log.e(s2,·sb6.toString()); |
358 | ························return·null; | 351 | ························return·null; |
Offset 362, 19 lines modified | Offset 355, 19 lines modified |
362 | ························sb7.append(s); | 355 | ························sb7.append(s); |
363 | ························sb7.append(wifiAwareNetworkSpecifier); | 356 | ························sb7.append(wifiAwareNetworkSpecifier); |
364 | ························sb7.append("·--·port/transportProtocol·can·only·be·specified·on·secure·ndp"); | 357 | ························sb7.append("·--·port/transportProtocol·can·only·be·specified·on·secure·ndp"); |
365 | ························Log.e(s2,·sb7.toString()); | 358 | ························Log.e(s2,·sb7.toString()); |
366 | ························return·null; | 359 | ························return·null; |
367 | ····················} | 360 | ····················} |
368 | ················} | 361 | ················} |
369 | ················final·int·type4·=·wifiAwareNetworkSpecifier.type; | 362 | ················final·int·type2·=·wifiAwareNetworkSpecifier.type; |
370 | ················int·pubSubId·=·0; | 363 | ················int·pubSubId·=·0; |
371 | ················int·mInstanceId·=·0; | 364 | ················int·mInstanceId·=·0; |
372 | ················Label_0922:·{ | 365 | ················Label_0964:·{ |
373 | ····················if·(type4·==·0·||·type4·==·(b2·?·1·:·0))·{ | 366 | ····················if·(type2·==·0·||·wifiAwareNetworkSpecifier.type·==·(b2·?·1·:·0))·{ |
374 | ························final·WifiAwareDiscoverySessionState·session·=·client.getSession(wifiAwareNetworkSpecifier.sessionId); | 367 | ························final·WifiAwareDiscoverySessionState·session·=·client.getSession(wifiAwareNetworkSpecifier.sessionId); |
375 | ························if·(session·==·null)·{ | 368 | ························if·(session·==·null)·{ |
376 | ····························final·StringBuilder·sb8·=·new·StringBuilder(); | 369 | ····························final·StringBuilder·sb8·=·new·StringBuilder(); |
377 | ····························sb8.append(s); | 370 | ····························sb8.append(s); |
378 | ····························sb8.append(wifiAwareNetworkSpecifier); | 371 | ····························sb8.append(wifiAwareNetworkSpecifier); |
379 | ····························sb8.append("·--·no·session·with·this·id·--·sessionId="); | 372 | ····························sb8.append("·--·no·session·with·this·id·--·sessionId="); |
380 | ····························sb8.append(wifiAwareNetworkSpecifier.sessionId); | 373 | ····························sb8.append(wifiAwareNetworkSpecifier.sessionId); |
Offset 401, 15 lines modified | Offset 394, 15 lines modified |
401 | ································Log.e(s2,·sb10.toString()); | 394 | ································Log.e(s2,·sb10.toString()); |
402 | ································return·null; | 395 | ································return·null; |
403 | ····························} | 396 | ····························} |
404 | ····························mInstanceId·=·peerInfo.mInstanceId; | 397 | ····························mInstanceId·=·peerInfo.mInstanceId; |
405 | ····························try·{ | 398 | ····························try·{ |
406 | ································peerDiscoveryMac·=·peerInfo.mMac; | 399 | ································peerDiscoveryMac·=·peerInfo.mMac; |
407 | ································if·(peerDiscoveryMac·!=·null·&&·peerDiscoveryMac.length·==·6)·{ | 400 | ································if·(peerDiscoveryMac·!=·null·&&·peerDiscoveryMac.length·==·6)·{ |
408 | ····································break·Label_0922; | 401 | ····································break·Label_0964; |
409 | ································} | 402 | ································} |
410 | ································try·{ | 403 | ································try·{ |
411 | ····································final·StringBuilder·sb12; | 404 | ····································final·StringBuilder·sb12; |
412 | ····································final·StringBuilder·sb11·=·sb12·=·new·StringBuilder(); | 405 | ····································final·StringBuilder·sb11·=·sb12·=·new·StringBuilder(); |
413 | ····································try·{ | 406 | ····································try·{ |
414 | ········································sb12.append(s); | 407 | ········································sb12.append(s); |
415 | ········································final·StringBuilder·sb13·=·sb11; | 408 | ········································final·StringBuilder·sb13·=·sb11; |
Offset 454, 16 lines modified | Offset 447, 15 lines modified |
454 | ····················sb16.append(s); | 447 | ····················sb16.append(s); |
455 | ····················sb16.append(wifiAwareNetworkSpecifier.toString()); | 448 | ····················sb16.append(wifiAwareNetworkSpecifier.toString()); |
456 | ····················sb16.append("·--·invalid·passphrase·length:·"); | 449 | ····················sb16.append("·--·invalid·passphrase·length:·"); |
457 | ····················sb16.append(wifiAwareNetworkSpecifier.passphrase.length()); | 450 | ····················sb16.append(wifiAwareNetworkSpecifier.passphrase.length()); |
458 | ····················Log.e(s2,·sb16.toString()); | 451 | ····················Log.e(s2,·sb16.toString()); |
459 | ····················return·null; | 452 | ····················return·null; |
460 | ················} | 453 | ················} |
| 454 | ················if·(wifiAwareNetworkSpecifier.pmk·!=·null·&&·!WifiAwareUtils.validatePmk(wifiAwareNetworkSpecifier.pmk))·{ |
461 | ················final·byte[]·pmk·=·wifiAwareNetworkSpecifier.pmk; | |
462 | ················if·(pmk·!=·null·&&·!WifiAwareUtils.validatePmk(pmk))·{ | |
463 | ····················final·StringBuilder·sb17·=·new·StringBuilder(); | 455 | ····················final·StringBuilder·sb17·=·new·StringBuilder(); |
464 | ····················sb17.append(s); | 456 | ····················sb17.append(s); |
465 | ····················sb17.append(wifiAwareNetworkSpecifier.toString()); | 457 | ····················sb17.append(wifiAwareNetworkSpecifier.toString()); |
466 | ····················sb17.append("·--·invalid·pmk·length:·"); | 458 | ····················sb17.append("·--·invalid·pmk·length:·"); |
467 | ····················sb17.append(wifiAwareNetworkSpecifier.pmk.length); | 459 | ····················sb17.append(wifiAwareNetworkSpecifier.pmk.length); |
468 | ····················Log.e(s2,·sb17.toString()); | 460 | ····················Log.e(s2,·sb17.toString()); |
469 | ····················return·null; | 461 | ····················return·null; |
Offset 485, 17 lines modified | Offset 477, 15 lines modified |
485 | ········sb18.append(wifiAwareNetworkSpecifier); | 477 | ········sb18.append(wifiAwareNetworkSpecifier); |
486 | ········sb18.append("·--·invalid·port/transportProtocol"); | 478 | ········sb18.append("·--·invalid·port/transportProtocol"); |
487 | ········Log.e(s2,·sb18.toString()); | 479 | ········Log.e(s2,·sb18.toString()); |
488 | ········return·null; | 480 | ········return·null; |
489 | ····} | 481 | ····} |
490 | ···· | 482 | ···· |
491 | ····WifiAwareDataPathStateManager$CanonicalConnectionInfo·getCanonicalDescriptor()·{ | 483 | ····WifiAwareDataPathStateManager$CanonicalConnectionInfo·getCanonicalDescriptor()·{ |
492 | ········final·byte[]·peerDiscoveryMac·=·this.peerDiscoveryMac; | |
493 | ········final·WifiAwareNetworkSpecifier·networkSpecifier·=·this.networkSpecifier; | |
494 | ········return·new·WifiAwareDataPathStateManager$CanonicalConnectionInfo(peerDiscoveryMac,·networkSpecifier.pmk,·networkSpecifier.sessionId,·networkSpecifier.passphrase); | 484 | ········return·new·WifiAwareDataPathStateManager$CanonicalConnectionInfo(this.peerDiscoveryMac,·this.networkSpecifier.pmk,·this.networkSpecifier.sessionId,·this.networkSpecifier.passphrase); |
495 | ····} | 485 | ····} |
496 | ···· | 486 | ···· |
497 | ····void·removeSupportForRequest(final·NetworkRequest·networkRequest)·{ | 487 | ····void·removeSupportForRequest(final·NetworkRequest·networkRequest)·{ |
498 | ········this.equivalentRequests.remove(networkRequest); | 488 | ········this.equivalentRequests.remove(networkRequest); |
499 | ····} | 489 | ····} |
500 | ···· | 490 | ···· |
501 | ····public·String·toString()·{ | 491 | ····public·String·toString()·{ |