alexa-cookie2 4.0.2 → 4.0.3

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.
package/README.md CHANGED
@@ -49,6 +49,9 @@ Partly based on [Amazon Alexa Remote Control](http://blog.loetzimmer.de/2017/10/
49
49
  Thank you for that work.
50
50
 
51
51
  ## Changelog:
52
+ ### 4.0.3 (2022-07-06)
53
+ * (Apollon77) Update some request meta data to match current Alexa Apps
54
+
52
55
  ### 4.0.2 (2022-06-30)
53
56
  * (Apollon77) Prevent potential crash cases
54
57
 
package/alexa-cookie.js CHANGED
@@ -430,10 +430,10 @@ function AlexaCookie() {
430
430
  },
431
431
  'registration_data': {
432
432
  'domain': 'Device',
433
- 'app_version': '2.2.443692.0',
433
+ 'app_version': '2.2.483723.0',
434
434
  'device_type': 'A2IVLV5VM2W81',
435
435
  'device_name': '%FIRST_NAME%\u0027s%DUPE_STRATEGY_1ST%ioBroker Alexa2',
436
- 'os_version': '14.8',
436
+ 'os_version': '15.5',
437
437
  'device_serial': deviceSerial,
438
438
  'device_model': 'iPhone',
439
439
  'app_name': 'ioBroker Alexa2',
@@ -464,8 +464,7 @@ function AlexaCookie() {
464
464
  'client_domain' : 'DeviceLegacy'
465
465
  };
466
466
  }
467
- for (const key in cookies) {
468
- if (!cookies.hasOwnProperty(key)) continue;
467
+ for (const key of Object.keys(cookies)) {
469
468
  registerData.cookies.website_cookies.push({
470
469
  'Value': cookies[key],
471
470
  'Name': key
@@ -477,7 +476,7 @@ function AlexaCookie() {
477
476
  path: '/auth/register',
478
477
  method: 'POST',
479
478
  headers: {
480
- 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.443692.0/iOS/14.8/iPhone',
479
+ 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.483723.0/iOS/15.5/iPhone',
481
480
  'Accept-Language': _options.acceptLanguage,
482
481
  'Accept-Charset': 'utf-8',
483
482
  'Connection': 'keep-alive',
@@ -519,10 +518,10 @@ function AlexaCookie() {
519
518
 
520
519
  const options = {
521
520
  host: 'alexa.' + _options.baseAmazonPage,
522
- path: '/api/users/me?platform=ios&version=2.2.443692.0',
521
+ path: '/api/users/me?platform=ios&version=2.2.483723.0',
523
522
  method: 'GET',
524
523
  headers: {
525
- 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.443692.0/iOS/14.8/iPhone',
524
+ 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.483723.0/iOS/15.5/iPhone',
526
525
  'Accept-Language': _options.acceptLanguage,
527
526
  'Accept-Charset': 'utf-8',
528
527
  'Connection': 'keep-alive',
@@ -593,7 +592,7 @@ function AlexaCookie() {
593
592
 
594
593
  const exchangeParams = {
595
594
  'di.os.name': 'iOS',
596
- 'app_version': '2.2.443692.0',
595
+ 'app_version': '2.2.483723.0',
597
596
  'domain': '.' + amazonPage,
598
597
  'source_token': refreshToken,
599
598
  'requested_token_type': 'auth_cookies',
@@ -609,7 +608,7 @@ function AlexaCookie() {
609
608
  path: '/ap/exchangetoken',
610
609
  method: 'POST',
611
610
  headers: {
612
- 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.443692.0/iOS/14.8/iPhone',
611
+ 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.483723.0/iOS/15.5/iPhone',
613
612
  'Accept-Language': _options.acceptLanguage,
614
613
  'Accept-Charset': 'utf-8',
615
614
  'Connection': 'keep-alive',
@@ -658,8 +657,7 @@ function AlexaCookie() {
658
657
 
659
658
  });
660
659
  let localCookie = '';
661
- for (const name in cookies) {
662
- if (!cookies.hasOwnProperty(name)) continue;
660
+ for (const name of Object.keys(cookies)) {
663
661
  localCookie += name + '=' + cookies[name] + '; ';
664
662
  }
665
663
  localCookie = localCookie.replace(/[; ]*$/, '');
@@ -687,7 +685,7 @@ function AlexaCookie() {
687
685
 
688
686
  const refreshData = {
689
687
  'app_name': 'ioBroker Alexa2',
690
- 'app_version': '2.2.443692.0',
688
+ 'app_version': '2.2.483723.0',
691
689
  'di.sdk.version': '6.10.0',
692
690
  'source_token': _options.formerRegistrationData.refreshToken,
693
691
  'package_name': 'com.amazon.echo',
@@ -705,7 +703,7 @@ function AlexaCookie() {
705
703
  path: '/auth/token',
706
704
  method: 'POST',
707
705
  headers: {
708
- 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.443692.0/iOS/14.8/iPhone',
706
+ 'User-Agent': 'AmazonWebView/Amazon Alexa/2.2.483723.0/iOS/15.5/iPhone',
709
707
  'Accept-Language': _options.acceptLanguage,
710
708
  'Accept-Charset': 'utf-8',
711
709
  'Connection': 'keep-alive',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alexa-cookie2",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Generate Cookie and CSRF for Alexa Remote",
5
5
  "author": {
6
6
  "name": "Apollon77",