OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

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


package com.excelliance.kxqp.gs.ui.banner;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.excelliance.kxqp.bitmap.model.AppInfo;
import com.excelliance.kxqp.gs.discover.model.ResponseData;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.banner.d;
import com.excelliance.kxqp.gs.ui.banner.l;
import com.excelliance.kxqp.gs.util.au;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.cn;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class e implements d.a {

    private Context f8796a;

    private d.b f8797b;
    private final Handler c = new Handler(Looper.getMainLooper());
    private final com.excelliance.kxqp.gs.discover.bbs.c d;

    public e(Context context, d.b bVar) {
        this.f8796a = context;
        this.f8797b = bVar;
        this.d = new com.excelliance.kxqp.gs.discover.bbs.c(this.f8796a);
    }

    @Override
    public void initData() {
        tp.f(new Runnable() {
            @Override
            public void run() {
                JSONObject i = cn.i(e.this.f8796a);
                try {
                    i.put("userid", bx.a().a(e.this.f8796a));
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                final ResponseData a2 = e.this.d.a(i.toString(), "https://api.ourplay.com.cn/userinterest/gettag", new com.excelliance.kxqp.gs.discover.a.c<l>() {
                    @Override
                    public ResponseData<l> a(String str) {
                        Log.d("FeelingPresenter", "response:" + str);
                        return (ResponseData) new Gson().a(str, new TypeToken<ResponseData<l>>() {
                        }.getType());
                    }
                });
                Log.d("FeelingPresenter", "result:" + ((l) a2.data).f8830a);
                if (a2 == null || a2.code != 0) {
                    e.this.c.post(new Runnable() {
                        @Override
                        public void run() {
                            cg.a(e.this.f8796a, com.excelliance.kxqp.swipe.a.a.getString(e.this.f8796a, "server_wrong"));
                        }
                    });
                } else {
                    e.this.c.post(new Runnable() {
                        @Override
                        public void run() {
                            if (e.this.f8797b != null) {
                                e.this.f8797b.a((l) a2.data);
                            }
                        }
                    });
                }
            }
        });
    }

    @Override
    public void a(final k kVar, final List<l.a> list, final List<l.a> list2) {
        tp.f(new Runnable() {
            @Override
            public void run() {
                e.this.c.post(new Runnable() {
                    @Override
                    public void run() {
                        if (e.this.f8797b != null) {
                            e.this.f8797b.c();
                        }
                    }
                });
                JSONObject i = cn.i(e.this.f8796a);
                try {
                    i.put("userid", bx.a().a(e.this.f8796a));
                    i.put("birthday", kVar.f8828a);
                    i.put("sex", kVar.f8829b);
                    i.put("job", kVar.c);
                    i.put("otherjob", kVar.d);
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                final ResponseData a2 = e.this.d.a(e.this.a((List<l.a>) list2, e.this.a((List<l.a>) list, i, "gametag"), "apptag").toString(), "https://api.ourplay.com.cn/userinterest/add", new com.excelliance.kxqp.gs.discover.a.c<h>() {
                    @Override
                    public ResponseData<h> a(String str) {
                        az.d("FeelingPresenter", "response:" + str);
                        try {
                            return (ResponseData) new Gson().a(str, new TypeToken<ResponseData<h>>() {
                            }.getType());
                        } catch (Exception unused) {
                            return null;
                        }
                    }
                });
                if (a2 != null && a2.data != 0) {
                    h hVar = (h) a2.data;
                    List<AppInfo> list3 = hVar.f8821b;
                    if (list3 != null) {
                        au.b(e.this.f8796a, list3);
                        com.excelliance.kxqp.bitmap.ui.imp.j.a(e.this.f8796a);
                        hVar.d = com.excelliance.kxqp.bitmap.ui.imp.j.a(e.this.f8796a, list3).data;
                    }
                    List<AppInfo> list4 = hVar.f8820a;
                    if (list3 != null) {
                        au.b(e.this.f8796a, list4);
                        com.excelliance.kxqp.bitmap.ui.imp.j.a(e.this.f8796a);
                        hVar.c = com.excelliance.kxqp.bitmap.ui.imp.j.a(e.this.f8796a, list4).data;
                    }
                    com.excelliance.kxqp.gs.ui.novice.a aVar = new com.excelliance.kxqp.gs.ui.novice.a();
                    aVar.a(hVar.c);
                    aVar.a(hVar.d);
                }
                az.d("FeelingPresenter", "responseResult:" + a2);
                e.this.c.post(new Runnable() {
                    @Override
                    public void run() {
                        if (e.this.f8797b != null) {
                            e.this.f8797b.f();
                        }
                    }
                });
                if (a2 == null || a2.code != 0) {
                    e.this.c.post(new Runnable() {
                        @Override
                        public void run() {
                            cg.a(e.this.f8796a, com.excelliance.kxqp.swipe.a.a.getString(e.this.f8796a, "server_wrong"));
                        }
                    });
                } else {
                    e.this.c.post(new Runnable() {
                        @Override
                        public void run() {
                            if (e.this.f8797b != null) {
                                e.this.f8797b.a((h) a2.data);
                            }
                        }
                    });
                }
            }
        });
    }

    public JSONObject a(List<l.a> list, JSONObject jSONObject, String str) {
        if (list != null) {
            JSONArray jSONArray = new JSONArray();
            for (l.a aVar : list) {
                if (aVar.c) {
                    JSONObject jSONObject2 = new JSONObject();
                    try {
                        jSONObject2.put("id", aVar.f8832a);
                        jSONObject2.put("name", aVar.f8833b);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                    jSONArray.put(jSONObject2);
                }
            }
            try {
                jSONObject.put(str, jSONArray);
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
        }
        return jSONObject;
    }

    @Override
    public void a() {
        this.f8796a = null;
        this.f8797b = null;
    }
}