OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 ab.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.dialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.gs.bean.PermissionBean;
import com.excelliance.kxqp.gs.dialog.l;
import com.excelliance.kxqp.gs.util.az;
import com.tencent.open.SocialConstants;
import java.util.List;
public class ab extends l {
private boolean i;
private boolean j;
@Override
public int c() {
return -1;
}
@Override
public int d() {
return -1;
}
public ab(Context context, List<PermissionBean> list, l.a aVar) {
super(context, list, aVar);
this.i = false;
this.j = false;
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
@Override
public void a() {
String string;
TextView textView = (TextView) this.c.findViewById(R.id.privacy_text);
String string2 = this.f4335a.getString(R.string.privacy_protocol);
if (string2 == null) {
string2 = "《OurPlay隐私协议》";
}
String string3 = this.f4335a.getString(R.string.service_protocol);
if (string3 == null) {
string3 = "《OurPlay用户服务协议》";
}
this.j = a(this.f4335a);
if (this.j) {
string = this.f4335a.getString(R.string.protocol_string);
} else {
string = this.f4335a.getString(R.string.protocol_string_default);
}
if (string == null) {
string = "请您详细阅读并同意%1s及%2s内所有条款及内容。";
}
String format = String.format(string, string2, string3);
SpannableString spannableString = new SpannableString(format);
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(ab.this.f4335a.getPackageName(), "com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity"));
intent.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/privacy-new/");
ab.this.f4335a.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setUnderlineText(true);
textPaint.setColor(ab.this.f4335a.getResources().getColor(R.color.new_main_color));
}
};
int indexOf = format.indexOf("《");
if (indexOf >= 0 && indexOf < format.length() - 1) {
spannableString.setSpan(clickableSpan, indexOf, string2.length() + indexOf, 17);
}
ClickableSpan clickableSpan2 = new ClickableSpan() {
@Override
public void onClick(@NonNull View view) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(ab.this.f4335a.getPackageName(), "com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity"));
intent.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/html/agreement/index.html");
ab.this.f4335a.startActivity(intent);
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
super.updateDrawState(textPaint);
textPaint.setUnderlineText(true);
textPaint.setColor(ab.this.f4335a.getResources().getColor(R.color.new_main_color));
}
};
int lastIndexOf = format.lastIndexOf("《");
if (lastIndexOf >= 0 && lastIndexOf < format.length() - 1) {
spannableString.setSpan(clickableSpan2, lastIndexOf, string3.length() + lastIndexOf, 17);
}
textView.setHighlightColor(this.f4335a.getResources().getColor(android.R.color.transparent));
textView.setText(spannableString);
textView.setMovementMethod(LinkMovementMethod.getInstance());
final Button button = (Button) this.c.findViewById(R.id.btn_agree_continue);
if (button != null) {
com.excelliance.kxqp.gs.newappstore.b.c.a(button, this.f4335a.getResources().getDrawable(R.drawable.bg_custom_dialog_button2_new_store));
if (this.j) {
button.setText(this.f4335a.getString(R.string.agree_and_continue_pri));
} else {
button.setText(this.f4335a.getString(R.string.agree_and_continue));
}
}
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (ab.this.j) {
if (ab.this.i) {
ab.this.g.a(ab.this.f);
return;
}
return;
}
ab.this.g.a(ab.this.f);
}
});
CheckBox checkBox = (CheckBox) this.c.findViewById(R.id.agree_cb);
if (!this.j) {
if (checkBox != null) {
checkBox.setVisibility(8);
}
} else {
this.i = checkBox.isChecked();
if (checkBox != null) {
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
if (button != null) {
ab.this.i = z;
if (z) {
com.excelliance.kxqp.gs.newappstore.b.c.a(button, ab.this.f4335a.getResources().getDrawable(R.drawable.bg_custom_dialog_button2_new_store));
} else {
com.excelliance.kxqp.gs.newappstore.b.c.a(button, ab.this.f4335a.getResources().getDrawable(R.drawable.bg_custom_dialog_button2_dis_enable));
}
}
}
});
}
}
}
public boolean a(Context context) {
GameUtil.getIntance().q(this.f4335a);
int b2 = GameUtil.b(context);
int c = GameUtil.c(context);
az.d("PrivacyPolicyDialog", "isTargetChid MainChid:" + b2 + " subChid:" + c);
return b2 == 610022 && c == 3;
}
@Override
public void a(List<PermissionBean> list) {
this.f = list;
}
@Override
public int b() {
return R.layout.dialog_permission_privacy;
}
@Override
public Drawable h() {
return this.f4335a.getResources().getDrawable(R.color.dialog_bg_color);
}
}