...
|
...
|
@@ -198,17 +198,59 @@ public class ClickUnionRest { |
|
|
bo.setClient_type("android");
|
|
|
bo.setAppid("com.yoho");
|
|
|
String agent = request.getHeader("user-agent");
|
|
|
agent = "momochat/7.5.6 ios/664 (iphone 6s; ios 10.1.1; zh-hans_ae; iphone8,1; s1)";
|
|
|
agent = agent.toLowerCase();
|
|
|
log.info("addUnion4Stream user-agent={}", agent);
|
|
|
String url = "http://cdn.yoho.cn/app-downfiles/yohoBuy_YOHO_2953.apk";
|
|
|
try {
|
|
|
if (!StringUtils.isEmpty(agent)) {
|
|
|
if (agent.indexOf("mac os x") >= 0 || agent.indexOf("iphone") >= 0) {
|
|
|
String version = agent.substring(agent.indexOf(" os ") + 4, agent.indexOf(" like"));
|
|
|
bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
bo.setClient_type("ios");
|
|
|
bo.setAppid("490655927");
|
|
|
url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
if (agent.indexOf("mac os x") >= 0 || agent.indexOf("iphone") >= 0 ||agent.indexOf("ipad")>0) {
|
|
|
if(agent.contains("os")&&agent.contains("like")){
|
|
|
String version = agent.substring(agent.indexOf(" os ") + 4, agent.indexOf(" like"));
|
|
|
bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
bo.setClient_type("ios");
|
|
|
bo.setAppid("490655927");
|
|
|
url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
}
|
|
|
//youku;5.4;ios;10.2;iphone6,1 ---这种情况比较多
|
|
|
if(agent.contains("youku")){
|
|
|
int first = agent.indexOf("ios;")+4;
|
|
|
String version1 = agent.substring(first);
|
|
|
String version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
|
|
|
bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
bo.setClient_type("ios");
|
|
|
bo.setAppid("490655927");
|
|
|
url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
}
|
|
|
//momochat/7.5.6 ios/664 (iphone 6; ios 10.2; zh_cn; iphone7,2; s1)
|
|
|
if(agent.contains("momochat")){
|
|
|
int first = agent.indexOf(" ios ")+4;
|
|
|
String version1 = agent.substring(first);
|
|
|
String version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
|
|
|
bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
bo.setClient_type("ios");
|
|
|
bo.setAppid("490655927");
|
|
|
url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
}
|
|
|
//ios/6.6 com.jugg.doctor ipad5,3/8.3/768x1024/2.0 /1---这个应该就是ios_6.6
|
|
|
if(agent.contains("ios/")){
|
|
|
String version = agent.substring(agent.indexOf("ios/")+4,agent.indexOf(" "));
|
|
|
bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
bo.setClient_type("ios");
|
|
|
bo.setAppid("490655927");
|
|
|
url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
}
|
|
|
if (agent.contains("ios")){
|
|
|
//user-agent=momochat/7.5.6 ios/664 (iphone 6; ios 10.2; zh_cn; iphone7,2; s1)
|
|
|
int first = agent.indexOf(" ios ")+4;
|
|
|
String version1 = agent.substring(first);
|
|
|
String version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
|
|
|
bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
bo.setClient_type("ios");
|
|
|
bo.setAppid("490655927");
|
|
|
url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
int index = agent.lastIndexOf("android");
|
|
|
if (index > 0) {
|
...
|
...
|
|