正在查看: 新暖心缘 v8.1.1 应用的 ConnectService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 新暖心缘 v8.1.1 应用的 ConnectService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.luanxingyuan.app.socket;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import com.luanxingyuan.app.base.AppManager;
import com.luanxingyuan.app.base.BaseResponse;
import com.luanxingyuan.app.ttt.QiNiuChecker;
import com.luanxingyuan.app.util.LogUtil;
import com.luanxingyuan.app.util.ParamUtil;
import java.util.HashMap;
import o6.k;
import o6.n;
import x7.a;
public class ConnectService extends Service {
private final int CHECK = 0;
private final long INTERVAL = 10000;
private HandlerThread connectThread;
private volatile ServiceHandler mServiceHandler;
class ServiceHandler extends Handler {
ServiceHandler(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
ConnectService.this.mServiceHandler.sendEmptyMessageDelayed(0, 10000L);
}
}
public void getQQNumber() {
HashMap hashMap = new HashMap();
hashMap.put("userId", Integer.valueOf(AppManager.f().k().t_id));
a.h().c(m6.a.p0()).e("param", ParamUtil.getParam(hashMap)).f().c(new r6.a<BaseResponse<String>>() {
public void onResponse(BaseResponse<String> baseResponse, int i8) {
if (baseResponse == null || baseResponse.m_istatus != 1 || TextUtils.isEmpty(baseResponse.m_object)) {
return;
}
String str = baseResponse.m_object;
LogUtil.i("QQ客服: " + str);
String j8 = n.j(ConnectService.this.getApplicationContext());
if (TextUtils.isEmpty(str) || j8.equals(str)) {
return;
}
n.C(ConnectService.this.getApplicationContext(), str);
}
});
}
private void startConnect() {
ConnectHelper.get().start();
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
if (Build.VERSION.SDK_INT >= 26) {
String str = getPackageName() + ".channelid";
NotificationChannel notificationChannel = new NotificationChannel(str, getPackageName() + ".channel", 4);
NotificationManager notificationManager = (NotificationManager) getSystemService("notification");
if (notificationManager != null) {
notificationManager.createNotificationChannel(notificationChannel);
}
startForeground(1, new Notification.Builder(getApplicationContext(), str).build());
}
}
@Override
public void onDestroy() {
super.onDestroy();
HandlerThread handlerThread = this.connectThread;
if (handlerThread != null) {
handlerThread.quit();
this.connectThread = null;
}
}
@Override
public int onStartCommand(Intent intent, int i8, int i9) {
if (this.connectThread == null) {
HandlerThread handlerThread = new HandlerThread("live");
this.connectThread = handlerThread;
handlerThread.start();
this.mServiceHandler = new ServiceHandler(this.connectThread.getLooper());
this.mServiceHandler.sendEmptyMessageDelayed(0, 10000L);
this.mServiceHandler.post(new Runnable() {
@Override
public void run() {
AppManager.f().B();
ConnectService.this.getQQNumber();
k.i().k();
QiNiuChecker.q().n();
}
});
}
LogUtil.i(" -------------服务 onStartCommand");
startConnect();
return 1;
}
}