导航菜单

页面标题

页面副标题

Crafto v9.3.3 - EasyPayConfigDownloader.java 源代码

正在查看: Crafto v9.3.3 应用的 EasyPayConfigDownloader.java JAVA 源代码文件

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


package easypay.appinvoke.utils;

import Si.b;
import android.content.Intent;
import android.content.SharedPreferences;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import easypay.appinvoke.manager.PaytmAssist;
import in.juspay.hypersdk.core.PaymentConstants;
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("com.paytm.com.paytm.pgsdk.easypay.appinvoke.NEW_PREFERENCE_FILE_KEY", 0);
        getSharedPreferences("newETAGPreference", 0);
        this.i = intent.getStringExtra("extra_bank_req");
        try {
            if (System.currentTimeMillis() - this.h.getLong("easypay_configuration_load_timestamp", 0L) > this.h.getLong("easypay_configuration_ttl", 0L)) {
                String configUrlToHit = PaytmAssist.getAssistInstance().getConfigUrlToHit();
                AssistLogs.printLog("EasyPay Config requestURL:" + configUrlToHit, this);
                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();
            AssistLogs.printLog("EXCEPTION", e);
        }
    }

    public final boolean f(String str) {
        try {
            URL url = new URL(str);
            AssistLogs.printLog("url:" + url.toString(), this);
            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("bnkCode"));
            jSONObject2.put("payMode", jSONObject.getString("payType"));
            if (jSONObject.getString("payType").equals("NB")) {
                jSONObject2.put("cardScheme", (Object) null);
            } else {
                jSONObject2.put("cardScheme", jSONObject.getString("cardScheme"));
            }
            jSONObject2.put(PaymentConstants.ORDER_ID_CAMEL, PaytmAssist.getAssistInstance().getOrderId());
            jSONObject2.put("mid", PaytmAssist.getAssistInstance().getMid());
            jSONObject2.put("deviceType", "ANDROID");
            AssistLogs.printLog("resquestBody:" + jSONObject2.toString(), this);
            String a = b.a(this, jSONObject.getString("bnkCode"), jSONObject.getString("payType"), jSONObject.getString("cardScheme"));
            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();
            AssistLogs.printLog("EasyPay Config requestbody:" + jSONObject2.toString(), this);
            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();
                    AssistLogs.printLog("unique Assist Config response" + sb.toString(), this);
                    b.b(this, sb.toString(), headerField);
                    Intent intent = new Intent();
                    intent.setAction("com.drc.paytm_example.EASYPAY_SINGLE_BANK_CONFIG_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);
    }
}