小红书.apk(点击下载) / b.java


package rf2;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.text.TextUtils;
import com.alibaba.alibclinkpartner.linkpartner.constants.ALPParamConstant;
import com.alibaba.baichuan.trade.biz.applink.adapter.AppLinkConstants;
import com.google.android.gms.common.GoogleApiAvailabilityLight;
import com.igexin.push.core.d.c;
import com.tencent.connect.share.QQShare;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.Tencent;
import com.tencent.tauth.UiError;
import com.xingin.sharesdk.R$string;
import com.xingin.socialsdk.ShareEntity;
import com.xingin.utils.core.PermissionUtils;
import java.io.File;
import java.lang.ref.WeakReference;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import qf2.d;
import qf2.e;
import y7.f;

@Metadata(bv = {}, d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u00002\u00020\u0001:\u0002\u001e\u001fB\u0017\u0012\u0006\u0010\u0019\u001a\u00020\u0018\u0012\u0006\u0010\u001b\u001a\u00020\u001a¢\u0006\u0004\b\u001c\u0010\u001dJ\b\u0010\u0003\u001a\u00020\u0002H\u0016J\b\u0010\u0004\u001a\u00020\u0002H\u0016J \u0010\n\u001a\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0007\u001a\u00020\u00052\b\u0010\t\u001a\u0004\u0018\u00010\bJ\u0010\u0010\u000e\u001a\u00020\r2\u0006\u0010\f\u001a\u00020\u000bH\u0016J\u0010\u0010\u000f\u001a\u00020\u00022\u0006\u0010\f\u001a\u00020\u000bH\u0016J\u0010\u0010\u0010\u001a\u00020\u00022\u0006\u0010\f\u001a\u00020\u000bH\u0016J\u0010\u0010\u0011\u001a\u00020\u00022\u0006\u0010\f\u001a\u00020\u000bH\u0016J\u0012\u0010\u0013\u001a\u0004\u0018\u00010\u00122\u0006\u0010\f\u001a\u00020\u000bH\u0002J\u0010\u0010\u0014\u001a\u00020\u00022\u0006\u0010\f\u001a\u00020\u000bH\u0002J\u0010\u0010\u0017\u001a\u00020\u00022\u0006\u0010\u0016\u001a\u00020\u0015H\u0002¨\u0006 "}, d2 = {"Lrf2/b;", "Lrf2/f;", "", f.f156778k, "r", "", AppLinkConstants.REQUESTCODE, ALPParamConstant.RESULT_CODE, "Landroid/content/Intent;", "data", "t", "Lcom/xingin/socialsdk/ShareEntity;", "shareEntity", "", "g", GoogleApiAvailabilityLight.TRACKING_SOURCE_NOTIFICATION, "o", c.f25536c, "", "s", "v", "Landroid/os/Bundle;", "params", "u", "Landroid/app/Activity;", "activity", "Lqf2/d;", "callback", "<init>", "(Landroid/app/Activity;Lqf2/d;)V", "a", "b", "sharesdk_library_release"}, k = 1, mv = {1, 6, 0})
/* compiled from: QQSharePlatform.kt */
public final class b extends f {

    /* renamed from: f  reason: collision with root package name */
    public static final a f126058f = new a(null);

    /* renamed from: d  reason: collision with root package name */
    public final Tencent f126059d;

    /* renamed from: e  reason: collision with root package name */
    public final C1999b f126060e = new C1999b(this);

    @Metadata(bv = {}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\b†\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\t\u0010\nJ\b\u0010\u0003\u001a\u00020\u0002H\u0002R\u0014\u0010\u0005\u001a\u00020\u00048\u0002X‚T¢\u0006\u0006\n\u0004\b\u0005\u0010\u0006R\u0014\u0010\u0007\u001a\u00020\u00048\u0002X‚T¢\u0006\u0006\n\u0004\b\u0007\u0010\u0006R\u0014\u0010\b\u001a\u00020\u00048\u0002X‚T¢\u0006\u0006\n\u0004\b\b\u0010\u0006¨\u0006\u000b"}, d2 = {"Lrf2/b$a;", "", "", "b", "", "QQ_MINI_PROGRAM_TYPE_PREVIEW", "Ljava/lang/String;", "QQ_MINI_PROGRAM_TYPE_RELEASE", "TEMP_SHARE_IMAGE", "<init>", "()V", "sharesdk_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: QQSharePlatform.kt */
    public static final class a {
        public a() {
        }

        public /* synthetic */ a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final boolean b() {
            return com.xingin.utils.core.c.c(com.xingin.utils.core.c.k("com.tencent.mobileqq"), "8.0.8") >= 0;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0002\u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\f\u001a\u00020\u000b¢\u0006\u0004\b\r\u0010\u000eJ\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016J\b\u0010\u0006\u001a\u00020\u0004H\u0016J\u0010\u0010\b\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0007H\u0016J\u0012\u0010\n\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\tH\u0016¨\u0006\u000f"}, d2 = {"Lrf2/b$b;", "Lcom/tencent/tauth/IUiListener;", "", "p0", "", "onComplete", "onCancel", "", "onWarning", "Lcom/tencent/tauth/UiError;", "onError", "Lrf2/b;", "qqSharePlatform", "<init>", "(Lrf2/b;)V", "sharesdk_library_release"}, k = 1, mv = {1, 6, 0})
    /* renamed from: rf2.b$b  reason: collision with other inner class name */
    /* compiled from: QQSharePlatform.kt */
    public static final class C1999b implements IUiListener {

        /* renamed from: a  reason: collision with root package name */
        public final WeakReference<b> f126061a;

        public C1999b(b bVar) {
            Intrinsics.checkNotNullParameter(bVar, "qqSharePlatform");
            this.f126061a = new WeakReference<>(bVar);
        }

        @Override // com.tencent.tauth.IUiListener
        public void onCancel() {
            d e14;
            b bVar = this.f126061a.get();
            if (bVar != null && (e14 = bVar.e()) != null) {
                e14.onCancel();
            }
        }

        @Override // com.tencent.tauth.IUiListener
        public void onComplete(Object obj) {
            d e14;
            b bVar = this.f126061a.get();
            if (bVar != null && (e14 = bVar.e()) != null) {
                e14.onSuccess();
            }
        }

        @Override // com.tencent.tauth.IUiListener
        public void onError(UiError uiError) {
            d e14;
            b bVar = this.f126061a.get();
            if (bVar != null && (e14 = bVar.e()) != null) {
                e14.onFail(-3);
            }
        }

        @Override // com.tencent.tauth.IUiListener
        public void onWarning(int i10) {
        }
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public b(Activity activity, d dVar) {
        super(activity, dVar);
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(dVar, "callback");
        Tencent createInstance = Tencent.createInstance("100507190", activity.getApplication(), "com.xingin.xhs.provider");
        Intrinsics.checkNotNullExpressionValue(createInstance, "createInstance(SocialCon…onstants.SOCIAL_PROVIDER)");
        this.f126059d = createInstance;
    }

    @Override // rf2.f
    public void f() {
    }

    @Override // rf2.f
    public boolean g(ShareEntity shareEntity) {
        Intrinsics.checkNotNullParameter(shareEntity, "shareEntity");
        return Tencent.isSupportShareToQQ(d());
    }

    @Override // rf2.f
    public void n(ShareEntity shareEntity) {
        Intrinsics.checkNotNullParameter(shareEntity, "shareEntity");
        if (TextUtils.isEmpty(shareEntity.f())) {
            shareEntity.H(s(shareEntity));
        }
        if (!TextUtils.isEmpty(shareEntity.f())) {
            String f14 = shareEntity.f();
            Intrinsics.checkNotNull(f14);
            if (new File(f14).exists()) {
                Bundle bundle = new Bundle();
                bundle.putString("imageLocalUrl", shareEntity.f());
                bundle.putInt("req_type", 5);
                if (shareEntity.r() == 5) {
                    bundle.putInt("cflag", 1);
                } else {
                    bundle.putInt("cflag", 2);
                }
                u(bundle);
                return;
            }
        }
        e().onFail(-100);
    }

    @Override // rf2.f
    public void o(ShareEntity shareEntity) {
        Intrinsics.checkNotNullParameter(shareEntity, "shareEntity");
        if (shareEntity.r() != 6 || !f126058f.b()) {
            Bundle bundle = new Bundle();
            String f14 = TextUtils.isEmpty(shareEntity.g()) ? shareEntity.f() : shareEntity.g();
            if (TextUtils.isEmpty(f14)) {
                f14 = s(shareEntity);
            }
            if (f14 == null) {
                f14 = "";
            }
            if (TextUtils.isEmpty(f14) || (!sf2.a.c(f14) && !new File(f14).exists())) {
                e().onFail(-100);
                return;
            }
            bundle.putString("title", shareEntity.w());
            bundle.putString("targetUrl", shareEntity.j());
            bundle.putString("summary", shareEntity.c());
            bundle.putString("imageUrl", f14);
            bundle.putInt("req_type", 1);
            if (shareEntity.r() == 5) {
                bundle.putInt("cflag", 1);
            } else {
                bundle.putInt("cflag", 2);
            }
            u(bundle);
            return;
        }
        v(shareEntity);
    }

    @Override // rf2.f
    public void p(ShareEntity shareEntity) {
        Intrinsics.checkNotNullParameter(shareEntity, "shareEntity");
    }

    @Override // rf2.f
    public void r() {
        this.f126059d.releaseResource();
    }

    public final String s(ShareEntity shareEntity) {
        Bitmap bitmap;
        boolean z14;
        File file = new File(e.f121928a.c(d()), "share_image_tmp.png");
        if (shareEntity.b() > 0) {
            bitmap = BitmapFactory.decodeResource(d().getResources(), shareEntity.b());
            z14 = true;
        } else {
            z14 = false;
            bitmap = null;
        }
        if (bitmap != null) {
            h50.b.f84967a.c(d(), bitmap, "share_image_tmp.png");
            if (z14 && !bitmap.isRecycled()) {
                bitmap.recycle();
            }
            if (file.exists()) {
                return file.getAbsolutePath();
            }
        }
        return null;
    }

    public final void t(int i10, int i14, Intent intent) {
        if (i10 == 10103) {
            Tencent.onActivityResultData(i10, i14, intent, this.f126060e);
        }
    }

    public final void u(Bundle bundle) {
        q();
        this.f126059d.shareToQQ(d(), bundle, this.f126060e);
    }

    public final void v(ShareEntity shareEntity) {
        Bundle bundle = new Bundle();
        bundle.putString("title", d().getString(R$string.dxg));
        bundle.putString("summary", shareEntity.w());
        bundle.putString("targetUrl", shareEntity.j());
        bundle.putString("imageUrl", PermissionUtils.f(new String[]{"android.permission.READ_EXTERNAL_STORAGE"}) ? shareEntity.f() : shareEntity.g());
        bundle.putString(QQShare.SHARE_TO_QQ_MINI_PROGRAM_APPID, "1108221428");
        bundle.putString(QQShare.SHARE_TO_QQ_MINI_PROGRAM_PATH, shareEntity.k());
        bundle.putString(QQShare.SHARE_TO_QQ_MINI_PROGRAM_TYPE, y9.b.f156988a.c() ? "1" : "3");
        bundle.putInt("req_type", 7);
        u(bundle);
        h50.c.b("SharePlatform", "shareEntity.path =  " + shareEntity.k());
    }
}