-
Notifications
You must be signed in to change notification settings - Fork 263
/
Copy pathMainActivity.java
134 lines (128 loc) · 4.89 KB
/
MainActivity.java
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
package com.p020a.multicheck;
import android.os.Bundle;
import android.support.v7.app.C0326c;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.Toast;
import com.a.multicheck.R;
import dalvik.system.DexClassLoader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class MainActivity extends C0326c {
private String f1763l;
static {
System.loadLibrary("check");
}
private void m2541i() {
FileOutputStream fileOutputStream;
InputStream inputStream = null;
File file = new File(getFilesDir().getAbsolutePath());
if (!file.exists()) {
file.mkdirs();
}
File file2 = new File(file, "claz.dex");
try {
InputStream open = getAssets().open("claz.dex");
try {
fileOutputStream = new FileOutputStream(file2);
try {
byte[] bArr = new byte[1024];
while (true) {
int read = open.read(bArr);
if (read <= 0) {
break;
}
fileOutputStream.write(bArr, 0, read);
}
open.close();
fileOutputStream.close();
} catch (Exception e) {
inputStream = open;
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e2) {
e2.printStackTrace();
}
}
if (fileOutputStream != null) {
try {
fileOutputStream.close();
} catch (IOException e3) {
e3.printStackTrace();
}
}
this.f1763l = file2.getAbsolutePath();
}
} catch (Exception e4) {
fileOutputStream = null;
inputStream = open;
if (inputStream != null) {
inputStream.close();
}
if (fileOutputStream != null) {
fileOutputStream.close();
}
this.f1763l = file2.getAbsolutePath();
}
} catch (Exception e5) {
fileOutputStream = null;
if (inputStream != null) {
inputStream.close();
}
if (fileOutputStream != null) {
fileOutputStream.close();
}
this.f1763l = file2.getAbsolutePath();
}
this.f1763l = file2.getAbsolutePath();
}
protected void onCreate(Bundle bundle) {
ReflectiveOperationException e;
final EditText editText;
Method method = null;
super.onCreate(bundle);
setContentView((int) R.layout.activity_main);
m2541i();
String str = getFilesDir().getAbsolutePath() + File.separator + "out";
File file = new File(str);
if (!file.exists()) {
file.mkdirs();
}
DexClassLoader dexClassLoader = new DexClassLoader(this.f1763l, str, null, getClassLoader());
new File(this.f1763l).delete();
try {
method = dexClassLoader.loadClass("com.a.Check").getMethod("check", new Class[]{String.class});
} catch (ClassNotFoundException e2) {
e = e2;
e.printStackTrace();
editText = (EditText) findViewById(R.id.edit_text);
findViewById(R.id.button).setOnClickListener(new OnClickListener(this) {
final /* synthetic */ MainActivity f1762d;
public void onClick(View view) {
try {
if (((Boolean) method.invoke(null, new Object[]{editText.getText().toString()})).booleanValue()) {
Toast.makeText(this, "YES, you get it~", 0).show();
return;
}
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e2) {
}
Toast.makeText(this, "Sorry, you are wrong", 0).show();
}
});
} catch (NoSuchMethodException e3) {
e = e3;
e.printStackTrace();
editText = (EditText) findViewById(R.id.edit_text);
findViewById(R.id.button).setOnClickListener(/* anonymous class already generated */);
}
editText = (EditText) findViewById(R.id.edit_text);
findViewById(R.id.button).setOnClickListener(/* anonymous class already generated */);
}
}