酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319

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


package com.kugou.android.app.home.channel;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.NotificationCompat;
import android.text.TextUtils;
import com.kugou.android.app.KGApplication;
import com.kugou.android.app.flexowebview.KGFelxoWebFragment;
import com.kugou.android.app.home.channel.entity.CommonResponse;
import com.kugou.android.app.home.channel.entity.Privilege;
import com.kugou.android.app.home.channel.event.UserApplyPublishEvent;
import com.kugou.android.app.home.channel.protocol.ApplySendPostPermissionProtocol;
import com.kugou.android.app.home.channel.protocol.CheckOperateProtocol;
import com.kugou.common.utils.bv;
import com.kugou.framework.database.channel.entity.ChannelEntity;
import com.sina.weibo.sdk.statistic.LogBuilder;
import com.sina.weibo.sdk.web.WebPicUploadResult;
import de.greenrobot.event.EventBus;
import kotlin.Metadata;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\u0018\u0000 \u001e2\u00020\u0001:\u0002\u001d\u001eB\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005¢\u0006\u0002\u0010\u0006J\u0006\u0010\u000b\u001a\u00020\fJ\u000e\u0010\r\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\u000fJ\u000e\u0010\u0010\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\u000fJ\u0010\u0010\u0011\u001a\u00020\f2\u0006\u0010\u0012\u001a\u00020\u000fH\u0002J\u000e\u0010\u0013\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\u000fJ\"\u0010\u0014\u001a\u00020\f2\u0006\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0017\u001a\u00020\u00182\n\b\u0002\u0010\u0019\u001a\u0004\u0018\u00010\u001aJ*\u0010\u0014\u001a\u00020\f2\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0017\u001a\u00020\u00182\n\b\u0002\u0010\u0019\u001a\u0004\u0018\u00010\u001aR\u0013\u0010\u0004\u001a\u0004\u0018\u00010\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\n¨\u0006\u001f"}, d2 = {"Lcom/kugou/android/app/home/channel/ChannelContributionPermissionManager;", "", "context", "Landroid/content/Context;", LogBuilder.KEY_CHANNEL, "Lcom/kugou/framework/database/channel/entity/ChannelEntity;", "(Landroid/content/Context;Lcom/kugou/framework/database/channel/entity/ChannelEntity;)V", "getChannel", "()Lcom/kugou/framework/database/channel/entity/ChannelEntity;", "getContext", "()Landroid/content/Context;", "requestPublishPermission", "", "showApplyPublishDialog", "privilege", "Lcom/kugou/android/app/home/channel/entity/Privilege;", "showMuteHintDialog", "showNoVideoPrivilegeDialog", "data", "showRemovedHintDialog", "startMeAfterHasPublishPermission", "showDialog", "", "runnable", "Ljava/lang/Runnable;", "callback", "Lcom/kugou/android/app/home/channel/ChannelContributionPermissionManager$CheckPublishPermissionCallback;", "eventType", "", "CheckPublishPermissionCallback", "Companion", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
public final class ChannelContributionPermissionManager {

    public static final b f10019a = new b(null);

    @NotNull
    private final Context f10020b;

    @Nullable
    private final ChannelEntity f10021c;

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bf\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H&¨\u0006\u0006"}, d2 = {"Lcom/kugou/android/app/home/channel/ChannelContributionPermissionManager$CheckPublishPermissionCallback;", "", "onGetPermissionCode", "", WebPicUploadResult.RESP_UPLOAD_PIC_PARAM_CODE, "Lcom/kugou/android/app/home/channel/entity/Privilege;", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public interface a {
        void a(@NotNull Privilege privilege);
    }

    public ChannelContributionPermissionManager(@NotNull Context context, @Nullable ChannelEntity channelEntity) {
        kotlin.jvm.internal.i.b(context, "context");
        this.f10020b = context;
        this.f10021c = channelEntity;
    }

    @Nullable
    public final ChannelEntity getF10021c() {
        return this.f10021c;
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000¨\u0006\u0007"}, d2 = {"Lcom/kugou/android/app/home/channel/ChannelContributionPermissionManager$Companion;", "", "()V", "TYPE_CHANNEL_VIDEO", "", "TYPE_COMMENT", "TYPE_PUBLISH", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public static final class b {
        private b() {
        }

        public b(kotlin.jvm.internal.g gVar) {
            this();
        }
    }

    public final void a(int i, boolean z, @NotNull Runnable runnable, @Nullable a aVar) {
        String str;
        kotlin.jvm.internal.i.b(runnable, "runnable");
        if (i == 3 && com.kugou.common.config.c.a().a(com.kugou.android.app.a.a.wI, false)) {
            runnable.run();
            return;
        }
        CheckOperateProtocol checkOperateProtocol = CheckOperateProtocol.f11435a;
        ChannelEntity channelEntity = this.f10021c;
        if (channelEntity == null || (str = channelEntity.f57740c) == null) {
            str = "";
        }
        checkOperateProtocol.a(str, i).b(Schedulers.io()).a(AndroidSchedulers.mainThread()).a(new g(runnable, aVar, z, i), new h(runnable));
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u0001J\u0016\u0010\u0004\u001a\u00020\u00052\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00030\u0002H\u0016¨\u0006\u0007"}, d2 = {"com/kugou/android/app/home/channel/ChannelContributionPermissionManager$startMeAfterHasPublishPermission$1", "Lrx/functions/Action1;", "Lcom/kugou/android/app/home/channel/entity/CommonResponse;", "Lcom/kugou/android/app/home/channel/entity/Privilege;", NotificationCompat.CATEGORY_CALL, "", "privilegeCommonResponse", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public static final class g implements rx.b.b<CommonResponse<Privilege>> {

        final Runnable f10161b;

        final a f10162c;

        final boolean f10163d;

        final int f10164e;

        g(Runnable runnable, a aVar, boolean z, int i) {
            this.f10161b = runnable;
            this.f10162c = aVar;
            this.f10163d = z;
            this.f10164e = i;
        }

        @Override
        public void call(@NotNull CommonResponse<Privilege> commonResponse) {
            kotlin.jvm.internal.i.b(commonResponse, "privilegeCommonResponse");
            Privilege e2 = commonResponse.e();
            if (commonResponse.a() && e2 != null) {
                if (e2.a()) {
                    this.f10161b.run();
                    return;
                }
                a aVar = this.f10162c;
                if (aVar != null) {
                    aVar.a(e2);
                }
                if (e2.f()) {
                    if (this.f10163d) {
                        ChannelContributionPermissionManager.this.d(e2);
                        return;
                    }
                    return;
                }
                if (e2.b()) {
                    if (this.f10163d) {
                        ChannelContributionPermissionManager.this.a(e2);
                        return;
                    }
                    return;
                }
                if (e2.c()) {
                    if (this.f10163d) {
                        ChannelContributionPermissionManager.this.c(e2);
                        return;
                    }
                    return;
                }
                if (e2.d()) {
                    if (this.f10163d) {
                        ChannelContributionPermissionManager.this.b(e2);
                        return;
                    }
                    return;
                }
                String f11296b = e2.getF11296b();
                if (this.f10164e == 2 && e2.e()) {
                    if (this.f10163d) {
                        bv.b(KGApplication.getContext(), f11296b);
                        return;
                    }
                    return;
                } else {
                    if (TextUtils.isEmpty(f11296b)) {
                        f11296b = "操作失败,如有疑问可到设置页提交反馈";
                    }
                    bv.b(KGApplication.getContext(), f11296b);
                    return;
                }
            }
            this.f10161b.run();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "", "kotlin.jvm.PlatformType", NotificationCompat.CATEGORY_CALL}, k = 3, mv = {1, 1, 15})
    public static final class h<T> implements rx.b.b<Throwable> {

        final Runnable f10180a;

        h(Runnable runnable) {
            this.f10180a = runnable;
        }

        @Override
        public final void call(Throwable th) {
            this.f10180a.run();
        }
    }

    public final void d(Privilege privilege) {
        com.kugou.common.dialog8.popdialogs.b bVar = new com.kugou.common.dialog8.popdialogs.b(this.f10020b);
        bVar.setTitleVisible(false);
        bVar.setMessage("功能内测中,如需体验可申请~");
        bVar.setButtonMode(2);
        bVar.setPositiveHint("前往申请");
        bVar.setNegativeHint("取消");
        bVar.setOnDialogClickListener(new f(bVar));
        bVar.show();
        com.kugou.common.statistics.e.a.a(new com.kugou.common.statistics.easytrace.task.b(20460, "exposure"));
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\u0012\u0010\u0004\u001a\u00020\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u0006H\u0016J\b\u0010\u0007\u001a\u00020\u0003H\u0016¨\u0006\b"}, d2 = {"com/kugou/android/app/home/channel/ChannelContributionPermissionManager$showNoVideoPrivilegeDialog$1", "Lcom/kugou/common/dialog8/OnPopDialogClickListener;", "onNegativeClick", "", "onOptionClick", "optionRow", "Lcom/kugou/common/dialog8/Row;", "onPositiveClick", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public static final class f implements com.kugou.common.dialog8.e {

        final com.kugou.common.dialog8.popdialogs.b f10158a;

        @Override
        public void onOptionClick(@Nullable com.kugou.common.dialog8.i iVar) {
        }

        f(com.kugou.common.dialog8.popdialogs.b bVar) {
            this.f10158a = bVar;
        }

        @Override
        public void onNegativeClick() {
            this.f10158a.dismiss();
        }

        @Override
        public void onPositiveClick() {
            this.f10158a.dismiss();
            String b2 = com.kugou.common.config.c.a().b(com.kugou.android.app.a.a.ww);
            if (TextUtils.isEmpty(b2)) {
                b2 = "https://www.wjx.cn/vj/rPFnibE.aspx";
            }
            Bundle bundle = new Bundle();
            bundle.putString("web_title", "视频发布权限申请");
            bundle.putString("web_url", b2);
            bundle.putBoolean("can_back_web", true);
            bundle.putBoolean("felxo_fragment_has_title_menu", true);
            com.kugou.common.base.g.a((Class<? extends Fragment>) KGFelxoWebFragment.class, bundle);
        }
    }

    public static void a(ChannelContributionPermissionManager channelContributionPermissionManager, boolean z, Runnable runnable, a aVar, int i, Object obj) {
        if ((i & 4) != 0) {
            aVar = (a) null;
        }
        channelContributionPermissionManager.a(z, runnable, aVar);
    }

    public final void a(boolean z, @NotNull Runnable runnable, @Nullable a aVar) {
        kotlin.jvm.internal.i.b(runnable, "runnable");
        a(1, z, runnable, aVar);
    }

    public final void a(@NotNull Privilege privilege) {
        kotlin.jvm.internal.i.b(privilege, "privilege");
        com.kugou.common.dialog8.popdialogs.b bVar = new com.kugou.common.dialog8.popdialogs.b(this.f10020b);
        bVar.setTitle("抱歉!你已被禁言");
        bVar.setMessage(privilege.getF11296b());
        bVar.setButtonMode(0);
        bVar.setPositiveHint("我知道了");
        bVar.show();
    }

    public final void b(@NotNull Privilege privilege) {
        kotlin.jvm.internal.i.b(privilege, "privilege");
        com.kugou.common.dialog8.popdialogs.b bVar = new com.kugou.common.dialog8.popdialogs.b(this.f10020b);
        bVar.setTitle("你的发布权限已失效");
        bVar.setMessage(privilege.getF11296b());
        bVar.setButtonMode(0);
        bVar.setPositiveHint("我知道了");
        bVar.show();
        com.kugou.common.statistics.easytrace.task.b bVar2 = new com.kugou.common.statistics.easytrace.task.b(20404, "exposure");
        ChannelEntity channelEntity = this.f10021c;
        com.kugou.common.statistics.e.a.a(bVar2.a("pdid", channelEntity != null ? channelEntity.f57740c : null));
    }

    public final void c(@NotNull Privilege privilege) {
        String str;
        kotlin.jvm.internal.i.b(privilege, "privilege");
        com.kugou.common.dialog8.popdialogs.b bVar = new com.kugou.common.dialog8.popdialogs.b(this.f10020b);
        bVar.setTitleVisible(true);
        bVar.setTitle("申请发布权限");
        bVar.setMessage(privilege.getF11296b());
        bVar.setButtonMode(2);
        bVar.setNegativeHint("再看一下");
        bVar.setPositiveHint("立即申请");
        bVar.setOnDialogClickListener(new e());
        bVar.show();
        com.kugou.common.statistics.easytrace.task.b bVar2 = new com.kugou.common.statistics.easytrace.task.b(20414, "exposure");
        ChannelEntity channelEntity = this.f10021c;
        if (channelEntity == null || (str = channelEntity.f57740c) == null) {
            str = "";
        }
        com.kugou.common.statistics.e.a.a(bVar2.a("pdid", str));
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H\u0016J\u0010\u0010\u0004\u001a\u00020\u00032\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\b\u0010\u0007\u001a\u00020\u0003H\u0016¨\u0006\b"}, d2 = {"com/kugou/android/app/home/channel/ChannelContributionPermissionManager$showApplyPublishDialog$1", "Lcom/kugou/common/dialog8/OnPopDialogClickListener;", "onNegativeClick", "", "onOptionClick", "optionRow", "Lcom/kugou/common/dialog8/Row;", "onPositiveClick", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public static final class e implements com.kugou.common.dialog8.e {
        @Override
        public void onOptionClick(@NotNull com.kugou.common.dialog8.i iVar) {
            kotlin.jvm.internal.i.b(iVar, "optionRow");
        }

        e() {
        }

        @Override
        public void onPositiveClick() {
            String str;
            ChannelContributionPermissionManager.this.a();
            com.kugou.common.statistics.easytrace.task.b bVar = new com.kugou.common.statistics.easytrace.task.b(20415, "click");
            ChannelEntity f10021c = ChannelContributionPermissionManager.this.getF10021c();
            if (f10021c == null || (str = f10021c.f57740c) == null) {
                str = "";
            }
            com.kugou.common.statistics.e.a.a(bVar.a("pdid", str).a("type", "2"));
        }

        @Override
        public void onNegativeClick() {
            String str;
            com.kugou.common.statistics.easytrace.task.b bVar = new com.kugou.common.statistics.easytrace.task.b(20415, "click");
            ChannelEntity f10021c = ChannelContributionPermissionManager.this.getF10021c();
            if (f10021c == null || (str = f10021c.f57740c) == null) {
                str = "";
            }
            com.kugou.common.statistics.e.a.a(bVar.a("pdid", str).a("type", "1"));
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u0001J\u0016\u0010\u0004\u001a\u00020\u00052\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00030\u0002H\u0016¨\u0006\u0007"}, d2 = {"com/kugou/android/app/home/channel/ChannelContributionPermissionManager$requestPublishPermission$1", "Lrx/functions/Action1;", "Lcom/kugou/android/app/home/channel/entity/CommonResponse;", "", NotificationCompat.CATEGORY_CALL, "", "response", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public static final class c implements rx.b.b<CommonResponse<Object>> {
        c() {
        }

        @Override
        public void call(@NotNull CommonResponse<Object> commonResponse) {
            String str;
            kotlin.jvm.internal.i.b(commonResponse, "response");
            if (commonResponse.a()) {
                bv.b(KGApplication.getContext(), "已申请权限");
                EventBus eventBus = EventBus.getDefault();
                ChannelEntity f10021c = ChannelContributionPermissionManager.this.getF10021c();
                if (f10021c == null || (str = f10021c.f57740c) == null) {
                    str = "";
                }
                eventBus.post(new UserApplyPublishEvent(str));
                return;
            }
            bv.b(KGApplication.getContext(), TextUtils.isEmpty(commonResponse.getErrorMsg()) ? "申请失败~" : commonResponse.getErrorMsg());
        }
    }

    public final void a() {
        String str;
        ApplySendPostPermissionProtocol applySendPostPermissionProtocol = ApplySendPostPermissionProtocol.f11399a;
        ChannelEntity channelEntity = this.f10021c;
        if (channelEntity == null || (str = channelEntity.f57740c) == null) {
            str = "";
        }
        applySendPostPermissionProtocol.a(str).b(Schedulers.io()).a(AndroidSchedulers.mainThread()).a(new c(), new d());
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0003\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0001J\u0012\u0010\u0003\u001a\u00020\u00042\b\u0010\u0005\u001a\u0004\u0018\u00010\u0002H\u0016¨\u0006\u0006"}, d2 = {"com/kugou/android/app/home/channel/ChannelContributionPermissionManager$requestPublishPermission$2", "Lrx/functions/Action1;", "", NotificationCompat.CATEGORY_CALL, "", "p0", "androidkugou_release"}, k = 1, mv = {1, 1, 15})
    public static final class d implements rx.b.b<Throwable> {
        d() {
        }

        @Override
        public void call(@Nullable Throwable th) {
            bv.b(KGApplication.getContext(), "网络请求出错,稍后重试吧~");
        }
    }
}