ClientInfo.java
6.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package com.chudiangameplay.android.bean;
import android.app.Application;
import android.os.Build;
import android.text.TextUtils;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.chudiangameplay.android.MyApplication;
import com.chudiangameplay.android.constant.SPConstants;
import com.chudiangameplay.android.manager.UserManager;
import com.chudiangameplay.android.tool.SPUtil;
import com.chudiangameplay.android.ui.activity.MainActivity;
import com.chudiangameplay.android.util.DateUtil;
import com.chudiangameplay.android.util.DeviceUtil;
import com.chudiangameplay.android.util.LocationUtils;
import com.chudiangameplay.android.util.NetUtils;
import com.chudiangameplay.android.util.Util;
import com.umeng.commonsdk.utils.UMUtils;
import java.util.Map;
/**
* Created by Administrator on 2018/8/14.
* 客户端信息
*/
public class ClientInfo {
public String _appName; //khpw
public String _appUser; //913a7be89c43f8cb31f7a13b6d9da71e 用户token
public String _cityName; //武汉市
public String _device; //Simulator
public String _firstTime; //2018-07-31 09:51:27 第一次启动时间
public String _gpsType; //ip
public String _imei; //77777777777777777777777777777777
// public String _ipCity; //420100
public String _jail; //false 是否越狱
public String _latitude; //0
public String _launch; //14
public String _longitude; //0
public String _mac; //77777777777777777777777777777777
public String _manufacturer; //Apple 手机厂商
public String _network; //wifi
public String _pkgName; //kaihei 包名
public String _platform; //iphone //平台
public String _product; //开黑陪玩
public String _screenDip; //3
public String _screenHeight; //2436
public String _screenWidth; //1125
public String _system; //iOS
public String _systemVersion; //11.4
public String _userCity; //110000
public String _vendor; //appstore 渠道
public String _version; //7.4.0
public String _webviewVersion; //4.7
public ClientInfo() {
try {
_appName = "皮皮PiPi";
_device = DeviceUtil.getSystemModel();
_firstTime = DateUtil.getDateFromTimeLine(DeviceUtil.getInstallTime(MyApplication.context));
_mac = DeviceUtil.getMacAddress(MyApplication.context);
_pkgName = MyApplication.context.getPackageName();
_product = "皮皮PiPi";
_screenWidth = DeviceUtil.getScreenDispaly(MyApplication.context)[0] + "";
_screenHeight = DeviceUtil.getScreenDispaly(MyApplication.context)[1] + "";
_system = "Android";
_systemVersion = DeviceUtil.getSystemVersion();
_manufacturer = DeviceUtil.getDeviceBrand();
_vendor = Util.getAppMetaData(MyApplication.context, "UMENG_CHANNEL") + "";
if (!TextUtils.isEmpty(SPUtil.getStringValue(MyApplication.context, SPConstants.H5_ChannelCode, ""))) {
_vendor = SPUtil.getStringValue(MyApplication.context, SPConstants.H5_ChannelCode, "");
}
_version = Util.getVersionName(MyApplication.context);
_imei = DeviceUtil.getIMEI(MyApplication.context);
_jail = "false";
_network = NetUtils.getNetworkStateStr(MyApplication.context);
_launch = SPUtil.getIntValue(MyApplication.context, SPConstants.LaunchTIMES, 0) + "";
_screenDip = Util.getDensityDpi() + "";
//定位信息
if (MainActivity.locationInfo != null) {
_cityName = MainActivity.locationInfo._cityName;
_gpsType = "IP";
_latitude = MainActivity.locationInfo._latitude;
_longitude = MainActivity.locationInfo._longitude;
_userCity = MainActivity.locationInfo._userCity;
}
//用户
if (UserManager.getUserInfo(MyApplication.context) != null) {
_appUser = UMUtils.getUMId(MyApplication.context) + "#" + UserManager.getUserInfo(MyApplication.context).userId;
}else{
_appUser = UMUtils.getUMId(MyApplication.context) + "#" ;
}
//webview版本
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
_webviewVersion = Util.getWebviewVersion();
}
//自定义渠道编号
_platform = Util.getPlatform(_vendor);
} catch (Exception e) {
}
}
@Override
public String toString() {
return "ClientInfo{" +
"_appName='" + _appName + '\'' +
", _appUser='" + _appUser + '\'' +
", _cityName='" + _cityName + '\'' +
", _device='" + _device + '\'' +
", _firstTime='" + _firstTime + '\'' +
", _gpsType='" + _gpsType + '\'' +
", _imei='" + _imei + '\'' +
", _jail='" + _jail + '\'' +
", _latitude='" + _latitude + '\'' +
", _launch='" + _launch + '\'' +
", _longitude='" + _longitude + '\'' +
", _mac='" + _mac + '\'' +
", _manufacturer='" + _manufacturer + '\'' +
", _network='" + _network + '\'' +
", _pkgName='" + _pkgName + '\'' +
", _platform='" + _platform + '\'' +
", _product='" + _product + '\'' +
", _screenDip='" + _screenDip + '\'' +
", _screenHeight='" + _screenHeight + '\'' +
", _screenWidth='" + _screenWidth + '\'' +
", _system='" + _system + '\'' +
", _systemVersion='" + _systemVersion + '\'' +
", _userCity='" + _userCity + '\'' +
", _vendor='" + _vendor + '\'' +
", _version='" + _version + '\'' +
", _webviewVersion='" + _webviewVersion + '\'' +
'}';
}
}