Kate Mobile v109.1版本的 MD5 值为:fcd76ded5f363ecbfac46035a4ed2a23
以下内容为反编译后的 Sender.java 源代码,内容仅作参考
package com.dynamixsoftware;
import android.util.Log;
import java.io.File;
import java.io.FilenameFilter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
abstract class Sender {
static final Object lock = new Object();
static final FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File file, String str) {
return str.endsWith(".report");
}
};
public static void send() {
synchronized (lock) {
sendInternal();
}
}
public static void sendInThread() {
new Thread() {
@Override
public void run() {
Sender.send();
}
}.start();
}
private static void sendInternal() {
try {
StaticVariables.FILES_PATH.mkdirs();
File[] listFiles = StaticVariables.FILES_PATH.listFiles(filter);
if (listFiles != null && listFiles.length != 0) {
for (File file : listFiles) {
String readFileToString = Utils.readFileToString(file);
Log.d("Sender", "Sending report " + file.getName());
URL url = new URL("http://ueh.dynamixsoftware.com/errors/report.ashx");
byte[] bytes = ("data=" + URLEncoder.encode(readFileToString, "UTF-8") + "&project_id=" + StaticVariables.PROJECT_ID).getBytes("UTF-8");
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setConnectTimeout(20000);
httpURLConnection.setReadTimeout(20000);
httpURLConnection.setDoOutput(true);
httpURLConnection.getOutputStream().write(bytes);
httpURLConnection.getResponseCode();
httpURLConnection.getInputStream().close();
httpURLConnection.disconnect();
file.delete();
Log.d("Sender", "Report sent " + file.getName());
}
}
} catch (Throwable th) {
th.printStackTrace();
}
}
}