c.java
3.46 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
package com.instabug.library.c;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Environment;
import android.os.FileObserver;
import android.os.Handler;
import com.instabug.library.util.InstabugSDKLogger;
import java.io.File;
public class c
extends FileObserver
{
private static final File a = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
private static final File b;
private static final String c;
private final Handler d;
private Runnable e;
private a f;
private String g;
private String h;
static
{
File localFile = new File(a, "Screenshots");
b = localFile;
c = localFile.getAbsolutePath();
}
public c(a parama)
{
super(c);
InstabugSDKLogger.d(this, "PATH: " + c);
this.d = new Handler();
this.f = parama;
}
private boolean a(String paramString)
{
if (paramString.toLowerCase().contains("screenshot"))
{
paramString = new File(c + "/" + paramString);
long l = System.currentTimeMillis() - paramString.lastModified();
InstabugSDKLogger.d(this, "Difference time between file lastUpdate and currentTime: " + l);
if (l < 1000L)
{
InstabugSDKLogger.d(this, "Send event to listener.");
return true;
}
}
return false;
}
public void a()
{
if (Build.VERSION.SDK_INT >= 23)
{
startWatching();
return;
}
super.startWatching();
}
public void b()
{
if (Build.VERSION.SDK_INT >= 23)
{
stopWatching();
return;
}
super.stopWatching();
}
public void onEvent(int paramInt, String paramString)
{
InstabugSDKLogger.i(this, "Event:" + paramInt + "\t" + paramString);
if (paramString == null) {
InstabugSDKLogger.i(this, "Ignore this event.");
}
do
{
return;
if (paramInt == 32) {
this.g = paramString;
}
if ((paramInt == 2) && (this.g.equals(paramString))) {
this.h = paramString;
}
} while ((paramInt != 8) || (!this.h.equals(this.g)) || (!this.h.equals(paramString)) || (!a(paramString)));
this.f.a(Uri.fromFile(new File(c + "/" + paramString)));
}
public void startWatching()
{
this.e = new Runnable()
{
public final void run()
{
Object localObject = new File(c.c());
if (((File)localObject).listFiles() != null)
{
InstabugSDKLogger.d(this, "The path is directory: " + ((File)localObject).isDirectory());
if (((File)localObject).isDirectory())
{
localObject = ((File)localObject).listFiles();
int j = localObject.length;
int i = 0;
while (i < j)
{
File localFile = localObject[i];
InstabugSDKLogger.d(this, "File name: " + localFile.getName() + "File last modified: " + localFile.lastModified());
if (c.a(c.this, localFile.getName())) {
c.a(c.this).a(Uri.fromFile(localFile));
}
i += 1;
}
}
}
c.c(c.this).postDelayed(c.b(c.this), 1500L);
}
};
this.d.post(this.e);
}
public void stopWatching()
{
this.d.removeCallbacks(this.e);
}
public static abstract interface a
{
public abstract void a(Uri paramUri);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/c/c.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/