Kate Mobile v109.1版本的 MD5 值为:fcd76ded5f363ecbfac46035a4ed2a23

以下内容为反编译后的 Sender.java 源代码,内容仅作参考


package com.perm.errors;

import android.os.Build;
import android.util.Log;
import java.io.File;
import java.io.FilenameFilter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import org.json.JSONObject;
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) {
                    JSONObject jSONObject = new JSONObject(Utils.readFileToString(file));
                    Log.d("Sender", "Sending report " + file.getName());
                    URL url = new URL("http://errors.katemobile.ru/report.php");
                    byte[] bytes = ("exc=" + URLEncoder.encode(jSONObject.optString("exc"), "UTF-8") + "&info=" + URLEncoder.encode(jSONObject.optString("info"), "UTF-8") + "&fc=" + jSONObject.optInt("fc") + "&app_ver=" + URLEncoder.encode(jSONObject.optString("app_ver"), "UTF-8") + "&project_id=" + StaticVariables.PROJECT_ID + "&model=" + Build.MODEL + "&and_ver=" + Build.VERSION.RELEASE + "&name_0=" + URLEncoder.encode(jSONObject.optString("name_0"), "UTF-8") + "&message_0=" + URLEncoder.encode(jSONObject.optString("message_0"), "UTF-8") + "&stack_cut_0=" + URLEncoder.encode(jSONObject.optString("stack_cut_0"), "UTF-8")).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();
                    StringBuilder sb = new StringBuilder();
                    sb.append("Report sent ");
                    sb.append(file.getName());
                    Log.d("Sender", sb.toString());
                }
            }
        } catch (Throwable th) {
            th.printStackTrace();
        }
    }
}