正在查看: 95爱播免登录版 v3.1.9 应用的 ChangeAccountActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 95爱播免登录版 v3.1.9 应用的 ChangeAccountActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.showself.ui.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import chat.service.SJChatService;
import com.mifeng.ui.R;
import com.r.b.m;
import com.r.b.s;
import com.r.m.b.e;
import com.r.n.g;
import com.showself.domain.LoginResultInfo;
import com.showself.domain.UserAccountInfo;
import com.showself.resource.DefaultResourceProvider;
import com.showself.resource.ResourceManager;
import com.showself.show.utils.download.service.DownloadService;
import com.showself.ui.ShowSelfApp;
import com.showself.ui.activity.ChangeAccountActivity;
import com.showself.ui.juvenile.activity.JuvenileHallActivity;
import com.showself.ui.login.LoginListActivity;
import com.showself.utils.Utils;
import com.showself.utils.c0;
import com.showself.utils.k0;
import com.showself.utils.r0;
import com.showself.utils.u0;
import com.showself.view.ImmersiveStatusBar;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.greenrobot.eventbus.ThreadMode;
public class ChangeAccountActivity extends com.showself.ui.c implements View.OnClickListener, m.c {
private ImageView a;
private RecyclerView b;
private RelativeLayout c;
private ImmersiveStatusBar d;
private s f2970e;
private List<UserAccountInfo> f2971f;
private LoginResultInfo f2972g;
private int f2973h;
private int f2974i;
private String f2975j;
private String f2976k;
private String l;
private String m;
private boolean n;
private int o;
private int p;
class a implements DefaultResourceProvider.GetVersionCallBack {
final int a;
final DefaultResourceProvider b;
class C0079a implements DefaultResourceProvider.GetDataCallBack {
C0079a() {
}
public void b() {
ChangeAccountActivity.this.E();
}
@Override
public void callBackData() {
ChangeAccountActivity.this.C(new Runnable() {
@Override
public final void run() {
ChangeAccountActivity.a.C0079a.this.b();
}
});
}
}
a(int i2, DefaultResourceProvider defaultResourceProvider) {
this.a = i2;
this.b = defaultResourceProvider;
}
public void b() {
ChangeAccountActivity.this.E();
}
public void d() {
ChangeAccountActivity.this.E();
}
@Override
public void callBackVersion(int i2) {
if (i2 == -1) {
ChangeAccountActivity.this.C(new Runnable() {
@Override
public final void run() {
ChangeAccountActivity.a.this.b();
}
});
return;
}
int i3 = this.a;
if (i2 == i3) {
ChangeAccountActivity.this.C(new Runnable() {
@Override
public final void run() {
ChangeAccountActivity.a.this.d();
}
});
return;
}
if (i3 > i2) {
i3 = 0;
}
this.b.getRsData(i2, i3, new C0079a());
}
}
class b extends com.sjnet.j.b {
final Runnable a;
b(Runnable runnable) {
this.a = runnable;
}
@Override
public void e(int i2, String str, com.sjnet.j.a aVar) {
if (i2 == 0) {
boolean c = aVar.c("success");
LoginResultInfo y = r0.y(ChangeAccountActivity.this);
y.setWhiteUser(c);
r0.b(ShowSelfApp.h(), y);
c0.c();
}
this.a.run();
}
}
class c implements Runnable {
final String a;
final String b;
c(String str, String str2) {
this.a = str;
this.b = str2;
}
@Override
public void run() {
HashMap hashMap = new HashMap();
hashMap.put("account", this.a);
hashMap.put("password", this.b);
hashMap.put("roomid", 0);
com.showself.service.f fVar = new com.showself.service.f(10000, hashMap);
?? r0 = ChangeAccountActivity.this;
r0.addTask(fVar, r0);
}
}
class d implements Runnable {
final int a;
final String b;
final String c;
final String d;
d(int i2, String str, String str2, String str3) {
this.a = i2;
this.b = str;
this.c = str2;
this.d = str3;
}
@Override
public void run() {
HashMap hashMap = new HashMap();
hashMap.put("roomid", 0);
hashMap.put("type", Integer.valueOf(this.a));
hashMap.put("account", this.b);
hashMap.put("accesstoken", this.c);
hashMap.put("expiretime", Long.valueOf(Long.parseLong(this.d)));
com.showself.service.f fVar = new com.showself.service.f(1003, hashMap);
?? r0 = ChangeAccountActivity.this;
r0.addTask(fVar, r0);
}
}
static class e {
static final int[] a;
static {
int[] iArr = new int[e.a.values().length];
a = iArr;
try {
iArr[e.a.ADD_ACCOUNT.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
}
}
private void B(UserAccountInfo userAccountInfo) {
if (userAccountInfo.getLoginType() == 0) {
J(userAccountInfo.getAccount(), userAccountInfo.getPassword(), userAccountInfo.getLoginType());
} else {
K(userAccountInfo.getAccount(), userAccountInfo.getAccesstoken(), userAccountInfo.getExpiretime(), userAccountInfo.getLoginType());
}
}
public void C(Runnable runnable) {
com.sjnet.i.c.g("/v2/homepage/isGovernmentWhiteUser", new HashMap(), this).b(new b(runnable));
}
public void E() {
k0.k().d0(ResourceManager.getConstantsInt("login.visitor.enable") == 1);
if (!k0.y()) {
d.g.b.h().k(getApplicationContext());
d.c.a.n().z(ResourceManager.getServiceCenterMinUid(), ResourceManager.getServiceCenterMaxUid(), Utils.M() + System.currentTimeMillis());
d.c.a.n().A(ResourceManager.getVideoMaxDuration(), ResourceManager.getServiceCenterAvatar(), ResourceManager.getServiceCenterNickname(), ResourceManager.getEmojiJsonUrl());
startService(new Intent(getApplicationContext(), (Class<?>) SJChatService.class));
if (ResourceManager.getPreLoadEnable() && !com.r.m.d.a0.c.k()) {
startService(new Intent((Context) this, (Class<?>) DownloadService.class));
}
LoginResultInfo y = r0.y(this);
UserAccountInfo userAccountInfo = new UserAccountInfo();
userAccountInfo.setUid(y.getUserId());
userAccountInfo.setAvatar(y.getAvatar());
userAccountInfo.setUserName(y.getUserName());
userAccountInfo.setShowId(y.getShowid());
userAccountInfo.setLevelUrl(ResourceManager.getWealthUrl(y.getCredit_level()));
userAccountInfo.setLoginType(this.f2973h);
userAccountInfo.setAccount(this.f2975j);
if (this.f2973h == 0) {
userAccountInfo.setPassword(this.f2976k);
} else {
userAccountInfo.setAccesstoken(this.l);
userAccountInfo.setExpiretime(this.m);
}
if (userAccountInfo.getUid() != 0) {
r0.t0(this, userAccountInfo);
}
} else if (com.blankj.utilcode.util.m.a(SJChatService.class)) {
stopService(new Intent(getApplicationContext(), (Class<?>) SJChatService.class));
}
if (com.showself.ui.juvenile.a.c.h() && r0.y(this).getSpvswitch() == 1) {
startActivity(new Intent((Context) this, (Class<?>) JuvenileHallActivity.class));
finish();
return;
}
this.f2972g = r0.y(this);
F();
Utils.a1("切换成功");
Utils.n(this);
org.greenrobot.eventbus.c.c().k(new com.r.m.b.e(e.a.CHANGE_ACCOUNT));
}
private void F() {
List<UserAccountInfo> w = r0.w(this);
for (int i2 = 0; i2 < w.size(); i2++) {
if (w.get(i2).getUid() == this.f2972g.getUserId()) {
w.get(i2).setSelect(true);
} else {
w.get(i2).setSelect(false);
}
}
this.f2970e.f(w);
}
private void G() {
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(1);
this.b.setLayoutManager(linearLayoutManager);
}
public void I() {
F();
Utils.a1("切换成功");
}
private void J(String str, String str2, int i2) {
if (str == null || str2 == null) {
Utils.a1("账号存在异常");
return;
}
Utils.B0();
Utils.U0(this);
this.f2975j = str;
this.f2976k = str2;
this.f2973h = i2;
new Handler().postDelayed(new c(str, str2), 300L);
}
private void K(String str, String str2, String str3, int i2) {
if (str == null || str2 == null || !Utils.r0(str3)) {
Utils.a1("账号存在异常");
return;
}
Utils.B0();
Utils.U0(this);
this.f2975j = str;
this.l = str2;
this.m = str3;
this.f2973h = i2;
new Handler().postDelayed(new d(i2, str, str2, str3), 300L);
}
private void L(int i2, String str, boolean z) {
com.showself.ui.c.exit();
if (this.o < this.f2971f.size()) {
r0.i(this, this.f2971f.get(this.o).getUid());
}
Intent intent = new Intent();
intent.addFlags(268435456);
intent.setClass(this, LoginListActivity.class);
intent.putExtra("roomid", this.f2974i);
intent.putExtra("errorCode", i2);
intent.putExtra("errorMsg", str);
intent.putExtra("showBannedDialog", z);
intent.putExtra("accountLoginType", "SwitchAccount");
startActivity(intent);
finish();
}
public void D() {
DefaultResourceProvider provider = ResourceManager.getProvider();
provider.getRsVersion(new a(provider.refreshAndgetVersion(), provider));
}
@Override
public void init() {
this.f2971f = new ArrayList();
this.f2972g = r0.y(this);
this.a = (ImageView) findViewById(R.id.iv_change_account_back);
this.b = findViewById(R.id.change_account_recycler);
this.c = (RelativeLayout) findViewById(R.id.rl_change_account_add);
this.d = (ImmersiveStatusBar) findViewById(2131298726);
this.a.setOnClickListener(this);
this.c.setOnClickListener(this);
G();
s sVar = new s(this, this.f2971f);
this.f2970e = sVar;
sVar.g(this);
this.b.setAdapter(this.f2970e);
this.b.setNestedScrollingEnabled(false);
this.n = getIntent().getBooleanExtra("showAddAccount", false);
this.f2974i = getIntent().getIntExtra("roomId", 0);
this.c.setVisibility(this.n ? 0 : 8);
this.p = this.f2972g.getUserId();
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == 2131297043) {
finish();
return;
}
if (id != 2131298322) {
return;
}
g j2 = g.j();
com.r.n.d c2 = com.r.n.d.c();
c2.e("SwitchAccount");
c2.f("Account");
c2.d("Add");
c2.h(com.r.n.e.Click);
j2.u(c2.b());
startActivity(new Intent((Context) this, (Class<?>) AddAccountActivity.class));
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
org.greenrobot.eventbus.c.c().o(this);
setContentView(R.layout.activity_change_account);
u0.q(this, null);
init();
F();
u0.i(this, this.d, 2131099661, true);
}
@Override
protected void onDestroy() {
if (this.n) {
g j2 = g.j();
com.r.n.d c2 = com.r.n.d.c();
c2.e("Me");
c2.f("Setting");
c2.d("SwitchAccount");
c2.h(com.r.n.e.View);
j2.u(c2.b());
} else {
g j3 = g.j();
com.r.n.d c3 = com.r.n.d.c();
c3.e("Room");
c3.f("TreasureBox");
c3.d("SwitchAccount");
c3.h(com.r.n.e.Cancel);
j3.u(c3.b());
}
super.onDestroy();
org.greenrobot.eventbus.c.c().q(this);
}
@org.greenrobot.eventbus.m(threadMode = ThreadMode.MAIN)
public void onMainEvent(com.r.m.b.e eVar) {
if (e.a[eVar.c().ordinal()] != 1) {
return;
}
this.f2972g = r0.y(this);
C(new Runnable() {
@Override
public final void run() {
ChangeAccountActivity.this.I();
}
});
}
@Override
public void refresh(Object... objArr) {
int intValue = ((Integer) objArr[0]).intValue();
HashMap hashMap = (HashMap) objArr[1];
if (hashMap == null) {
Utils.n(this);
return;
}
String str = (String) hashMap.get(com.showself.net.e.o1);
if (intValue != 1003) {
if (intValue != 10000) {
return;
}
int intValue2 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
k0 k2 = k0.k();
k2.M(this.f2973h);
k2.K(this.f2973h, this.f2975j, this.f2976k);
if (intValue2 != 0) {
g j2 = g.j();
com.r.n.d c2 = com.r.n.d.c();
c2.e("SwitchAccount");
c2.f("Account");
c2.d("Failed");
c2.h(com.r.n.e.Click);
j2.u(c2.b());
Utils.n(this);
if (intValue2 != com.showself.net.e.S1) {
Utils.a1(str);
}
L(intValue2, str, false);
return;
}
if (hashMap.containsKey("downroom") && hashMap.get("downroom") != null) {
((Integer) hashMap.get("downroom")).intValue();
}
g j3 = g.j();
com.r.n.d c3 = com.r.n.d.c();
c3.e("SwitchAccount");
c3.f("Account");
c3.d("Success");
c3.h(com.r.n.e.Click);
c3.a("fromUid", Integer.valueOf(this.p));
c3.a("toUid", Integer.valueOf(r0.y(this).getUserId()));
j3.u(c3.b());
D();
return;
}
int intValue3 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
if (intValue3 != com.showself.net.e.m1) {
g j4 = g.j();
com.r.n.d c4 = com.r.n.d.c();
c4.e("SwitchAccount");
c4.f("Account");
c4.d("Failed");
c4.h(com.r.n.e.Click);
j4.u(c4.b());
Utils.n(this);
if (intValue3 != com.showself.net.e.S1) {
Utils.a1(str);
}
L(intValue3, str, false);
return;
}
k0 k3 = k0.k();
k3.M(this.f2973h);
if (this.f2973h == 8) {
this.f2975j = (String) k0.k().l(this.f2973h).get("account");
}
k3.L(this.f2973h, this.f2975j, this.l, this.m);
if (hashMap.containsKey("downroom") && hashMap.get("downroom") != null) {
((Integer) hashMap.get("downroom")).intValue();
}
g j5 = g.j();
com.r.n.d c5 = com.r.n.d.c();
c5.e("SwitchAccount");
c5.f("Account");
c5.d("Success");
c5.h(com.r.n.e.Click);
c5.a("fromUid", Integer.valueOf(this.p));
c5.a("toUid", Integer.valueOf(r0.y(this).getUserId()));
j5.u(c5.b());
D();
}
@Override
public void y(Object obj, int i2) {
UserAccountInfo userAccountInfo;
if (Utils.o0() || (userAccountInfo = this.f2971f.get(i2)) == null || userAccountInfo.getUid() == 0 || userAccountInfo.isSelect()) {
return;
}
this.o = i2;
B(userAccountInfo);
}
}