RegisterDeviceRequest.java
2.86 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
package com.arellomobile.android.push.request;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.os.Build.VERSION;
import com.arellomobile.android.push.utils.GeneralUtils;
import java.util.Calendar;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
public class RegisterDeviceRequest
extends PushRequest
{
private String b;
public RegisterDeviceRequest(String paramString)
{
this.b = paramString;
}
private static String a(String paramString)
{
String str;
if ((paramString == null) || (paramString.length() == 0)) {
str = "";
}
char c;
do
{
return str;
c = paramString.charAt(0);
str = paramString;
} while (Character.isUpperCase(c));
return Character.toUpperCase(c) + paramString.substring(1);
}
protected void buildParams(Context paramContext, Map<String, Object> paramMap)
{
String str;
if (GeneralUtils.isTablet(paramContext))
{
str = "Tablet";
paramMap.put("device_name", str);
if (!GeneralUtils.isAmazonDevice()) {
break label206;
}
paramMap.put("device_type", "9");
label37:
paramMap.put("v", "2.2");
paramMap.put("language", Locale.getDefault().getLanguage());
paramMap.put("timezone", Integer.valueOf(Calendar.getInstance().getTimeZone().getRawOffset() / 1000));
str = paramContext.getPackageName();
paramMap.put("android_package", str);
paramMap.put("push_token", this.b);
paramMap.put("sounds", GeneralUtils.getRawResourses(paramContext));
if (paramContext.getPackageManager().getInstallerPackageName(str) != null) {
break label220;
}
paramMap.put("jailbroken", Integer.valueOf(1));
}
for (;;)
{
paramMap.put("device_model", getDeviceName());
paramMap.put("os_version", Build.VERSION.RELEASE);
try
{
paramMap.put("app_version", paramContext.getPackageManager().getPackageInfo(str, 0).versionName);
return;
}
catch (PackageManager.NameNotFoundException paramContext) {}
str = "Phone";
break;
label206:
paramMap.put("device_type", "3");
break label37;
label220:
paramMap.put("jailbroken", Integer.valueOf(0));
}
}
public String getDeviceName()
{
String str1 = Build.MANUFACTURER;
String str2 = Build.MODEL;
if (str2.startsWith(str1)) {
return a(str2);
}
return a(str1) + " " + str2;
}
public String getMethod()
{
return "registerDevice";
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/arellomobile/android/push/request/RegisterDeviceRequest.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/