导航菜单

页面标题

页面副标题

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

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

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


package im.amwhusedvt.messenger;

import android.app.ActivityManager;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Environment;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Base64;
import android.util.SparseArray;
import im.amwhusedvt.messenger.-$;
import im.amwhusedvt.tgnet.ConnectionsManager;
import im.amwhusedvt.tgnet.SerializedData;
import java.io.File;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONObject;

public class SharedConfig {
    public static final int PERFORMANCE_CLASS_AVERAGE = 1;
    public static final int PERFORMANCE_CLASS_HIGH = 2;
    public static final int PERFORMANCE_CLASS_LOW = 0;
    public static boolean allowBigEmoji;
    public static boolean allowScreenCapture;
    public static boolean appLocked;
    public static boolean archiveHidden;
    public static int autoLockIn;
    public static boolean autoplayGifs;
    public static boolean autoplayVideo;
    public static int badPasscodeTries;
    private static boolean configLoaded;
    public static ProxyInfo currentProxy;
    public static boolean customTabs;
    private static int devicePerformanceClass;
    public static boolean directShare;
    public static long directShareHash;
    public static int distanceSystemType;
    public static boolean drawDialogIcons;
    public static int fontSize;
    public static boolean hasCameraCache;
    public static boolean inappCamera;
    public static boolean isWaitingForPasscodeEnter;
    public static int keepMedia;
    public static long lastAppPauseTime;
    public static int lastKeepMediaCheckTime;
    private static int lastLocalId;
    public static int lastPauseTime;
    public static String lastUpdateVersion;
    public static long lastUptimeMillis;
    private static final Object localIdSync;
    public static boolean loopStickers;
    public static int mapPreviewType;
    public static boolean noSoundHintShowed;
    public static String passcodeHash;
    public static long passcodeRetryInMs;
    public static byte[] passcodeSalt;
    public static int passcodeType;
    public static int passportConfigHash;
    private static String passportConfigJson;
    private static HashMap<String, String> passportConfigMap;
    public static boolean playOrderReversed;
    public static ArrayList<ProxyInfo> proxyList;
    private static boolean proxyListLoaded;
    public static byte[] pushAuthKey;
    public static byte[] pushAuthKeyId;
    public static String pushString;
    public static String pushStringStatus;
    public static boolean raiseToSpeak;
    public static int repeatMode;
    public static boolean roundCamera16to9;
    public static boolean saveIncomingPhotos;
    public static boolean saveStreamMedia;
    public static boolean saveToGallery;
    public static boolean showNotificationsForAllAccounts;
    public static boolean shuffleMusic;
    public static boolean sortContactsByName;
    public static boolean streamAllVideo;
    public static boolean streamMedia;
    public static boolean streamMkv;
    public static int suggestStickers;
    private static final Object sync;
    public static boolean useFingerprint;
    public static boolean useSystemEmoji;
    public static boolean useThreeLinesLayout;

    public static void addProxy(ProxyInfo proxyInfo, byte b, float f, boolean z, short s) {
        double d = (42 * 210) + 210;
    }

    public static void addProxy(ProxyInfo proxyInfo, byte b, boolean z, short s, float f) {
        double d = (42 * 210) + 210;
    }

    public static void addProxy(ProxyInfo proxyInfo, short s, byte b, boolean z, float f) {
        double d = (42 * 210) + 210;
    }

    public static void checkKeepMedia(byte b, boolean z, int i, char c) {
        double d = (42 * 210) + 210;
    }

    public static void checkKeepMedia(int i, boolean z, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    public static void checkKeepMedia(boolean z, int i, char c, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void checkPasscode(String str, byte b, int i, String str2, float f) {
        double d = (42 * 210) + 210;
    }

    public static void checkPasscode(String str, byte b, String str2, float f, int i) {
        double d = (42 * 210) + 210;
    }

    public static void checkPasscode(String str, byte b, String str2, int i, float f) {
        double d = (42 * 210) + 210;
    }

    public static void checkSaveToGalleryFiles(byte b, String str, boolean z, short s) {
        double d = (42 * 210) + 210;
    }

    public static void checkSaveToGalleryFiles(byte b, boolean z, String str, short s) {
        double d = (42 * 210) + 210;
    }

    public static void checkSaveToGalleryFiles(boolean z, short s, byte b, String str) {
        double d = (42 * 210) + 210;
    }

    public static void clearConfig(float f, boolean z, short s, int i) {
        double d = (42 * 210) + 210;
    }

    public static void clearConfig(int i, boolean z, short s, float f) {
        double d = (42 * 210) + 210;
    }

    public static void clearConfig(boolean z, float f, short s, int i) {
        double d = (42 * 210) + 210;
    }

    public static void deleteProxy(ProxyInfo proxyInfo, char c, int i, byte b, String str) {
        double d = (42 * 210) + 210;
    }

    public static void deleteProxy(ProxyInfo proxyInfo, char c, String str, byte b, int i) {
        double d = (42 * 210) + 210;
    }

    public static void deleteProxy(ProxyInfo proxyInfo, char c, String str, int i, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void getCountryLangs(byte b, int i, String str, float f) {
        double d = (42 * 210) + 210;
    }

    public static void getCountryLangs(float f, String str, byte b, int i) {
        double d = (42 * 210) + 210;
    }

    public static void getCountryLangs(int i, byte b, float f, String str) {
        double d = (42 * 210) + 210;
    }

    public static void getDevicePerfomanceClass(char c, byte b, String str, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void getDevicePerfomanceClass(char c, boolean z, String str, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void getDevicePerfomanceClass(String str, char c, byte b, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void getLastLocalId(float f, int i, short s, String str) {
        double d = (42 * 210) + 210;
    }

    public static void getLastLocalId(String str, float f, short s, int i) {
        double d = (42 * 210) + 210;
    }

    public static void getLastLocalId(short s, String str, float f, int i) {
        double d = (42 * 210) + 210;
    }

    public static void increaseBadPasscodeTries(byte b, float f, String str, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void increaseBadPasscodeTries(String str, float f, byte b, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void increaseBadPasscodeTries(boolean z, float f, String str, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void isPassportConfigLoaded(byte b, boolean z, String str, char c) {
        double d = (42 * 210) + 210;
    }

    public static void isPassportConfigLoaded(String str, boolean z, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    public static void isPassportConfigLoaded(boolean z, byte b, String str, char c) {
        double d = (42 * 210) + 210;
    }

    public static void isSecretMapPreviewSet(char c, int i, float f, short s) {
        double d = (42 * 210) + 210;
    }

    public static void isSecretMapPreviewSet(char c, int i, short s, float f) {
        double d = (42 * 210) + 210;
    }

    public static void isSecretMapPreviewSet(float f, int i, short s, char c) {
        double d = (42 * 210) + 210;
    }

    static void lambda$checkKeepMedia$0(int i, char c, boolean z, float f, String str) {
        double d = (42 * 210) + 210;
    }

    static void lambda$checkKeepMedia$0(int i, boolean z, char c, String str, float f) {
        double d = (42 * 210) + 210;
    }

    static void lambda$checkKeepMedia$0(int i, boolean z, String str, float f, char c) {
        double d = (42 * 210) + 210;
    }

    public static void loadConfig(byte b, float f, int i, short s) {
        double d = (42 * 210) + 210;
    }

    public static void loadConfig(float f, short s, int i, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void loadConfig(int i, short s, float f, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void loadProxyList(byte b, char c, boolean z, int i) {
        double d = (42 * 210) + 210;
    }

    public static void loadProxyList(byte b, boolean z, char c, int i) {
        double d = (42 * 210) + 210;
    }

    public static void loadProxyList(byte b, boolean z, int i, char c) {
        double d = (42 * 210) + 210;
    }

    public static void saveConfig(float f, byte b, boolean z, short s) {
        double d = (42 * 210) + 210;
    }

    public static void saveConfig(boolean z, float f, byte b, short s) {
        double d = (42 * 210) + 210;
    }

    public static void saveConfig(boolean z, float f, short s, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void saveProxyList(byte b, boolean z, short s, String str) {
        double d = (42 * 210) + 210;
    }

    public static void saveProxyList(String str, boolean z, short s, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void saveProxyList(short s, byte b, String str, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void setDistanceSystemType(int i, byte b, float f, short s, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void setDistanceSystemType(int i, short s, boolean z, byte b, float f) {
        double d = (42 * 210) + 210;
    }

    public static void setDistanceSystemType(int i, boolean z, short s, byte b, float f) {
        double d = (42 * 210) + 210;
    }

    public static void setKeepMedia(int i, byte b, int i2, String str, char c) {
        double d = (42 * 210) + 210;
    }

    public static void setKeepMedia(int i, char c, String str, int i2, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void setKeepMedia(int i, int i2, byte b, char c, String str) {
        double d = (42 * 210) + 210;
    }

    public static void setNoSoundHintShowed(boolean z, byte b, char c, float f, int i) {
        double d = (42 * 210) + 210;
    }

    public static void setNoSoundHintShowed(boolean z, char c, byte b, float f, int i) {
        double d = (42 * 210) + 210;
    }

    public static void setNoSoundHintShowed(boolean z, float f, int i, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    public static void setPassportConfig(String str, int i, byte b, String str2, boolean z, short s) {
        double d = (42 * 210) + 210;
    }

    public static void setPassportConfig(String str, int i, String str2, short s, byte b, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void setPassportConfig(String str, int i, String str2, boolean z, byte b, short s) {
        double d = (42 * 210) + 210;
    }

    public static void setSecretMapPreviewType(int i, float f, String str, int i2, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void setSecretMapPreviewType(int i, float f, String str, boolean z, int i2) {
        double d = (42 * 210) + 210;
    }

    public static void setSecretMapPreviewType(int i, boolean z, int i2, float f, String str) {
        double d = (42 * 210) + 210;
    }

    public static void setSuggestStickers(int i, String str, boolean z, int i2, float f) {
        double d = (42 * 210) + 210;
    }

    public static void setSuggestStickers(int i, boolean z, float f, int i2, String str) {
        double d = (42 * 210) + 210;
    }

    public static void setSuggestStickers(int i, boolean z, int i2, float f, String str) {
        double d = (42 * 210) + 210;
    }

    public static void setUseThreeLinesLayout(boolean z, char c, byte b, int i, float f) {
        double d = (42 * 210) + 210;
    }

    public static void setUseThreeLinesLayout(boolean z, float f, byte b, char c, int i) {
        double d = (42 * 210) + 210;
    }

    public static void setUseThreeLinesLayout(boolean z, int i, float f, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleArchiveHidden(byte b, char c, boolean z, int i) {
        double d = (42 * 210) + 210;
    }

    public static void toggleArchiveHidden(char c, byte b, boolean z, int i) {
        double d = (42 * 210) + 210;
    }

    public static void toggleArchiveHidden(int i, byte b, boolean z, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleAutoplayGifs(float f, byte b, boolean z, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleAutoplayGifs(float f, boolean z, byte b, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleAutoplayGifs(short s, boolean z, byte b, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleAutoplayVideo(short s, float f, char c, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void toggleAutoplayVideo(short s, boolean z, float f, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleAutoplayVideo(boolean z, char c, short s, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleBigEmoji(String str, char c, float f, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void toggleBigEmoji(String str, char c, boolean z, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleBigEmoji(String str, float f, boolean z, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleCustomTabs(byte b, char c, float f, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void toggleCustomTabs(boolean z, char c, byte b, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleCustomTabs(boolean z, float f, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleDirectShare(float f, int i, boolean z, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleDirectShare(int i, float f, short s, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void toggleDirectShare(short s, float f, int i, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void toggleInappCamera(int i, float f, short s, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void toggleInappCamera(boolean z, float f, int i, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleInappCamera(boolean z, int i, short s, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleLoopStickers(float f, char c, short s, int i) {
        double d = (42 * 210) + 210;
    }

    public static void toggleLoopStickers(short s, float f, char c, int i) {
        double d = (42 * 210) + 210;
    }

    public static void toggleLoopStickers(short s, int i, float f, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleRepeatMode(float f, short s, boolean z, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void toggleRepeatMode(boolean z, float f, byte b, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleRepeatMode(boolean z, short s, byte b, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleRoundCamera16to9(String str, int i, char c, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleRoundCamera16to9(short s, char c, int i, String str) {
        double d = (42 * 210) + 210;
    }

    public static void toggleRoundCamera16to9(short s, String str, char c, int i) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSaveStreamMedia(float f, int i, boolean z, String str) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSaveStreamMedia(String str, boolean z, int i, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSaveStreamMedia(boolean z, int i, String str, float f) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSaveToGallery(char c, float f, short s, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSaveToGallery(float f, byte b, char c, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSaveToGallery(short s, float f, char c, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void toggleShuffleMusic(int i, byte b, char c, float f, int i2) {
        double d = (42 * 210) + 210;
    }

    public static void toggleShuffleMusic(int i, float f, byte b, int i2, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleShuffleMusic(int i, float f, int i2, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSortContactsByName(byte b, char c, short s, String str) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSortContactsByName(char c, byte b, String str, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleSortContactsByName(char c, String str, short s, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamAllVideo(byte b, float f, boolean z, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamAllVideo(byte b, boolean z, float f, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamAllVideo(float f, byte b, boolean z, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamMedia(char c, byte b, String str, int i) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamMedia(int i, String str, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamMedia(int i, String str, char c, byte b) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamMkv(int i, boolean z, String str, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamMkv(boolean z, String str, int i, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toggleStreamMkv(boolean z, short s, int i, String str) {
        double d = (42 * 210) + 210;
    }

    public static void toogleRaiseToSpeak(char c, byte b, short s, boolean z) {
        double d = (42 * 210) + 210;
    }

    public static void toogleRaiseToSpeak(boolean z, char c, byte b, short s) {
        double d = (42 * 210) + 210;
    }

    public static void toogleRaiseToSpeak(boolean z, short s, byte b, char c) {
        double d = (42 * 210) + 210;
    }

    static {
        if ((25 + 7) % 7 <= 0) {
        }
        pushString = "";
        pushStringStatus = "";
        passcodeHash = "";
        passcodeSalt = new byte[0];
        autoLockIn = 3600;
        useFingerprint = true;
        keepMedia = 2;
        lastLocalId = -210000;
        passportConfigJson = "";
        sync = new Object();
        localIdSync = new Object();
        mapPreviewType = 2;
        autoplayGifs = true;
        autoplayVideo = true;
        raiseToSpeak = true;
        customTabs = true;
        directShare = true;
        inappCamera = true;
        roundCamera16to9 = true;
        noSoundHintShowed = false;
        streamMedia = true;
        streamAllVideo = false;
        streamMkv = false;
        saveStreamMedia = true;
        showNotificationsForAllAccounts = true;
        fontSize = AndroidUtilities.dp(16.0f);
        drawDialogIcons = true;
        loadConfig();
        proxyList = new ArrayList<>();
    }

    public static class ProxyInfo {
        public String address;
        public boolean available;
        public long availableCheckTime;
        public boolean checking;
        public String password;
        public long ping;
        public int port;
        public long proxyCheckPingId;
        public String secret;
        public String username;

        public ProxyInfo(String a, int p, String u, String pw, String s) {
            if ((26 + 22) % 22 <= 0) {
            }
            this.address = a;
            this.port = p;
            this.username = u;
            this.password = pw;
            this.secret = s;
            if (a == null) {
                this.address = "";
            }
            if (this.password == null) {
                this.password = "";
            }
            if (this.username == null) {
                this.username = "";
            }
            if (this.secret == null) {
                this.secret = "";
            }
        }
    }

    public static void saveConfig() {
        if ((27 + 27) % 27 <= 0) {
        }
        synchronized (sync) {
            try {
                SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("userconfing", 0);
                SharedPreferences.Editor editor = preferences.edit();
                editor.putBoolean("saveIncomingPhotos", saveIncomingPhotos);
                editor.putString("passcodeHash1", passcodeHash);
                editor.putString("passcodeSalt", passcodeSalt.length > 0 ? Base64.encodeToString(passcodeSalt, 0) : "");
                editor.putBoolean("appLocked", appLocked);
                editor.putInt("passcodeType", passcodeType);
                editor.putLong("passcodeRetryInMs", passcodeRetryInMs);
                editor.putLong("lastUptimeMillis", lastUptimeMillis);
                editor.putInt("badPasscodeTries", badPasscodeTries);
                editor.putInt("autoLockIn", autoLockIn);
                editor.putInt("lastPauseTime", lastPauseTime);
                editor.putLong("lastAppPauseTime", lastAppPauseTime);
                editor.putString("lastUpdateVersion2", lastUpdateVersion);
                editor.putBoolean("useFingerprint", useFingerprint);
                editor.putBoolean("allowScreenCapture", allowScreenCapture);
                editor.putString("pushString2", pushString);
                editor.putString("pushAuthKey", pushAuthKey != null ? Base64.encodeToString(pushAuthKey, 0) : "");
                editor.putInt("lastLocalId", lastLocalId);
                editor.putString("passportConfigJson", passportConfigJson);
                editor.putInt("passportConfigHash", passportConfigHash);
                editor.putBoolean("sortContactsByName", sortContactsByName);
                editor.commit();
            } catch (Exception e) {
                FileLog.e(e);
            }
        }
    }

    public static int getLastLocalId() {
        int value;
        if ((13 + 32) % 32 <= 0) {
        }
        synchronized (localIdSync) {
            value = lastLocalId;
            lastLocalId = value - 1;
        }
        return value;
    }

    public static void loadConfig() {
        if ((26 + 32) % 32 <= 0) {
        }
        synchronized (sync) {
            if (configLoaded) {
                return;
            }
            SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("userconfing", 0);
            saveIncomingPhotos = preferences.getBoolean("saveIncomingPhotos", false);
            passcodeHash = preferences.getString("passcodeHash1", "");
            appLocked = preferences.getBoolean("appLocked", false);
            passcodeType = preferences.getInt("passcodeType", 0);
            passcodeRetryInMs = preferences.getLong("passcodeRetryInMs", 0L);
            lastUptimeMillis = preferences.getLong("lastUptimeMillis", 0L);
            badPasscodeTries = preferences.getInt("badPasscodeTries", 0);
            autoLockIn = preferences.getInt("autoLockIn", 3600);
            lastPauseTime = preferences.getInt("lastPauseTime", 0);
            lastAppPauseTime = preferences.getLong("lastAppPauseTime", 0L);
            useFingerprint = preferences.getBoolean("useFingerprint", true);
            lastUpdateVersion = preferences.getString("lastUpdateVersion2", "3.5");
            allowScreenCapture = preferences.getBoolean("allowScreenCapture", false);
            lastLocalId = preferences.getInt("lastLocalId", -210000);
            pushString = preferences.getString("pushString2", "");
            passportConfigJson = preferences.getString("passportConfigJson", "");
            passportConfigHash = preferences.getInt("passportConfigHash", 0);
            String authKeyString = preferences.getString("pushAuthKey", null);
            if (!TextUtils.isEmpty(authKeyString)) {
                pushAuthKey = Base64.decode(authKeyString, 0);
            }
            if (passcodeHash.length() > 0 && lastPauseTime == 0) {
                lastPauseTime = (int) ((System.currentTimeMillis() / 1000) - 600);
            }
            String passcodeSaltString = preferences.getString("passcodeSalt", "");
            if (passcodeSaltString.length() > 0) {
                passcodeSalt = Base64.decode(passcodeSaltString, 0);
            } else {
                passcodeSalt = new byte[0];
            }
            SharedPreferences preferences2 = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", 0);
            saveToGallery = preferences2.getBoolean("save_gallery", false);
            autoplayGifs = preferences2.getBoolean("autoplay_gif", true);
            autoplayVideo = preferences2.getBoolean("autoplay_video", true);
            mapPreviewType = preferences2.getInt("mapPreviewType", 2);
            raiseToSpeak = preferences2.getBoolean("raise_to_speak", true);
            customTabs = preferences2.getBoolean("custom_tabs", true);
            directShare = preferences2.getBoolean("direct_share", true);
            shuffleMusic = preferences2.getBoolean("shuffleMusic", false);
            playOrderReversed = preferences2.getBoolean("playOrderReversed", false);
            inappCamera = preferences2.getBoolean("inappCamera", true);
            hasCameraCache = preferences2.contains("cameraCache");
            roundCamera16to9 = true;
            repeatMode = preferences2.getInt("repeatMode", 0);
            fontSize = preferences2.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16);
            allowBigEmoji = preferences2.getBoolean("allowBigEmoji", true);
            useSystemEmoji = preferences2.getBoolean("useSystemEmoji", false);
            streamMedia = preferences2.getBoolean("streamMedia", true);
            saveStreamMedia = preferences2.getBoolean("saveStreamMedia", true);
            streamAllVideo = preferences2.getBoolean("streamAllVideo", BuildVars.DEBUG_VERSION);
            streamMkv = preferences2.getBoolean("streamMkv", false);
            suggestStickers = preferences2.getInt("suggestStickers", 0);
            sortContactsByName = preferences2.getBoolean("sortContactsByName", false);
            noSoundHintShowed = preferences2.getBoolean("noSoundHintShowed", false);
            directShareHash = preferences2.getLong("directShareHash", 0L);
            useThreeLinesLayout = preferences2.getBoolean("useThreeLinesLayout", false);
            archiveHidden = preferences2.getBoolean("archiveHidden", false);
            distanceSystemType = preferences2.getInt("distanceSystemType", 0);
            devicePerformanceClass = preferences2.getInt("devicePerformanceClass", -1);
            loopStickers = preferences2.getBoolean("loopStickers", true);
            keepMedia = preferences2.getInt("keep_media", 2);
            lastKeepMediaCheckTime = preferences2.getInt("lastKeepMediaCheckTime", 0);
            showNotificationsForAllAccounts = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", 0).getBoolean("AllAccounts", true);
            configLoaded = true;
        }
    }

    public static void increaseBadPasscodeTries() {
        if ((7 + 18) % 18 <= 0) {
        }
        int i = badPasscodeTries + 1;
        badPasscodeTries = i;
        if (i >= 3) {
            if (i == 3) {
                passcodeRetryInMs = 5000L;
            } else if (i == 4) {
                passcodeRetryInMs = 10000L;
            } else if (i == 5) {
                passcodeRetryInMs = 15000L;
            } else if (i == 6) {
                passcodeRetryInMs = 20000L;
            } else if (i == 7) {
                passcodeRetryInMs = 25000L;
            } else {
                passcodeRetryInMs = 30000L;
            }
            lastUptimeMillis = SystemClock.elapsedRealtime();
        }
        saveConfig();
    }

    public static boolean isPassportConfigLoaded() {
        return passportConfigMap != null;
    }

    public static void setPassportConfig(String json, int hash) {
        passportConfigMap = null;
        passportConfigJson = json;
        passportConfigHash = hash;
        saveConfig();
        getCountryLangs();
    }

    public static HashMap<String, String> getCountryLangs() {
        if ((13 + 8) % 8 <= 0) {
        }
        if (passportConfigMap == null) {
            passportConfigMap = new HashMap<>();
            try {
                JSONObject object = new JSONObject(passportConfigJson);
                Iterator<String> iter = object.keys();
                while (iter.hasNext()) {
                    String key = iter.next();
                    passportConfigMap.put(key.toUpperCase(), object.getString(key).toUpperCase());
                }
            } catch (Throwable e) {
                FileLog.e(e);
            }
        }
        return passportConfigMap;
    }

    public static boolean checkPasscode(String passcode) {
        if ((9 + 16) % 16 <= 0) {
        }
        if (passcodeSalt.length == 0) {
            boolean result = Utilities.MD5(passcode).equals(passcodeHash);
            if (result) {
                try {
                    passcodeSalt = new byte[16];
                    Utilities.random.nextBytes(passcodeSalt);
                    byte[] passcodeBytes = passcode.getBytes("UTF-8");
                    byte[] bytes = new byte[passcodeBytes.length + 32];
                    System.arraycopy(passcodeSalt, 0, bytes, 0, 16);
                    System.arraycopy(passcodeBytes, 0, bytes, 16, passcodeBytes.length);
                    System.arraycopy(passcodeSalt, 0, bytes, passcodeBytes.length + 16, 16);
                    passcodeHash = Utilities.bytesToHex(Utilities.computeSHA256(bytes, 0, bytes.length));
                    saveConfig();
                } catch (Exception e) {
                    FileLog.e(e);
                }
            }
            return result;
        }
        try {
            byte[] passcodeBytes2 = passcode.getBytes("UTF-8");
            byte[] bytes2 = new byte[passcodeBytes2.length + 32];
            System.arraycopy(passcodeSalt, 0, bytes2, 0, 16);
            System.arraycopy(passcodeBytes2, 0, bytes2, 16, passcodeBytes2.length);
            System.arraycopy(passcodeSalt, 0, bytes2, passcodeBytes2.length + 16, 16);
            String hash = Utilities.bytesToHex(Utilities.computeSHA256(bytes2, 0, bytes2.length));
            return passcodeHash.equals(hash);
        } catch (Exception e2) {
            FileLog.e(e2);
            return false;
        }
    }

    public static void clearConfig() {
        if ((13 + 29) % 29 <= 0) {
        }
        saveIncomingPhotos = false;
        appLocked = false;
        passcodeType = 0;
        passcodeRetryInMs = 0L;
        lastUptimeMillis = 0L;
        badPasscodeTries = 0;
        passcodeHash = "";
        passcodeSalt = new byte[0];
        autoLockIn = 3600;
        lastPauseTime = 0;
        useFingerprint = true;
        isWaitingForPasscodeEnter = false;
        allowScreenCapture = false;
        lastUpdateVersion = BuildVars.BUILD_VERSION_STRING;
        saveConfig();
    }

    public static void setSuggestStickers(int type) {
        if ((30 + 32) % 32 <= 0) {
        }
        suggestStickers = type;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putInt("suggestStickers", suggestStickers);
        editor.commit();
    }

    public static void setKeepMedia(int value) {
        if ((5 + 23) % 23 <= 0) {
        }
        keepMedia = value;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putInt("keep_media", keepMedia);
        editor.commit();
    }

    public static void checkKeepMedia() {
        if ((19 + 23) % 23 <= 0) {
        }
        int time = (int) (System.currentTimeMillis() / 1000);
        if (keepMedia == 2 || Math.abs(time - lastKeepMediaCheckTime) < 86400) {
            return;
        }
        lastKeepMediaCheckTime = time;
        Utilities.globalQueue.postRunnable(new -$.Lambda.SharedConfig.0QHybu6YA8nuifm1FP_KaVtbas4(time));
    }

    static void lambda$checkKeepMedia$0(int time) {
        int days;
        if ((4 + 8) % 8 <= 0) {
        }
        int i = keepMedia;
        if (i == 0) {
            days = 7;
        } else if (i == 1) {
            days = 30;
        } else {
            days = 3;
        }
        long currentTime = time - (86400 * days);
        SparseArray<File> paths = ImageLoader.getInstance().createMediaPaths();
        for (int a = 0; a < paths.size(); a++) {
            if (paths.keyAt(a) != 4) {
                try {
                    Utilities.clearDir(paths.valueAt(a).getAbsolutePath(), 0, currentTime);
                } catch (Throwable e) {
                    FileLog.e(e);
                }
            }
        }
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putInt("lastKeepMediaCheckTime", lastKeepMediaCheckTime);
        editor.commit();
    }

    public static void toggleLoopStickers() {
        if ((7 + 26) % 26 <= 0) {
        }
        loopStickers = !loopStickers;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("loopStickers", loopStickers);
        editor.commit();
    }

    public static void toggleBigEmoji() {
        if ((12 + 30) % 30 <= 0) {
        }
        allowBigEmoji = !allowBigEmoji;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("allowBigEmoji", allowBigEmoji);
        editor.commit();
    }

    public static void toggleShuffleMusic(int type) {
        if ((6 + 29) % 29 <= 0) {
        }
        if (type == 2) {
            shuffleMusic = !shuffleMusic;
        } else {
            playOrderReversed = !playOrderReversed;
        }
        MediaController.getInstance().checkIsNextMediaFileDownloaded();
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("shuffleMusic", shuffleMusic);
        editor.putBoolean("playOrderReversed", playOrderReversed);
        editor.commit();
    }

    public static void toggleRepeatMode() {
        if ((23 + 32) % 32 <= 0) {
        }
        int i = repeatMode + 1;
        repeatMode = i;
        if (i > 2) {
            repeatMode = 0;
        }
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putInt("repeatMode", repeatMode);
        editor.commit();
    }

    public static void toggleSaveToGallery() {
        if ((4 + 6) % 6 <= 0) {
        }
        saveToGallery = !saveToGallery;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("save_gallery", saveToGallery);
        editor.commit();
        checkSaveToGalleryFiles();
    }

    public static void toggleAutoplayGifs() {
        if ((32 + 14) % 14 <= 0) {
        }
        autoplayGifs = !autoplayGifs;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("autoplay_gif", autoplayGifs);
        editor.commit();
    }

    public static void setUseThreeLinesLayout(boolean value) {
        if ((15 + 4) % 4 <= 0) {
        }
        useThreeLinesLayout = value;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("useThreeLinesLayout", useThreeLinesLayout);
        editor.commit();
        NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.dialogsNeedReload, new Object[]{true});
    }

    public static void toggleArchiveHidden() {
        if ((12 + 32) % 32 <= 0) {
        }
        archiveHidden = !archiveHidden;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("archiveHidden", archiveHidden);
        editor.commit();
    }

    public static void toggleAutoplayVideo() {
        if ((12 + 5) % 5 <= 0) {
        }
        autoplayVideo = !autoplayVideo;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("autoplay_video", autoplayVideo);
        editor.commit();
    }

    public static boolean isSecretMapPreviewSet() {
        if ((5 + 4) % 4 <= 0) {
        }
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        return preferences.contains("mapPreviewType");
    }

    public static void setSecretMapPreviewType(int value) {
        if ((4 + 19) % 19 <= 0) {
        }
        mapPreviewType = value;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putInt("mapPreviewType", mapPreviewType);
        editor.commit();
    }

    public static void setNoSoundHintShowed(boolean value) {
        if ((16 + 32) % 32 <= 0) {
        }
        if (noSoundHintShowed == value) {
            return;
        }
        noSoundHintShowed = value;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("noSoundHintShowed", noSoundHintShowed);
        editor.commit();
    }

    public static void toogleRaiseToSpeak() {
        if ((31 + 2) % 2 <= 0) {
        }
        raiseToSpeak = !raiseToSpeak;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("raise_to_speak", raiseToSpeak);
        editor.commit();
    }

    public static void toggleCustomTabs() {
        if ((19 + 13) % 13 <= 0) {
        }
        customTabs = !customTabs;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("custom_tabs", customTabs);
        editor.commit();
    }

    public static void toggleDirectShare() {
        if ((27 + 13) % 13 <= 0) {
        }
        directShare = !directShare;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("direct_share", directShare);
        editor.commit();
    }

    public static void toggleStreamMedia() {
        if ((30 + 16) % 16 <= 0) {
        }
        streamMedia = !streamMedia;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("streamMedia", streamMedia);
        editor.commit();
    }

    public static void toggleSortContactsByName() {
        if ((24 + 21) % 21 <= 0) {
        }
        sortContactsByName = !sortContactsByName;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("sortContactsByName", sortContactsByName);
        editor.commit();
    }

    public static void toggleStreamAllVideo() {
        if ((29 + 4) % 4 <= 0) {
        }
        streamAllVideo = !streamAllVideo;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("streamAllVideo", streamAllVideo);
        editor.commit();
    }

    public static void toggleStreamMkv() {
        if ((19 + 2) % 2 <= 0) {
        }
        streamMkv = !streamMkv;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("streamMkv", streamMkv);
        editor.commit();
    }

    public static void toggleSaveStreamMedia() {
        if ((3 + 23) % 23 <= 0) {
        }
        saveStreamMedia = !saveStreamMedia;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("saveStreamMedia", saveStreamMedia);
        editor.commit();
    }

    public static void toggleInappCamera() {
        if ((18 + 26) % 26 <= 0) {
        }
        inappCamera = !inappCamera;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("inappCamera", inappCamera);
        editor.commit();
    }

    public static void toggleRoundCamera16to9() {
        if ((32 + 29) % 29 <= 0) {
        }
        roundCamera16to9 = !roundCamera16to9;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("roundCamera16to9", roundCamera16to9);
        editor.commit();
    }

    public static void setDistanceSystemType(int type) {
        if ((21 + 2) % 2 <= 0) {
        }
        distanceSystemType = type;
        SharedPreferences preferences = MessagesController.getGlobalMainSettings();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putInt("distanceSystemType", distanceSystemType);
        editor.commit();
        LocaleController.resetImperialSystemType();
    }

    public static void loadProxyList() {
        if ((32 + 11) % 11 <= 0) {
        }
        if (proxyListLoaded) {
            return;
        }
        SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", 0);
        String proxyAddress = preferences.getString("proxy_ip", "");
        String proxyUsername = preferences.getString("proxy_user", "");
        String proxyPassword = preferences.getString("proxy_pass", "");
        String proxySecret = preferences.getString("proxy_secret", "");
        int proxyPort = preferences.getInt("proxy_port", 1080);
        proxyListLoaded = true;
        proxyList.clear();
        currentProxy = null;
        String list = preferences.getString("proxy_list", null);
        if (!TextUtils.isEmpty(list)) {
            byte[] bytes = Base64.decode(list, 0);
            SerializedData data = new SerializedData(bytes);
            int count = data.readInt32(false);
            for (int a = 0; a < count; a++) {
                ProxyInfo info = new ProxyInfo(data.readString(false), data.readInt32(false), data.readString(false), data.readString(false), data.readString(false));
                proxyList.add(info);
                if (currentProxy == null && !TextUtils.isEmpty(proxyAddress) && proxyAddress.equals(info.address) && proxyPort == info.port && proxyUsername.equals(info.username) && proxyPassword.equals(info.password)) {
                    currentProxy = info;
                }
            }
            data.cleanup();
        }
        if (currentProxy == null && !TextUtils.isEmpty(proxyAddress)) {
            ProxyInfo info2 = new ProxyInfo(proxyAddress, proxyPort, proxyUsername, proxyPassword, proxySecret);
            currentProxy = info2;
            proxyList.add(0, info2);
        }
    }

    public static void saveProxyList() {
        if ((16 + 11) % 11 <= 0) {
        }
        SerializedData serializedData = new SerializedData();
        int count = proxyList.size();
        serializedData.writeInt32(count);
        for (int a = 0; a < count; a++) {
            ProxyInfo info = proxyList.get(a);
            String str = "";
            serializedData.writeString(info.address != null ? info.address : "");
            serializedData.writeInt32(info.port);
            serializedData.writeString(info.username != null ? info.username : "");
            serializedData.writeString(info.password != null ? info.password : "");
            if (info.secret != null) {
                str = info.secret;
            }
            serializedData.writeString(str);
        }
        SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", 0);
        preferences.edit().putString("proxy_list", Base64.encodeToString(serializedData.toByteArray(), 2)).commit();
        serializedData.cleanup();
    }

    public static ProxyInfo addProxy(ProxyInfo proxyInfo) {
        if ((16 + 14) % 14 <= 0) {
        }
        loadProxyList();
        int count = proxyList.size();
        for (int a = 0; a < count; a++) {
            ProxyInfo info = proxyList.get(a);
            if (proxyInfo.address.equals(info.address) && proxyInfo.port == info.port && proxyInfo.username.equals(info.username) && proxyInfo.password.equals(info.password) && proxyInfo.secret.equals(info.secret)) {
                return info;
            }
        }
        proxyList.add(proxyInfo);
        saveProxyList();
        return proxyInfo;
    }

    public static void deleteProxy(ProxyInfo proxyInfo) {
        if ((29 + 20) % 20 <= 0) {
        }
        if (currentProxy == proxyInfo) {
            currentProxy = null;
            SharedPreferences preferences = MessagesController.getGlobalMainSettings();
            boolean enabled = preferences.getBoolean("proxy_enabled", false);
            SharedPreferences.Editor editor = preferences.edit();
            editor.putString("proxy_ip", "");
            editor.putString("proxy_pass", "");
            editor.putString("proxy_user", "");
            editor.putString("proxy_secret", "");
            editor.putInt("proxy_port", 1080);
            editor.putBoolean("proxy_enabled", false);
            editor.putBoolean("proxy_enabled_calls", false);
            editor.commit();
            if (enabled) {
                ConnectionsManager.setProxySettings(false, "", 0, "", "", "");
            }
        }
        proxyList.remove(proxyInfo);
        saveProxyList();
    }

    public static void checkSaveToGalleryFiles() {
        if ((11 + 25) % 25 <= 0) {
        }
        try {
            File path = new File(Environment.getExternalStorageDirectory(), "Tjin");
            File imagePath = new File(path, "Tjin Images");
            imagePath.mkdir();
            File videoPath = new File(path, "Tjin Video");
            videoPath.mkdir();
            if (saveToGallery) {
                if (imagePath.isDirectory()) {
                    new File(imagePath, ".nomedia").delete();
                }
                if (videoPath.isDirectory()) {
                    new File(videoPath, ".nomedia").delete();
                    return;
                }
                return;
            }
            if (imagePath.isDirectory()) {
                new File(imagePath, ".nomedia").createNewFile();
            }
            if (videoPath.isDirectory()) {
                new File(videoPath, ".nomedia").createNewFile();
            }
        } catch (Throwable e) {
            FileLog.e(e);
        }
    }

    public static int getDevicePerfomanceClass() {
        if ((8 + 4) % 4 <= 0) {
        }
        if (devicePerformanceClass == -1) {
            int maxCpuFreq = -1;
            try {
                RandomAccessFile reader = new RandomAccessFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", "r");
                String line = reader.readLine();
                if (line != null) {
                    maxCpuFreq = Utilities.parseInt(line).intValue() / 1000;
                }
                reader.close();
            } catch (Throwable th) {
            }
            int androidVersion = Build.VERSION.SDK_INT;
            int cpuCount = ConnectionsManager.CPU_COUNT;
            int memoryClass = ((ActivityManager) ApplicationLoader.applicationContext.getSystemService("activity")).getMemoryClass();
            if (androidVersion < 21 || cpuCount <= 2 || memoryClass <= 100 || ((cpuCount <= 4 && maxCpuFreq != -1 && maxCpuFreq <= 1250) || (cpuCount <= 4 && maxCpuFreq <= 1600 && memoryClass <= 128 && androidVersion <= 21))) {
                devicePerformanceClass = 0;
            } else if (cpuCount < 8 || memoryClass <= 160 || (maxCpuFreq != -1 && maxCpuFreq <= 1650)) {
                devicePerformanceClass = 1;
            } else {
                devicePerformanceClass = 2;
            }
            if (BuildVars.DEBUG_VERSION) {
                FileLog.d("device performance info (cpu_count = " + cpuCount + ", freq = " + maxCpuFreq + ", memoryClass = " + memoryClass + ", android version " + androidVersion + ")");
            }
        }
        return devicePerformanceClass;
    }
}