工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853
以下内容为反编译后的 MosLauncherActivity.java 源代码,内容仅作参考
package com.uusafe.launcher.ui.activity;
import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextClock;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.lifecycle.Lifecycle;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.uber.autodispose.l;
import com.uusafe.app.plugin.launcher.core.Launcher;
import com.uusafe.app.plugin.launcher.core.LauncherAppState;
import com.uusafe.app.plugin.launcher.core.ShortcutInfo;
import com.uusafe.app.plugin.launcher.core.Utilities;
import com.uusafe.app.plugin.launcher.manager.BaseLauncher;
import com.uusafe.app.plugin.launcher.manager.LauncherManager;
import com.uusafe.app.plugin.launcher.manager.UUShortcutInfo;
import com.uusafe.app.plugin.launcher.manager.UUWidgetHostView;
import com.uusafe.app.plugin.launcher.manager.UUWidgetInfoImpl;
import com.uusafe.base.modulesdk.module.ApnModule;
import com.uusafe.base.modulesdk.module.ZhugeModule;
import com.uusafe.base.modulesdk.module.activity.ActivityLifeController;
import com.uusafe.base.modulesdk.module.activity.ActivityManager;
import com.uusafe.base.modulesdk.module.bean.BaseBundleInfo;
import com.uusafe.base.modulesdk.module.bean.SecParam;
import com.uusafe.base.modulesdk.module.global.CommGlobal;
import com.uusafe.base.modulesdk.module.global.MosConstants;
import com.uusafe.base.modulesdk.module.manager.BaseModuleManager;
import com.uusafe.base.modulesdk.module.router.ARouterConfig;
import com.uusafe.base.modulesdk.module.utils.NetworkUtils;
import com.uusafe.commbase.bean.AllAloneAppMessageInfo;
import com.uusafe.commbase.bean.AloneAppMessageInfo;
import com.uusafe.commbase.bean.MosAppInfo;
import com.uusafe.commbase.db.MosAppManagerTools;
import com.uusafe.commbase.event.NextDialogEvent;
import com.uusafe.commbase.event.StartUninstallAppActivityEvent;
import com.uusafe.commbase.global.BaseGlobal;
import com.uusafe.commbase.module.manager.ModuleManager;
import com.uusafe.common.device.env.AppEnv;
import com.uusafe.data.module.permission.PermissionReqBridge;
import com.uusafe.data.module.presenter.main.BuildInModuleManager;
import com.uusafe.data.module.presenter.main.CustomHotseatModuleManager;
import com.uusafe.data.module.service.MosBgService;
import com.uusafe.download.manager.DownloadManager;
import com.uusafe.download.task.DownloadTask;
import com.uusafe.emm.policy.PolicyProtocol;
import com.uusafe.launcher.impl.main.MosLauncherPresenterImpl;
import com.uusafe.launcher.ui.drawer.DrawerItemView;
import com.uusafe.launcher.view.LauncherGuideView;
import com.uusafe.launcher.view.LeftScreenView;
import com.uusafe.mbs.mbslauncher.R;
import com.uusafe.permission.AfterPermissionGranted;
import com.uusafe.permission.AppSettingsDialog;
import com.uusafe.permission.EasyPermissions;
import com.uusafe.permission.util.PermissionsUtils;
import com.uusafe.rxjava.RxManager;
import com.uusafe.rxjava.RxTask;
import com.uusafe.sandbox.controller.view.applock.LockDialogListener;
import com.uusafe.thirdpartylibs.utils.ImageUtil;
import com.uusafe.uibase.activity.UninstallBlackAppActivity;
import com.uusafe.uibase.application.AppStatusTracker;
import com.uusafe.uibase.manager.OpenWinManager;
import com.uusafe.uibase.utils.ApnUtils;
import com.uusafe.uibase.utils.WallPaperUtil;
import com.uusafe.utils.common.DeviceUtils;
import com.uusafe.utils.common.JsonUtil;
import com.uusafe.utils.common.MosLocaleUtils;
import com.uusafe.utils.common.PreferenceUtils;
import com.uusafe.utils.common.StringUtils;
import com.uusafe.utils.common.UiUtils;
import com.uusafe.utils.common.ZZLog;
import io.reactivex.functions.Consumer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import net.sqlcipher.database.SQLiteDatabase;
import org.greenrobot.eventbus.ThreadMode;
import org.greenrobot.eventbus.n;
import org.json.JSONObject;
@Route(path = ARouterConfig.RouterPath.UUSAFE_FEATYRE_APP_MOSLAUNCHER_ACTIVITY)
public class MosLauncherActivity extends BaseLauncher implements LauncherGuideView.DismissListener, DialogInterface, LockDialogListener, IMosLauncherView, EasyPermissions.PermissionCallbacks, View.OnClickListener {
public static final String EXTRA_SAFE_WORKSPACE_STATE = "safe_workspace_state";
public static final String TAG = "MosLauncherActivity";
private static String lastAction;
private static long lastClickTime;
private static String lastPackageName;
public LauncherGuideView appStoreGuideView;
private boolean isMeetingModeIsShowUser;
private Launcher.CustomContentCallbacks mCustomContentCallbacks;
public LeftScreenView mLeftView;
MosLauncherPresenterImpl presenterImpl;
public LauncherGuideView recommendAppGuideView;
private int systemUiVisibility;
private DrawerItemView tabAbout;
private DrawerItemView tabDoc;
private DrawerItemView tabMessage;
private DrawerItemView tabSetting;
private DrawerItemView tabStore;
private String workAreaName;
private boolean hasRecommendApp = false;
boolean onPause = false;
private ArrayList<MosAppInfo> adviceList = new ArrayList<>();
View widgetRootView = null;
public static Object b() {
return 0;
}
@NonNull
public static Intent getIntent(Context context, Parcelable parcelable) {
Intent intent = new Intent(context, MosLauncherActivity.class);
intent.addFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
intent.putExtra(EXTRA_SAFE_WORKSPACE_STATE, parcelable);
return intent;
}
private void initDrawerView(View view) {
this.tabStore = (DrawerItemView) view.findViewById(R.id.tab_store);
this.tabStore.setOnClickListener(this);
this.tabStore.setDrawerItem(R.drawable.tab_firm_app_normal, R.string.tab_store);
this.tabDoc = (DrawerItemView) view.findViewById(R.id.tab_doc);
this.tabDoc.setOnClickListener(this);
this.tabDoc.setDrawerItem(R.drawable.tab_doc_normal, R.string.tab_doc);
this.tabMessage = (DrawerItemView) view.findViewById(R.id.tab_message);
this.tabMessage.setOnClickListener(this);
this.tabMessage.setDrawerItem(R.drawable.tab_my_notify_normal, R.string.tab_message);
this.tabSetting = (DrawerItemView) view.findViewById(R.id.tab_setting);
this.tabSetting.setOnClickListener(this);
this.tabSetting.setDrawerItem(R.drawable.tab_device_normal, R.string.tab_setting);
this.tabAbout = (DrawerItemView) view.findViewById(R.id.tab_about_us);
this.tabAbout.setOnClickListener(this);
this.tabAbout.setDrawerItem(R.drawable.tab_about_us_normal, R.string.tab_about_us);
}
private void initLeftView() {
ZZLog.f(TAG, "initLeftView begin", new Object[0]);
this.mLeftView = new LeftScreenView(this);
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.loadLauncherBackground(WallPaperUtil.getBlurDrawable(this), this.mLeftView.getBlurBackground());
}
ZZLog.f(TAG, "initLeftView end", new Object[0]);
}
public static void start(Context context, Parcelable parcelable) {
context.startActivity(getIntent(context, parcelable));
}
private boolean startApp(String str, String str2) {
if (this.presenterImpl == null || !CommGlobal.canUse(this)) {
return false;
}
if (TextUtils.isEmpty(str)) {
if (MosConstants.SAFECAMERA_PACKAGE.equals(str2)) {
if (PermissionsUtils.requestPermission(this, 131, PermissionsUtils.VIDEO)) {
goSafeCamera();
}
return false;
}
} else if (MosConstants.SAFECAMERA_PACKAGE.equals(str)) {
if (PermissionsUtils.requestPermission(this, 131, PermissionsUtils.VIDEO)) {
goSafeCamera();
}
return false;
}
return this.presenterImpl.handleItemClick(str, str2);
}
private void zhugeTrack() {
ZhugeModule zhugeModule = BaseModuleManager.getInstance().getZhugeModule();
if (zhugeModule != null) {
JSONObject jSONObject = new JSONObject();
JsonUtil.putLong(jSONObject, "userId", PreferenceUtils.getUserId(this));
JsonUtil.putString(jSONObject, PolicyProtocol.VPN_USERNAME, PreferenceUtils.getLoginName(this, BaseGlobal.getMosKey()));
JsonUtil.putString(jSONObject, "deviceId", DeviceUtils.getDeviceId());
JsonUtil.putString(jSONObject, "deviceModel", DeviceUtils.getDeviceModel());
JsonUtil.putString(jSONObject, "os", DeviceUtils.getDevicePlatform());
JsonUtil.putString(jSONObject, "versionName", "3.6.5.2");
zhugeModule.track(this, "launcher", jSONObject);
}
}
public void a() {
if (this.presenterImpl != null) {
ZZLog.f(TAG, "loadLauncherBackground", new Object[0]);
this.presenterImpl.loadLauncherBackground(WallPaperUtil.getDrawable(this), getLauncherBackgroundImageView());
}
}
public void addAdviceAppList(final List<MosAppInfo> list) {
this.adviceList.clear();
if (list != null) {
this.adviceList.addAll(list);
runOnUiThread(new Runnable() {
@Override
public final void run() {
MosLauncherActivity.this.a(list);
}
});
}
}
public void addMosAppIcon(boolean z, @NonNull UUShortcutInfo... uUShortcutInfoArr) {
if (getModel() != null) {
addAppIcon(z, uUShortcutInfoArr);
}
}
@Override
protected void attachBaseContext(Context context) {
super.attachBaseContext(MosLocaleUtils.attachBaseContext(context));
}
@Override
public int attachLayoutRes() {
return 0;
}
@Override
public l<Object> bindLifecycle() {
return null;
}
@Override
public void bindUUWidgetCompleted(String str, View view) {
TextClock textClock;
this.widgetRootView = view;
refreshWorkAreaName(PreferenceUtils.getWorkAreaName(this, BaseGlobal.getMosKey()));
if (!UUWidgetHostView.INTENT_WIDGET_TIME.equals(str) || view == null || (textClock = (TextClock) view.findViewById(R.id.uu_mos_text_date_clock)) == null) {
return;
}
if (Locale.ENGLISH.equals(MosLocaleUtils.getLang(this))) {
textClock.setFormat12Hour("EEE, MMM dd");
textClock.setFormat24Hour("EEE, MMM dd");
return;
}
textClock.setFormat12Hour("MMMdd日 EEEE");
textClock.setFormat24Hour("MMMdd日 EEEE");
}
@Override
public void cancel() {
}
public void checkPermission() {
ZZLog.f(TAG, "checkPermission begin", new Object[0]);
boolean hasPermission = PermissionsUtils.hasPermission(this, PermissionsUtils.STORAGE);
boolean hasPermission2 = PermissionsUtils.hasPermission(this, PermissionsUtils.PHONE_STATE);
boolean hasPermission3 = PermissionsUtils.hasPermission(this, PermissionsUtils.NETWORK);
if (!hasPermission || !hasPermission2 || !hasPermission3) {
String[][] strArr = new String[3];
strArr[0] = hasPermission2 ? new String[0] : PermissionsUtils.PHONE_STATE;
strArr[1] = hasPermission ? new String[0] : PermissionsUtils.STORAGE;
strArr[2] = hasPermission3 ? new String[0] : PermissionsUtils.NETWORK;
PermissionsUtils.requestPermission(this, 127, strArr);
}
ZZLog.f(TAG, "checkPermission end", new Object[0]);
}
public void deleteMosAppIcon(@NonNull String... strArr) {
if (getModel() != null) {
ZZLog.e(TAG, "deleteMosAppIcon packageNames=" + Arrays.toString(strArr), new Object[0]);
deleteAppIcon(strArr);
}
}
@Override
public void dismiss() {
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.showNextDialog();
}
}
@Override
public void doSyncApps() {
}
@Override
public boolean enableDelete(ComponentName componentName) {
if (componentName == null) {
return false;
}
String packageName = componentName.getPackageName();
if (StringUtils.areNotEmpty(packageName) && this.presenterImpl.innerApp(packageName)) {
return false;
}
ZZLog.e(TAG, "enableDelete packageName=" + packageName, new Object[0]);
MosAppInfo queryInfoByPkgName = MosAppManagerTools.getInstance().queryInfoByPkgName(packageName);
if (queryInfoByPkgName != null) {
if (queryInfoByPkgName == null || queryInfoByPkgName.getAppProperty() != 2) {
return !ModuleManager.getInstance().getH5Module().isPkgInstalled(packageName, queryInfoByPkgName.getPlatform());
}
return false;
}
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
return mosLauncherPresenterImpl.checkSysApp(packageName);
}
return false;
}
@Override
public boolean enableUninstall(ComponentName componentName) {
if (componentName == null) {
return false;
}
String packageName = componentName.getPackageName();
if (StringUtils.areNotEmpty(packageName) && this.presenterImpl.innerApp(packageName)) {
return false;
}
ZZLog.e(TAG, "enableUninstall packageName=" + packageName, new Object[0]);
MosAppInfo queryInfoByPkgName = MosAppManagerTools.getInstance().queryInfoByPkgName(packageName);
if (queryInfoByPkgName != null) {
if (queryInfoByPkgName == null || queryInfoByPkgName.getAppProperty() != 2) {
return ModuleManager.getInstance().getH5Module().isPkgInstalled(packageName, queryInfoByPkgName.getPlatform());
}
return false;
}
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
return mosLauncherPresenterImpl.checkSysApp(packageName);
}
return false;
}
@Override
public Context getCurrentContext() {
return null;
}
@Override
public HashMap<String, Integer> getDownloadingAppsProgressinfo() {
List<DownloadTask> allDownloadTask;
MosAppInfo queryInfoByPkgName;
ZZLog.f(TAG, "getDownloadingAppsProgressinfo begin", new Object[0]);
HashMap<String, Integer> hashMap = new HashMap<>();
if (CommGlobal.canUse(this) && (allDownloadTask = DownloadManager.getInstance().getAllDownloadTask()) != null && allDownloadTask.size() > 0) {
for (DownloadTask downloadTask : allDownloadTask) {
int fraction = (int) (downloadTask.getDownloadInfo().getFraction() * 100.0f);
if (downloadTask.getDownloadInfo() != null && StringUtils.areNotEmpty(downloadTask.getDownloadInfo().getAppid()) && ((queryInfoByPkgName = MosAppManagerTools.getInstance().queryInfoByPkgName(downloadTask.getDownloadInfo().getAppid())) == null || !ModuleManager.getInstance().getH5Module().isPkgInstalled(queryInfoByPkgName.getPkgName(), queryInfoByPkgName.getPlatform()))) {
if (fraction >= 0 && fraction <= 100) {
hashMap.put(downloadTask.getDownloadInfo().getAppid(), Integer.valueOf(fraction));
}
}
}
}
return hashMap;
}
@Override
public View getDrawerLeftView(FrameLayout frameLayout) {
return null;
}
@Override
public int getDrawerLeftWidth() {
return 0;
}
@Override
public View getDrawerRightView(FrameLayout frameLayout) {
View inflate = LayoutInflater.from(this).inflate(R.layout.feature_mbslauncher_custom_somple_desk, (ViewGroup) frameLayout, false);
initDrawerView(inflate);
return inflate;
}
@Override
public int getDrawerRightWidth() {
return 400;
}
public ImageView getLauncherBackgroundImageView() {
return getLauncherBackgroudView();
}
@Override
@RequiresApi(api = 23)
public View getLeftContentView() {
LeftScreenView leftScreenView = this.mLeftView;
if (leftScreenView == null) {
return null;
}
return leftScreenView.getView();
}
@Override
public Launcher.CustomContentCallbacks getLeftContentViewCallback() {
if (this.mCustomContentCallbacks == null) {
this.mCustomContentCallbacks = new Launcher.CustomContentCallbacks() {
@Override
public boolean isScrollingAllowed() {
return true;
}
@Override
public void onHide() {
BaseModuleManager.getInstance().getUaaModule().onPageEnd("com.uusafe.launcher.view.LeftScreenView", MosLauncherActivity.this.getString(R.string.uu_mbs_uaa_page_leftview), MosLauncherActivity.this);
MosLauncherActivity.this.getWindow().getDecorView().setSystemUiVisibility(MosLauncherActivity.this.systemUiVisibility);
MosLauncherActivity.this.getWindow().setStatusBarColor(0);
}
@Override
public void onScrollProgressChanged(float f) {
LeftScreenView leftScreenView = MosLauncherActivity.this.mLeftView;
if (leftScreenView != null) {
leftScreenView.updateBackground(f);
}
}
@Override
@RequiresApi(api = 23)
public void onShow(boolean z) {
ZZLog.f(MosLauncherActivity.TAG, "getLeftContentViewCallback begin", new Object[0]);
BaseModuleManager.getInstance().getUaaModule().onPageStart("com.uusafe.launcher.view.LeftScreenView", MosLauncherActivity.this.getString(R.string.uu_mbs_uaa_page_leftview), MosLauncherActivity.this);
BaseModuleManager.getInstance().getUaaModule().onClickEvent("uu_mbs_uaa_event_leftview", MosLauncherActivity.this.getString(R.string.uu_mbs_uaa_event_leftview), MosLauncherActivity.this);
LeftScreenView leftScreenView = MosLauncherActivity.this.mLeftView;
if (leftScreenView != null) {
leftScreenView.initStatusBar();
MosLauncherActivity mosLauncherActivity = MosLauncherActivity.this;
MosLauncherPresenterImpl mosLauncherPresenterImpl = mosLauncherActivity.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.loadLauncherBackground(WallPaperUtil.getBlurDrawable(mosLauncherActivity), MosLauncherActivity.this.mLeftView.getBlurBackground());
}
if (CommGlobal.canUse(MosLauncherActivity.this)) {
MosLauncherActivity.this.mLeftView.updateView();
MosLauncherActivity mosLauncherActivity2 = MosLauncherActivity.this;
mosLauncherActivity2.mLeftView.addAdviceApp(mosLauncherActivity2.adviceList);
}
}
}
};
}
return this.mCustomContentCallbacks;
}
public LeftScreenView getLeftView() {
return this.mLeftView;
}
@AfterPermissionGranted(131)
public void goSafeCamera() {
this.presenterImpl.goSafeCamera(this, getPackageName());
}
@Override
public void handleBackPressed() {
super.handleBackPressed();
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.handleBackPressed(this);
}
if (AppEnv.isPMos() && BaseModuleManager.getInstance().getEmmModule() != null && BaseModuleManager.getInstance().getEmmModule().isForceLauncher()) {
return;
}
ActivityLifeController.backToDesk(this);
}
@Override
protected boolean hasCustomContentToLeft() {
return SecParam.getPreferenceHideNegativeOneScreen() == 0;
}
@Override
public boolean hasCustomToLeft() {
return SecParam.getPreferenceHideNegativeOneScreen() == 0;
}
@Override
public void hideProgressBar() {
}
@Override
public int homePageIndex() {
return 1;
}
@Override
public int hotseatNum() {
return CustomHotseatModuleManager.getInstance().gethotseatNum();
}
@Override
public void initData() {
}
protected void initInjector() {
this.presenterImpl = new MosLauncherPresenterImpl(this, true);
BaseModuleManager.getInstance().getMainModule().setMosBaseLauncherPresenterImpl(this.presenterImpl);
}
@Override
public void initLifecycleObserver(Lifecycle lifecycle) {
}
@Override
public List<UUShortcutInfo> initSpecifiedItems() {
return null;
}
protected void initToolbar() {
if (Build.VERSION.SDK_INT >= 21) {
getWindow().setStatusBarColor(0);
}
if (Build.VERSION.SDK_INT >= 16) {
getWindow().getDecorView().setSystemUiVisibility(1280);
}
}
@Override
public void initView(Bundle bundle) {
}
@Override
public List<UUShortcutInfo> initialCustomHotseat(List<UUShortcutInfo> list, List<UUShortcutInfo> list2) {
if (this.presenterImpl != null) {
ZZLog.f(TAG, "processInitoalHotseat begin", new Object[0]);
return null;
}
return null;
}
@Override
public List<UUShortcutInfo> initialHotseat() {
if (this.presenterImpl != null) {
ZZLog.f(TAG, "initialHotseat begin", new Object[0]);
return this.presenterImpl.initialHotseat();
}
return null;
}
@Override
public List<UUWidgetInfoImpl> initialUUWidget() {
ArrayList arrayList = new ArrayList();
int i = LauncherAppState.getInstance().getInvariantDeviceProfile().numColumns;
if ("showall".equals(CommGlobal.desktopType)) {
arrayList.add(new UUWidgetInfoImpl(UUWidgetHostView.INTENT_WIDGET_TIME, getResources().getResourceEntryName(R.layout.uu_mos_widget_layout), i, 2));
} else if ("onlydate".equals(CommGlobal.desktopType)) {
arrayList.add(new UUWidgetInfoImpl(UUWidgetHostView.INTENT_WIDGET_TIME, getResources().getResourceEntryName(R.layout.uu_mos_widget_onlydate_layout), i, 2));
} else if ("onlyworkspacename".equals(CommGlobal.desktopType)) {
arrayList.add(new UUWidgetInfoImpl(UUWidgetHostView.INTENT_WIDGET_TIME, getResources().getResourceEntryName(R.layout.uu_mos_widget_onlyworkspacename_layout), i, 1));
}
return arrayList;
}
@Override
public boolean isCustom() {
return true;
}
public boolean isFastDoubleClick(String str, String str2, long j) {
long currentTimeMillis = System.currentTimeMillis();
long abs = Math.abs(currentTimeMillis - lastClickTime);
if (lastPackageName == str && lastAction == str2 && lastClickTime > 0 && abs < j) {
ZZLog.d(TAG, "短时间内按钮多次触发", new Object[0]);
return true;
}
lastClickTime = currentTimeMillis;
lastPackageName = str;
lastAction = str2;
return false;
}
@Override
protected boolean isRotationAllowedForDevice() {
return UiUtils.isPad(this);
}
@Override
public boolean isSimpleDesktop() {
return true;
}
@AfterPermissionGranted(141)
protected void nextWindow() {
ZZLog.e(TAG, "nextWindow", new Object[0]);
PermissionReqBridge.getInstance().callBack(0, 1);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
ZZLog.e(TAG, "onActivityResult ===", new Object[0]);
if (BaseModuleManager.getInstance().getSdpLoginPluginModule() != null) {
BaseModuleManager.getInstance().getSdpLoginPluginModule().onActivityResult(i, i2, intent, this, false);
}
if (BaseModuleManager.getInstance().getEpassSangforVpnModule() != null) {
BaseModuleManager.getInstance().getEpassSangforVpnModule().onActivityResult(i, i2);
}
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.onActivityResult(i, i2, intent);
}
if (i == 16061) {
if (i2 == 0) {
PermissionReqBridge.getInstance().callBack(-1, 1);
} else if (i2 == -1) {
PermissionReqBridge.getInstance().callBack(0, 1);
}
}
}
@Override
public void onAddCellView(View view) {
super.onAddCellView(view);
if (this.presenterImpl != null) {
ZZLog.f(TAG, "onAddCellView begin", new Object[0]);
this.presenterImpl.onAddCellView(view);
}
}
@Override
public void onAppBackground() {
}
@Override
public void onAppForeground() {
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.tab_store) {
BaseModuleManager.getInstance().getMainProcessModule().startActivityRouterPath(CommGlobal.getContext(), "/feature_appstore/activity/appstore", new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
} else if (id == R.id.tab_doc) {
if (BuildInModuleManager.getInstance().containModule("com.uusafe.mbs.mcm")) {
BuildInModuleManager.getInstance().getModule("com.uusafe.mbs.mcm").onModuleAction(CommGlobal.getContext());
}
} else if (id == R.id.tab_message) {
BaseModuleManager.getInstance().getMainProcessModule().startActivityRouterPath(CommGlobal.getContext(), ARouterConfig.RouterPath.UUSAFE_FEATURE_APPMESSAGE_MESSAGELIST_ACTIVITY, new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
} else if (id == R.id.tab_setting) {
BaseModuleManager.getInstance().getMainProcessModule().startActivityRouterPath(CommGlobal.getContext(), "/feature_appsetting/activity/setting", new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
} else if (id == R.id.tab_about_us) {
OpenWinManager.startActivityRouterPath(CommGlobal.getContext(), ARouterConfig.RouterPath.UUSAFE_FEATURE_APPSETTING_ABOUT_ACTIVITY, new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
}
super.onClick(view);
}
@Override
public boolean onClickApp(String str, String str2) {
if (isFastDoubleClick(str, str2, 1000L)) {
return true;
}
return startApp(str, str2);
}
@Override
@SuppressLint({"CheckResult"})
protected void onCreate(Bundle bundle) {
ApnModule apnModule;
ZZLog.f(TAG, "onCreate begin", new Object[0]);
Utilities.setEnableRegisterForPackageIntents(false);
if (CommGlobal.enableCloudPhoneLoading) {
LauncherAppState.setSceneType(LauncherAppState.SCENE_TYPE_DALIAN);
}
AppStatusTracker.getInstance().setAppStatus(2);
ZZLog.f(TAG, "setRequestedOrientation", new Object[0]);
if (UiUtils.isPad(this)) {
setRequestedOrientation(-1);
} else {
setRequestedOrientation(1);
}
initToolbar();
initInjector();
super.onCreate(bundle);
LauncherManager.getInstance().setEnableIconIndicator(BaseModuleManager.getInstance().getEmmModule() != null);
initLeftView();
runOnUiThread(new Runnable() {
@Override
public final void run() {
MosLauncherActivity.this.a();
}
});
if (!org.greenrobot.eventbus.e.a().b(this)) {
org.greenrobot.eventbus.e.a().e(this);
}
ImageUtil.initRequestOptions(this);
zhugeTrack();
ActivityManager.getScreenManager().pushActivity(this);
if (CommGlobal.enableCloudPhoneLoading) {
checkPermission();
ActivityLifeController.finishAllExcept(MosLauncherActivity.class);
}
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.emmGestureAuth(this);
}
if (CommGlobal.apnEnable && ((NetworkUtils.isApnEnabled(this) || NetworkUtils.isWifi(this)) && (apnModule = ModuleManager.getInstance().getApnModule()) != null)) {
apnModule.showApnDialog();
}
if (PreferenceUtils.getBooleanPreference(CommGlobal.getContext(), CommGlobal.MEETING_WORKSPACE, false)) {
this.isMeetingModeIsShowUser = PreferenceUtils.getBooleanPreference(CommGlobal.getContext(), CommGlobal.MEETING_WORKSPACE_IS_SHOW_USER, false);
this.workAreaName = PreferenceUtils.getStringPreference(CommGlobal.getContext(), BaseGlobal.getMosKey(), CommGlobal.MEETING_WORKSPACE_USER_NAME);
ZZLog.f(TAG, "onCreate: isMeetingModeIsShowUser = " + this.isMeetingModeIsShowUser + ";workAreaName = " + this.workAreaName, new Object[0]);
refreshMeetingModeWorkArea(this.isMeetingModeIsShowUser, this.workAreaName);
}
MosLauncherPresenterImpl mosLauncherPresenterImpl2 = this.presenterImpl;
if (mosLauncherPresenterImpl2 != null) {
mosLauncherPresenterImpl2.onCreate(this);
}
ZZLog.f(TAG, "onCreate end", new Object[0]);
}
@Override
public void onDelete(ComponentName componentName) {
MosAppInfo queryInfoByPkgName;
if (componentName == null) {
return;
}
String packageName = componentName.getPackageName();
if ((StringUtils.areNotEmpty(packageName) && this.presenterImpl.innerApp(packageName)) || (queryInfoByPkgName = MosAppManagerTools.getInstance().queryInfoByPkgName(componentName.getPackageName())) == null) {
return;
}
ZZLog.i(TAG, "onDelete packageName=" + packageName, new Object[0]);
ModuleManager.getInstance().getAppStoreModule().onUninstall(queryInfoByPkgName, this, false, true);
}
@Override
public void onDestroy() {
super.onDestroy();
ZZLog.f(TAG, "onDestroy begin", new Object[0]);
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.onDestroy(this);
}
MosLauncherPresenterImpl mosLauncherPresenterImpl2 = this.presenterImpl;
if (mosLauncherPresenterImpl2 != null && mosLauncherPresenterImpl2.getPresenter() != null) {
this.presenterImpl.getPresenter().dispose();
this.presenterImpl.onDestroy();
}
this.appStoreGuideView = null;
this.recommendAppGuideView = null;
MosBgService.stopBgService();
org.greenrobot.eventbus.e.a().g(this);
MosLauncherPresenterImpl mosLauncherPresenterImpl3 = this.presenterImpl;
if (mosLauncherPresenterImpl3 != null) {
mosLauncherPresenterImpl3.release();
}
ZZLog.f(TAG, "onDestroy end", new Object[0]);
ActivityManager.getScreenManager().popActivityOut(this);
}
@Override
public void onDismiss(String str) {
PreferenceUtils.setGuideValue(str, true, this);
if (PreferenceUtils.isAppStoreGuide(this) && !PreferenceUtils.isRecommendAppGuide(this)) {
this.appStoreGuideView = null;
} else if (PreferenceUtils.isRecommendAppGuide(this)) {
this.recommendAppGuideView = null;
}
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.showNextDialog();
}
}
@Override
@SuppressLint({"CheckResult"})
public void onFinishBindingItems() {
ZZLog.e(TAG, "onFinishBindingItems", new Object[0]);
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.bindSpecialItemsCompleted = true;
}
if (this.presenterImpl != null) {
ZZLog.e(TAG, "onFinishBindingItems initLauncherPresenterImpl", new Object[0]);
this.presenterImpl.initLauncherPresenterImpl(this);
}
MosLauncherPresenterImpl mosLauncherPresenterImpl2 = this.presenterImpl;
if (mosLauncherPresenterImpl2 != null && !mosLauncherPresenterImpl2.openGestureSet) {
ZZLog.e(TAG, "onFinishBindingItems processStartLauncherTask", new Object[0]);
this.presenterImpl.processStartLauncherTask();
}
MosLauncherPresenterImpl mosLauncherPresenterImpl3 = this.presenterImpl;
if (mosLauncherPresenterImpl3 != null) {
mosLauncherPresenterImpl3.showTopDialog();
}
if (CommGlobal.canUse(this) && this.presenterImpl != null) {
ZZLog.e(TAG, "startCheckEnv", new Object[0]);
this.presenterImpl.startCheckEnv(this);
}
RxManager.createIO(new RxTask() {
@Override
public final Object run() {
return MosLauncherActivity.b();
}
}).subscribe(new Consumer() {
@Override
public final void accept(Object obj) {
MosLauncherActivity.this.a(obj);
}
});
MosLauncherPresenterImpl mosLauncherPresenterImpl4 = this.presenterImpl;
if (mosLauncherPresenterImpl4 != null) {
mosLauncherPresenterImpl4.checkPermission();
}
MosLauncherPresenterImpl mosLauncherPresenterImpl5 = this.presenterImpl;
if (mosLauncherPresenterImpl5 != null) {
mosLauncherPresenterImpl5.onFinishBindingItems(this);
}
}
@Override
public void onLongClickBlank(View view) {
}
public void onMbsPermissionsDenied(int i, List list) {
if (EasyPermissions.somePermissionPermanentlyDenied(this, list)) {
String[] permissionPrompt = PermissionsUtils.getPermissionPrompt(this, (String) list.get(0));
new AppSettingsDialog.Builder(this).setTitle(permissionPrompt[0]).setRationale(permissionPrompt[1]).setThemeResId(R.style.EasyPermissions_Dialog).build().show();
return;
}
checkPermission();
ZZLog.e(TAG, "onPermissionsDenied checkPermission", new Object[0]);
if (this.presenterImpl != null) {
PermissionReqBridge.getInstance().checkPermission(this, this.presenterImpl.checkPermissionCallBack);
}
}
@n(threadMode = ThreadMode.MAIN)
public void onMessageEventMainThread(NextDialogEvent nextDialogEvent) {
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.showNextDialog();
}
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (this.presenterImpl == null) {
initInjector();
}
this.presenterImpl.onNewIntent(this, intent);
}
public void onNotifyLoginSuccess() {
ZZLog.d(TAG, "onNotifyLoginSuccess==", new Object[0]);
if (this.presenterImpl != null) {
ZZLog.d(TAG, "start onNotifyLoginSuccess==", new Object[0]);
this.presenterImpl.registerAppMessageCallback();
this.presenterImpl.appChanges(this, true);
this.presenterImpl.initTimerHandler();
this.presenterImpl.startCheckEnv(this);
}
}
@Override
public void onPageSwitch(View view, int i) {
super.onPageSwitch(view, i);
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.onPageSwitch(view, i);
}
}
@Override
public void onPause() {
ZZLog.f(TAG, "onPause begin", new Object[0]);
super.onPause();
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.onPause(this);
}
ZZLog.f(TAG, "onPause end", new Object[0]);
this.onPause = true;
}
@Override
public void onPermissionsDenied(int i, List list) {
ZZLog.f(TAG, "onPermissionsDenied begin", new Object[0]);
onMbsPermissionsDenied(i, list);
ZZLog.f(TAG, "onPermissionsDenied end", new Object[0]);
}
@Override
public void onPermissionsGranted(int i, List<String> list) {
}
@Override
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
EasyPermissions.onRequestPermissionsResult(i, strArr, iArr, this);
}
@Override
public void onResume() {
super.onResume();
if (BaseModuleManager.getInstance().getEmmModule() != null) {
BaseModuleManager.getInstance().getEmmModule().refreshCustomizeConfigLoadStatus();
}
ZZLog.f(TAG, "onResume begin", new Object[0]);
this.onPause = false;
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.showTopDialog();
MosLauncherPresenterImpl mosLauncherPresenterImpl2 = this.presenterImpl;
mosLauncherPresenterImpl2.onResume(this, mosLauncherPresenterImpl2.startApp);
}
this.systemUiVisibility = getWindow().getDecorView().getSystemUiVisibility();
ZZLog.f(TAG, "onResume end", new Object[0]);
if (CommGlobal.apnEnable && (NetworkUtils.isApnEnabled(this) || NetworkUtils.isWifi(this))) {
ApnUtils.showApnDialog(this);
}
MosLauncherPresenterImpl mosLauncherPresenterImpl3 = this.presenterImpl;
if (mosLauncherPresenterImpl3 != null) {
mosLauncherPresenterImpl3.processStartLauncherTask();
}
}
@Override
protected void onScrollInteractionBegin() {
super.onScrollInteractionBegin();
if (!this.hasRecommendApp || PreferenceUtils.isRecommendAppGuide(this)) {
return;
}
getWorkspace().setEnabled(false);
}
@Override
public boolean onUninstall(ComponentName componentName) {
if (componentName == null) {
return false;
}
String packageName = componentName.getPackageName();
if (StringUtils.areNotEmpty(packageName) && this.presenterImpl.innerApp(packageName)) {
return false;
}
MosAppInfo queryInfoByPkgName = MosAppManagerTools.getInstance().queryInfoByPkgName(componentName.getPackageName());
if (queryInfoByPkgName != null) {
ZZLog.i(TAG, "onUninstall packageName=" + packageName, new Object[0]);
ModuleManager.getInstance().getAppStoreModule().onUninstall(queryInfoByPkgName, this, false, true);
}
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
return mosLauncherPresenterImpl.checkSysApp(packageName);
}
return false;
}
@Override
public void refreshData() {
ZZLog.f(TAG, "refreshData begin", new Object[0]);
super.refreshData();
ZZLog.f(TAG, "refreshData end", new Object[0]);
}
public void refreshHotSeat() {
ZZLog.i(TAG, "refreshHotSeat", new Object[0]);
List<ShortcutInfo> hotSeatItems = getHotSeatItems(true);
List<ShortcutInfo> workspaceItems = getWorkspaceItems(true);
if (workspaceItems == null) {
workspaceItems = new ArrayList<>();
}
if (this.presenterImpl != null) {
ZZLog.i(TAG, "processHotseat", new Object[0]);
this.presenterImpl.processHotseat(hotSeatItems, workspaceItems, true);
}
}
public void refreshMeetingModeWorkArea(final boolean z, final String str) {
this.isMeetingModeIsShowUser = z;
this.workAreaName = str;
runOnUiThread(new Runnable() {
@Override
public final void run() {
MosLauncherActivity.this.a(z, str);
}
});
}
public void refreshWorkAreaName(final String str) {
if (this.widgetRootView == null) {
ZZLog.e(TAG, "refreshWorkAreaName widgetRootView null", new Object[0]);
} else {
runOnUiThread(new Runnable() {
@Override
public final void run() {
MosLauncherActivity.this.a(str);
}
});
}
}
@AfterPermissionGranted(125)
void sdpInit() {
if (BaseModuleManager.getInstance().getSdpLoginPluginModule() != null) {
BaseModuleManager.getInstance().getSdpLoginPluginModule().sdpInit(this, false);
}
}
@Override
public HashMap<String, Integer> setIndicatorNumber() {
AllAloneAppMessageInfo readAppMessagesSync;
HashMap<String, Integer> hashMap = new HashMap<>();
if (CommGlobal.canUse(this) && ModuleManager.getInstance().getGetLatestAppMessagesModule() != null && (readAppMessagesSync = ModuleManager.getInstance().getGetLatestAppMessagesModule().readAppMessagesSync()) != null && readAppMessagesSync.getAloneAppMessageInfoList() != null) {
for (AloneAppMessageInfo aloneAppMessageInfo : readAppMessagesSync.getAloneAppMessageInfoList()) {
String pkgName = aloneAppMessageInfo.getPkgName();
if (!StringUtils.areNotEmpty(pkgName) || !pkgName.equalsIgnoreCase("mcm")) {
ZZLog.d(TAG, "setIndicatorNumber pkgName=" + aloneAppMessageInfo.getPkgName() + " Unread=" + aloneAppMessageInfo.getUnread(), new Object[0]);
hashMap.put(pkgName, Integer.valueOf(aloneAppMessageInfo.getUnread()));
}
}
}
return hashMap;
}
@Override
public void setListener() {
}
@Override
public void show(boolean z) {
MosLauncherPresenterImpl mosLauncherPresenterImpl = this.presenterImpl;
if (mosLauncherPresenterImpl != null) {
mosLauncherPresenterImpl.setEnableShowDialog(z);
if (this.presenterImpl.isEnableShowDialog()) {
this.presenterImpl.showTopDialog();
}
}
}
@Override
public void showProgressBar() {
}
@Override
public void showToast(String str) {
}
public void updateAppIconIndicator(String str, int i) {
if (getModel() != null) {
updateIconIndicator(str, i);
}
}
public void updateMosAppIcon(String str, Bitmap bitmap, String str2) {
if ((CommGlobal.enableCloudPhoneLoading && StringUtils.areNotEmpty(str) && CommGlobal.cloudPhonePkgname.equals(str)) || getModel() == null) {
return;
}
updateAppIcon(str, bitmap, str2);
}
public void updateMosIconIndicator(String str, int i) {
if ((CommGlobal.enableCloudPhoneLoading && StringUtils.areNotEmpty(str) && CommGlobal.cloudPhonePkgname.equals(str)) || getModel() == null) {
return;
}
setIconIndicatorByAction(str, i);
}
public void updateMosIconProgress(String str, int i, boolean z) {
if (getModel() == null) {
return;
}
if (CommGlobal.enableCloudPhoneLoading && StringUtils.areNotEmpty(str) && CommGlobal.cloudPhonePkgname.equals(str)) {
return;
}
if (i == -1) {
updateIconProgress(str, i, z);
}
MosAppInfo queryInfoByPkgName = MosAppManagerTools.getInstance().queryInfoByPkgName(str);
if (queryInfoByPkgName == null || !ModuleManager.getInstance().getH5Module().isPkgInstalled(queryInfoByPkgName.getPkgName(), queryInfoByPkgName.getPlatform())) {
if (z) {
updateIconProgress(str, i, z);
} else if (this.onPause) {
} else {
updateIconProgress(str, i, z);
}
}
}
@n(sticky = true, threadMode = ThreadMode.MAIN)
public void onMessageEventMainThread(StartUninstallAppActivityEvent startUninstallAppActivityEvent) {
ZZLog.e(TAG, "onMessageEventMainThread ===", new Object[0]);
Intent intent = new Intent(this, UninstallBlackAppActivity.class);
intent.setFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
startActivity(intent);
}
public void a(List list) {
this.mLeftView.addAdviceApp(list);
}
public void a(String str) {
if (!PreferenceUtils.getBooleanPreference(CommGlobal.getContext(), CommGlobal.MEETING_WORKSPACE, false)) {
LauncherManager.getInstance().changeLauncherMode(CommGlobal.getContext(), false, false);
closeDrawer(2);
((TextView) this.widgetRootView.findViewById(R.id.workspace_title)).setVisibility(8);
((TextView) this.widgetRootView.findViewById(R.id.workspace_title_user)).setVisibility(8);
TextClock textClock = (TextClock) this.widgetRootView.findViewById(R.id.uu_mos_textClock);
TextView textView = (TextView) this.widgetRootView.findViewById(R.id.uu_mos_text_date_clock);
TextView textView2 = (TextView) this.widgetRootView.findViewById(R.id.uu_mos_info_view);
View view = this.widgetRootView;
if (view != null) {
TextView textView3 = (TextView) view.findViewById(R.id.uu_mos_info_view);
if (StringUtils.areNotEmpty(str)) {
textView3.setText(str);
} else {
textView3.setText(R.string.uu_mos_system_workspace);
}
}
if ("showall".equals(CommGlobal.desktopType)) {
textClock.setVisibility(0);
textView.setVisibility(0);
textView2.setVisibility(0);
return;
} else if ("onlydate".equals(CommGlobal.desktopType)) {
textClock.setVisibility(0);
textView.setVisibility(0);
textView2.setVisibility(8);
return;
} else if ("onlyworkspacename".equals(CommGlobal.desktopType)) {
textClock.setVisibility(8);
textView.setVisibility(8);
textView2.setVisibility(0);
return;
} else {
return;
}
}
refreshMeetingModeWorkArea(this.isMeetingModeIsShowUser, str);
}
public void a(boolean z, String str) {
LauncherManager.getInstance().changeLauncherMode(CommGlobal.getContext(), true, true);
openDrawer(2);
View view = this.widgetRootView;
if (view != null) {
TextView textView = (TextView) view.findViewById(R.id.workspace_title);
TextView textView2 = (TextView) this.widgetRootView.findViewById(R.id.workspace_title_user);
textView2.setVisibility(z ? 0 : 8);
textView2.setText(PreferenceUtils.getUserRealName(this, BaseGlobal.getMosKey()));
((TextClock) this.widgetRootView.findViewById(R.id.uu_mos_textClock)).setVisibility(0);
((TextView) this.widgetRootView.findViewById(R.id.uu_mos_text_date_clock)).setVisibility(0);
((TextView) this.widgetRootView.findViewById(R.id.uu_mos_info_view)).setVisibility(8);
if (StringUtils.areNotEmpty(str)) {
textView.setVisibility(0);
textView.setText(str);
}
}
}
public void a(Object obj) throws Exception {
if (this.presenterImpl != null) {
ZZLog.f(TAG, "initialDesktop", new Object[0]);
this.presenterImpl.initialDesktop();
}
refreshHotSeat();
}
}