导航菜单

页面标题

页面副标题

哔哩哔哩 v1.6.6 - zl.java 源代码

正在查看: 哔哩哔哩 v1.6.6 应用的 zl.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package bl;

import android.content.Context;
import android.text.TextUtils;
import com.bilibili.api.BiliConfig;
import com.bilibili.lib.account.model.AccountInfo;
import com.bilibili.okretro.anno.RequestInterceptor;
import java.nio.charset.Charset;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import retrofit2.http.BaseUrl;
import retrofit2.http.Body;
import retrofit2.http.POST;
import tv.danmaku.android.log.BLog;

public final class zl {
    static final SecretKeySpec a = new SecretKeySpec(new byte[]{102, 100, 54, 98, 54, 51, 57, 100, 98, 99, 102, 102, 48, 99, 50, 97, 49, 98, 48, 51, 98, 51, 56, 57, 101, 99, 55, 54, 51, 99, 52, 98}, "AES");
    static final IvParameterSpec b = new IvParameterSpec(new byte[]{55, 55, 98, 48, 55, 97, 54, 55, 50, 100, 53, 55, 100, 54, 52, 99});
    static final byte[] c = {57, 99, 97, 102, 97, 54, 52, 54, 54, 97, 48, 50, 56, 98, 102, 98};

    @BaseUrl(a = "http://api.bilibili.com")
    interface a {
        @POST(a = "/x/report/click/android/tv")
        @RequestInterceptor(a = vy.class)
        vp<String> a(@Body bhy bhyVar);
    }

    public void a(final Context context, final long j, final long j2, final int i, final int i2, final int i3, final long j3, final long j4, final String str, final String str2) {
        BLog.event("on play av=" + j + " cid=" + j2 + " via network " + kn.a().b());
        a().c(new ja<Long, Void>() {
            @Override
            public Void a(jb<Long> jbVar) throws Exception {
                long d = abc.b().d();
                if (d == -1) {
                    d = jbVar.f().longValue() / 1000;
                    abc.b().b(d);
                }
                blh<String> d2 = ((a) vo.a(a.class)).a(bhy.a(bht.a("application/octet-stream"), zl.this.a(context, j, j2, i, jbVar.f().longValue() / 1000, d, i2, i3, j3, j4, str, str2))).d();
                d2.b();
                d2.c();
                d2.f();
                return null;
            }
        }, jb.a).b((ja<TContinuationResult, TContinuationResult>) new ja<Void, Void>() {
            @Override
            public Void a(jb<Void> jbVar) throws Exception {
                return null;
            }
        });
    }

    static jb<Long> a() {
        return acf.a();
    }

    public byte[] a(Context context, long j, long j2, int i, long j3, long j4, int i2, int i3, long j5, long j6, String str, String str2) throws Exception {
        long j7;
        mg a2 = mg.a(context);
        AccountInfo c2 = a2.c();
        int i4 = 0;
        if (c2 != null) {
            j7 = c2.mMid;
            if (c2.mLevelInfo != null) {
                i4 = c2.mLevelInfo.mCurrentLevel;
            }
        } else {
            j7 = 0;
        }
        TreeMap treeMap = new TreeMap();
        treeMap.put("aid", String.valueOf(j));
        treeMap.put("cid", String.valueOf(j2));
        treeMap.put("part", String.valueOf(i));
        treeMap.put("mid", String.valueOf(j7));
        treeMap.put("lv", String.valueOf(i4));
        treeMap.put("ftime", String.valueOf(j4));
        treeMap.put("stime", String.valueOf(j3));
        treeMap.put("did", mw.d(context));
        treeMap.put("type", String.valueOf(i2));
        treeMap.put("sub_type", String.valueOf(i3));
        treeMap.put("sid", String.valueOf(j5));
        treeMap.put("epid", String.valueOf(j6));
        treeMap.put("play_mode", str);
        if (!TextUtils.isEmpty(str2)) {
            treeMap.put("auto_play", str2);
        }
        if (a2.a()) {
            treeMap.put("access_key", a2.e());
        }
        treeMap.put("platform", "android");
        treeMap.put("mobi_app", BiliConfig.e());
        treeMap.put(u.aly.au.a, BiliConfig.a());
        treeMap.put("build", String.valueOf(BiliConfig.c()));
        StringBuilder sb = new StringBuilder();
        for (Map.Entry entry : treeMap.entrySet()) {
            String str3 = (String) entry.getKey();
            String str4 = (String) entry.getValue();
            sb.append(str3);
            sb.append('=');
            if (str4 == null) {
                str4 = "";
            }
            sb.append(str4);
            sb.append('&');
        }
        sb.deleteCharAt(sb.length() - 1);
        String sb2 = sb.toString();
        Charset forName = Charset.forName("UTF-8");
        String lowerCase = ld.a(sb2.getBytes(forName), c).toLowerCase(Locale.US);
        sb.append("&sign=");
        sb.append(lowerCase);
        return lu.a(a, b, sb.toString().getBytes(forName));
    }
}