CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05
以下内容为反编译后的 ye.java 源代码,内容仅作参考
package ak.im.sdk.manager;
import ak.application.AKApplication;
import ak.db.c;
import ak.event.NeedShowHintFromServerException;
import ak.im.BuildConfig;
import ak.im.loginDB.AppLoginDBHelper;
import ak.im.module.AKBot;
import ak.im.module.AKCDiscoverGlobal;
import ak.im.module.AKCDiscoverInstance;
import ak.im.module.AKExternalApp;
import ak.im.module.AKStrException;
import ak.im.module.AKWorkspaceApplicationCategory;
import ak.im.module.AccountInfo;
import ak.im.module.Attachment;
import ak.im.module.BaseWorkflow;
import ak.im.module.BoxInfoBean;
import ak.im.module.CAData;
import ak.im.module.ChatMessage;
import ak.im.module.ComplaintCodeTime;
import ak.im.module.CountryBean;
import ak.im.module.CtrlMessage;
import ak.im.module.EnterpriseConfig;
import ak.im.module.EnterpriseInfo;
import ak.im.module.Group;
import ak.im.module.GroupSpeakBean;
import ak.im.module.GroupUser;
import ak.im.module.LoginConfig;
import ak.im.module.OtherBoxNotice;
import ak.im.module.PrivacyConfig;
import ak.im.module.QueryModel;
import ak.im.module.ReadOnlyInfo;
import ak.im.module.ReportBean;
import ak.im.module.RequestSignUpResult;
import ak.im.module.ResetPwdData;
import ak.im.module.Role;
import ak.im.module.SecurityConfig;
import ak.im.module.Server;
import ak.im.module.ServerInfo;
import ak.im.module.ServerNetInfo;
import ak.im.module.SignUpBuilder;
import ak.im.module.UpdateBean;
import ak.im.module.User;
import ak.im.sdk.manager.ff;
import ak.im.uitls.AKCAppConfiguration;
import ak.im.utils.AkeyChatUtils;
import ak.im.utils.HttpURLTools;
import ak.im.utils.Log;
import ak.view.AKeyDialog;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.Dialog;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Process;
import android.provider.Settings;
import android.text.TextUtils;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.asim.protobuf.Akeychat;
import com.huawei.hms.framework.common.ContainerUtils;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.tencent.mmkv.MMKV;
import com.view.akcencrypt.api.AKCEncryptWrapper;
import com.view.akcsensitiveutils.AKCSensitiveUtils;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.commons.httpclient.cookie.CookieSpec;
import org.apache.http.client.cache.HeaderConstants;
import org.greenrobot.eventbus.EventBus;
import org.jetbrains.annotations.NotNull;
import org.jivesoftware.smack.AbstractXMPPConnection;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.StanzaCollector;
import org.jivesoftware.smack.filter.StanzaIdFilter;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.roster.packet.RosterVer;
import org.pjsip.pjsua2.pjsip_transport_type_e;
import org.reactivestreams.Publisher;
public class ye {
private static AppLoginDBHelper a = null;
public static volatile OtherBoxNotice f1255b = null;
public static volatile long f1256c = 0;
public static volatile boolean f1257d = false;
public static volatile int f1258e;
private boolean A;
private boolean A0;
public boolean A1;
private boolean B;
private transient int B0;
public boolean B1;
private boolean C;
private transient long C0;
public boolean C1;
private boolean D;
HashMap<String, AKExternalApp> D0;
public boolean D1;
private boolean E;
HashMap<String, AKWorkspaceApplicationCategory> E0;
private int E1;
private int F;
public boolean F0;
private String F1;
private String G;
private String G0;
private boolean G1;
private boolean H;
private String H0;
private boolean H1;
private String I;
private boolean I0;
private boolean I1;
private AtomicReference<String> J;
private boolean J0;
private boolean J1;
private boolean K;
private CAData K0;
private String K1;
private boolean L;
private RequestSignUpResult L0;
public HashMap<String, String> L1;
private boolean M;
private ResetPwdData M0;
private int M1;
private boolean N;
private String N0;
private HashMap N1;
private boolean O;
private String O0;
private boolean O1;
private boolean P;
private Akeychat.LicenseInfo P0;
private boolean P1;
private boolean Q;
private String Q0;
private int Q1;
private boolean R;
private boolean R0;
private boolean R1;
private boolean S;
private Uri S0;
private boolean S1;
private boolean T;
private boolean T0;
private boolean T1;
private boolean U;
public AccountInfo U0;
private boolean U1;
private boolean V;
private String V0;
private boolean V1;
private boolean W;
private ReadOnlyInfo W0;
boolean W1;
private Akeychat.Workspace X;
private String X0;
boolean X1;
private List<String> Y;
private String Y0;
boolean Y1;
private boolean Z;
private String Z0;
private boolean Z1;
private String a0;
private HashMap<String, String> a1;
Dialog a2;
private Akeychat.QRCodeShareInfo b0;
private int b1;
String b2;
private boolean c0;
private boolean c1;
private boolean c2;
private boolean d0;
private boolean d1;
public String d2;
private List<GroupSpeakBean> e0;
private String e1;
private long e2;
@Deprecated
private SharedPreferences f;
private HashMap<String, List<GroupSpeakBean>> f0;
public boolean f1;
private String f2;
@Deprecated
private SharedPreferences g;
private int g0;
private String[] g1;
public boolean g2;
private List<Akeychat.ServerArea> h;
private int h0;
public boolean h1;
boolean h2;
private Context i;
private float i0;
@NonNull
private ConcurrentHashMap<String, Akeychat.ServerSyncResponseV2> i1;
private int i2;
private LoginConfig j;
String j0;
@NonNull
private ConcurrentHashMap<String, Akeychat.ServerSyncResponseV2> j1;
public boolean j2;
public boolean k;
String k0;
private volatile ConcurrentHashMap<String, String> k1;
private HashMap<String, Akeychat.DesktopStatusInfo> k2;
private boolean l;
private long l0;
private String l1;
private List<Akeychat.DesktopStatusInfo> l2;
private PrivacyConfig m;
private boolean m0;
private int m1;
private boolean m2;
private EnterpriseConfig n;
private String n0;
public String n1;
private boolean n2;
private SecurityConfig o;
private byte[] o0;
public String o1;
private boolean o2;
private boolean p;
private byte[] p0;
private String p1;
private long p2;
private boolean q;
private String q0;
private List<String> q1;
private int q2;
private boolean r;
private int r0;
private HashSet<Integer> r1;
private CountryBean r2;
private String s;
String s0;
private String s1;
private ReportBean s2;
private boolean t;
ArrayList<String> t0;
String[] t1;
private String t2;
private ak.db.c u;
boolean u0;
HashSet<String> u1;
private boolean v;
long v0;
JSONArray v1;
public ak.k.a w;
private boolean w0;
HashMap<String, Long> w1;
private HashMap<String, ServerInfo> x;
private boolean x0;
public boolean x1;
private ArrayList<AccountInfo> y;
private int y0;
public ArrayList<String> y1;
public boolean z;
private int z0;
boolean z1;
public class a extends ak.j.a<Object> {
a() {
}
@Override
public void onError(Throwable th) {
th.printStackTrace();
}
@Override
public void onNext(Object obj) {
}
}
class b implements io.reactivex.s0.o<String, Object> {
final Server a;
b(Server server) {
this.a = server;
}
@Override
public Object apply(String str) throws Exception {
Server server;
try {
server = this.a;
if (server == null) {
server = ye.this.getServer();
}
} catch (Throwable th) {
th.printStackTrace();
}
if (!ye.this.D0(server.getEnterpriseId())) {
Log.i("AppConfigManager", "had upload,dont upload");
return str;
}
Log.i("AppConfigManager", "uploadBlackListToServer start");
com.google.gson.g gVar = new com.google.gson.g();
Iterator<String> it = ye.this.getBlacklist().iterator();
while (it.hasNext()) {
gVar.add(it.next());
}
if (gVar.size() == 0) {
Log.i("AppConfigManager", "no black list ,stop upload");
return str;
}
HashMap hashMap = new HashMap();
hashMap.put("license_key_blacklist", gVar.toString());
okhttp3.c0 execute = AKCDiscoverGlobal.Companion.apiCall(ye.this.getBaseURL(server), "app/sync_license_key_blacklist", 0, "POST", hashMap, false, 5L, new ArrayList(), "", ye.this.getAccessToken()).execute();
Log.i("AppConfigManager", "uploadBlackListToServer response is " + execute.toString());
if (execute.code() == 200) {
ye.this.w1.put(server.getEnterpriseId(), Long.valueOf(ye.this.u()));
ye.this.L0();
Log.i("AppConfigManager", "uploadBlackListToServer success");
}
return str;
}
}
class c implements io.reactivex.s0.o<String, Object> {
c() {
}
@Override
public Object apply(String str) throws Exception {
try {
} catch (Throwable th) {
th.printStackTrace();
Log.i("AppConfigManager", "loadBlackListFromServer failed,e is " + th.getMessage());
}
if (ye.this.getNeedUploadBlacklist().size() == 0) {
return str;
}
Log.i("AppConfigManager", "loadBlackListFromServer start");
okhttp3.c0 execute = AKCDiscoverGlobal.Companion.apiCall(ye.getCountServerURL(), "app/license/report", 0, "POST", new HashMap(), true, 5L, new ArrayList(), ye.this.v1.toString(), "").execute();
if (execute.code() != 200) {
Log.i("AppConfigManager", "uploadBlackListErrorToOSS failed,code is " + execute.code() + ",des is " + execute.message());
} else {
ye.this.v1 = new JSONArray();
ye.this.saveNeedUploadListValue();
Log.i("AppConfigManager", "uploadBlackListErrorToOSS finish");
}
return str;
}
}
public class d extends ak.j.a<Boolean> {
d() {
}
@Override
public void onError(Throwable th) {
if (AKCAppConfiguration.a.supportSurveillance()) {
AKCSensitiveUtils.a.getInstance().setCanUse(true);
}
Log.e("AppConfigManager", "UpdateReportBean is failed");
AkeyChatUtils.logException(th);
}
@Override
public void onNext(Boolean bool) {
if (AKCAppConfiguration.a.supportSurveillance()) {
AKCSensitiveUtils.a.getInstance().setCanUse(true);
}
}
}
public class e implements ak.worker.d0 {
final boolean a;
e(boolean z) {
this.a = z;
}
@Override
public void onResult(boolean z) {
if (z) {
ye.this.saveSecurityConfig();
} else if (this.a) {
ye.getInstance().loadSecurityConfig();
EventBus.getDefault().post(new ak.event.q4());
} else {
ye.this.saveSecurityConfig();
}
}
}
public class f implements Runnable {
final String a;
f(String str) {
this.a = str;
}
@Override
public void run() {
final AKeyDialog aKeyDialog = new AKeyDialog(AKApplication.getTopActivity());
aKeyDialog.setTitle(AKApplication.getAppName());
aKeyDialog.setMessage((CharSequence) this.a);
aKeyDialog.setPositiveButton(AKApplication.getTopActivity().getString(ak.im.b2.ensure), new View.OnClickListener() {
@Override
public final void onClick(View view) {
AKeyDialog.this.dismiss();
}
});
aKeyDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
AKeyDialog.this.dismiss();
}
});
aKeyDialog.show();
}
}
class g extends ak.j.a<Akeychat.CurrentTrustDeviceTypeResponse> {
g() {
}
@Override
public void onError(Throwable th) {
Log.i("AppConfigManager", "queryMasterDevice failed ,error is " + th.getMessage());
th.printStackTrace();
}
@Override
public void onNext(Akeychat.CurrentTrustDeviceTypeResponse currentTrustDeviceTypeResponse) {
if (currentTrustDeviceTypeResponse.getResult().getReturnCode() == 0) {
if (currentTrustDeviceTypeResponse.getAuthDeviceType() == Akeychat.AuthDeviceType.MainTrustDevice) {
Log.i("AppConfigManager", "current device is master device");
ye.this.F0 = true;
return;
}
Log.i("AppConfigManager", "current device is not master device");
return;
}
Log.i("AppConfigManager", "queryMasterDevice is not 0 ,error is " + currentTrustDeviceTypeResponse.getResult().getDescription());
}
}
class h extends ak.j.a<Stanza> {
h() {
}
@Override
public void onError(Throwable th) {
super.onError(th);
Log.e("AppConfigManager", "loadLicenseInfoFromServer failed try reconnect");
try {
XMPPConnectionManager.a.getInstance().reconnect(false);
} catch (Exception e2) {
Log.e("AppConfigManager", "loadLicenseInfoFromServer, reconnect failed");
AkeyChatUtils.logException(e2);
}
}
@Override
public void onNext(Stanza stanza) {
if (stanza instanceof ak.smack.v1) {
Akeychat.LicenseInfoResponse mResponse = ((ak.smack.v1) stanza).getMResponse();
ye.this.P0 = mResponse.getLicenseInfo();
ak.im.utils.j4.sendEvent(new ak.event.z2());
}
}
}
public class i implements MediaScannerConnection.OnScanCompletedListener {
i() {
}
@Override
public void onScanCompleted(String str, Uri uri) {
ye.this.S0 = uri;
ye.this.R0 = false;
Log.d("AppConfigManager", "==== insert to MediaStore.Uri: " + uri);
}
}
class j extends ak.j.a<Stanza> {
j() {
}
@Override
public void onError(Throwable th) {
th.printStackTrace();
Log.i("AppConfigManager", "queryRemoteServerStatus failed,reason is " + th.getMessage());
}
@Override
public void onNext(Stanza stanza) {
}
}
class k implements io.reactivex.s0.o<ak.smack.z4, Stanza> {
final ak.smack.z4 a;
k(ak.smack.z4 z4Var) {
this.a = z4Var;
}
@Override
public Stanza apply(@NonNull ak.smack.z4 z4Var) throws Exception {
Stanza sendIQDirectly = XMPPConnectionManager.a.getInstance().sendIQDirectly(this.a);
if (sendIQDirectly instanceof ak.smack.z4) {
Akeychat.OtherServersStatusResponse mResponse = ((ak.smack.z4) sendIQDirectly).getMResponse();
Log.i("AppConfigManager", "queryRemoteServerStatus is " + mResponse.toString());
ye.this.resetServerStatus();
List<Akeychat.ServerStatus> serverStatusListList = mResponse.getServerStatusListList();
if (serverStatusListList.size() > 0) {
for (Akeychat.ServerStatus serverStatus : serverStatusListList) {
ye.this.updateServerStatus(serverStatus.getServerId(), serverStatus.getStatus() ? "available" : "unavailable");
}
} else {
Log.w("AppConfigManager", "size is 0 check smt");
}
}
return sendIQDirectly;
}
}
class l implements io.reactivex.s0.o<BoxInfoBean, BoxInfoBean> {
l() {
}
@Override
public BoxInfoBean apply(@NonNull BoxInfoBean boxInfoBean) throws Exception {
BoxInfoBean.Server_info server_info = boxInfoBean.getServer_info();
ye.f1257d = server_info.isLicense_innerconnect_open();
ye.f1258e = server_info.getLast_connect_req_count();
Log.i("AppConfigManager", "last_connect_req_count " + ye.f1258e);
return boxInfoBean;
}
}
class m implements io.reactivex.s0.o<String, Object> {
m() {
}
@Override
public Object apply(String str) throws Exception {
try {
Log.i("AppConfigManager", "loadBlackListFromServer start");
okhttp3.c0 execute = AKCDiscoverGlobal.Companion.apiCall(ye.getCountServerURL(), "app/license/blacklist", 0, HeaderConstants.GET_METHOD, new HashMap(), false, 5L, new ArrayList()).execute();
Log.i("AppConfigManager", "resonse is " + execute.toString());
if (execute.code() != 200) {
Log.i("AppConfigManager", "loadBlackListFromServer failed,code is " + execute.code() + ",des is " + execute.message());
} else {
String readUtf8 = execute.body().source().readUtf8();
Log.i("AppConfigManager", "loadBlackListFromServer body is " + readUtf8);
if (readUtf8 != null) {
com.google.gson.l asJsonObject = com.google.gson.m.parseString(readUtf8).getAsJsonObject();
if (asJsonObject.has("data")) {
com.google.gson.g asJsonArray = asJsonObject.getAsJsonArray("data");
for (int i = 0; i < asJsonArray.size(); i++) {
ye.this.getBlacklist().add(asJsonArray.get(i).getAsString());
}
ye.this.saveBlackList();
}
Log.i("AppConfigManager", "loadBlackListFromServer finish");
} else {
Log.i("AppConfigManager", "loadBlackListFromServer body is null");
}
}
} catch (Throwable th) {
th.printStackTrace();
Log.i("AppConfigManager", "loadBlackListFromServer failed,e is " + th.getMessage());
}
return str;
}
}
public static class n {
static ye a = new ye(null);
}
@Retention(RetentionPolicy.SOURCE)
public @interface o {
}
ye(e eVar) {
this();
}
private int A() {
String w = w();
if (w == null) {
return 0;
}
if (this.r0 == -1) {
this.r0 = w.hashCode();
}
return this.r0;
}
private String A0() {
String decryptedContent;
String string = getMMKV().getString("c3a48f229e79c40c", null);
if (TextUtils.isEmpty(string)) {
String string2 = getMMKV().getString("0b8b946432f1ac91f0b07bd5f8df6587", null);
if (TextUtils.isEmpty(string2)) {
decryptedContent = getMMKV().getString("password", null);
getMMKV().putString("password", null).apply();
Log.w("AppConfigManager", "load pwd from 2.0 pre");
} else {
getMMKV().putString("0b8b946432f1ac91f0b07bd5f8df6587", null).apply();
decryptedContent = decryptedContent(string2);
Log.w("AppConfigManager", "load pwd from 2.0+");
}
return ak.comm.i.MD5Encode(decryptedContent);
}
Log.w("AppConfigManager", "md5 is not null:" + string);
return string;
}
private String B(Context context) {
int myPid = Process.myPid();
for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : ((ActivityManager) context.getSystemService(PushConstants.INTENT_ACTIVITY_NAME)).getRunningAppProcesses()) {
if (runningAppProcessInfo.pid == myPid) {
return runningAppProcessInfo.processName;
}
}
return null;
}
private String B0() {
return decryptedContent(getMMKV().getString("0a6cee4f7ecb1d0c", null));
}
private synchronized AppLoginDBHelper C() {
return a;
}
private String C0() {
return decryptedContent(getMMKV().getString("11c7fdb5492dca76", null));
}
private List<QueryModel<String, String>> D(ArrayList<String> arrayList) {
StringBuilder sb = new StringBuilder();
int size = arrayList.size();
sb.append("SELECT * FROM simple_data WHERE ");
for (int i2 = 0; i2 < size; i2++) {
sb.append("key");
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append("'");
sb.append(arrayList.get(i2));
sb.append("'");
if (i2 < size - 1) {
sb.append(" or ");
}
}
Log.i("AppConfigManager", "load configure data-sql:" + sb.toString());
return v().queryForList(new c.b() {
@Override
public final Object mapRow(Cursor cursor, int i3) {
return ye.Y(cursor, i3);
}
}, sb.toString(), null);
}
public boolean D0(String str) {
long u = u();
Long l2 = this.w1.get(str);
return l2 == null || u != l2.longValue();
}
private String E(Akeychat.WorkspaceApplication workspaceApplication) {
if (!workspaceApplication.hasType()) {
Log.w("AppConfigManager", "proto doesn't has WorkspaceApplicationType");
return "";
} else if (!TextUtils.isEmpty(workspaceApplication.getIconurl())) {
return workspaceApplication.getIconurl();
} else {
int number = workspaceApplication.getType().getNumber();
if (number != 1) {
if (number != 2) {
return number != 3 ? "" : BotManager.getSingleton().getBotAnyway(workspaceApplication.getId()).avatarKey;
}
return ChannelManager.getSingleton().getChannelAnyway(workspaceApplication.getId()).avatarKey;
}
BaseWorkflow baseWorkflowById = WorkflowManager.a.getInstance().getBaseWorkflowById(workspaceApplication.getId());
if (baseWorkflowById == null) {
Log.w("AppConfigManager", "get BaseWorkflow null");
return "";
}
return baseWorkflowById.getIconUrl();
}
}
private synchronized void E0() {
String decrypt;
LoginConfig loginConfig = new LoginConfig();
this.j = loginConfig;
boolean z = true;
this.m0 = true;
loginConfig.setUserNameVersion(2);
this.j.setLoginKey(getMMKV().getString("25924daa3e3520b2d5fd84f72ff05fbb", null));
if (!getMMKV().getBoolean("NEW_ENCR_PHONE", false) && !ak.im.g2.c.a.isFlavor("pro")) {
z = false;
}
String string = getMMKV().getString("0a6cee4f7ecb1d0c", null);
LoginConfig loginConfig2 = this.j;
if (z) {
decrypt = decryptPhone(string);
} else {
decrypt = ak.im.h2.d.decrypt(BuildConfig.PRODUCT_PKG_NAME, string);
}
loginConfig2.setPhone(decrypt);
this.j.setLoginCategory(getMMKV().getInt("4eef1db24e30556f9efc3673b4535ba8", ak.im.g2.c.a.getDefaultLoginCategory()));
this.j.setCountryCode(getMMKV().getString("60f3e77a22b1fcc3103835127f2f4f4f", ak.im.o1.get().getString(ak.im.b2.local_area_code)));
Server loads = Server.loads(C().getString("c3efa684ec28a6ccfc9ca0a1f855c479", null));
String string2 = getMMKV().getString("11c7fdb5492dca76", null);
Log.i("AppConfigManager", "load newName is " + string2);
if (!TextUtils.isEmpty(string2)) {
this.j.setUsername(string2);
this.j.setUserNameVersion(2);
}
this.j.setServer(loads);
String w = w();
String string3 = getMMKV().getString("asim_app_uuid", null);
Log.i("AppConfigManager", "check saved id:" + string3 + ",current device id:" + w);
this.j.setPassword(getMMKV().getString("c3a48f229e79c40c", null));
this.j.setEncryptedPassword(getMMKV().getString("021381e7b0d5bb75", null));
this.j.setUuid(w);
this.j.setCollect_log(getMMKV().getString(CtrlMessage.COLLECT_LOG, null));
this.j.setReSendCollectLogNotice(getMMKV().getString("resend_collect_log_notice", null));
this.j.setComplete(false);
this.j.setToken(getMMKV().getBoolean("is_login_by_token", false));
}
private String F(Akeychat.WorkspaceApplication workspaceApplication) {
if (!workspaceApplication.hasType()) {
Log.w("AppConfigManager", "proto doesn't has WorkspaceApplicationType");
return "";
} else if (!TextUtils.isEmpty(workspaceApplication.getName())) {
return workspaceApplication.getName();
} else {
int number = workspaceApplication.getType().getNumber();
if (number != 1) {
if (number != 2) {
return number != 3 ? "" : BotManager.getSingleton().getBotAnyway(workspaceApplication.getId()).name;
}
return ChannelManager.getSingleton().getChannelAnyway(workspaceApplication.getId()).name;
}
BaseWorkflow baseWorkflowById = WorkflowManager.a.getInstance().getBaseWorkflowById(workspaceApplication.getId());
if (baseWorkflowById == null) {
Log.w("AppConfigManager", "get BaseWorkflow null");
return "";
}
return baseWorkflowById.getName();
}
}
@SuppressLint({"CheckResult"})
private void F0() {
this.n = new EnterpriseConfig();
HashMap<String, String> x = x();
HashMap hashMap = new HashMap(x.size());
Log.e("AppConfigManager", "enterprise mmkv size is " + x.size());
for (Map.Entry<String, String> entry : x.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
Log.i("AppConfigManager", "current enterprise data is " + key + " " + value);
hashMap.put(key, value);
}
this.n.loadEnterprise(hashMap, getServer());
if (this.m0) {
return;
}
io.reactivex.z.timer(0L, TimeUnit.MILLISECONDS, io.reactivex.w0.a.io()).subscribe(new io.reactivex.s0.g() {
@Override
public final void accept(Object obj) {
ye.this.g0((Long) obj);
}
});
}
private void G() {
String trim;
EnterpriseInfo parseEnterpriseInfo;
if (this.y.size() == 0) {
String string = getMMKV().getString(BuildConfig.PRODUCT_PKG_NAME, "");
if (!TextUtils.isEmpty(string)) {
try {
try {
JSONArray parseArray = JSON.parseArray(string);
Log.i("AppConfigManager", "***" + parseArray.toJSONString());
List javaList = parseArray.toJavaList(AccountInfo.class);
String string2 = getMMKV().getString("account_uid", "");
AccountInfo accountInfo = null;
for (int i2 = 0; i2 < javaList.size(); i2++) {
AccountInfo accountInfo2 = (AccountInfo) javaList.get(i2);
if (accountInfo2.getEnterpriseInfo() == null && (parseEnterpriseInfo = parseEnterpriseInfo(accountInfo2.getEnt(), accountInfo2.getEnt().getXmppDomain())) != null) {
if (!TextUtils.isEmpty(accountInfo2.getDiscoverServerIp())) {
parseEnterpriseInfo.discoverServerIP = accountInfo2.getDiscoverServerIp();
if (accountInfo2.getDiscoverServerIp().contains(":")) {
parseEnterpriseInfo.discoverServerPort = "";
} else {
parseEnterpriseInfo.discoverServerPort = "30149";
}
accountInfo2.setEnterpriseInfo(parseEnterpriseInfo);
} else if (!TextUtils.isEmpty(parseEnterpriseInfo.enterpriseID)) {
accountInfo2.setEnterpriseInfo(this.n.getmEnterpriseMap().get(parseEnterpriseInfo.enterpriseID));
}
}
if (accountInfo2.getEnterpriseInfo() == null || TextUtils.isEmpty(accountInfo2.getEnterpriseInfo().discoverServerIP)) {
Log.i("AppConfigManager", "drop the account is base " + accountInfo2);
} else if (AkeyChatUtils.needClearLoginTypeForCustomized(accountInfo2.getLoginType())) {
Log.i("AppConfigManager", "isCustomizedVersion drop account ," + accountInfo2.getLoginType());
} else {
this.y.add(accountInfo2);
if (!TextUtils.isEmpty(accountInfo2.getUnitId()) && accountInfo2.getUnitId().equals(string2)) {
this.d0 = getMMKV().getBoolean("is_chosen_login", false);
getMMKV().putBoolean("is_chosen_login", false);
Log.i("AppConfigManager", "selected account is " + string2);
accountInfo = accountInfo2;
}
}
if (TextUtils.isEmpty(accountInfo2.getServerId())) {
String userInput = accountInfo2.getEnt().getUserInput();
Log.i("lwxid", "account input is " + userInput);
if (TextUtils.isEmpty(userInput)) {
trim = accountInfo2.getEnterpriseInfo().discoverServerIP;
} else {
trim = userInput.trim();
}
accountInfo2.setServerId(trim);
}
Log.i("lwxid", "account id is " + accountInfo2.getServerId());
}
if (accountInfo != null) {
Log.i("lwxcode", "chosenAccount code is " + accountInfo.getCountryCode());
N0(accountInfo);
}
} catch (Exception e2) {
Log.e("AppConfigManager", "get account failed ,error is " + e2.getMessage());
e2.printStackTrace();
}
} finally {
getMMKV().putString("account_uid", "");
}
}
}
System.currentTimeMillis();
if (this.w == null) {
this.w = new ak.k.a();
}
}
private void G0(String str) {
getMMKV().putString("60f3e77a22b1fcc3103835127f2f4f4f", r(str)).commit();
}
private synchronized void H() {
String string;
Server loads;
this.j = new LoginConfig();
if (getMMKV().getLong("b9810d5fec350b9ff10671205aaa63b6", -1L) > 0) {
this.m0 = true;
string = z0();
Log.i("AppConfigManager", "load uname is " + string);
this.j.setUsername(string);
this.j.setUserNameVersion(2);
this.j.setOldUserName(string);
this.j.setLoginKey(y0());
this.j.setPhone(B0());
this.j.setLoginCategory(getMMKV().getInt("4eef1db24e30556f9efc3673b4535ba8", ak.im.g2.c.a.getDefaultLoginCategory()));
this.j.setCountryCode(x0());
loads = Server.loads(decryptedContent(C().getString("c3efa684ec28a6ccfc9ca0a1f855c479", null)));
} else {
string = getMMKV().getString(GroupUser.USER_NAME, null);
Log.i("AppConfigManager", "load nuname is " + string);
this.j.setUsername(string);
this.j.setOldUserName(string);
this.j.setLoginKey(getMMKV().getString("login_key", null));
this.j.setLoginCategory(getMMKV().getInt("login_category", ak.im.g2.c.a.getDefaultLoginCategory()));
this.j.setCountryCode(getMMKV().getString("countrycode", ak.im.o1.get().getString(ak.im.b2.local_area_code)));
loads = Server.loads(C().getString("simple_data_server_info_key", null));
}
String C0 = C0();
Log.i("AppConfigManager", "load newName is " + C0);
if (!TextUtils.isEmpty(C0)) {
this.j.setUsername(C0);
this.j.setUserNameVersion(2);
}
if (!TextUtils.isEmpty(string) && TextUtils.isEmpty(this.j.getPhone())) {
savePhone(string.substring(1));
}
this.j.setServer(loads);
String w = w();
String string2 = getMMKV().getString("asim_app_uuid", null);
Log.i("AppConfigManager", "check saved id:" + string2 + ",current device id:" + w);
if (w.equals(string2) && !TextUtils.isEmpty(string2)) {
this.j.setPassword(A0());
this.j.setEncryptedPassword(getMMKV().getString("021381e7b0d5bb75", null));
} else {
this.j.setPassword(null);
this.j.setEncryptedPassword(null);
}
this.j.setUuid(w);
this.j.setCollect_log(getMMKV().getString(CtrlMessage.COLLECT_LOG, null));
this.j.setReSendCollectLogNotice(getMMKV().getString("resend_collect_log_notice", null));
this.j.setComplete(false);
this.j.setToken(getMMKV().getBoolean("is_login_by_token", false));
}
private void H0(String str) {
getMMKV().putString("021381e7b0d5bb75", str).commit();
}
private void I() {
this.Q1 = getMMKV().getInt("showSipNotifyTimes", 0);
this.P1 = getMMKV().getBoolean("hadClosedSipNotifyTips", false);
this.R1 = getMMKV().getBoolean("hadGotoNotifyWeb", false);
this.V1 = getMMKV().getBoolean("sipMessageSwitch", true);
this.U1 = getMMKV().getBoolean("normalMessageSwitch", true);
this.W1 = getMMKV().getBoolean("openForeground", false);
this.T1 = getMMKV().getBoolean("hadGotoNotifyWebForNormal", false);
this.S1 = getMMKV().getBoolean("hadGotoNotifyWebForSip", false);
this.m2 = getMMKV().getBoolean("ignore_can_leave", false);
this.n2 = getMMKV().getBoolean("is_feedback_login", false);
this.p2 = getMMKV().getLong("feedback_global_clear_time", 0L);
this.q2 = getMMKV().getInt("currentFeedbackCode", 0);
}
private void I0(String str) {
getMMKV().putString("25924daa3e3520b2d5fd84f72ff05fbb", r(str)).commit();
}
private void J0(String str) {
getMMKV().putString("11c7fdb5492dca76", r(str)).commit();
}
private void K0(String str, String str2, String str3, String str4) {
CAData cAData = this.K0;
if (cAData == null) {
this.K0 = new CAData(str, str2, str3, str4);
return;
}
cAData.setName(str);
this.K0.setPhone(str2);
this.K0.setId(str3);
this.K0.setPin(str4);
}
public void L0() {
JSONObject jSONObject = new JSONObject();
for (String str : this.w1.keySet()) {
jSONObject.put(str, (Object) this.w1.get(str));
}
C().putString("need_upload_black_list", jSONObject.toJSONString());
}
private synchronized void N0(AccountInfo accountInfo) {
setPwdSaveValidDate(accountInfo.getSavePwdTag());
setAccountPwdTagWithData(accountInfo);
this.j.setServer(accountInfo.getEnt());
this.j.setUsername(accountInfo.getUnitId());
this.j.setPassword(accountInfo.getPwd());
if (accountInfo.isUserPhone()) {
this.j.setLoginCategory(1);
savePhone(accountInfo.getPhone());
} else {
this.j.setLoginCategory(2);
}
if (accountInfo.getLoginType() >= 0) {
this.j.setLoginCategory(accountInfo.getLoginType());
}
this.j.setLoginKey(accountInfo.getPhone());
this.n.addOneEnterpriseInfo(accountInfo.getEnterpriseInfo());
this.n.setCurrentEnterprise(accountInfo.getEnterpriseInfo());
this.n.getCurrentEnterpriseInfo().chooseTimestamp = System.currentTimeMillis();
if (!TextUtils.isEmpty(accountInfo.getCountryCode())) {
setCountryCode(accountInfo.getCountryCode());
}
setOneKeyLogin(accountInfo.isOneKeyLogin());
saveLoginConfig();
saveEnterpriseConfig();
setServerId(accountInfo.getServerId());
}
private void O0(String str) {
this.Q0 = str;
}
public static void P(String str, io.reactivex.b0 b0Var) throws Exception {
Server loads = Server.loads(str);
if (loads != null && loads.isEffective()) {
b0Var.onNext(loads);
b0Var.onComplete();
return;
}
b0Var.onError(new NeedShowHintFromServerException(ak.im.o1.get().getString(ak.im.b2.login_failed_hint_7), true));
}
private void P0(boolean z) {
getInstance().uploadSecurityConfig(new e(z), "appLock");
}
public static ResetPwdData T(ResetPwdData resetPwdData, String str, ResetPwdData resetPwdData2) throws Exception {
resetPwdData2.setReqId(resetPwdData.getReqId());
resetPwdData2.setPhone(str);
return resetPwdData2;
}
public Publisher V(final String str, Integer num, final ResetPwdData resetPwdData) throws Exception {
if (resetPwdData.getReturnCode() == 0) {
return getSMSCodeBeforeResetPwd(str, resetPwdData.getReqId(), num).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
ResetPwdData resetPwdData2 = (ResetPwdData) obj;
ye.T(ResetPwdData.this, str, resetPwdData2);
return resetPwdData2;
}
});
}
return io.reactivex.j.just(resetPwdData);
}
public static QueryModel W(Cursor cursor, int i2) {
QueryModel queryModel = new QueryModel();
if (cursor != null) {
String string = cursor.getString(cursor.getColumnIndex("key"));
String string2 = cursor.getString(cursor.getColumnIndex("value"));
queryModel.setKey(string);
queryModel.setValue(string2);
Log.i("AppConfigManager", "we get sync info,type:" + string + ",ver_code:" + string2);
}
return queryModel;
}
public static QueryModel X(Cursor cursor, int i2) {
QueryModel queryModel = new QueryModel();
if (cursor != null) {
String string = cursor.getString(cursor.getColumnIndex("key"));
String string2 = cursor.getString(cursor.getColumnIndex("value"));
queryModel.setKey(string);
queryModel.setValue(string2);
Log.i("AppConfigManager", "we get sync info,type:" + string + ",ver_code:" + string2);
}
return queryModel;
}
public static QueryModel Y(Cursor cursor, int i2) {
QueryModel queryModel = new QueryModel();
if (cursor != null) {
String string = cursor.getString(cursor.getColumnIndex("key"));
String string2 = cursor.getString(cursor.getColumnIndex("value"));
queryModel.setKey(string);
queryModel.setValue(string2);
Log.i("AppConfigManager", "1we get sync info,key:" + string + ",value:" + string2);
}
return queryModel;
}
public void b0(Long l2) throws Exception {
saveEnterpriseConfig();
}
public static void bubbleSort(List<Akeychat.DesktopStatusInfo> list) {
int size = list.size();
for (int i2 = 0; i2 < size - 1; i2++) {
int i3 = 0;
while (i3 < (size - i2) - 1) {
int i4 = i3 + 1;
if (list.get(i3).getLoginTime() < list.get(i4).getLoginTime()) {
list.set(i3, list.get(i4));
list.set(i4, list.get(i3));
}
i3 = i4;
}
}
}
public static Stanza c0(Stanza stanza) throws Exception {
return stanza;
}
public Akeychat.ServerSyncResponseV2 e0(Cursor cursor, int i2) {
try {
Akeychat.ServerSyncResponseV2 parseFrom = Akeychat.ServerSyncResponseV2.parseFrom(ak.comm.d.decode(cursor.getString(cursor.getColumnIndex("data"))));
addServerIntoRAM(parseFrom);
return parseFrom;
} catch (IOException e2) {
e2.printStackTrace();
return null;
}
}
public void g0(Long l2) throws Exception {
saveEnterpriseConfig();
}
private void g(AKWorkspaceApplicationCategory aKWorkspaceApplicationCategory, AKExternalApp aKExternalApp) {
if (aKWorkspaceApplicationCategory != null && aKExternalApp != null) {
aKWorkspaceApplicationCategory.getApps().add(aKExternalApp);
return;
}
Log.w("AppConfigManager", "category or app is null:" + aKExternalApp);
}
public static String getCountServerURL() {
return "https://" + AKCAppConfiguration.a.stats() + CookieSpec.PATH_DELIM;
}
public static ye getInstance() {
return n.a;
}
public static void goToSetting(Context context) {
context.startActivity(new Intent("android.settings.SETTINGS"));
}
private synchronized void h(AKExternalApp aKExternalApp) {
if (this.D0 == null) {
this.D0 = new LinkedHashMap();
}
this.D0.put(aKExternalApp.getId(), aKExternalApp);
}
private synchronized void i(AKWorkspaceApplicationCategory aKWorkspaceApplicationCategory) {
if (this.E0 == null) {
this.E0 = new LinkedHashMap();
}
this.E0.put(Long.toString(aKWorkspaceApplicationCategory.getId()), aKWorkspaceApplicationCategory);
}
public static void i0(Stanza stanza, io.reactivex.b0 b0Var) throws Exception {
if (stanza instanceof ak.smack.n3) {
b0Var.onNext(((ak.smack.n3) stanza).getMResponse());
b0Var.onComplete();
return;
}
b0Var.onError(new AKStrException("other-error"));
}
public static boolean isAsim() {
return ak.im.g2.c.a.isFlavor("ansimixin") || ak.im.g2.c.a.isFlavor("enterprise");
}
public static boolean isNeedHideCustomServiceUI() {
return true;
}
public static boolean isSupportBot() {
if (!getInstance().k()) {
Log.w("AppConfigManager", "b info is invalidity");
return false;
}
return getInstance().z().getSwitch().getBotSwitch();
}
public static boolean isSupportChannel() {
if (!getInstance().k()) {
Log.w("AppConfigManager", "c info is invalidity");
return false;
}
return getInstance().z().getSwitch().getChannelSwitch();
}
public static boolean isSupportPush() {
Server server = getInstance().getServer();
if (server == null) {
return false;
}
return server.isSupportPushMsg();
}
public static boolean isSupportRegisterUser() {
Server server = getInstance().getServer();
if (server == null) {
return false;
}
return server.isSupportRegisterUser();
}
public static boolean isSupportSmsService() {
Server server = getInstance().getServer();
return server != null && server.isSupportSmsMsg();
}
private void j(String str) {
new Handler(Looper.getMainLooper()).post(new f(str));
}
private boolean k() {
if (z() == null) {
return false;
}
return z().hasSwitch();
}
public ArrayList l0(Context context, boolean z, Akeychat.ExternalApplicationsResponse externalApplicationsResponse) throws Exception {
List<Akeychat.ExternalAppTypeWithApps> externalAppTypeWithAppsList = externalApplicationsResponse.getExternalAppTypeWithAppsList();
HashMap<String, AKExternalApp> hashMap = this.D0;
if (hashMap != null) {
hashMap.clear();
}
HashMap<String, AKWorkspaceApplicationCategory> hashMap2 = this.E0;
if (hashMap2 != null) {
hashMap2.clear();
}
ArrayList arrayList = new ArrayList();
if (externalAppTypeWithAppsList != null) {
boolean isSupportWorkflowWithOA = isSupportWorkflowWithOA();
if (isSupportWorkflowWithOA) {
WorkflowManager.a.getInstance().loadWorkflowData(context, z);
}
for (Akeychat.ExternalAppTypeWithApps externalAppTypeWithApps : externalAppTypeWithAppsList) {
AKWorkspaceApplicationCategory t = t(externalAppTypeWithApps);
t.getApps().clear();
for (Akeychat.WorkspaceApplication workspaceApplication : externalAppTypeWithApps.getWorkspaceApplicationsList()) {
if (workspaceApplication.getExternalApplicationPlatform() == Akeychat.ExternalApplicationPlatform.DesktopPlatform) {
Log.w("AppConfigManager", "desk top app do not add into local");
} else if (Akeychat.WorkspaceApplicationType.WorkflowApplication == workspaceApplication.getType()) {
if (isSupportWorkflowWithOA) {
BaseWorkflow baseWorkflowById = WorkflowManager.a.getInstance().getBaseWorkflowById(workspaceApplication.getId());
if (baseWorkflowById != null && baseWorkflowById.isDocApprovalAndSignature() && !isSupportApprovalAndSignature()) {
Log.w("AppConfigManager", "not support for:" + baseWorkflowById.getName());
}
s(workspaceApplication, t);
}
} else if (Akeychat.WorkspaceApplicationType.BotApplication == workspaceApplication.getType()) {
if (isSupportBot()) {
s(workspaceApplication, t);
}
} else {
if (Akeychat.WorkspaceApplicationType.ChannelApplication == workspaceApplication.getType() && !isSupportChannel()) {
}
s(workspaceApplication, t);
}
}
arrayList.add(t);
}
}
return arrayList;
}
private void l() {
if (AkeyChatUtils.needClearLoginTypeForCustomized(this.j.getLoginCategory())) {
this.j.setLoginKey("");
this.j.setPhone("");
this.j.setPassword("");
this.j.setCountryCode("");
this.j.setLoginCategory(2);
}
}
private synchronized void m() {
if (!AKApplication.isAppHadLogin()) {
Log.w("AppConfigManager", "enterprise version clear app server address.");
C().putString("c3efa684ec28a6ccfc9ca0a1f855c479", "");
}
}
public io.reactivex.e0 n0(Context context, ArrayList arrayList) throws Exception {
if (!isSupportWorkflowWithOA()) {
return io.reactivex.z.just(arrayList);
}
ArrayList<AKWorkspaceApplicationCategory> approvalManageList = WorkflowManager.a.getInstance().approvalManageList(context);
approvalManageList.addAll(arrayList);
return io.reactivex.z.just(approvalManageList);
}
private synchronized void n() {
m();
}
private static boolean o(List<Integer> list, Integer num) {
double d2;
int i2 = 1;
while (true) {
if (i2 < Math.pow(2.0d, list.size()) - 1.0d) {
new HashSet();
Integer num2 = 0;
for (int i3 = 0; i3 < list.size(); i3++) {
if ((((int) Math.pow(2.0d, d2)) & i2) == Math.pow(2.0d, i3)) {
num2 = Integer.valueOf(num2.intValue() + list.get(i3).intValue());
}
}
if (num2.equals(num)) {
return true;
}
i2++;
} else {
Integer num3 = 0;
for (Integer num4 : list) {
num3 = Integer.valueOf(num3.intValue() + num4.intValue());
}
return num3.equals(num);
}
}
}
private String p(String str, String str2, String str3) {
try {
return ak.im.h2.b.decrypt(new String(HttpURLTools.getBytesFromHttpsUrl(str, 10000, null, null)), AKeyManager.getInstance().getSensitiveKey(str2), AKeyManager.getInstance().getSensitiveVi(str3));
} catch (Exception unused) {
return null;
}
}
private void q(String str) {
if (Server.CLOUD_SERVICE_SEEWEED.equals(getServer().getCloudFS()) && !TextUtils.isEmpty(str)) {
String str2 = ak.im.utils.l4.getAKCachePath(this.i) + ak.comm.i.MD5Encode(str);
if (ak.im.utils.l4.isFileExist(str2)) {
return;
}
Log.i("AppConfigManager", "start download startupPageUrl");
ak.im.utils.m4.saveFile(HttpURLTools.getBytesFromHttpsUrl(str, AKCDiscoverGlobal.AKCDiscoverError_BNOffline, getAccessToken(), null), str2);
}
}
public static Server q0(Server server) throws Exception {
getInstance().setAndSaveServerInfo(server);
return server;
}
private String r(String str) {
return str;
}
private AKExternalApp s(Akeychat.WorkspaceApplication workspaceApplication, AKWorkspaceApplicationCategory aKWorkspaceApplicationCategory) {
if (workspaceApplication == null) {
Log.w("AppConfigManager", "null proto data do not generate ak external app");
return null;
}
String id = workspaceApplication.getId();
String F = F(workspaceApplication);
String description = workspaceApplication.getDescription();
String name = workspaceApplication.getExternalApplicationPlatform().name();
AKExternalApp aKExternalApp = new AKExternalApp(id, workspaceApplication.getType().getNumber(), F, workspaceApplication.getAppurl(), description, name, E(workspaceApplication), Long.valueOf(workspaceApplication.getPriority()).longValue());
h(aKExternalApp);
if (workspaceApplication.hasType() && workspaceApplication.getType() == Akeychat.WorkspaceApplicationType.WorkflowApplication) {
aKExternalApp.setWorkflowlType(id);
}
g(aKWorkspaceApplicationCategory, aKExternalApp);
return aKExternalApp;
}
public Boolean t0(ReportBean reportBean) throws Exception {
boolean z;
ReportBean.markTagAndReport markTagAndReport = reportBean.getMarkTagAndReport();
if (TextUtils.isEmpty(markTagAndReport.getReportWord())) {
String reportMgcFromUrl = markTagAndReport.getReportMgcFromUrl();
AKCAppConfiguration aKCAppConfiguration = AKCAppConfiguration.a;
String p = p(reportMgcFromUrl, aKCAppConfiguration.getSurveillanceKey1(), aKCAppConfiguration.getSurveillanceIv1());
if (!TextUtils.isEmpty(p)) {
markTagAndReport.setReportWord(p);
z = true;
if (!TextUtils.isEmpty(markTagAndReport.getReportWord()) && AKCAppConfiguration.a.supportSurveillance()) {
AKCSensitiveUtils.a.getInstance().configSensitiveWords("unset", "unset", 1, markTagAndReport.getReportWord());
}
if (z) {
updateSimpleData("simple_report_bean", JSON.toJSONString(reportBean));
}
return Boolean.valueOf(z);
}
}
z = false;
if (!TextUtils.isEmpty(markTagAndReport.getReportWord())) {
AKCSensitiveUtils.a.getInstance().configSensitiveWords("unset", "unset", 1, markTagAndReport.getReportWord());
}
if (z) {
}
return Boolean.valueOf(z);
}
private AKWorkspaceApplicationCategory t(Akeychat.ExternalAppTypeWithApps externalAppTypeWithApps) {
if (externalAppTypeWithApps == null) {
Log.w("AppConfigManager", "null proto data do not generate ak WorkspaceApplication app");
return null;
}
Long valueOf = Long.valueOf(externalAppTypeWithApps.getId());
String name = externalAppTypeWithApps.getName();
Long valueOf2 = Long.valueOf(externalAppTypeWithApps.getPriority());
AKWorkspaceApplicationCategory y = y(valueOf.longValue());
if (y == null) {
AKWorkspaceApplicationCategory aKWorkspaceApplicationCategory = new AKWorkspaceApplicationCategory(valueOf.longValue(), name, valueOf2.longValue());
i(aKWorkspaceApplicationCategory);
return aKWorkspaceApplicationCategory;
}
y.setName(name);
y.setPriority(valueOf2.longValue());
return y;
}
public long u() {
Iterator<String> it = getBlacklist().iterator();
long j2 = 0;
while (it.hasNext()) {
j2 += it.next().hashCode();
}
return j2;
}
private Long u0(int i2, Long l2) throws Exception {
setPwdSaveValidDate(i2);
if (i2 == 0) {
clearPwdInSharedPref();
}
C().putInt("123sdffds", i2);
if (i2 > 0) {
setPwdSetDate(ak.im.utils.f4.getRightTime());
C().putLong("1AD-23-S12", this.C0);
}
return l2;
}
private ak.db.c v() {
if (this.u == null) {
Log.w("AppConfigManager", "db helper is null get it from database-helper");
this.u = ak.db.c.getDataBaseHelper();
}
return this.u;
}
private String w() {
if (!TextUtils.isEmpty(this.q0)) {
return this.q0;
}
if (ContextCompat.checkSelfPermission(this.i, Build.VERSION.SDK_INT >= 33 ? "android.permission.READ_MEDIA_IMAGES" : "android.permission.READ_EXTERNAL_STORAGE") == 0) {
Log.i("AppConfigManager", "current have read permission,try restore device info");
restoreDeInfo();
if (!TextUtils.isEmpty(this.q0)) {
return this.q0;
}
}
UUID.randomUUID();
String string = Settings.Secure.getString(this.i.getContentResolver(), "android_id");
Log.e("lwx", "androidId is " + string);
try {
if (!"9774d56d682e549c".equals(string)) {
String uuid = UUID.nameUUIDFromBytes(string.getBytes("UTF-8")).toString();
this.q0 = uuid;
return uuid;
}
Log.w("AppConfigManager", "permission denied");
String uuid2 = UUID.nameUUIDFromBytes(string.getBytes("UTF-8")).toString();
this.q0 = uuid2;
return uuid2;
} catch (UnsupportedEncodingException e2) {
throw new RuntimeException(e2);
}
}
@SuppressLint({"CheckResult"})
private void w0() {
this.n = new EnterpriseConfig();
HashMap<String, String> x = x();
HashMap hashMap = new HashMap(x.size());
Log.e("AppConfigManager", "enterprise mmkv size is " + x.size());
for (Map.Entry<String, String> entry : x.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
Log.i("AppConfigManager", "current enterprise data is " + key + " " + value);
if (this.m0) {
key = decryptedContent(key);
value = decryptedContent(value);
}
hashMap.put(key, value);
}
this.n.loadEnterprise(hashMap, getServer());
if (this.m0) {
return;
}
io.reactivex.z.timer(0L, TimeUnit.MILLISECONDS, io.reactivex.w0.a.io()).subscribe(new io.reactivex.s0.g() {
@Override
public final void accept(Object obj) {
ye.this.b0((Long) obj);
}
});
}
private synchronized HashMap<String, String> x() {
return a.getAllEnterpriseMap();
}
private String x0() {
return decryptedContent(getMMKV().getString("60f3e77a22b1fcc3103835127f2f4f4f", r(ak.im.o1.get().getString(ak.im.b2.local_area_code))));
}
private synchronized AKWorkspaceApplicationCategory y(long j2) {
HashMap<String, AKWorkspaceApplicationCategory> hashMap = this.E0;
if (hashMap == null) {
return null;
}
return hashMap.get(Long.toString(j2));
}
private String y0() {
return decryptedContent(getMMKV().getString("25924daa3e3520b2d5fd84f72ff05fbb", null));
}
private Akeychat.LicenseInfo z() {
return this.P0;
}
@Deprecated
private String z0() {
return decryptedContent(getMMKV().getString("bd72f1cbb51e0a5488579f42c4dd7eb3", null));
}
public io.reactivex.z<Akeychat.CancelUserApplyCancelResponse> CancelCancelUser() {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.r()).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.CancelUserApplyCancelResponse cancelUserApplyCancelResponse;
cancelUserApplyCancelResponse = ((ak.smack.r) ((Stanza) obj)).getmResponse();
return cancelUserApplyCancelResponse;
}
});
}
public boolean CheckGroupSpeakBeans(GroupSpeakBean groupSpeakBean, boolean z, boolean z2) {
Group groupBySimpleName = df.getInstance().getGroupBySimpleName(df.getInstance().getSimpleNameByGroupname(groupSpeakBean.getGroupName()));
if (groupBySimpleName == null) {
Log.i("CheckGroupSpeakBeans", "group is null " + groupSpeakBean.getGroupName());
return true;
}
int i2 = -1;
if (groupBySimpleName.getSpeakFrenquency() == 0) {
Role userMeRole = jf.getInstance().getUserMeRole();
if (userMeRole == null) {
Log.i("CheckGroupSpeakBeans", "my role is null");
return true;
}
if (userMeRole.isAllow_role_send_message_limit()) {
try {
i2 = Integer.valueOf(userMeRole.getRole_send_message_limit()).intValue();
} catch (Exception e2) {
Log.e("AppConfigManager", "CheckGroupSpeakBeans error is " + e2.getMessage());
}
}
if (i2 < 0) {
Log.i("CheckGroupSpeakBeans", "group is no speakFrenquency ");
this.f0.remove(groupSpeakBean.getGroupName());
return true;
}
}
if (groupBySimpleName.getSpeakFrenquency() == 3) {
Log.i("CheckGroupSpeakBeans", "group is no limit " + groupSpeakBean.getGroupName());
return true;
} else if (groupBySimpleName.getSpeakFrenquency() != 0 && groupBySimpleName.isOwnerOrManager(nf.getInstance().getUserMe().getJID())) {
Log.i("CheckGroupSpeakBeans", "group is manager " + groupSpeakBean.getGroupName());
return true;
} else {
if (z && !this.f0.containsKey(groupSpeakBean.getGroupName())) {
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add(SessionManager.getInstance().getAKSession(groupSpeakBean.getGroupName()).getSessionId());
queryGroupFrequency(arrayList);
}
if (i2 < 0 || groupBySimpleName.getSpeakFrenquency() != 0) {
i2 = groupBySimpleName.getSpeakFrenquency() == 1 ? 10 : 5;
}
Log.i("CheckGroupSpeakBeans", "group is " + groupBySimpleName.getName() + " ,time is " + i2 + ",bean group name is " + groupSpeakBean.getGroupName());
if (this.f0.containsKey(groupSpeakBean.getGroupName())) {
List<GroupSpeakBean> list = this.f0.get(groupSpeakBean.getGroupName());
if (list != null && list.size() > 0) {
Log.i("AppConfigManager", "CheckGroupSpeakBeans groupSpeakBeans size is " + list.size() + ",limitedSize is " + i2);
boolean z3 = false;
if (list.get(0).getTime().equals(groupSpeakBean.getTime())) {
if (list.size() >= i2 && z) {
return false;
}
if (!z) {
Iterator<GroupSpeakBean> it = list.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
GroupSpeakBean next = it.next();
if (groupSpeakBean.getMessageUid().equals(next.getMessageUid())) {
groupSpeakBean = next;
z3 = true;
break;
}
}
if (z3) {
list.remove(groupSpeakBean);
}
}
} else {
Log.i("AppConfigManager", "CheckGroupSpeakBeans bean time is " + groupSpeakBean.getTime());
list.clear();
}
}
if (z2) {
list.add(groupSpeakBean);
}
}
return true;
}
}
public synchronized void M0() {
Server server = this.j.getServer();
if (server != null) {
Log.d("AppConfigManager", "lwx server id is:" + server.getEnterpriseId());
Log.d("AppConfigManager", server.getUserInput() + " lwx server type is:" + server.getProductType());
C().putString("c3efa684ec28a6ccfc9ca0a1f855c479", r(server.getSeverData()));
}
}
public String NetErrorHintWeb() {
return (this.F1.length() <= 0 || !new File(this.F1).exists()) ? "file:///android_asset/netcheckpage.html" : this.F1;
}
public io.reactivex.z<Stanza> QueryCancelUser() {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.f3());
}
public io.reactivex.z<Akeychat.CancelUserSmscodeResponse> QueryCancleUserSms() {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.g3()).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.CancelUserSmscodeResponse cancelUserSmscodeResponse;
cancelUserSmscodeResponse = ((ak.smack.g3) ((Stanza) obj)).getmResponse();
return cancelUserSmscodeResponse;
}
});
}
public void addAccount(AccountInfo accountInfo) {
if (TextUtils.isEmpty(accountInfo.getUnitId().trim())) {
return;
}
int i2 = -1;
for (int i3 = 0; i3 < this.y.size(); i3++) {
AccountInfo accountInfo2 = this.y.get(i3);
if (accountInfo.getUnitId().equals(accountInfo2.getUnitId()) || (accountInfo2.getEnt().getEnterpriseId().equals(accountInfo.getEnt().getEnterpriseId()) && accountInfo2.getPhone().equals(accountInfo.getPhone()))) {
i2 = i3;
break;
}
}
if (i2 >= 0) {
this.y.remove(i2);
}
if (accountInfo.getSavePwdTag() == 0) {
accountInfo.setPwd("");
}
this.y.add(0, accountInfo);
}
public void addCurrentLoginAccount() {
AKCDiscoverInstance queryDiscoverInstanceBy;
User userMe = nf.getInstance().getUserMe();
LoginConfig loginConfig = getmLoginCfg();
if (TextUtils.isEmpty(getLoginKey())) {
Log.i("AppConfigManager", "loginKey is empty");
if (getLoginCategory() != 2 && !TextUtils.isEmpty(getPhone())) {
Log.i("AppConfigManager", "loginKey is empty,use phone");
setLoginKey(getPhone());
saveLoginKeyAndCategory();
}
}
EnterpriseInfo currentEnterpriseInfo = af.getInstance().getCurrentEnterpriseInfo();
if (TextUtils.isEmpty(currentEnterpriseInfo.discoverServerIP) && (queryDiscoverInstanceBy = AKCDiscoverInstance.Companion.queryDiscoverInstanceBy(AKCDiscoverManager.a.getInstance().getLastServerSearchKey())) != null) {
List<ServerNetInfo> server_net_info = queryDiscoverInstanceBy.getServer_net_info();
if (server_net_info.size() > queryDiscoverInstanceBy.getBestAccessServerNetInfo()) {
currentEnterpriseInfo.discoverServerIP = server_net_info.get(queryDiscoverInstanceBy.getBestAccessServerNetInfo()).ip();
}
}
AccountInfo accountInfo = new AccountInfo(userMe.getAkeyId(), userMe.getNickName(), loginConfig.getUsername(), getLoginKey(), loginConfig.getPassword(), loginConfig.getServer(), getLoginCategory(), userMe.getHeadImgThumb(), getmPwdSetDate(), getPwdSaveValidDate(), currentEnterpriseInfo);
if (TextUtils.isEmpty(accountInfo.getEnt().getUserInput())) {
Log.i("AppConfigManager", "account server userInput is empty");
}
accountInfo.setOneKeyLogin(this.c2);
Log.i("AppConfigManager", "new account added: " + accountInfo.toString());
saveEnterpriseConfig();
addAccount(accountInfo);
this.U0 = accountInfo;
saveLoginConfig();
}
public void addServerIntoRAM(Akeychat.ServerSyncResponseV2 serverSyncResponseV2) {
if (serverSyncResponseV2 == null) {
return;
}
Log.i("AppConfigManager", "addServerIntoRAM " + serverSyncResponseV2.toString());
this.i1.put(serverSyncResponseV2.getId(), serverSyncResponseV2);
}
public void addToFeedbackMasterReplyList(String str) {
this.t0.add(str);
updateSimpleData("feedback_global_clear_time", JSON.toJSONString(this.t0));
}
public void backUpDeviceInfo() {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("asim_app_uuid", (Object) this.j.getUuid());
if (Build.VERSION.SDK_INT > 29) {
try {
if (!new File(ak.im.utils.l4.getNewBackupDeviceFilePath()).exists()) {
ak.im.utils.l4.write(ak.im.o1.get().getContentResolver().openOutputStream(ak.im.utils.l4.writeToMediaStoreForBackUps("device.amr")), jSONObject.toString());
}
} catch (Exception e2) {
Log.e("AppConfigManager", "onScanCompleted dealHead failed ,reason is " + e2.getMessage());
e2.printStackTrace();
}
} else {
ak.im.utils.l4.deleteFile(ak.im.utils.l4.getNewBackupDeviceFilePath());
ak.im.utils.l4.write(ak.im.utils.l4.getNewBackupDeviceFilePath(), jSONObject.toString());
}
} catch (Exception e3) {
Log.e("AppConfigManager", "back cp device failed");
AkeyChatUtils.logException(e3);
}
}
public void backUpLoginInfo() {
JSONObject jSONObject = new JSONObject();
try {
ArrayList<JSONObject> searchRestoreFile = ak.im.utils.l4.searchRestoreFile();
String str = null;
if (searchRestoreFile.size() > 0) {
Iterator<JSONObject> it = searchRestoreFile.iterator();
while (it.hasNext()) {
JSONObject next = it.next();
try {
if (Server.loads(C().getString("c3efa684ec28a6ccfc9ca0a1f855c479", str)).getEnterpriseId().equals(getServer().getEnterpriseId()) && getMMKV().getString("11c7fdb5492dca76", "").equals(next.getString("11c7fdb5492dca76")) && getMMKV().getString("25924daa3e3520b2d5fd84f72ff05fbb", null).equals(next.getString("25924daa3e3520b2d5fd84f72ff05fbb"))) {
Log.i("AppConfigManager", "dont backup");
return;
}
} catch (Exception e2) {
Log.i("AppConfigManager", "backUpLoginInfo judge failed,reason is " + e2.getMessage());
}
str = null;
}
}
JSONObject jSONObject2 = new JSONObject();
for (Map.Entry<String, String> entry : x().entrySet()) {
jSONObject2.put(entry.getKey(), (Object) entry.getValue());
}
jSONObject.put("7f16ead8b6604a8bb2ee774fc6fd3099", (Object) jSONObject2.toJSONString());
jSONObject.put("c3efa684ec28a6ccfc9ca0a1f855c479", (Object) C().getString("c3efa684ec28a6ccfc9ca0a1f855c479", ""));
jSONObject.put("11c7fdb5492dca76", (Object) getMMKV().getString("11c7fdb5492dca76", null));
jSONObject.put("0a6cee4f7ecb1d0c", (Object) getMMKV().getString("0a6cee4f7ecb1d0c", null));
jSONObject.put("25924daa3e3520b2d5fd84f72ff05fbb", (Object) getMMKV().getString("25924daa3e3520b2d5fd84f72ff05fbb", null));
jSONObject.put("4eef1db24e30556f9efc3673b4535ba8", (Object) Integer.valueOf(getMMKV().getInt("4eef1db24e30556f9efc3673b4535ba8", ak.im.g2.c.a.getDefaultLoginCategory())));
jSONObject.put("60f3e77a22b1fcc3103835127f2f4f4f", (Object) getMMKV().getString("60f3e77a22b1fcc3103835127f2f4f4f", null));
jSONObject.put("69615c092a5d5d84ac037aa65696f051", (Object) Long.valueOf(getMMKV().getLong("69615c092a5d5d84ac037aa65696f051", 1L)));
jSONObject.put("box_talk_root_id", (Object) Long.valueOf(getMMKV().getLong("box_talk_root_id", 0L)));
jSONObject.put("server_id", (Object) getMMKV().getString("server_id", ""));
jSONObject.put("app_version", (Object) Long.valueOf((long) BuildConfig.VERSION_CODE));
jSONObject.put("backup_time", (Object) Long.valueOf(System.currentTimeMillis()));
jSONObject.put("NEW_ENCR_PHONE", (Object) Boolean.TRUE);
Log.d("lwx", "box root id is " + getMMKV().getLong("box_talk_root_id", 0L));
Log.d("lwxback", "json is " + jSONObject.toJSONString());
if (Build.VERSION.SDK_INT > 29) {
try {
ContentResolver contentResolver = ak.im.o1.get().getContentResolver();
ak.im.utils.l4.write(contentResolver.openOutputStream(ak.im.utils.l4.writeToMediaStoreForBackUps(System.currentTimeMillis() + "bk.amr")), jSONObject.toString());
return;
} catch (Exception e3) {
Log.e("AppConfigManager", "backup failed, " + e3.getMessage());
e3.printStackTrace();
return;
}
}
ak.im.utils.l4.write(ak.im.utils.l4.getNewBackupFilePath(), jSONObject.toString());
} catch (Exception e4) {
Log.e("AppConfigManager", "BACKUP FAILED");
AkeyChatUtils.logException(e4);
}
}
public void cacheUpdateStrategy(UpdateBean updateBean) {
getMMKV().putString("update_strategy", updateBean == null ? "" : new com.google.gson.d().toJson(updateBean));
getMMKV().commit();
}
public boolean canDealFeedback() {
return supportFeedback() && isFeedBackMaster();
}
public boolean canLogToday() {
return !ak.im.utils.f4.isTheSameDay(getMMKV().getLong("push_sdk_failed_date", 0L), ak.im.utils.f4.getRightTime()) && getMMKV().getInt("push_sdk_failed_times", 0) < 3;
}
public io.reactivex.z<Akeychat.CancelAuthDeviceResponse> cancelDevice(String str) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.u(str)).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.CancelAuthDeviceResponse cancelAuthDeviceResponse;
cancelAuthDeviceResponse = ((ak.smack.u) ((Stanza) obj)).getmResponse();
return cancelAuthDeviceResponse;
}
});
}
public io.reactivex.z<Akeychat.CancelUserSubResponse> cancleUser(String str, String str2, String str3) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.v0(str, str2, str3)).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.CancelUserSubResponse cancelUserSubResponse;
cancelUserSubResponse = ((ak.smack.v0) ((Stanza) obj)).getmResponse();
return cancelUserSubResponse;
}
});
}
public io.reactivex.z<Akeychat.PhoneNumberChangeSubResponse> changePhone(String str, String str2) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.w(nf.getIQFromTo(), str, str2)).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.PhoneNumberChangeSubResponse mResponse;
mResponse = ((ak.smack.w) ((Stanza) obj)).getMResponse();
return mResponse;
}
});
}
public void checkAndUpdateReportBean(ReportBean reportBean) {
String str;
ReportBean reportBean2 = getReportBean();
if (reportBean != null) {
ReportBean.markTagAndReport markTagAndReport = reportBean.getMarkTagAndReport();
if (reportBean2 != null) {
try {
ReportBean.markTagAndReport markTagAndReport2 = reportBean2.getMarkTagAndReport();
if (markTagAndReport2 != null) {
if (markTagAndReport.getReportMgcHash().equals(markTagAndReport2.getReportMgcHash())) {
markTagAndReport.setReportWord(markTagAndReport2.getReportWord());
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
str = JSON.toJSONString(reportBean);
} else {
str = "";
}
updateSimpleData("simple_report_bean", str);
setReportBean(reportBean);
}
public io.reactivex.z<Akeychat.PasswordCheckResponse> checkPassword(String str) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.a0(nf.getIQFromTo(), str)).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.PasswordCheckResponse mResponse;
mResponse = ((ak.smack.a0) ((Stanza) obj)).getMResponse();
return mResponse;
}
});
}
public boolean checkSensitive(Object obj) {
HashSet hashSet;
String str;
Attachment attachment;
try {
hashSet = new HashSet();
if (obj instanceof ChatMessage) {
ChatMessage chatMessage = (ChatMessage) obj;
String type = chatMessage.getType();
if ("text".equals(type)) {
str = chatMessage.getContent();
} else {
str = (!ChatMessage.CHAT_FILE.equals(type) || (attachment = chatMessage.getAttachment()) == null) ? "" : attachment.getFilename();
}
} else {
str = (String) obj;
}
} catch (Exception e2) {
e2.printStackTrace();
Log.i("AppConfigManager", "checkSensitive failed,error is " + e2.getMessage());
}
if (TextUtils.isEmpty(str)) {
return false;
}
String lowerCase = str.replaceAll(" ", "").replaceAll("\n", "").replaceAll("\r", "").toLowerCase();
for (String str2 : this.q1) {
String lowerCase2 = str2.toLowerCase();
if (!TextUtils.isEmpty(lowerCase) && !TextUtils.isEmpty(lowerCase2) && lowerCase.contains(lowerCase2)) {
hashSet.add(Integer.valueOf(lowerCase2.hashCode()));
}
}
ArrayList arrayList = new ArrayList(hashSet);
System.currentTimeMillis();
Iterator<Integer> it = this.r1.iterator();
while (it.hasNext()) {
Integer next = it.next();
if (arrayList.size() >= 5) {
return true;
}
if ((arrayList.size() == 1 && ((Integer) arrayList.get(0)).longValue() == next.intValue()) || o(arrayList, next)) {
return true;
}
while (it.hasNext()) {
}
}
return false;
}
public boolean checkUsernameIsNew() {
return this.j.getUserNameVersion() == 2;
}
public void chooseOneEnterprise(EnterpriseInfo enterpriseInfo) {
n();
resetUserInfo();
this.n.addOneEnterpriseInfo(enterpriseInfo);
this.n.setCurrentEnterprise(enterpriseInfo);
saveEnterpriseConfig();
}
public synchronized void cleanAutoAccount() {
}
public synchronized void clearAccountDataWhenExit() {
getMMKV().putString("account_uid", "");
getMMKV().putString("account_pwd", "");
getMMKV().putString("account", "");
getMMKV().commit();
}
public void clearPhoneAndLoginKey() {
getMMKV().putString("0a6cee4f7ecb1d0c", "");
getMMKV().putString("4eef1db24e30556f9efc3673b4535ba8", "");
}
public synchronized void clearPwdInSharedPref() {
this.j.setPassword("");
this.j.setEncryptedPassword("");
putMD5Password(null);
H0(null);
getMMKV().putString("password", null);
getMMKV().putString("0b8b946432f1ac91f0b07bd5f8df6587", null);
getMMKV().commit();
}
public void clearServerAndEnterprise() {
this.j.setServer(null);
this.n.setCurrentEnterprise(null);
}
public void clearServerConfigWhenEnterpriseIsEmpty() {
this.j.setServer(null);
m();
}
public void closeABKeyLockSwitch() {
if (getLockMode() == 0) {
setLockMode(3);
setPatternUnlockCode("");
P0(false);
}
}
public synchronized void closeLockSwitch() {
setPatternUnlockCode("");
setLockMode(3);
P0(true);
}
public int contentSizeLimit() {
return AKCAppConfiguration.a.textMsgLengthLimit();
}
public String decryptPhone(String str) {
try {
byte[] decode = ak.comm.d.decode(str);
return new String(AKCEncryptWrapper.getInstance().NativeDecryptData(decode, decode.length, getKey(), this.p0));
} catch (Exception unused) {
return "";
}
}
public String decryptedContent(String str) {
return AKApplication.decryptLocalContent(str, A(), w());
}
public void deleteAccount(AccountInfo accountInfo) {
if (accountInfo == null) {
return;
}
this.y.remove(accountInfo);
getMMKV().putString(BuildConfig.PRODUCT_PKG_NAME, JSON.toJSONString(this.y));
getMMKV().commit();
}
public void deleteLoginSimpleDataByField(String str, String str2) {
a.deleteByField(str, str2);
}
public void deleteServerByIds(ArrayList<String> arrayList) {
v().deleteByField("servers", "server_id", arrayList);
}
public void dismissPermissionDialog() {
Dialog dialog = this.a2;
if (dialog != null) {
dialog.dismiss();
this.a2 = null;
}
}
public io.reactivex.j<ak.f.e> doRealSignUp(SignUpBuilder signUpBuilder) {
String baseURL = getInstance().getBaseURL();
ak.f.b bVar = new ak.f.b(baseURL, false, AkeyChatUtils.isNeedVerifyCertificate(baseURL));
HashMap hashMap = new HashMap();
hashMap.put("phonenumber", signUpBuilder.getNickname());
hashMap.put("reqid", signUpBuilder.getReqId());
hashMap.put("password", signUpBuilder.getPassword());
hashMap.put("name", signUpBuilder.getUserName());
hashMap.put("app_plt", User.ANDROID_PLATFORM);
hashMap.put("app_ver", getVersion());
hashMap.put(RosterVer.ELEMENT, "2");
hashMap.put("nickname", signUpBuilder.getNickname());
hashMap.put("sex", User.MALE.toLowerCase());
hashMap.put("sn", signUpBuilder.getSn());
hashMap.put("passcode", ak.comm.i.MD5Encode(signUpBuilder.getPasscode()));
hashMap.put("keydata", signUpBuilder.getKeydata());
return bVar.getAKAPI().doSignUp(hashMap);
}
public io.reactivex.j<ResetPwdData> doResetPwd(String str, String str2) {
String baseURL = getInstance().getBaseURL();
ak.f.b bVar = new ak.f.b(baseURL, false, AkeyChatUtils.isNeedVerifyCertificate(baseURL));
HashMap hashMap = new HashMap();
hashMap.put("reqid", str);
hashMap.put("password", str2);
return bVar.getAKAPI().resetPwd(hashMap);
}
public void downLoadSeaweedLogin() {
String startupPageUrl = getServer().getStartupPageUrl();
String enterpriseLogo = getServer().getEnterpriseLogo();
q(startupPageUrl);
q(enterpriseLogo);
}
public io.reactivex.z<Server> flatMapStringServerInfoTo(io.reactivex.z<String> zVar) {
if (zVar == null) {
return null;
}
return zVar.flatMap(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
io.reactivex.e0 create;
create = io.reactivex.z.create(new io.reactivex.c0() {
@Override
public final void subscribe(io.reactivex.b0 b0Var) {
ye.P(r1, b0Var);
}
});
return create;
}
});
}
public ContentValues generateServerInfoContentValues(Akeychat.ServerSyncResponseV2 serverSyncResponseV2) {
if (serverSyncResponseV2 == null || TextUtils.isEmpty(serverSyncResponseV2.getId()) || TextUtils.isEmpty(serverSyncResponseV2.getDomain())) {
return null;
}
ContentValues contentValues = new ContentValues();
contentValues.put("server_id", serverSyncResponseV2.getId());
contentValues.put("data", ak.comm.d.encodeBytes(serverSyncResponseV2.toByteArray()));
return contentValues;
}
public synchronized String get61SuoBaseUrl() {
return getServer().getM61SuoBaseUrl();
}
public String getAccessToken() {
if (this.J == null) {
this.J = new AtomicReference<>(UUID.randomUUID().toString());
}
return this.J.get();
}
public ArrayList<AccountInfo> getAccountInfos() {
return this.y;
}
public io.reactivex.z<Akeychat.CustomerAskResponse> getAiReply(String str, String str2) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.m(str, str2), 20000L).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.CustomerAskResponse response;
response = ((ak.smack.m) ((Stanza) obj)).getResponse();
return response;
}
});
}
public String getArticleUrlPrefix(String str) {
Server server = getServer();
if (server == null) {
new Exception("server is null return return empty download url").printStackTrace();
return null;
}
StringBuilder sb = new StringBuilder();
sb.append("https://");
sb.append(server.getAppSrvHost());
sb.append(":");
sb.append(server.getAppSrvPort());
sb.append("/app/show_article?");
sb.append("article_id=");
sb.append(str.replace("%2C", ","));
sb.append("&username=");
String username = getUsername();
try {
username = ak.comm.a.stringToHex(ak.comm.d.encodeBytes(username.getBytes("utf-8")));
} catch (UnsupportedEncodingException e2) {
e2.printStackTrace();
}
sb.append(username);
return sb.toString();
}
public String getAuthToken() {
if (this.p1 == null) {
AppLoginDBHelper mmkv = getMMKV();
this.p1 = mmkv.getString(getServer().getEnterpriseId() + "_" + getUsername() + "_auth_token", "");
}
return this.p1;
}
public String getBannerUrl() {
if (this.X == null) {
return null;
}
return getDownloadUrl() + this.X.getBannerUrl();
}
public synchronized String getBaseURL(Server server) {
return "https://" + server.getAppSrvHost() + ":" + server.getAppSrvPort() + CookieSpec.PATH_DELIM;
}
public String getBigVersion() {
String version = getVersion();
if (version.contains(".")) {
String[] split = version.split("\\.");
int min = Math.min(2, split.length);
StringBuilder sb = new StringBuilder();
for (int i2 = 0; i2 <= min; i2++) {
sb.append(split[i2]);
if (i2 < min) {
sb.append(".");
}
}
return sb.toString();
}
return version;
}
public synchronized HashSet<String> getBlacklist() {
this.u1.addAll(Arrays.asList(this.t1));
this.u1.remove("");
return this.u1;
}
public io.reactivex.z<BoxInfoBean> getBoxInfo() {
return ((ak.i.g) AkeyChatUtils.boxtalkBaseApi().create(ak.i.g.class)).boxInfo(getAccessToken(), f1256c).map(new l());
}
public String getBoxMasterName() {
return this.X0;
}
public synchronized String getBoxRoot() {
return this.k0;
}
public synchronized long getBoxRootId() {
return this.l0;
}
@NonNull
public ConcurrentHashMap<String, Akeychat.ServerSyncResponseV2> getBundServers() {
return this.i1;
}
public CAData getCAData() {
if (this.J0) {
return this.K0;
}
throw new IllegalStateException("ca info doesn't load,please load it");
}
public UpdateBean getCachedUpdateStrategy() {
String string = getMMKV().getString("update_strategy", "");
try {
return (UpdateBean) new com.google.gson.d().fromJson(string, (Class<Object>) UpdateBean.class);
} catch (Exception e2) {
e2.printStackTrace();
Log.w("AppConfigManager", "parse json error:" + string);
return null;
}
}
public String getChatLongTime(boolean z, boolean z2, Group group) {
Context context = ak.im.o1.get();
ye yeVar = getInstance();
boolean isSingleChatMessageStoreDayUsedForMiyun = yeVar.isSingleChatMessageStoreDayUsedForMiyun();
int singleChatMessageStoreDay = yeVar.getSingleChatMessageStoreDay();
int groupChatMessageStoreDay = yeVar.getGroupChatMessageStoreDay();
boolean isUserVisibleForMiyun = yeVar.isUserVisibleForMiyun();
int userVisibleDay = yeVar.getUserVisibleDay();
Role userMeRole = jf.getInstance().getUserMeRole();
boolean z3 = userMeRole != null && userMeRole.isUserVisibleDayUsedForMiyun();
int userVisibleDay2 = userMeRole != null ? userMeRole.getUserVisibleDay() : -1;
Log.i("AppConfigManager", "current getChatLongTime is " + isSingleChatMessageStoreDayUsedForMiyun + "**" + singleChatMessageStoreDay + "**" + groupChatMessageStoreDay + "**" + isUserVisibleForMiyun + "**" + userVisibleDay + "**" + z3 + "**" + userVisibleDay2);
if (!z) {
if (!z2) {
if (userVisibleDay <= -1) {
userVisibleDay = userVisibleDay2;
}
if (userVisibleDay > -1 && (singleChatMessageStoreDay <= -1 || userVisibleDay <= singleChatMessageStoreDay)) {
singleChatMessageStoreDay = userVisibleDay;
}
return singleChatMessageStoreDay > -1 ? context.getString(ak.im.b2.chat_set_2, Integer.valueOf(singleChatMessageStoreDay)) : context.getString(ak.im.b2.group_speak_no);
}
int groupMessageStoreDay = group.getGroupMessageStoreDay();
if (groupMessageStoreDay > 0) {
groupChatMessageStoreDay = groupMessageStoreDay;
}
if (userVisibleDay <= 0) {
userVisibleDay = userVisibleDay2;
}
if (groupChatMessageStoreDay > 0 && userVisibleDay > 0) {
int i2 = ak.im.b2.chat_set_2;
Object[] objArr = new Object[1];
if (groupChatMessageStoreDay > userVisibleDay) {
groupChatMessageStoreDay = userVisibleDay;
}
objArr[0] = Integer.valueOf(groupChatMessageStoreDay);
return context.getString(i2, objArr);
} else if (groupChatMessageStoreDay <= 0 && userVisibleDay <= 0) {
return context.getString(ak.im.b2.group_speak_no);
} else {
int i3 = ak.im.b2.chat_set_2;
Object[] objArr2 = new Object[1];
if (groupChatMessageStoreDay <= 0) {
groupChatMessageStoreDay = userVisibleDay;
}
objArr2[0] = Integer.valueOf(groupChatMessageStoreDay);
return context.getString(i3, objArr2);
}
} else if (userVisibleDay <= -1) {
if (userVisibleDay2 > -1 && z3) {
userVisibleDay = userVisibleDay2;
if (singleChatMessageStoreDay > -1 || !isSingleChatMessageStoreDayUsedForMiyun || (userVisibleDay > -1 && userVisibleDay <= singleChatMessageStoreDay)) {
singleChatMessageStoreDay = userVisibleDay;
}
if (singleChatMessageStoreDay >= 0) {
return context.getString(ak.im.b2.chat_set_3);
}
return context.getString(ak.im.b2.chat_set_3) + context.getString(ak.im.b2.chat_set_2, Integer.valueOf(singleChatMessageStoreDay)) + " >";
}
userVisibleDay = -1;
if (singleChatMessageStoreDay > -1) {
}
singleChatMessageStoreDay = userVisibleDay;
if (singleChatMessageStoreDay >= 0) {
}
}
}
public int getChatLongTimeForInt(boolean z, boolean z2, Group group) {
boolean isSingleChatMessageStoreDayUsedForMiyun = isSingleChatMessageStoreDayUsedForMiyun();
int singleChatMessageStoreDay = getSingleChatMessageStoreDay();
int groupChatMessageStoreDay = getGroupChatMessageStoreDay();
boolean isUserVisibleForMiyun = isUserVisibleForMiyun();
int userVisibleDay = getUserVisibleDay();
Role userMeRole = jf.getInstance().getUserMeRole();
boolean z3 = userMeRole != null && userMeRole.isUserVisibleDayUsedForMiyun();
int userVisibleDay2 = userMeRole != null ? userMeRole.getUserVisibleDay() : -1;
Log.i("AppConfigManager", "current getChatLongTime is " + isSingleChatMessageStoreDayUsedForMiyun + "**" + singleChatMessageStoreDay + "**" + groupChatMessageStoreDay + "**" + isUserVisibleForMiyun + "**" + userVisibleDay + "**" + z3 + "**" + userVisibleDay2);
if (!z) {
if (!z2) {
if (userVisibleDay <= -1) {
userVisibleDay = userVisibleDay2;
}
return userVisibleDay > -1 ? (singleChatMessageStoreDay <= -1 || userVisibleDay <= singleChatMessageStoreDay) ? userVisibleDay : singleChatMessageStoreDay : singleChatMessageStoreDay;
}
int groupMessageStoreDay = group.getGroupMessageStoreDay();
if (groupMessageStoreDay > 0) {
groupChatMessageStoreDay = groupMessageStoreDay;
}
if (userVisibleDay <= 0) {
userVisibleDay = userVisibleDay2;
}
if (groupChatMessageStoreDay > 0 && userVisibleDay > 0) {
return groupChatMessageStoreDay > userVisibleDay ? userVisibleDay : groupChatMessageStoreDay;
} else if (groupChatMessageStoreDay > 0 || userVisibleDay > 0) {
return groupChatMessageStoreDay > 0 ? groupChatMessageStoreDay : userVisibleDay;
} else {
return -1;
}
} else if (userVisibleDay <= -1) {
if (userVisibleDay2 > -1 && z3) {
userVisibleDay = userVisibleDay2;
return (singleChatMessageStoreDay > -1 || !isSingleChatMessageStoreDayUsedForMiyun || (userVisibleDay > -1 && userVisibleDay <= singleChatMessageStoreDay)) ? userVisibleDay : singleChatMessageStoreDay;
}
userVisibleDay = -1;
if (singleChatMessageStoreDay > -1) {
}
}
}
public long getCheckCacheTime() {
long j2 = getMMKV().getLong("check_cache_file_time", 0L);
this.e2 = j2;
return j2;
}
public int getChooseLan() {
return this.i2;
}
public synchronized String getCollect_log() {
return this.j.getCollect_log();
}
public HashMap<String, ComplaintCodeTime> getComplaintCodeTimeHashMap() {
return this.N1;
}
public String getComplaintKey() {
return this.K1;
}
public String getConnectedSatelliteDeviceAddress() {
return this.G;
}
public CountryBean getCountryBean() {
return this.r2;
}
public synchronized String getCountryCode() {
return this.j.getCountryCode();
}
public String getCurrentClouds() {
Server server = getInstance().getServer();
if (server == null) {
return null;
}
return Server.CLOUD_SERVICE_SEEWEED.equals(server.getCloudFS()) ? "2" : Server.CLOUD_SERVICE_ALIYUN.equals(server.getCloudFS()) ? "1" : Server.CLOUD_SERVICE_S3.equals(server.getCloudFS()) ? "3" : "0";
}
public String getCurrentDeviceIp() {
return this.f2;
}
public int getCurrentFeedbackCode() {
return this.q2;
}
public List<List<String>> getCurrentLanguageCountryList() {
String language = Locale.getDefault().getLanguage();
if (language.equals("zh")) {
String country = Locale.getDefault().getCountry();
Log.debug("AppConfigManager", "disp c " + country);
if (!country.equals("TW") && !country.equals("HK") && !country.equals("MO")) {
return this.r2.getZh_hans();
}
return this.r2.getZh_hant();
} else if (language.equals("vi") && ak.im.g2.c.a.isFlavor("enterprise")) {
return this.r2.getVi();
} else {
return this.r2.getEn();
}
}
public String getCurrentMd5Pwd() {
return this.V0;
}
public String getCurrentServerDomain() {
Server server = getServer();
return server != null ? server.getXmppDomain() : "";
}
public HashMap<String, ServerInfo> getCurrentWaitDealServerInfo() {
return this.x;
}
public HashMap<String, Akeychat.DesktopStatusInfo> getDesktopStatusInfoMap() {
return this.k2;
}
public List<Akeychat.DesktopStatusInfo> getDesktopStatusInfos() {
return this.l2;
}
public io.reactivex.z<Akeychat.DeviceAuthListResponse> getDeviceList() {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.m3()).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.DeviceAuthListResponse deviceAuthListResponse;
deviceAuthListResponse = ((ak.smack.m3) ((Stanza) obj)).getmResponse();
return deviceAuthListResponse;
}
});
}
public String getDiscoveryId() {
return this.j0;
}
public synchronized String getDownloadUrl() {
Server server = getInstance().getServer();
if (server == null) {
new Exception("server is null return return empty download url").printStackTrace();
return null;
} else if (Server.CLOUD_SERVICE_SEEWEED.equals(server.getCloudFS())) {
return "https://" + server.getAppSrvHost() + ":" + server.getAppSrvPort() + "/app/seaweedfsdownload?fid=";
} else if (Server.CLOUD_SERVICE_ALIYUN.equals(server.getCloudFS())) {
return server.getAliyunfsDownloadUrlPrefix();
} else if (Server.CLOUD_SERVICE_S3.equals(server.getCloudFS())) {
return server.getAwsDownloadUrlPrefix();
} else {
return server.getQiniuDownloadUrlPrefix();
}
}
public synchronized String getEncryptedPassword() {
return this.j.getEncryptedPassword();
}
public long getFeedbackMapLastTime() {
return this.v0;
}
public ArrayList<String> getFeedbackMasterReplyList() {
return this.t0;
}
public synchronized String getFileBucketName() {
Server server = getInstance().getServer();
if (server == null) {
new Exception("server is null return return empty file bucket name url").printStackTrace();
return null;
} else if (Server.CLOUD_SERVICE_QINIU.equals(server.getCloudFS())) {
return server.getQiniuFileBucketName();
} else {
return null;
}
}
public float getFontSize() {
return this.i0;
}
public ConcurrentHashMap<String, Akeychat.ServerSyncResponseV2> getFriendServers() {
this.j1.clear();
for (String str : this.i1.keySet()) {
Akeychat.ServerSyncResponseV2 serverSyncResponseV2 = this.i1.get(str);
if (serverSyncResponseV2 == null || !serverSyncResponseV2.hasIsDelete() || !serverSyncResponseV2.getIsDelete()) {
this.j1.put(str, serverSyncResponseV2);
}
}
return this.j1;
}
public int getGetLoginCodeTimes() {
return this.m1;
}
public long getGlobalClearTime() {
return this.p2;
}
public int getGroupChatMessageStoreDay() {
return this.z0;
}
public List<GroupSpeakBean> getGroupSpeakBeanList() {
return this.e0;
}
public HashMap<String, List<GroupSpeakBean>> getGroupSpeakListMap() {
return this.f0;
}
public synchronized String getHWPushToken() {
if (!TextUtils.isEmpty(this.s0)) {
return this.s0;
}
if (ak.im.utils.f4.getRightTime() - C().getLong("hw_push_token_time", 0L) >= AKCAppConfiguration.a.pushCacheTime()) {
this.s0 = "";
} else {
this.s0 = C().getString("hw_push_token", "");
}
return this.s0;
}
public String getIDNO() {
PrivacyConfig privacyConfig = this.m;
return privacyConfig == null ? "" : privacyConfig.getIdNO();
}
public long getInternetTime() {
String[] strArr;
ak.im.utils.l5 l5Var = new ak.im.utils.l5();
for (String str : ak.im.p1.F) {
if (l5Var.requestTime(str, 5000)) {
long ntpTime = l5Var.getNtpTime();
Log.i("AppConfigManager", str + " local time: " + ak.im.utils.f4.getCurDateLong() + ", and the internet time: " + ntpTime);
return ntpTime;
}
Log.e("AppConfigManager", str + " get internet time failed");
}
return -1L;
}
public String getJidByNameForOtherServer(String str) {
Akeychat.ServerSyncResponseV2 serverById;
if (TextUtils.isEmpty(str) || str.contains("@") || !str.contains("#")) {
return "";
}
String[] split = str.split("#");
if (split.length <= 1 || (serverById = getServerById(split[1])) == null) {
return "";
}
String str2 = split[0] + "@" + serverById.getDomain();
Log.i("AppConfigManager", "jid from other is " + str2);
return str2;
}
public byte[] getKey() {
if (this.o0 == null) {
byte[] NativeHKDF = AKCEncryptWrapper.getInstance().NativeHKDF(BuildConfig.PRODUCT_PKG_NAME.getBytes(), 32L);
this.o0 = new byte[16];
this.p0 = new byte[16];
for (int i2 = 0; i2 < NativeHKDF.length; i2++) {
if (i2 < 16) {
this.o0[i2] = NativeHKDF[i2];
} else {
this.p0[i2 - 16] = NativeHKDF[i2];
}
}
}
return this.o0;
}
public String getKingGridLicenseInfo() {
if (!TextUtils.isEmpty(this.Q0)) {
return this.Q0;
}
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add("6BBBF07B7A3C7315");
List<QueryModel<String, String>> D = D(arrayList);
if (D == null || D.size() == 0) {
return "";
}
String value = D.get(0).getValue();
this.Q0 = value;
return value;
}
public String getLanguage() {
return this.I;
}
public Long getLastDailyReportTime() {
return Long.valueOf(getMMKV().getLong("last_statistics", 0L));
}
public Akeychat.QRCodeShareInfo getLastQrCodeShareInfo() {
return this.b0;
}
public int getLimitNumForFriend() {
return this.E1;
}
public synchronized int getLockMode() {
SecurityConfig securityConfig = this.o;
if (securityConfig == null) {
return 3;
}
return securityConfig.getLockMode();
}
public int getLoginCategory() {
LoginConfig loginConfig = this.j;
if (loginConfig == null) {
return 0;
}
return loginConfig.getLoginCategory();
}
public String getLoginCode() {
return this.l1;
}
public String getLoginKey() {
LoginConfig loginConfig = this.j;
if (loginConfig == null) {
return null;
}
return loginConfig.getLoginKey();
}
public int getLoginStatus() {
return this.M1;
}
public String getM5MBase() {
return "https://" + AKCAppConfiguration.a.m5m();
}
public synchronized AppLoginDBHelper getMMKV() {
return a;
}
public JSONArray getNeedUploadBlacklist() {
return this.v1;
}
public synchronized long getNoShotCount() {
return this.m.getNoShotCount();
}
public synchronized String getOSSBaseURL() {
return "https://" + getOssCenterHost() + CookieSpec.PATH_DELIM;
}
public synchronized int getOldAppVersionFromSharedPref() {
int i2 = this.g0;
if (i2 != 0) {
return i2;
}
int i3 = C().getInt("simple_data_app_ver_key", 0);
this.g0 = i3;
return i3;
}
public synchronized String getOldUsername() {
return this.j.getOldUserName();
}
public String getOssCenterHost() {
this.a0 = getMMKV().getString("ossCenterHost", this.a0);
return AKCAppConfiguration.a.oss();
}
public String getPasscode() {
return this.s;
}
public synchronized String getPassword() {
return this.j.getPassword();
}
public synchronized String getPatternUnlockCode() {
return this.o.getPatternUnlockCode();
}
public Dialog getPermissionDialog() {
return this.a2;
}
public synchronized String getPhone() {
if (TextUtils.isEmpty(this.j.getPhone())) {
return "";
}
return this.j.getPhone();
}
public synchronized int getPreVer4SettingDialogFromSP() {
int i2 = this.h0;
if (i2 != 0) {
return i2;
}
int i3 = C().getInt("pre_version_code_for_setting_dialog", 0);
this.h0 = i3;
return i3;
}
public synchronized boolean getPrivacyDestroySwitch() {
return true;
}
public synchronized boolean getPrivacyMessageNoticeVoiceSwitch() {
PrivacyConfig privacyConfig = this.m;
if (privacyConfig == null) {
Log.w("AppConfigManager", "private cfg is null-v-s");
return true;
}
return privacyConfig.isMessageNoticeVoice();
}
public synchronized boolean getPrivacyRecvAndReadSwitch() {
if (this.m == null) {
Log.w("AppConfigManager", "private cfg is null-r-r-s");
return true;
}
Role roleById = jf.getInstance().getRoleById(nf.getInstance().getUserMe().getUser_role_id());
if (roleById == null || roleById.isAllow_close_receipt()) {
return this.m.isRecvAndReadReceipts();
}
return true;
}
public synchronized boolean getPrivacyShowSwitch() {
return true;
}
public String getPropValue(String str) {
BufferedReader bufferedReader;
Exception e2;
String str2 = "";
BufferedReader bufferedReader2 = null;
try {
try {
bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("getprop " + str).getInputStream()), 1024);
try {
try {
str2 = bufferedReader.readLine();
bufferedReader.close();
bufferedReader.close();
} catch (Exception e3) {
e2 = e3;
Log.e("AppConfigManager", "Unable to read sysprop " + str, e2);
if (bufferedReader != null) {
bufferedReader.close();
}
return str2;
}
} catch (Throwable th) {
th = th;
bufferedReader2 = bufferedReader;
if (bufferedReader2 != null) {
try {
bufferedReader2.close();
} catch (Exception e4) {
Log.e("AppConfigManager", "Exception while closing InputStream", e4);
}
}
throw th;
}
} catch (Exception e5) {
Log.e("AppConfigManager", "Exception while closing InputStream", e5);
}
} catch (Exception e6) {
bufferedReader = null;
e2 = e6;
} catch (Throwable th2) {
th = th2;
if (bufferedReader2 != null) {
}
throw th;
}
return str2;
}
public synchronized boolean getPublicSwitch() {
PrivacyConfig privacyConfig = this.m;
if (privacyConfig == null) {
Log.w("AppConfigManager", "private cfg is null-p-s");
return true;
}
return privacyConfig.isPublicSwitch();
}
public int getPwdSaveValidDate() {
return this.B0;
}
public synchronized String getReSendCollectLogNotice() {
return this.j.getReSendCollectLogNotice();
}
public ReadOnlyInfo getReadOnlyInfo() {
return this.W0;
}
public synchronized long getRemoteDestroyCount() {
return this.m.getRemoteDestroyCount();
}
public ReportBean getReportBean() {
return this.s2;
}
public RequestSignUpResult getReqSignUpResult() {
return this.L0;
}
public io.reactivex.j<ResetPwdData> getRequestAndSMSCodeForResetPwd(final String str, final Integer num) {
return getRequestIdBeforeResetPwd().flatMap(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
return ye.this.V(str, num, (ResetPwdData) obj);
}
});
}
public io.reactivex.j<ResetPwdData> getRequestIdBeforeResetPwd() {
String baseURL = getInstance().getBaseURL();
return new ak.f.b(baseURL, false, AkeyChatUtils.isNeedVerifyCertificate(baseURL)).getAKAPI().getReqIdForResetPassword();
}
public io.reactivex.j<RequestSignUpResult> getRequestIdBeforeSign(String str, Integer num) {
String baseURL = getInstance().getBaseURL();
ak.f.b bVar = new ak.f.b(baseURL, false, AkeyChatUtils.isNeedVerifyCertificate(baseURL));
HashMap hashMap = new HashMap();
hashMap.put("phonenumber", str);
hashMap.put("count", String.valueOf(num));
hashMap.put("product_type", BuildConfig.PRODUCT_TYPE);
hashMap.put("resource", getInstance().getResource());
hashMap.put("device_name", Build.BRAND);
return bVar.getAKAPI().signUp(hashMap);
}
public synchronized String getResource() {
return Build.MANUFACTURER + "." + Build.DEVICE + "." + this.j.getUuid();
}
public synchronized String getRootPath() {
LoginConfig loginConfig = this.j;
if (loginConfig != null) {
return loginConfig.getRootPath();
}
return null;
}
public io.reactivex.j<ResetPwdData> getSMSCodeBeforeResetPwd(String str, String str2, Integer num) {
String baseURL = getInstance().getBaseURL();
ak.f.b bVar = new ak.f.b(baseURL, false, AkeyChatUtils.isNeedVerifyCertificate(baseURL));
HashMap hashMap = new HashMap();
hashMap.put("phonenumber", str);
hashMap.put("reqid", str2);
hashMap.put("count", String.valueOf(num));
hashMap.put("product_type", BuildConfig.PRODUCT_TYPE);
return bVar.getAKAPI().getSMSCodeForResetPassword(hashMap);
}
public synchronized boolean getSearchAsimId() {
return this.m.isSearchAsimIds();
}
public synchronized boolean getSearchPhoneNum() {
return this.m.isSearchPhoneNums();
}
public String getSelectOpenFileAppInfo(String str) {
StringBuilder sb = new StringBuilder();
ArrayList arrayList = new ArrayList();
arrayList.add(str);
int size = arrayList.size();
sb.append("SELECT * FROM simple_data WHERE ");
for (int i2 = 0; i2 < size; i2++) {
sb.append("key");
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append("'");
sb.append((String) arrayList.get(i2));
sb.append("'");
if (i2 < size - 1) {
sb.append(" or ");
}
}
Log.i("AppConfigManager", "load configure data-sql:" + sb.toString());
List<QueryModel> queryForList = v().queryForList(new c.b() {
@Override
public final Object mapRow(Cursor cursor, int i3) {
return ye.W(cursor, i3);
}
}, sb.toString(), null);
if (queryForList != null && queryForList.size() > 0) {
for (QueryModel queryModel : queryForList) {
if (queryModel != null && str.equals((String) queryModel.getKey())) {
return (String) queryModel.getValue();
}
}
}
return null;
}
public List<String> getSensitiveWords() {
return this.Y;
}
public List<String> getSensitives() {
return this.q1;
}
public HashSet<Integer> getSensitivesMapping() {
return this.r1;
}
public synchronized Server getServer() {
return this.j.getServer();
}
public List<Akeychat.ServerArea> getServerAreaList() {
if (this.h == null) {
this.h = new ArrayList();
}
return this.h;
}
public Akeychat.ServerSyncResponseV2 getServerById(String str) {
if (str == null) {
return null;
}
return this.i1.get(str);
}
public String getServerId() {
if (TextUtils.isEmpty(this.e1)) {
this.e1 = getMMKV().getString("server_id", "");
}
String trim = this.e1.trim();
this.e1 = trim;
String serverIdByDomain = AkeyChatUtils.getServerIdByDomain(trim);
this.e1 = serverIdByDomain;
return serverIdByDomain;
}
@Nullable
public String getServerIdByDomain(String str) {
if (str == null) {
Log.w("AppConfigManager", "domain is null get server id failed");
return null;
}
for (Map.Entry<String, Akeychat.ServerSyncResponseV2> entry : this.i1.entrySet()) {
Akeychat.ServerSyncResponseV2 value = entry.getValue();
if (str.equals(value.getDomain())) {
return value.getId();
}
}
if (!str.equals(getServer().getXmppDomain())) {
Log.w("AppConfigManager", "we can't get server by domain:" + str);
}
return null;
}
@Nullable
public String getServerIdByJid(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
return getServerIdByDomain(nf.getDomainFromJid(str));
}
public String getServerIdFromChatMessage(ChatMessage chatMessage) {
String from = chatMessage.getFrom();
Log.i("AppConfigManager", "getServerIdFromChatMessage jid is " + from);
String serverIdByJid = getServerIdByJid(from);
return serverIdByJid != null ? serverIdByJid : "";
}
public String getServerStatus() {
return this.t2;
}
public ConcurrentHashMap<String, String> getServerStatusMap() {
return this.k1;
}
public String getServerVersion() {
return this.b2;
}
public int getShowSipNotifyTimes() {
return this.Q1;
}
public ArrayList<String> getSimpleData(ArrayList<String> arrayList) {
StringBuilder sb = new StringBuilder();
int size = arrayList.size();
sb.append("SELECT * FROM simple_data WHERE ");
for (int i2 = 0; i2 < size; i2++) {
sb.append("key");
sb.append(ContainerUtils.KEY_VALUE_DELIMITER);
sb.append("'");
sb.append(arrayList.get(i2));
sb.append("'");
if (i2 < size - 1) {
sb.append(" or ");
}
}
Log.i("AppConfigManager", "load configure data-sql:" + sb.toString());
ArrayList<String> arrayList2 = null;
List<QueryModel> queryForList = v().queryForList(new c.b() {
@Override
public final Object mapRow(Cursor cursor, int i3) {
return ye.X(cursor, i3);
}
}, sb.toString(), null);
if (queryForList == null) {
return null;
}
int size2 = queryForList.size();
if (size2 > 0) {
for (QueryModel queryModel : queryForList) {
if (queryModel != null) {
if (arrayList2 == null) {
arrayList2 = new ArrayList<>(size2);
}
arrayList2.add((String) queryModel.getValue());
}
}
}
return arrayList2;
}
public int getSingleChatMessageStoreDay() {
return this.y0;
}
public synchronized long getSipCount() {
return this.m.getSipCount();
}
public String getTempPic() {
return this.n0;
}
public String[] getTempServerInfo() {
return this.g1;
}
public synchronized boolean getTouchId() {
return this.m.isTouchId();
}
public synchronized long getUnstableCount() {
return this.m.getUnstableCount();
}
public String getUriForWeb() {
return this.s1;
}
@NotNull
public synchronized String getUserDLPLevel() {
PrivacyConfig privacyConfig = this.m;
if (privacyConfig == null) {
return "";
}
return privacyConfig.getUserDLPLevel();
}
public void getUserHadOpenReadStatus() {
ak.im.p1.g0 = "had_open_read_" + af.getInstance().getCurrentEnterpriseInfo().enterpriseID + "_" + getUsername();
this.l = getMMKV().getBoolean(ak.im.p1.g0, false);
StringBuilder sb = new StringBuilder();
sb.append("init hadOpenRead is ");
sb.append(this.l);
Log.i("AppConfigManager", sb.toString());
}
public void getUserInput() {
Server.loads(C().getString("simple_data_server_info_key", null));
}
public int getUserVisibleDay() {
return this.b1;
}
public synchronized String getUsername() {
LoginConfig loginConfig = this.j;
if (loginConfig != null) {
return loginConfig.getUsername();
}
return null;
}
public String getVersion() {
try {
String str = this.i.getPackageManager().getPackageInfo(this.i.getPackageName(), 0).versionName;
if (str.contains(" + ")) {
return str.substring(0, str.indexOf(" + ")) + "b";
}
return str;
} catch (PackageManager.NameNotFoundException unused) {
return "Unknown";
}
}
public int getVersionCode() {
try {
return this.i.getPackageManager().getPackageInfo(this.i.getPackageName(), 0).versionCode;
} catch (PackageManager.NameNotFoundException unused) {
return 0;
}
}
public String getWebViewCookie(String str) {
return C().getString(str, "");
}
public String getWorkspaceName(Context context) {
if (context == null) {
return "Workspace";
}
Akeychat.Workspace workspace = this.X;
if (workspace == null) {
return context.getString(ak.im.b2.workspace);
}
String name = workspace.getName();
return TextUtils.isEmpty(name) ? context.getString(ak.im.b2.workspace) : name;
}
public synchronized String getYLTBaseURL() {
return getServer().getRedPacketBaseUrl();
}
public synchronized String getYLTInteralStoreUrl() {
return getServer().getInteralStoreUrl();
}
public ak.k.a getZtListener() {
return this.w;
}
public EnterpriseConfig getmEnterpriseCfg() {
return this.n;
}
public LoginConfig getmLoginCfg() {
return this.j;
}
public int getmMaxMemberCount() {
return this.F;
}
public String getmPasswordFromIntent() {
return this.O0;
}
public long getmPwdSetDate() {
return this.C0;
}
public ResetPwdData getmReqsetPwdData() {
return this.M0;
}
public String getmUserNameFromIntent() {
return this.N0;
}
public Akeychat.Workspace getmWorkspace() {
return this.X;
}
public int handleSyncGlobalConfigureResponse(Akeychat.GlobalParamsSyncResponse globalParamsSyncResponse, boolean z) {
ReadOnlyInfo readOnlyInfo;
List<Akeychat.ServerArea> areasList;
com.google.protobuf.v sensitiveWords2List;
Log.debug("AppConfigManager", "handleSyncGlobalConfigureResponse " + globalParamsSyncResponse.toString());
if (globalParamsSyncResponse.hasSystemShowPhonenumberToFriend()) {
boolean systemShowPhonenumberToFriend = globalParamsSyncResponse.getSystemShowPhonenumberToFriend();
this.A = systemShowPhonenumberToFriend;
updateSimpleData("simple_show_number_by_system", Boolean.toString(systemShowPhonenumberToFriend));
ak.im.utils.j4.sendEvent(new ak.event.i6());
}
if (globalParamsSyncResponse.hasUserShowPhonenumberToFriend()) {
boolean userShowPhonenumberToFriend = globalParamsSyncResponse.getUserShowPhonenumberToFriend();
this.B = userShowPhonenumberToFriend;
updateSimpleData("simple_allow_show_number_by_user", Boolean.toString(userShowPhonenumberToFriend));
ak.im.utils.j4.sendEvent(new ak.event.i6());
}
if (globalParamsSyncResponse.hasIsPhoneSearchSwitch()) {
boolean isPhoneSearchSwitch = globalParamsSyncResponse.getIsPhoneSearchSwitch();
this.C = isPhoneSearchSwitch;
updateSimpleData("simple_search_phone_by_system", Boolean.toString(isPhoneSearchSwitch));
ak.im.utils.j4.sendEvent(new ak.event.q5());
}
if (globalParamsSyncResponse.hasIsPhoneSearchSelfDefinedSwitch()) {
boolean isPhoneSearchSelfDefinedSwitch = globalParamsSyncResponse.getIsPhoneSearchSelfDefinedSwitch();
this.D = isPhoneSearchSelfDefinedSwitch;
updateSimpleData("simple_allow_search_phone_by_user", Boolean.toString(isPhoneSearchSelfDefinedSwitch));
ak.im.utils.j4.sendEvent(new ak.event.q5());
}
if (globalParamsSyncResponse.hasAutoAddFriend()) {
boolean autoAddFriend = globalParamsSyncResponse.getAutoAddFriend();
this.K = autoAddFriend;
updateSimpleData("auto_add_friend", Boolean.toString(autoAddFriend));
}
if (globalParamsSyncResponse.hasForbiddenEditUserBasicinfo()) {
setForbiddenModifyBasicInfo(globalParamsSyncResponse.getForbiddenEditUserBasicinfo());
updateSimpleData("asdsddweer", Boolean.toString(isForbiddenModifyBasicInfo()));
}
if (globalParamsSyncResponse.hasSupportPlainMode()) {
boolean isSecurity = AKeyManager.isSecurity();
boolean z2 = this.L;
boolean supportPlainMode = globalParamsSyncResponse.getSupportPlainMode();
this.L = supportPlainMode;
if (!isSecurity && z2 && !supportPlainMode) {
AKeyManager.getInstance().openSecMode(ak.im.o1.get());
}
updateSimpleData("A346D942128980C3", Boolean.toString(this.L));
ak.im.utils.j4.sendEvent(new ak.event.x1());
}
if (globalParamsSyncResponse.hasSupportGroupWatermark()) {
setSupportGroupWatermark(globalParamsSyncResponse.getSupportGroupWatermark());
ak.im.utils.j4.sendEvent(new ak.event.d8(isSupportGroupWatermark()));
updateSimpleData("CF3A20CE2722FB13", Boolean.toString(isSupportGroupWatermark()));
}
if (globalParamsSyncResponse.hasSupportCaCertificate()) {
setSupportCA(globalParamsSyncResponse.getSupportCaCertificate());
ak.im.utils.j4.sendEvent(new ak.event.a7(isSupportCA()));
updateSimpleData("DA3F06B750C80B56", Boolean.toString(isSupportCA()));
}
if (globalParamsSyncResponse.hasSupportNews()) {
setSupportNews(globalParamsSyncResponse.getSupportNews());
ak.im.utils.j4.sendEvent(new ak.event.d7());
updateSimpleData("3D88B1896623499C", Boolean.toString(this.W));
}
if (globalParamsSyncResponse.hasWorkspace()) {
Akeychat.Workspace workspace = globalParamsSyncResponse.getWorkspace();
Log.w("AppConfigManager", "check workspace:" + workspace);
if (workspace != null) {
setmWorkspace(workspace);
long updateSimpleData = updateSimpleData("V09SS1NQQUNF", ak.comm.d.encodeBytes(workspace.toByteArray()));
Log.w("AppConfigManager", "check save result:" + updateSimpleData);
ak.im.utils.j4.sendEvent(new ak.event.g8());
}
}
if (globalParamsSyncResponse.hasSupportFileSend()) {
setSupportFileSend(globalParamsSyncResponse.getSupportFileSend());
updateSimpleData("8256842059b04291", Boolean.toString(isSupportFileSend()));
ak.im.utils.j4.sendEvent(new ak.event.c7(isSupportFileSend()));
}
if (globalParamsSyncResponse.hasSupportWorkflow()) {
setSupportWorkflow(globalParamsSyncResponse.getSupportWorkflow());
updateSimpleData("d0c238e10c1b9b26", Boolean.toString(isSupportWorkflow()));
ak.im.utils.j4.sendEvent(new ak.event.f8(isSupportWorkflowWithOA()));
}
if (globalParamsSyncResponse.hasSupportDlp()) {
setSupportDLP(globalParamsSyncResponse.getSupportDlp());
updateSimpleData("59d48dd45671061af77ecea023f96936", Boolean.toString(isSupportDLP()));
ak.im.utils.j4.sendEvent(new ak.event.z0(isSupportDLP()));
}
if (globalParamsSyncResponse.hasJgLicense()) {
O0(globalParamsSyncResponse.getJgLicense().getLicense());
updateSimpleData("6BBBF07B7A3C7315", this.Q0);
}
if (globalParamsSyncResponse.hasSupportEnvelopeIntegral()) {
setSupportRedPacket(globalParamsSyncResponse.getSupportEnvelopeIntegral());
updateSimpleData("4CF9175D84DBA27E07E1B032E1522671", Boolean.toString(isSupportRedPacket()));
ak.im.utils.j4.sendEvent(new ak.event.a4(isSupportRedPacket()));
}
if (globalParamsSyncResponse.hasSupportBurningAfterReading()) {
setSupportBurnFeature(globalParamsSyncResponse.getSupportBurningAfterReading());
updateSimpleData("simple_burn_feature", Boolean.toString(isSupportBurnFeature()));
ak.im.utils.j4.sendEvent(new ak.event.z6(isSupportBurnFeature()));
}
if (globalParamsSyncResponse.getSensitiveWordsCount() > 0) {
com.google.protobuf.v sensitiveWordsList = globalParamsSyncResponse.getSensitiveWordsList();
if (sensitiveWordsList != null) {
setSensitiveWords(sensitiveWordsList);
JSONArray jSONArray = new JSONArray();
jSONArray.addAll(sensitiveWordsList);
long updateSimpleData2 = updateSimpleData("8b78b60213c2c57c", jSONArray.toJSONString());
Log.w("AppConfigManager", "check save result:" + updateSimpleData2);
ak.im.utils.j4.sendEvent(new ak.event.g8());
}
this.Y = sensitiveWordsList;
}
if (globalParamsSyncResponse.getSensitiveWords2Count() > 0 && (sensitiveWords2List = globalParamsSyncResponse.getSensitiveWords2List()) != null) {
setSensitives(sensitiveWords2List);
JSONArray jSONArray2 = new JSONArray();
jSONArray2.addAll(sensitiveWords2List);
long updateSimpleData3 = updateSimpleData("fa26fbc6fe813982", jSONArray2.toJSONString());
Log.w("AppConfigManager", "check save result2:" + updateSimpleData3);
}
if (globalParamsSyncResponse.getSensitiveWords2StrategyCount() > 0) {
List<Integer> sensitiveWords2StrategyList = globalParamsSyncResponse.getSensitiveWords2StrategyList();
if (sensitiveWords2StrategyList.size() > 0) {
HashSet<Integer> hashSet = new HashSet<>(sensitiveWords2StrategyList);
setSensitivesMapping(hashSet);
JSONArray jSONArray3 = new JSONArray();
jSONArray3.addAll(hashSet);
long updateSimpleData4 = updateSimpleData("731f64cb0c528250", jSONArray3.toJSONString());
Log.w("AppConfigManager", "check save result2s:" + updateSimpleData4);
}
}
if (globalParamsSyncResponse.hasCleanSensitiveWords2AndStrategy() && globalParamsSyncResponse.getCleanSensitiveWords2AndStrategy()) {
this.q1.clear();
this.r1.clear();
updateSimpleData("731f64cb0c528250", "");
updateSimpleData("fa26fbc6fe813982", "");
}
if (globalParamsSyncResponse.getAreasCount() > 0 && (areasList = globalParamsSyncResponse.getAreasList()) != null) {
try {
this.h = areasList;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
new ObjectOutputStream(byteArrayOutputStream).writeObject(areasList);
long updateSimpleData5 = updateSimpleData("simple_server_areas", ak.comm.d.encodeBytes(byteArrayOutputStream.toByteArray()));
Log.w("AppConfigManager", "check save result:" + updateSimpleData5);
} catch (IOException e2) {
e2.printStackTrace();
}
}
if (globalParamsSyncResponse.hasSupportGroupReadReceipts()) {
setSupportGroupReceipt(globalParamsSyncResponse.getSupportGroupReadReceipts());
updateSimpleData("simple_support_group_receipt", Boolean.toString(isSupportGroupReceipt()));
ak.im.utils.j4.sendEvent(new ak.event.n2(isSupportGroupReceipt()));
}
if (globalParamsSyncResponse.hasMucMaxMemberCount()) {
setmMaxMemberCount(globalParamsSyncResponse.getMucMaxMemberCount());
updateSimpleData("simple_group_max_member_count", Integer.toString(getmMaxMemberCount()));
ak.im.utils.j4.sendEvent(new ak.event.e2(getmMaxMemberCount()));
}
if (globalParamsSyncResponse.hasCustomerServiceModule()) {
setSupportCustomService(globalParamsSyncResponse.getCustomerServiceModule());
updateSimpleData("suport_custom_service", Boolean.toString(isSupportCustomService()));
nf.getInstance().processCustomerServiceSwitch();
ak.im.utils.j4.sendEvent(new ak.event.b7(isSupportCustomService()));
}
if (globalParamsSyncResponse.hasPublicDisplayMucroomCount()) {
setPublicDisplayMucroomCount(globalParamsSyncResponse.getPublicDisplayMucroomCount());
updateSimpleData("simple_show_group_num_by_system", Boolean.toString(isPublicDisplayMucroomCount()));
ak.im.utils.j4.sendEvent(new ak.event.h6());
}
if (globalParamsSyncResponse.hasBoxOwnerUsername()) {
String boxOwnerUsername = globalParamsSyncResponse.getBoxOwnerUsername();
Log.d("lwx", "master is " + boxOwnerUsername + " " + getBoxMasterName());
if (nf.getInstance().getUserMe().getName().equals(boxOwnerUsername) && !boxOwnerUsername.equals(getBoxMasterName())) {
if (z) {
j("您已经成为盒主,可在APP上管理盒子成员");
}
ak.im.utils.j4.sendEvent(new ak.event.q());
} else if (nf.getInstance().getUserMe().getName().equals(getBoxMasterName()) && !boxOwnerUsername.equals(nf.getInstance().getUserMe().getName())) {
j("您已经被取消盒主身份");
ak.im.utils.j4.sendEvent(new ak.event.x());
AKApplication.closeAllBoxManagerActivity();
}
setBoxMasterName(boxOwnerUsername);
updateSimpleData("simple_box_master_name", boxOwnerUsername);
}
if (globalParamsSyncResponse.hasDocReadOnlyInfoV2() || globalParamsSyncResponse.hasDocReadOnlyInfo()) {
if (globalParamsSyncResponse.hasDocReadOnlyInfoV2()) {
Akeychat.DocReadOnlyInfoV2 docReadOnlyInfoV2 = globalParamsSyncResponse.getDocReadOnlyInfoV2();
readOnlyInfo = new ReadOnlyInfo(docReadOnlyInfoV2.getFuncOpen(), docReadOnlyInfoV2.getForceUseType().getNumber(), docReadOnlyInfoV2.getDesktopOpen(), docReadOnlyInfoV2.getDocOpen(), docReadOnlyInfoV2.getAudioVedioOpen(), docReadOnlyInfoV2.getImageOpen(), docReadOnlyInfoV2.getZipOpen());
} else {
Akeychat.DocReadOnlyInfo docReadOnlyInfo = globalParamsSyncResponse.getDocReadOnlyInfo();
readOnlyInfo = new ReadOnlyInfo(docReadOnlyInfo.getFuncOpen(), docReadOnlyInfo.getForceUse(), docReadOnlyInfo.getDesktopOpen(), docReadOnlyInfo.getDocOpen(), docReadOnlyInfo.getAudioVedioOpen(), docReadOnlyInfo.getImageOpen(), docReadOnlyInfo.getZipOpen());
}
ReadOnlyInfo readOnlyInfo2 = getReadOnlyInfo();
if (readOnlyInfo2 != null && readOnlyInfo2.isForceUse() && !readOnlyInfo.isForceUse()) {
SessionManager.getInstance().setSessionsOnlyReadStatus(false);
ak.im.utils.j4.sendEvent(new ak.event.q0());
}
if (readOnlyInfo2 != null && readOnlyInfo2.isFunc_open() && !readOnlyInfo.isFunc_open()) {
SessionManager.getInstance().setSessionsOnlyReadStatus(false);
}
setReadOnlyInfo(readOnlyInfo);
updateSimpleData("simple_only_read", ReadOnlyInfo.getData(readOnlyInfo));
ak.im.utils.j4.sendEvent(new ak.event.x3());
}
if (globalParamsSyncResponse.hasIsAkeyidSearchSwitch()) {
setAkeyIdSwitch(Boolean.toString(globalParamsSyncResponse.getIsAkeyidSearchSwitch()));
updateSimpleData("simple_akey_switch", Boolean.toString(globalParamsSyncResponse.getIsAkeyidSearchSwitch()));
ak.im.utils.j4.sendEvent(new ak.event.k());
}
Log.i("AppConfigManager", "pyx1 " + globalParamsSyncResponse.hasSinglechatMessageStoreDay());
if (globalParamsSyncResponse.hasSinglechatMessageStoreDay()) {
Log.i("AppConfigManager", "pyx1 " + globalParamsSyncResponse.getSinglechatMessageStoreDay());
setSingleChatMessageStoreDay(globalParamsSyncResponse.getSinglechatMessageStoreDay());
updateSimpleData("single_message_store_day", String.valueOf(getSingleChatMessageStoreDay()));
ak.im.utils.j4.sendEvent(new ak.event.d());
}
Log.i("AppConfigManager", "pyx2 " + globalParamsSyncResponse.hasGroupchatMessageStoreDay());
if (globalParamsSyncResponse.hasGroupchatMessageStoreDay()) {
Log.i("AppConfigManager", "pyx2 " + globalParamsSyncResponse.getGroupchatMessageStoreDay());
setGroupChatMessageStoreDay(globalParamsSyncResponse.getGroupchatMessageStoreDay());
updateSimpleData("group_message_store_day", String.valueOf(getGroupChatMessageStoreDay()));
ak.im.utils.j4.sendEvent(new ak.event.d());
}
Log.i("AppConfigManager", "pyx3 " + globalParamsSyncResponse.hasSinglechatMessageStoreDayUsedForMiyun());
if (globalParamsSyncResponse.hasSinglechatMessageStoreDayUsedForMiyun()) {
Log.i("AppConfigManager", "pyx3 " + globalParamsSyncResponse.getSinglechatMessageStoreDayUsedForMiyun());
setSingleChatMessageStoreDayUsedForMiyun(globalParamsSyncResponse.getSinglechatMessageStoreDayUsedForMiyun());
updateSimpleData("single_message_store_for_miyun", Boolean.toString(isSingleChatMessageStoreDayUsedForMiyun()));
ak.im.utils.j4.sendEvent(new ak.event.d());
}
if (globalParamsSyncResponse.hasPublicUserInterfaceSwitch()) {
boolean publicUserInterfaceSwitch = globalParamsSyncResponse.getPublicUserInterfaceSwitch();
Log.i("AppConfigManager", "lwxhas hasPublicUserInterfaceSwitch is " + publicUserInterfaceSwitch);
updateSimpleData("PublicUserInterface", Boolean.toString(publicUserInterfaceSwitch));
setShowAddress(publicUserInterfaceSwitch);
ak.im.utils.j4.sendEvent(new ak.event.j());
}
if (globalParamsSyncResponse.hasRosterCountLimit()) {
int rosterCountLimit = globalParamsSyncResponse.getRosterCountLimit();
Log.i("AppConfigManager", "rosterCountLimit is " + rosterCountLimit);
updateSimpleData("roster_count_limit", String.valueOf(rosterCountLimit));
setLimitNumForFriend(rosterCountLimit);
}
if (globalParamsSyncResponse.hasMucVoip()) {
boolean mucVoip = globalParamsSyncResponse.getMucVoip();
updateSimpleData("can_group_muc", Boolean.toString(mucVoip));
setCanMucAudio(mucVoip);
ak.im.utils.j4.sendEvent(new ak.event.c0());
}
if (globalParamsSyncResponse.hasVersion()) {
String version = globalParamsSyncResponse.getVersion();
Log.debug("AppConfigManager", "server version is " + version);
updateSimpleData("server_version", version);
setServerVersion(version);
}
if (globalParamsSyncResponse.hasContainsFeedbackOperatorList()) {
ArrayList arrayList = new ArrayList();
if (globalParamsSyncResponse.getFeedbackOperatorCount() > 0) {
arrayList.addAll(globalParamsSyncResponse.getFeedbackOperatorList());
}
String jSONString = JSON.toJSONString(arrayList);
Log.i("AppConfigManager", "changed feed back maseter," + jSONString);
updateSimpleData("feedback_master_name", jSONString);
boolean isFeedBackMaster = isFeedBackMaster();
setFeedBackMaster(arrayList.contains(getUsername()));
if (!isFeedBackMaster && isFeedBackMaster() && z && getInstance().supportFeedback()) {
new ak.worker.g2(new ak.worker.h2() {
@Override
public final int execut() {
int syncFeedbackSession;
syncFeedbackSession = SessionManager.getInstance().syncFeedbackSession(false);
return syncFeedbackSession;
}
}, "sync-all-feedback").execute();
}
ak.im.utils.j4.sendEvent(new ak.event.a0(isFeedBackMaster));
}
if (globalParamsSyncResponse.hasRiskStatus()) {
String name = globalParamsSyncResponse.getRiskStatus().name();
updateSimpleData("server_status", name);
getInstance().setServerStatus(name);
}
if (globalParamsSyncResponse.hasRiskStrategy()) {
try {
String riskStrategy = globalParamsSyncResponse.getRiskStrategy();
ReportBean reportBean = null;
try {
reportBean = (ReportBean) JSON.parseObject(riskStrategy, ReportBean.class);
} catch (Exception unused) {
Log.e("AppConfigManager", "ReportBean json is wrong," + riskStrategy);
}
checkAndUpdateReportBean(reportBean);
if (z && needCheckSensitive()) {
if (AKCAppConfiguration.a.supportSurveillance()) {
AKCSensitiveUtils.a.getInstance().reset();
}
getInstance().updateAndInitReportBean();
}
} catch (Exception e3) {
e3.printStackTrace();
}
}
SyncManager.getSingleton().updateSyncInfo("global_conf", globalParamsSyncResponse.getVersioncode());
return 0;
}
public synchronized void init(long j2) {
if (j2 == 1) {
H();
w0();
G();
savePhone(this.j.getPhone());
saveEnterpriseConfig();
saveLoginConfig();
} else {
E0();
F0();
G();
}
l();
if (this.n.getCurrentEnterpriseInfo() != null) {
EnterpriseInfo currentEnterpriseInfo = this.n.getCurrentEnterpriseInfo();
Log.i("lwxtestid", "here " + currentEnterpriseInfo.discoverServerIP);
TextUtils.isEmpty(getServerId());
if (TextUtils.isEmpty(getServerId())) {
setServerId(currentEnterpriseInfo.discoverServerIP);
}
}
Log.w("AppConfigManager", "init login config: " + this.j);
this.o = new SecurityConfig();
setPwdSetDate(C().getLong("1AD-23-S12", 0L));
setPwdSaveValidDate(C().getInt("123sdffds", -1));
setNewEncryptedSp();
try {
String string = C().getString("black_list", "");
String[] split = string.split("\n");
if (split.length > 0) {
this.u1.addAll(Arrays.asList(split));
}
Log.i("AppConfigManager", "lwxblack list is " + string);
} catch (Exception e2) {
C().putString("black_list", "");
e2.printStackTrace();
}
try {
JSONObject jSONObject = (JSONObject) JSON.parse(C().getString("need_upload_black_list", ""));
Log.i("AppConfigManager", "lwxblack map is " + jSONObject.toJSONString());
for (String str : jSONObject.keySet()) {
this.w1.put(str, Long.valueOf(jSONObject.getLongValue(str)));
}
} catch (Exception e3) {
C().putString("need_upload_black_list", "");
e3.printStackTrace();
}
try {
String string2 = C().getString("black_list_report", "");
if (!TextUtils.isEmpty(string2)) {
this.v1 = JSON.parseArray(string2);
}
Log.i("AppConfigManager", "lwxblack needUploadBlacklist is " + string2);
} catch (Exception e4) {
C().putString("black_list_report", "");
e4.printStackTrace();
}
this.c2 = getMMKV().getBoolean("is_one_key_login", false);
int i2 = getMMKV().getInt("choose_lan", 0);
this.i2 = i2;
if (i2 != 0) {
ak.im.utils.s4.getInstance(this.i).setCurrentLanguage(this.i2);
}
}
public void initDBHelper(ak.db.c cVar) {
this.u = cVar;
}
public String isAkeyIdSwitch() {
return this.Y0;
}
public boolean isAllowAutoAddFriend() {
return this.K;
}
public synchronized boolean isAllowFindSatelliteDevice() {
return this.H;
}
public boolean isAllowSearchUserByPhoneDefined() {
return this.D;
}
public boolean isAllowShowNumberToFriendByUser() {
return this.B;
}
public boolean isBoxOffLine() {
return this.h2;
}
public boolean isCanMucAudio() {
return this.Z1;
}
public boolean isChosenLogin() {
return this.d0;
}
public boolean isClosePushWhenDesktopActive() {
return this.d1;
}
public synchronized boolean isConstraintUnSec() {
return this.o.isConstraintUnSec();
}
public boolean isFeedBackMaster() {
return this.x0;
}
public boolean isFeedbackMapHadUnRead() {
return this.u0;
}
public boolean isFeedbackModel() {
return this.o2;
}
public boolean isFirstToRequestPermission(String str) {
boolean z = getMMKV().getBoolean(str, true);
if (z && !str.equals("android.permission.CAMERA") && !str.equals("android.permission.RECORD_AUDIO")) {
getMMKV().putBoolean(str, false);
}
return z;
}
public boolean isFirstToShow() {
return this.Y1;
}
public boolean isFixedTopChat() {
return this.S;
}
public boolean isForbiddenModifyBasicInfo() {
return this.T;
}
public boolean isHadClosedMessageNotifyTips() {
return this.O1;
}
public boolean isHadClosedSipNotifyTips() {
return this.P1;
}
public boolean isHadClosedSysTemNotify() {
return this.G1;
}
public boolean isHadClosedSysTemTips() {
return this.I1;
}
public boolean isHadDeleteRoot() {
return getMMKV().getBoolean("hadDeleteRootNew", false);
}
public boolean isHadGotoNotifyWeb() {
return this.R1;
}
public boolean isHadGotoNotifyWebForNormal() {
return this.T1;
}
public boolean isHadGotoNotifyWebForSip() {
return this.S1;
}
public boolean isHadOpenRead() {
return this.l;
}
public boolean isHadStartForeground() {
return this.X1;
}
public boolean isHadSysTemNotify() {
return this.H1;
}
public boolean isHadSysTemTips() {
return this.J1;
}
public boolean isIgnoreCanLeave() {
return this.m2;
}
public boolean isInstallFromUpdate(Context context) {
try {
return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).firstInstallTime != context.getPackageManager().getPackageInfo(context.getPackageName(), 0).lastUpdateTime;
} catch (PackageManager.NameNotFoundException e2) {
e2.printStackTrace();
return false;
}
}
public boolean isIsstopdownloadover() {
return this.r;
}
public boolean isLoginByFeedBack() {
return this.n2;
}
public boolean isMasterDevice() {
Role roleById;
User userMe = nf.getInstance().getUserMe();
return userMe != null && (roleById = jf.getInstance().getRoleById(userMe.getUser_role_id())) != null && roleById.isTrustdevicelogin() && this.F0;
}
public boolean isMasterForBox() {
return getUsername() != null && getUsername().equals(getBoxMasterName());
}
public boolean isNeedAnyOfficeLogin() {
return (getmUserNameFromIntent() == null || getmPasswordFromIntent() == null) ? false : true;
}
public boolean isNormalMessageSwitch() {
return this.U1;
}
public boolean isOldServer() {
return isOldServer(new int[]{12, 7, pjsip_transport_type_e.PJSIP_TRANSPORT_UDP6});
}
public boolean isOneKeyLogin() {
return this.c2;
}
public synchronized boolean isOnline() {
return this.j.isOnline();
}
public boolean isOnlineBoxByJid(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
String serverIdByJid = getServerIdByJid(str);
if (TextUtils.isEmpty(serverIdByJid) || getServerStatusMap() == null) {
return false;
}
return "available".equals(getServerStatusMap().get(serverIdByJid));
}
public boolean isOnlyReadSession() {
if (this.W0 != null) {
Log.i("AppConfigManager", "readOnlyInfo is not null");
return this.W0.isFunc_open() && this.W0.isForceUse();
}
Log.i("AppConfigManager", "readOnlyInfo is null");
return false;
}
public boolean isOpenForeground() {
return this.W1;
}
public boolean isProjectMode() {
return this.i.getSharedPreferences("simple_data", 0).getBoolean("is_project_mode", false);
}
public boolean isPublicDisplayMucroomCount() {
return this.E;
}
public boolean isPwdInvalid() {
int i2 = this.B0;
if (i2 <= 0) {
return false;
}
return this.C0 + (((long) (((i2 * 24) * 60) * 60)) * 1000) < ak.im.utils.f4.getRightTime();
}
public synchronized boolean isScanABKey() {
return false;
}
public synchronized boolean isScanning() {
return this.q;
}
public boolean isSearchUserByPhoneSystem() {
return this.C;
}
public synchronized boolean isSecModeSwitchHide() {
return this.o.isSecModeSwitchHide();
}
public synchronized boolean isSecurityAutoClose() {
return this.o.isAutoClose();
}
public boolean isShowAddress() {
return this.w0;
}
public boolean isShowNumberToFriendBySystem() {
return this.A;
}
public boolean isShowOnlyReadIcon() {
ReadOnlyInfo readOnlyInfo;
return getInstance().z().getSwitch().getDocReadonlySwitch() && (readOnlyInfo = this.W0) != null && readOnlyInfo.isFunc_open();
}
public boolean isSign() {
return this.c0;
}
public boolean isSignUp() {
return this.t;
}
public boolean isSingleChatMessageStoreDayUsedForMiyun() {
return this.A0;
}
public boolean isSipMessageSwitch() {
return this.V1;
}
public boolean isSuccessForPush() {
return this.z1;
}
public synchronized boolean isSupportABKey() {
return false;
}
public boolean isSupportApprovalAndSignature() {
if (k()) {
return z().getSwitch().getDocApprovalSignature();
}
return false;
}
public boolean isSupportBurnFeature() {
return this.R;
}
public boolean isSupportCA() {
return this.V;
}
public boolean isSupportCustomService() {
return this.Z;
}
public boolean isSupportDLP() {
return this.O;
}
public boolean isSupportFileSend() {
if (AKCAppConfiguration.a.canIgnoreFileSend()) {
return true;
}
return this.M;
}
public boolean isSupportGroupReceipt() {
return this.Q;
}
public boolean isSupportGroupWatermark() {
return this.U;
}
public boolean isSupportNews() {
if (!getInstance().k()) {
Log.w("AppConfigManager", "license is invalidity");
return false;
} else if (getInstance().z().getSwitch().getNewsSwitch()) {
return this.W;
} else {
return false;
}
}
public boolean isSupportPlainMode() {
return false;
}
public boolean isSupportRedPacket() {
return this.P;
}
public boolean isSupportWorkflow() {
return this.N;
}
public boolean isSupportWorkflowWithOA() {
if (k() && z().getSwitch().getOaSwitch()) {
return this.N;
}
Log.w("AppConfigManager", "license switch is off");
return false;
}
public boolean isToken() {
LoginConfig loginConfig = this.j;
if (loginConfig == null) {
return false;
}
return loginConfig.isToken();
}
public boolean isUseNewEncryptFile() {
return getServer().getFile_encrypt_ver() == 1;
}
public boolean isUserVisibleForMiyun() {
return this.c1;
}
public boolean isWithinScopeOfMaxNum(int i2) {
return this.E1 == -1 || AKCAppConfiguration.a.canIgnoreRosterLimit() || i2 < this.E1;
}
public boolean isWorkspaceOpen() {
if (this.X == null) {
return false;
}
if (k() && z().getSwitch().getWorkspaceSwitch()) {
return this.X.getFuncOpen();
}
Log.w("AppConfigManager", "license switch is off");
return false;
}
public boolean ismSkipClaculatorLockByNotice() {
return this.v;
}
public boolean judgeCanAddByServerId(String str) {
if (TextUtils.isEmpty(str) || getBundServers().size() == 0 || getBundServers().get(str) == null) {
return false;
}
return getBundServers().get(str).getAllowSelfAddFriend();
}
public boolean judgeIsReadStatusFile(String str) {
String str2 = this.a1.get(str);
if (TextUtils.isEmpty(str2)) {
return false;
}
return Boolean.parseBoolean(str2);
}
public boolean judgeOnlyReadByFileName(String str, boolean z, ChatMessage chatMessage) {
String judgeOnlyReadBySwitch = ak.im.utils.l4.judgeOnlyReadBySwitch(str, z);
if (this.W0 == null) {
return false;
}
if (chatMessage != null && "video".equals(chatMessage.getType())) {
judgeOnlyReadBySwitch = "video";
}
judgeOnlyReadBySwitch.hashCode();
char c2 = 65535;
switch (judgeOnlyReadBySwitch.hashCode()) {
case -1268966290:
if (judgeOnlyReadBySwitch.equals("folder")) {
c2 = 0;
break;
}
break;
case -577741570:
if (judgeOnlyReadBySwitch.equals("picture")) {
c2 = 1;
break;
}
break;
case 120609:
if (judgeOnlyReadBySwitch.equals("zip")) {
c2 = 2;
break;
}
break;
case 112202875:
if (judgeOnlyReadBySwitch.equals("video")) {
c2 = 3;
break;
}
break;
case 861720859:
if (judgeOnlyReadBySwitch.equals("document")) {
c2 = 4;
break;
}
break;
}
switch (c2) {
case 0:
case 2:
return this.W0.isZip_open();
case 1:
return this.W0.isImage_open();
case 3:
return this.W0.isAudio_vedio_open();
case 4:
return this.W0.isDoc_open();
default:
return false;
}
}
public void judgeTiming(io.reactivex.z<Object> zVar) {
a aVar = new a();
if (Thread.currentThread().getId() == Looper.getMainLooper().getThread().getId()) {
zVar.subscribeOn(io.reactivex.w0.a.io()).subscribe(aVar);
} else {
zVar.subscribe(aVar);
}
}
public boolean kickDeskTop(Akeychat.DesktopStatusInfo desktopStatusInfo) {
try {
Akeychat.OpBaseResult result = ((ak.smack.t1) XMPPConnectionManager.a.getInstance().sendIQDirectly(new ak.smack.t1(desktopStatusInfo.getResource()))).getmResponse().getResult();
if (result.getReturnCode() == 0) {
getInstance().getDesktopStatusInfos().remove(desktopStatusInfo);
return true;
}
Log.i("AppConfigManager", "queryDesktopStatus failed , " + result.getReturnCode() + "," + result.getDescription());
return false;
} catch (Exception e2) {
Log.i("AppConfigManager", "queryDesktopStatus error," + e2.getMessage());
AkeyChatUtils.logException(e2);
return false;
}
}
public synchronized void loadAppLockConfig() {
ff.a aVar = ff.a;
this.o.setLockMode(aVar.getInstance().getLockMode());
this.o.setPatternUnlockCode(aVar.getInstance().getPatternUnlockCode());
}
public void loadBlackListFromServer() {
judgeTiming(io.reactivex.z.just("").map(new m()));
}
public void loadCAData() {
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add("d3bcc5b2e4d580e3");
List<QueryModel<String, String>> D = D(arrayList);
if (D.size() == 0) {
Log.w("AppConfigManager", "nothing local ca info");
return;
}
JSONObject parseObject = JSON.parseObject(decryptedContent(D.get(0).getValue()));
if (parseObject == null) {
Log.w("AppConfigManager", "nothing ca data");
} else {
K0(parseObject.getString("name"), parseObject.getString("phone"), parseObject.getString("id"), parseObject.getString("pin"));
}
}
public void loadLicenseInfoFromServer() {
XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.v1(nf.getIQFromTo())).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Stanza stanza = (Stanza) obj;
ye.c0(stanza);
return stanza;
}
}).subscribe(new h());
}
public void loadPrivacyConfig() {
this.m = ff.a.getInstance().getPrivacyConfig();
Log.i("AppConfigManager", "privacy cfg:" + this.m.toString());
}
public synchronized void loadSecurityConfig() {
this.o.setSecModePasscode(getMMKV().getString("security_cfg_sec_mode_passcode", null));
ff.a aVar = ff.a;
this.o.setSecModeSwitchHide(aVar.getInstance().getPrivacySwitch("secModeSwitchHidden"));
this.o.setAutoClose(aVar.getInstance().getPrivacySwitch("securityModeAutoClose"));
boolean privacySwitch = aVar.getInstance().getPrivacySwitch("autoScanABKey");
if (!getInstance().isSupportABKey()) {
privacySwitch = false;
}
this.o.setScanABKey(privacySwitch);
loadAppLockConfig();
Log.i("AppConfigManager", "mSecurityCfg cfg:" + this.o.toString());
}
public ArrayList<Akeychat.ServerSyncResponseV2> loadServersFromDB() {
List queryForList = v().queryForList(new c.b() {
@Override
public final Object mapRow(Cursor cursor, int i2) {
return ye.this.e0(cursor, i2);
}
}, "SELECT * FROM servers", null);
ArrayList<Akeychat.ServerSyncResponseV2> arrayList = new ArrayList<>();
if (queryForList != null) {
arrayList.addAll(queryForList);
}
return arrayList;
}
public void loadSimpleData() {
String str;
String str2;
Iterator<QueryModel<String, String>> it;
String str3;
String str4;
String str5;
String str6;
String str7;
if (TextUtils.isEmpty(getUsername())) {
Log.w("AppConfigManager", "user name is null do not load it");
return;
}
ArrayList<String> arrayList = new ArrayList<>();
String str8 = "auto_add_friend";
arrayList.add("auto_add_friend");
String str9 = "asdsddweer";
arrayList.add("asdsddweer");
arrayList.add("A346D942128980C3");
arrayList.add("8256842059b04291");
arrayList.add("CF3A20CE2722FB13");
arrayList.add("DA3F06B750C80B56");
arrayList.add("3D88B1896623499C");
arrayList.add("V09SS1NQQUNF");
arrayList.add("d0c238e10c1b9b26");
arrayList.add("59d48dd45671061af77ecea023f96936");
arrayList.add("8b78b60213c2c57c");
arrayList.add("fa26fbc6fe813982");
arrayList.add("731f64cb0c528250");
String str10 = "731f64cb0c528250";
arrayList.add("simple_server_areas");
String str11 = "simple_server_areas";
arrayList.add("E9A8A6232F18841D");
String str12 = "E9A8A6232F18841D";
arrayList.add("F42F5AE19D649066");
String str13 = "F42F5AE19D649066";
arrayList.add("simple_support_group_receipt");
String str14 = "fa26fbc6fe813982";
arrayList.add("simple_fixed_top_chat");
String str15 = "8b78b60213c2c57c";
arrayList.add("4CF9175D84DBA27E07E1B032E1522671");
String str16 = "AppConfigManager";
String str17 = "simple_burn_feature";
arrayList.add("simple_burn_feature");
String str18 = "V09SS1NQQUNF";
arrayList.add("simple_group_max_member_count");
String str19 = "simple_group_max_member_count";
arrayList.add("suport_custom_service");
arrayList.add("simple_show_number_by_system");
arrayList.add("simple_allow_show_number_by_user");
arrayList.add("simple_search_phone_by_system");
arrayList.add("simple_allow_search_phone_by_user");
arrayList.add("simple_show_group_num_by_system");
arrayList.add("simple_box_master_name");
arrayList.add("simple_only_read");
arrayList.add("simple_akey_switch");
arrayList.add("single_message_store_day");
arrayList.add("group_message_store_day");
arrayList.add("single_message_store_for_miyun");
arrayList.add("PublicUserInterface");
arrayList.add("roster_count_limit");
arrayList.add("can_group_muc");
arrayList.add("server_version");
arrayList.add("feedback_master_name");
arrayList.add("feedback_map_show_pop");
arrayList.add("feedback_global_clear_time");
arrayList.add("simple_report_bean");
arrayList.add("server_status");
List<QueryModel<String, String>> D = D(arrayList);
if (D == null || D.size() <= 0) {
return;
}
Iterator<QueryModel<String, String>> it2 = D.iterator();
while (it2.hasNext()) {
QueryModel<String, String> next = it2.next();
if (next != null) {
it = it2;
String key = next.getKey();
if (str8.equals(key)) {
setAllowAutoAddFriend(Boolean.parseBoolean(next.getValue()));
} else if (str9.equals(key)) {
setForbiddenModifyBasicInfo(Boolean.parseBoolean(next.getValue()));
} else if ("A346D942128980C3".equals(key)) {
setSupportPlainMode(Boolean.parseBoolean(next.getValue()));
} else if ("8256842059b04291".equals(key)) {
setSupportFileSend(Boolean.parseBoolean(next.getValue()));
} else if ("CF3A20CE2722FB13".equals(key)) {
setSupportGroupWatermark(Boolean.parseBoolean(next.getValue()));
} else if ("DA3F06B750C80B56".equals(key)) {
setSupportCA(Boolean.parseBoolean(next.getValue()));
} else if ("3D88B1896623499C".equals(key)) {
setSupportNews(Boolean.parseBoolean(next.getValue()));
} else if ("d0c238e10c1b9b26".equals(key)) {
setSupportWorkflow(Boolean.parseBoolean(next.getValue()));
} else if ("59d48dd45671061af77ecea023f96936".equals(key)) {
setSupportDLP(Boolean.parseBoolean(next.getValue()));
} else if ("simple_support_group_receipt".equals(key)) {
setSupportGroupReceipt(Boolean.parseBoolean(next.getValue()));
} else if ("simple_fixed_top_chat".equals(key)) {
setFixedTopChat(Boolean.parseBoolean(next.getValue()));
} else if ("4CF9175D84DBA27E07E1B032E1522671".equals(key)) {
setSupportRedPacket(Boolean.parseBoolean(next.getValue()));
} else if (str17.equals(key)) {
setSupportBurnFeature(Boolean.parseBoolean(next.getValue()));
} else {
str = str17;
String str20 = str18;
if (str20.equals(key)) {
try {
setmWorkspace(Akeychat.Workspace.parseFrom(ak.comm.d.decode(next.getValue())));
str7 = str16;
} catch (IOException e2) {
e = e2;
str7 = str16;
}
try {
Log.i(str7, "check workspace:" + getmWorkspace().toString());
str18 = str20;
} catch (IOException e3) {
e = e3;
str18 = str20;
Log.w(str7, "load workspace failed");
e.printStackTrace();
str2 = str9;
str5 = str12;
str3 = str15;
str4 = str8;
str6 = str7;
str12 = str5;
str17 = str;
it2 = it;
str9 = str2;
String str21 = str3;
str16 = str6;
str8 = str4;
str15 = str21;
}
str2 = str9;
str5 = str12;
str3 = str15;
str4 = str8;
str6 = str7;
} else {
str18 = str20;
String str22 = str15;
str4 = str8;
str6 = str16;
if (str22.equals(key)) {
JSONArray parseArray = JSON.parseArray(next.getValue());
if (parseArray != null) {
List<String> list = this.Y;
if (list == null) {
this.Y = new com.google.protobuf.n();
} else {
list.clear();
}
int i2 = 0;
str3 = str22;
while (i2 < parseArray.size()) {
this.Y.add(parseArray.getString(i2));
i2++;
str9 = str9;
}
} else {
str3 = str22;
}
str2 = str9;
} else {
str3 = str22;
str2 = str9;
String str23 = str14;
if (str23.equals(key)) {
JSONArray parseArray2 = JSON.parseArray(next.getValue());
if (parseArray2 != null) {
Log.i(str6, "sensitive is " + parseArray2.toJSONString());
List<String> list2 = this.q1;
if (list2 == null) {
this.q1 = new ArrayList();
} else {
list2.clear();
}
try {
setSensitives(parseArray2.toJavaList(String.class));
} catch (Exception e4) {
e4.printStackTrace();
}
}
str14 = str23;
} else {
String str24 = str10;
if (str24.equals(key)) {
JSONArray parseArray3 = JSON.parseArray(next.getValue());
if (parseArray3 != null) {
StringBuilder sb = new StringBuilder();
str14 = str23;
sb.append("sensitive s is ");
sb.append(parseArray3.toJSONString());
Log.i(str6, sb.toString());
HashSet<Integer> hashSet = this.r1;
if (hashSet == null) {
this.r1 = new HashSet<>();
} else {
hashSet.clear();
}
int i3 = 0;
while (i3 < parseArray3.size()) {
this.r1.add(parseArray3.getInteger(i3));
i3++;
str24 = str24;
}
} else {
str14 = str23;
}
str10 = str24;
} else {
str14 = str23;
str10 = str24;
String str25 = str11;
if (str25.equals(key)) {
try {
this.h = (List) new ObjectInputStream(new ByteArrayInputStream(ak.comm.d.decode(next.getValue()))).readObject();
} catch (Exception e5) {
e5.printStackTrace();
}
Log.i(str6, "check ServerArea:");
str11 = str25;
} else {
str5 = str12;
if (str5.equals(key)) {
setAllowFindSatelliteDevice(Boolean.parseBoolean(next.getValue()));
str11 = str25;
} else {
str11 = str25;
String str26 = str13;
if (str26.equals(key)) {
setConnectedSatelliteDeviceAddress(next.getValue());
str13 = str26;
} else {
str13 = str26;
String str27 = str19;
if (str27.equals(key)) {
setmMaxMemberCount(Integer.parseInt(next.getValue()));
str19 = str27;
} else {
str19 = str27;
if ("suport_custom_service".equals(key)) {
setSupportCustomService(Boolean.parseBoolean(next.getValue()));
} else if ("simple_allow_search_phone_by_user".equals(key)) {
setAllowSearchUserByPhoneDefined(Boolean.parseBoolean(next.getValue()));
} else if ("simple_search_phone_by_system".equals(key)) {
setSearchUserByPhoneSystem(Boolean.parseBoolean(next.getValue()));
} else if ("simple_allow_show_number_by_user".equals(key)) {
setAllowShowNumberToFriendByUser(Boolean.parseBoolean(next.getValue()));
} else if ("simple_show_number_by_system".equals(key)) {
setShowNumberToFriendBySystem(Boolean.parseBoolean(next.getValue()));
} else if ("simple_show_group_num_by_system".equals(key)) {
setPublicDisplayMucroomCount(Boolean.parseBoolean(next.getValue()));
} else if ("simple_box_master_name".equals(key)) {
setBoxMasterName(next.getValue());
} else if ("simple_only_read".equals(key)) {
setReadOnlyInfo(next.getValue());
} else if ("simple_akey_switch".equals(key)) {
setAkeyIdSwitch(next.getValue());
} else if ("single_message_store_day".equals(key)) {
setSingleChatMessageStoreDay(Integer.parseInt(next.getValue()));
} else if ("group_message_store_day".equals(key)) {
setGroupChatMessageStoreDay(Integer.parseInt(next.getValue()));
} else if ("single_message_store_for_miyun".equals(key)) {
setSingleChatMessageStoreDayUsedForMiyun(Boolean.parseBoolean(next.getValue()));
} else if ("PublicUserInterface".equals(key)) {
setShowAddress(Boolean.parseBoolean(next.getValue()));
} else if ("roster_count_limit".equals(key)) {
setLimitNumForFriend(Integer.parseInt(next.getValue()));
} else if ("can_group_muc".equals(key)) {
setCanMucAudio(Boolean.parseBoolean(next.getValue()));
} else if ("server_version".equals(key)) {
setServerVersion(next.getValue());
} else if ("feedback_master_name".equals(key)) {
setFeedBackMaster(next.getValue().contains(getUsername()));
} else if ("feedback_map_show_pop".equals(key)) {
this.u0 = Boolean.parseBoolean(next.getValue());
} else if ("feedback_global_clear_time".equals(key)) {
JSONArray parseArray4 = JSON.parseArray(next.getValue());
if (parseArray4.size() > 0) {
getFeedbackMasterReplyList().addAll(parseArray4.toJavaList(String.class));
}
} else if ("simple_report_bean".equals(key)) {
try {
setReportBean((ReportBean) JSON.parseObject(next.getValue(), ReportBean.class));
} catch (Exception e6) {
AkeyChatUtils.logException(e6);
}
} else if ("server_status".equals(key)) {
setServerStatus(next.getValue());
}
}
}
}
}
}
}
}
str5 = str12;
}
str12 = str5;
str17 = str;
it2 = it;
str9 = str2;
String str212 = str3;
str16 = str6;
str8 = str4;
str15 = str212;
}
str = str17;
str2 = str9;
} else {
str = str17;
str2 = str9;
it = it2;
}
str5 = str12;
String str28 = str15;
str4 = str8;
str6 = str16;
str3 = str28;
str12 = str5;
str17 = str;
it2 = it;
str9 = str2;
String str2122 = str3;
str16 = str6;
str8 = str4;
str15 = str2122;
}
}
public void logSdkFailed() {
getMMKV().putLong("push_sdk_failed_date", ak.im.utils.f4.getRightTime());
getMMKV().putLong("push_sdk_failed_times", getMMKV().getInt("push_sdk_failed_times", 0) + 1);
}
public boolean needCheckSensitive() {
return Akeychat.RiskStatus.surveillance.name().equals(getServerStatus());
}
public boolean needHideComplain() {
return false;
}
public void newClearServerConfig() {
setServerId("");
EnterpriseConfig enterpriseConfig = this.n;
if (enterpriseConfig != null) {
enterpriseConfig.setCurrentEnterprise(null);
}
LoginConfig loginConfig = this.j;
if (loginConfig != null) {
loginConfig.setServer(null);
}
af.getInstance().setmCurrentEnterpriseInfo(null);
C().putString("c3efa684ec28a6ccfc9ca0a1f855c479", "");
}
public void newRestoreChoosedDate(JSONObject jSONObject) {
Long l2;
Log.d("lwxback", "restore json is " + jSONObject.toJSONString());
if (jSONObject.containsKey("69615c092a5d5d84ac037aa65696f051")) {
l2 = jSONObject.getLong("69615c092a5d5d84ac037aa65696f051");
} else {
l2 = 1L;
}
getMMKV().putLong("69615c092a5d5d84ac037aa65696f051", l2.longValue());
String string = jSONObject.getString("11c7fdb5492dca76");
if (l2.longValue() < 2) {
decryptedContent(string);
}
JSONObject jSONObject2 = jSONObject.getJSONObject("7f16ead8b6604a8bb2ee774fc6fd3099");
x().clear();
for (String str : jSONObject2.keySet()) {
String string2 = jSONObject2.getString(str);
x().put(str, string2);
a.put(str, string2, 1);
}
C().putString("c3efa684ec28a6ccfc9ca0a1f855c479", jSONObject.getString("c3efa684ec28a6ccfc9ca0a1f855c479"));
getMMKV().putLong("b9810d5fec350b9ff10671205aaa63b6", 1L).commit();
getMMKV().putString("11c7fdb5492dca76", jSONObject.getString("11c7fdb5492dca76"));
getMMKV().putString("0a6cee4f7ecb1d0c", jSONObject.getString("0a6cee4f7ecb1d0c"));
getMMKV().putString("25924daa3e3520b2d5fd84f72ff05fbb", jSONObject.getString("25924daa3e3520b2d5fd84f72ff05fbb"));
getMMKV().putInt("4eef1db24e30556f9efc3673b4535ba8", jSONObject.getInteger("4eef1db24e30556f9efc3673b4535ba8").intValue());
getMMKV().putString("60f3e77a22b1fcc3103835127f2f4f4f", jSONObject.getString("60f3e77a22b1fcc3103835127f2f4f4f"));
getMMKV().putLong("box_talk_root_id", jSONObject.getLong("box_talk_root_id").longValue());
getMMKV().putBoolean("is_one_key_login", jSONObject.getBoolean("is_one_key_login") != null ? jSONObject.getBoolean("is_one_key_login").booleanValue() : false);
getMMKV().putBoolean("NEW_ENCR_PHONE", jSONObject.containsKey("NEW_ENCR_PHONE") ? jSONObject.getBoolean("NEW_ENCR_PHONE").booleanValue() : false);
Log.d("lwx", "boxrootid is " + jSONObject.getInteger("box_talk_root_id"));
String string3 = jSONObject.getString("server_id");
Log.d("lwx", "SERVER_ID is " + string3);
Log.i("AppConfigManager", "init(version) " + l2);
setServerId(string3);
getMMKV().commit();
init(l2.longValue());
a.logAllData();
}
public io.reactivex.z<Akeychat.OfflienTrustDeviceResponse> offLineDevice(String str) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.r6(str)).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.OfflienTrustDeviceResponse offlienTrustDeviceResponse;
offlienTrustDeviceResponse = ((ak.smack.r6) ((Stanza) obj)).getmResponse();
return offlienTrustDeviceResponse;
}
});
}
public void openABKeyLockSwitch() {
setLockMode(0);
setPatternUnlockCode("");
P0(true);
}
public void openPatternLockSwitch(String str) {
setPatternUnlockCode(str);
setLockMode(1);
P0(true);
}
public EnterpriseInfo parseEnterpriseInfo(Server server, String str) {
EnterpriseInfo enterpriseInfo = null;
try {
if (server == null) {
Log.w("AppConfigManager", "info obj is null");
return null;
}
String enterpriseId = server.getEnterpriseId();
if (!TextUtils.isEmpty(enterpriseId)) {
str = enterpriseId;
}
EnterpriseInfo enterpriseInfo2 = new EnterpriseInfo(str);
try {
enterpriseInfo2.enterpriseName = server.getEnterpriseName();
enterpriseInfo2.enterpriseLogoUrl = server.getEnterpriseLogo();
enterpriseInfo2.enterpriseDescription = server.getEnterpriseDes();
enterpriseInfo2.cloudVendor = server.getCloudFS();
enterpriseInfo2.uploadUrl = server.getQiniuUploadUrlPrefix();
enterpriseInfo2.downloadUrlPrefix = server.getQiniuDownloadUrlPrefix();
enterpriseInfo2.fileBucketName = server.getQiniuFileBucketName();
return enterpriseInfo2;
} catch (Exception e2) {
e = e2;
enterpriseInfo = enterpriseInfo2;
e.printStackTrace();
return enterpriseInfo;
}
} catch (Exception e3) {
e = e3;
}
}
public void putMD5Password(String str) {
getMMKV().putString("c3a48f229e79c40c", str).commit();
}
public List<Akeychat.DesktopStatusInfo> queryDesktopStatus() {
try {
Log.debug("lwxq", "start" + Thread.currentThread().getName());
Log.debug("lwxq", "end");
Akeychat.DesktopStatusListResponse desktopStatusListResponse = ((ak.smack.l3) XMPPConnectionManager.a.getInstance().sendIQDirectly(new ak.smack.l3())).getmResponse();
Akeychat.OpBaseResult result = desktopStatusListResponse.getResult();
if (result.getReturnCode() == 0) {
List<Akeychat.DesktopStatusInfo> desktopStatusInfoList = desktopStatusListResponse.getDesktopStatusInfoList();
this.l2.clear();
this.l2.addAll(desktopStatusInfoList);
bubbleSort(this.l2);
this.k2.clear();
for (Akeychat.DesktopStatusInfo desktopStatusInfo : this.l2) {
this.k2.put(desktopStatusInfo.getResource(), desktopStatusInfo);
}
ak.im.utils.j4.sendEvent(new ak.event.j4());
return desktopStatusInfoList;
}
Log.i("AppConfigManager", "lwxq queryDesktopStatus failed , " + result.getReturnCode() + "," + result.getDescription());
return null;
} catch (Exception e2) {
Log.i("AppConfigManager", "lwxq queryDesktopStatus error," + e2.getMessage());
AkeyChatUtils.logException(e2);
return null;
}
}
public io.reactivex.z<ArrayList<AKWorkspaceApplicationCategory>> queryExternalApp(@NonNull final Context context, final boolean z) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.n3(nf.getIQFromTo())).flatMap(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
io.reactivex.e0 create;
create = io.reactivex.z.create(new io.reactivex.c0() {
@Override
public final void subscribe(io.reactivex.b0 b0Var) {
ye.i0(Stanza.this, b0Var);
}
});
return create;
}
}).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
return ye.this.l0(context, z, (Akeychat.ExternalApplicationsResponse) obj);
}
}).flatMap(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
return ye.this.n0(context, (ArrayList) obj);
}
});
}
public void queryGroupFrequency(ArrayList<String> arrayList) {
if (arrayList == null || arrayList.size() <= 0) {
return;
}
AbstractXMPPConnection connection = XMPPConnectionManager.a.getInstance().getConnection();
if (connection != null && connection.isAuthenticated()) {
ak.smack.q4 q4Var = new ak.smack.q4(arrayList);
StanzaCollector createStanzaCollector = connection.createStanzaCollector(new StanzaIdFilter(q4Var.getStanzaId()));
try {
connection.sendStanza(q4Var);
try {
createStanzaCollector.cancel();
Akeychat.GetSpeechFrequencyLimitCountResponse mResponse = ((ak.smack.q4) createStanzaCollector.nextResult(SmackConfiguration.getDefaultReplyTimeout())).getMResponse();
if (mResponse.getResult().getReturnCode() == 0) {
for (Akeychat.SpeechFrequencyLimitCountInfo speechFrequencyLimitCountInfo : mResponse.getInfoList()) {
String with = SessionManager.getInstance().getAKSessionBySessionId(speechFrequencyLimitCountInfo.getSessionId()).getWith();
int count = (int) speechFrequencyLimitCountInfo.getCount();
if (this.f0.get(with) != null) {
List<GroupSpeakBean> list = getGroupSpeakListMap().get(with);
if (list != null && list.size() > 0) {
if (mResponse.getTimestamp() < ak.im.utils.f4.formatStr2Long(list.get(0).getTime(), "yyyy/MM/dd HH:mm")) {
}
}
this.f0.remove(with);
}
String long2ymFormat = ak.im.utils.f4.long2ymFormat(mResponse.getTimestamp());
ArrayList arrayList2 = new ArrayList();
for (int i2 = 0; i2 < count; i2++) {
arrayList2.add(new GroupSpeakBean(with, "", long2ymFormat));
}
Log.i("AppConfigManager", "groupSpeakListMap put groupName is " + with + ",list size is " + arrayList2.size() + ",time is " + long2ymFormat);
this.f0.put(with, arrayList2);
}
Log.d("AppConfigManager", "query group frequency success");
return;
}
return;
} catch (Exception e2) {
e2.printStackTrace();
return;
}
} catch (Exception e3) {
e3.printStackTrace();
Log.w("AppConfigManager", "encounter excp(fail) when reset group sign .");
return;
}
}
Log.w("AppConfigManager", "connection is null or not authenticated sign failed");
}
public void queryMasterDevice() {
XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.y3()).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.CurrentTrustDeviceTypeResponse currentTrustDeviceTypeResponse;
currentTrustDeviceTypeResponse = ((ak.smack.y3) ((Stanza) obj)).getmResponse();
return currentTrustDeviceTypeResponse;
}
}).observeOn(io.reactivex.w0.a.io()).subscribeOn(io.reactivex.w0.a.io()).subscribe(new g());
}
public void queryRemoteServerStatus() {
if (this.i1.size() == 0) {
Log.w("AppConfigManager", "there is nothing connected server so do not need query ");
return;
}
ak.smack.z4 z4Var = new ak.smack.z4(nf.getIQFromTo());
io.reactivex.z.just(z4Var).map(new k(z4Var)).subscribeOn(io.reactivex.w0.a.io()).subscribe(new j());
}
public boolean readOnlyFuncIsOpean() {
ReadOnlyInfo readOnlyInfo = this.W0;
if (readOnlyInfo == null) {
return false;
}
return readOnlyInfo.isFunc_open();
}
public void removeServerFromRAM(String str) {
ConcurrentHashMap<String, Akeychat.ServerSyncResponseV2> concurrentHashMap;
if (str != null && (concurrentHashMap = this.i1) != null) {
concurrentHashMap.remove(str);
return;
}
Log.w("AppConfigManager", "id or bund servers is null,id:" + str);
}
public io.reactivex.z<Akeychat.PhoneNumberChangeReqResponse> requestChangePhone(String str, String str2) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.b5(nf.getIQFromTo(), str, str2)).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.PhoneNumberChangeReqResponse mResponse;
mResponse = ((ak.smack.b5) ((Stanza) obj)).getMResponse();
return mResponse;
}
});
}
public void resetServerStatus() {
if (this.k1 != null) {
this.k1.clear();
}
}
public void resetUserInfo() {
this.j.setUserNameVersion(1);
this.j.setUsername(null);
this.j.setPassword(null);
this.j.setEncryptedPassword(null);
this.j.setPhone(null);
this.j.setOldUserName(null);
J0(this.j.getUsername());
putMD5Password(this.j.getPassword());
H0(this.j.getEncryptedPassword());
}
public void resetUserInfoExceptUNmae() {
this.j.setPassword(null);
this.j.setEncryptedPassword(null);
this.j.setPhone(null);
this.j.setOldUserName(null);
putMD5Password(this.j.getPassword());
H0(this.j.getEncryptedPassword());
}
public void resetUserInfoForExist() {
this.j.setUserNameVersion(1);
this.j.setPassword(null);
this.j.setEncryptedPassword(null);
this.j.setPhone(null);
this.j.setLoginKey(null);
this.j.setOldUserName(null);
J0(this.j.getUsername());
putMD5Password(this.j.getPassword());
H0(this.j.getEncryptedPassword());
}
public void restoreDeInfo() {
String readFile;
if (this.T0) {
return;
}
this.T0 = true;
try {
Log.i("AppConfigManager", "restore device info");
String newBackupDeviceFilePath = ak.im.utils.l4.getNewBackupDeviceFilePath();
if (!ak.im.utils.l4.isFileExist(newBackupDeviceFilePath) && Build.VERSION.SDK_INT < 30) {
newBackupDeviceFilePath = ak.im.utils.l4.getBackupDeviceFilePath();
if (!ak.im.utils.l4.isFileExist(newBackupDeviceFilePath)) {
Log.d("AppConfigManager", "the backup device file is not exist");
return;
}
}
if (Build.VERSION.SDK_INT >= 30) {
this.R0 = true;
MediaScannerConnection.scanFile(ak.im.o1.get(), new String[]{newBackupDeviceFilePath}, null, new i());
long currentTimeMillis = System.currentTimeMillis();
while (System.currentTimeMillis() - currentTimeMillis < 1000 && this.R0) {
}
this.R0 = false;
Uri uri = this.S0;
this.S0 = null;
readFile = ak.im.utils.l4.readFile(uri);
} else {
readFile = ak.im.utils.l4.readFile(new File(newBackupDeviceFilePath));
}
JSONObject parseObject = JSON.parseObject(readFile);
if (parseObject == null) {
Log.d("AppConfigManager", "jo device is null");
return;
}
String string = parseObject.getString("asim_app_uuid");
if (!TextUtils.isEmpty(string)) {
this.q0 = string;
this.j.setUuid(string);
Log.i("AppConfigManager", "restore device info success , info is " + string);
return;
}
Log.i("AppConfigManager", "save the device info is empty");
} catch (Exception e2) {
Log.e("AppConfigManager", "load device failed");
AkeyChatUtils.logException(e2);
}
}
public synchronized void saveAccountInfos() {
getMMKV().putString(BuildConfig.PRODUCT_PKG_NAME, JSON.toJSONString(this.y));
}
public void saveAnyOfficeInfo(String str, String str2) {
String encryptPasswordByPublicKey = AKeyManager.getInstance().encryptPasswordByPublicKey(str2);
String MD5Encode = ak.comm.i.MD5Encode(str2);
getInstance().setLoginKey(str);
getInstance().savePassword(MD5Encode, encryptPasswordByPublicKey);
}
public void saveBlackList() {
StringBuffer stringBuffer = new StringBuffer();
Iterator<String> it = getBlacklist().iterator();
while (it.hasNext()) {
stringBuffer.append(it.next() + "\n");
}
C().putString("black_list", stringBuffer.toString());
}
public synchronized void saveCollect_log(String str) {
this.j.setCollect_log(str);
getMMKV().putString(CtrlMessage.COLLECT_LOG, this.j.getCollect_log()).apply();
}
@SuppressLint({"ApplySharedPref"})
public void saveEnterpriseConfig() {
EnterpriseConfig enterpriseConfig = this.n;
if (enterpriseConfig == null) {
Log.w("AppConfigManager", "enterprise config is null cancel enterprise");
return;
}
ConcurrentMap<String, EnterpriseInfo> concurrentMap = enterpriseConfig.getmEnterpriseMap();
if (concurrentMap == null) {
Log.w("AppConfigManager", "enterprises is null cancel enterprise");
return;
}
Log.i("AppConfigManager", "lwx enterpriseInfoMap size is " + concurrentMap.size());
x().clear();
for (String str : concurrentMap.keySet()) {
EnterpriseInfo enterpriseInfo = concurrentMap.get(str);
Log.i("AppConfigManager", "lwx current enterprise is " + str + " " + enterpriseInfo);
if (!ak.im.utils.n5.isEmptyString(str) && enterpriseInfo != null) {
String r = r(str);
String r2 = r(enterpriseInfo.toJsonString());
x().put(r, r2);
a.put(r, r2, 1);
}
}
getMMKV().putLong("b9810d5fec350b9ff10671205aaa63b6", 1L).commit();
}
public void saveFontSize(float f2) {
setFontSize(f2);
C().putFloat("font_size", f2);
}
public synchronized void saveLoginConfig() {
M0();
J0(this.j.getUsername());
boolean z = false;
int i2 = this.B0;
if (i2 == 0) {
z = true;
} else if (i2 > 0) {
z = isPwdInvalid();
}
if (z) {
putMD5Password(null);
H0(null);
} else {
putMD5Password(this.j.getPassword());
H0(this.j.getEncryptedPassword());
}
G0(this.j.getCountryCode());
getMMKV().putString("data_root_path", this.j.getRootPath());
getMMKV().putString("asim_app_uuid", this.j.getUuid());
I0(this.j.getLoginKey());
getMMKV().putInt("4eef1db24e30556f9efc3673b4535ba8", this.j.getLoginCategory());
getMMKV().putLong("b9810d5fec350b9ff10671205aaa63b6", 1L);
getMMKV().putString(BuildConfig.PRODUCT_PKG_NAME, JSON.toJSONString(this.y));
getMMKV().putBoolean("is_login_by_token", this.j.isToken());
getMMKV().commit();
}
public void saveLoginKeyAndCategory() {
getMMKV().putString("4eef1db24e30556f9efc3673b4535ba8", r(this.j.getLoginKey()));
getMMKV().putInt("4eef1db24e30556f9efc3673b4535ba8", this.j.getLoginCategory());
getMMKV().commit();
}
public void saveNeedUploadListValue() {
C().putString("black_list_report", getNeedUploadBlacklist().toJSONString());
}
public void saveNewServerId() {
if (this.g1[1].equals(getServer().getEnterpriseId())) {
setServerId(this.g1[0]);
}
Log.i("AppConfigManager", "saveNewServerId success ,id is " + this.e1);
}
public synchronized void savePassword(String str, String str2) {
setPassword(str);
putMD5Password(str);
H0(str2);
}
public void savePhone(String str) {
this.j.setPhone(str);
try {
byte[] NativeEncryptData = AKCEncryptWrapper.getInstance().NativeEncryptData(str.getBytes(), str.getBytes().length, getKey(), this.p0);
if (NativeEncryptData == null) {
Log.e("AppConfigManager", "NativeEncryptData Error,encrypt phone.[" + ak.im.utils.n5.bytesToHexString(NativeEncryptData) + "," + ak.im.utils.n5.bytesToHexString(this.o0) + "," + ak.im.utils.n5.bytesToHexString(this.p0) + "]");
}
str = ak.comm.d.encodeBytes(NativeEncryptData);
} catch (Exception unused) {
}
Log.d("lwxphone", "phone is " + str);
getMMKV().putBoolean("NEW_ENCR_PHONE", true).apply();
getMMKV().putString("0a6cee4f7ecb1d0c", str).apply();
}
public synchronized void saveReSendCollectLogNotice(String str) {
this.j.setReSendCollectLogNotice(str);
getMMKV().putString("resend_collect_log_notice", str).apply();
}
public synchronized void saveSecurityConfig() {
getMMKV().putString("security_cfg_sec_mode_passcode", this.o.getSecModePasscode()).commit();
ff.a aVar = ff.a;
aVar.getInstance().setPrivacySwitch(this.o.isSecModeSwitchHide(), "secModeSwitchHidden");
aVar.getInstance().setPrivacySwitch(this.o.isAutoClose(), "securityModeAutoClose");
aVar.getInstance().setPrivacySwitch(this.o.isScanABKey(), "autoScanABKey");
aVar.getInstance().setLockMode(this.o.getLockMode());
aVar.getInstance().setPatternUnlockCode(this.o.getPatternUnlockCode());
Log.i("AppConfigManager", "getUsername() is " + getUsername());
}
public void saveServerContentValues(ArrayList<ContentValues> arrayList) {
v().insert("servers", arrayList);
}
public void saveServerIntoRAM(Server server) {
this.j.setServer(server);
}
public void saveWebViewCookie(String str, String str2) {
C().putString(str, str2);
}
public synchronized void setAccount() {
if (ak.im.g2.c.a.isFlavor("boxtalk") && TextUtils.isEmpty(this.j.getPassword())) {
String string = getMMKV().getString("account_uid", "");
String string2 = getMMKV().getString("account_pwd", "");
if (!TextUtils.isEmpty(this.j.getUsername()) && this.j.getUsername().equals(string) && !TextUtils.isEmpty(string2)) {
this.j.setPassword(string2);
}
}
}
public void setAccountInfos(ArrayList<AccountInfo> arrayList) {
this.y = arrayList;
}
public void setAccountPwdTagWithData(AccountInfo accountInfo) {
C().putInt("123sdffds", accountInfo.getSavePwdTag());
if (accountInfo.getSavePwdTag() > 0) {
C().putLong("1AD-23-S12", accountInfo.getSavePwdData());
setPwdSetDate(accountInfo.getSavePwdData());
}
}
public void setAkeyIdSwitch(String str) {
this.Y0 = str;
}
public void setAllowAutoAddFriend(boolean z) {
this.K = z;
}
public synchronized void setAllowFindSatelliteDevice(boolean z) {
this.H = z;
}
public void setAllowSearchUserByPhoneDefined(boolean z) {
this.D = z;
}
public void setAllowShowNumberToFriendByUser(boolean z) {
this.B = z;
}
public void setAndSaveServerInfo(Server server) {
setAndSaveServerInfo(server, false);
}
public void setAuthToken(String str, String str2) {
AppLoginDBHelper mmkv = getMMKV();
mmkv.putString(getServer().getEnterpriseId() + "_" + str2 + "_auth_token", str);
this.p1 = str;
}
public void setBoxMasterName(String str) {
this.X0 = str;
}
public void setBoxOffLine(boolean z) {
this.h2 = z;
}
public synchronized void setBoxRoot(String str) {
if (str.equals(this.k0)) {
return;
}
this.k0 = str;
getMMKV().putString("box_talk_root", this.k0).commit();
}
public synchronized void setBoxRootId(long j2) {
Log.d("testid", "root is " + j2);
if (j2 == this.l0) {
return;
}
this.l0 = j2;
getMMKV().putLong("box_talk_root_id", this.l0).commit();
}
public void setCanMucAudio(boolean z) {
this.Z1 = z;
}
public void setCheckCacheTime(long j2) {
getMMKV().putLong("check_cache_file_time", j2);
this.e2 = j2;
}
public void setChooseLan(int i2) {
if (Build.VERSION.SDK_INT < 24) {
SharedPreferences.Editor edit = this.i.getSharedPreferences("choose_lan", 0).edit();
edit.putInt("choose_lan", i2);
edit.apply();
}
getMMKV().putInt("choose_lan", i2);
this.i2 = i2;
}
public void setChosenAccount(String str) {
getMMKV().putString("account_uid", str);
getMMKV().putBoolean("is_chosen_login", true);
Log.i("AppConfigManager", "the account of has been chosen is " + str);
}
public void setClosePushWhenDesktopActive(boolean z) {
this.d1 = z;
}
public void setComplaintCodeTimeHashMap(HashMap<String, ComplaintCodeTime> hashMap) {
this.N1 = hashMap;
}
public void setComplaintKey(String str) {
this.K1 = str;
}
public void setConnectedSatelliteDeviceAddress(String str) {
this.G = str;
}
public synchronized void setConstraintUnSec(boolean z) {
this.o.setConstraintUnSec(z);
}
public void setCountryBean(CountryBean countryBean) {
this.r2 = countryBean;
}
public synchronized void setCountryCode(String str) {
this.j.setCountryCode(str);
}
public void setCurrentDeviceIp(String str) {
this.f2 = str;
}
public void setCurrentFeedbackCode(int i2) {
Log.debug("aliyunLog", "setCurrentFeedbackCode " + i2);
this.q2 = i2;
getMMKV().putInt("currentFeedbackCode", i2);
}
public void setCurrentMd5Pwd(String str) {
this.V0 = str;
}
public void setDiscoveryId(String str) {
getMMKV().putString("account_discovery_id", str).commit();
this.j0 = str;
}
public synchronized void setEncryptedPassword(String str) {
this.j.setEncryptedPassword(str);
}
public void setFeedBackMaster(boolean z) {
this.x0 = z;
}
public void setFeedbackMapHadUnRead(boolean z) {
this.u0 = z;
updateSimpleData("feedback_map_show_pop", z + "");
}
public void setFeedbackMapLastTime(long j2) {
this.v0 = j2;
}
public void setFeedbackModel(boolean z) {
this.o2 = z;
}
public void setFileReadStatus(String str, String str2) {
this.a1.put(str, str2);
}
public void setFirstToShow(boolean z) {
this.Y1 = z;
}
public void setFixedTopChat(boolean z) {
this.S = z;
}
public void setFontSize(float f2) {
this.i0 = f2;
}
public void setForbiddenModifyBasicInfo(boolean z) {
this.T = z;
}
public void setGetLoginCodeTimes(int i2) {
this.m1 = i2;
}
public void setGlobalClearTime(long j2) {
this.p2 = j2;
getMMKV().putLong("feedback_global_clear_time", j2);
}
public void setGroupChatMessageStoreDay(int i2) {
this.z0 = i2;
}
public synchronized void setHWPushToken(String str) {
C().putLong("hw_push_token_time", ak.im.utils.f4.getRightTime());
C().putString("hw_push_token", str);
this.s0 = str;
}
public void setHadClosedMessageNotifyTips(boolean z) {
this.O1 = z;
}
public void setHadClosedSipNotifyTips(boolean z) {
this.P1 = z;
getMMKV().putBoolean("hadClosedSipNotifyTips", z);
}
public void setHadClosedSysTemNotify(boolean z) {
this.G1 = z;
}
public void setHadClosedSysTemTips(boolean z) {
this.I1 = z;
}
public void setHadDeleteRoot(boolean z) {
getMMKV().putBoolean("hadDeleteRootNew", z);
}
public void setHadGotoNotifyWeb(boolean z) {
this.R1 = z;
getMMKV().putBoolean("hadGotoNotifyWeb", z);
}
public void setHadGotoNotifyWebForNormal(boolean z) {
this.T1 = z;
getMMKV().putBoolean("hadGotoNotifyWebForNormal", z);
}
public void setHadGotoNotifyWebForSip(boolean z) {
this.S1 = z;
getMMKV().putBoolean("hadGotoNotifyWebForSip", z);
}
public void setHadOpenRead(boolean z) {
getMMKV().putBoolean(ak.im.p1.g0, z);
this.l = z;
}
public void setHadStartForeground(boolean z) {
this.X1 = z;
}
public void setHadSysTemNotify(boolean z) {
this.H1 = z;
}
public void setHadSysTemTips(boolean z) {
this.J1 = z;
}
public void setIDNO(String str) {
this.m.setIdNO(str);
}
public void setIgnoreCanLeave(boolean z) {
this.m2 = z;
getMMKV().putBoolean("ignore_can_leave", z);
}
public void setIsstopdownloadover(boolean z) {
this.r = z;
}
public void setLanguage(String str) {
this.I = str;
}
public void setLastDailyReportTime(Long l2) {
getMMKV().putLong("last_statistics", l2.longValue());
getMMKV().commit();
}
public void setLastQrCodeShareInfo(Akeychat.QRCodeShareInfo qRCodeShareInfo) {
this.b0 = qRCodeShareInfo;
}
public void setLimitNumForFriend(int i2) {
Log.i("AppConfigManager", "rosterCountLimit is " + i2);
this.E1 = i2;
}
public synchronized void setLockMode(int i2) {
this.o.setLockMode(i2);
}
public void setLoginByFeedBack(boolean z, boolean z2) {
this.n2 = z;
if (z2) {
getMMKV().putBoolean("is_feedback_login", this.n2);
}
}
public void setLoginCategory(int i2) {
this.j.setLoginCategory(i2);
}
public void setLoginCode(String str) {
this.l1 = str;
}
public void setLoginKey(String str) {
this.j.setLoginKey(str);
}
public void setLoginStatus(int i2) {
this.M1 = i2;
}
public void setM5MBase(String str) {
this.Z0 = str;
getMMKV().putString("M5M", str).commit();
}
public void setNetCheckHtml(String str) {
this.F1 = str;
}
public void setNewEncryptedSp() {
getMMKV().putLong("69615c092a5d5d84ac037aa65696f051", 2L);
}
public synchronized void setNoShotCount(long j2) {
this.m.setNoShotCount(j2);
}
public void setNormalMessageSwitch(boolean z) {
this.U1 = z;
getMMKV().putBoolean("normalMessageSwitch", z);
}
public void setOneKeyLogin(boolean z) {
getMMKV().putBoolean("is_one_key_login", z);
this.c2 = z;
}
public synchronized void setOnline(boolean z) {
Log.i("AppConfigManager", "setOnline isOnLine: " + z);
this.j.setOnline(z);
}
public void setOpenForeground(boolean z) {
this.W1 = z;
getMMKV().putBoolean("openForeground", z);
}
public void setOssCenterHost(String str) {
if ("cancel".equals(str)) {
this.a0 = "enterprise.akeychat.cn:20443";
getMMKV().putString("ossCenterHost", "");
} else {
this.a0 = str;
getMMKV().putString("ossCenterHost", str);
}
HttpURLTools.initOssServerHosts(this.a0);
}
public void setPasscode(String str) {
this.s = str;
}
public synchronized void setPassword(String str) {
this.j.setPassword(str);
}
public synchronized void setPatternUnlockCode(String str) {
this.o.setPatternUnlockCode(str);
}
public void setPermissionDialog(Dialog dialog) {
this.a2 = dialog;
}
public synchronized void setPhone(String str) {
this.j.setPhone(str);
}
public synchronized void setPrivacyDestroySwitch(boolean z) {
this.m.setDestroyReceipts(z);
}
public synchronized void setPrivacyMessageNoticeVoice(boolean z) {
this.m.setMessageNoticeVoice(z);
}
public synchronized void setPrivacyRecvAndReadSwitch(boolean z) {
this.m.setRecvAndReadReceipts(z);
}
public synchronized void setPrivacySearchAsimId(boolean z) {
this.m.setSearchAsimIds(z);
}
public synchronized void setPrivacySearchPhoneNum(boolean z) {
this.m.setSearchPhoneNums(z);
}
public synchronized void setPrivacyShowSwitch(boolean z) {
this.m.setShowReceipts(z);
}
public void setPublicDisplayMucroomCount(boolean z) {
this.E = z;
}
public synchronized void setPublicSwitch(boolean z) {
this.m.setPublicSwitch(z);
}
public void setPwdSaveValidDate(int i2) {
this.B0 = i2;
}
public void setPwdSetDate(long j2) {
this.C0 = j2;
}
public void setReadOnlyInfo(String str) {
Log.i("AppConfigManager", "readOnlyInfo json is " + str);
this.W0 = ReadOnlyInfo.loads(str);
}
public synchronized void setRemoteDestroyCount(long j2) {
this.m.setRemoteDestroyCount(j2);
}
public void setReportBean(ReportBean reportBean) {
this.s2 = reportBean;
}
public void setReqSignUpResult(RequestSignUpResult requestSignUpResult) {
this.L0 = requestSignUpResult;
}
public synchronized void setRootPath(String str) {
this.j.setRootPath(str);
}
public synchronized void setScanABKey(boolean z) {
this.o.setScanABKey(z);
}
public synchronized void setScanning(boolean z) {
this.q = z;
}
public void setSearchUserByPhoneSystem(boolean z) {
this.C = z;
}
public synchronized void setSecModeSwitchHide(boolean z) {
this.o.setSecModeSwitchHide(z);
}
public synchronized void setSecurityAutoClose(boolean z) {
this.o.setAutoClose(z);
}
public void setSensitiveWords(List<String> list) {
this.Y = list;
}
public void setSensitives(List<String> list) {
this.q1.clear();
for (String str : list) {
this.q1.add(str.toLowerCase(Locale.getDefault()));
}
}
public void setSensitivesMapping(HashSet<Integer> hashSet) {
this.r1 = hashSet;
}
public void setServerId(String str) {
if (!TextUtils.isEmpty(str)) {
str = str.trim();
}
String serverIdByDomain = AkeyChatUtils.getServerIdByDomain(str);
this.e1 = serverIdByDomain;
getMMKV().putString("server_id", serverIdByDomain);
}
public void setServerStatus(String str) {
this.t2 = str;
}
public void setServerVersion(String str) {
this.b2 = str;
}
public void setShowAddress(boolean z) {
this.w0 = z;
}
public void setShowNumberToFriendBySystem(boolean z) {
this.A = z;
}
public void setShowSipNotifyTimes(int i2) {
this.Q1 = i2;
getMMKV().putInt("showSipNotifyTimes", i2);
}
public void setSign(boolean z) {
this.c0 = z;
}
public void setSignUp(boolean z) {
this.t = z;
}
public void setSingleChatMessageStoreDay(int i2) {
this.y0 = i2;
}
public void setSingleChatMessageStoreDayUsedForMiyun(boolean z) {
this.A0 = z;
}
public synchronized void setSipCount(long j2) {
this.m.setSipCount(j2);
}
public void setSipMessageSwitch(boolean z) {
this.V1 = z;
getMMKV().putBoolean("sipMessageSwitch", z);
}
public void setSuccessForPush(boolean z) {
this.z1 = z;
}
public synchronized void setSupportABKey(boolean z) {
this.p = z;
}
public void setSupportBurnFeature(boolean z) {
this.R = z;
}
public void setSupportCA(boolean z) {
this.V = z;
}
public void setSupportCustomService(boolean z) {
this.Z = z;
}
public void setSupportDLP(boolean z) {
this.O = z;
}
public void setSupportFileSend(boolean z) {
this.M = z;
}
public void setSupportGroupReceipt(boolean z) {
this.Q = z;
}
public void setSupportGroupWatermark(boolean z) {
this.U = z;
}
public void setSupportNews(boolean z) {
this.W = z;
}
public void setSupportPlainMode(boolean z) {
this.L = z;
}
public void setSupportRedPacket(boolean z) {
this.P = z;
}
public void setSupportWorkflow(boolean z) {
this.N = z;
}
public void setTempPic(String str) {
this.n0 = str;
}
public void setTempServerInfo(String str, String str2) {
String[] strArr = this.g1;
strArr[0] = str;
strArr[1] = str2;
}
public synchronized void setToken(boolean z) {
this.j.setToken(z);
}
public synchronized void setUnstableCount(long j2) {
this.m.setUnstableCount(j2);
}
public void setUriForWeb(String str) {
this.s1 = str;
}
public void setUserVisibleDay(int i2) {
this.b1 = i2;
}
public void setUserVisibleForMiyun(boolean z) {
this.c1 = z;
}
public synchronized void setUsername(String str) {
this.j.setUsername(str);
this.j.setUserNameVersion(2);
}
public void setmMaxMemberCount(int i2) {
this.F = i2;
}
public synchronized void setmOldAppVersion(int i2) {
this.g0 = i2;
C().putInt("simple_data_app_ver_key", i2);
}
public void setmPasswordFromIntent(String str) {
this.O0 = str;
}
public synchronized void setmPreVer4SettingDialog(int i2) {
this.h0 = i2;
C().putInt("pre_version_code_for_setting_dialog", i2);
}
public void setmReqsetPwdData(ResetPwdData resetPwdData) {
this.M0 = resetPwdData;
}
public void setmSkipClaculatorLockByNotice(boolean z) {
this.v = z;
}
public void setmUserNameFromIntent(String str) {
this.N0 = str;
}
public void setmWorkspace(Akeychat.Workspace workspace) {
this.X = workspace;
}
public String showContacrsUi() {
if (getLimitNumForFriend() > 0) {
return CookieSpec.PATH_DELIM + getLimitNumForFriend();
}
return "";
}
public io.reactivex.z<Server> startDiscover(String str, boolean z, boolean z2) {
Server server = getServer();
if (z && server != null && server.isEffective()) {
return io.reactivex.z.just(server);
}
TextUtils.isEmpty(str);
io.reactivex.z<Server> flatMapStringServerInfoTo = flatMapStringServerInfoTo(af.getInstance().discoverServer(str));
return (z2 && flatMapStringServerInfoTo != null) ? flatMapStringServerInfoTo.map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Server server2 = (Server) obj;
ye.q0(server2);
return server2;
}
}) : flatMapStringServerInfoTo;
}
public io.reactivex.z<Akeychat.InterceptBotMsgResponse> stopAiBotRequest(String str, String str2) {
return XMPPConnectionManager.a.getInstance().sendIQWithRx(new ak.smack.r5(str, str2), 20000L).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Akeychat.InterceptBotMsgResponse interceptBotMsgResponse;
interceptBotMsgResponse = ((ak.smack.r5) ((Stanza) obj)).getmResponse();
return interceptBotMsgResponse;
}
});
}
public boolean supportAiReplay() {
boolean z = false;
for (AKBot aKBot : BotManager.getSingleton().getBotMap().values()) {
if (aKBot.isCustom && aKBot.isEnable()) {
z = true;
continue;
} else {
z = false;
continue;
}
if (z) {
break;
}
}
return z && AKCAppConfiguration.a.supportAiReplay() && jf.getInstance().getUserMeRole().isAllow_use_smart_reply() && isSupportBot();
}
public boolean supportFeedback() {
return getServer() != null && getServer().isSupport_feedback() && AKCAppConfiguration.a.supportFeedback();
}
public boolean supportNormalFeedback() {
Log.debug("AppConfigManager", "supportFeedback " + supportFeedback() + ",isFeedBackMaster " + isFeedBackMaster());
return supportFeedback() && !isFeedBackMaster();
}
public String transFormTableKey() {
StringBuilder sb = new StringBuilder();
sb.append("transform_table-");
sb.append(TextUtils.isEmpty(getUsername()) ? Long.valueOf(System.currentTimeMillis()) : getUsername());
String sb2 = sb.toString();
Log.i("AppConfigManager", "transFormTableKey " + sb2);
return sb2;
}
public int transformSizeLimit() {
return AKCAppConfiguration.a.forwardMsgMultiLimit();
}
public void updateAndInitReportBean() {
ReportBean reportBean = getReportBean();
if (reportBean != null && needCheckSensitive()) {
io.reactivex.z.just(reportBean).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
return ye.this.t0((ReportBean) obj);
}
}).subscribeOn(io.reactivex.w0.a.io()).observeOn(io.reactivex.q0.c.a.mainThread()).subscribe(new d());
} else {
Log.i("AppConfigManager", "local reportBean is null");
}
}
public io.reactivex.z<Long> updatePwdSaveValidDate(final int i2) {
return io.reactivex.z.timer(0L, TimeUnit.SECONDS).map(new io.reactivex.s0.o() {
@Override
public final Object apply(Object obj) {
Long l2 = (Long) obj;
ye.this.v0(i2, l2);
return l2;
}
});
}
public void updateServerContentValues(ArrayList<ContentValues> arrayList, ArrayList<String[]> arrayList2) {
v().update("servers", arrayList, "server_id=?", arrayList2);
}
public void updateServerStatus(String str, String str2) {
synchronized (o.class) {
if (this.k1 == null) {
this.k1 = new ConcurrentHashMap<>();
}
}
this.k1.put(str, str2);
}
public void updateServerVersionCode(long j2) {
SyncManager.getSingleton().updateSyncInfo("server_list", j2);
}
public long updateSimpleData(String str, String str2) {
ContentValues contentValues = new ContentValues();
contentValues.put("key", str);
contentValues.put("value", str2);
return v().isExistsByField("simple_data", "key", str) ? v().update("simple_data", contentValues, "key=?", new String[]{str}) : v().insert("simple_data", contentValues);
}
public synchronized void uploadBlackListErrorToOSS() {
judgeTiming(io.reactivex.z.just("").map(new c()));
}
public void uploadBlackListToServer(Server server) {
if (server == null && (getmLoginCfg() == null || getServer() == null)) {
Log.i("AppConfigManager", "uploadBlackListToServer server is null");
} else {
judgeTiming(io.reactivex.z.just("").map(new b(server)));
}
}
public synchronized void uploadSecurityConfig(ak.worker.d0 d0Var, String str) {
this.o.uploadConfig(d0Var, str);
}
public Long v0(int i2, Long l2) {
u0(i2, l2);
return l2;
}
public io.reactivex.j<ResetPwdData> verifySMSCodeForResetPwd(String str, String str2) {
String baseURL = getInstance().getBaseURL();
ak.f.b bVar = new ak.f.b(baseURL, false, AkeyChatUtils.isNeedVerifyCertificate(baseURL));
HashMap hashMap = new HashMap();
hashMap.put("reqid", str);
hashMap.put("smscode", str2);
return bVar.getAKAPI().verifySMSCodeForResetPwd(hashMap);
}
public io.reactivex.j<ak.f.e> verifySMSCodeForSignUp(String str, String str2) {
String baseURL = getInstance().getBaseURL();
ak.f.b bVar = new ak.f.b(baseURL, false, AkeyChatUtils.isNeedVerifyCertificate(baseURL));
HashMap hashMap = new HashMap();
hashMap.put("reqid", str);
hashMap.put("smscode", str2);
return bVar.getAKAPI().verifySMSCodeForSignUp(hashMap);
}
private ye() {
this.k = true;
this.p = false;
this.q = false;
this.r = false;
this.t = false;
this.v = false;
this.x = new HashMap<>();
this.y = new ArrayList<>();
this.z = false;
this.A = false;
this.B = false;
this.C = true;
this.D = false;
this.E = false;
this.F = 2000;
this.I = "";
this.L = true;
this.M = true;
this.N = false;
this.O = false;
this.P = false;
this.Q = true;
this.R = true;
this.S = false;
this.T = true;
this.U = false;
this.V = false;
this.W = false;
this.Z = true;
this.c0 = false;
this.d0 = false;
this.f0 = new HashMap<>();
this.g0 = 0;
this.h0 = 0;
this.m0 = false;
this.n0 = "";
this.o0 = null;
this.p0 = null;
this.r0 = -1;
this.s0 = null;
this.t0 = new ArrayList<>();
this.u0 = false;
this.v0 = 0L;
this.w0 = false;
this.x0 = false;
this.y0 = -1;
this.z0 = -1;
this.A0 = false;
this.B0 = -1;
this.F0 = false;
this.G0 = "3027bb1bee17415d8211c91740e7d0b8";
this.H0 = "https://221.8.16.119:8443/myb";
this.I0 = false;
this.R0 = false;
this.S0 = null;
this.T0 = false;
this.U0 = null;
this.W0 = null;
this.a1 = new HashMap<>();
this.b1 = -1;
this.c1 = false;
this.d1 = true;
this.f1 = false;
this.g1 = new String[]{"", ""};
this.h1 = false;
this.i1 = new ConcurrentHashMap<>();
this.j1 = new ConcurrentHashMap<>();
this.l1 = "";
this.m1 = -1;
this.n1 = "";
this.p1 = "";
this.q1 = new ArrayList();
this.r1 = new HashSet<>();
this.s1 = "";
this.t1 = new String[0];
this.u1 = new HashSet<>();
this.v1 = new JSONArray();
this.w1 = new HashMap<>();
this.x1 = false;
this.y1 = new ArrayList<>();
this.z1 = false;
this.A1 = false;
this.B1 = true;
this.C1 = false;
this.D1 = false;
this.E1 = -1;
this.F1 = "";
this.G1 = false;
this.H1 = false;
this.I1 = false;
this.J1 = false;
this.K1 = "";
this.L1 = new HashMap<>();
this.M1 = 0;
this.N1 = new HashMap();
this.O1 = false;
this.P1 = false;
this.Q1 = -1;
this.R1 = false;
this.S1 = false;
this.T1 = false;
this.U1 = true;
this.V1 = true;
this.W1 = false;
this.X1 = false;
this.Y1 = true;
this.Z1 = true;
this.b2 = "";
this.c2 = false;
this.d2 = "";
this.e2 = 0L;
this.f2 = "";
this.g2 = false;
this.h2 = false;
this.i2 = 0;
this.j2 = false;
this.k2 = new HashMap<>();
this.l2 = new ArrayList();
this.m2 = false;
this.n2 = false;
this.o2 = false;
this.q2 = 0;
long currentTimeMillis = System.currentTimeMillis();
Context context = ak.im.o1.get();
this.i = context;
String B = B(context);
if (TextUtils.isEmpty(B) || !B.equals(BuildConfig.PRODUCT_PKG_NAME)) {
return;
}
Log.w("AppConfigManager", "AppConfigManager is initialized");
a = AppLoginDBHelper.getDataBase(this.i);
if (!MMKV.defaultMMKV().getBoolean("F25CE706DE7E01F1", false)) {
getMMKV().importDataFromSp(this.i.getSharedPreferences("asim_im_settings_pref", 0));
getMMKV().putBoolean("F25CE706DE7E01F1", true);
} else if (a.getAll().size() < 1) {
this.f = this.i.getSharedPreferences("simple_data", 0);
getMMKV().importDataFromSp(this.f);
}
if (a.getAllEnterpriseMap().size() < 1) {
this.g = this.i.getSharedPreferences("enterprise_pref", 0);
getMMKV().importDataFromSpEnterprise(this.g);
}
this.i0 = C().getFloat("font_size", 1.0f);
this.a0 = "enterprise.akeychat.cn:20443";
long j2 = getMMKV().getLong("69615c092a5d5d84ac037aa65696f051", 1L);
Log.d("AppConfigManager", "newEncryptedVer is " + j2);
init(j2);
long currentTimeMillis2 = System.currentTimeMillis();
Log.i("AppConfigManager", "check time diff:" + (currentTimeMillis2 - currentTimeMillis));
a.logAllData();
Log.i("lwxpng", "MAX_WIDTH_FOR_DISPLAY_IN_GROUP is " + ak.im.utils.e4.dip2px(160.0f));
I();
}
public boolean isOldServer(int[] iArr) {
try {
if (!TextUtils.isEmpty(this.b2) && this.b2.contains(".")) {
String[] split = this.b2.split("\\.");
if (split.length >= 3) {
for (int i2 = 0; i2 < iArr.length; i2++) {
int parseInt = Integer.parseInt(split[i2]) - iArr[i2];
if (parseInt > 0) {
return false;
}
if (parseInt != 0) {
break;
}
}
return true;
}
}
} catch (Exception e2) {
Log.e("AppConfigManager", "isOldServer error " + e2.getMessage() + ". " + this.b2);
}
return true;
}
public void setAndSaveServerInfo(Server server, boolean z) {
if (server == null) {
Log.d("AppConfigManager", "server is null ,end");
return;
}
if (ak.im.g2.c.a.isFlavor("boxtalk") && getServer() != null && getServer().getEnterpriseId().equals(server.getEnterpriseId())) {
server.setScan(getServer().isScan());
}
if (TextUtils.isEmpty(server.getUserInput()) && getServer() != null && server.getEnterpriseId().equals(getServer().getEnterpriseId())) {
server.setUserInput(getServer().getUserInput());
Log.d("AppConfigManager", "userInput is " + server.getUserInput());
}
boolean z2 = false;
Server server2 = this.j.getServer();
if (z && server2 != null && (!server2.getSipDomain().equals(server.getSipDomain()) || !server2.getSipHost().equals(server.getSipHost()) || !server2.getSipTurnServerHost().equals(server.getSipTurnServerHost()) || !server2.getStunHost().equals(server.getStunHost()) || server2.getStunPort() != server.getStunPort() || server2.getSipTurnServerPort() != server.getSipTurnServerPort() || server2.isUseStun() != server.isUseStun() || server2.getTlsPort() != server.getTlsPort() || server2.getSipPort() != server.getSipPort() || !server2.getMcuDomain().equals(server.getMcuDomain()) || !server2.getMcuIP().equals(server.getMcuIP()) || !server2.getMcuPort().equals(server.getMcuPort()) || server2.getMcuTLSPort() != server.getMcuTLSPort() || !server2.getMcuTurnServerHost().equals(server.getMcuTurnServerHost()) || server2.getMcuTurnServerPort() != server.getMcuTurnServerPort())) {
Log.e("AppConfigManager", "pjsip parameters may changed ,send PjsipParametersChanged");
z2 = true;
}
saveServerIntoRAM(server);
M0();
if (z && z2) {
ak.im.utils.j4.sendEvent(new ak.event.o3());
}
}
public void setReadOnlyInfo(ReadOnlyInfo readOnlyInfo) {
this.W0 = readOnlyInfo;
}
public boolean isPwdInvalid(int i2, long j2) {
if (i2 < 0) {
return false;
}
if (i2 == 0) {
return true;
}
return j2 + (((long) (((i2 * 24) * 60) * 60)) * 1000) < ak.im.utils.f4.getRightTime();
}
public synchronized String getBaseURL() {
Server server;
server = getServer();
return "https://" + server.getAppSrvHost() + ":" + server.getAppSrvPort() + CookieSpec.PATH_DELIM;
}
public void addAccount(AccountInfo accountInfo, boolean z) {
if (TextUtils.isEmpty(accountInfo.getUnitId().trim())) {
Log.i("AppConfigManager", "new add account uid is null");
return;
}
int i2 = 0;
while (i2 < this.y.size()) {
AccountInfo accountInfo2 = this.y.get(i2);
if (accountInfo.getUnitId().equals(accountInfo2.getUnitId()) || (accountInfo2.getEnt().getEnterpriseId().equals(accountInfo.getEnt().getEnterpriseId()) && accountInfo2.getPhone().equals(accountInfo.getPhone()))) {
if (accountInfo.getSavePwdTag() != accountInfo2.getSavePwdTag()) {
if (accountInfo2.getSavePwdTag() >= 0) {
if (accountInfo.getSavePwdData() == 0) {
accountInfo.setSavePwdData(ak.im.utils.f4.getCurDateLong());
}
} else {
accountInfo.setSavePwdData(0L);
}
}
accountInfo.setSavePwdTag(accountInfo2.getSavePwdTag());
if (i2 < 0) {
this.y.remove(i2);
getInstance().setPwdSaveValidDate(accountInfo.getSavePwdTag());
getInstance().setPwdSetDate(accountInfo.getSavePwdData());
} else {
getInstance().setPwdSaveValidDate(-1);
getInstance().setPwdSetDate(0L);
accountInfo.setSavePwdTag(this.B0);
accountInfo.setSavePwdData(this.C0);
}
if (accountInfo.getSavePwdTag() == 0) {
accountInfo.setPwd("");
}
this.y.add(0, accountInfo);
if (z) {
getMMKV().putString(BuildConfig.PRODUCT_PKG_NAME, JSON.toJSONString(this.y));
getMMKV().commit();
}
C().putInt("123sdffds", this.B0);
C().putLong("1AD-23-S12", this.C0);
}
i2++;
}
i2 = -1;
if (i2 < 0) {
}
if (accountInfo.getSavePwdTag() == 0) {
}
this.y.add(0, accountInfo);
if (z) {
}
C().putInt("123sdffds", this.B0);
C().putLong("1AD-23-S12", this.C0);
}
public int CheckGroupSpeakBeans(GroupSpeakBean groupSpeakBean) {
int i2;
Group groupBySimpleName = df.getInstance().getGroupBySimpleName(df.getInstance().getSimpleNameByGroupname(groupSpeakBean.getGroupName()));
if (groupBySimpleName == null) {
return -1;
}
if (groupBySimpleName.getSpeakFrenquency() == 0) {
Role userMeRole = jf.getInstance().getUserMeRole();
if (userMeRole != null && userMeRole.isAllow_role_send_message_limit()) {
try {
i2 = Integer.valueOf(userMeRole.getRole_send_message_limit()).intValue();
} catch (Exception e2) {
Log.e("AppConfigManager", "parse role send message limit failed," + e2.getMessage());
return -1;
}
} else {
this.f0.remove(groupSpeakBean.getGroupName());
return -1;
}
} else if (groupBySimpleName.isOwnerOrManager(nf.getInstance().getUserMe().getJID())) {
return -1;
} else {
i2 = 0;
}
if (i2 == 0) {
i2 = groupBySimpleName.getSpeakFrenquency() == 1 ? 10 : 5;
}
if (this.f0.containsKey(groupSpeakBean.getGroupName())) {
List<GroupSpeakBean> list = this.f0.get(groupSpeakBean.getGroupName());
if (list.get(0).getTime().equals(groupSpeakBean.getTime()) && list.size() >= i2) {
return i2;
}
}
return -1;
}
}