Skip to content

Commit

Permalink
Improves version detection for Lineage OS (#7629)
Browse files Browse the repository at this point in the history
* Improves version detection for Lineage OS
* Add more tests
  • Loading branch information
liviuconcioiu committed Mar 18, 2024
1 parent dbea31d commit b70d7d6
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 10 deletions.
42 changes: 41 additions & 1 deletion Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3428,7 +3428,7 @@
os:
name: Lineage OS
short_name: LEN
version: ""
version: "18"
platform: ""
family: Android
-
Expand Down Expand Up @@ -4427,3 +4427,43 @@
family: Android
headers:
http-x-requested-with: org.lineageos.jelly
-
user_agent: Mozilla/5.0 (Linux; Android 11; lineage_j5y17lte Build/RQ2A.210305.006) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.152 Mobile Safari/537.36
os:
name: Lineage OS
short_name: LEN
version: "18"
platform:
family: Android
-
user_agent: 'Mozilla/5.0 (Linux; Android 10; SM-A105F Build/Lineage_17.1-arm64_by_Eureka_Team; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.101 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/399.0.0.24.93;]'
os:
name: Lineage OS
short_name: LEN
version: "17.1"
platform:
family: Android
-
user_agent: Mozilla/5.0 (Linux; Android 9; lineage_serranoltexx) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36
os:
name: Lineage OS
short_name: LEN
version: "16"
platform:
family: Android
-
user_agent: Mozilla/5.0 (Linux; Android 7.1.2; lineage_FS504 Build/NJH47F; ru-ru) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36 Puffin/7.8.2.40664AP
os:
name: Lineage OS
short_name: LEN
version: "14.1"
platform:
family: Android
-
user_agent: Dalvik/2.1.0 (Linux; U; Android 7.1.1; lineage_A6020 Build/NMF26V)
os:
name: Lineage OS
short_name: LEN
version: "14.1"
platform:
family: Android
2 changes: 1 addition & 1 deletion Tests/fixtures/smartphone-24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7525,7 +7525,7 @@
user_agent: Mozilla/5.0 (Linux; Android 11; lineage_j5y17lte Build/RQ2A.210305.006) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/88.0.4324.152 Mobile Safari/537.36
os:
name: Lineage OS
version: ""
version: "18"
platform: ""
client:
type: browser
Expand Down
12 changes: 6 additions & 6 deletions Tests/fixtures/smartphone-29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8819,7 +8819,7 @@
user_agent: Mozilla/5.0 (Linux; Android 11; lineage_ss2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36 OPR/62.3.3146.57763
os:
name: Lineage OS
version: ""
version: "18"
platform: ""
client:
type: browser
Expand All @@ -8837,7 +8837,7 @@
user_agent: Mozilla/5.0 (Linux; Android 7.1.2; lineage_osprey) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36
os:
name: Lineage OS
version: ""
version: "14.1"
platform: ""
client:
type: browser
Expand All @@ -8855,7 +8855,7 @@
user_agent: Dalvik/2.1.0 (Linux; U; Android 7.1.1; lineage_A6020 Build/NMF26V)
os:
name: Lineage OS
version: ""
version: "14.1"
platform: ""
client:
type: browser
Expand All @@ -8873,7 +8873,7 @@
user_agent: Mozilla/5.0 (Linux; Android 9; lineage_c106) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.82 Mobile Safari/537.36
os:
name: Lineage OS
version: ""
version: "16"
platform: ""
client:
type: browser
Expand Down Expand Up @@ -8909,7 +8909,7 @@
user_agent: Mozilla/5.0 (Linux; Android 7.1.2; lineage_FS504 Build/NJH47F; ru-ru) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36 Puffin/7.8.2.40664AP
os:
name: Lineage OS
version: ""
version: "14.1"
platform: ""
client:
type: browser
Expand All @@ -8927,7 +8927,7 @@
user_agent: Mozilla/5.0 (Linux; Android 9; lineage_serranoltexx) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36
os:
name: Lineage OS
version: ""
version: "16"
platform: ""
client:
type: browser
Expand Down
28 changes: 26 additions & 2 deletions regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,33 @@
##########
# Lineage OS
##########
- regex: 'lineage_\w+'
- regex: 'Lineage_(\d+[\.\d]*)'
name: 'Lineage OS'
version: ''
version: '$1'

- regex: '(?:Android (\d([\d.])*);? )?lineage_\w+'
name: 'Lineage OS'
versions:
- regex: 'Android 14'
version: '21'
- regex: 'Android 13'
version: '20'
- regex: 'Android 12\.1'
version: '19.1'
- regex: 'Android 12'
version: '19'
- regex: 'Android 11'
version: '18'
- regex: 'Android 10'
version: '17'
- regex: 'Android 9'
version: '16'
- regex: 'Android 8\.1'
version: '15.1'
- regex: 'Android 7\.1'
version: '14.1'
- regex: 'Android 6'
version: '13'

#########
# Resurrection Remix OS (https://resurrectionremix.com/)
Expand Down

0 comments on commit b70d7d6

Please sign in to comment.