WebUtils.java
2.53 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
package com.bitstrips.imoji.util;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.os.Build;
import android.os.Build.VERSION;
import android.provider.Settings.Secure;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import retrofit.client.Header;
import retrofit.client.Response;
public class WebUtils
{
public static final String BITMOJI_TOKEN_HEADER = "bitmoji-token";
public static final String BITMOJI_USER_AGENT_HEADER = "Bitmoji-User-Agent";
public static final String MONOUSER_TOKEN_HEADER = "authorization";
public static final String MONOUSER_TOKEN_TYPE_PREFIX = "Bearer ";
public static final String SNAPCHAT_TOKEN_HEADER = "bitmoji-sc-token";
public static String getBitmojiUserAgent(Context paramContext)
{
String str3 = paramContext.getPackageName();
try
{
String str1 = paramContext.getPackageManager().getPackageInfo(paramContext.getPackageName(), 0).versionName;
String str4 = Build.VERSION.RELEASE;
String str5 = Build.MANUFACTURER + " " + Build.MODEL;
String str6 = Settings.Secure.getString(paramContext.getContentResolver(), "android_id");
paramContext = Float.toString(paramContext.getResources().getDisplayMetrics().density);
String str7 = Locale.getDefault().toString();
return "1|" + str3.replaceAll("\\|", "") + "|" + str1.replaceAll("\\|", "") + "|" + "Android".replaceAll("\\|", "") + "|" + str4.replaceAll("\\|", "") + "|" + str5.replaceAll("\\|", "") + "|" + str6.replaceAll("\\|", "") + "|" + paramContext.replaceAll("\\|", "") + "|" + str7.replaceAll("\\|", "");
}
catch (PackageManager.NameNotFoundException localNameNotFoundException)
{
for (;;)
{
String str2 = "";
}
}
}
public static String getETag(Response paramResponse)
{
paramResponse = paramResponse.getHeaders().iterator();
while (paramResponse.hasNext())
{
Header localHeader = (Header)paramResponse.next();
if ((!TextUtils.isEmpty(localHeader.getName())) && ("etag".equals(localHeader.getName().toLowerCase()))) {
return localHeader.getValue();
}
}
return null;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/util/WebUtils.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/