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

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


package com.excelliance.kxqp.platforms.gameservice;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.util.Log;
import android.util.Xml;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.cd;
import java.io.StringReader;
import java.util.Hashtable;
import java.util.Map;
import org.xmlpull.v1.XmlPullParser;

public class b {

    private static b f12784a;

    private final String f12785b;
    private final boolean c;
    private h d;
    private Map<String, Float> e;
    private Map<String, Object> f;
    private boolean g;
    private boolean h;
    private boolean i;
    private boolean j;
    private boolean k;
    private String l;
    private Context m;

    private b() {
        this.f12785b = "PlatService GameDataManager";
        this.c = true;
        this.d = null;
        this.e = null;
        this.f = new Hashtable();
        this.g = false;
        this.h = false;
        this.i = false;
        this.j = false;
        this.k = false;
        this.l = null;
        this.m = null;
    }

    private b(Context context) {
        this.f12785b = "PlatService GameDataManager";
        this.c = true;
        this.d = null;
        this.e = null;
        this.f = new Hashtable();
        this.g = false;
        this.h = false;
        this.i = false;
        this.j = false;
        this.k = false;
        this.l = null;
        this.m = null;
        this.m = context;
        this.l = context.getSharedPreferences("userInfo", Build.VERSION.SDK_INT >= 11 ? 4 : 0).getString("uid", null);
        if (this.l == null) {
            b();
        }
    }

    public static synchronized b a() {
        b bVar;
        synchronized (b.class) {
            if (f12784a == null) {
                f12784a = new b();
            }
            bVar = f12784a;
        }
        return bVar;
    }

    public static synchronized b a(Context context) {
        b bVar;
        synchronized (b.class) {
            if (f12784a == null) {
                f12784a = new b(context);
            }
            bVar = f12784a;
        }
        return bVar;
    }

    public synchronized void b() {
        new Thread() {
            @Override
            public void run() {
                if (b.this.l != null) {
                    return;
                }
                GameUtil intance = GameUtil.getIntance();
                String o = GameUtil.o(b.this.m);
                StringBuilder sb = new StringBuilder((o == null || o.length() <= 0) ? com.excelliance.kxqp.i.e + "/genuser.php" : "http://plat." + o + "/genuser.php");
                sb.append("?chid=");
                sb.append(intance.h());
                sb.append("&subchid=");
                sb.append(intance.i());
                sb.append("&vercode=");
                sb.append(GameUtil.a(intance.getContext()));
                sb.append("&type=4");
                sb.append("&data=" + GameUtil.getIntance().f());
                String sb2 = sb.toString();
                Log.d("PlatService GameDataManager", "getuser URL:" + sb2);
                try {
                    String a2 = bd.a(sb2, 12000, 12000);
                    if (!cd.a(a2)) {
                        XmlPullParser newPullParser = Xml.newPullParser();
                        newPullParser.setInput(new StringReader(a2));
                        for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) {
                            if (eventType != 0 && eventType == 2) {
                                if (newPullParser.getName().equalsIgnoreCase("info")) {
                                    b.this.l = newPullParser.getAttributeValue(null, "uid");
                                    Log.d("PlatService GameDataManager", "uid=" + b.this.l);
                                }
                            }
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (b.this.l != null && b.this.l.length() > 0 && !b.this.l.equals("0")) {
                    SharedPreferences.Editor edit = b.this.m.getSharedPreferences("userInfo", Build.VERSION.SDK_INT >= 11 ? 4 : 0).edit();
                    edit.putString("uid", b.this.l);
                    edit.commit();
                    if (PlatService.c()) {
                        PlatService.a(PlatService.b().obtainMessage(24, true));
                        return;
                    }
                    return;
                }
                if (PlatService.c()) {
                    PlatService.a(PlatService.b().obtainMessage(24, false));
                }
            }
        }.start();
    }

    public String c() {
        return this.l;
    }

    public synchronized void a(final int i, final float f, final String str) {
        new Thread() {
            @Override
            public void run() {
                String str2;
                GameUtil intance = GameUtil.getIntance();
                String string = intance.getContext().getSharedPreferences("gameInfo", Build.VERSION.SDK_INT < 11 ? 0 : 4).getString("currentGameId", "20000");
                String o = GameUtil.o(b.this.m);
                if (o == null || o.length() <= 0) {
                    str2 = "http://pay.appota.cn/genorder.php";
                } else {
                    str2 = "http://pay." + o + "/genorder.php";
                }
                String str3 = str2 + "?uid=" + b.this.l + "&chid=" + intance.h() + "&subchid=" + intance.i() + "&amt=" + f + "&gid=" + string + "&coin=" + str;
                Log.d("PlatService GameDataManager", "getuser URL:" + str3);
                String a2 = bd.a(str3, 12000, 12000);
                try {
                    if (!cd.a(a2)) {
                        Log.d("PlatService GameDataManager", "result=" + a2);
                    }
                    PlatService.a(PlatService.b().obtainMessage(4, new f(a2 != null, i, a2)));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }

    public int d() {
        if (this.f.containsKey("gemCount")) {
            return ((Integer) this.f.get("gemCount")).intValue();
        }
        return 0;
    }

    public Map<String, Object> e() {
        return this.f;
    }
}