OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 LotteryActivity.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.nyactivitys;
import android.R;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;
import com.excelliance.kxqp.gs.dialog.ae;
import com.excelliance.kxqp.gs.dialog.f;
import com.excelliance.kxqp.gs.ui.make_money.DeepBaseActivity;
import com.excelliance.kxqp.gs.ui.nyactivitys.c;
import com.excelliance.kxqp.gs.ui.share.core.ui.WxAssistActivity;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.task.model.ShareBean;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import java.util.ArrayList;
public class LotteryActivity extends DeepBaseActivity<c.a> implements c.b {
private WebView f10697a;
private f f10698b;
private com.excelliance.kxqp.task.g.h c;
private j d;
private WebProgressBarView e;
private View f;
private BroadcastReceiver g = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent == null) {
return;
}
int intExtra = intent.getIntExtra("status_code", -1);
intent.getStringExtra("status_msg");
az.d(LotteryActivity.this.TAG, "get result from broadcast:" + intExtra);
if (intExtra == 200) {
LotteryActivity.this.f10697a.reload();
Log.d(LotteryActivity.this.TAG, "get result from broadcast: success");
cg.a(context, w.e(context, "share_success"));
((c.a) LotteryActivity.this.mPresenter).a(f.f10729a, 1);
return;
}
if (intExtra == 202) {
Log.d(LotteryActivity.this.TAG, "get result from broadcast: failed");
cg.a(context, w.e(context, "share_error"));
} else if (intExtra == 201) {
Log.d(LotteryActivity.this.TAG, "get result from broadcast: cancel");
cg.a(context, w.e(context, "cancel_auth"));
}
}
};
@Override
public String getLayoutName() {
return "activity_new_year_lottery";
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
registerReceiver(this.g, new IntentFilter(WxAssistActivity.ACTION_RESULT));
c();
}
private void c() {
IUiListener iUiListener = new IUiListener() {
@Override
public void onComplete(Object obj) {
az.d(LotteryActivity.this.TAG, "qq share onComplete: ");
cg.a(LotteryActivity.this.mContext, "分享成功!");
((c.a) LotteryActivity.this.mPresenter).a(f.f10729a, 2);
}
@Override
public void onError(UiError uiError) {
cg.a(LotteryActivity.this.mContext, "分享失败!");
az.d(LotteryActivity.this.TAG, "qq share onError: " + uiError.errorCode);
az.d(LotteryActivity.this.TAG, "qq share onError: " + uiError.errorMessage);
}
@Override
public void onCancel() {
az.d(LotteryActivity.this.TAG, "qq share onCancel: ");
cg.a(LotteryActivity.this.mContext, "分享成功!");
((c.a) LotteryActivity.this.mPresenter).a(f.f10729a, 2);
}
};
this.c = com.excelliance.kxqp.task.g.h.a(this);
this.c.a(iUiListener);
}
@Override
public c.a initPresenter() {
return new d(this.mContext, this);
}
@Override
public void initId() {
this.f10697a = (WebView) findId("webView");
this.e = (WebProgressBarView) findId("progressBar");
this.f = findId("status_bar");
this.e.setColor(Color.parseColor("#FA9B16"));
d();
}
private void d() {
WebSettings settings = this.f10697a.getSettings();
settings.setJavaScriptEnabled(true);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
settings.setSupportZoom(false);
settings.setBuiltInZoomControls(false);
settings.setDisplayZoomControls(true);
settings.setCacheMode(1);
settings.setAllowFileAccess(false);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setLoadsImagesAutomatically(true);
settings.setDefaultTextEncodingName("utf-8");
settings.setDomStorageEnabled(true);
if (Build.VERSION.SDK_INT >= 26) {
settings.setSafeBrowsingEnabled(false);
}
String e = e();
a(this.f10697a);
this.f10697a.removeJavascriptInterface("searchBoxJavaBridge_");
this.f10697a.removeJavascriptInterface("accessibility");
this.f10697a.removeJavascriptInterface("accessibilityTraversal");
this.f10697a.loadUrl(e);
this.f10697a.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
return super.shouldOverrideUrlLoading(webView, str);
}
});
this.f10697a.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView webView, int i) {
if (i == 100) {
LotteryActivity.this.e.setVisibility(8);
if (LotteryActivity.this.f != null) {
LotteryActivity.this.f.setVisibility(8);
return;
}
return;
}
LotteryActivity.this.e.setProgress(i);
}
@Override
public void onReceivedTitle(WebView webView, String str) {
super.onReceivedTitle(webView, str);
}
});
}
@Override
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (i == 4) {
hideKeyboard(this);
if (this.f10697a != null && this.f10697a.canGoBack()) {
this.f10697a.goBack();
return true;
}
finish();
return true;
}
return super.onKeyDown(i, keyEvent);
}
@Override
public void onDestroy() {
super.onDestroy();
if (this.g != null) {
unregisterReceiver(this.g);
}
this.c.a();
if (this.f10697a != null) {
this.f10697a.getSettings().setJavaScriptEnabled(false);
this.f10697a.clearCache(true);
this.f10697a.setWebChromeClient(null);
this.f10697a.setWebViewClient(null);
this.f10697a.setVisibility(8);
this.f10697a.removeAllViews();
this.f10697a.destroy();
this.f10697a = null;
}
}
private void a(WebView webView) {
if (this.f10698b == null) {
this.f10698b = new f(this);
if (Build.VERSION.SDK_INT > 17) {
webView.addJavascriptInterface(this.f10698b, "newYearInterface");
}
}
}
public static void a(Context context, String str) {
Intent intent = new Intent(context, (Class<?>) LotteryActivity.class);
intent.putExtra("targetUrl", str);
context.startActivity(intent);
}
private String e() {
String stringExtra = getIntent().getStringExtra("targetUrl");
return TextUtils.isEmpty(stringExtra) ? "http://jaychuan.com/turnplate2/" : stringExtra;
}
@Override
public void onClick(int i) {
switch (i) {
case 1:
default:
return;
case 2:
a(this.mContext, "http://ourplay.com.cn/");
return;
}
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
Log.d("onActivityResult", "requestCode:" + i + " resultCode:" + i2);
this.f10697a.reload();
if (i == 1) {
if (intent == null || intent.getExtras() == null) {
return;
}
String string = intent.getExtras().getString("prizeId");
if (TextUtils.isEmpty(string)) {
return;
}
((c.a) this.mPresenter).a(string);
return;
}
this.c.a(i, i2, intent);
}
@Override
public void a(boolean z, final a aVar) {
if (z) {
final i iVar = new i();
com.excelliance.kxqp.gs.dialog.f a2 = new f.b(this.mContext).c("dialog_receive_award_tips").b("炫耀一下").a("确定").a(new f.a() {
@Override
public void a(View view, Dialog dialog) {
dialog.dismiss();
view.setTag(aVar);
iVar.onClick(view);
}
}).b(new f.a() {
@Override
public void a(View view, Dialog dialog) {
dialog.dismiss();
f unused = LotteryActivity.this.f10698b;
}
}).a();
a2.show();
View b2 = a2.b();
ImageView imageView = (ImageView) com.excelliance.kxqp.ui.util.b.a("iv_icon", b2);
TextView textView = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_prize_title", b2);
TextView textView2 = (TextView) com.excelliance.kxqp.ui.util.b.a("tv_prize_desc", b2);
if (aVar.d == 4) {
textView2.setVisibility(0);
textView2.setText(String.format(w.e(this.mContext, "red_packet_desc"), aVar.c));
} else {
textView2.setVisibility(8);
}
com.bumptech.glide.i.b(this.mContext).a(aVar.f10716a).a(imageView);
textView.setText(aVar.f10717b);
}
}
public void a(String str) {
((c.a) this.mPresenter).a(str);
}
public void b() {
if (this.d == null) {
this.d = new j(this);
this.d.a(new ae.a() {
@Override
public void b(View view, int i) {
String e = w.e(LotteryActivity.this.mContext, "nyactivitys_share_title");
String e2 = w.e(LotteryActivity.this.mContext, "nyactivitys_share_content");
if (i != 2) {
if (i != 5) {
return;
}
if (!as.i(LotteryActivity.this.mContext, "com.tencent.mm")) {
cg.a(LotteryActivity.this.mContext, w.e(LotteryActivity.this.mContext, "share_sdk_not_install_wechat"));
return;
} else {
LotteryActivity.this.c.a(ShareBean.getCommonBean(e, e2, f.f10730b, BitmapFactory.decodeResource(LotteryActivity.this.mContext.getResources(), w.j(LotteryActivity.this.mContext, "icon_share"))), 1);
LotteryActivity.this.d.dismiss();
return;
}
}
if (!as.i(LotteryActivity.this.mContext, "com.tencent.mobileqq")) {
cg.a(LotteryActivity.this.mContext, w.e(LotteryActivity.this.mContext, "share_sdk_not_install_qq"));
return;
}
String a2 = com.excelliance.kxqp.gs.ui.make_money.f.a(BitmapFactory.decodeResource(LotteryActivity.this.mContext.getResources(), w.j(LotteryActivity.this.mContext, "icon_share")));
ArrayList arrayList = new ArrayList();
arrayList.add(a2);
LotteryActivity.this.c.a(ShareBean.getImageTextQQZone(e, e2, f.f10730b, arrayList));
LotteryActivity.this.d.dismiss();
}
});
}
if (this.d.isShowing()) {
return;
}
this.d.a(findViewById(R.id.content));
}
}