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

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


package com.qihoo.appstore.share;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.qihoo.appstore.utils.bk;
import com.qihoo.speedometer.Config;
import org.json.JSONException;
import org.json.JSONObject;

public class h extends a {

    private static final String f3269a = h.class.getSimpleName();

    private com.qihoo.appstore.share.sinaweibo.j f3270b;
    private com.qihoo.appstore.share.sinaweibo.g c;

    public h(Activity activity) {
        this.f3270b = com.qihoo.appstore.share.sinaweibo.j.a(a(activity), "http://www.360.cn/shoujizhushou/");
    }

    public int a(com.qihoo.appstore.share.sinaweibo.r rVar) {
        String str = rVar.f3323a;
        if (TextUtils.isEmpty(str)) {
            return 1001;
        }
        try {
            try {
                switch (new JSONObject(str).getInt("error_code")) {
                    case 20005:
                    case 40045:
                        return 1005;
                    case 20006:
                    case 40008:
                        return 1006;
                    case 20012:
                    case 20013:
                    case 40013:
                        return 1004;
                    case 20019:
                    case 40025:
                        return 1003;
                    case 21332:
                    case 40072:
                        return 1008;
                    case 40064:
                        return 1007;
                    case 40111:
                        return 1009;
                    default:
                        return 1001;
                }
            } catch (JSONException e) {
                bk.e(f3269a, "Exception getting \" error_code\" in " + str);
                return 1001;
            }
        } catch (JSONException e2) {
            bk.e(f3269a, "Exception converting to json object: " + str);
            return 1001;
        }
    }

    public static final String a(Context context) {
        return com.qihoo.appstore.utils.q.b(context, "ACEwWTLFyzBmALDqFpnhkQ==");
    }

    private boolean d() {
        return this.f3270b.d != null && this.f3270b.d.a();
    }

    public com.qihoo.appstore.share.b.a a(Context context, String str) {
        if (this.f3270b.d == null || TextUtils.isEmpty(this.f3270b.d.b())) {
            bk.e(f3269a, "access token is empty!");
            return null;
        }
        com.qihoo.appstore.share.sinaweibo.s sVar = new com.qihoo.appstore.share.sinaweibo.s();
        sVar.a("access_token", this.f3270b.d.b());
        sVar.a("source", a(context));
        sVar.a("status", str);
        try {
            return (com.qihoo.appstore.share.b.a) new com.qihoo.appstore.share.a.b().a(com.qihoo.appstore.share.sinaweibo.b.a("https://api.weibo.com/2/statuses/update.json", "POST", sVar, Config.INVALID_IP));
        } catch (JSONException e) {
            bk.e(f3269a, "upload error: json parsing " + e.getMessage());
            return null;
        }
    }

    @Override
    public void a(int i, int i2, Intent intent) {
        if (this.c != null) {
            this.c.a(i, i2, intent);
        }
    }

    @Override
    public void a(Activity activity, q qVar, boolean z) {
        this.f3270b.a(activity, new i(this, activity, qVar), z);
    }

    @Override
    public void a(Context context, String str, q qVar) {
        if (!d()) {
            qVar.a(3, 1001, null);
        }
        m.a().a(new n(3, new Object[]{3, str}, new j(this, context), qVar));
    }

    @Override
    public void a(Context context, String str, String str2, q qVar) {
        if (!d()) {
            qVar.a(4, 1001, null);
        }
        m.a().a(new n(4, new Object[]{4, str, str2}, new k(this, context), qVar));
    }

    public com.qihoo.appstore.share.b.a b(Context context, String str, String str2) {
        if (this.f3270b.d == null || TextUtils.isEmpty(this.f3270b.d.b())) {
            bk.e(f3269a, "access token is empty!");
            return null;
        }
        com.qihoo.appstore.share.sinaweibo.s sVar = new com.qihoo.appstore.share.sinaweibo.s();
        sVar.a("access_token", this.f3270b.d.b());
        sVar.a("source", a(context));
        sVar.a("pic", str2);
        sVar.a("status", str);
        try {
            return (com.qihoo.appstore.share.b.a) new com.qihoo.appstore.share.a.b().a(com.qihoo.appstore.share.sinaweibo.b.a("https://api.weibo.com/2/statuses/upload.json", "POST", sVar, sVar.b("pic")));
        } catch (JSONException e) {
            bk.e(f3269a, "upload error: json parsing " + e.getMessage());
            return null;
        }
    }

    public void b() {
        m.a().b();
    }

    @Override
    public void b(Context context, String str, String str2, q qVar) {
        if (!d()) {
            qVar.a(5, 1001, null);
        }
        m.a().a(new n(5, new Object[]{5, str, str2}, new l(this, context), qVar));
    }

    public com.qihoo.appstore.share.b.a c(Context context, String str, String str2) {
        if (this.f3270b.d == null || TextUtils.isEmpty(this.f3270b.d.b())) {
            bk.e(f3269a, "access token is empty!");
            return null;
        }
        com.qihoo.appstore.share.sinaweibo.s sVar = new com.qihoo.appstore.share.sinaweibo.s();
        sVar.a("access_token", this.f3270b.d.b());
        sVar.a("source", a(context));
        sVar.a("url", str2);
        sVar.a("status", str);
        try {
            return (com.qihoo.appstore.share.b.a) new com.qihoo.appstore.share.a.b().a(com.qihoo.appstore.share.sinaweibo.b.a("https://api.weibo.com/2/statuses/upload_url_text.json", "POST", sVar, Config.INVALID_IP));
        } catch (JSONException e) {
            bk.e(f3269a, "upload error: json parsing " + e.getMessage());
            return null;
        }
    }
}