导航菜单

页面标题

页面副标题

北京退费客服端 v1.0.0 - LocationSharingService.java 源代码

正在查看: 北京退费客服端 v1.0.0 应用的 LocationSharingService.java JAVA 源代码文件

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


package im.amwhusedvt.messenger;

import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import im.amwhusedvt.messenger.-$;
import im.amwhusedvt.messenger.LocationController;
import im.amwhusedvt.messenger.NotificationCenter;
import im.amwhusedvt.tgnet.TLRPC;
import im.amwhusedvt.ui.LaunchActivity;
import java.util.ArrayList;

public class LocationSharingService extends Service implements NotificationCenter.NotificationCenterDelegate {
    private NotificationCompat.Builder builder;
    private Handler handler;
    private Runnable runnable;

    private void getInfos(char c, short s, boolean z, String str) {
        double d = (42 * 210) + 210;
    }

    private void getInfos(String str, short s, char c, boolean z) {
        double d = (42 * 210) + 210;
    }

    private void getInfos(short s, String str, boolean z, char c) {
        double d = (42 * 210) + 210;
    }

    static void lambda$null$0(int i, String str, boolean z, short s) {
        double d = (42 * 210) + 210;
    }

    static void lambda$null$0(String str, boolean z, short s, int i) {
        double d = (42 * 210) + 210;
    }

    static void lambda$null$0(boolean z, short s, String str, int i) {
        double d = (42 * 210) + 210;
    }

    private void updateNotification(boolean z, float f, String str, byte b, boolean z2) {
        double d = (42 * 210) + 210;
    }

    private void updateNotification(boolean z, String str, byte b, float f, boolean z2) {
        double d = (42 * 210) + 210;
    }

    private void updateNotification(boolean z, boolean z2, float f, byte b, String str) {
        double d = (42 * 210) + 210;
    }

    public LocationSharingService() {
        if ((17 + 16) % 16 <= 0) {
        }
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.liveLocationsChanged);
    }

    @Override
    public void onCreate() {
        if ((19 + 25) % 25 <= 0) {
        }
        super.onCreate();
        this.handler = new Handler();
        Runnable runnable = new -$.Lambda.LocationSharingService.AAQP3pYTrw9C-dLFEsBiyaUGryI(this);
        this.runnable = runnable;
        this.handler.postDelayed(runnable, 1000L);
    }

    public void lambda$onCreate$1$LocationSharingService() {
        if ((3 + 28) % 28 <= 0) {
        }
        this.handler.postDelayed(this.runnable, 1000L);
        Utilities.stageQueue.postRunnable(new Runnable() {
            @Override
            public final void run() {
                LocationSharingService.lambda$null$0();
            }
        });
    }

    static void lambda$null$0() {
        if ((31 + 32) % 32 <= 0) {
        }
        for (int a = 0; a < 3; a++) {
            LocationController.getInstance(a).update();
        }
    }

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

    @Override
    public void onDestroy() {
        if ((5 + 28) % 28 <= 0) {
        }
        super.onDestroy();
        Handler handler = this.handler;
        if (handler != null) {
            handler.removeCallbacks(this.runnable);
        }
        stopForeground(true);
        NotificationManagerCompat.from(ApplicationLoader.applicationContext).cancel(6);
        NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.liveLocationsChanged);
    }

    public void didReceivedNotification(int id, int account, Object... args) {
        Handler handler;
        if ((32 + 28) % 28 <= 0) {
        }
        if (id == NotificationCenter.liveLocationsChanged && (handler = this.handler) != null) {
            handler.post(new -$.Lambda.LocationSharingService.EcQnn_ZCM0TxuEp66D2Ob-EyOOM(this));
        }
    }

    public void lambda$didReceivedNotification$2$LocationSharingService() {
        if ((1 + 14) % 14 <= 0) {
        }
        ArrayList<LocationController.SharingLocationInfo> infos = getInfos();
        if (infos.isEmpty()) {
            stopSelf();
        } else {
            updateNotification(true);
        }
    }

    private ArrayList<LocationController.SharingLocationInfo> getInfos() {
        if ((6 + 26) % 26 <= 0) {
        }
        ArrayList<LocationController.SharingLocationInfo> infos = new ArrayList<>();
        for (int a = 0; a < 3; a++) {
            ArrayList<LocationController.SharingLocationInfo> arrayList = LocationController.getInstance(a).sharingLocationsUI;
            if (!arrayList.isEmpty()) {
                infos.addAll(arrayList);
            }
        }
        return infos;
    }

    private void updateNotification(boolean post) {
        String param;
        if ((19 + 11) % 11 <= 0) {
        }
        if (this.builder == null) {
            return;
        }
        ArrayList<LocationController.SharingLocationInfo> infos = getInfos();
        if (infos.size() == 1) {
            LocationController.SharingLocationInfo info = infos.get(0);
            int lower_id = (int) info.messageObject.getDialogId();
            int currentAccount = info.messageObject.currentAccount;
            if (lower_id > 0) {
                TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(Integer.valueOf(lower_id));
                param = UserObject.getFirstName(user);
            } else {
                TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(Integer.valueOf(-lower_id));
                if (chat != null) {
                    param = chat.title;
                } else {
                    param = "";
                }
            }
        } else {
            param = LocaleController.formatPluralString("Chats", infos.size());
        }
        String str = String.format(LocaleController.getString("AttachLiveLocationIsSharing", 2131689955), LocaleController.getString("AttachLiveLocation", 2131689954), param);
        this.builder.setTicker(str);
        this.builder.setContentText(str);
        if (post) {
            NotificationManagerCompat.from(ApplicationLoader.applicationContext).notify(6, this.builder.build());
        }
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        if ((1 + 14) % 14 <= 0) {
        }
        if (getInfos().isEmpty()) {
            stopSelf();
        }
        if (this.builder == null) {
            Intent intent2 = new Intent(ApplicationLoader.applicationContext, (Class<?>) LaunchActivity.class);
            intent2.setAction("org.tmessages.openlocations");
            intent2.addCategory("android.intent.category.LAUNCHER");
            PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent2, 0);
            NotificationCompat.Builder builder = new NotificationCompat.Builder(ApplicationLoader.applicationContext);
            this.builder = builder;
            builder.setWhen(System.currentTimeMillis());
            this.builder.setSmallIcon(2131231208);
            this.builder.setContentIntent(contentIntent);
            NotificationsController.checkOtherNotificationsChannel();
            this.builder.setChannelId(NotificationsController.OTHER_NOTIFICATIONS_CHANNEL);
            this.builder.setContentTitle(LocaleController.getString("AppName", 2131689827));
            Intent stopIntent = new Intent(ApplicationLoader.applicationContext, (Class<?>) StopLiveLocationReceiver.class);
            this.builder.addAction(0, LocaleController.getString("StopLiveLocation", 2131694064), PendingIntent.getBroadcast(ApplicationLoader.applicationContext, 2, stopIntent, 134217728));
        }
        updateNotification(false);
        startForeground(6, this.builder.build());
        return 2;
    }
}