|
@@ -198,17 +198,59 @@ public class ClickUnionRest { |
|
@@ -198,17 +198,59 @@ public class ClickUnionRest { |
198
|
bo.setClient_type("android");
|
198
|
bo.setClient_type("android");
|
199
|
bo.setAppid("com.yoho");
|
199
|
bo.setAppid("com.yoho");
|
200
|
String agent = request.getHeader("user-agent");
|
200
|
String agent = request.getHeader("user-agent");
|
|
|
201
|
+ agent = "momochat/7.5.6 ios/664 (iphone 6s; ios 10.1.1; zh-hans_ae; iphone8,1; s1)";
|
201
|
agent = agent.toLowerCase();
|
202
|
agent = agent.toLowerCase();
|
202
|
log.info("addUnion4Stream user-agent={}", agent);
|
203
|
log.info("addUnion4Stream user-agent={}", agent);
|
203
|
String url = "http://cdn.yoho.cn/app-downfiles/yohoBuy_YOHO_2953.apk";
|
204
|
String url = "http://cdn.yoho.cn/app-downfiles/yohoBuy_YOHO_2953.apk";
|
204
|
try {
|
205
|
try {
|
205
|
if (!StringUtils.isEmpty(agent)) {
|
206
|
if (!StringUtils.isEmpty(agent)) {
|
206
|
- if (agent.indexOf("mac os x") >= 0 || agent.indexOf("iphone") >= 0) {
|
|
|
207
|
- String version = agent.substring(agent.indexOf(" os ") + 4, agent.indexOf(" like"));
|
|
|
208
|
- bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
209
|
- bo.setClient_type("ios");
|
|
|
210
|
- bo.setAppid("490655927");
|
|
|
211
|
- url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
207
|
+ if (agent.indexOf("mac os x") >= 0 || agent.indexOf("iphone") >= 0 ||agent.indexOf("ipad")>0) {
|
|
|
208
|
+ if(agent.contains("os")&&agent.contains("like")){
|
|
|
209
|
+ String version = agent.substring(agent.indexOf(" os ") + 4, agent.indexOf(" like"));
|
|
|
210
|
+ bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
211
|
+ bo.setClient_type("ios");
|
|
|
212
|
+ bo.setAppid("490655927");
|
|
|
213
|
+ url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
214
|
+ }
|
|
|
215
|
+ //youku;5.4;ios;10.2;iphone6,1 ---这种情况比较多
|
|
|
216
|
+ if(agent.contains("youku")){
|
|
|
217
|
+ int first = agent.indexOf("ios;")+4;
|
|
|
218
|
+ String version1 = agent.substring(first);
|
|
|
219
|
+ String version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
|
|
|
220
|
+ bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
221
|
+ bo.setClient_type("ios");
|
|
|
222
|
+ bo.setAppid("490655927");
|
|
|
223
|
+ url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
224
|
+ }
|
|
|
225
|
+ //momochat/7.5.6 ios/664 (iphone 6; ios 10.2; zh_cn; iphone7,2; s1)
|
|
|
226
|
+ if(agent.contains("momochat")){
|
|
|
227
|
+ int first = agent.indexOf(" ios ")+4;
|
|
|
228
|
+ String version1 = agent.substring(first);
|
|
|
229
|
+ String version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
|
|
|
230
|
+ bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
231
|
+ bo.setClient_type("ios");
|
|
|
232
|
+ bo.setAppid("490655927");
|
|
|
233
|
+ url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
234
|
+ }
|
|
|
235
|
+ //ios/6.6 com.jugg.doctor ipad5,3/8.3/768x1024/2.0 /1---这个应该就是ios_6.6
|
|
|
236
|
+ if(agent.contains("ios/")){
|
|
|
237
|
+ String version = agent.substring(agent.indexOf("ios/")+4,agent.indexOf(" "));
|
|
|
238
|
+ bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
239
|
+ bo.setClient_type("ios");
|
|
|
240
|
+ bo.setAppid("490655927");
|
|
|
241
|
+ url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
242
|
+ }
|
|
|
243
|
+ if (agent.contains("ios")){
|
|
|
244
|
+ //user-agent=momochat/7.5.6 ios/664 (iphone 6; ios 10.2; zh_cn; iphone7,2; s1)
|
|
|
245
|
+ int first = agent.indexOf(" ios ")+4;
|
|
|
246
|
+ String version1 = agent.substring(first);
|
|
|
247
|
+ String version = version1.substring(version1.indexOf(" ")+1, version1.indexOf(";"));
|
|
|
248
|
+ bo.setTd("ios_" + version.replaceAll("_", "."));
|
|
|
249
|
+ bo.setClient_type("ios");
|
|
|
250
|
+ bo.setAppid("490655927");
|
|
|
251
|
+ url = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
|
|
|
252
|
+ }
|
|
|
253
|
+
|
212
|
} else {
|
254
|
} else {
|
213
|
int index = agent.lastIndexOf("android");
|
255
|
int index = agent.lastIndexOf("android");
|
214
|
if (index > 0) {
|
256
|
if (index > 0) {
|