工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853
以下内容为反编译后的 AboutFragment.java 源代码,内容仅作参考
package com.uusafe.appsetting.fragment;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.CallSuper;
import androidx.annotation.MainThread;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.Lifecycle;
import com.uusafe.appsetting.view.LoadingDialog;
import com.uusafe.base.modulesdk.module.activity.ActivityLifeController;
import com.uusafe.base.modulesdk.module.bean.BaseBundleInfo;
import com.uusafe.base.modulesdk.module.global.CommGlobal;
import com.uusafe.base.modulesdk.module.manager.BaseModuleManager;
import com.uusafe.base.modulesdk.module.netapi.BaseApis;
import com.uusafe.base.modulesdk.module.router.ARouterConfig;
import com.uusafe.commbase.global.BaseGlobal;
import com.uusafe.data.module.event.UiEvent;
import com.uusafe.data.module.service.MosBgService;
import com.uusafe.h5app.library.H5PackageManager;
import com.uusafe.mbs.appsetting.R;
import com.uusafe.rxjava.RxBus;
import com.uusafe.uibase.dialog.CommonDialog;
import com.uusafe.uibase.event.StartFragmentEvent;
import com.uusafe.uibase.fragment.BaseFragment;
import com.uusafe.uibase.fragment.SwipeBackFragment;
import com.uusafe.uibase.manager.OpenWinManager;
import com.uusafe.utils.common.Base64Utils;
import com.uusafe.utils.common.JsonUtil;
import com.uusafe.utils.common.PreferenceUtils;
import com.uusafe.utils.common.UiUtils;
import com.uusafe.utils.common.ViewUtils;
import com.uusafe.utils.common.ZZLog;
import com.zhizhangyi.mbs.settingplugin.api.EdnConfig;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import org.json.JSONObject;
public class AboutFragment extends SwipeBackFragment {
private long[] developCount = new long[5];
private View feedbackLine;
private ImageView ivLogo;
private ImageView ivUpdateTip;
private LinearLayout llVersion;
private LoadingDialog mDialogLoading;
private CommonDialog sameVersionDialog;
private TextView tvAppName;
private TextView tvAppVersion;
private TextView tvBuildInfo;
private RelativeLayout tvComponentVerRelativeLayout;
private RelativeLayout tvDevelopRelativeLayout;
private TextView tvEmm;
private RelativeLayout tvFeedbackRelativeLayout;
private TextView tvH5;
private RelativeLayout tvLicenseRelativeLayout;
private TextView tvMagSdk;
private TextView tvMbs;
private TextView tvMbsBase;
private RelativeLayout tvQrRelativeLayout;
private TextView tvSandbox;
private RelativeLayout tvUpdateRelativeLayout;
public static AboutFragment newInstance() {
Bundle bundle = new Bundle();
AboutFragment aboutFragment = new AboutFragment();
aboutFragment.setArguments(bundle);
return aboutFragment;
}
private void showSameVersionDialog() {
if (this.sameVersionDialog == null) {
this.sameVersionDialog = new CommonDialog.Builder(getCurrentContext()).setTitleShow(false).setMessage(this.mActivity.getString(R.string.uu_mos_msg_same_version)).setCancelable(true).setNegativeBtnShow(false).setPositiveText(this.mActivity.getString(R.string.uu_mos_btn_same_version)).setPositiveListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
AboutFragment.this.a(view);
}
}).create();
}
this.sameVersionDialog.show();
}
public void a(UiEvent uiEvent) throws Exception {
int eventAction = uiEvent.getEventAction();
if (eventAction == 10004) {
ViewUtils.dismiss(this.mDialogLoading);
this.ivUpdateTip.setVisibility(8);
showSameVersionDialog();
} else if (eventAction == 10005) {
ViewUtils.dismiss(this.mDialogLoading);
UiUtils.showToast(getCurrentContext(), getString(R.string.uu_mos_msg_updating_error));
} else if (eventAction != 10011 && eventAction != 10012) {
LoadingDialog loadingDialog = this.mDialogLoading;
if (loadingDialog != null) {
ViewUtils.dismiss(loadingDialog);
}
} else {
ViewUtils.dismiss(this.mDialogLoading);
this.ivUpdateTip.setVisibility(0);
}
}
@Override
public int attachLayoutRes() {
return R.layout.uu_mos_appsetting_fragment_about;
}
@Override
public <T> com.uber.autodispose.l<T> bindLifecycle() {
return null;
}
@Override
public void closeWindow() {
AppCompatActivity appCompatActivity = this.mActivity;
if (appCompatActivity != null) {
appCompatActivity.finish();
}
}
@Override
public Context getCurrentContext() {
return this.mActivity;
}
@Override
public void initData() {
this.tvAppName.setText(this.mActivity.getString(R.string.uu_mos_app_name));
this.tvAppVersion.setText("V3.6.5.2");
this.tvMbs.setText(String.format("MBS %s %s", "3.6.5.2", 2045211033));
this.tvMbsBase.setText(String.format("MBS Base %s %s %s %s %s %s", "3.6.5", "10254", "20220121103330", "mbs-android-3.6.5", "473dd5e", "2022-01-20 17:33:00 +0800"));
this.tvSandbox.setText(String.format("Sandbox %s \nShellVersion %s \nSandbox channel %s", BaseGlobal.getInstance().getSandboxVersion(), BaseModuleManager.getInstance().getSandboxSdkModule().getShellVersion(), CommGlobal.mbsClientId));
this.tvMagSdk.setText(String.format("MAG SDK %s", BaseGlobal.getInstance().getGatewayVersion()));
this.tvH5.setText(String.format("H5 Engine %s", H5PackageManager.getVersion()));
if (BaseModuleManager.getInstance().getEmmModule() != null) {
this.tvEmm.setText(String.format("EMM SDK %s %s %s %s", BaseModuleManager.getInstance().getEmmModule().getVersion(), BaseModuleManager.getInstance().getEmmModule().getBuildConfig(), BaseModuleManager.getInstance().getEmmModule().getBuildTime(), BaseModuleManager.getInstance().getEmmModule().getBuildSerial()));
} else {
this.tvEmm.setVisibility(8);
}
if (!TextUtils.isEmpty("10254") && !TextUtils.isEmpty("473dd5e")) {
this.tvBuildInfo.setVisibility(0);
this.tvBuildInfo.setText(String.format("BuildInfo %s-%s\n%s", "10254", "473dd5e", "http://192.168.0.251:8080/job/Android_Mbs_Custom/10254/"));
}
if (PreferenceUtils.getClientUpdate(this.mActivity)) {
this.ivUpdateTip.setVisibility(0);
} else {
this.ivUpdateTip.setVisibility(8);
}
addOnDestroy(RxBus.getDefault().register(UiEvent.class, new Consumer() {
@Override
public final void accept(Object obj) {
AboutFragment.this.a((UiEvent) obj);
}
}, AndroidSchedulers.mainThread()));
}
@Override
protected void initInjector() {
}
@Override
@CallSuper
@MainThread
public void initLifecycleObserver(Lifecycle lifecycle) {
}
@Override
public void initView(Bundle bundle) {
boolean z;
boolean z2;
EdnConfig.Ui ui;
EdnConfig.Ui.About about;
EdnConfig.Project project;
EdnConfig.Project.Bonree bonree;
setTitleText(R.string.uu_mos_appsetting_about_title);
this.ivLogo = (ImageView) findViewById(R.id.uu_mos_appsetting_iv_logo);
this.ivLogo.setMaxWidth(UiUtils.getRealScreenWidth(this.mActivity));
this.tvAppName = (TextView) findViewById(R.id.uu_mos_appsetting_tv_appname);
this.tvAppVersion = (TextView) findViewById(R.id.uu_mos_appsetting_tv_appversion);
this.tvQrRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_appsetting_tv_setting_qr_code_layout);
this.tvFeedbackRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_appsetting_tv_setting_feedback_layout);
this.feedbackLine = findViewById(R.id.feedback_line);
if (CommGlobal.feedback) {
ZZLog.f(BaseFragment.TAG, "show feedback item", new Object[0]);
this.tvFeedbackRelativeLayout.setVisibility(0);
this.feedbackLine.setVisibility(0);
} else {
ZZLog.f(BaseFragment.TAG, "hide feedback item", new Object[0]);
this.tvFeedbackRelativeLayout.setVisibility(8);
this.feedbackLine.setVisibility(8);
}
this.tvUpdateRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_appsetting_tv_setting_update_layout);
this.tvLicenseRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_appsetting_tv_setting_user_license_layout);
this.tvComponentVerRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_appsetting_tv_setting_component_version_layout);
this.tvDevelopRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_appsetting_tv_setting_develop_layout);
EdnConfig ednConfig = CommGlobal.ednConfig;
if (ednConfig != null && (project = ednConfig.project) != null && (bonree = project.bonree) != null && bonree.enable) {
ViewUtils.setVisibility(false, this.tvComponentVerRelativeLayout, findViewById(R.id.uu_mos_appsetting_line_setting_component_version));
}
this.llVersion = (LinearLayout) findViewById(R.id.uu_mos_appsetting_ll_versions);
this.tvMbs = (TextView) findViewById(R.id.uu_mos_appsetting_tv_about_mbs);
this.tvMbsBase = (TextView) findViewById(R.id.uu_mos_appsetting_tv_about_mbsbase);
this.tvSandbox = (TextView) findViewById(R.id.uu_mos_appsetting_tv_about_sandbox);
this.tvMagSdk = (TextView) findViewById(R.id.uu_mos_appsetting_tv_about_mag_sdk);
this.tvH5 = (TextView) findViewById(R.id.uu_mos_appsetting_tv_h5_version);
this.tvEmm = (TextView) findViewById(R.id.uu_mos_appsetting_tv_emm_version);
this.tvBuildInfo = (TextView) findViewById(R.id.uu_mos_appsetting_tv_build_info);
this.mDialogLoading = new LoadingDialog(getCurrentContext(), true, false);
this.ivUpdateTip = (ImageView) findViewById(R.id.uu_mos_appsetting_iv_setting_update_tip);
if (CommGlobal.enableCloudPhoneLoading && !CommGlobal.allowUpgradeClient) {
this.tvUpdateRelativeLayout.setVisibility(8);
findViewById(R.id.check_version_underline).setVisibility(8);
}
EdnConfig ednConfig2 = CommGlobal.ednConfig;
if (ednConfig2 == null || (ui = ednConfig2.ui) == null || (about = ui.about) == null) {
z = true;
z2 = true;
} else {
z2 = about.license;
z = about.version;
}
if (!z2) {
ViewUtils.setVisibility(false, this.tvLicenseRelativeLayout, findViewById(R.id.uu_mos_appsetting_line_setting_user_license));
}
if (z) {
return;
}
ViewUtils.setVisibility(false, this.tvComponentVerRelativeLayout, findViewById(R.id.uu_mos_appsetting_line_setting_component_version));
}
@Override
public void onActivityCreated(@Nullable Bundle bundle) {
super.onActivityCreated(bundle);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
}
@Override
public boolean onBackPressedSupport() {
return super.onBackPressedSupport();
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.uu_mos_appsetting_tv_setting_qr_code_layout) {
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_FEATURE_APPSETTING_SHARE_ACTIVITY, new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
} else if (id == R.id.uu_mos_appsetting_tv_setting_feedback_layout) {
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_FEATURE_APPSETTING_FEEDBACK_ACTIVITY, new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
} else if (id == R.id.uu_mos_appsetting_tv_setting_update_layout) {
this.mDialogLoading.show(null);
MosBgService.startCheckClientVersion(1, this.mActivity);
} else if (id == R.id.uu_mos_appsetting_tv_setting_user_license_layout) {
if ("licenseagreement_static".equals(CommGlobal.userAgreementType)) {
BaseBundleInfo baseBundleInfo = new BaseBundleInfo();
JSONObject jSONObject = new JSONObject();
JsonUtil.putString(jSONObject, "url", "file:///android_asset/license");
baseBundleInfo.param = jSONObject.toString();
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_BIZ_H5_WEB_ACTIVITY, baseBundleInfo, ARouterConfig.OpenTarget._BLANK, -1);
return;
}
BaseBundleInfo baseBundleInfo2 = new BaseBundleInfo();
JSONObject jSONObject2 = new JSONObject();
JsonUtil.putString(jSONObject2, "url", BaseApis.getBaseUrl() + BaseApis.BASE_GETLICENSEAGREEMENTCONTENTDETAIL + "?orgCode=" + PreferenceUtils.getCompanyCode(this.mActivity, BaseGlobal.getMosKey()) + "&addr=" + Base64Utils.encode(BaseApis.getBaseUrl().getBytes()));
baseBundleInfo2.param = jSONObject2.toString();
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_BIZ_H5_WEB_ACTIVITY, baseBundleInfo2, ARouterConfig.OpenTarget._BLANK, -1);
} else if (CommGlobal.developeroptions && id == R.id.uu_mos_appsetting_iv_logo) {
long[] jArr = this.developCount;
System.arraycopy(jArr, 1, jArr, 0, jArr.length - 1);
long[] jArr2 = this.developCount;
jArr2[jArr2.length - 1] = SystemClock.uptimeMillis();
if (SystemClock.uptimeMillis() - this.developCount[0] <= 1000) {
this.llVersion.setVisibility(0);
this.tvDevelopRelativeLayout.setVisibility(0);
this.developCount = new long[5];
}
} else if (id == R.id.uu_mos_appsetting_tv_setting_develop_layout) {
if (CommGlobal.developeroptions) {
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_FEATURE_APPSETTING_DEVELOP_ACTIVITY, new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
}
} else if (id == R.id.uu_mos_appsetting_tv_setting_component_version_layout) {
OpenWinManager.startActivityRouterPath(this.mActivity, ARouterConfig.RouterPath.UUSAFE_FEATURE_APPSETTING_COMPONENT_VERSION_ACTIVITY, new BaseBundleInfo(), ARouterConfig.OpenTarget._BLANK, -1);
}
}
@Override
public void onDestroy() {
super.onDestroy();
}
@Override
public void onDestroyView() {
super.onDestroyView();
}
@Override
public void onDetach() {
super.onDetach();
}
@Override
public void onRightButtonClick(View view) {
}
@Override
public void onSupportInvisible() {
super.onSupportInvisible();
hideSoftInput();
}
@Override
protected void restoreView() {
}
@Override
public void setListener() {
this.ivLogo.setOnClickListener(this);
this.tvQrRelativeLayout.setOnClickListener(this);
this.tvFeedbackRelativeLayout.setOnClickListener(this);
this.tvUpdateRelativeLayout.setOnClickListener(this);
this.tvLicenseRelativeLayout.setOnClickListener(this);
this.tvComponentVerRelativeLayout.setOnClickListener(this);
this.tvDevelopRelativeLayout.setOnClickListener(this);
}
@org.greenrobot.eventbus.n
public void startBrother(StartFragmentEvent startFragmentEvent) {
Activity currentActivity = ActivityLifeController.currentActivity();
if (currentActivity == null || currentActivity == this.mActivity) {
if (startFragmentEvent.target == ARouterConfig.OpenTarget._SELF) {
startWithPop(startFragmentEvent.targetFragment);
} else {
start(startFragmentEvent.targetFragment);
}
}
}
public void a(View view) {
ViewUtils.dismiss(this.sameVersionDialog);
}
}