No description
This repository has been archived on 2026-06-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2020-08-31 19:11:07 +08:00
.idea 项目初始提交 2020-08-18 18:26:03 +08:00
src 修改设备跟操作系统正则和处理方法 2020-08-31 19:07:02 +08:00
.gitignore 项目初始提交 2020-08-18 18:26:03 +08:00
.gitmodules 项目初始提交 2020-08-18 18:26:03 +08:00
LICENSE 项目初始提交 2020-08-18 18:26:03 +08:00
pom.xml 提交nexus 配置 2020-08-27 09:37:41 +08:00
readme.md 修改readme.md 2020-08-31 19:11:07 +08:00
uap-java.iml 项目初始提交 2020-08-18 18:26:03 +08:00

galaxy ua parser Java Library

此项目根据开源项目地址(https://github.com/ua-parser)基础上改编。解析网络撒花姑娘常见的user-agent 。 这是ua-parser的Java实现。该实现使用共享的正则表达式模式并覆盖regexes.yaml。

environment:

    * JRE环境尽量使用JDK 1.8 或更高版本
    * maven 3.3.9 或更高版本

maven:

    <dependency>
        <groupId>com.zdjizhi</groupId>
        <artifactId>galaxy-ua-parser</artifactId>
        <version>1.0.0</version>
    </dependency>

Usage:



...

  String uaString = "Mozilla/5.0 (Linux; U; android 2.3.7; en-us; Nexus One Build/FRF91) " +
   "AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1";

  Parser uaParser = new Parser();
  UserAgent u = uaParser.parse(uaString);

  System.out.println(u.client.name); // => "Safari"
  System.out.println(u.client.type);  // => "Browser"
  System.out.println(u.client.engine);  // => "WebKit"
  System.out.println(u.client.engineVersion);  // => "533.1"

  System.out.println(c.os.name);        // => "Android"
  System.out.println(c.os.version);         // => "2"
  System.out.println(c.os.platform);         // => "HTC Nexus One"

  System.out.println(c.device.name);    // => "HTC Nexus One"
  System.out.println(c.device.brand);    // => "HTC"
  System.out.println(c.device.model);    // => "Nexus One"
  System.out.println(c.device.type);    // => "MOBILE"

version

版本信息查询说明.

repository:

目前工具类库未支持外网maven构建时请自行添加局域网仓库URL具体如下 nexus Team Nexus Repository http://192.168.10.125:8099/content/repositories/galaxy-ua-parser