Skip to content

Commit

Permalink
Merge pull request #318 from 24khxn/salesforce
Browse files Browse the repository at this point in the history
Added OS and UserAgent parser for Salesforce UA on Android
  • Loading branch information
commenthol authored Jun 4, 2018
2 parents 906604e + 98e276f commit 590f66f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ user_agent_parsers:
- regex: '(Tableau)/(\d+)\.(\d+)'
family_replacement: 'Tableau'

# Salesforce
- regex: '(Salesforce)(?:.)\/(\d+)\.(\d?)'

#StatusCake
- regex: '(\(StatusCake\))'
family_replacement: 'StatusCakeBot'
Expand Down Expand Up @@ -867,6 +870,10 @@ os_parsers:
- regex: '^(JUC).*; ?U; ?(?:Android)?(\d+)\.(\d+)(?:[\.\-]([a-z0-9]+))?'
os_replacement: 'Android'

# Salesforce
- regex: '(android)\s(?:mobile\/)(\d+)\.(\d+)\.?(\d+)?'
os_replacement: 'Android'

##########
# Kindle Android
##########
Expand Down
14 changes: 14 additions & 0 deletions tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2553,3 +2553,17 @@ test_cases:
patch:
patch_minor:

- user_agent_string: 'SalesforceMobileSDK/5.3.0 android mobile/8.0.0 (SM-G955F) Salesforce1/15.2 Native uid_c4589f605fad8c7e ftr_ Cordova/6.2.3'
family: 'Android'
major: '8'
minor: '0'
patch: '0'
patch_minor:

- user_agent_string: 'SalesforceMobileSDK/5.3.0 android mobile/7.0 (SM-G955U) Salesforce1/15.2 Native uid_4ec4068eddf27447 ftr_ Cordova/6.2.3'
family: 'Android'
major: '7'
minor: '0'
patch:
patch_minor:

6 changes: 6 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7619,3 +7619,9 @@ test_cases:
minor: '19'
patch: '0'

- user_agent_string: 'SalesforceMobileSDK/5.3.0 android mobile/7.1.1 (XT1635-02) Salesforce1/15.2 Native uid_bef1747905d064c6 ftr_ Cordova/6.2.3'
family: 'Salesforce'
major: '15'
minor: '2'
patch:

0 comments on commit 590f66f

Please sign in to comment.