同城相亲 v1.1.1版本的 MD5 值为:007e8e047d75ee89cca348774925c94f
以下内容为反编译后的 SplashActivity.java 源代码,内容仅作参考
package com.ysxsoft.goddess.ui;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.JThirdPlatFormInterface;
import com.baidu.mapapi.SDKInitializer;
import com.tencent.bugly.Bugly;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMAuthListener;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.UMShareConfig;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ysxsoft.goddess.R;
import com.ysxsoft.goddess.api.ApiManager;
import com.ysxsoft.goddess.api.MyHttpCallback;
import com.ysxsoft.goddess.entity.Constant;
import com.ysxsoft.goddess.utils.LogUtils;
import com.ysxsoft.goddess.utils.SPUtils;
import com.ysxsoft.goddess.utils.ShareUtils;
import com.zhy.http.okhttp.OkHttpUtils;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import org.simple.eventbus.EventBus;
import org.simple.eventbus.Subscriber;
@SuppressLint({"Registered"})
public class SplashActivity extends BaseActivity {
@BindView(R.id.ll_login)
LinearLayout llLogin;
@BindView(R.id.privacy_agreement_cbx)
CheckBox mAgreementCbx;
private Dialog privacyDialog;
private boolean isClickPrivacy = true;
@SuppressLint({"HandlerLeak"})
private Handler sHandler = new Handler() {
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
SDKInitializer.initialize(SplashActivity.this.getApplicationContext());
UMConfigure.init(SplashActivity.this, 1, "");
PlatformConfig.setWeixin(Constant.APP_ID, "0ec1c887008f5b9e6cb5a6e7579a499b");
PlatformConfig.setQQZone("1109908937", "gMttfkMjWfrRjkpO");
PlatformConfig.setSinaWeibo("3095556970", "847c00f8e75c0b8a29db2e242f710600", "http://www.chinameinv.com.cn/");
UMConfigure.setLogEnabled(true);
Bugly.init(SplashActivity.this.getApplicationContext(), "491b7a0226", false);
JPushInterface.setDebugMode(false);
JPushInterface.init(SplashActivity.this);
if (TextUtils.isEmpty(ShareUtils.getTOKEN())) {
SplashActivity.this.llLogin.setVisibility(0);
return;
}
SplashActivity.this.startActivity(MainActivity.class);
SplashActivity.this.finish();
}
};
private View.OnClickListener mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.privacy_cancel_tv) {
if (SplashActivity.this.privacyDialog == null || SplashActivity.this.isFinishing()) {
return;
}
SplashActivity.this.privacyDialog.dismiss();
SplashActivity.this.finish();
} else if (id != R.id.privacy_sure_tv) {
} else {
if (SplashActivity.this.isClickPrivacy) {
SPUtils.put(SplashActivity.this.getApplicationContext(), "isAgreePrivacy", true);
SplashActivity.this.privacyDialog.dismiss();
SplashActivity.this.sHandler.sendEmptyMessageDelayed(0, 1500L);
return;
}
SplashActivity.this.showToast("请先认真阅读隐私政策和用户协议");
}
}
};
@Override
@SuppressLint({"HandlerLeak"})
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_splash);
ButterKnife.bind(this);
EventBus.getDefault().register(this);
initStatusBar(this, false);
initView();
if (!((Boolean) SPUtils.get(getApplicationContext(), "isAgreePrivacy", false)).booleanValue()) {
showPrivacyDialog();
} else {
this.sHandler.sendEmptyMessageDelayed(0, 1500L);
}
}
private void initView() {
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
spannableStringBuilder.append((CharSequence) "我已阅读并同意");
SpannableString spannableString = new SpannableString("《用户协议》");
spannableString.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
((TextView) view).setHighlightColor(SplashActivity.this.getResources().getColor(17170445));
Bundle bundle = new Bundle();
bundle.putString("title", "用户协议");
bundle.putString("url", ApiManager.USER_AGREEMENT);
SplashActivity.this.startActivity(CommonWebBrowseActivity.class, bundle);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
textPaint.setUnderlineText(false);
textPaint.setColor(SplashActivity.this.getResources().getColor(R.color.color_privacy_str_color));
}
}, 0, spannableString.length(), 33);
spannableStringBuilder.append((CharSequence) spannableString);
spannableStringBuilder.append((CharSequence) "和");
SpannableString spannableString2 = new SpannableString("《隐私政策》");
spannableString2.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
((TextView) view).setHighlightColor(SplashActivity.this.getResources().getColor(17170445));
Bundle bundle = new Bundle();
bundle.putString("title", "隐私政策");
bundle.putString("url", ApiManager.PRIVACY_POLICY);
SplashActivity.this.startActivity(CommonWebBrowseActivity.class, bundle);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
textPaint.setUnderlineText(false);
textPaint.setColor(SplashActivity.this.getResources().getColor(R.color.color_privacy_str_color));
}
}, 0, spannableString2.length(), 33);
spannableStringBuilder.append((CharSequence) spannableString2);
this.mAgreementCbx.setMovementMethod(LinkMovementMethod.getInstance());
this.mAgreementCbx.setText(spannableStringBuilder);
}
@OnClick({R.id.tv_dl, R.id.tv_zc, R.id.tv_wx})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.tv_dl) {
if (this.mAgreementCbx.isChecked()) {
startActivity(LoginActivity.class);
finish();
return;
}
showToast("请先认真阅读隐私政策和用户协议");
} else if (id == R.id.tv_wx) {
if (this.mAgreementCbx.isChecked()) {
clickThreadLoginNew();
} else {
showToast("请先认真阅读隐私政策和用户协议");
}
} else if (id != R.id.tv_zc) {
} else {
if (this.mAgreementCbx.isChecked()) {
startActivity(RegisterActivity.class);
finish();
return;
}
showToast("请先认真阅读隐私政策和用户协议");
}
}
private void clickThreadLoginNew() {
IWXAPI createWXAPI = WXAPIFactory.createWXAPI(this, Constant.APP_ID);
SendAuth.Req req = new SendAuth.Req();
req.scope = "snsapi_userinfo";
createWXAPI.sendReq(req);
}
@Override
public void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
@Subscriber(tag = "wxentry_result")
public void WxLoginResult(String str) {
threeLogin(str, "", "");
}
private void clickThreadLogin(SHARE_MEDIA share_media) {
UMShareConfig uMShareConfig = new UMShareConfig();
uMShareConfig.isNeedAuthOnGetUserInfo(true);
UMShareAPI uMShareAPI = UMShareAPI.get(this);
uMShareAPI.setShareConfig(uMShareConfig);
uMShareAPI.getPlatformInfo(this, share_media, new UMAuthListener() {
@Override
public void onStart(SHARE_MEDIA share_media2) {
LogUtils.e("onStart。。。。");
}
@Override
public void onComplete(SHARE_MEDIA share_media2, int i, Map<String, String> map) {
LogUtils.e("onComplete。。。。");
LogUtils.e(map.get("uid"));
LogUtils.e(map.get("name"));
LogUtils.e(map.get("iconurl"));
SplashActivity.this.threeLogin(map.get("uid"), map.get("name"), map.get("iconurl"));
}
@Override
public void onError(SHARE_MEDIA share_media2, int i, Throwable th) {
LogUtils.e("onError。。。。");
}
@Override
public void onCancel(SHARE_MEDIA share_media2, int i) {
LogUtils.e("onCancel。。。。");
}
});
}
public void threeLogin(String str, String str2, String str3) {
HashMap hashMap = new HashMap();
hashMap.put("code", str);
OkHttpUtils.post().url(ApiManager.THREE_LOGIN).params((Map<String, String>) hashMap).build().execute(new MyHttpCallback() {
@Override
public void onError(String str4) {
SplashActivity.this.showToast(str4);
}
@Override
public void onSuccess(JSONObject jSONObject) {
try {
ShareUtils.setTOKEN(jSONObject.getJSONObject("data").getString(JThirdPlatFormInterface.KEY_TOKEN));
SplashActivity.this.showToast("登录成功");
SplashActivity.this.startActivity(MainActivity.class);
SplashActivity.this.finish();
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
private void showPrivacyDialog() {
View inflate = LayoutInflater.from(getApplicationContext()).inflate(R.layout.dialog_privacy_agreement_layout, (ViewGroup) null);
TextView textView = (TextView) inflate.findViewById(R.id.privacy_content_tv);
((TextView) inflate.findViewById(R.id.privacy_cancel_tv)).setOnClickListener(this.mOnClickListener);
((TextView) inflate.findViewById(R.id.privacy_sure_tv)).setOnClickListener(this.mOnClickListener);
SpannableString spannableString = new SpannableString("欢迎您使用同城相亲!感谢您对同城相亲的支持和信任,我们更新了《同城相亲隐私政策》和《同城相亲用户协议》,特向您说明。我们将通过《同城相亲隐私政策》和《同城相亲用户协议》帮助您了解我们收集、使用、存储个人信息的情形。\n您可以通过阅读");
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#FF474747")), 0, spannableString.length(), 33);
SpannableString spannableString2 = new SpannableString("《同城相亲隐私政策》");
spannableString2.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
SplashActivity.this.isClickPrivacy = true;
Intent intent = new Intent();
intent.setClass(SplashActivity.this, CommonWebBrowseActivity.class);
intent.putExtra("title", "隐私政策");
intent.putExtra("url", ApiManager.PRIVACY_POLICY);
SplashActivity.this.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setColor(Color.parseColor("#FF45BCE3"));
textPaint.setUnderlineText(false);
}
}, 0, spannableString2.length(), 33);
SpannableString spannableString3 = new SpannableString("和");
spannableString3.setSpan(new ForegroundColorSpan(Color.parseColor("#FF474747")), 0, spannableString3.length(), 33);
SpannableString spannableString4 = new SpannableString("《同城相亲用户协议》");
spannableString4.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
SplashActivity.this.isClickPrivacy = true;
Intent intent = new Intent();
intent.setClass(SplashActivity.this, CommonWebBrowseActivity.class);
intent.putExtra("title", "用户协议");
intent.putExtra("url", ApiManager.USER_AGREEMENT);
SplashActivity.this.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setColor(Color.parseColor("#FF45BCE3"));
textPaint.setUnderlineText(false);
}
}, 0, spannableString4.length(), 33);
SpannableString spannableString5 = new SpannableString(",了解详细的个人信息处理规则。\n如您同意,您可以点击“同意”开始接受我们的服务。");
spannableString5.setSpan(new ForegroundColorSpan(Color.parseColor("#FF474747")), 0, spannableString5.length(), 33);
textView.append(spannableString);
textView.append(spannableString2);
textView.append(spannableString3);
textView.append(spannableString4);
textView.append(spannableString5);
textView.setMovementMethod(LinkMovementMethod.getInstance());
this.privacyDialog = new Dialog(this, R.style.PrivacyDialog);
this.privacyDialog.setContentView(inflate);
this.privacyDialog.setCancelable(false);
this.privacyDialog.setCanceledOnTouchOutside(false);
if (isFinishing()) {
return;
}
this.privacyDialog.show();
}
}