-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #494.
- Loading branch information
Showing
7 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
module Browser | ||
class Device | ||
class Samsung < Base | ||
REGEX = /\(Linux.*?; Android.*?; (SAMSUNG )?(SM-[A-Z0-9]+).*?\)/i.freeze | ||
|
||
def self.names | ||
@names ||= YAML.load_file(Browser.root.join("samsung.yml").to_s) | ||
end | ||
|
||
def id | ||
:samsung | ||
end | ||
|
||
def name | ||
"Samsung #{self.class.names[code] || code}" | ||
end | ||
|
||
def code | ||
matches && matches[2] | ||
end | ||
|
||
def matches | ||
@matches ||= ua.match(REGEX) | ||
end | ||
|
||
def match? | ||
!!matches | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# Source: https://en.wikipedia.org/wiki/Samsung_Galaxy | ||
SM-G900H: Galaxy S5 Exynos | ||
SM-A320FL: Galaxy A3 | ||
SM-G780F: Galaxy S20 Fan Edition | ||
SM-G781B: Galaxy S20 Fan Edition | ||
SM-F196B: Galaxy Z Fold2 5G | ||
SM-G928A: Galaxy S6 Edge+ | ||
SM-G928AZ: Galaxy S6 Edge+ | ||
SM-G928D: Galaxy S6 Edge+ | ||
SM-G928F: Galaxy S6 Edge+ | ||
SM-G928FD: Galaxy S6 Edge+ | ||
SM-G928I: Galaxy S6 Edge+ | ||
SM-G928K: Galaxy S6 Edge+ | ||
SM-G928L: Galaxy S6 Edge+ | ||
SM-G928P: Galaxy S6 Edge+ | ||
SM-G928PZ: Galaxy S6 Edge+ | ||
SM-G928R4: Galaxy S6 Edge+ | ||
SM-G928R7: Galaxy S6 Edge+ | ||
SM-G928S: Galaxy S6 Edge+ | ||
SM-G928T: Galaxy S6 Edge+ | ||
SM-G928T1: Galaxy S6 Edge+ | ||
SM-G928TR: Galaxy S6 Edge+ | ||
SM-G928V: Galaxy S6 Edge+ | ||
SM-G9280: Galaxy S6 Edge+ | ||
SM-G9288: Galaxy S6 Edge+ | ||
SM-G9289: Galaxy S6 Edge+ | ||
SM-A8000: Galaxy A8 | ||
SM-A800F: Galaxy A8 | ||
SM-A800I: Galaxy A8 | ||
SM-A800S: Galaxy A8 | ||
SM-A800Y: Galaxy A8 | ||
SM-N9200: Galaxy Note 5 | ||
SM-N920C: Galaxy Note 5 | ||
SM-N920T: Galaxy Note 5 | ||
SM-N920A: Galaxy Note 5 | ||
SM-N920I: Galaxy Note 5 | ||
SM-N9208: Galaxy Note 5 | ||
SM-G903FP: Galaxy S5 Neo | ||
SM-G903WP: Galaxy S5 Neo | ||
SM-G925A: Galaxy S6 Edge | ||
SM-G925AZ: Galaxy S6 Edge | ||
SM-G925F: Galaxy S6 Edge | ||
SM-G925I: Galaxy S6 Edge | ||
SM-G925K: Galaxy S6 Edge | ||
SM-G925L: Galaxy S6 Edge | ||
SM-G925P: Galaxy S6 Edge | ||
SM-G925PZ: Galaxy S6 Edge | ||
SM-G925R4: Galaxy S6 Edge | ||
SM-G925R7: Galaxy S6 Edge | ||
SM-G925S: Galaxy S6 Edge | ||
SM-G925T: Galaxy S6 Edge | ||
SM-G925T1: Galaxy S6 Edge | ||
SM-G925TR: Galaxy S6 Edge | ||
SM-G925V: Galaxy S6 Edge | ||
SM-G9250: Galaxy S6 Edge | ||
SM-G9258: Galaxy S6 Edge | ||
SM-G9259: Galaxy S6 Edge | ||
SM-G920A: Galaxy S6 | ||
SM-G920AZ: Galaxy S6 | ||
SM-G920D: Galaxy S6 | ||
SM-G920F: Galaxy S6 | ||
SM-G920FD: Galaxy S6 | ||
SM-G920I: Galaxy S6 | ||
SM-G920K: Galaxy S6 | ||
SM-G920L: Galaxy S6 | ||
SM-G920P: Galaxy S6 | ||
SM-G920PZ: Galaxy S6 | ||
SM-G920R4: Galaxy S6 | ||
SM-G920R7: Galaxy S6 | ||
SM-G920S: Galaxy S6 | ||
SM-G920T: Galaxy S6 | ||
SM-G920T1: Galaxy S6 | ||
SM-G920TR: Galaxy S6 | ||
SM-G920V: Galaxy S6 | ||
SM-G9200: Galaxy S6 | ||
SM-G9208: Galaxy S6 | ||
SM-G9209: Galaxy S6 | ||
SM-A700F: Galaxy A7 | ||
SM-A700FD: Galaxy A7 | ||
SM-A700FQ: Galaxy A7 | ||
SM-A700H: Galaxy A7 | ||
SM-A700K: Galaxy A7 | ||
SM-A700L: Galaxy A7 | ||
SM-A700M: Galaxy A7 | ||
SM-A700S: Galaxy A7 | ||
SM-A700X: Galaxy A7 | ||
SM-A700YD: Galaxy A7 | ||
SM-A700YZ: Galaxy A7 | ||
SM-A7000: Galaxy A7 | ||
SM-A7009: Galaxy A7 | ||
SM-A7009W: Galaxy A7 | ||
SM-G530BT: Galaxy Grand Prime | ||
SM-G530F: Galaxy Grand Prime | ||
SM-G530FQ: Galaxy Grand Prime | ||
SM-G530FZ: Galaxy Grand Prime | ||
SM-G530H: Galaxy Grand Prime | ||
SM-G530M: Galaxy Grand Prime | ||
SM-G530MU: Galaxy Grand Prime | ||
SM-G530P: Galaxy Grand Prime | ||
SM-G530R4: Galaxy Grand Prime | ||
SM-G530R7: Galaxy Grand Prime | ||
SM-G530T: Galaxy Grand Prime | ||
SM-G530W: Galaxy Grand Prime | ||
SM-G530Y: Galaxy Grand Prime | ||
SM-G5306W: Galaxy Grand Prime | ||
SM-G5308W: Galaxy Grand Prime | ||
SM-G5309W: Galaxy Grand Prime | ||
SM-J7109: Galaxy J7 | ||
SM-J710F: Galaxy J7 | ||
SM-J710FN: Galaxy J7 | ||
SM-J710H: Galaxy J7 | ||
SM-J710MN: Galaxy J7 | ||
SM-J710FQ: Galaxy J7 | ||
SM-J710K: Galaxy J7 | ||
SM-J710K: Galaxy J7 | ||
SM-J710GN: Galaxy J7 | ||
SM-J5109: Galaxy J5 | ||
SM-J510F: Galaxy J5 | ||
SM-J510FN: Galaxy J5 | ||
SM-J510H: Galaxy J5 | ||
SM-J510G: Galaxy J5 | ||
SM-J510MN: Galaxy J5 | ||
SM-J510Y: Galaxy J5 | ||
SM-J5108: Galaxy J5 | ||
SM-J510K: Galaxy J5 | ||
SM-J510L: Galaxy J5 | ||
SM-J510S: Galaxy J5 | ||
SM-J510UN: Galaxy J5 | ||
SM-G570F: Galaxy J2 Prime | ||
SM-G570M: Galaxy J2 Prime | ||
SM-G532F: Galaxy J2 Prime | ||
SM-G532M: Galaxy J2 Prime | ||
SM-G532G: Galaxy J2 Prime | ||
SM-G610F: Galaxy J7 Prime | ||
SM-G610M: Galaxy J7 Prime | ||
SM-G975F: Galaxy S10+ | ||
SM-G960F: Galaxy S9 | ||
SM-F700F: Galaxy Z Flip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters