正在查看: 北京退费客服端 v1.0.0 应用的 LaunchActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 北京退费客服端 v1.0.0 应用的 LaunchActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package im.amwhusedvt.ui;
import android.app.ActivityManager;
import android.app.NotificationManager;
import android.app.role.RoleManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.StatFs;
import android.text.TextUtils;
import android.util.Base64;
import android.view.ActionMode;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.widget.FrameLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.view.inputmethod.InputContentInfoCompat;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.bjz.comm.net.utils.AppPreferenceUtil;
import com.google.android.gms.common.api.Status;
import im.amwhusedvt.javaBean.fc.FollowedFcListBean;
import im.amwhusedvt.javaBean.fc.HomeFcListBean;
import im.amwhusedvt.javaBean.fc.RecommendFcListBean;
import im.amwhusedvt.messenger.AccountInstance;
import im.amwhusedvt.messenger.AndroidUtilities;
import im.amwhusedvt.messenger.ApplicationLoader;
import im.amwhusedvt.messenger.BuildVars;
import im.amwhusedvt.messenger.ContactsController;
import im.amwhusedvt.messenger.FileLoader;
import im.amwhusedvt.messenger.FileLog;
import im.amwhusedvt.messenger.ImageLoader;
import im.amwhusedvt.messenger.LocaleController;
import im.amwhusedvt.messenger.LocationController;
import im.amwhusedvt.messenger.MediaController;
import im.amwhusedvt.messenger.MediaDataController;
import im.amwhusedvt.messenger.MessageObject;
import im.amwhusedvt.messenger.MessagesController;
import im.amwhusedvt.messenger.MessagesStorage;
import im.amwhusedvt.messenger.NotificationCenter;
import im.amwhusedvt.messenger.SendMessagesHelper;
import im.amwhusedvt.messenger.SharedConfig;
import im.amwhusedvt.messenger.UserConfig;
import im.amwhusedvt.messenger.UserObject;
import im.amwhusedvt.messenger.Utilities;
import im.amwhusedvt.messenger.browser.Browser;
import im.amwhusedvt.messenger.camera.CameraController;
import im.amwhusedvt.messenger.utils.PlayerUtils;
import im.amwhusedvt.tel.CallApiBelow26And28Service;
import im.amwhusedvt.tgnet.ConnectionsManager;
import im.amwhusedvt.tgnet.TLObject;
import im.amwhusedvt.tgnet.TLRPC;
import im.amwhusedvt.tgnet.TLRPCCall;
import im.amwhusedvt.ui.-$;
import im.amwhusedvt.ui.DialogsActivity;
import im.amwhusedvt.ui.PhoneBookSelectActivity;
import im.amwhusedvt.ui.WallpapersListActivity;
import im.amwhusedvt.ui.actionbar.ActionBarLayout;
import im.amwhusedvt.ui.actionbar.AlertDialog;
import im.amwhusedvt.ui.actionbar.BaseFragment;
import im.amwhusedvt.ui.actionbar.DrawerLayoutContainer;
import im.amwhusedvt.ui.actionbar.Theme;
import im.amwhusedvt.ui.actionbar.XAlertDialog;
import im.amwhusedvt.ui.adapters.DrawerLayoutAdapter;
import im.amwhusedvt.ui.cells.DrawerUserCell;
import im.amwhusedvt.ui.cells.LanguageCell;
import im.amwhusedvt.ui.cells.ThemesHorizontalListCell;
import im.amwhusedvt.ui.components.AlertsCreator;
import im.amwhusedvt.ui.components.BlockingUpdateView;
import im.amwhusedvt.ui.components.EmbedBottomSheet;
import im.amwhusedvt.ui.components.LayoutHelper;
import im.amwhusedvt.ui.components.PasscodeView;
import im.amwhusedvt.ui.components.PipRoundVideoView;
import im.amwhusedvt.ui.components.RecyclerListView;
import im.amwhusedvt.ui.components.StickersAlert;
import im.amwhusedvt.ui.components.StickersAlert$StickersAlertDelegate;
import im.amwhusedvt.ui.components.TermsOfServiceView;
import im.amwhusedvt.ui.components.ThemeEditorView;
import im.amwhusedvt.ui.components.UpdateAppAlertDialog;
import im.amwhusedvt.ui.components.toast.ToastUtils;
import im.amwhusedvt.ui.hui.chats.NewProfileActivity;
import im.amwhusedvt.ui.hui.contacts.AddContactsInfoActivity;
import im.amwhusedvt.ui.hui.discoveryweb.DiscoveryJumpPausedFloatingView;
import im.amwhusedvt.ui.hui.friendscircle_v1.helper.DatabaseInstance;
import im.amwhusedvt.ui.hui.friendscircle_v1.helper.FcDBHelper;
import im.amwhusedvt.ui.hui.friendscircle_v1.ui.ImagePreviewActivity;
import im.amwhusedvt.ui.hui.login.LoginContronllerActivity;
import im.amwhusedvt.ui.hui.visualcall.AVideoCallInterface;
import im.amwhusedvt.ui.hui.visualcall.RingUtils;
import im.amwhusedvt.ui.hui.visualcall.VisualCallActivity;
import im.amwhusedvt.ui.hui.visualcall.VisualCallReceiveActivity;
import im.amwhusedvt.ui.hui.visualcall.VisualCallRequestParaBean;
import im.amwhusedvt.ui.utils.AppUpdater;
import im.amwhusedvt.ui.utils.OpenInstallUitl;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class LaunchActivity extends AppCompatActivity implements ActionBarLayout.ActionBarLayoutDelegate, NotificationCenter.NotificationCenterDelegate, DialogsActivity.DialogsActivityDelegate {
private static final int CODE = 102;
private static final int PLAY_SERVICES_REQUEST_CHECK_SETTINGS = 140;
private ActionBarLayout actionBarLayout;
private View backgroundTablet;
private BlockingUpdateView blockingUpdateView;
private AlertDialog checkUpdateDialog;
private ArrayList<TLRPC.User> contactsToSend;
private Uri contactsToSendUri;
private int currentAccount;
private int currentConnectionState;
private String documentsMimeType;
private ArrayList<String> documentsOriginalPathsArray;
private ArrayList<String> documentsPathsArray;
private ArrayList<Uri> documentsUrisArray;
private DrawerLayoutAdapter drawerLayoutAdapter;
protected DrawerLayoutContainer drawerLayoutContainer;
private HashMap<String, String> englishLocaleStrings;
private boolean finished;
private ActionBarLayout layersActionBarLayout;
private boolean loadingLocaleDialog;
private TLRPC.TL_theme loadingTheme;
private String loadingThemeFileName;
private Theme.ThemeInfo loadingThemeInfo;
private AlertDialog loadingThemeProgressDialog;
private String loadingThemeWallpaperName;
private AlertDialog localeDialog;
private Runnable lockRunnable;
private byte mBytJumpFromBack = 0;
private ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener;
private Intent passcodeSaveIntent;
private boolean passcodeSaveIntentIsNew;
private boolean passcodeSaveIntentIsRestore;
private PasscodeView passcodeView;
private ArrayList<SendMessagesHelper.SendingMediaInfo> photoPathsArray;
private AlertDialog proxyErrorDialog;
private ActionBarLayout rightActionBarLayout;
private String sendingText;
private FrameLayout shadowTablet;
private FrameLayout shadowTabletSide;
private RecyclerListView sideMenu;
private HashMap<String, String> systemLocaleStrings;
private boolean tabletFullSize;
private TermsOfServiceView termsOfServiceView;
private UpdateAppAlertDialog updateAppAlertDialog;
private String videoPath;
private ActionMode visibleActionMode;
private AlertDialog visibleDialog;
private static ArrayList<BaseFragment> mainFragmentsStack = new ArrayList<>();
private static ArrayList<BaseFragment> layerFragmentsStack = new ArrayList<>();
private static ArrayList<BaseFragment> rightFragmentsStack = new ArrayList<>();
private void checkPermission() {
if ((2 + 5) % 5 <= 0) {
}
ArrayList<String> pers = new ArrayList<>();
if (Build.VERSION.SDK_INT >= 29) {
RoleManager roleManager = (RoleManager) getSystemService("role");
startActivityIfNeeded(roleManager.createRequestRoleIntent("android.app.role.CALL_SCREENING"), 1011, null);
} else {
pers.add("android.permission.WRITE_CONTACTS");
pers.add("android.permission.READ_CONTACTS");
pers.add("android.permission.READ_CALL_LOG");
pers.add("android.permission.WRITE_CALL_LOG");
pers.add("android.permission.READ_PHONE_STATE");
pers.add("android.permission.MODIFY_PHONE_STATE");
pers.add("android.permission.CALL_PHONE");
pers.add("android.permission.PROCESS_OUTGOING_CALLS");
pers.add("android.permission.WRITE_SECURE_SETTINGS");
if (Build.VERSION.SDK_INT >= 26) {
pers.add("android.permission.ANSWER_PHONE_CALLS");
pers.add("android.permission.MANAGE_OWN_CALLS");
pers.add("android.permission.READ_PHONE_NUMBERS");
}
if (Build.VERSION.SDK_INT >= 30) {
pers.add("android.permission.QUERY_ALL_PACKAGES");
}
}
ArrayList<String> realPers = new ArrayList<>();
Iterator<String> it = pers.iterator();
while (it.hasNext()) {
String realPer = it.next();
if (ActivityCompat.checkSelfPermission(this, realPer) != 0) {
realPers.add(realPer);
}
}
if (!realPers.isEmpty()) {
String[] arr = new String[0];
if (Build.VERSION.SDK_INT >= 23) {
requestPermissions((String[]) realPers.toArray(arr), CODE);
}
}
}
protected void onCreate(Bundle savedInstanceState) {
String os1;
String os2;
Uri uri;
if ((14 + 28) % 28 <= 0) {
}
ApplicationLoader.postInitApplication();
queryProxyAccount(getIntent());
OpenInstallUitl.getInstance().getInstallOrWakeUp(getIntent());
AndroidUtilities.checkDisplaySize(this, getResources().getConfiguration());
int i = UserConfig.selectedAccount;
this.currentAccount = i;
AppUpdater.getInstance(i).loadUpdateConfig();
if (BuildVars.PHONE_CHECK) {
checkPermission();
}
if (!UserConfig.getInstance(this.currentAccount).isClientActivated()) {
Intent intent = getIntent();
if (intent != null && intent.getAction() != null) {
if ("android.intent.action.SEND".equals(intent.getAction()) || "android.intent.action.SEND_MULTIPLE".equals(intent.getAction())) {
super.onCreate(savedInstanceState);
finish();
return;
} else if ("android.intent.action.VIEW".equals(intent.getAction()) && (uri = intent.getData()) != null) {
String url = uri.toString().toLowerCase();
boolean z = url.startsWith("hchat:proxy") || url.startsWith("hchat://proxy") || url.startsWith("hchat:socks") || url.startsWith("hchat://socks");
}
}
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
preferences.getLong("intro_crashed_time", 0L);
boolean fromIntro = intent.getBooleanExtra("fromIntro", false);
if (fromIntro) {
preferences.edit().putLong("intro_crashed_time", 0L).commit();
}
}
requestWindowFeature(1);
setTheme(2131755390);
if (Build.VERSION.SDK_INT >= 21) {
try {
setTaskDescription(new ActivityManager.TaskDescription((String) null, (Bitmap) null, Theme.getColor(Theme.key_actionBarDefault) | Theme.ACTION_BAR_VIDEO_EDIT_COLOR));
} catch (Exception e) {
}
try {
getWindow().setNavigationBarColor(Theme.ACTION_BAR_VIDEO_EDIT_COLOR);
} catch (Exception e2) {
}
}
getWindow().setBackgroundDrawableResource(2131231650);
if (SharedConfig.passcodeHash.length() > 0 && !SharedConfig.allowScreenCapture) {
try {
getWindow().setFlags(8192, 8192);
} catch (Exception e3) {
FileLog.e(e3);
}
}
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= 21) {
Window window = getWindow();
window.getDecorView().setSystemUiVisibility(1280);
window.setStatusBarColor(0);
}
if (Build.VERSION.SDK_INT >= 24) {
AndroidUtilities.isInMultiwindow = isInMultiWindowMode();
}
Theme.createChatResources(this, false);
if (SharedConfig.passcodeHash.length() != 0 && SharedConfig.appLocked) {
SharedConfig.lastPauseTime = ConnectionsManager.getInstance(this.currentAccount).getCurrentTime();
}
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
AndroidUtilities.statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
this.actionBarLayout = new ActionBarLayout(this);
DrawerLayoutContainer drawerLayoutContainer = new DrawerLayoutContainer(this);
this.drawerLayoutContainer = drawerLayoutContainer;
drawerLayoutContainer.setBehindKeyboardColor(Theme.getColor(Theme.key_windowBackgroundWhite));
char c = 65535;
setContentView(this.drawerLayoutContainer, new ViewGroup.LayoutParams(-1, -1));
if (AndroidUtilities.isTablet()) {
getWindow().setSoftInputMode(16);
1 r4 = new 1(this, this);
this.drawerLayoutContainer.addView((View) r4, (ViewGroup.LayoutParams) LayoutHelper.createFrame(-1, -1.0f));
this.backgroundTablet = new View(this);
BitmapDrawable drawable = (BitmapDrawable) getResources().getDrawable(2131230908);
drawable.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
this.backgroundTablet.setBackgroundDrawable(drawable);
r4.addView(this.backgroundTablet, LayoutHelper.createRelative(-1, -1));
r4.addView(this.actionBarLayout);
ActionBarLayout actionBarLayout = new ActionBarLayout(this);
this.rightActionBarLayout = actionBarLayout;
actionBarLayout.init(rightFragmentsStack);
this.rightActionBarLayout.setDelegate(this);
r4.addView(this.rightActionBarLayout);
FrameLayout frameLayout = new FrameLayout(this);
this.shadowTabletSide = frameLayout;
frameLayout.setBackgroundColor(1076449908);
r4.addView(this.shadowTabletSide);
FrameLayout frameLayout2 = new FrameLayout(this);
this.shadowTablet = frameLayout2;
frameLayout2.setVisibility(layerFragmentsStack.isEmpty() ? 8 : 0);
this.shadowTablet.setBackgroundColor(Theme.ACTION_BAR_PHOTO_VIEWER_COLOR);
r4.addView(this.shadowTablet);
this.shadowTablet.setOnTouchListener(new -$.Lambda.LaunchActivity.kPzXTs0-UKgS_tVgUcMl0EIvSWU(this));
this.shadowTablet.setOnClickListener(-$.Lambda.LaunchActivity.eVWt3A-ghad9np48rk0-uY5Hx0M.INSTANCE);
ActionBarLayout actionBarLayout2 = new ActionBarLayout(this);
this.layersActionBarLayout = actionBarLayout2;
actionBarLayout2.setRemoveActionBarExtraHeight(true);
this.layersActionBarLayout.setBackgroundView(this.shadowTablet);
this.layersActionBarLayout.setUseAlphaAnimations(true);
this.layersActionBarLayout.setBackgroundResource(2131230876);
this.layersActionBarLayout.init(layerFragmentsStack);
this.layersActionBarLayout.setDelegate(this);
this.layersActionBarLayout.setDrawerLayoutContainer(this.drawerLayoutContainer);
this.layersActionBarLayout.setVisibility(layerFragmentsStack.isEmpty() ? 8 : 0);
r4.addView(this.layersActionBarLayout);
} else {
this.drawerLayoutContainer.addView(this.actionBarLayout, new ViewGroup.LayoutParams(-1, -1));
}
RecyclerListView recyclerListView = new RecyclerListView(this);
this.sideMenu = recyclerListView;
((DefaultItemAnimator) recyclerListView.getItemAnimator()).setDelayAnimations(false);
this.sideMenu.setBackgroundColor(Theme.getColor(Theme.key_chats_menuBackground));
this.sideMenu.setLayoutManager(new LinearLayoutManager(this, 1, false));
RecyclerListView recyclerListView2 = this.sideMenu;
DrawerLayoutAdapter drawerLayoutAdapter = new DrawerLayoutAdapter(this);
this.drawerLayoutAdapter = drawerLayoutAdapter;
recyclerListView2.setAdapter(drawerLayoutAdapter);
this.drawerLayoutContainer.setDrawerLayout(this.sideMenu);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.sideMenu.getLayoutParams();
Point screenSize = AndroidUtilities.getRealScreenSize();
layoutParams.width = AndroidUtilities.isTablet() ? AndroidUtilities.dp(320.0f) : Math.min(AndroidUtilities.dp(320.0f), Math.min(screenSize.x, screenSize.y) - AndroidUtilities.dp(56.0f));
layoutParams.height = -1;
this.sideMenu.setLayoutParams(layoutParams);
this.drawerLayoutContainer.setParentActionBarLayout(this.actionBarLayout);
this.actionBarLayout.setDrawerLayoutContainer(this.drawerLayoutContainer);
this.actionBarLayout.init(mainFragmentsStack);
this.actionBarLayout.setDelegate(this);
Theme.loadWallpaper();
PasscodeView passcodeView = new PasscodeView(this);
this.passcodeView = passcodeView;
this.drawerLayoutContainer.addView(passcodeView, LayoutHelper.createFrame(-1, -1.0f));
checkCurrentAccount();
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.closeOtherAppActivities, new Object[]{this});
this.currentConnectionState = ConnectionsManager.getInstance(this.currentAccount).getConnectionState();
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.needShowAlert);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.reloadInterface);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.suggestedLangpack);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didSetNewTheme);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.needSetDayNightTheme);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.closeOtherAppActivities);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didSetPasscode);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didSetNewWallpapper);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.notificationsCountUpdated);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.receivedAVideoCallRequest);
if (this.actionBarLayout.fragmentsStack.isEmpty()) {
if (!UserConfig.getInstance(this.currentAccount).isClientActivated()) {
this.actionBarLayout.addFragmentToStack(new LoginContronllerActivity());
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
} else {
this.actionBarLayout.addFragmentToStack(new IndexActivity());
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
}
if (savedInstanceState != null) {
try {
String fragmentName = savedInstanceState.getString("fragment");
if (fragmentName != null) {
Bundle args = savedInstanceState.getBundle("args");
switch (fragmentName.hashCode()) {
case -1529105743:
if (fragmentName.equals("wallpapers")) {
c = 5;
break;
}
break;
case -1349522494:
if (fragmentName.equals("chat_profile")) {
c = 4;
break;
}
break;
case 3052376:
if (fragmentName.equals("chat")) {
c = 0;
break;
}
break;
case 98629247:
if (fragmentName.equals("group")) {
c = 2;
break;
}
break;
case 738950403:
if (fragmentName.equals("channel")) {
c = 3;
break;
}
break;
case 1434631203:
if (fragmentName.equals("settings")) {
c = 1;
break;
}
break;
}
if (c != 0) {
if (c == 1) {
SettingsActivity settingsActivity = new SettingsActivity();
this.actionBarLayout.addFragmentToStack(settingsActivity);
settingsActivity.restoreSelfArgs(savedInstanceState);
} else if (c != 2) {
if (c != 3) {
if (c != 4) {
if (c == 5) {
WallpapersListActivity wallpapersListActivity = new WallpapersListActivity(0);
this.actionBarLayout.addFragmentToStack(wallpapersListActivity);
wallpapersListActivity.restoreSelfArgs(savedInstanceState);
}
} else if (args != null) {
ProfileActivity profileActivity = new ProfileActivity(args);
if (this.actionBarLayout.addFragmentToStack(profileActivity)) {
profileActivity.restoreSelfArgs(savedInstanceState);
}
}
} else if (args != null) {
ChannelCreateActivity channelCreateActivity = new ChannelCreateActivity(args);
if (this.actionBarLayout.addFragmentToStack(channelCreateActivity)) {
channelCreateActivity.restoreSelfArgs(savedInstanceState);
}
}
} else if (args != null) {
GroupCreateFinalActivity groupCreateFinalActivity = new GroupCreateFinalActivity(args);
if (this.actionBarLayout.addFragmentToStack(groupCreateFinalActivity)) {
groupCreateFinalActivity.restoreSelfArgs(savedInstanceState);
}
}
} else if (args != null) {
ChatActivity chatActivity = new ChatActivity(args);
if (this.actionBarLayout.addFragmentToStack(chatActivity)) {
chatActivity.restoreSelfArgs(savedInstanceState);
}
}
}
} catch (Exception e4) {
FileLog.e(e4);
}
}
} else {
BaseFragment fragment = this.actionBarLayout.fragmentsStack.get(0);
boolean z2 = fragment instanceof IndexActivity;
if (AndroidUtilities.isTablet()) {
boolean z3 = this.actionBarLayout.fragmentsStack.size() <= 1 && this.layersActionBarLayout.fragmentsStack.isEmpty();
if (this.layersActionBarLayout.fragmentsStack.size() != 1 || (this.layersActionBarLayout.fragmentsStack.get(0) instanceof LoginContronllerActivity)) {
}
}
if (this.actionBarLayout.fragmentsStack.size() != 1 || (this.actionBarLayout.fragmentsStack.get(0) instanceof LoginContronllerActivity)) {
}
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
}
if (this.actionBarLayout.fragmentsStack.size() >= 1) {
this.actionBarLayout.showLastFragment();
}
checkLayout();
checkSystemBarColors();
handleIntent(getIntent(), false, savedInstanceState != null, false);
try {
String os12 = Build.DISPLAY;
String os22 = Build.USER;
if (os12 == null) {
os1 = "";
} else {
os1 = os12.toLowerCase();
}
if (os22 == null) {
os2 = "";
} else {
os2 = os1.toLowerCase();
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("OS name " + os1 + " " + os2);
}
if (os1.contains("flyme") || os2.contains("flyme")) {
AndroidUtilities.incorrectDisplaySizeFix = true;
View view = getWindow().getDecorView().getRootView();
ViewTreeObserver viewTreeObserver = view.getViewTreeObserver();
-$.Lambda.LaunchActivity._CH55WRGcxMJmzlKAWBU4hENVP0 _ch55wrgcxmjmzlkawbu4henvp0 = new -$.Lambda.LaunchActivity._CH55WRGcxMJmzlKAWBU4hENVP0(view);
this.onGlobalLayoutListener = _ch55wrgcxmjmzlkawbu4henvp0;
viewTreeObserver.addOnGlobalLayoutListener(_ch55wrgcxmjmzlkawbu4henvp0);
}
} catch (Exception e5) {
FileLog.e(e5);
}
MediaController.getInstance().setBaseActivity(this, true);
}
public boolean lambda$onCreate$0$LaunchActivity(View v, MotionEvent event) {
if ((31 + 29) % 29 <= 0) {
}
if (this.actionBarLayout.fragmentsStack.isEmpty() || event.getAction() != 1) {
return false;
}
float x = event.getX();
float y = event.getY();
int[] location = new int[2];
this.layersActionBarLayout.getLocationOnScreen(location);
int viewX = location[0];
int viewY = location[1];
if (this.layersActionBarLayout.checkTransitionAnimation() || (x > viewX && x < this.layersActionBarLayout.getWidth() + viewX && y > viewY && y < this.layersActionBarLayout.getHeight() + viewY)) {
return false;
}
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
for (int a = 0; a < this.layersActionBarLayout.fragmentsStack.size() - 1; a = (a - 1) + 1) {
ActionBarLayout actionBarLayout = this.layersActionBarLayout;
actionBarLayout.removeFragmentFromStack(actionBarLayout.fragmentsStack.get(0));
}
this.layersActionBarLayout.closeLastFragment(true);
}
return true;
}
static void lambda$onCreate$1(View v) {
}
static void lambda$onCreate$2(View view) {
if ((14 + 24) % 24 <= 0) {
}
int height = view.getMeasuredHeight();
FileLog.d("height = " + height + " displayHeight = " + AndroidUtilities.displaySize.y);
if (Build.VERSION.SDK_INT >= 21) {
height -= AndroidUtilities.statusBarHeight;
}
if (height > AndroidUtilities.dp(100.0f) && height < AndroidUtilities.displaySize.y && AndroidUtilities.dp(100.0f) + height > AndroidUtilities.displaySize.y) {
AndroidUtilities.displaySize.y = height;
if (BuildVars.LOGS_ENABLED) {
FileLog.d("fix display size y to " + AndroidUtilities.displaySize.y);
}
}
}
@Deprecated
private void queryProxyAccount(Intent intent) {
}
private void checkSystemBarColors() {
checkSystemBarColors(true);
}
private void checkSystemBarColors(boolean checkNavigationBar) {
if ((31 + 32) % 32 <= 0) {
}
if (Build.VERSION.SDK_INT >= 23 && Build.VERSION.SDK_INT >= 26 && checkNavigationBar) {
Window window = getWindow();
int color = Theme.getColor(Theme.key_windowBackgroundGray);
if (window.getNavigationBarColor() != color) {
window.setNavigationBarColor(color);
float brightness = AndroidUtilities.computePerceivedBrightness(color);
AndroidUtilities.setLightNavigationBar(getWindow(), brightness >= 0.721f);
}
}
}
public void switchToAccount(int account, boolean removeAll) {
if ((19 + 23) % 23 <= 0) {
}
if (account == UserConfig.selectedAccount) {
return;
}
if (BuildVars.LOGS_ENABLED) {
FileLog.d("Launch ===> switchToAccount start newAccount = " + account + " oldAccount = " + this.currentAccount + " userConfigAccount = " + UserConfig.selectedAccount + " removeAll = " + removeAll);
}
ConnectionsManager.getInstance(this.currentAccount).setAppPaused(true, false);
UserConfig.selectedAccount = account;
UserConfig.getInstance(0).saveConfig(false);
checkCurrentAccount();
if (AndroidUtilities.isTablet()) {
this.layersActionBarLayout.removeAllFragments();
this.rightActionBarLayout.removeAllFragments();
if (!this.tabletFullSize) {
this.shadowTabletSide.setVisibility(0);
if (this.rightActionBarLayout.fragmentsStack.isEmpty()) {
this.backgroundTablet.setVisibility(0);
}
this.rightActionBarLayout.setVisibility(8);
}
this.layersActionBarLayout.setVisibility(8);
}
if (removeAll) {
this.actionBarLayout.removeAllFragments();
} else {
this.actionBarLayout.removeFragmentFromStack(0);
}
IndexActivity indexActivity = new IndexActivity();
this.actionBarLayout.addFragmentToStack(indexActivity, 0);
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
this.actionBarLayout.showLastFragment();
if (AndroidUtilities.isTablet()) {
this.layersActionBarLayout.showLastFragment();
this.rightActionBarLayout.showLastFragment();
}
if (!ApplicationLoader.mainInterfacePaused) {
ConnectionsManager.getInstance(this.currentAccount).setAppPaused(false, false);
}
if (UserConfig.getInstance(account).unacceptedTermsOfService != null) {
showTosActivity(account, UserConfig.getInstance(account).unacceptedTermsOfService);
}
AppPreferenceUtil.putString("PublishFcBean", "");
FcDBHelper.getInstance().deleteAll(HomeFcListBean.class);
FcDBHelper.getInstance().deleteAll(RecommendFcListBean.class);
FcDBHelper.getInstance().deleteAll(FollowedFcListBean.class);
if (BuildVars.LOGS_ENABLED) {
FileLog.d("Launch ===> switchToAccount end newAccount = " + account + " oldAccount = = " + this.currentAccount + " userConfigAccount = " + UserConfig.selectedAccount + " removeAll = " + removeAll);
}
DiscoveryJumpPausedFloatingView.getInstance().hide(true);
}
private void switchToAvailableAccountOrLogout() {
if ((12 + 25) % 25 <= 0) {
}
int account = -1;
int a = 0;
while (true) {
if (a >= 3) {
break;
}
if (!UserConfig.getInstance(a).isClientActivated()) {
a++;
} else {
account = a;
break;
}
}
TermsOfServiceView termsOfServiceView = this.termsOfServiceView;
if (termsOfServiceView != null) {
termsOfServiceView.setVisibility(8);
}
if (account != -1) {
switchToAccount(account, true);
return;
}
ConnectionsManager.getInstance(this.currentAccount).setAppPaused(true, false);
UserConfig.selectedAccount = 0;
UserConfig.getInstance(0).saveConfig(false);
checkCurrentAccount();
if (AndroidUtilities.isTablet()) {
this.layersActionBarLayout.removeAllFragments();
this.rightActionBarLayout.removeAllFragments();
if (!this.tabletFullSize) {
this.shadowTabletSide.setVisibility(0);
if (this.rightActionBarLayout.fragmentsStack.isEmpty()) {
this.backgroundTablet.setVisibility(0);
}
this.rightActionBarLayout.setVisibility(8);
}
this.layersActionBarLayout.setVisibility(8);
}
this.actionBarLayout.removeAllFragments();
BaseFragment loginContronllerActivity = new LoginContronllerActivity();
if (BuildVars.LOGS_ENABLED) {
FileLog.d("LaunchActivity ===> switchToAvailableAccountOrLogout() , logoutAccount = 0 UserConfig.selectedAccount = " + UserConfig.selectedAccount + " This.currentAccount = " + this.currentAccount + " loginPage.currentAccount = " + loginContronllerActivity.getCurrentAccount());
}
this.actionBarLayout.addFragmentToStack(loginContronllerActivity, 0);
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
this.actionBarLayout.showLastFragment();
if (AndroidUtilities.isTablet()) {
this.layersActionBarLayout.showLastFragment();
this.rightActionBarLayout.showLastFragment();
}
if (!ApplicationLoader.mainInterfacePaused) {
ConnectionsManager.getInstance(this.currentAccount).setAppPaused(false, false);
}
}
public int getMainFragmentsCount() {
return mainFragmentsStack.size();
}
private void checkCurrentAccount() {
if ((27 + 31) % 31 <= 0) {
}
if (this.currentAccount != UserConfig.selectedAccount) {
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.appDidLogout);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.mainUserInfoChanged);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.didUpdateConnectionState);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.needShowAlert);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.wasUnableToFindCurrentLocation);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.openArticle);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.hasNewContactsToImport);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.needShowPlayServicesAlert);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.fileDidLoad);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.fileDidFailToLoad);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.folderWebView);
}
int i = UserConfig.selectedAccount;
this.currentAccount = i;
NotificationCenter.getInstance(i).addObserver(this, NotificationCenter.appDidLogout);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.mainUserInfoChanged);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.didUpdateConnectionState);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.needShowAlert);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.wasUnableToFindCurrentLocation);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.openArticle);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.hasNewContactsToImport);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.needShowPlayServicesAlert);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.fileDidLoad);
NotificationCenter.getInstance(this.currentAccount).addObserver(this, NotificationCenter.fileDidFailToLoad);
NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.folderWebView);
updateCurrentConnectionState(this.currentAccount);
}
private void checkLayout() {
if ((10 + 11) % 11 <= 0) {
}
if (!AndroidUtilities.isTablet() || this.rightActionBarLayout == null) {
return;
}
if (!AndroidUtilities.isInMultiwindow && (!AndroidUtilities.isSmallTablet() || getResources().getConfiguration().orientation == 2)) {
this.tabletFullSize = false;
if (this.actionBarLayout.fragmentsStack.size() >= 2) {
for (int a = 1; a < this.actionBarLayout.fragmentsStack.size(); a = (a - 1) + 1) {
ChatActivity chatActivity = (BaseFragment) this.actionBarLayout.fragmentsStack.get(a);
if (chatActivity instanceof ChatActivity) {
chatActivity.setIgnoreAttachOnPause(true);
}
chatActivity.onPause();
this.actionBarLayout.fragmentsStack.remove(a);
this.rightActionBarLayout.fragmentsStack.add(chatActivity);
}
if (this.passcodeView.getVisibility() != 0) {
this.actionBarLayout.showLastFragment();
this.rightActionBarLayout.showLastFragment();
}
}
ActionBarLayout actionBarLayout = this.rightActionBarLayout;
actionBarLayout.setVisibility(actionBarLayout.fragmentsStack.isEmpty() ? 8 : 0);
this.backgroundTablet.setVisibility(this.rightActionBarLayout.fragmentsStack.isEmpty() ? 0 : 8);
this.shadowTabletSide.setVisibility(this.actionBarLayout.fragmentsStack.isEmpty() ? 8 : 0);
return;
}
this.tabletFullSize = true;
if (!this.rightActionBarLayout.fragmentsStack.isEmpty()) {
for (int a2 = 0; a2 < this.rightActionBarLayout.fragmentsStack.size(); a2 = (a2 - 1) + 1) {
ChatActivity chatActivity2 = (BaseFragment) this.rightActionBarLayout.fragmentsStack.get(a2);
if (chatActivity2 instanceof ChatActivity) {
chatActivity2.setIgnoreAttachOnPause(true);
}
chatActivity2.onPause();
this.rightActionBarLayout.fragmentsStack.remove(a2);
this.actionBarLayout.fragmentsStack.add(chatActivity2);
}
if (this.passcodeView.getVisibility() != 0) {
this.actionBarLayout.showLastFragment();
}
}
this.shadowTabletSide.setVisibility(8);
this.rightActionBarLayout.setVisibility(8);
this.backgroundTablet.setVisibility(this.actionBarLayout.fragmentsStack.isEmpty() ? 0 : 8);
}
private void showUpdateActivity(int account, TLRPC.TL_help_appUpdate update, boolean check) {
if ((6 + 27) % 27 <= 0) {
}
if (this.blockingUpdateView == null) {
View view = new 2(this, this);
this.blockingUpdateView = view;
this.drawerLayoutContainer.addView(view, LayoutHelper.createFrame(-1, -1.0f));
}
this.blockingUpdateView.show(account, update, check);
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
}
private void showTosActivity(int account, TLRPC.TL_help_termsOfService tos) {
if ((29 + 20) % 20 <= 0) {
}
if (this.termsOfServiceView == null) {
View termsOfServiceView = new TermsOfServiceView(this);
this.termsOfServiceView = termsOfServiceView;
this.drawerLayoutContainer.addView(termsOfServiceView, LayoutHelper.createFrame(-1, -1.0f));
this.termsOfServiceView.setDelegate(new TermsOfServiceView.TermsOfServiceViewDelegate() {
public void onAcceptTerms(int account2) {
if ((16 + 20) % 20 <= 0) {
}
UserConfig.getInstance(account2).unacceptedTermsOfService = null;
UserConfig.getInstance(account2).saveConfig(false);
LaunchActivity.this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
LaunchActivity.this.termsOfServiceView.setVisibility(8);
}
public void onDeclineTerms(int account2) {
if ((26 + 28) % 28 <= 0) {
}
LaunchActivity.this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
LaunchActivity.this.termsOfServiceView.setVisibility(8);
}
});
}
TLRPC.TL_help_termsOfService currentTos = UserConfig.getInstance(account).unacceptedTermsOfService;
if (currentTos != tos && (currentTos == null || !currentTos.id.data.equals(tos.id.data))) {
UserConfig.getInstance(account).unacceptedTermsOfService = tos;
UserConfig.getInstance(account).saveConfig(false);
}
this.termsOfServiceView.show(account, tos);
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
}
public void showPasscodeActivity() {
if ((19 + 30) % 30 <= 0) {
}
if (this.passcodeView == null) {
return;
}
SharedConfig.appLocked = true;
if (SecretMediaViewer.hasInstance() && SecretMediaViewer.getInstance().isVisible()) {
SecretMediaViewer.getInstance().closePhoto(false, false);
} else if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().closePhoto(false, true);
} else if (ArticleViewer.hasInstance() && ArticleViewer.getInstance().isVisible()) {
ArticleViewer.getInstance().close(false, true);
}
this.passcodeView.onShow();
SharedConfig.isWaitingForPasscodeEnter = true;
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
this.passcodeView.setDelegate(new -$.Lambda.LaunchActivity.oO9GH7UNm2kZXkfO5AfKVb-vXpU(this));
this.actionBarLayout.setVisibility(4);
if (AndroidUtilities.isTablet()) {
if (this.layersActionBarLayout.getVisibility() == 0) {
this.layersActionBarLayout.setVisibility(4);
}
this.rightActionBarLayout.setVisibility(4);
}
}
public void lambda$showPasscodeActivity$3$LaunchActivity() {
if ((28 + 15) % 15 <= 0) {
}
SharedConfig.isWaitingForPasscodeEnter = false;
Intent intent = this.passcodeSaveIntent;
if (intent != null) {
handleIntent(intent, this.passcodeSaveIntentIsNew, this.passcodeSaveIntentIsRestore, true);
this.passcodeSaveIntent = null;
}
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
this.actionBarLayout.setVisibility(0);
this.actionBarLayout.showLastFragment();
if (AndroidUtilities.isTablet()) {
this.layersActionBarLayout.showLastFragment();
this.rightActionBarLayout.showLastFragment();
if (this.layersActionBarLayout.getVisibility() == 4) {
this.layersActionBarLayout.setVisibility(0);
}
this.rightActionBarLayout.setVisibility(0);
}
}
private boolean handleIntent(android.content.Intent r68, boolean r69, boolean r70, boolean r71) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.ui.LaunchActivity.handleIntent(android.content.Intent, boolean, boolean, boolean):boolean");
}
public void lambda$handleIntent$4$LaunchActivity(Bundle args) {
lambda$runLinkRequest$28$LaunchActivity(new CancelAccountDeletionActivity(args));
}
public void lambda$handleIntent$6$LaunchActivity(int[] intentAccount, LocationController.SharingLocationInfo info) {
if ((8 + 15) % 15 <= 0) {
}
intentAccount[0] = info.messageObject.currentAccount;
switchToAccount(intentAccount[0], true);
NewLocationActivity locationActivity = new NewLocationActivity(3, info.messageObject);
long dialog_id = info.messageObject.getDialogId();
locationActivity.setDelegate(new -$.Lambda.LaunchActivity.DbcrYEjEuuEdC62BPlMlxjvyr_U(info, dialog_id));
lambda$runLinkRequest$28$LaunchActivity(locationActivity);
}
static void lambda$null$5(LocationController.SharingLocationInfo info, long dialog_id, TLRPC.MessageMedia location, int locationType, boolean notify, int scheduleDate) {
if ((22 + 31) % 31 <= 0) {
}
SendMessagesHelper.getInstance(info.messageObject.currentAccount).sendMessage(location, dialog_id, (MessageObject) null, (TLRPC.ReplyMarkup) null, (HashMap) null, notify, scheduleDate);
}
private void getUserInfo(TLRPC.User user) {
if ((30 + 14) % 14 <= 0) {
}
TLRPC.TL_users_getFullUser req = new TLRPC.TL_users_getFullUser();
req.id = MessagesController.getInstance(UserConfig.selectedAccount).getInputUser(user);
XAlertDialog progressDialog = new XAlertDialog(this, 4);
progressDialog.setLoadingText(LocaleController.getString(2131691846));
int reqId = ConnectionsManager.getInstance(UserConfig.selectedAccount).sendRequest(req, new -$.Lambda.LaunchActivity.6sYm6p4t60Fz-Y-1f5jFnsYUzE8(this, progressDialog));
progressDialog.show();
ConnectionsManager.getInstance(UserConfig.selectedAccount).bindRequestToGuid(reqId, getActionBarLayout().getCurrentFragment().getClassGuid());
}
public void lambda$getUserInfo$8$LaunchActivity(XAlertDialog progressDialog, TLObject response, TLRPC.TL_error error) {
if ((26 + 1) % 1 <= 0) {
}
progressDialog.dismiss();
if (error == null) {
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.dN2Dvnbm89xSmPS9ddWD7x6kdtE(this, response));
} else if ("USERNOTEXITST".equals(error.text)) {
AlertsCreator.showSimpleAlert(getActionBarLayout().getCurrentFragment(), LocaleController.getString("UserNotExist", 2131694575));
}
}
public void lambda$null$7$LaunchActivity(TLObject response) {
if ((7 + 10) % 10 <= 0) {
}
TLRPC.UserFull userFull = (TLRPC.UserFull) response;
MessagesController.getInstance(UserConfig.selectedAccount).putUser(userFull.user, false);
if (userFull.user == null) {
return;
}
if (userFull.user.self || userFull.user.contact) {
Bundle bundle = new Bundle();
bundle.putInt("user_id", userFull.user.id);
lambda$runLinkRequest$28$LaunchActivity(new NewProfileActivity(bundle));
} else {
Bundle bundle2 = new Bundle();
bundle2.putInt("from_type", 4);
lambda$runLinkRequest$28$LaunchActivity(new AddContactsInfoActivity(bundle2, userFull.user));
}
}
private void runLinkRequest(int intentAccount, String username, String group, String sticker, String botUser, String botChat, final String message, final boolean hasUrl, Integer messageId, Integer channelId, String game, HashMap<String, String> auth, String lang, String unsupportedUrl, String code, TLRPC.TL_wallPaper wallPaper, String theme, int state) {
final int i;
int[] requestId;
AlertDialog progressDialog;
if ((30 + 18) % 18 <= 0) {
}
if (state == 0 && UserConfig.getActivatedAccountsCount() >= 2 && auth != null) {
AlertsCreator.createAccountSelectDialog(this, new -$.Lambda.LaunchActivity.n37wJ_DlDjIkgLwMvsZ39gsZqa8(this, intentAccount, username, group, sticker, botUser, botChat, message, hasUrl, messageId, channelId, game, auth, lang, unsupportedUrl, code, wallPaper, theme)).show();
return;
}
BaseFragment baseFragment = null;
if (code == null) {
AlertDialog progressDialog2 = new AlertDialog(this, 3);
int[] requestId2 = {0};
Runnable cancelRunnable = null;
if (username != null) {
TLRPC.TL_contacts_resolveUsername req = new TLRPC.TL_contacts_resolveUsername();
req.username = username;
requestId2[0] = ConnectionsManager.getInstance(intentAccount).sendRequest(req, new -$.Lambda.LaunchActivity.MAk5auGnXFpbE-bho11pYuG9Mpk(this, progressDialog2, game, intentAccount, botChat, botUser, messageId));
requestId = requestId2;
progressDialog = progressDialog2;
i = intentAccount;
} else if (group == null) {
i = intentAccount;
requestId = requestId2;
if (sticker != null) {
if (!mainFragmentsStack.isEmpty()) {
TLRPC.TL_inputStickerSetShortName stickerset = new TLRPC.TL_inputStickerSetShortName();
stickerset.short_name = sticker;
ArrayList<BaseFragment> arrayList = mainFragmentsStack;
BaseFragment fragment = arrayList.get(arrayList.size() - 1);
fragment.showDialog(new StickersAlert(this, fragment, stickerset, (TLRPC.TL_messages_stickerSet) null, (StickersAlert$StickersAlertDelegate) null));
return;
}
return;
}
if (message != null) {
Bundle args = new Bundle();
args.putBoolean("onlySelect", true);
DialogsActivity fragment2 = new DialogsActivity(args);
fragment2.setDelegate(new DialogsActivity.DialogsActivityDelegate() {
public final void didSelectDialogs(DialogsActivity dialogsActivity, ArrayList arrayList2, CharSequence charSequence, boolean z) {
if ((28 + 8) % 8 <= 0) {
}
LaunchActivity.this.lambda$runLinkRequest$19$LaunchActivity(hasUrl, i, message, dialogsActivity, arrayList2, charSequence, z);
}
});
presentFragment(fragment2, false, true);
progressDialog = progressDialog2;
} else if (auth == null) {
progressDialog = progressDialog2;
if (unsupportedUrl != null) {
TLRPC.TL_help_getDeepLinkInfo req2 = new TLRPC.TL_help_getDeepLinkInfo();
req2.path = unsupportedUrl;
requestId[0] = ConnectionsManager.getInstance(this.currentAccount).sendRequest(req2, new -$.Lambda.LaunchActivity.mEm6OIakBhIUkraqMNr5P65R2vA(this, progressDialog));
} else if (lang != null) {
TLRPC.TL_langpack_getLanguage req3 = new TLRPC.TL_langpack_getLanguage();
req3.lang_code = lang;
req3.lang_pack = "android";
requestId[0] = ConnectionsManager.getInstance(this.currentAccount).sendRequest(req3, new -$.Lambda.LaunchActivity.qiL0U9aNXDTDQDWhmm5kmKGhQcA(this, progressDialog));
} else if (wallPaper != null) {
boolean ok = false;
if (TextUtils.isEmpty(wallPaper.slug)) {
try {
WallpapersListActivity.ColorWallpaper colorWallpaper = new WallpapersListActivity.ColorWallpaper(-100L, wallPaper.settings.background_color);
WallpaperActivity wallpaperActivity = new WallpaperActivity(colorWallpaper, (Bitmap) null);
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.Epqkc5oHxf54ST6IniHKgIFPtfA(this, wallpaperActivity));
ok = true;
} catch (Exception e) {
FileLog.e(e);
}
}
if (!ok) {
TLRPC.TL_account_getWallPaper req4 = new TLRPC.TL_account_getWallPaper();
TLRPC.TL_inputWallPaperSlug inputWallPaperSlug = new TLRPC.TL_inputWallPaperSlug();
inputWallPaperSlug.slug = wallPaper.slug;
req4.wallpaper = inputWallPaperSlug;
requestId[0] = ConnectionsManager.getInstance(this.currentAccount).sendRequest(req4, new -$.Lambda.LaunchActivity.rA_-egnZwwrCjwoFFYWIpfX3E9Y(this, progressDialog, wallPaper));
}
} else if (theme != null) {
Runnable cancelRunnable2 = new -$.Lambda.LaunchActivity.5CDR6pBKi0bPr1EFxwf2rUxsIzs(this);
TLRPC.TL_account_getTheme req5 = new TLRPC.TL_account_getTheme();
req5.format = "android";
TLRPC.TL_inputThemeSlug inputThemeSlug = new TLRPC.TL_inputThemeSlug();
inputThemeSlug.slug = theme;
req5.theme = inputThemeSlug;
requestId[0] = ConnectionsManager.getInstance(this.currentAccount).sendRequest(req5, new -$.Lambda.LaunchActivity.634Izm1LW0qjedmSG05OLJVt-rc(this, progressDialog));
cancelRunnable = cancelRunnable2;
} else if (channelId != null && messageId != null) {
Bundle args2 = new Bundle();
args2.putInt("chat_id", channelId.intValue());
args2.putInt("message_id", messageId.intValue());
if (!mainFragmentsStack.isEmpty()) {
ArrayList<BaseFragment> arrayList2 = mainFragmentsStack;
baseFragment = arrayList2.get(arrayList2.size() - 1);
}
BaseFragment lastFragment = baseFragment;
if (lastFragment == null || MessagesController.getInstance(intentAccount).checkCanOpenChat(args2, lastFragment)) {
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.6qhCuj-hPdB2rbQKRsXwIR45Nr0(this, args2, channelId, requestId, progressDialog, lastFragment, intentAccount));
}
}
} else {
int bot_id = Utilities.parseInt(auth.get("bot_id")).intValue();
if (bot_id == 0) {
return;
}
String payload = auth.get("payload");
String nonce = auth.get("nonce");
String callbackUrl = auth.get("callback_url");
TLRPC.TL_account_getAuthorizationForm req6 = new TLRPC.TL_account_getAuthorizationForm();
req6.bot_id = bot_id;
req6.scope = auth.get("scope");
req6.public_key = auth.get("public_key");
progressDialog = progressDialog2;
requestId[0] = ConnectionsManager.getInstance(intentAccount).sendRequest(req6, new -$.Lambda.LaunchActivity.fE4huUuIxXAONulQdPf7tFe1_Jc(this, requestId, intentAccount, progressDialog2, req6, payload, nonce, callbackUrl));
}
} else if (state == 0) {
TLRPC.TL_messages_checkChatInvite req7 = new TLRPC.TL_messages_checkChatInvite();
req7.hash = group;
requestId = requestId2;
requestId[0] = ConnectionsManager.getInstance(intentAccount).sendRequest(req7, new -$.Lambda.LaunchActivity.u8WeDAYJEtlrzGN_brTMulr9AS8(this, progressDialog2, intentAccount, group, username, sticker, botUser, botChat, message, hasUrl, messageId, channelId, game, auth, lang, unsupportedUrl, code, wallPaper, theme), 2);
i = intentAccount;
progressDialog = progressDialog2;
} else {
requestId = requestId2;
if (state == 1) {
TLRPC.TL_messages_importChatInvite req8 = new TLRPC.TL_messages_importChatInvite();
req8.hash = group;
i = intentAccount;
ConnectionsManager.getInstance(intentAccount).sendRequest(req8, new -$.Lambda.LaunchActivity.M-Xzn3hhLDFnpF-TMszphbTcWgE(this, i, progressDialog2), 2);
progressDialog = progressDialog2;
} else {
i = intentAccount;
progressDialog = progressDialog2;
}
}
if (requestId[0] != 0) {
Runnable cancelRunnableFinal = cancelRunnable;
progressDialog.setOnCancelListener(new -$.Lambda.LaunchActivity.4B5YSZU3_ah0HEcM53i23WL4QLI(i, requestId, cancelRunnableFinal));
try {
progressDialog.show();
return;
} catch (Exception e2) {
return;
}
}
return;
}
if (!NotificationCenter.getGlobalInstance().hasObservers(NotificationCenter.didReceiveSmsCode)) {
AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
builder.setTitle(LocaleController.getString("AppName", 2131689827));
builder.setMessage(AndroidUtilities.replaceTags(LocaleController.formatString("OtherLoginCode", 2131692547, new Object[]{code})));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
showAlertDialog(builder);
return;
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, new Object[]{code});
}
public void lambda$runLinkRequest$9$LaunchActivity(int intentAccount, String username, String group, String sticker, String botUser, String botChat, String message, boolean hasUrl, Integer messageId, Integer channelId, String game, HashMap auth, String lang, String unsupportedUrl, String code, TLRPC.TL_wallPaper wallPaper, String theme, int account) {
if ((2 + 28) % 28 <= 0) {
}
if (account != intentAccount) {
switchToAccount(account, true);
}
runLinkRequest(account, username, group, sticker, botUser, botChat, message, hasUrl, messageId, channelId, game, auth, lang, unsupportedUrl, code, wallPaper, theme, 1);
}
public void lambda$runLinkRequest$13$LaunchActivity(AlertDialog progressDialog, String game, int intentAccount, String botChat, String botUser, Integer messageId, TLObject response, TLRPC.TL_error error) {
if ((16 + 1) % 1 <= 0) {
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.EZ2ese05SWw57w7A0OgpVRaJwNk(this, progressDialog, response, error, game, intentAccount, botChat, botUser, messageId));
}
public void lambda$null$12$LaunchActivity(AlertDialog progressDialog, TLObject response, TLRPC.TL_error error, String game, int intentAccount, String botChat, String botUser, Integer messageId) {
long dialog_id;
boolean removeLast;
if ((31 + 15) % 15 <= 0) {
}
if (!isFinishing()) {
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
TLRPC.TL_contacts_resolvedPeer res = (TLRPC.TL_contacts_resolvedPeer) response;
if (error != null || this.actionBarLayout == null || (game != null && (game == null || res.users.isEmpty()))) {
try {
AlertsCreator.createSimpleAlert(this, LocaleController.getString("JoinToGroupErrorNotExist", 2131691733)).show();
return;
} catch (Exception e2) {
FileLog.e(e2);
return;
}
}
MessagesController.getInstance(intentAccount).putUsers(res.users, false);
MessagesController.getInstance(intentAccount).putChats(res.chats, false);
MessagesStorage.getInstance(intentAccount).putUsersAndChats(res.users, res.chats, false, true);
if (game != null) {
Bundle args = new Bundle();
args.putBoolean("onlySelect", true);
args.putBoolean("cantSendToChannels", true);
args.putInt("dialogsType", 1);
args.putString("selectAlertString", LocaleController.getString("SendGameTo", 2131693812));
args.putString("selectAlertStringGroup", LocaleController.getString("SendGameToGroup", 2131693813));
BaseFragment dialogsActivity = new DialogsActivity(args);
dialogsActivity.setDelegate(new -$.Lambda.LaunchActivity.jrG2JX8xBTsAnVn0gzexvIEmnmQ(this, game, intentAccount, res));
if (AndroidUtilities.isTablet()) {
removeLast = this.layersActionBarLayout.fragmentsStack.size() > 0 && (this.layersActionBarLayout.fragmentsStack.get(this.layersActionBarLayout.fragmentsStack.size() - 1) instanceof IndexActivity);
} else {
removeLast = this.actionBarLayout.fragmentsStack.size() > 1 && (this.actionBarLayout.fragmentsStack.get(this.actionBarLayout.fragmentsStack.size() - 1) instanceof IndexActivity);
}
this.actionBarLayout.presentFragment(dialogsActivity, removeLast, true, true, false);
if (SecretMediaViewer.hasInstance() && SecretMediaViewer.getInstance().isVisible()) {
SecretMediaViewer.getInstance().closePhoto(false, false);
} else if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().closePhoto(false, true);
} else if (ArticleViewer.hasInstance() && ArticleViewer.getInstance().isVisible()) {
ArticleViewer.getInstance().close(false, true);
}
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
if (AndroidUtilities.isTablet()) {
this.actionBarLayout.showLastFragment();
this.rightActionBarLayout.showLastFragment();
return;
} else {
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
return;
}
}
if (botChat != null) {
user = res.users.isEmpty() ? null : (TLRPC.User) res.users.get(0);
if (user == null || (user.bot && user.bot_nochats)) {
try {
ToastUtils.show(2131690185);
return;
} catch (Exception e3) {
FileLog.e(e3);
return;
}
}
Bundle args2 = new Bundle();
args2.putBoolean("onlySelect", true);
args2.putInt("dialogsType", 2);
args2.putString("addToGroupAlertString", LocaleController.formatString("AddToTheGroupTitle", 2131689718, new Object[]{UserObject.getName(user), "%1$s"}));
DialogsActivity fragment = new DialogsActivity(args2);
fragment.setDelegate(new -$.Lambda.LaunchActivity.nL32IuochEGPTEv6dRp69g6NBlc(this, intentAccount, user, botChat));
lambda$runLinkRequest$28$LaunchActivity(fragment);
return;
}
boolean isBot = false;
Bundle args3 = new Bundle();
if (!res.chats.isEmpty()) {
args3.putInt("chat_id", ((TLRPC.Chat) res.chats.get(0)).id);
dialog_id = -((TLRPC.Chat) res.chats.get(0)).id;
} else {
args3.putInt("user_id", ((TLRPC.User) res.users.get(0)).id);
dialog_id = ((TLRPC.User) res.users.get(0)).id;
}
if (botUser != null && res.users.size() > 0 && ((TLRPC.User) res.users.get(0)).bot) {
args3.putString("botUser", botUser);
isBot = true;
}
if (messageId != null) {
args3.putInt("message_id", messageId.intValue());
}
if (!mainFragmentsStack.isEmpty()) {
ArrayList<BaseFragment> arrayList = mainFragmentsStack;
user = (BaseFragment) arrayList.get(arrayList.size() - 1);
}
TLRPC.User user = user;
if (user == null || MessagesController.getInstance(intentAccount).checkCanOpenChat(args3, user)) {
if (isBot && (user instanceof ChatActivity) && ((ChatActivity) user).getDialogId() == dialog_id) {
((ChatActivity) user).setBotUser(botUser);
} else {
this.actionBarLayout.presentFragment(new ChatActivity(args3));
}
}
}
}
public void lambda$null$10$LaunchActivity(String game, int intentAccount, TLRPC.TL_contacts_resolvedPeer res, DialogsActivity fragment1, ArrayList dids, CharSequence message1, boolean param) {
if ((11 + 32) % 32 <= 0) {
}
long did = ((Long) dids.get(0)).longValue();
TLRPC.TL_inputMediaGame inputMediaGame = new TLRPC.TL_inputMediaGame();
inputMediaGame.id = new TLRPC.TL_inputGameShortName();
inputMediaGame.id.short_name = game;
inputMediaGame.id.bot_id = MessagesController.getInstance(intentAccount).getInputUser((TLRPC.User) res.users.get(0));
SendMessagesHelper.getInstance(intentAccount).sendGame(MessagesController.getInstance(intentAccount).getInputPeer((int) did), inputMediaGame, 0L, 0L);
Bundle args1 = new Bundle();
args1.putBoolean("scrollToTopOnResume", true);
int lower_part = (int) did;
int high_id = (int) (did >> 32);
if (lower_part != 0) {
if (lower_part > 0) {
args1.putInt("user_id", lower_part);
} else if (lower_part < 0) {
args1.putInt("chat_id", -lower_part);
}
} else {
args1.putInt("enc_id", high_id);
}
if (MessagesController.getInstance(intentAccount).checkCanOpenChat(args1, fragment1)) {
NotificationCenter.getInstance(intentAccount).postNotificationName(NotificationCenter.closeChats, new Object[0]);
this.actionBarLayout.presentFragment(new ChatActivity(args1), true, false, true, false);
}
}
public void lambda$null$11$LaunchActivity(int intentAccount, TLRPC.User user, String botChat, DialogsActivity fragment12, ArrayList dids, CharSequence message1, boolean param) {
if ((15 + 13) % 13 <= 0) {
}
long did = ((Long) dids.get(0)).longValue();
Bundle args12 = new Bundle();
args12.putBoolean("scrollToTopOnResume", true);
args12.putInt("chat_id", -((int) did));
if (!mainFragmentsStack.isEmpty()) {
MessagesController messagesController = MessagesController.getInstance(intentAccount);
ArrayList<BaseFragment> arrayList = mainFragmentsStack;
if (!messagesController.checkCanOpenChat(args12, arrayList.get(arrayList.size() - 1))) {
return;
}
}
NotificationCenter.getInstance(intentAccount).postNotificationName(NotificationCenter.closeChats, new Object[0]);
MessagesController.getInstance(intentAccount).addUserToChat(-((int) did), user, (TLRPC.ChatFull) null, 0, botChat, (BaseFragment) null, (Runnable) null);
this.actionBarLayout.presentFragment(new ChatActivity(args12), true, false, true, false);
}
public void lambda$runLinkRequest$16$LaunchActivity(AlertDialog progressDialog, int intentAccount, String group, String username, String sticker, String botUser, String botChat, String message, boolean hasUrl, Integer messageId, Integer channelId, String game, HashMap auth, String lang, String unsupportedUrl, String code, TLRPC.TL_wallPaper wallPaper, String theme, TLObject response, TLRPC.TL_error error) {
if ((6 + 28) % 28 <= 0) {
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.bgPIexYFVhAH5jpF_pvjMwl-RB8(this, progressDialog, error, response, intentAccount, group, username, sticker, botUser, botChat, message, hasUrl, messageId, channelId, game, auth, lang, unsupportedUrl, code, wallPaper, theme));
}
public void lambda$null$15$LaunchActivity(im.amwhusedvt.ui.actionbar.AlertDialog r24, im.amwhusedvt.tgnet.TLRPC.TL_error r25, im.amwhusedvt.tgnet.TLObject r26, int r27, java.lang.String r28, java.lang.String r29, java.lang.String r30, java.lang.String r31, java.lang.String r32, java.lang.String r33, boolean r34, java.lang.Integer r35, java.lang.Integer r36, java.lang.String r37, java.util.HashMap r38, java.lang.String r39, java.lang.String r40, java.lang.String r41, im.amwhusedvt.tgnet.TLRPC.TL_wallPaper r42, java.lang.String r43) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.ui.LaunchActivity.lambda$null$15$LaunchActivity(im.amwhusedvt.ui.actionbar.AlertDialog, im.amwhusedvt.tgnet.TLRPC$TL_error, im.amwhusedvt.tgnet.TLObject, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, java.lang.Integer, java.lang.Integer, java.lang.String, java.util.HashMap, java.lang.String, java.lang.String, java.lang.String, im.amwhusedvt.tgnet.TLRPC$TL_wallPaper, java.lang.String):void");
}
public void lambda$null$14$LaunchActivity(int intentAccount, String username, String group, String sticker, String botUser, String botChat, String message, boolean hasUrl, Integer messageId, Integer channelId, String game, HashMap auth, String lang, String unsupportedUrl, String code, TLRPC.TL_wallPaper wallPaper, String theme, DialogInterface dialogInterface, int i) {
if ((15 + 15) % 15 <= 0) {
}
runLinkRequest(intentAccount, username, group, sticker, botUser, botChat, message, hasUrl, messageId, channelId, game, auth, lang, unsupportedUrl, code, wallPaper, theme, 1);
}
public void lambda$runLinkRequest$18$LaunchActivity(int intentAccount, AlertDialog progressDialog, TLObject response, TLRPC.TL_error error) {
if ((11 + 29) % 29 <= 0) {
}
if (error == null) {
TLRPC.Updates updates = (TLRPC.Updates) response;
MessagesController.getInstance(intentAccount).processUpdates(updates, false);
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.8AKtCg_LJTM6kwAr_m1c35XVg2s(this, progressDialog, error, response, intentAccount));
}
public void lambda$null$17$LaunchActivity(AlertDialog progressDialog, TLRPC.TL_error error, TLObject response, int intentAccount) {
if ((14 + 6) % 6 <= 0) {
}
if (!isFinishing()) {
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
if (error == null) {
if (this.actionBarLayout != null) {
TLRPC.Updates updates = (TLRPC.Updates) response;
if (!updates.chats.isEmpty()) {
TLRPC.Chat chat = (TLRPC.Chat) updates.chats.get(0);
chat.left = false;
chat.kicked = false;
MessagesController.getInstance(intentAccount).putUsers(updates.users, false);
MessagesController.getInstance(intentAccount).putChats(updates.chats, false);
Bundle args = new Bundle();
args.putInt("chat_id", chat.id);
if (!mainFragmentsStack.isEmpty()) {
if (!MessagesController.getInstance(intentAccount).checkCanOpenChat(args, mainFragmentsStack.get(r5.size() - 1))) {
return;
}
}
BaseFragment chatActivity = new ChatActivity(args);
NotificationCenter.getInstance(intentAccount).postNotificationName(NotificationCenter.closeChats, new Object[0]);
this.actionBarLayout.presentFragment(chatActivity, false, true, true, false);
return;
}
return;
}
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
builder.setTitle(LocaleController.getString("AppName", 2131689827));
if (error.text.startsWith("FLOOD_WAIT")) {
builder.setMessage(LocaleController.getString("FloodWait", 2131691328));
} else if (error.text.equals("USERS_TOO_MUCH")) {
builder.setMessage(LocaleController.getString("JoinToGroupErrorFull", 2131691732));
} else {
builder.setMessage(LocaleController.getString("JoinToGroupErrorNotExist", 2131691733));
}
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
showAlertDialog(builder);
}
}
public void lambda$runLinkRequest$19$LaunchActivity(boolean hasUrl, int intentAccount, String message, DialogsActivity fragment13, ArrayList dids, CharSequence m, boolean param) {
if ((30 + 9) % 9 <= 0) {
}
long did = ((Long) dids.get(0)).longValue();
Bundle args13 = new Bundle();
args13.putBoolean("scrollToTopOnResume", true);
args13.putBoolean("hasUrl", hasUrl);
int lower_part = (int) did;
int high_id = (int) (did >> 32);
if (lower_part != 0) {
if (lower_part > 0) {
args13.putInt("user_id", lower_part);
} else if (lower_part < 0) {
args13.putInt("chat_id", -lower_part);
}
} else {
args13.putInt("enc_id", high_id);
}
if (MessagesController.getInstance(intentAccount).checkCanOpenChat(args13, fragment13)) {
NotificationCenter.getInstance(intentAccount).postNotificationName(NotificationCenter.closeChats, new Object[0]);
MediaDataController.getInstance(intentAccount).saveDraft(did, message, (ArrayList) null, (TLRPC.Message) null, false);
this.actionBarLayout.presentFragment(new ChatActivity(args13), true, false, true, false);
}
}
public void lambda$runLinkRequest$23$LaunchActivity(int[] requestId, int intentAccount, final AlertDialog progressDialog, TLRPC.TL_account_getAuthorizationForm req, String payload, String nonce, String callbackUrl, TLObject response, final TLRPC.TL_error error) {
if ((31 + 13) % 13 <= 0) {
}
TLRPC.TL_account_authorizationForm authorizationForm = (TLRPC.TL_account_authorizationForm) response;
if (authorizationForm != null) {
TLRPC.TL_account_getPassword req2 = new TLRPC.TL_account_getPassword();
requestId[0] = ConnectionsManager.getInstance(intentAccount).sendRequest(req2, new -$.Lambda.LaunchActivity.pxr-gtHiYJ-bGI8awFgd_cuzs2c(this, progressDialog, intentAccount, authorizationForm, req, payload, nonce, callbackUrl));
} else {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((23 + 24) % 24 <= 0) {
}
LaunchActivity.this.lambda$null$22$LaunchActivity(progressDialog, error);
}
});
}
}
public void lambda$null$21$LaunchActivity(AlertDialog progressDialog, int intentAccount, TLRPC.TL_account_authorizationForm authorizationForm, TLRPC.TL_account_getAuthorizationForm req, String payload, String nonce, String callbackUrl, TLObject response1, TLRPC.TL_error error1) {
if ((30 + 14) % 14 <= 0) {
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.7N_eM1iiMpIqv3gG-eVRXG5AmH0(this, progressDialog, response1, intentAccount, authorizationForm, req, payload, nonce, callbackUrl));
}
public void lambda$null$20$LaunchActivity(AlertDialog progressDialog, TLObject response1, int intentAccount, TLRPC.TL_account_authorizationForm authorizationForm, TLRPC.TL_account_getAuthorizationForm req, String payload, String nonce, String callbackUrl) {
if ((18 + 8) % 8 <= 0) {
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
if (response1 != null) {
TLRPC.TL_account_password accountPassword = (TLRPC.TL_account_password) response1;
MessagesController.getInstance(intentAccount).putUsers(authorizationForm.users, false);
lambda$runLinkRequest$28$LaunchActivity(new PassportActivity(5, req.bot_id, req.scope, req.public_key, payload, nonce, callbackUrl, authorizationForm, accountPassword));
}
}
public void lambda$null$22$LaunchActivity(AlertDialog progressDialog, TLRPC.TL_error error) {
if ((16 + 32) % 32 <= 0) {
}
try {
progressDialog.dismiss();
if ("APP_VERSION_OUTDATED".equals(error.text)) {
AlertsCreator.showUpdateAppAlert(this, LocaleController.getString("UpdateAppAlert", 2131694508), true);
} else {
showAlertDialog(AlertsCreator.createSimpleAlert(this, LocaleController.getString("ErrorOccurred", 2131691148) + "\n" + error.text));
}
} catch (Exception e) {
FileLog.e(e);
}
}
public void lambda$runLinkRequest$25$LaunchActivity(final AlertDialog progressDialog, final TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((11 + 3) % 3 <= 0) {
}
LaunchActivity.this.lambda$null$24$LaunchActivity(progressDialog, response);
}
});
}
public void lambda$null$24$LaunchActivity(AlertDialog progressDialog, TLObject response) {
if ((28 + 10) % 10 <= 0) {
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
if (response instanceof TLRPC.TL_help_deepLinkInfo) {
TLRPC.TL_help_deepLinkInfo res = (TLRPC.TL_help_deepLinkInfo) response;
AlertsCreator.showUpdateAppAlert(this, res.message, res.update_app);
}
}
public void lambda$runLinkRequest$27$LaunchActivity(final AlertDialog progressDialog, final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((14 + 25) % 25 <= 0) {
}
LaunchActivity.this.lambda$null$26$LaunchActivity(progressDialog, response, error);
}
});
}
public void lambda$null$26$LaunchActivity(AlertDialog progressDialog, TLObject response, TLRPC.TL_error error) {
if ((20 + 30) % 30 <= 0) {
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
if (response instanceof TLRPC.TL_langPackLanguage) {
TLRPC.TL_langPackLanguage res = (TLRPC.TL_langPackLanguage) response;
showAlertDialog(AlertsCreator.createLanguageAlert(this, res));
} else if (error != null) {
if ("LANG_CODE_NOT_SUPPORTED".equals(error.text)) {
showAlertDialog(AlertsCreator.createSimpleAlert(this, LocaleController.getString("LanguageUnsupportedError", 2131691782)));
return;
}
showAlertDialog(AlertsCreator.createSimpleAlert(this, LocaleController.getString("ErrorOccurred", 2131691148) + "\n" + error.text));
}
}
public void lambda$runLinkRequest$30$LaunchActivity(AlertDialog progressDialog, TLRPC.TL_wallPaper wallPaper, TLObject response, TLRPC.TL_error error) {
if ((3 + 26) % 26 <= 0) {
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity._mtxV4JrKonF-_ucbW95ViLXVcg(this, progressDialog, response, wallPaper, error));
}
public void lambda$null$29$LaunchActivity(AlertDialog progressDialog, TLObject response, TLRPC.TL_wallPaper wallPaper, TLRPC.TL_error error) {
WallpapersListActivity.ColorWallpaper colorWallpaper;
if ((9 + 28) % 28 <= 0) {
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
if (response instanceof TLRPC.TL_wallPaper) {
WallpapersListActivity.ColorWallpaper colorWallpaper2 = (TLRPC.TL_wallPaper) response;
if (((TLRPC.TL_wallPaper) colorWallpaper2).pattern) {
colorWallpaper = new WallpapersListActivity.ColorWallpaper(-1L, wallPaper.settings.background_color, ((TLRPC.TL_wallPaper) colorWallpaper2).id, wallPaper.settings.intensity / 100.0f, wallPaper.settings.motion, (File) null);
colorWallpaper.pattern = colorWallpaper2;
} else {
colorWallpaper = colorWallpaper2;
}
WallpaperActivity wallpaperActivity = new WallpaperActivity(colorWallpaper, (Bitmap) null);
wallpaperActivity.setInitialModes(wallPaper.settings.blur, wallPaper.settings.motion);
lambda$runLinkRequest$28$LaunchActivity(wallpaperActivity);
return;
}
showAlertDialog(AlertsCreator.createSimpleAlert(this, LocaleController.getString("ErrorOccurred", 2131691148) + "\n" + error.text));
}
public void lambda$runLinkRequest$31$LaunchActivity() {
this.loadingThemeFileName = null;
this.loadingThemeWallpaperName = null;
this.loadingThemeInfo = null;
this.loadingThemeProgressDialog = null;
this.loadingTheme = null;
}
public void lambda$runLinkRequest$33$LaunchActivity(AlertDialog progressDialog, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.Is5cc3cCfT0tLyY-VEzV2Db8TA8(this, response, progressDialog, error));
}
public void lambda$null$32$LaunchActivity(TLObject response, AlertDialog progressDialog, TLRPC.TL_error error) {
if ((1 + 28) % 28 <= 0) {
}
int notFound = 2;
if (response instanceof TLRPC.TL_theme) {
TLRPC.TL_theme t = (TLRPC.TL_theme) response;
if (t.document != null) {
this.loadingTheme = t;
this.loadingThemeFileName = FileLoader.getAttachFileName(t.document);
this.loadingThemeProgressDialog = progressDialog;
FileLoader.getInstance(this.currentAccount).loadFile(this.loadingTheme.document, t, 1, 1);
notFound = 0;
} else {
notFound = 1;
}
} else if (error != null && "THEME_FORMAT_INVALID".equals(error.text)) {
notFound = 1;
}
if (notFound != 0) {
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
if (notFound == 1) {
showAlertDialog(AlertsCreator.createSimpleAlert(this, LocaleController.getString("Theme", 2131694176), LocaleController.getString("ThemeNotSupported", 2131694195)));
} else {
showAlertDialog(AlertsCreator.createSimpleAlert(this, LocaleController.getString("Theme", 2131694176), LocaleController.getString("ThemeNotFound", 2131694194)));
}
}
}
public void lambda$runLinkRequest$36$LaunchActivity(Bundle args, Integer channelId, int[] requestId, AlertDialog progressDialog, BaseFragment lastFragment, int intentAccount) {
if ((6 + 9) % 9 <= 0) {
}
if (!this.actionBarLayout.presentFragment(new ChatActivity(args))) {
TLRPC.TL_channels_getChannels req = new TLRPC.TL_channels_getChannels();
TLRPC.TL_inputChannel inputChannel = new TLRPC.TL_inputChannel();
inputChannel.channel_id = channelId.intValue();
req.id.add(inputChannel);
requestId[0] = ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new -$.Lambda.LaunchActivity._b_oFDliTGKLzpG83Dj7gfc0NMs(this, progressDialog, lastFragment, intentAccount, args));
}
}
public void lambda$null$35$LaunchActivity(final AlertDialog progressDialog, final BaseFragment lastFragment, final int intentAccount, final Bundle args, final TLObject response, TLRPC.TL_error error) {
if ((29 + 32) % 32 <= 0) {
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public final void run() {
if ((7 + 28) % 28 <= 0) {
}
LaunchActivity.this.lambda$null$34$LaunchActivity(progressDialog, response, lastFragment, intentAccount, args);
}
});
}
public void lambda$null$34$LaunchActivity(AlertDialog progressDialog, TLObject response, BaseFragment lastFragment, int intentAccount, Bundle args) {
if ((9 + 13) % 13 <= 0) {
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e(e);
}
boolean notFound = true;
if (response instanceof TLRPC.TL_messages_chats) {
TLRPC.TL_messages_chats res = (TLRPC.TL_messages_chats) response;
if (!res.chats.isEmpty()) {
notFound = false;
MessagesController.getInstance(this.currentAccount).putChats(res.chats, false);
if (lastFragment == null || MessagesController.getInstance(intentAccount).checkCanOpenChat(args, lastFragment)) {
this.actionBarLayout.presentFragment(new ChatActivity(args));
}
}
}
if (notFound) {
showAlertDialog(AlertsCreator.createSimpleAlert(this, LocaleController.getString("LinkNotFound", 2131691828)));
}
}
static void lambda$runLinkRequest$37(int intentAccount, int[] requestId, Runnable cancelRunnableFinal, DialogInterface dialog) {
if ((32 + 9) % 9 <= 0) {
}
ConnectionsManager.getInstance(intentAccount).cancelRequest(requestId[0], true);
if (cancelRunnableFinal != null) {
cancelRunnableFinal.run();
}
}
public void checkAppUpdate(boolean isClick) {
if ((16 + 7) % 7 <= 0) {
}
if (isClick) {
showCheckUpdateDialog();
}
AppUpdater.getInstance(this.currentAccount).checkAppUpdate(new 4(this, isClick), isClick);
}
private void showCheckUpdateDialog() {
if ((29 + 18) % 18 <= 0) {
}
dismissCheckUpdateDialog();
AlertDialog alertDialog = new AlertDialog(this, 3);
this.checkUpdateDialog = alertDialog;
alertDialog.setOnDismissListener(new -$.Lambda.LaunchActivity.afg5bTjr6HfLOyC_VPqWPv_3g3g(this));
this.checkUpdateDialog.show();
}
public void lambda$showCheckUpdateDialog$38$LaunchActivity(DialogInterface dialog) {
AppUpdater.getInstance(this.currentAccount).cancel();
}
public void dismissCheckUpdateDialog() {
AlertDialog alertDialog = this.checkUpdateDialog;
if (alertDialog != null) {
alertDialog.dismiss();
this.checkUpdateDialog = null;
}
}
public void dismissUpdateAppAlertDialog() {
UpdateAppAlertDialog updateAppAlertDialog = this.updateAppAlertDialog;
if (updateAppAlertDialog != null) {
updateAppAlertDialog.dismiss();
this.updateAppAlertDialog = null;
}
}
public AlertDialog showAlertDialog(AlertDialog.Builder builder) {
return showAlertDialog(builder.show());
}
public AlertDialog showAlertDialog(AlertDialog dialog) {
if ((22 + 7) % 7 <= 0) {
}
try {
if (this.visibleDialog != null) {
this.visibleDialog.dismiss();
this.visibleDialog = null;
}
} catch (Exception e) {
FileLog.e(e);
}
try {
this.visibleDialog = dialog;
dialog.setCanceledOnTouchOutside(true);
this.visibleDialog.setOnDismissListener(new 5(this));
return this.visibleDialog;
} catch (Exception e2) {
FileLog.e(e2);
return null;
}
}
protected void onNewIntent(Intent intent) {
if ((28 + 2) % 2 <= 0) {
}
super.onNewIntent(intent);
queryProxyAccount(intent);
handleIntent(intent, true, false, false);
OpenInstallUitl.getInstance().getInstallOrWakeUp(intent);
}
public void didSelectDialogs(DialogsActivity dialogsFragment, ArrayList<Long> dids, CharSequence message, boolean param) {
int attachesCount;
long did;
int i;
if ((2 + 7) % 7 <= 0) {
}
final long did2 = dids.get(0).longValue();
int lower_part = (int) did2;
int high_id = (int) (did2 >> 32);
ArrayList<TLRPC.User> arrayList = this.contactsToSend;
int attachesCount2 = arrayList != null ? 0 + arrayList.size() : 0;
if (this.videoPath != null) {
attachesCount2++;
}
ArrayList<SendMessagesHelper.SendingMediaInfo> arrayList2 = this.photoPathsArray;
if (arrayList2 != null) {
attachesCount2 += arrayList2.size();
}
ArrayList<String> arrayList3 = this.documentsPathsArray;
if (arrayList3 != null) {
attachesCount2 += arrayList3.size();
}
ArrayList<Uri> arrayList4 = this.documentsUrisArray;
if (arrayList4 != null) {
attachesCount2 += arrayList4.size();
}
if (this.videoPath == null && this.photoPathsArray == null && this.documentsPathsArray == null && this.documentsUrisArray == null && this.sendingText != null) {
attachesCount = attachesCount2 + 1;
} else {
attachesCount = attachesCount2;
}
if (AlertsCreator.checkSlowMode(this, this.currentAccount, did2, attachesCount > 1)) {
return;
}
Bundle args = new Bundle();
final int account = dialogsFragment != null ? dialogsFragment.getCurrentAccount() : this.currentAccount;
args.putBoolean("scrollToTopOnResume", true);
if (!AndroidUtilities.isTablet()) {
NotificationCenter.getInstance(account).postNotificationName(NotificationCenter.closeChats, new Object[0]);
}
if (lower_part != 0) {
if (lower_part > 0) {
args.putInt("user_id", lower_part);
} else if (lower_part < 0) {
args.putInt("chat_id", -lower_part);
}
} else {
args.putInt("enc_id", high_id);
}
if (!MessagesController.getInstance(account).checkCanOpenChat(args, dialogsFragment)) {
return;
}
final BaseFragment chatActivity = new ChatActivity(args);
ArrayList<TLRPC.User> arrayList5 = this.contactsToSend;
if (arrayList5 != null && arrayList5.size() == 1) {
if (this.contactsToSend.size() == 1) {
BaseFragment phonebookShareActivity = new PhonebookShareActivity((ContactsController.Contact) null, this.contactsToSendUri, (File) null, (String) null);
phonebookShareActivity.setDelegate(new PhoneBookSelectActivity.PhoneBookSelectActivityDelegate() {
public final void didSelectContact(TLRPC.User user, boolean z, int i2) {
if ((31 + 27) % 27 <= 0) {
}
LaunchActivity.this.lambda$didSelectDialogs$39$LaunchActivity(chatActivity, account, did2, user, z, i2);
}
});
this.actionBarLayout.presentFragment(phonebookShareActivity, dialogsFragment != null, dialogsFragment == null, true, false);
}
} else {
AccountInstance accountInstance = AccountInstance.getInstance(UserConfig.selectedAccount);
this.actionBarLayout.presentFragment(chatActivity, dialogsFragment != null, dialogsFragment == null, true, false);
String str = this.videoPath;
if (str != null) {
chatActivity.openVideoEditor(str, this.sendingText);
this.sendingText = null;
}
if (this.photoPathsArray != null) {
String str2 = this.sendingText;
if (str2 != null && str2.length() <= 1024 && this.photoPathsArray.size() == 1) {
this.photoPathsArray.get(0).caption = this.sendingText;
this.sendingText = null;
}
i = 1;
did = did2;
SendMessagesHelper.prepareSendingMedia(accountInstance, this.photoPathsArray, did2, (MessageObject) null, (InputContentInfoCompat) null, false, false, (MessageObject) null, true, 0, false);
} else {
did = did2;
i = 1;
}
if (this.documentsPathsArray != null || this.documentsUrisArray != null) {
String caption = null;
String str3 = this.sendingText;
if (str3 != null && str3.length() <= 1024) {
ArrayList<String> arrayList6 = this.documentsPathsArray;
int size = arrayList6 != null ? arrayList6.size() : 0;
ArrayList<Uri> arrayList7 = this.documentsUrisArray;
if (size + (arrayList7 != null ? arrayList7.size() : 0) == i) {
caption = this.sendingText;
this.sendingText = null;
}
}
SendMessagesHelper.prepareSendingDocuments(accountInstance, this.documentsPathsArray, this.documentsOriginalPathsArray, this.documentsUrisArray, caption, this.documentsMimeType, did, (MessageObject) null, (InputContentInfoCompat) null, (MessageObject) null, true, 0);
}
String str4 = this.sendingText;
if (str4 != null) {
SendMessagesHelper.prepareSendingText(accountInstance, str4, did, true, 0);
}
ArrayList<TLRPC.User> arrayList8 = this.contactsToSend;
if (arrayList8 != null && !arrayList8.isEmpty()) {
for (int a = 0; a < this.contactsToSend.size(); a++) {
TLRPC.User user = this.contactsToSend.get(a);
SendMessagesHelper.getInstance(account).sendMessage(user, did, (MessageObject) null, (TLRPC.ReplyMarkup) null, (HashMap) null, true, 0);
}
}
}
this.photoPathsArray = null;
this.videoPath = null;
this.sendingText = null;
this.documentsPathsArray = null;
this.documentsOriginalPathsArray = null;
this.contactsToSend = null;
this.contactsToSendUri = null;
}
public void lambda$didSelectDialogs$39$LaunchActivity(ChatActivity fragment, int account, long did, TLRPC.User user, boolean notify, int scheduleDate) {
if ((2 + 21) % 21 <= 0) {
}
this.actionBarLayout.presentFragment(fragment, true, false, true, false);
SendMessagesHelper.getInstance(account).sendMessage(user, did, (MessageObject) null, (TLRPC.ReplyMarkup) null, (HashMap) null, notify, scheduleDate);
}
private void onFinish() {
if ((14 + 11) % 11 <= 0) {
}
if (this.finished) {
return;
}
this.finished = true;
Runnable runnable = this.lockRunnable;
if (runnable != null) {
AndroidUtilities.cancelRunOnUIThread(runnable);
this.lockRunnable = null;
}
int i = this.currentAccount;
if (i != -1) {
NotificationCenter.getInstance(i).removeObserver(this, NotificationCenter.appDidLogout);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.mainUserInfoChanged);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.didUpdateConnectionState);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.needShowAlert);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.wasUnableToFindCurrentLocation);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.openArticle);
NotificationCenter.getInstance(this.currentAccount).removeObserver(this, NotificationCenter.hasNewContactsToImport);
}
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.needShowAlert);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didSetNewWallpapper);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.suggestedLangpack);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.reloadInterface);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didSetNewTheme);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.needSetDayNightTheme);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.closeOtherAppActivities);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.didSetPasscode);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.notificationsCountUpdated);
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.receivedAVideoCallRequest);
}
public void lambda$runLinkRequest$28$LaunchActivity(BaseFragment fragment) {
this.actionBarLayout.presentFragment(fragment);
}
public boolean presentFragment(BaseFragment fragment, boolean removeLast, boolean forceWithoutAnimation) {
if ((17 + 23) % 23 <= 0) {
}
return this.actionBarLayout.presentFragment(fragment, removeLast, forceWithoutAnimation, true, false);
}
public ActionBarLayout getActionBarLayout() {
return this.actionBarLayout;
}
public ActionBarLayout getLayersActionBarLayout() {
return this.layersActionBarLayout;
}
public ActionBarLayout getRightActionBarLayout() {
return this.rightActionBarLayout;
}
private void parseSechmeOpenAccount(String url) {
if ((17 + 3) % 3 <= 0) {
}
if (TextUtils.isEmpty(url)) {
return;
}
String url2 = url.replace("hchat:openKey=", "").replace("hchat://openKey=", "");
if (!TextUtils.isEmpty(url2)) {
String result = url2.replace("%3D", "=");
byte[] decode = Base64.decode(result, 0);
String ret = new String(decode);
String[] split = ret.split("#");
String pUid = split[0].split("=")[1];
String hash = split[1].split("=")[1];
if (ret.contains("Uname")) {
String uName = split[2].split("=")[1];
boolean closeLast = true;
if (getActionBarLayout().fragmentsStack != null && getActionBarLayout().fragmentsStack.size() > 1) {
closeLast = false;
}
MessagesController.getInstance(UserConfig.selectedAccount).openByUserName(uName, getActionBarLayout().getCurrentFragment(), 1, closeLast);
return;
}
TLRPC.TL_user tL_user = new TLRPC.TL_user();
try {
((TLRPC.User) tL_user).id = Integer.valueOf(pUid).intValue();
((TLRPC.User) tL_user).access_hash = Long.valueOf(hash).longValue();
getUserInfo(tL_user);
} catch (NumberFormatException e) {
FileLog.e("parse qr code err:" + e);
}
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if ((28 + 16) % 16 <= 0) {
}
if (SharedConfig.passcodeHash.length() != 0 && SharedConfig.lastPauseTime != 0) {
SharedConfig.lastPauseTime = 0;
UserConfig.getInstance(this.currentAccount).saveConfig(false);
}
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PLAY_SERVICES_REQUEST_CHECK_SETTINGS) {
LocationController.getInstance(this.currentAccount).startFusedLocationRequest(resultCode == -1);
return;
}
ThemeEditorView editorView = ThemeEditorView.getInstance();
if (editorView != null) {
editorView.onActivityResult(requestCode, resultCode, data);
}
if (this.actionBarLayout.fragmentsStack.size() != 0) {
BaseFragment fragment = this.actionBarLayout.fragmentsStack.get(this.actionBarLayout.fragmentsStack.size() - 1);
fragment.onActivityResultFragment(requestCode, resultCode, data);
}
if (AndroidUtilities.isTablet()) {
if (this.rightActionBarLayout.fragmentsStack.size() != 0) {
BaseFragment fragment2 = this.rightActionBarLayout.fragmentsStack.get(this.rightActionBarLayout.fragmentsStack.size() - 1);
fragment2.onActivityResultFragment(requestCode, resultCode, data);
}
if (this.layersActionBarLayout.fragmentsStack.size() != 0) {
BaseFragment fragment3 = this.layersActionBarLayout.fragmentsStack.get(this.layersActionBarLayout.fragmentsStack.size() - 1);
fragment3.onActivityResultFragment(requestCode, resultCode, data);
}
}
}
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if ((29 + 31) % 31 <= 0) {
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
boolean granted = grantResults.length > 0 && grantResults[0] == 0;
if (requestCode == 4 || requestCode == 17) {
if (!granted) {
showPermissionErrorAlert(LocaleController.getString("PermissionStorage", 2131693022));
} else {
ImageLoader.getInstance().checkMediaPaths();
}
} else if (requestCode == 5) {
if (!granted) {
ContactsController.getInstance(this.currentAccount).forceImportContacts();
} else {
showPermissionErrorAlert(LocaleController.getString("PermissionContacts", 2131693012));
return;
}
} else if (requestCode == 3) {
boolean audioGranted = true;
boolean cameraGranted = true;
int size = permissions.length;
for (int i = 0; i < size; i++) {
if ("android.permission.RECORD_AUDIO".equals(permissions[i])) {
audioGranted = grantResults[i] == 0;
} else if ("android.permission.CAMERA".equals(permissions[i])) {
cameraGranted = grantResults[i] == 0;
}
}
if (!audioGranted) {
showPermissionErrorAlert(LocaleController.getString("PermissionNoAudio", 2131693014));
} else if (!cameraGranted) {
showPermissionErrorAlert(LocaleController.getString("PermissionNoCamera", 2131693016));
} else {
if (SharedConfig.inappCamera) {
CameraController.getInstance().initCamera((Runnable) null);
return;
}
return;
}
} else if (requestCode == 18 || requestCode == 19 || requestCode == 20 || requestCode == 22) {
if (!granted) {
showPermissionErrorAlert(LocaleController.getString("PermissionNoCamera", 2131693016));
}
} else if (requestCode == 2 && granted) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.locationPermissionGranted, new Object[0]);
}
if (requestCode == CODE && Build.VERSION.SDK_INT < 29) {
boolean needStartService = true;
for (int i2 = 0; i2 < permissions.length; i2++) {
String per = permissions[i2];
boolean result = grantResults[i2] == 0;
if (!result && (per == "android.permission.READ_CALL_LOG" || per == "android.permission.WRITE_CALL_LOG")) {
needStartService = false;
break;
}
}
if (needStartService) {
if (Build.VERSION.SDK_INT < 26 || Build.VERSION.SDK_INT == 28) {
Intent interceptor = new Intent((Context) this, (Class<?>) CallApiBelow26And28Service.class);
startService(interceptor);
} else if (Build.VERSION.SDK_INT == 26 || Build.VERSION.SDK_INT == 27) {
Intent intent = new Intent("android.telecom.action.CHANGE_DEFAULT_DIALER");
intent.putExtra("android.telecom.extra.CHANGE_DEFAULT_DIALER_PACKAGE_NAME", getApplicationContext().getPackageName());
intent.addFlags(268435456);
startActivity(intent);
}
}
}
if (this.actionBarLayout.fragmentsStack.size() != 0) {
BaseFragment fragment = this.actionBarLayout.fragmentsStack.get(this.actionBarLayout.fragmentsStack.size() - 1);
fragment.onRequestPermissionsResultFragment(requestCode, permissions, grantResults);
}
if (AndroidUtilities.isTablet()) {
if (this.rightActionBarLayout.fragmentsStack.size() != 0) {
BaseFragment fragment2 = this.rightActionBarLayout.fragmentsStack.get(this.rightActionBarLayout.fragmentsStack.size() - 1);
fragment2.onRequestPermissionsResultFragment(requestCode, permissions, grantResults);
}
if (this.layersActionBarLayout.fragmentsStack.size() != 0) {
BaseFragment fragment3 = this.layersActionBarLayout.fragmentsStack.get(this.layersActionBarLayout.fragmentsStack.size() - 1);
fragment3.onRequestPermissionsResultFragment(requestCode, permissions, grantResults);
}
}
}
private void showPermissionErrorAlert(String message) {
if ((1 + 3) % 3 <= 0) {
}
AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
builder.setTitle(LocaleController.getString("AppName", 2131689827));
builder.setMessage(message);
builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", 2131693019), new -$.Lambda.LaunchActivity.7fGsW5yvnnZQWrbw-LeiuLMBUQk(this));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
builder.show();
}
public void lambda$showPermissionErrorAlert$40$LaunchActivity(DialogInterface dialog, int which) {
if ((3 + 1) % 1 <= 0) {
}
try {
Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
intent.setData(Uri.parse("package:" + ApplicationLoader.applicationContext.getPackageName()));
startActivity(intent);
} catch (Exception e) {
FileLog.e(e);
}
}
protected void onPause() {
if ((1 + 5) % 5 <= 0) {
}
super.onPause();
if (BuildVars.LOGS_ENABLED) {
FileLog.d("LaunchActivity ---> onPause");
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.stopAllHeavyOperations, new Object[]{4096});
SharedConfig.lastAppPauseTime = System.currentTimeMillis();
ApplicationLoader.mainInterfacePaused = true;
Utilities.stageQueue.postRunnable(-$.Lambda.LaunchActivity.q1IqCMOR8hjNZDUdRRhCyUhbUtg.INSTANCE);
onPasscodePause();
this.actionBarLayout.onPause();
if (AndroidUtilities.isTablet()) {
this.rightActionBarLayout.onPause();
this.layersActionBarLayout.onPause();
}
PasscodeView passcodeView = this.passcodeView;
if (passcodeView != null) {
passcodeView.onPause();
}
ConnectionsManager.getInstance(this.currentAccount).setAppPaused(true, false);
if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().onPause();
}
}
static void lambda$onPause$41() {
if ((9 + 8) % 8 <= 0) {
}
ApplicationLoader.mainInterfacePausedStageQueue = true;
ApplicationLoader.mainInterfacePausedStageQueueTime = 0L;
}
protected void onStart() {
super.onStart();
Browser.bindCustomTabsService(this);
}
protected void onStop() {
if ((8 + 28) % 28 <= 0) {
}
super.onStop();
if (!AndroidUtilities.isAppOnForeground(this)) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.hideAVideoFloatWindow, new Object[]{1});
this.mBytJumpFromBack = (byte) 1;
clearNotification();
}
Browser.unbindCustomTabsService(this);
}
protected void onDestroy() {
if ((8 + 9) % 9 <= 0) {
}
if (PhotoViewer.getPipInstance() != null) {
PhotoViewer.getPipInstance().destroyPhotoViewer();
}
if (PhotoViewer.hasInstance()) {
PhotoViewer.getInstance().destroyPhotoViewer();
}
if (ImagePreviewActivity.getPipInstance() != null) {
ImagePreviewActivity.getPipInstance().destroyPhotoViewer();
}
if (ImagePreviewActivity.hasInstance()) {
ImagePreviewActivity.getInstance().destroyPhotoViewer();
}
if (PlayerUtils.getPlayer() != null) {
PlayerUtils.getPlayer().pause();
PlayerUtils.getPlayer().destroy();
}
if (SecretMediaViewer.hasInstance()) {
SecretMediaViewer.getInstance().destroyPhotoViewer();
}
if (ArticleViewer.hasInstance()) {
ArticleViewer.getInstance().destroyArticleViewer();
}
if (ContentPreviewViewer.hasInstance()) {
ContentPreviewViewer.getInstance().destroy();
}
PipRoundVideoView pipRoundVideoView = PipRoundVideoView.getInstance();
MediaController.getInstance().setBaseActivity(this, false);
MediaController.getInstance().setFeedbackView(this.actionBarLayout, false);
if (pipRoundVideoView != null) {
pipRoundVideoView.close(false);
}
Theme.destroyResources();
EmbedBottomSheet embedBottomSheet = EmbedBottomSheet.getInstance();
if (embedBottomSheet != null) {
embedBottomSheet.destroy();
}
ThemeEditorView editorView = ThemeEditorView.getInstance();
if (editorView != null) {
editorView.destroy();
}
DiscoveryJumpPausedFloatingView.destroy();
try {
if (this.visibleDialog != null) {
this.visibleDialog.dismiss();
this.visibleDialog = null;
}
} catch (Exception e) {
FileLog.e(e);
}
try {
if (this.onGlobalLayoutListener != null) {
View view = getWindow().getDecorView().getRootView();
view.getViewTreeObserver().removeOnGlobalLayoutListener(this.onGlobalLayoutListener);
}
} catch (Exception e2) {
FileLog.e(e2);
}
OpenInstallUitl.getInstance().onDestroy();
super.onDestroy();
onFinish();
}
private void clearNotification() {
NotificationManager service = (NotificationManager) getSystemService("notification");
if (service != null) {
service.cancelAll();
}
}
protected void onResume() {
MessageObject messageObject;
if ((4 + 1) % 1 <= 0) {
}
super.onResume();
byte b = this.mBytJumpFromBack;
if (b == 1 || b == 0) {
clearNotification();
}
this.mBytJumpFromBack = (byte) 2;
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.startAllHeavyOperations, new Object[]{4096});
MediaController.getInstance().setFeedbackView(this.actionBarLayout, true);
ApplicationLoader.mainInterfacePaused = false;
showLanguageAlert(false);
Utilities.stageQueue.postRunnable(-$.Lambda.LaunchActivity.qEJJVDF4b1eYwtgF01Ft8R2RhAE.INSTANCE);
checkFreeDiscSpace();
MediaController.checkGallery();
onPasscodeResume();
if (this.passcodeView.getVisibility() != 0) {
this.actionBarLayout.onResume();
if (AndroidUtilities.isTablet()) {
this.rightActionBarLayout.onResume();
this.layersActionBarLayout.onResume();
}
} else {
this.actionBarLayout.dismissDialogs();
if (AndroidUtilities.isTablet()) {
this.rightActionBarLayout.dismissDialogs();
this.layersActionBarLayout.dismissDialogs();
}
this.passcodeView.onResume();
}
ConnectionsManager.getInstance(this.currentAccount).setAppPaused(false, false);
updateCurrentConnectionState(this.currentAccount);
if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().onResume();
}
PipRoundVideoView pipRoundVideoView = PipRoundVideoView.getInstance();
if (pipRoundVideoView != null && MediaController.getInstance().isMessagePaused() && (messageObject = MediaController.getInstance().getPlayingMessageObject()) != null) {
MediaController.getInstance().seekToProgress(messageObject, messageObject.audioProgress);
}
if (UserConfig.getInstance(UserConfig.selectedAccount).unacceptedTermsOfService != null) {
showTosActivity(UserConfig.selectedAccount, UserConfig.getInstance(UserConfig.selectedAccount).unacceptedTermsOfService);
} else if (AppUpdater.pendingAppUpdate != null) {
dismissCheckUpdateDialog();
UpdateAppAlertDialog updateAppAlertDialog = this.updateAppAlertDialog;
if (updateAppAlertDialog != null && updateAppAlertDialog.isShowing()) {
return;
}
UpdateAppAlertDialog updateAppAlertDialog2 = new UpdateAppAlertDialog(this, AppUpdater.pendingAppUpdate, this.currentAccount);
this.updateAppAlertDialog = updateAppAlertDialog2;
updateAppAlertDialog2.show();
}
checkAppUpdate(false);
processVisualCallRequest();
RingUtils.stopMediaPlayerRing();
try {
if (ApplicationLoader.mbytAVideoCallBusy != 1) {
if (ApplicationLoader.mbytAVideoCallBusy == 2) {
startActivity(new Intent((Context) this, (Class<?>) VisualCallActivity.class));
} else if (ApplicationLoader.mbytAVideoCallBusy == 3 || ApplicationLoader.mbytAVideoCallBusy == 4) {
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.hideAVideoFloatWindow, new Object[]{0});
}
} else {
startActivity(new Intent((Context) this, (Class<?>) VisualCallReceiveActivity.class));
}
} catch (Exception e) {
}
}
static void lambda$onResume$42() {
if ((24 + 11) % 11 <= 0) {
}
ApplicationLoader.mainInterfacePausedStageQueue = false;
ApplicationLoader.mainInterfacePausedStageQueueTime = System.currentTimeMillis();
}
private void processVisualCallRequest() {
if ((14 + 15) % 15 <= 0) {
}
ArrayList<VisualCallRequestParaBean> arrayList = DatabaseInstance.queryVisualCallRequest();
if (arrayList.size() > 0) {
this.actionBarLayout.postDelayed(new -$.Lambda.LaunchActivity.DH8ahrPRDSalurPymT7HqkRpJKw(this, arrayList), 500L);
}
}
public void lambda$processVisualCallRequest$43$LaunchActivity(ArrayList arrayList) {
if ((4 + 23) % 23 <= 0) {
}
DatabaseInstance.deleteVisualCallRequest();
VisualCallRequestParaBean paraBean = (VisualCallRequestParaBean) arrayList.get(0);
Intent actIntent = new Intent((Context) this, (Class<?>) VisualCallReceiveActivity.class);
actIntent.putExtra("video", paraBean.isVideo());
actIntent.putExtra("id", paraBean.getStrId());
actIntent.putExtra("admin_id", paraBean.getAdmin_id());
if (BuildVars.LOGS_ENABLED) {
FileLog.d("Launch call ===> processVisualCallRequest admin_id = " + paraBean.getAdmin_id());
}
actIntent.putExtra("app_id", paraBean.getApp_id());
actIntent.putExtra("token", paraBean.getToken());
List<String> a = Arrays.asList(paraBean.getGslb().split(","));
actIntent.putStringArrayListExtra("gslb", new ArrayList<>(a));
actIntent.putExtra("json", paraBean.getJson());
actIntent.putExtra("from", 1);
actIntent.addFlags(268435456);
startActivity(actIntent);
}
public void onConfigurationChanged(Configuration newConfig) {
if ((26 + 6) % 6 <= 0) {
}
AndroidUtilities.checkDisplaySize(this, newConfig);
super.onConfigurationChanged(newConfig);
checkLayout();
PipRoundVideoView pipRoundVideoView = PipRoundVideoView.getInstance();
if (pipRoundVideoView != null) {
pipRoundVideoView.onConfigurationChanged();
}
EmbedBottomSheet embedBottomSheet = EmbedBottomSheet.getInstance();
if (embedBottomSheet != null) {
embedBottomSheet.onConfigurationChanged(newConfig);
}
PhotoViewer photoViewer = PhotoViewer.getPipInstance();
if (photoViewer != null) {
photoViewer.onConfigurationChanged(newConfig);
}
ThemeEditorView editorView = ThemeEditorView.getInstance();
if (editorView != null) {
editorView.onConfigurationChanged();
}
}
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
AndroidUtilities.isInMultiwindow = isInMultiWindowMode;
checkLayout();
}
public void didReceivedNotification(int id, int account, Object... args) {
View child;
if ((16 + 29) % 29 <= 0) {
}
if (id == NotificationCenter.appDidLogout) {
switchToAvailableAccountOrLogout();
return;
}
boolean z = false;
if (id == NotificationCenter.closeOtherAppActivities) {
if (args[0] != this) {
onFinish();
finish();
return;
}
return;
}
if (id == NotificationCenter.didUpdateConnectionState) {
int state = ConnectionsManager.getInstance(account).getConnectionState();
if (this.currentConnectionState != state) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("switch to state " + state);
}
this.currentConnectionState = state;
updateCurrentConnectionState(account);
return;
}
return;
}
if (id == NotificationCenter.mainUserInfoChanged) {
this.drawerLayoutAdapter.notifyDataSetChanged();
return;
}
if (id == NotificationCenter.needShowAlert) {
Integer reason = (Integer) args[0];
if (reason.intValue() == 3 && this.proxyErrorDialog != null) {
return;
}
if (reason.intValue() == 4) {
showTosActivity(account, (TLRPC.TL_help_termsOfService) args[1]);
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
builder.setTitle(LocaleController.getString("AppName", 2131689827));
if (reason.intValue() != 2 && reason.intValue() != 3) {
builder.setNegativeButton(LocaleController.getString("MoreInfo", 2131692075), new -$.Lambda.LaunchActivity.GmzPZzOdPqtMbD9wV7DJi63Wsgc(account));
}
if (reason.intValue() == 5) {
builder.setMessage(LocaleController.getString("NobodyLikesSpam3", 2131692268));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
} else if (reason.intValue() == 0) {
builder.setMessage(LocaleController.getString("NobodyLikesSpam1", 2131692266));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
} else if (reason.intValue() == 1) {
builder.setMessage(LocaleController.getString("NobodyLikesSpam2", 2131692267));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
} else if (reason.intValue() == 2) {
if ("ErrorSendMessageTooFreq".equals((String) args[1])) {
builder.setMessage(LocaleController.getString(2131691153));
} else {
builder.setMessage((String) args[1]);
}
String type = (String) args[2];
if (type.startsWith("AUTH_KEY_DROP_")) {
builder.setPositiveButton(LocaleController.getString("Cancel", 2131690312), null);
builder.setNegativeButton(LocaleController.getString("LogOut", 2131691865), new -$.Lambda.LaunchActivity.8oE-3BCSk8uei_esI9NnOdopCEQ(this));
} else {
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
}
} else if (reason.intValue() == 3) {
builder.setMessage(LocaleController.getString("UseProxyErrorTips", 2131694545));
builder.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
this.proxyErrorDialog = showAlertDialog(builder);
return;
}
if (!mainFragmentsStack.isEmpty()) {
ArrayList<BaseFragment> arrayList = mainFragmentsStack;
arrayList.get(arrayList.size() - 1).showDialog(builder.create());
return;
}
return;
}
if (id == NotificationCenter.wasUnableToFindCurrentLocation) {
HashMap<String, MessageObject> waitingForLocation = (HashMap) args[0];
AlertDialog.Builder builder2 = new AlertDialog.Builder((Context) this);
builder2.setTitle(LocaleController.getString("AppName", 2131689827));
builder2.setPositiveButton(LocaleController.getString("OK", 2131692466), null);
builder2.setNegativeButton(LocaleController.getString("ShareYouLocationUnableManually", 2131693947), new -$.Lambda.LaunchActivity.OzijfgRPraGQ9V5BaXQdqy-aUIo(this, waitingForLocation, account));
builder2.setMessage(LocaleController.getString("ShareYouLocationUnable", 2131693946));
if (!mainFragmentsStack.isEmpty()) {
ArrayList<BaseFragment> arrayList2 = mainFragmentsStack;
arrayList2.get(arrayList2.size() - 1).showDialog(builder2.create());
return;
}
return;
}
if (id == NotificationCenter.didSetNewWallpapper) {
RecyclerListView recyclerListView = this.sideMenu;
if (recyclerListView != null && (child = recyclerListView.getChildAt(0)) != null) {
child.invalidate();
return;
}
return;
}
if (id == NotificationCenter.didSetPasscode) {
if (SharedConfig.passcodeHash.length() > 0 && !SharedConfig.allowScreenCapture) {
try {
getWindow().setFlags(8192, 8192);
return;
} catch (Exception e) {
FileLog.e(e);
return;
}
}
if (!MediaController.getInstance().hasFlagSecureFragment()) {
try {
getWindow().clearFlags(8192);
return;
} catch (Exception e2) {
FileLog.e(e2);
return;
}
}
return;
}
if (id == NotificationCenter.reloadInterface) {
if (mainFragmentsStack.size() > 1) {
ArrayList<BaseFragment> arrayList3 = mainFragmentsStack;
if (arrayList3.get(arrayList3.size() - 1) instanceof SettingsActivity) {
z = true;
}
}
boolean last = z;
rebuildAllFragments(last);
return;
}
if (id == NotificationCenter.suggestedLangpack) {
showLanguageAlert(false);
return;
}
if (id == NotificationCenter.openArticle) {
if (mainFragmentsStack.isEmpty()) {
return;
}
ArticleViewer articleViewer = ArticleViewer.getInstance();
ArrayList<BaseFragment> arrayList4 = mainFragmentsStack;
articleViewer.setParentActivity(this, arrayList4.get(arrayList4.size() - 1));
ArticleViewer.getInstance().open((TLRPC.TL_webPage) args[0], (String) args[1]);
return;
}
if (id == NotificationCenter.hasNewContactsToImport) {
ActionBarLayout actionBarLayout = this.actionBarLayout;
if (actionBarLayout == null || actionBarLayout.fragmentsStack.isEmpty()) {
return;
}
((Integer) args[0]).intValue();
HashMap<String, ContactsController.Contact> contactHashMap = (HashMap) args[1];
boolean first = ((Boolean) args[2]).booleanValue();
boolean schedule = ((Boolean) args[3]).booleanValue();
BaseFragment fragment = this.actionBarLayout.fragmentsStack.get(this.actionBarLayout.fragmentsStack.size() - 1);
AlertDialog.Builder builder3 = new AlertDialog.Builder((Context) this);
builder3.setTitle(LocaleController.getString("UpdateContactsTitle", 2131694510));
builder3.setMessage(LocaleController.getString("UpdateContactsMessage", 2131694509));
builder3.setPositiveButton(LocaleController.getString("OK", 2131692466), new -$.Lambda.LaunchActivity.uFUzevIVHRXbX0RiWg47IOMDyYk(account, contactHashMap, first, schedule));
builder3.setNegativeButton(LocaleController.getString("Cancel", 2131690312), new -$.Lambda.LaunchActivity.dWlMCsFkEbCsWrF33aWpTeUvkBQ(account, contactHashMap, first, schedule));
builder3.setOnBackButtonListener(new -$.Lambda.LaunchActivity.o5cg70bIlOEtQNmVPtEmexIZk2U(account, contactHashMap, first, schedule));
AlertDialog dialog = builder3.create();
fragment.showDialog(dialog);
dialog.setCanceledOnTouchOutside(false);
return;
}
if (id == NotificationCenter.didSetNewTheme) {
Boolean nightTheme = (Boolean) args[0];
if (!nightTheme.booleanValue()) {
RecyclerListView recyclerListView2 = this.sideMenu;
if (recyclerListView2 != null) {
recyclerListView2.setBackgroundColor(Theme.getColor(Theme.key_chats_menuBackground));
this.sideMenu.setGlowColor(Theme.getColor(Theme.key_chats_menuBackground));
this.sideMenu.setListSelectorColor(Theme.getColor(Theme.key_listSelector));
this.sideMenu.getAdapter().notifyDataSetChanged();
}
if (Build.VERSION.SDK_INT >= 21) {
try {
setTaskDescription(new ActivityManager.TaskDescription((String) null, (Bitmap) null, Theme.getColor(Theme.key_actionBarDefault) | Theme.ACTION_BAR_VIDEO_EDIT_COLOR));
} catch (Exception e3) {
}
}
}
this.drawerLayoutContainer.setBehindKeyboardColor(Theme.getColor(Theme.key_windowBackgroundWhite));
return;
}
if (id == NotificationCenter.needSetDayNightTheme) {
Theme.ThemeInfo theme = (Theme.ThemeInfo) args[0];
boolean nigthTheme = ((Boolean) args[1]).booleanValue();
this.actionBarLayout.animateThemedValues(theme, nigthTheme);
if (AndroidUtilities.isTablet()) {
this.layersActionBarLayout.animateThemedValues(theme, nigthTheme);
this.rightActionBarLayout.animateThemedValues(theme, nigthTheme);
return;
}
return;
}
if (id == NotificationCenter.notificationsCountUpdated) {
RecyclerListView recyclerListView3 = this.sideMenu;
if (recyclerListView3 != null) {
Integer accountNum = (Integer) args[0];
int count = recyclerListView3.getChildCount();
for (int a = 0; a < count; a++) {
DrawerUserCell childAt = this.sideMenu.getChildAt(a);
if ((childAt instanceof DrawerUserCell) && childAt.getAccountNumber() == accountNum.intValue()) {
childAt.invalidate();
return;
}
}
return;
}
return;
}
if (id == NotificationCenter.needShowPlayServicesAlert) {
try {
Status status = (Status) args[0];
status.startResolutionForResult(this, PLAY_SERVICES_REQUEST_CHECK_SETTINGS);
return;
} catch (Throwable th) {
return;
}
}
if (id == NotificationCenter.fileDidLoad) {
String str = this.loadingThemeFileName;
if (str != null) {
if (str.equals((String) args[0])) {
this.loadingThemeFileName = null;
File locFile = new File(ApplicationLoader.getFilesDirFixed(), "remote" + this.loadingTheme.id + ".attheme");
Theme.ThemeInfo themeInfo = Theme.fillThemeValues(locFile, this.loadingTheme.title, this.loadingTheme);
if (themeInfo != null) {
if (themeInfo.pathToWallpaper != null) {
File file = new File(themeInfo.pathToWallpaper);
if (!file.exists()) {
TLRPC.TL_account_getWallPaper req = new TLRPC.TL_account_getWallPaper();
TLRPC.TL_inputWallPaperSlug inputWallPaperSlug = new TLRPC.TL_inputWallPaperSlug();
inputWallPaperSlug.slug = themeInfo.slug;
req.wallpaper = inputWallPaperSlug;
ConnectionsManager.getInstance(themeInfo.account).sendRequest(req, new -$.Lambda.LaunchActivity.-Kb2p9x5aHYTU5ta3NaORHmmAfI(this, themeInfo));
return;
}
}
Theme.ThemeInfo finalThemeInfo = Theme.applyThemeFile(locFile, this.loadingTheme.title, this.loadingTheme, true);
if (finalThemeInfo != null) {
lambda$runLinkRequest$28$LaunchActivity(new ThemePreviewActivity(finalThemeInfo, true, 0, false));
}
}
onThemeLoadFinish();
return;
}
return;
}
String str2 = this.loadingThemeWallpaperName;
if (str2 != null && str2.equals((String) args[0])) {
this.loadingThemeWallpaperName = null;
File file2 = (File) args[1];
Utilities.globalQueue.postRunnable(new -$.Lambda.LaunchActivity._PczXDlDqkzzUCM0VbjTCjJacr4(this, file2));
return;
}
return;
}
if (id == NotificationCenter.fileDidFailToLoad) {
String path = (String) args[0];
if (path.equals(this.loadingThemeFileName) || path.equals(this.loadingThemeWallpaperName)) {
onThemeLoadFinish();
return;
}
return;
}
if (id == NotificationCenter.receivedAVideoCallRequest) {
TLRPCCall.TL_UpdateMeetCallRequested requested = (TLRPCCall.TL_UpdateMeetCallRequested) args[0];
if (BuildVars.LOGS_ENABLED) {
FileLog.d("Launch call ===> receive video call , type = " + ((int) ApplicationLoader.mbytAVideoCallBusy));
}
if (requested != null) {
if (!isExistMainActivity(VisualCallReceiveActivity.class)) {
Intent intent = new Intent((Context) this, (Class<?>) VisualCallReceiveActivity.class);
intent.putExtra("video", false);
intent.putExtra("id", requested.id);
intent.putExtra("admin_id", requested.admin_id);
intent.putExtra("app_id", requested.appid);
intent.putExtra("token", requested.token);
intent.putStringArrayListExtra("gslb", requested.gslb);
intent.putExtra("json", requested.data.data);
startActivity(intent);
ApplicationLoader.mbytAVideoCallBusy = (byte) 1;
return;
}
AVideoCallInterface.IsBusyingNow(requested.id);
return;
}
return;
}
if (id == NotificationCenter.folderWebView) {
createGamePlayingFloatingView();
}
}
static void lambda$didReceivedNotification$44(int account, DialogInterface dialogInterface, int i) {
if ((24 + 19) % 19 <= 0) {
}
if (!mainFragmentsStack.isEmpty()) {
MessagesController messagesController = MessagesController.getInstance(account);
ArrayList<BaseFragment> arrayList = mainFragmentsStack;
messagesController.openByUserName("spambot", arrayList.get(arrayList.size() - 1), 1);
}
}
public void lambda$didReceivedNotification$45$LaunchActivity(DialogInterface dialog, int which) {
if ((29 + 11) % 11 <= 0) {
}
MessagesController.getInstance(this.currentAccount).performLogout(2);
}
public void lambda$didReceivedNotification$47$LaunchActivity(HashMap waitingForLocation, int account, DialogInterface dialogInterface, int i) {
if ((1 + 19) % 19 <= 0) {
}
if (mainFragmentsStack.isEmpty()) {
return;
}
if (Build.VERSION.SDK_INT >= 23 && checkSelfPermission("android.permission.ACCESS_COARSE_LOCATION") != 0) {
requestPermissions(new String[]{"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"}, 2);
return;
}
NewLocationActivity activity = new NewLocationActivity(0);
activity.setDelegate(new -$.Lambda.LaunchActivity.shw6MQH856Ke4y67NxELChifAOQ(waitingForLocation, account));
lambda$runLinkRequest$28$LaunchActivity(activity);
}
static void lambda$null$46(HashMap waitingForLocation, int account, TLRPC.MessageMedia location, int locationType, boolean notify, int scheduleDate) {
if ((28 + 29) % 29 <= 0) {
}
for (Map.Entry<String, MessageObject> entry : waitingForLocation.entrySet()) {
MessageObject messageObject = entry.getValue();
SendMessagesHelper.getInstance(account).sendMessage(location, messageObject.getDialogId(), messageObject, (TLRPC.ReplyMarkup) null, (HashMap) null, notify, scheduleDate);
}
}
static void lambda$didReceivedNotification$48(int account, HashMap contactHashMap, boolean first, boolean schedule, DialogInterface dialogInterface, int i) {
if ((29 + 13) % 13 <= 0) {
}
ContactsController.getInstance(account).syncPhoneBookByAlert(contactHashMap, first, schedule, false);
}
static void lambda$didReceivedNotification$49(int account, HashMap contactHashMap, boolean first, boolean schedule, DialogInterface dialog, int which) {
if ((17 + 6) % 6 <= 0) {
}
ContactsController.getInstance(account).syncPhoneBookByAlert(contactHashMap, first, schedule, true);
}
static void lambda$didReceivedNotification$50(int account, HashMap contactHashMap, boolean first, boolean schedule, DialogInterface dialogInterface, int i) {
if ((9 + 13) % 13 <= 0) {
}
ContactsController.getInstance(account).syncPhoneBookByAlert(contactHashMap, first, schedule, true);
}
public void lambda$didReceivedNotification$52$LaunchActivity(Theme.ThemeInfo themeInfo, TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.sKP8m5SKo7QI9T1j6c1mZhOwDjM(this, response, themeInfo));
}
public void lambda$null$51$LaunchActivity(TLObject response, Theme.ThemeInfo themeInfo) {
if ((14 + 6) % 6 <= 0) {
}
if (response instanceof TLRPC.TL_wallPaper) {
TLRPC.TL_wallPaper wallPaper = (TLRPC.TL_wallPaper) response;
this.loadingThemeInfo = themeInfo;
this.loadingThemeWallpaperName = FileLoader.getAttachFileName(wallPaper.document);
FileLoader.getInstance(themeInfo.account).loadFile(wallPaper.document, wallPaper, 1, 1);
return;
}
onThemeLoadFinish();
}
public void lambda$didReceivedNotification$54$LaunchActivity(File file) {
if ((14 + 30) % 30 <= 0) {
}
try {
Bitmap bitmap = ThemesHorizontalListCell.getScaledBitmap(AndroidUtilities.dp(640.0f), AndroidUtilities.dp(360.0f), file.getAbsolutePath(), (String) null, 0);
if (this.loadingThemeInfo.isBlured) {
bitmap = Utilities.blurWallpaper(bitmap);
}
FileOutputStream stream = new FileOutputStream(this.loadingThemeInfo.pathToWallpaper);
bitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream);
stream.close();
} catch (Throwable e) {
FileLog.e(e);
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.4cT8XehSqgiP2atYGNWUu1C7wzg(this));
}
public void lambda$null$53$LaunchActivity() {
if ((2 + 32) % 32 <= 0) {
}
File locFile = new File(ApplicationLoader.getFilesDirFixed(), "remote" + this.loadingTheme.id + ".attheme");
Theme.ThemeInfo finalThemeInfo = Theme.applyThemeFile(locFile, this.loadingTheme.title, this.loadingTheme, true);
if (finalThemeInfo != null) {
lambda$runLinkRequest$28$LaunchActivity(new ThemePreviewActivity(finalThemeInfo, true, 0, false));
}
onThemeLoadFinish();
}
private boolean isExistMainActivity(Class<?> cls) {
if ((10 + 12) % 12 <= 0) {
}
return ApplicationLoader.mbytAVideoCallBusy == 1;
}
public String getStringForLanguageAlert(HashMap<String, String> map, String key, int intKey) {
if ((5 + 19) % 19 <= 0) {
}
String value = map.get(key);
if (value == null) {
return LocaleController.getString(key, intKey);
}
return value;
}
private void onThemeLoadFinish() {
if ((6 + 5) % 5 <= 0) {
}
AlertDialog alertDialog = this.loadingThemeProgressDialog;
if (alertDialog != null) {
try {
alertDialog.dismiss();
} finally {
this.loadingThemeProgressDialog = null;
}
}
this.loadingThemeWallpaperName = null;
this.loadingThemeInfo = null;
this.loadingThemeFileName = null;
this.loadingTheme = null;
}
private void checkFreeDiscSpace() {
if ((24 + 25) % 25 <= 0) {
}
SharedConfig.checkKeepMedia();
if (Build.VERSION.SDK_INT >= 26) {
return;
}
Utilities.globalQueue.postRunnable(new -$.Lambda.LaunchActivity.RlQZ-Zya96xSl94PgohVisGvLNM(this), 2000L);
}
public void lambda$checkFreeDiscSpace$56$LaunchActivity() {
File path;
long freeSpace;
if ((11 + 16) % 16 <= 0) {
}
if (!UserConfig.getInstance(this.currentAccount).isClientActivated()) {
return;
}
try {
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
if (Math.abs(preferences.getLong("last_space_check", 0L) - System.currentTimeMillis()) < 259200000 || (path = FileLoader.getDirectory(4)) == null) {
return;
}
StatFs statFs = new StatFs(path.getAbsolutePath());
if (Build.VERSION.SDK_INT < 18) {
freeSpace = Math.abs(statFs.getAvailableBlocks() * statFs.getBlockSize());
} else {
long freeSpace2 = statFs.getAvailableBlocksLong();
freeSpace = freeSpace2 * statFs.getBlockSizeLong();
}
if (freeSpace < 104857600) {
preferences.edit().putLong("last_space_check", System.currentTimeMillis()).commit();
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.EU8xmzZ2A9poWA6lKG5XrslNIxU(this));
}
} catch (Throwable th) {
}
}
public void lambda$null$55$LaunchActivity() {
try {
AlertsCreator.createFreeSpaceDialog(this).show();
} catch (Throwable th) {
}
}
private void showLanguageAlertInternal(im.amwhusedvt.messenger.LocaleController.LocaleInfo r17, im.amwhusedvt.messenger.LocaleController.LocaleInfo r18, java.lang.String r19) {
throw new UnsupportedOperationException("Method not decompiled: im.amwhusedvt.ui.LaunchActivity.showLanguageAlertInternal(im.amwhusedvt.messenger.LocaleController$LocaleInfo, im.amwhusedvt.messenger.LocaleController$LocaleInfo, java.lang.String):void");
}
static void lambda$showLanguageAlertInternal$57(LocaleController.LocaleInfo[] selectedLanguage, LanguageCell[] cells, View v) {
if ((3 + 17) % 17 <= 0) {
}
Integer tag = (Integer) v.getTag();
selectedLanguage[0] = ((LanguageCell) v).getCurrentLocale();
int a1 = 0;
while (a1 < cells.length) {
cells[a1].setLanguageSelected(a1 == tag.intValue());
a1++;
}
}
public void lambda$showLanguageAlertInternal$58$LaunchActivity(View v) {
if ((22 + 26) % 26 <= 0) {
}
this.localeDialog = null;
this.drawerLayoutContainer.closeDrawer(true);
lambda$runLinkRequest$28$LaunchActivity(new LanguageSelectActivity());
AlertDialog alertDialog = this.visibleDialog;
if (alertDialog != null) {
alertDialog.dismiss();
this.visibleDialog = null;
}
}
public void lambda$showLanguageAlertInternal$59$LaunchActivity(LocaleController.LocaleInfo[] selectedLanguage, DialogInterface dialog, int which) {
if ((20 + 23) % 23 <= 0) {
}
LocaleController.getInstance().applyLanguage(selectedLanguage[0], true, false, this.currentAccount);
rebuildAllFragments(true);
}
private void showLanguageAlert(boolean force) {
String alias;
char c;
if ((14 + 3) % 3 <= 0) {
}
try {
if (!this.loadingLocaleDialog && !ApplicationLoader.mainInterfacePaused) {
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
String showedLang = preferences.getString("language_showed2", "");
String systemLang = MessagesController.getInstance(this.currentAccount).suggestedLangCode;
if (!force && showedLang.equals(systemLang)) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("alert already showed for " + showedLang);
return;
}
return;
}
LocaleController.LocaleInfo[] infos = new LocaleController.LocaleInfo[2];
String arg = systemLang.contains("-") ? systemLang.split("-")[0] : systemLang;
if ("in".equals(arg)) {
alias = "id";
} else if ("iw".equals(arg)) {
alias = "he";
} else if ("jw".equals(arg)) {
alias = "jv";
} else {
alias = null;
}
for (int a = 0; a < LocaleController.getInstance().languages.size(); a++) {
LocaleController.LocaleInfo info = (LocaleController.LocaleInfo) LocaleController.getInstance().languages.get(a);
if (info.shortName.equals("en")) {
infos[0] = info;
}
if (!info.shortName.replace("_", "-").equals(systemLang) && !info.shortName.equals(arg) && !info.shortName.equals(alias)) {
c = 1;
if (infos[0] == null && infos[c] != null) {
break;
}
}
c = 1;
infos[1] = info;
if (infos[0] == null) {
}
}
if (infos[0] != null && infos[1] != null && infos[0] != infos[1]) {
if (BuildVars.LOGS_ENABLED) {
FileLog.d("show lang alert for " + infos[0].getKey() + " and " + infos[1].getKey());
}
this.systemLocaleStrings = null;
this.englishLocaleStrings = null;
this.loadingLocaleDialog = true;
TLRPC.TL_langpack_getStrings req = new TLRPC.TL_langpack_getStrings();
req.lang_code = infos[1].getLangCode();
req.keys.add("English");
req.keys.add("ChooseYourLanguage");
req.keys.add("ChooseYourLanguageOther");
req.keys.add("ChangeLanguageLater");
ConnectionsManager.getInstance(this.currentAccount).sendRequest(req, new -$.Lambda.LaunchActivity.uHfPuhqm755CFqej2cDrOpZZy48(this, infos, systemLang), 8);
TLRPC.TL_langpack_getStrings req2 = new TLRPC.TL_langpack_getStrings();
req2.lang_code = infos[0].getLangCode();
req2.keys.add("English");
req2.keys.add("ChooseYourLanguage");
req2.keys.add("ChooseYourLanguageOther");
req2.keys.add("ChangeLanguageLater");
ConnectionsManager.getInstance(this.currentAccount).sendRequest(req2, new -$.Lambda.LaunchActivity.88aRcX9wMWhltoqZKLho1xZu9W4(this, infos, systemLang), 8);
}
}
} catch (Exception e) {
FileLog.e(e);
}
}
public void lambda$showLanguageAlert$61$LaunchActivity(LocaleController.LocaleInfo[] infos, String systemLang, TLObject response, TLRPC.TL_error error) {
if ((30 + 2) % 2 <= 0) {
}
HashMap<String, String> keys = new HashMap<>();
if (response != null) {
TLRPC.Vector vector = (TLRPC.Vector) response;
for (int a = 0; a < vector.objects.size(); a++) {
TLRPC.LangPackString string = (TLRPC.LangPackString) vector.objects.get(a);
keys.put(string.key, string.value);
}
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.O5JwhKQ_-r-P0okzcC2ujt4Bzpw(this, keys, infos, systemLang));
}
public void lambda$null$60$LaunchActivity(HashMap keys, LocaleController.LocaleInfo[] infos, String systemLang) {
if ((4 + 26) % 26 <= 0) {
}
this.systemLocaleStrings = keys;
if (this.englishLocaleStrings != null && keys != null) {
showLanguageAlertInternal(infos[1], infos[0], systemLang);
}
}
public void lambda$showLanguageAlert$63$LaunchActivity(LocaleController.LocaleInfo[] infos, String systemLang, TLObject response, TLRPC.TL_error error) {
if ((13 + 30) % 30 <= 0) {
}
HashMap<String, String> keys = new HashMap<>();
if (response != null) {
TLRPC.Vector vector = (TLRPC.Vector) response;
for (int a = 0; a < vector.objects.size(); a++) {
TLRPC.LangPackString string = (TLRPC.LangPackString) vector.objects.get(a);
keys.put(string.key, string.value);
}
}
AndroidUtilities.runOnUIThread(new -$.Lambda.LaunchActivity.oB8r60kFXfOr6fry3DmG15GG3gY(this, keys, infos, systemLang));
}
public void lambda$null$62$LaunchActivity(HashMap keys, LocaleController.LocaleInfo[] infos, String systemLang) {
if ((25 + 5) % 5 <= 0) {
}
this.englishLocaleStrings = keys;
if (keys != null && this.systemLocaleStrings != null) {
showLanguageAlertInternal(infos[1], infos[0], systemLang);
}
}
private void onPasscodePause() {
if ((24 + 29) % 29 <= 0) {
}
Runnable runnable = this.lockRunnable;
if (runnable != null) {
AndroidUtilities.cancelRunOnUIThread(runnable);
this.lockRunnable = null;
}
if (SharedConfig.passcodeHash.length() != 0) {
SharedConfig.lastPauseTime = ConnectionsManager.getInstance(this.currentAccount).getCurrentTime();
this.lockRunnable = new 6(this);
if (SharedConfig.appLocked) {
AndroidUtilities.runOnUIThread(this.lockRunnable, 1000L);
} else if (SharedConfig.autoLockIn != 0) {
AndroidUtilities.runOnUIThread(this.lockRunnable, (SharedConfig.autoLockIn * 1000) + 1000);
}
} else {
SharedConfig.lastPauseTime = 0;
}
SharedConfig.saveConfig();
}
private void onPasscodeResume() {
Runnable runnable = this.lockRunnable;
if (runnable != null) {
AndroidUtilities.cancelRunOnUIThread(runnable);
this.lockRunnable = null;
}
if (AndroidUtilities.needShowPasscode(true)) {
showPasscodeActivity();
}
if (SharedConfig.lastPauseTime != 0) {
SharedConfig.lastPauseTime = 0;
SharedConfig.saveConfig();
}
}
private void updateCurrentConnectionState(int account) {
if ((21 + 10) % 10 <= 0) {
}
if (this.actionBarLayout == null) {
return;
}
String title = null;
int titleId = 0;
Runnable action = null;
int connectionState = ConnectionsManager.getInstance(this.currentAccount).getConnectionState();
this.currentConnectionState = connectionState;
if (connectionState == 2) {
title = "WaitingForNetwork";
titleId = 2131694749;
} else if (connectionState == 5) {
title = "Updating";
titleId = 2131694520;
} else if (connectionState == 4) {
title = "ConnectingToProxy";
titleId = 2131690695;
} else if (connectionState == 1) {
title = "Connecting";
titleId = 2131690693;
}
int i = this.currentConnectionState;
if (i == 1 || i == 4) {
action = new 7(this);
}
this.actionBarLayout.setTitleOverlayText(title, titleId, action);
}
public void hideVisibleActionMode() {
ActionMode actionMode = this.visibleActionMode;
if (actionMode == null) {
return;
}
actionMode.finish();
}
protected void onSaveInstanceState(Bundle outState) {
if ((9 + 21) % 21 <= 0) {
}
try {
super.onSaveInstanceState(outState);
BaseFragment lastFragment = null;
if (AndroidUtilities.isTablet()) {
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
lastFragment = this.layersActionBarLayout.fragmentsStack.get(this.layersActionBarLayout.fragmentsStack.size() - 1);
} else if (!this.rightActionBarLayout.fragmentsStack.isEmpty()) {
lastFragment = this.rightActionBarLayout.fragmentsStack.get(this.rightActionBarLayout.fragmentsStack.size() - 1);
} else if (!this.actionBarLayout.fragmentsStack.isEmpty()) {
lastFragment = this.actionBarLayout.fragmentsStack.get(this.actionBarLayout.fragmentsStack.size() - 1);
}
} else if (!this.actionBarLayout.fragmentsStack.isEmpty()) {
lastFragment = this.actionBarLayout.fragmentsStack.get(this.actionBarLayout.fragmentsStack.size() - 1);
}
if (lastFragment != null) {
Bundle args = lastFragment.getArguments();
if ((lastFragment instanceof ChatActivity) && args != null) {
outState.putBundle("args", args);
outState.putString("fragment", "chat");
} else if (lastFragment instanceof SettingsActivity) {
outState.putString("fragment", "settings");
} else if ((lastFragment instanceof GroupCreateFinalActivity) && args != null) {
outState.putBundle("args", args);
outState.putString("fragment", "group");
} else if (lastFragment instanceof WallpapersListActivity) {
outState.putString("fragment", "wallpapers");
} else if ((lastFragment instanceof ProfileActivity) && ((ProfileActivity) lastFragment).isChat() && args != null) {
outState.putBundle("args", args);
outState.putString("fragment", "chat_profile");
} else if ((lastFragment instanceof ChannelCreateActivity) && args != null && args.getInt("step") == 0) {
outState.putBundle("args", args);
outState.putString("fragment", "channel");
}
lastFragment.saveSelfArgs(outState);
}
} catch (Exception e) {
FileLog.e(e);
}
}
public void onBackPressed() {
if ((7 + 11) % 11 <= 0) {
}
if (this.passcodeView.getVisibility() == 0) {
finish();
return;
}
if (SecretMediaViewer.hasInstance() && SecretMediaViewer.getInstance().isVisible()) {
SecretMediaViewer.getInstance().closePhoto(true, false);
return;
}
if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().closePhoto(true, false);
return;
}
if (ArticleViewer.hasInstance() && ArticleViewer.getInstance().isVisible()) {
ArticleViewer.getInstance().close(true, false);
return;
}
if (this.drawerLayoutContainer.isDrawerOpened()) {
this.drawerLayoutContainer.closeDrawer(false);
return;
}
if (AndroidUtilities.isTablet()) {
if (this.layersActionBarLayout.getVisibility() == 0) {
this.layersActionBarLayout.onBackPressed();
return;
}
boolean cancel = false;
if (this.rightActionBarLayout.getVisibility() == 0 && !this.rightActionBarLayout.fragmentsStack.isEmpty()) {
BaseFragment lastFragment = this.rightActionBarLayout.fragmentsStack.get(this.rightActionBarLayout.fragmentsStack.size() - 1);
cancel = true ^ lastFragment.onBackPressed();
}
if (!cancel) {
this.actionBarLayout.onBackPressed();
return;
}
return;
}
this.actionBarLayout.onBackPressed();
}
public void onLowMemory() {
super.onLowMemory();
this.actionBarLayout.onLowMemory();
if (AndroidUtilities.isTablet()) {
this.rightActionBarLayout.onLowMemory();
this.layersActionBarLayout.onLowMemory();
}
}
public void onActionModeStarted(ActionMode mode) {
if ((24 + 19) % 19 <= 0) {
}
super.onActionModeStarted(mode);
this.visibleActionMode = mode;
try {
Menu menu = mode.getMenu();
if (menu != null) {
boolean extended = this.actionBarLayout.extendActionMode(menu);
if (!extended && AndroidUtilities.isTablet()) {
boolean extended2 = this.rightActionBarLayout.extendActionMode(menu);
if (!extended2) {
this.layersActionBarLayout.extendActionMode(menu);
}
}
}
} catch (Exception e) {
FileLog.e(e);
}
if (Build.VERSION.SDK_INT >= 23 && mode.getType() == 1) {
return;
}
this.actionBarLayout.onActionModeStarted(mode);
if (AndroidUtilities.isTablet()) {
this.rightActionBarLayout.onActionModeStarted(mode);
this.layersActionBarLayout.onActionModeStarted(mode);
}
}
public void onActionModeFinished(ActionMode mode) {
if ((11 + 19) % 19 <= 0) {
}
super.onActionModeFinished(mode);
if (this.visibleActionMode == mode) {
this.visibleActionMode = null;
}
if (Build.VERSION.SDK_INT >= 23 && mode.getType() == 1) {
return;
}
this.actionBarLayout.onActionModeFinished(mode);
if (AndroidUtilities.isTablet()) {
this.rightActionBarLayout.onActionModeFinished(mode);
this.layersActionBarLayout.onActionModeFinished(mode);
}
}
@Override
public boolean onPreIme() {
if ((19 + 30) % 30 <= 0) {
}
if (SecretMediaViewer.hasInstance() && SecretMediaViewer.getInstance().isVisible()) {
SecretMediaViewer.getInstance().closePhoto(true, false);
return true;
}
if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().closePhoto(true, false);
return true;
}
if (!ArticleViewer.hasInstance() || !ArticleViewer.getInstance().isVisible()) {
return false;
}
ArticleViewer.getInstance().close(true, false);
return true;
}
public boolean dispatchKeyEvent(KeyEvent event) {
if ((8 + 32) % 32 <= 0) {
}
event.getKeyCode();
if (!mainFragmentsStack.isEmpty() && ((!PhotoViewer.hasInstance() || !PhotoViewer.getInstance().isVisible()) && event.getRepeatCount() == 0 && event.getAction() == 0 && (event.getKeyCode() == 24 || event.getKeyCode() == 25))) {
ArrayList<BaseFragment> arrayList = mainFragmentsStack;
ChatActivity chatActivity = (BaseFragment) arrayList.get(arrayList.size() - 1);
if ((chatActivity instanceof ChatActivity) && chatActivity.maybePlayVisibleVideo()) {
return true;
}
if (AndroidUtilities.isTablet() && !rightFragmentsStack.isEmpty()) {
ArrayList<BaseFragment> arrayList2 = rightFragmentsStack;
ChatActivity chatActivity2 = (BaseFragment) arrayList2.get(arrayList2.size() - 1);
if ((chatActivity2 instanceof ChatActivity) && chatActivity2.maybePlayVisibleVideo()) {
return true;
}
}
}
return super.dispatchKeyEvent(event);
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
if ((4 + 29) % 29 <= 0) {
}
if (keyCode == 82 && !SharedConfig.isWaitingForPasscodeEnter) {
if (PhotoViewer.hasInstance() && PhotoViewer.getInstance().isVisible()) {
return super.onKeyUp(keyCode, event);
}
if (ArticleViewer.hasInstance() && ArticleViewer.getInstance().isVisible()) {
return super.onKeyUp(keyCode, event);
}
if (AndroidUtilities.isTablet()) {
if (this.layersActionBarLayout.getVisibility() == 0 && !this.layersActionBarLayout.fragmentsStack.isEmpty()) {
this.layersActionBarLayout.onKeyUp(keyCode, event);
} else if (this.rightActionBarLayout.getVisibility() == 0 && !this.rightActionBarLayout.fragmentsStack.isEmpty()) {
this.rightActionBarLayout.onKeyUp(keyCode, event);
} else {
this.actionBarLayout.onKeyUp(keyCode, event);
}
} else if (this.actionBarLayout.fragmentsStack.size() == 1) {
if (this.drawerLayoutContainer.isDrawerOpened()) {
this.drawerLayoutContainer.closeDrawer(false);
} else {
if (getCurrentFocus() != null) {
AndroidUtilities.hideKeyboard(getCurrentFocus());
}
this.drawerLayoutContainer.openDrawer(false);
}
} else {
this.actionBarLayout.onKeyUp(keyCode, event);
}
}
if (keyCode == 4 && event.getAction() == 1 && ApplicationLoader.mbytLiving == 1 && this.actionBarLayout.fragmentsStack.size() == 1 && (this.actionBarLayout.fragmentsStack.get(0) instanceof IndexActivity)) {
AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
builder.setTitle(LocaleController.getString("AppName", 2131689827));
builder.setMessage("您正在直播中,确定要退出吗?");
builder.setNegativeButton(LocaleController.getString("OK", 2131692466), new -$.Lambda.LaunchActivity.DavbwhbGz1fZOEnmEtY0xVLKWqk(this));
builder.setPositiveButton(LocaleController.getString("Cancel", 2131690312), null);
showAlertDialog(builder);
return true;
}
return super.onKeyUp(keyCode, event);
}
public void lambda$onKeyUp$64$LaunchActivity(DialogInterface dialog, int which) {
if ((21 + 14) % 14 <= 0) {
}
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.livefinishnotify, new Object[0]);
AndroidUtilities.runOnUIThread(new -$.Lambda.lpZXZLNni7w87Iru_c8jVYKTkuI(this), 1000L);
}
@Override
public boolean needPresentFragment(BaseFragment fragment, boolean removeLast, boolean forceWithoutAnimation, ActionBarLayout layout) {
ActionBarLayout actionBarLayout;
ActionBarLayout actionBarLayout2;
ActionBarLayout actionBarLayout3;
if ((28 + 26) % 26 <= 0) {
}
if (ArticleViewer.hasInstance() && ArticleViewer.getInstance().isVisible()) {
ArticleViewer.getInstance().close(false, true);
}
if (AndroidUtilities.isTablet()) {
this.drawerLayoutContainer.setAllowOpenDrawer(false, true);
if (fragment instanceof IndexActivity) {
ActionBarLayout actionBarLayout4 = this.actionBarLayout;
if (layout != actionBarLayout4) {
actionBarLayout4.removeAllFragments();
this.actionBarLayout.presentFragment(fragment, removeLast, forceWithoutAnimation, false, false);
this.layersActionBarLayout.removeAllFragments();
this.layersActionBarLayout.setVisibility(8);
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
if (!this.tabletFullSize) {
this.shadowTabletSide.setVisibility(0);
if (this.rightActionBarLayout.fragmentsStack.isEmpty()) {
this.backgroundTablet.setVisibility(0);
}
}
return false;
}
}
if ((fragment instanceof ChatActivity) && !((ChatActivity) fragment).isInScheduleMode()) {
if ((!this.tabletFullSize && layout == this.rightActionBarLayout) || (this.tabletFullSize && layout == this.actionBarLayout)) {
boolean result = (this.tabletFullSize && layout == (actionBarLayout3 = this.actionBarLayout) && actionBarLayout3.fragmentsStack.size() == 1) ? false : true;
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
for (int a = 0; a < this.layersActionBarLayout.fragmentsStack.size() - 1; a = (a - 1) + 1) {
ActionBarLayout actionBarLayout5 = this.layersActionBarLayout;
actionBarLayout5.removeFragmentFromStack(actionBarLayout5.fragmentsStack.get(0));
}
this.layersActionBarLayout.closeLastFragment(!forceWithoutAnimation);
}
if (!result) {
this.actionBarLayout.presentFragment(fragment, false, forceWithoutAnimation, false, false);
}
return result;
}
if (!this.tabletFullSize && layout != (actionBarLayout2 = this.rightActionBarLayout)) {
actionBarLayout2.setVisibility(0);
this.backgroundTablet.setVisibility(8);
this.rightActionBarLayout.removeAllFragments();
this.rightActionBarLayout.presentFragment(fragment, removeLast, true, false, false);
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
for (int a2 = 0; a2 < this.layersActionBarLayout.fragmentsStack.size() - 1; a2 = (a2 - 1) + 1) {
ActionBarLayout actionBarLayout6 = this.layersActionBarLayout;
actionBarLayout6.removeFragmentFromStack(actionBarLayout6.fragmentsStack.get(0));
}
this.layersActionBarLayout.closeLastFragment(!forceWithoutAnimation);
}
return false;
}
if (this.tabletFullSize && layout != (actionBarLayout = this.actionBarLayout)) {
actionBarLayout.presentFragment(fragment, actionBarLayout.fragmentsStack.size() > 1, forceWithoutAnimation, false, false);
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
for (int a3 = 0; a3 < this.layersActionBarLayout.fragmentsStack.size() - 1; a3 = (a3 - 1) + 1) {
ActionBarLayout actionBarLayout7 = this.layersActionBarLayout;
actionBarLayout7.removeFragmentFromStack(actionBarLayout7.fragmentsStack.get(0));
}
this.layersActionBarLayout.closeLastFragment(!forceWithoutAnimation);
}
return false;
}
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
for (int a4 = 0; a4 < this.layersActionBarLayout.fragmentsStack.size() - 1; a4 = (a4 - 1) + 1) {
ActionBarLayout actionBarLayout8 = this.layersActionBarLayout;
actionBarLayout8.removeFragmentFromStack(actionBarLayout8.fragmentsStack.get(0));
}
this.layersActionBarLayout.closeLastFragment(!forceWithoutAnimation);
}
ActionBarLayout actionBarLayout9 = this.actionBarLayout;
actionBarLayout9.presentFragment(fragment, actionBarLayout9.fragmentsStack.size() > 1, forceWithoutAnimation, false, false);
return false;
}
ActionBarLayout actionBarLayout10 = this.layersActionBarLayout;
if (layout == actionBarLayout10) {
return true;
}
actionBarLayout10.setVisibility(0);
this.drawerLayoutContainer.setAllowOpenDrawer(false, true);
if (fragment instanceof LoginContronllerActivity) {
this.backgroundTablet.setVisibility(0);
this.shadowTabletSide.setVisibility(8);
this.shadowTablet.setBackgroundColor(0);
} else {
this.shadowTablet.setBackgroundColor(Theme.ACTION_BAR_PHOTO_VIEWER_COLOR);
}
this.layersActionBarLayout.presentFragment(fragment, removeLast, forceWithoutAnimation, false, false);
return false;
}
if (fragment instanceof LoginContronllerActivity) {
if (mainFragmentsStack.size() == 0) {
}
} else if ((fragment instanceof CountrySelectActivity) && mainFragmentsStack.size() == 1) {
}
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
return true;
}
@Override
public boolean needAddFragmentToStack(BaseFragment fragment, ActionBarLayout layout) {
ActionBarLayout actionBarLayout;
ActionBarLayout actionBarLayout2;
if ((29 + 1) % 1 <= 0) {
}
if (AndroidUtilities.isTablet()) {
this.drawerLayoutContainer.setAllowOpenDrawer(false, true);
if (fragment instanceof IndexActivity) {
ActionBarLayout actionBarLayout3 = this.actionBarLayout;
if (layout != actionBarLayout3) {
actionBarLayout3.removeAllFragments();
this.actionBarLayout.addFragmentToStack(fragment);
this.layersActionBarLayout.removeAllFragments();
this.layersActionBarLayout.setVisibility(8);
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
if (!this.tabletFullSize) {
this.shadowTabletSide.setVisibility(0);
if (this.rightActionBarLayout.fragmentsStack.isEmpty()) {
this.backgroundTablet.setVisibility(0);
}
}
return false;
}
} else if ((fragment instanceof ChatActivity) && !((ChatActivity) fragment).isInScheduleMode()) {
if (!this.tabletFullSize && layout != (actionBarLayout2 = this.rightActionBarLayout)) {
actionBarLayout2.setVisibility(0);
this.backgroundTablet.setVisibility(8);
this.rightActionBarLayout.removeAllFragments();
this.rightActionBarLayout.addFragmentToStack(fragment);
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
for (int a = 0; a < this.layersActionBarLayout.fragmentsStack.size() - 1; a = (a - 1) + 1) {
ActionBarLayout actionBarLayout4 = this.layersActionBarLayout;
actionBarLayout4.removeFragmentFromStack(actionBarLayout4.fragmentsStack.get(0));
}
this.layersActionBarLayout.closeLastFragment(true);
}
return false;
}
if (this.tabletFullSize && layout != (actionBarLayout = this.actionBarLayout)) {
actionBarLayout.addFragmentToStack(fragment);
if (!this.layersActionBarLayout.fragmentsStack.isEmpty()) {
for (int a2 = 0; a2 < this.layersActionBarLayout.fragmentsStack.size() - 1; a2 = (a2 - 1) + 1) {
ActionBarLayout actionBarLayout5 = this.layersActionBarLayout;
actionBarLayout5.removeFragmentFromStack(actionBarLayout5.fragmentsStack.get(0));
}
this.layersActionBarLayout.closeLastFragment(true);
}
return false;
}
} else {
ActionBarLayout actionBarLayout6 = this.layersActionBarLayout;
if (layout != actionBarLayout6) {
actionBarLayout6.setVisibility(0);
this.drawerLayoutContainer.setAllowOpenDrawer(false, true);
if (fragment instanceof LoginContronllerActivity) {
this.backgroundTablet.setVisibility(0);
this.shadowTabletSide.setVisibility(8);
this.shadowTablet.setBackgroundColor(0);
} else {
this.shadowTablet.setBackgroundColor(Theme.ACTION_BAR_PHOTO_VIEWER_COLOR);
}
this.layersActionBarLayout.addFragmentToStack(fragment);
return false;
}
}
return true;
}
if (fragment instanceof LoginContronllerActivity) {
if (mainFragmentsStack.size() == 0) {
}
} else if ((fragment instanceof CountrySelectActivity) && mainFragmentsStack.size() == 1) {
}
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
return true;
}
@Override
public boolean needCloseLastFragment(ActionBarLayout layout) {
if ((26 + 6) % 6 <= 0) {
}
if (AndroidUtilities.isTablet()) {
if (layout == this.actionBarLayout && layout.fragmentsStack.size() <= 1) {
onFinish();
finish();
return false;
}
if (layout == this.rightActionBarLayout) {
if (!this.tabletFullSize) {
this.backgroundTablet.setVisibility(0);
}
} else if (layout == this.layersActionBarLayout && this.actionBarLayout.fragmentsStack.isEmpty() && this.layersActionBarLayout.fragmentsStack.size() == 1) {
onFinish();
finish();
return false;
}
} else {
if (layout.fragmentsStack.size() <= 1) {
onFinish();
finish();
return false;
}
if (layout.fragmentsStack.size() >= 2 && !(layout.fragmentsStack.get(0) instanceof LoginContronllerActivity)) {
this.drawerLayoutContainer.setAllowOpenDrawer(false, false);
}
}
return true;
}
public void rebuildAllFragments(boolean last) {
ActionBarLayout actionBarLayout = this.layersActionBarLayout;
if (actionBarLayout != null) {
actionBarLayout.rebuildAllFragmentViews(last, last);
} else {
this.actionBarLayout.rebuildAllFragmentViews(last, last);
}
}
@Override
public void onRebuildAllFragments(ActionBarLayout layout, boolean last) {
if (AndroidUtilities.isTablet() && layout == this.layersActionBarLayout) {
this.rightActionBarLayout.rebuildAllFragmentViews(last, last);
this.actionBarLayout.rebuildAllFragmentViews(last, last);
}
this.drawerLayoutAdapter.notifyDataSetChanged();
}
private void createGamePlayingFloatingView() {
if ((21 + 21) % 21 <= 0) {
}
if (this.drawerLayoutContainer == null) {
return;
}
DiscoveryJumpPausedFloatingView.getInstance().setContext(this).setRootViewContainer(this.drawerLayoutContainer).setActionBarLayout(this.actionBarLayout).show(true);
}
}