导航菜单

页面标题

页面副标题

Rilo v2.0.21 - a.java 源代码

正在查看: Rilo v2.0.21 应用的 a.java JAVA 源代码文件

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


package com.tencent.aai.task.net.networktime;

import com.tencent.aai.log.AAILogger;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import p003do.Cif;

public class a {
    public final String a = "a";
    public b b;

    public class RunnableC0035a implements Runnable {
        public RunnableC0035a() {
        }

        @Override
        public void run() {
            a.this.a();
        }
    }

    public void a() {
        long j2;
        try {
            try {
                HttpURLConnection httpURLConnection = (HttpURLConnection) new URL("https://asr.cloud.tencent.com/server_time").openConnection();
                httpURLConnection.setRequestMethod("GET");
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
                StringBuilder sb = new StringBuilder();
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        break;
                    } else {
                        sb.append(readLine);
                    }
                }
                String sb2 = sb.toString();
                httpURLConnection.disconnect();
                if (sb2.contains(".")) {
                    sb2 = sb2.replace(".", "");
                }
                try {
                    j2 = Long.parseLong(sb2) / 1000;
                } catch (NumberFormatException unused) {
                    j2 = 0;
                }
                AAILogger.debug(this.a, "run: timeTamp=" + j2 + ",nowTime=" + System.currentTimeMillis());
                b bVar = this.b;
                if (bVar != null) {
                    bVar.a(j2);
                }
            } catch (IOException e2) {
                b bVar2 = this.b;
                if (bVar2 != null) {
                    bVar2.a(0L);
                }
                AAILogger.warn(this.a, "Failed to synchronize server time" + e2.toString());
                e2.printStackTrace();
            }
        } catch (MalformedURLException e3) {
            b bVar3 = this.b;
            if (bVar3 != null) {
                bVar3.a(0L);
            }
            String str = this.a;
            StringBuilder m1134do = Cif.m1134do("Failed to synchronize server time");
            m1134do.append(e3.toString());
            AAILogger.warn(str, m1134do.toString());
            e3.printStackTrace();
        }
    }

    public void a(b bVar) {
        this.b = bVar;
    }

    public void b() {
        new Thread(new RunnableC0035a()).start();
    }
}