BitmapTeleporter.java
6.5 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
package com.google.android.gms.common.data;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor.AutoCloseInputStream;
import android.os.Parcelable.Creator;
import android.util.Log;
import com.google.android.gms.common.internal.ReflectedParcelable;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.Buffer;
import java.nio.ByteBuffer;
public class BitmapTeleporter
extends com.google.android.gms.common.internal.safeparcel.zza
implements ReflectedParcelable
{
public static final Parcelable.Creator<BitmapTeleporter> CREATOR = new zza();
final int a;
ParcelFileDescriptor b;
final int c;
private Bitmap d;
private boolean e;
private File f;
BitmapTeleporter(int paramInt1, ParcelFileDescriptor paramParcelFileDescriptor, int paramInt2)
{
this.a = paramInt1;
this.b = paramParcelFileDescriptor;
this.c = paramInt2;
this.d = null;
this.e = false;
}
public BitmapTeleporter(Bitmap paramBitmap)
{
this.a = 1;
this.b = null;
this.c = 0;
this.d = paramBitmap;
this.e = true;
}
/* Error */
private java.io.FileOutputStream a()
{
// Byte code:
// 0: aload_0
// 1: getfield 50 com/google/android/gms/common/data/BitmapTeleporter:f Ljava/io/File;
// 4: ifnonnull +13 -> 17
// 7: new 52 java/lang/IllegalStateException
// 10: dup
// 11: ldc 54
// 13: invokespecial 57 java/lang/IllegalStateException:<init> (Ljava/lang/String;)V
// 16: athrow
// 17: ldc 59
// 19: ldc 61
// 21: aload_0
// 22: getfield 50 com/google/android/gms/common/data/BitmapTeleporter:f Ljava/io/File;
// 25: invokestatic 67 java/io/File:createTempFile (Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
// 28: astore_1
// 29: new 69 java/io/FileOutputStream
// 32: dup
// 33: aload_1
// 34: invokespecial 72 java/io/FileOutputStream:<init> (Ljava/io/File;)V
// 37: astore_2
// 38: aload_0
// 39: aload_1
// 40: ldc 73
// 42: invokestatic 79 android/os/ParcelFileDescriptor:open (Ljava/io/File;I)Landroid/os/ParcelFileDescriptor;
// 45: putfield 36 com/google/android/gms/common/data/BitmapTeleporter:b Landroid/os/ParcelFileDescriptor;
// 48: aload_1
// 49: invokevirtual 83 java/io/File:delete ()Z
// 52: pop
// 53: aload_2
// 54: areturn
// 55: astore_1
// 56: new 52 java/lang/IllegalStateException
// 59: dup
// 60: ldc 85
// 62: aload_1
// 63: invokespecial 88 java/lang/IllegalStateException:<init> (Ljava/lang/String;Ljava/lang/Throwable;)V
// 66: athrow
// 67: astore_1
// 68: new 52 java/lang/IllegalStateException
// 71: dup
// 72: ldc 90
// 74: invokespecial 57 java/lang/IllegalStateException:<init> (Ljava/lang/String;)V
// 77: athrow
// Local variable table:
// start length slot name signature
// 0 78 0 this BitmapTeleporter
// 28 21 1 localFile File
// 55 8 1 localIOException IOException
// 67 1 1 localFileNotFoundException java.io.FileNotFoundException
// 37 17 2 localFileOutputStream java.io.FileOutputStream
// Exception table:
// from to target type
// 17 29 55 java/io/IOException
// 29 48 67 java/io/FileNotFoundException
}
private static void a(Closeable paramCloseable)
{
try
{
paramCloseable.close();
return;
}
catch (IOException paramCloseable)
{
Log.w("BitmapTeleporter", "Could not close stream", paramCloseable);
}
}
public void release()
{
if (!this.e) {}
try
{
this.b.close();
return;
}
catch (IOException localIOException)
{
Log.w("BitmapTeleporter", "Could not close PFD", localIOException);
}
}
public void writeToParcel(Parcel paramParcel, int paramInt)
{
Bitmap localBitmap;
Object localObject;
byte[] arrayOfByte;
if (this.b == null)
{
localBitmap = this.d;
localObject = ByteBuffer.allocate(localBitmap.getRowBytes() * localBitmap.getHeight());
localBitmap.copyPixelsToBuffer((Buffer)localObject);
arrayOfByte = ((ByteBuffer)localObject).array();
localObject = new DataOutputStream(a());
}
try
{
((DataOutputStream)localObject).writeInt(arrayOfByte.length);
((DataOutputStream)localObject).writeInt(localBitmap.getWidth());
((DataOutputStream)localObject).writeInt(localBitmap.getHeight());
((DataOutputStream)localObject).writeUTF(localBitmap.getConfig().toString());
((DataOutputStream)localObject).write(arrayOfByte);
a((Closeable)localObject);
zza.a(this, paramParcel, paramInt | 0x1);
this.b = null;
return;
}
catch (IOException paramParcel)
{
throw new IllegalStateException("Could not write into unlinked file", paramParcel);
}
finally
{
a((Closeable)localObject);
}
}
public void zzd(File paramFile)
{
if (paramFile == null) {
throw new NullPointerException("Cannot set null temp directory");
}
this.f = paramFile;
}
public Bitmap zzxg()
{
Object localObject1;
if (!this.e) {
localObject1 = new DataInputStream(new ParcelFileDescriptor.AutoCloseInputStream(this.b));
}
try
{
byte[] arrayOfByte = new byte[((DataInputStream)localObject1).readInt()];
int i = ((DataInputStream)localObject1).readInt();
int j = ((DataInputStream)localObject1).readInt();
Object localObject2 = Bitmap.Config.valueOf(((DataInputStream)localObject1).readUTF());
((DataInputStream)localObject1).read(arrayOfByte);
a((Closeable)localObject1);
localObject1 = ByteBuffer.wrap(arrayOfByte);
localObject2 = Bitmap.createBitmap(i, j, (Bitmap.Config)localObject2);
((Bitmap)localObject2).copyPixelsFromBuffer((Buffer)localObject1);
this.d = ((Bitmap)localObject2);
this.e = true;
return this.d;
}
catch (IOException localIOException)
{
throw new IllegalStateException("Could not read from parcel file descriptor", localIOException);
}
finally
{
a((Closeable)localObject1);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/android/gms/common/data/BitmapTeleporter.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/