工作空间 v3.7.4.6版本的 MD5 值为:94c1c0052e9f2e949ae1349e6caf437b
以下内容为反编译后的 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.MainProcessModule;
import com.uusafe.base.modulesdk.module.activity.ActivityLifeController;
import com.uusafe.base.modulesdk.module.bean.BaseBundleInfo;
import com.uusafe.base.modulesdk.module.bean.GetLicenseAgreementRspBean;
import com.uusafe.base.modulesdk.module.global.CommGlobal;
import com.uusafe.base.modulesdk.module.listener.GetLicenseAgreementListener;
import com.uusafe.base.modulesdk.module.manager.BaseModuleManager;
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.SwipeBackFragment;
import com.uusafe.uibase.manager.OpenWinManager;
import com.uusafe.uibase.view.utils.SpannableUtil;
import com.uusafe.utils.common.PreferenceUtils;
import com.uusafe.utils.common.StringUtils;
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;
public class AboutFragment extends SwipeBackFragment {
private static String TAG = "AboutFragment";
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 TextView tvH5;
private RelativeLayout tvLicenseRelativeLayout;
private TextView tvMagSdk;
private TextView tvMbs;
private TextView tvMbsBase;
private RelativeLayout tvPrivacyRelativeLayout;
private RelativeLayout tvQrRelativeLayout;
private TextView tvSandbox;
private TextView tvSdpMbs;
private RelativeLayout tvUpdateRelativeLayout;
private long[] developCount = new long[5];
GetLicenseAgreementRspBean licenseAgreementRspBean = null;
private GetLicenseAgreementRspBean getAgreementRspBean() {
if (this.licenseAgreementRspBean == null) {
this.licenseAgreementRspBean = SpannableUtil.getDefaultAgreementRspBean(3);
}
return this.licenseAgreementRspBean;
}
private void initAgreement() {
GetLicenseAgreementRspBean agreementRspBean = SpannableUtil.getAgreementRspBean();
if (agreementRspBean == null) {
agreementRspBean = SpannableUtil.getDefaultAgreementRspBean(3);
}
this.licenseAgreementRspBean = agreementRspBean;
processAgreement(agreementRspBean);
}
public static AboutFragment newInstance() {
Bundle bundle = new Bundle();
AboutFragment aboutFragment = new AboutFragment();
aboutFragment.setArguments(bundle);
return aboutFragment;
}
public void processAgreement(GetLicenseAgreementRspBean getLicenseAgreementRspBean) {
boolean z;
boolean z2;
EdnConfig.Ui ui;
EdnConfig.Ui.About about;
if (getLicenseAgreementRspBean != null) {
z2 = getLicenseAgreementRspBean.getHasDetail() == 1;
z = getLicenseAgreementRspBean.getLaSecretShowType() == 1;
} else {
z = true;
z2 = true;
}
EdnConfig ednConfig = CommGlobal.ednConfig;
if (ednConfig != null && (ui = ednConfig.ui) != null && (about = ui.about) != null) {
if (!about.license) {
z2 = false;
}
if (!CommGlobal.ednConfig.ui.about.privacylicense) {
z = false;
}
}
if (z2) {
ViewUtils.setVisibility(true, this.tvLicenseRelativeLayout, findViewById(R.id.uu_mos_appsetting_line_setting_user_license));
} else {
ViewUtils.setVisibility(false, this.tvLicenseRelativeLayout, findViewById(R.id.uu_mos_appsetting_line_setting_user_license));
}
if (z) {
ViewUtils.setVisibility(true, this.tvPrivacyRelativeLayout, findViewById(R.id.uu_mos_appsetting_line_setting_user_privacy));
} else {
ViewUtils.setVisibility(false, this.tvPrivacyRelativeLayout, findViewById(R.id.uu_mos_appsetting_line_setting_user_privacy));
}
}
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.7.4.6");
if (StringUtils.areNotEmpty(BaseGlobal.SdpVersion)) {
this.tvSdpMbs.setVisibility(0);
this.tvSdpMbs.setText(String.format("SDP %s", BaseGlobal.SdpVersion));
}
this.tvMbs.setText(String.format("MBS %s %s", "3.7.4.6", 2061490498));
this.tvMbsBase.setText(String.format("MBS Base %s %s %s %s %s %s", "3.7.4", "23314", "20231206145900", "mbs-android-3.7.4", "a196f8a", "2023-12-05 17:40:38 +0800"));
if (CommGlobal.ednConfig.sandboxlibsopenSwitch) {
this.tvSandbox.setVisibility(0);
this.tvMagSdk.setVisibility(0);
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()));
} else {
this.tvSandbox.setVisibility(8);
this.tvMagSdk.setVisibility(8);
}
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()));
this.tvQrRelativeLayout.setVisibility(BaseModuleManager.getInstance().getEmmModule().isHideShareQrCode() ? 8 : 0);
} else {
this.tvEmm.setVisibility(8);
}
if (!TextUtils.isEmpty("23314") && !TextUtils.isEmpty("a196f8a")) {
this.tvBuildInfo.setVisibility(0);
this.tvBuildInfo.setText(String.format("BuildInfo %s-%s\n%s", "23314", "a196f8a", !TextUtils.isEmpty("BAA6A6A2E8FDFDB8B9A1E7E7FCA8BABBA8BAB3BCB5ABBBFCB1BDBFE8EAE2EAE2FDB8BDB0FD93BCB6A0BDBBB68D9FB0A18D91A7A1A6BDBFFDE0E1E1E3E6FD") ? CommGlobal.decryptAndHexStr2Byte("BAA6A6A2E8FDFDB8B9A1E7E7FCA8BABBA8BAB3BCB5ABBBFCB1BDBFE8EAE2EAE2FDB8BDB0FD93BCB6A0BDBBB68D9FB0A18D91A7A1A6BDBFFDE0E1E1E3E6FD") : ""));
}
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()));
if ("licenseagreement_dynamic".equals(CommGlobal.userAgreementType)) {
requestDynamicUserAgreement();
}
initAgreement();
}
@Override
protected void initInjector() {
}
@Override
@CallSuper
@MainThread
public void initLifecycleObserver(Lifecycle lifecycle) {
}
@Override
public void initView(Bundle bundle) {
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.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.tvPrivacyRelativeLayout = (RelativeLayout) findViewById(R.id.uu_mos_appsetting_tv_setting_user_privacy_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.tvSdpMbs = (TextView) findViewById(R.id.uu_mos_appsetting_tv_about_mbs_sdp);
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 || about.version) {
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_update_layout) {
this.mDialogLoading.show(null);
MosBgService.startCheckClientVersion(1, this.mActivity);
} else if (id == R.id.uu_mos_appsetting_tv_setting_user_license_layout) {
SpannableUtil.licenseAgreementClick(1, getAgreementRspBean());
} else if (id == R.id.uu_mos_appsetting_tv_setting_user_privacy_layout) {
SpannableUtil.licenseAgreementClick(2, getAgreementRspBean());
} 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();
}
public void requestDynamicUserAgreement() {
ZZLog.f(TAG, "requestDynamicUserAgreement", new Object[0]);
final Activity currentActivity = ActivityLifeController.currentActivity();
long lastLicenseTimestamp = PreferenceUtils.getLastLicenseTimestamp(currentActivity);
if (lastLicenseTimestamp <= 0) {
lastLicenseTimestamp = System.currentTimeMillis();
}
if (BaseModuleManager.getInstance().getMainProcessModule() != null) {
MainProcessModule mainProcessModule = BaseModuleManager.getInstance().getMainProcessModule();
mainProcessModule.getLicenseAgreement(lastLicenseTimestamp + "", false, new GetLicenseAgreementListener() {
@Override
public Context getCurrentContext() {
return currentActivity;
}
@Override
public void onGetLicenseAgreementError(String str) {
String str2 = AboutFragment.TAG;
ZZLog.f(str2, "onGetLicenseAgreementError: " + str, new Object[0]);
}
@Override
public void onGetLicenseAgreementSuccess(final GetLicenseAgreementRspBean getLicenseAgreementRspBean) {
ZZLog.i(AboutFragment.TAG, "onGetLicenseAgreementSuccess", new Object[0]);
if (getLicenseAgreementRspBean != null) {
ZZLog.i(AboutFragment.TAG, "onGetLicenseAgreementSuccess getLicenseAgreement not null", new Object[0]);
AboutFragment aboutFragment = AboutFragment.this;
aboutFragment.licenseAgreementRspBean = getLicenseAgreementRspBean;
aboutFragment.mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
AboutFragment.this.processAgreement(getLicenseAgreementRspBean);
}
});
SpannableUtil.saveAgreementRspBean(getLicenseAgreementRspBean);
return;
}
ZZLog.i(AboutFragment.TAG, "onGetLicenseAgreementSuccess getLicenseAgreement is null", new Object[0]);
}
});
}
}
@Override
protected void restoreView() {
}
@Override
public void setListener() {
this.ivLogo.setOnClickListener(this);
this.tvQrRelativeLayout.setOnClickListener(this);
this.tvUpdateRelativeLayout.setOnClickListener(this);
this.tvLicenseRelativeLayout.setOnClickListener(this);
this.tvPrivacyRelativeLayout.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);
}
}