APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:For S9
版本号:4.5
包名称:com.jb.gokeyboard.theme.emojiztfors9.getjar

MD5 校验值:27cf44ec6e0720408f5ef017a90a3331

反编译源代码说明

AdInfoController.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.jiubang.commerce.statistics.adinfo.http;

import android.content.Context;
import com.jb.ga0.commerce.util.LogUtils;
import com.jb.ga0.commerce.util.encrypt.Base64;
import com.jb.ga0.commerce.util.http.GoHttpHeadUtil;
import com.jiubang.commerce.mopub.dilute.MopubDiluteCfg;
import com.jiubang.commerce.statistics.adinfo.http.BaseHttpConnector;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;

public class AdInfoController extends BaseHttpConnector {
    public static final String AD_INFO_URL = "/api/v3/configurations";
    public static final String HOST = "http://conf.api.hk.goforandroid.com";
    private static AdInfoController sController;
    private Context mContext;

    public static AdInfoController getInstance(Context context) {
        if (sController == null) {
            synchronized (AdInfoController.class) {
                if (sController == null) {
                    sController = new AdInfoController(context.getApplicationContext(), HOST);
                }
            }
        }
        return sController;
    }

    private AdInfoController(Context context, String str) {
        super(context, str);
        this.mContext = context.getApplicationContext();
    }

    public void getAdInfo(BaseHttpConnector.ConnectListener connectListener) {
        String str;
        String str2 = AD_INFO_URL;
        HashMap<String, String> createParams = createParams();
        if (createParams != null) {
            if (AD_INFO_URL.lastIndexOf("?") != AD_INFO_URL.length() - 1) {
                str2 = AD_INFO_URL + "?";
            }
            Iterator<Map.Entry<String, String>> it = createParams.entrySet().iterator();
            while (true) {
                str = str2;
                if (!it.hasNext()) {
                    break;
                }
                Map.Entry<String, String> next = it.next();
                str2 = str + next.getKey() + "=" + next.getValue() + "&";
            }
        } else {
            str = AD_INFO_URL;
        }
        get(str, connectListener);
    }

    protected HashMap<String, String> createParams() {
        Context context = this.mContext;
        HashMap<String, String> hashMap = new HashMap<>();
        if (context != null) {
            hashMap.put("product_id", "1272");
            hashMap.put("config_name", "ad_title_sequence_" + GoHttpHeadUtil.getCountry(context).toLowerCase());
            JSONObject jSONObject = new JSONObject();
            try {
                jSONObject.put("lang", GoHttpHeadUtil.getLanguage(context).toLowerCase());
                jSONObject.put(MopubDiluteCfg.COUNTRY, GoHttpHeadUtil.getCountry(context));
                jSONObject.put("channel", 200);
                jSONObject.put("cversion_name", GoHttpHeadUtil.getVersionName(context));
                jSONObject.put("cversion_number", GoHttpHeadUtil.getVersionCode(context));
            } catch (JSONException e) {
                e.printStackTrace();
            }
            String jSONObject2 = jSONObject.toString();
            LogUtils.i("hzw", "client:" + jSONObject2);
            try {
                jSONObject2 = Base64.encodeString(jSONObject2, "UTF-8").replaceAll("\\n", "");
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            hashMap.put("client", jSONObject2);
        }
        return hashMap;
    }
}