千寻位置 v2.8.9版本的 MD5 值为:c028423c956e81d2a162977350c0ec2e

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


package com.qx.wz.lab.rn;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.qx.wz.base.AppToast;
import com.qx.wz.base.BaseActivity;
import com.qx.wz.lab.R;
import com.qx.wz.lab.router.provider.LabProvider;
import com.qx.wz.utils.ObjectUtil;
import com.qx.wz.utils.SharedKey;
import com.qx.wz.utils.SharedUtil;
import com.qx.wz.utils.StringUtil;
import com.qx.wz.utils.appconfig.HelperConfigKt;
import com.qx.wz.utils.router.ProviderList;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;

public class RnConfigActivity extends BaseActivity implements View.OnClickListener {
    private Button mBtJump;
    private CheckBox mCbSelAll;
    private String mContent;
    private EditText mEtContent;
    private String mRnTips;
    private TextView mTitle;
    private TextView mTvClearAll;
    private TextView mTvTips;

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.act_rn_config);
        this.mTitle = (TextView) findViewById(R.id.tv_center);
        this.mTitle.setText("RN调试面板");
        findViewById(R.id.tv_left).setOnClickListener(new View.OnClickListener() {
            @Override
            @SensorsDataInstrumented
            public void onClick(View view) {
                RnConfigActivity.this.finish();
                SensorsDataAutoTrackHelper.trackViewOnClick(view);
            }
        });
        this.mTvClearAll = (TextView) findViewById(R.id.tv_clearall);
        this.mEtContent = (EditText) findViewById(R.id.et_content);
        this.mTvTips = (TextView) findViewById(R.id.tv_tips);
        String preferStr = SharedUtil.getPreferStr(SharedKey.URL_LAB_RN_ROUTER_URL);
        if (!TextUtils.isEmpty(preferStr)) {
            this.mEtContent.setText(preferStr);
            this.mEtContent.setSelection(preferStr.length());
        }
        this.mCbSelAll = (CheckBox) findViewById(R.id.cb_sel_all);
        this.mBtJump = (Button) findViewById(R.id.bt_jump);
        this.mTvClearAll.setOnClickListener(this);
        this.mBtJump.setOnClickListener(this);
        this.mCbSelAll.setChecked(!HelperConfigKt.getHelperConfig().isRemoteDeveloper());
        this.mCbSelAll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            @SensorsDataInstrumented
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                HelperConfigKt.saveConfigRemote(!z);
                Toast.makeText(RnConfigActivity.this.getContext(), "修改配置后需要重启app", 1).show();
                SensorsDataAutoTrackHelper.trackViewOnClick(compoundButton);
            }
        });
        initialTips();
    }

    @Override
    @SensorsDataInstrumented
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.tv_clearall) {
            this.mContent = "";
            this.mEtContent.setText("");
        } else if (id == R.id.bt_jump) {
            if (ObjectUtil.nonNull(this.mEtContent) && ObjectUtil.nonNull(this.mEtContent.getText())) {
                this.mContent = this.mEtContent.getText().toString();
            }
            if (StringUtil.isNotBlank(this.mContent)) {
                SharedUtil.setPreferStr(SharedKey.URL_LAB_RN_ROUTER_URL, this.mContent);
                ((LabProvider) ARouter.getInstance().build(ProviderList.PROVIDER_LAB_RN).navigation()).routerDispatcher(this, this.mContent);
            } else {
                AppToast.showToast("路由地址不能为空!!!");
            }
        }
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
    }

    private void initialTips() {
        this.mRnTips = "使用说明:\n1.设置CodePush开关,关闭的话,则调试的是远程的代码,需要在开发机器上启动node服务;然后在路由设置中将qxdebug设置为开发机的域名/IP地址,点击跳转按钮即可\n2.CodePush开关为开启的话,也是需要设置路由的,只不过qxdebug无效,读取的仍然是本地/CodePush上最新的代码;设置好路由,点击跳转即可\n3.完整的路由示例:qxapp://rn/info?qxmodule=hybridMall&qxdebug=127.0.0.1&qxneedlogin=1&qxpage=OrderDetail&orderid=12344\"";
        this.mTvTips.setText(this.mRnTips);
    }
}