browser_sniffer 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1f122e65998d2712691f2b2dfefd9cbbdb7e824ad1a5a39bab483b4274bbac3
4
- data.tar.gz: 002eb813a2e049806a5e409035aeb8f303c4dff4797e05461993d70e372f5c18
3
+ metadata.gz: beb896967f13a26304b23513f7e2a6e334854afc3187795a7d98698a4b8a2299
4
+ data.tar.gz: b3be5e1a5068b56d87685129404b8ed369644af58adbd815c6634a8500a23221
5
5
  SHA512:
6
- metadata.gz: 266ff5af2b669e477e088b0cf2caff845e7bacdbcc2abd7a6c4380921a9343e15604c2c4975260bf53cdccc0002de45b49563aef40e790c4fe46f1abc5e497b0
7
- data.tar.gz: 9c9620bb162e584acc189d3a6e208d67470a0d16aeefd5b331f9250e5dc1eb444fc1243fef615bf242cde1a5ba4d89c9a124a0984e56119baf4c05831c545225
6
+ metadata.gz: b0f851fc4026c1f35e905daf515f68cd4755261fe6c1424825170dcaefa207605bdd825b821f865cecad5bcc4d99394b783f6078c29eb37a41d96ee41ccaff07
7
+ data.tar.gz: bad8fe19eb686b1d4e698805a87790cf4e48f4b0654504c5f6d761d2b7cbc97a82746eacade1cbacd210b2459b3e3065f212315b5045bd4bcbe40be09418535f
@@ -59,6 +59,9 @@ class BrowserSniffer
59
59
  ], [:name, :version], [
60
60
  # Shopify POS for Android (Native App)
61
61
  %r{.*(\sPOS\s-).*\s([\d+\.]+)(\/\d*)*\s}i,
62
+ ], [[:name, 'Shopify POS'], :version], [
63
+ # Shopify POS for Android (Native App) New Format
64
+ %r{(Shopify POS)\/([\d\.]+)[^\/]*\/(Android)\/(\d+)}i,
62
65
  ], [[:name, 'Shopify POS'], :version], [
63
66
  # Shopify POS for Android (SmartWebView)
64
67
  %r{.*(Shopify\sPOS)\s.*Android.*\s([\d+\.]+)(\/\d*)*\s}i,
@@ -1,3 +1,3 @@
1
1
  class BrowserSniffer
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -554,6 +554,34 @@ describe "Shopify agents" do
554
554
  assert_equal sniffer.os_info, sniffer_with_suffix.os_info
555
555
  end
556
556
 
557
+ it "Shopify POS on Android can be sniffed (Native App) New Format" do
558
+ user_agent = "com.jadedpixel.pos Shopify POS/4.23.0/Android/12/google/Pixel 5/production MobileMiddlewareSupported"
559
+ sniffer = BrowserSniffer.new(user_agent)
560
+
561
+ user_agent_with_mal = "com.jadedpixel.pos Shopify POS/4.23.0-mal+30112/Android/12/google/Android SDK built for " \
562
+ "x86/development MobileMiddlewareSupported"
563
+ sniffer_with_suffix = BrowserSniffer.new(user_agent_with_mal)
564
+
565
+ assert_equal ({
566
+ name: 'Shopify POS',
567
+ version: '4.23.0',
568
+ }), sniffer.browser_info
569
+
570
+ assert_equal ({
571
+ type: :handheld,
572
+ }), sniffer.device_info
573
+
574
+ assert_equal ({
575
+ type: :android,
576
+ version: '12',
577
+ name: 'Android',
578
+ }), sniffer.os_info
579
+
580
+ assert_equal sniffer.browser_info, sniffer_with_suffix.browser_info
581
+ assert_equal sniffer.device_info, sniffer_with_suffix.device_info
582
+ assert_equal sniffer.os_info, sniffer_with_suffix.os_info
583
+ end
584
+
557
585
  it "Shopify Mobile in debug mode can be parsed" do
558
586
  user_agent = "Shopify Mobile/Android/6.0.0 (debug) (Build 1 with API 25 on Unknown Android SDK built for x86)"
559
587
  sniffer = BrowserSniffer.new(user_agent)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browser_sniffer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2021-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler