导航菜单

页面标题

页面副标题

Moneyman v2.316.0.0 - FreshchatService.java 源代码

正在查看: Moneyman v2.316.0.0 应用的 FreshchatService.java JAVA 源代码文件

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


package com.freshchat.consumer.sdk.service;

import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import com.freshchat.consumer.sdk.service.e.r;
import com.freshchat.consumer.sdk.service.e.s;
import com.freshchat.consumer.sdk.util.aj;
import com.freshchat.consumer.sdk.util.co;
import java.util.LinkedList;
import java.util.Queue;

public class FreshchatService extends IntentService {
    private static Queue<com.freshchat.consumer.sdk.service.b.c> qH = new LinkedList();
    private static Queue<com.freshchat.consumer.sdk.service.b.c> qI = new LinkedList();
    private int qJ;
    com.freshchat.consumer.sdk.service.b.b qK;

    public FreshchatService() {
        super("FreshchatService");
        this.qJ = 0;
        this.qK = new com.freshchat.consumer.sdk.service.b.b();
    }

    private static void Q(Context context) {
        try {
            context.startService(new Intent(context, (Class<?>) FreshchatService.class));
        } catch (Exception e4) {
            co.d("FRESHCHAT", e4.getMessage());
        }
    }

    public static void R(Context context) {
        try {
            qH.clear();
            qI.clear();
        } catch (Exception e4) {
            aj.a(e4);
        }
    }

    public static void a(Context context, s sVar, a aVar) {
        qH.add(new com.freshchat.consumer.sdk.service.b.c(sVar, aVar));
        Q(context);
    }

    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        co.a("FRESHCHAT", "Service processed " + this.qJ + " messages");
    }

    @Override
    public void onHandleIntent(Intent intent) {
        while (true) {
            try {
                if (qH.peek() == null && qI.peek() == null) {
                    return;
                }
                com.freshchat.consumer.sdk.service.b.c peek = qH.peek();
                if (peek == null) {
                    com.freshchat.consumer.sdk.service.b.c peek2 = qI.peek();
                    if (peek2 != null) {
                        this.qK.b(getApplicationContext(), peek2.hN(), peek2.hM());
                        this.qJ++;
                        a(qI, peek2);
                    }
                } else if (peek.hN() instanceof r) {
                    qI.add(qH.remove());
                } else {
                    co.a("Service", "Processing message " + peek.hN().getClass());
                    this.qK.b(getApplicationContext(), peek.hN(), peek.hM());
                    this.qJ = this.qJ + 1;
                    a(qH, peek);
                }
            } catch (Exception e4) {
                aj.a(e4);
                return;
            }
        }
    }

    private static void a(Queue<com.freshchat.consumer.sdk.service.b.c> queue, com.freshchat.consumer.sdk.service.b.c cVar) {
        if (queue.contains(cVar)) {
            queue.remove(cVar);
        }
    }
}