Shandong video conference v3.2.10版本的 MD5 值为:e9e908f971313b4c4bca5737f96781ef

以下内容为反编译后的 SettingActivity.java 源代码,内容仅作参考


package com.ainemo.android.activity.business;

import android.annotation.SuppressLint;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.log.L;
import android.log.LogFormData;
import android.log.upload.UploadLogUtil;
import android.log.upload.UploadType;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.text.TextUtils;
import android.utils.VersionUtil;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import cn.gov.sdongmeeting.video.R;
import com.ainemo.android.activity.BaseMobileActivity;
import com.ainemo.android.activity.MobileApplication;
import com.ainemo.android.activity.business.actions.RecommendDownloadActivity;
import com.ainemo.android.activity.business.actions.WebBusinessActivity;
import com.ainemo.android.business.DatabaseAccessor;
import com.ainemo.android.business.H5PageManager;
import com.ainemo.android.business.MakeCallManager;
import com.ainemo.android.rest.model.LoginResponse;
import com.ainemo.android.utils.CommonDef;
import com.ainemo.android.utils.NewFeatureUtils;
import com.ainemo.android.view.BadgeView;
import com.xylink.common.widget.b.j;
import com.xylink.net.manager.UrlConstants;
import e.l.c.c;
public class SettingActivity extends BaseMobileActivity {
    public static final String USER_GUIDE_URL = "http://www.xylink.com/support/tutorial#";
    private long clickCheckTime;
    private ImageView imageBackClose;
    private LinearLayout mDebugLayout;
    private Handler mHandler;
    private ImageView mNewFeatureRedtipView;
    private LinearLayout mSettingVersionLayout;
    private NewFeatureUtils newFeatureUtils;
    private String policyUri;
    private TextView tvCenterTitle;
    private UploadLogUtil uploadLogUtil;
    private boolean isShowNoNewVersionHint = false;
    private Runnable audioCfgRunnable = new Runnable() {
        @Override
        public final void run() {
            SettingActivity.this.m();
        }
    };

    private void alartServicePhone() {
        final String s = TextUtils.isEmpty("") ? com.xylink.net.manager.g.E().s() : "";
        if (s.isEmpty()) {
            s = getString(R.string.service_phone_number);
        }
        j.c d2 = new j.c().d(getString(R.string.service_phone));
        com.xylink.common.widget.b.j a = d2.a((CharSequence) (s + "\n" + getString(R.string.service_phone_time))).a(getString(R.string.service_phone_daile)).b(getString(R.string.action_cancel)).a();
        a.a(new j.d() {
            @Override
            public void onPrimaryButtonClicked(Button button) {
                try {
                    Intent intent = new Intent("android.intent.action.DIAL", Uri.parse("tel://" + s.replace("-", "")));
                    if (SettingActivity.this.getPackageManager().resolveActivity(intent, 0) != null) {
                        SettingActivity.this.startActivity(intent);
                    } else {
                        com.xylink.common.widget.c.b.b(SettingActivity.this, SettingActivity.this.getResources().getString(R.string.grant_make_call), 0);
                    }
                } catch (Exception unused) {
                    SettingActivity settingActivity = SettingActivity.this;
                    com.xylink.common.widget.c.b.b(settingActivity, settingActivity.getResources().getString(R.string.grant_make_call), 0);
                }
            }

            @Override
            public void onSecondButtonClicked(Button button) {
            }
        });
        androidx.fragment.app.m a2 = getSupportFragmentManager().a();
        a2.a(a, "Call HotLine");
        a2.f();
    }

    private void alertServiceVideo() {
        com.xylink.common.widget.b.j a = new j.c().d(getString(R.string.service_video)).a((CharSequence) getString(R.string.make_video_service, new Object[]{getString(R.string.service_video_number)})).a(getString(R.string.make_call_text)).b(getString(R.string.action_cancel)).a();
        a.a(new j.d() {
            @Override
            public void onPrimaryButtonClicked(Button button) {
                new MakeCallManager(SettingActivity.this).callWithSettings(SettingActivity.this.getString(R.string.service_video_number), false, false, false, (String) null);
            }

            @Override
            public void onSecondButtonClicked(Button button) {
            }
        });
        androidx.fragment.app.m a2 = getSupportFragmentManager().a();
        a2.a(a, "Call Video");
        a2.f();
    }

    private void checkInstallApkPermission() {
        new com.xylink.common.d.b(this).d("android.permission.REQUEST_INSTALL_PACKAGES").i(new io.reactivex.v0.c.g() {
            @Override
            public final void accept(Object obj) {
                ((Boolean) obj).booleanValue();
            }
        });
    }

    private void goToMarket() {
        try {
            startActivity(new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + getPackageName())));
        } catch (ActivityNotFoundException e2) {
            e2.printStackTrace();
        }
    }

    private void initPolicy() {
        this.policyUri = TextUtils.isEmpty("") ? com.xylink.net.manager.g.E().q() : "";
        View findViewById = findViewById(R.id.privacy_policy_line);
        TextView textView = (TextView) findViewById(R.id.setting_service_privacy);
        findViewById.setVisibility(this.policyUri == null ? 8 : 0);
        textView.setVisibility(this.policyUri != null ? 0 : 8);
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.a(view);
            }
        });
    }

    private void startWebPager(String str) {
        Intent intent = new Intent(this, WebPageActivity.class);
        intent.putExtra(WebPageActivity.KEY_URL, str);
        startActivity(intent);
    }

    private void updateNewfeature2Read() {
        this.mNewFeatureRedtipView.setVisibility(8);
        if (this.newFeatureUtils.hasNewFeature()) {
            this.newFeatureUtils.updateNewfeature2Read();
            d.a aIDLService = getAIDLService();
            if (aIDLService != null) {
                try {
                    aIDLService.t();
                } catch (RemoteException e2) {
                    e2.printStackTrace();
                }
            }
        }
    }

    public void b(View view) {
        e.l.c.b.a(this, c.a.C0);
        goToMarket();
    }

    public void c(View view) {
        startActivity(new Intent(this, DebuggingActivity.class));
    }

    public void d(View view) {
        startWebPager(TextUtils.isEmpty("") ? com.xylink.net.manager.g.E().r() : "");
    }

    public void e(View view) {
        startActivity(new Intent(this, FeedbackActivity.class));
    }

    public void f(View view) {
        this.isShowNoNewVersionHint = true;
        this.clickCheckTime = System.currentTimeMillis();
        com.xylink.common.widget.c.b.a(this, (int) R.string.string_chekc_new_version_hint, 0);
        com.ainemo.android.preferences.j.n().g(false);
        com.xylink.app.module.update.e.a((Context) this, false, true, 0, (String) null);
        L.i("sync h5 page by click new version clicked");
    }

    public void g(View view) {
        finish();
    }

    public boolean h(View view) {
        L.i("on logo long clicked");
        com.xylink.common.widget.c.b.b(this, "当前h5页面版本号:" + H5PageManager.getInstance().getCurrentVersion(), 0);
        return true;
    }

    public void i(View view) {
        updateNewfeature2Read();
        String p = com.xylink.net.manager.g.E().p();
        Intent intent = new Intent(this, WebPageActivity.class);
        intent.putExtra(WebPageActivity.KEY_URL, p);
        intent.putExtra(WebPageActivity.KEY_TITLE, getString(R.string.newfeature));
        startActivity(intent);
    }

    public void j(View view) {
        alartServicePhone();
    }

    public void k(View view) {
        alertServiceVideo();
    }

    public void l(View view) {
        String a = com.xylink.net.manager.g.E().a("", "", CommonDef.getAppVersionName(getApplicationContext()));
        Intent intent = new Intent(this, WebPageActivity.class);
        intent.putExtra(WebPageActivity.KEY_URL, a);
        startActivity(intent);
    }

    public void m() {
        android.utils.b.a();
        runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                SettingActivity.this.n();
            }
        });
    }

    public void n() {
        com.xylink.common.widget.c.b.a(this, (int) R.string.audio_debug_open_aeconfig, 0);
    }

    public void o() {
        com.xylink.common.widget.c.b.b(MobileApplication.l(), (int) R.string.string_version_newest);
        this.isShowNoNewVersionHint = false;
    }

    @Override
    @androidx.annotation.l0(api = 21)
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (Build.VERSION.SDK_INT >= 23) {
            getWindow().setStatusBarColor(getResources().getColor(R.color.WHITE));
            getWindow().getDecorView().setSystemUiVisibility(8192);
        } else {
            getWindow().clearFlags(67108864);
            getWindow().addFlags(Integer.MIN_VALUE);
            getWindow().setStatusBarColor(getResources().getColor(R.color.WHITE));
        }
        setContentView(R.layout.activity_settings);
        ImageView imageView = (ImageView) findViewById(R.id.image_back_close);
        this.imageBackClose = imageView;
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.g(view);
            }
        });
        TextView textView = (TextView) findViewById(R.id.tv_centet_title);
        this.tvCenterTitle = textView;
        textView.setText(getString(R.string.setting_label));
        this.mHandler = new Handler();
        this.newFeatureUtils = new NewFeatureUtils(this);
        setTitle(R.string.setting_label);
        this.mNewFeatureRedtipView = (ImageView) findViewById(R.id.newfeature_redtip);
        findViewById(R.id.nemo_logo).setOnTouchListener(new View.OnTouchListener() {
            long then = 0;

            @Override
            @SuppressLint({"ClickableViewAccessibility"})
            public boolean onTouch(View view, MotionEvent motionEvent) {
                LoginResponse loginResponse;
                if (motionEvent.getAction() == 0) {
                    this.then = System.currentTimeMillis();
                } else if (motionEvent.getAction() == 1 && System.currentTimeMillis() - this.then > 5000 && (loginResponse = new DatabaseAccessor().getLoginResponse()) != null && loginResponse.getUserProfile() != null && loginResponse.getUserDevice() != null && loginResponse.getUserProfile().getDisplayName() != null && loginResponse.getUserDevice().getDisplayName() != null) {
                    LogFormData logFormData = new LogFormData("from settings", loginResponse.getUserDevice().getDeviceSN(), loginResponse.getUserProfile().getId() + "", loginResponse.getUserDevice().getId() + "", loginResponse.getUserProfile().getDisplayName().replace(UrlConstants.h.a, ""), loginResponse.getUserDevice().getDisplayName().replace(UrlConstants.h.a, ""), LogFormData.LogDataType.LOG_DATA_TYPE_SERVER_USER_SUBMIT, loginResponse.getUserProfile().getCellPhone(), loginResponse.getUserProfile().getCellPhone(), com.ainemo.android.b.f5983f, Build.VERSION.SDK_INT + "", System.currentTimeMillis());
                    logFormData.setDeviceType(LogFormData.LogDeviceType.LOG_DEVICE_TYPE_APP);
                    if (SettingActivity.this.uploadLogUtil != null) {
                        SettingActivity.this.uploadLogUtil.startZipLast2Logs(logFormData);
                    }
                }
                return false;
            }
        });
        findViewById(R.id.nemo_logo).setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public final boolean onLongClick(View view) {
                return SettingActivity.this.h(view);
            }
        });
        com.xylink.app.module.update.e.a((Context) this, false, false, 0, (String) null);
        findViewById(R.id.layout_newfeature).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.i(view);
            }
        });
        findViewById(R.id.layout_service_phone).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.j(view);
            }
        });
        findViewById(R.id.layout_service_vidoe).setVisibility((com.ainemo.android.b.f5988k.equals(com.xylink.net.e.c.f()) || com.xylink.net.e.c.n.equals(com.xylink.net.e.c.f())) ? 0 : 8);
        findViewById(R.id.layout_service_vidoe).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.k(view);
            }
        });
        findViewById(R.id.layout_live_service).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.l(view);
            }
        });
        findViewById(R.id.action_item_faq).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.m(view);
            }
        });
        findViewById(R.id.action_recommend_download).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.n(view);
            }
        });
        findViewById(R.id.action_vote).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.b(view);
            }
        });
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.layout_profile_debug);
        this.mDebugLayout = linearLayout;
        linearLayout.setVisibility(8);
        this.mDebugLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.c(view);
            }
        });
        findViewById(R.id.settting_service_lisence).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.d(view);
            }
        });
        initPolicy();
        findViewById(R.id.setting_layout_feedback).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.e(view);
            }
        });
        findViewById(R.id.setting_layout_feedback).setOnTouchListener(new View.OnTouchListener() {
            long then = 0;

            @Override
            @SuppressLint({"ClickableViewAccessibility"})
            public boolean onTouch(View view, MotionEvent motionEvent) {
                if (motionEvent.getAction() == 0) {
                    this.then = System.currentTimeMillis();
                    SettingActivity.this.mHandler.postDelayed(SettingActivity.this.audioCfgRunnable, 2000L);
                    return false;
                } else if (motionEvent.getAction() == 1) {
                    if (System.currentTimeMillis() - this.then >= 2000) {
                        return true;
                    }
                    SettingActivity.this.mHandler.removeCallbacks(SettingActivity.this.audioCfgRunnable);
                    return false;
                } else {
                    return false;
                }
            }
        });
        LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.setting_version_layout);
        this.mSettingVersionLayout = linearLayout2;
        linearLayout2.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SettingActivity.this.f(view);
            }
        });
        TextView textView2 = (TextView) findViewById(R.id.setting_version_current);
        if (com.ainemo.android.preferences.j.n().j()) {
            textView2.setText("");
            BadgeView badgeView = new BadgeView((Context) this, (View) textView2, false);
            badgeView.setText("NEW");
            badgeView.setBadgePosition(5);
            badgeView.show();
        } else {
            textView2.setText(R.string.string_version_newest);
        }
        String appVersionName = VersionUtil.getAppVersionName(this);
        TextView textView3 = (TextView) findViewById(R.id.setting_version_label);
        textView3.setText(getString(R.string.string_nemo_at_home, new Object[]{appVersionName}));
        textView3.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                Intent intent = new Intent(SettingActivity.this, DebuggingActivity.class);
                intent.putExtra("isReleaseDebug", true);
                SettingActivity.this.startActivity(intent);
                return false;
            }
        });
        String s = com.xylink.net.manager.g.E().s();
        if (!android.utils.d.c(s)) {
            ((TextView) findViewById(R.id.service_number_text)).setText(s);
        }
        findViewById(R.id.action_item_faq).setVisibility(8);
        findViewById(R.id.view_server_phone_divide).setVisibility(8);
        findViewById(R.id.layout_service_phone).setVisibility(8);
        findViewById(R.id.view_video_divide).setVisibility(8);
        findViewById(R.id.layout_service_vidoe).setVisibility(8);
        findViewById(R.id.action_recommend_download).setVisibility(8);
        findViewById(R.id.action_vote).setVisibility(8);
        findViewById(R.id.ll_copyright).setVisibility(8);
        findViewById(R.id.action_vote).setVisibility(8);
        findViewById(R.id.view_share_divide).setVisibility(8);
        findViewById(R.id.layout_live_service).setVisibility(8);
        findViewById(R.id.setting_version_layout).setVisibility(8);
        findViewById(R.id.view_version_divide).setVisibility(8);
        if (!TextUtils.isEmpty("")) {
            findViewById(R.id.view_server_phone_divide).setVisibility(0);
            findViewById(R.id.layout_service_phone).setVisibility(0);
        }
        if (TextUtils.isEmpty("") && TextUtils.isEmpty("")) {
            return;
        }
        findViewById(R.id.ll_copyright).setVisibility(0);
    }

    @Override
    public void onMessage(Message message) {
        super.onMessage(message);
        if (4401 == message.what && !com.ainemo.android.preferences.j.n().j() && this.isShowNoNewVersionHint) {
            if (System.currentTimeMillis() - this.clickCheckTime < 2000) {
                new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        SettingActivity.this.o();
                    }
                }, 2000L);
                return;
            }
            com.xylink.common.widget.c.b.b(this, (int) R.string.string_version_newest);
            this.isShowNoNewVersionHint = false;
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        findViewById(R.id.policy_redtip).setVisibility(com.ainemo.android.preferences.a.s().j(com.xylink.net.manager.g.L()) ? 0 : 8);
    }

    @Override
    public void onViewAndServiceReady(d.a aVar) {
        this.uploadLogUtil = new UploadLogUtil(com.xylink.net.manager.g.E().f(), UploadType.UploadTypeLog, null);
        this.mNewFeatureRedtipView.setVisibility(this.newFeatureUtils.hasNewFeature() ? 0 : 8);
    }

    public void a(View view) {
        startWebPager(this.policyUri);
    }

    public void n(View view) {
        startActivity(new Intent(this, RecommendDownloadActivity.class));
    }

    public void m(View view) {
        Intent intent = new Intent(this, WebBusinessActivity.class);
        intent.putExtra(WebBusinessActivity.WEB_BUSINESS_URL, USER_GUIDE_URL);
        intent.putExtra("web_business_title", getString(R.string.nemo_faq));
        startActivity(intent);
    }
}