ua-parser / uap-scala

Scala port of ua-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some Motorola user agents are not recognized

euclides-filho opened this issue · comments

Hi guys I have a couple of examples where it is clear it is a motorola device from the raw string, but it is being parsed as Generic Smartphone/Generic

val ua = "Android/4.11.0-246 (25e0b9f59d05541f; 7.0; motorola; Moto G (4))"
val client = Parser.default.parse(ua)
println(client)
// Client(UserAgent(Other,None,None,None),OS(Android,Some(4),Some(11),Some(0),None),Device(Generic Smartphone,Some(Generic),Some(Smartphone)))

val ua = "Android/4.19.0-minApi21-20259 (aaf792d44e54edb8; 7.0; motorola; Moto G (5))"
val client = Parser.default.parse(ua)
println(client)
// Client(UserAgent(Other,None,None,None),OS(Android,Some(4),Some(19),Some(0),None),Device(Generic Smartphone,Some(Generic),Some(Smartphone)))

I also notice other less known brands with similar ua formats are parsed as generic too.

val ua = "Android/4.12.1-248 (2955c110f798431c; 6.0.1; Xiaomi; Redmi Note 3)"
val client = Parser.default.parse(ua)
println(client)
// Client(UserAgent(Other,None,None,None),OS(Android,Some(4),Some(12),Some(1),None),Device(Generic Smartphone,Some(Generic),Some(Smartphone)))

val ua = "Android/169 (a8d38cfb50ba68c3; Sony; E2363;  Arcos)"
val client = Parser.default.parse(ua)
println(client)
// Client(UserAgent(Other,None,None,None),OS(Android,Some(4),Some(19),Some(0),None),Device(Generic Smartphone,Some(Generic),Some(Smartphone)))

Thanks, but this should probably be addressed in uap-core, which is where uap-scala gets its data from.

Closing, as this seems very old and an answer was already provided.