360手机助手 v3.3.0版本的 MD5 值为:127c345ad16bbebee6e347381328afd0

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


package com.qihoo.appstore.share;

import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.qihoo.speedometer.Config;
import com.qihoo360.mobilesafe.util.ag;

public class u {
    private static final String e = u.class.getSimpleName();
    private static u g;

    public String f3328a;

    public String f3329b;
    public String c;
    public String d;
    private final String f = "auth";
    private SharedPreferences h;
    private com.qihoo.appstore.share.sinaweibo.j i;

    public u(Context context) {
        this.h = null;
        this.h = context.getSharedPreferences("auth", 0);
        d(context);
    }

    public static u a(Context context) {
        if (g == null) {
            synchronized (u.class) {
                if (g == null) {
                    g = new u(context);
                }
            }
        }
        return g;
    }

    private void d(Context context) {
        this.i = com.qihoo.appstore.share.sinaweibo.j.a(h.a(context), "http://www.360.cn/shoujizhushou/");
        String string = this.h.getString("access_token", Config.INVALID_IP);
        String string2 = this.h.getString("expires_in", Config.INVALID_IP);
        String string3 = this.h.getString("nickname", Config.INVALID_IP);
        String string4 = this.h.getString("weibo_uid", Config.INVALID_IP);
        if (!string.equals(Config.INVALID_IP)) {
            this.f3328a = com.qihoo.appstore.utils.q.b(context, string);
        }
        if (!string2.equals(Config.INVALID_IP)) {
            this.f3329b = com.qihoo.appstore.utils.q.b(context, string2);
        }
        if (!string4.equals(Config.INVALID_IP)) {
            this.d = com.qihoo.appstore.utils.q.b(context, string3);
        }
        if (!string3.equals(Config.INVALID_IP)) {
            this.c = com.qihoo.appstore.utils.q.b(context, string4);
        }
        if (TextUtils.isEmpty(this.f3328a) || TextUtils.isEmpty(this.f3329b)) {
            return;
        }
        this.i.d = new com.qihoo.appstore.share.sinaweibo.f(this.f3328a, this.f3329b);
    }

    public boolean a() {
        return b();
    }

    public void b(Context context) {
        this.f3328a = null;
        this.f3329b = null;
        this.d = null;
        this.c = null;
        SharedPreferences.Editor edit = this.h.edit();
        edit.putString("access_token", Config.INVALID_IP);
        edit.putString("expires_in", Config.INVALID_IP);
        edit.putString("nickname", Config.INVALID_IP);
        edit.putString("weibo_uid", Config.INVALID_IP);
        ag.a(edit);
        com.qihoo.appstore.share.sinaweibo.j.a(h.a(context), "http://www.360.cn/shoujizhushou/").d = null;
    }

    public boolean b() {
        return (this.i.d == null || !this.i.d.a() || TextUtils.isEmpty(this.f3328a)) ? false : true;
    }

    public void c(Context context) {
        SharedPreferences.Editor edit = this.h.edit();
        if (this.f3328a != null && !this.f3328a.equals(Config.INVALID_IP)) {
            edit.putString("access_token", com.qihoo.appstore.utils.q.a(context, this.f3328a));
        }
        if (this.f3329b != null && !this.f3329b.equals(Config.INVALID_IP)) {
            edit.putString("expires_in", com.qihoo.appstore.utils.q.a(context, this.f3329b));
        }
        if (this.d != null && !this.d.equals(Config.INVALID_IP)) {
            edit.putString("nickname", com.qihoo.appstore.utils.q.a(context, this.d));
        }
        if (this.c != null && !this.c.equals(Config.INVALID_IP)) {
            edit.putString("weibo_uid", com.qihoo.appstore.utils.q.a(context, this.c));
        }
        ag.a(edit);
    }
}