导航菜单

页面标题

页面副标题

RummyCircle v11000.89 - EasyPayConfigDownloader.java 源代码

正在查看: RummyCircle v11000.89 应用的 EasyPayConfigDownloader.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package easypay.appinvoke.utils;

import android.content.Intent;
import android.content.SharedPreferences;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;
import com.google.android.play.core.appupdate.e;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import easypay.appinvoke.manager.Constants;
import easypay.appinvoke.manager.PaytmAssist;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import org.json.JSONObject;

public class EasyPayConfigDownloader extends JobIntentService {
    public static final int j = 0;
    public SharedPreferences h;
    public String i;

    public final void d(@NonNull Intent intent) {
        this.h = getSharedPreferences(Constants.EASYPAY_NEW_PREFERENCE_FILE, 0);
        getSharedPreferences(Constants.EASY_PAY_ETAG_PREF, 0);
        this.i = intent.getStringExtra(Constants.EXTRA_BANK_REQ_JSON);
        try {
            if (System.currentTimeMillis() - this.h.getLong("easypay_configuration_load_timestamp", 0L) > this.h.getLong("easypay_configuration_ttl", 0L)) {
                String configUrlToHit = PaytmAssist.getAssistInstance().getConfigUrlToHit();
                e.n(this, "EasyPay Config requestURL:" + configUrlToHit);
                if (TextUtils.isEmpty(configUrlToHit) || !f(configUrlToHit)) {
                    return;
                }
                SharedPreferences.Editor edit = this.h.edit();
                edit.putLong("easypay_configuration_load_timestamp", System.currentTimeMillis());
                edit.apply();
            }
        } catch (Exception e) {
            e.printStackTrace();
            e.n(e, "EXCEPTION");
        }
    }

    public final boolean f(String str) {
        try {
            URL url = new URL(str);
            e.n(this, "url:" + url.toString());
            HttpURLConnection httpURLConnection = (HttpURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(url.openConnection()));
            httpURLConnection.setReadTimeout(15000);
            httpURLConnection.setConnectTimeout(13000);
            httpURLConnection.setRequestMethod("POST");
            JSONObject jSONObject = new JSONObject(this.i);
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("bankName", jSONObject.getString(Constants.EXTRA_BANK_CODE));
            jSONObject2.put("payMode", jSONObject.getString(Constants.EXTRA_BANK_PAYTYPE));
            if (jSONObject.getString(Constants.EXTRA_BANK_PAYTYPE).equals(Constants.EASYPAY_PAYTYPE_NETBANKING)) {
                jSONObject2.put(Constants.EXTRA_BANK_SCHEME, (Object) null);
            } else {
                jSONObject2.put(Constants.EXTRA_BANK_SCHEME, jSONObject.getString(Constants.EXTRA_BANK_SCHEME));
            }
            jSONObject2.put(Constants.EXTRA_ORDER_ID, PaytmAssist.getAssistInstance().getOrderId());
            jSONObject2.put(Constants.EXTRA_MID, PaytmAssist.getAssistInstance().getMid());
            jSONObject2.put("deviceType", "ANDROID");
            e.n(this, "resquestBody:" + jSONObject2.toString());
            String a = b.a(this, jSONObject.getString(Constants.EXTRA_BANK_CODE), jSONObject.getString(Constants.EXTRA_BANK_PAYTYPE), jSONObject.getString(Constants.EXTRA_BANK_SCHEME));
            if (a == null) {
                a = "";
            }
            httpURLConnection.setRequestProperty("If-None-Match", a);
            httpURLConnection.setRequestProperty("Content-Type", "application/json");
            OutputStream outputStream = httpURLConnection.getOutputStream();
            outputStream.write(jSONObject2.toString().getBytes());
            outputStream.close();
            e.n(this, "EasyPay Config requestbody:" + jSONObject2.toString());
            String headerField = httpURLConnection.getHeaderField("ETag");
            InputStream inputStream = httpURLConnection.getInputStream();
            BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream, 5120);
            StringBuilder sb = new StringBuilder();
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
            while (true) {
                String readLine = bufferedReader.readLine();
                if (readLine == null) {
                    bufferedInputStream.close();
                    e.n(this, "unique Assist Config response" + sb.toString());
                    b.b(this, sb.toString(), headerField);
                    Intent intent = new Intent();
                    intent.setAction(Constants.EASYPAY_ACTION_FILE_DOWNLOADED);
                    sendBroadcast(intent);
                    return true;
                }
                sb.append(readLine);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    public final void onCreate() {
        super.onCreate();
    }

    public final void onStart(Intent intent, int i) {
        super/*android.app.Service*/.onStart(intent, i);
    }
}