Helper.java
6.69 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
package com.arellomobile.android.push.utils.notification;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.util.DisplayMetrics;
public class Helper
{
public static Bitmap getScaleBitmap(Bitmap paramBitmap, int paramInt, Context paramContext)
{
paramInt = (int)(paramInt * paramContext.getResources().getDisplayMetrics().density);
return Bitmap.createScaledBitmap(paramBitmap, paramBitmap.getWidth() * paramInt / paramBitmap.getHeight(), paramInt, true);
}
/* Error */
public static Bitmap tryToGetBitmapFromInternet(String paramString, Context paramContext, int paramInt)
{
// Byte code:
// 0: aload_0
// 1: ifnull +79 -> 80
// 4: new 50 java/net/URL
// 7: dup
// 8: aload_0
// 9: invokespecial 53 java/net/URL:<init> (Ljava/lang/String;)V
// 12: invokevirtual 57 java/net/URL:openConnection ()Ljava/net/URLConnection;
// 15: astore_0
// 16: aload_0
// 17: invokevirtual 62 java/net/URLConnection:connect ()V
// 20: aload_0
// 21: invokevirtual 66 java/net/URLConnection:getInputStream ()Ljava/io/InputStream;
// 24: astore_0
// 25: new 68 java/io/ByteArrayOutputStream
// 28: dup
// 29: invokespecial 69 java/io/ByteArrayOutputStream:<init> ()V
// 32: astore 5
// 34: sipush 1024
// 37: newarray <illegal type>
// 39: astore 6
// 41: aload_0
// 42: aload 6
// 44: invokevirtual 75 java/io/InputStream:read ([B)I
// 47: istore 4
// 49: iload 4
// 51: iconst_m1
// 52: if_icmpeq +30 -> 82
// 55: aload 5
// 57: aload 6
// 59: iconst_0
// 60: iload 4
// 62: invokevirtual 79 java/io/ByteArrayOutputStream:write ([BII)V
// 65: goto -24 -> 41
// 68: astore_1
// 69: aload_0
// 70: ifnull +7 -> 77
// 73: aload_0
// 74: invokevirtual 82 java/io/InputStream:close ()V
// 77: invokestatic 87 java/lang/System:gc ()V
// 80: aconst_null
// 81: areturn
// 82: aload_0
// 83: invokevirtual 82 java/io/InputStream:close ()V
// 86: aload 5
// 88: invokevirtual 88 java/io/ByteArrayOutputStream:close ()V
// 91: aload 5
// 93: invokevirtual 92 java/io/ByteArrayOutputStream:toByteArray ()[B
// 96: astore 5
// 98: new 94 android/graphics/BitmapFactory$Options
// 101: dup
// 102: invokespecial 95 android/graphics/BitmapFactory$Options:<init> ()V
// 105: astore 6
// 107: aload 6
// 109: iconst_1
// 110: putfield 99 android/graphics/BitmapFactory$Options:inJustDecodeBounds Z
// 113: aload 5
// 115: iconst_0
// 116: aload 5
// 118: arraylength
// 119: aload 6
// 121: invokestatic 105 android/graphics/BitmapFactory:decodeByteArray ([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
// 124: pop
// 125: aload 6
// 127: getfield 109 android/graphics/BitmapFactory$Options:outWidth I
// 130: aload 6
// 132: getfield 112 android/graphics/BitmapFactory$Options:outHeight I
// 135: invokestatic 118 java/lang/Math:max (II)I
// 138: istore 4
// 140: fconst_1
// 141: fstore_3
// 142: iconst_m1
// 143: iload_2
// 144: if_icmpeq +21 -> 165
// 147: iload 4
// 149: i2f
// 150: iload_2
// 151: i2f
// 152: aload_1
// 153: invokevirtual 17 android/content/Context:getResources ()Landroid/content/res/Resources;
// 156: invokevirtual 23 android/content/res/Resources:getDisplayMetrics ()Landroid/util/DisplayMetrics;
// 159: getfield 29 android/util/DisplayMetrics:density F
// 162: fmul
// 163: fdiv
// 164: fstore_3
// 165: aload 6
// 167: iconst_0
// 168: putfield 99 android/graphics/BitmapFactory$Options:inJustDecodeBounds Z
// 171: aload 6
// 173: fload_3
// 174: invokestatic 122 java/lang/Math:round (F)I
// 177: putfield 125 android/graphics/BitmapFactory$Options:inSampleSize I
// 180: aload 5
// 182: iconst_0
// 183: aload 5
// 185: arraylength
// 186: aload 6
// 188: invokestatic 105 android/graphics/BitmapFactory:decodeByteArray ([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
// 191: astore_1
// 192: aload_0
// 193: ifnull +7 -> 200
// 196: aload_0
// 197: invokevirtual 82 java/io/InputStream:close ()V
// 200: invokestatic 87 java/lang/System:gc ()V
// 203: aload_1
// 204: areturn
// 205: astore_1
// 206: aconst_null
// 207: astore_0
// 208: aload_0
// 209: ifnull +7 -> 216
// 212: aload_0
// 213: invokevirtual 82 java/io/InputStream:close ()V
// 216: invokestatic 87 java/lang/System:gc ()V
// 219: aload_1
// 220: athrow
// 221: astore_0
// 222: goto -22 -> 200
// 225: astore_0
// 226: goto -149 -> 77
// 229: astore_0
// 230: goto -14 -> 216
// 233: astore_1
// 234: goto -26 -> 208
// 237: astore_0
// 238: aconst_null
// 239: astore_0
// 240: goto -171 -> 69
// Local variable table:
// start length slot name signature
// 0 243 0 paramString String
// 0 243 1 paramContext Context
// 0 243 2 paramInt int
// 141 33 3 f float
// 47 101 4 i int
// 32 152 5 localObject1 Object
// 39 148 6 localObject2 Object
// Exception table:
// from to target type
// 25 41 68 java/lang/Throwable
// 41 49 68 java/lang/Throwable
// 55 65 68 java/lang/Throwable
// 82 140 68 java/lang/Throwable
// 147 165 68 java/lang/Throwable
// 165 192 68 java/lang/Throwable
// 4 25 205 finally
// 196 200 221 java/io/IOException
// 73 77 225 java/io/IOException
// 212 216 229 java/io/IOException
// 25 41 233 finally
// 41 49 233 finally
// 55 65 233 finally
// 82 140 233 finally
// 147 165 233 finally
// 165 192 233 finally
// 4 25 237 java/lang/Throwable
}
public static int tryToGetIconFormStringOrGetFromApplication(String paramString, Context paramContext)
{
int i = paramContext.getApplicationInfo().icon;
if (paramString != null)
{
int j = paramContext.getResources().getIdentifier(paramString, "drawable", paramContext.getPackageName());
if (j != 0) {
return j;
}
}
return i;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/arellomobile/android/push/utils/notification/Helper.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/