4399游戏盒 v7.2.1.31版本的 MD5 值为:951717f45e3fda95c8a358caf4ca93e1
以下内容为反编译后的 QrCodeScanActivity.java 源代码,内容仅作参考
package com.m4399.gamecenter.plugin.main.controllers.qrcode;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.BitmapFactory;
import android.graphics.PointF;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Keep;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.android.tools.r8.annotations.SynthesizedClassMap;
import com.dialog.DialogResult;
import com.dialog.c;
import com.dialog.theme.DialogOneButtonTheme;
import com.framework.config.Config;
import com.framework.net.ILoadPageEventListener;
import com.framework.rxbus.RxBus;
import com.framework.rxbus.annotation.Subscribe;
import com.framework.rxbus.annotation.Tag;
import com.framework.utils.UMengEventUtils;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.google.zxing.client.result.ResultParser;
import com.huawei.hms.framework.common.ContainerUtils;
import com.m4399.framework.BaseApplication;
import com.m4399.gamecenter.aidl.K;
import com.m4399.gamecenter.plugin.main.R;
import com.m4399.gamecenter.plugin.main.config.GameCenterConfigKey;
import com.m4399.gamecenter.plugin.main.controllers.qrcode.view.PointsOverlayView;
import com.m4399.gamecenter.plugin.main.controllers.qrcode.view.QRCodeReaderView;
import com.m4399.gamecenter.plugin.main.controllers.qrcode.view.ViewfinderView;
import com.m4399.gamecenter.plugin.main.listeners.f;
import com.m4399.gamecenter.plugin.main.manager.i.d;
import com.m4399.gamecenter.plugin.main.manager.minigame.MiniGamePluginLoaderHelper;
import com.m4399.gamecenter.plugin.main.manager.permission.StoragePermissionManager;
import com.m4399.gamecenter.plugin.main.manager.permission.a;
import com.m4399.gamecenter.plugin.main.manager.router.GameCenterRouterManager;
import com.m4399.gamecenter.plugin.main.manager.user.UserCenterManager;
import com.m4399.gamecenter.plugin.main.utils.MyLog;
import com.m4399.gamecenter.plugin.main.utils.bc;
import com.m4399.gamecenter.plugin.main.utils.bp;
import com.m4399.gamecenter.plugin.main.utils.e;
import com.m4399.gamecenter.plugin.main.widget.h;
import com.m4399.plugin.PluginConstant;
import com.m4399.plugin.PluginManager;
import com.m4399.support.controllers.BaseActivity;
import com.m4399.support.utils.ToastUtils;
import com.m4399.support.widget.dialog.CommonLoadingDialog;
import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import org.json.JSONObject;
@SynthesizedClassMap({$$Lambda$QrCodeScanActivity$a17__iVAk1NRvxaW_PGeitc5QXc.class, $$Lambda$QrCodeScanActivity$dUhBKPDMsFZvjQg3jQ91iOFiro.class})
public class QrCodeScanActivity extends BaseActivity implements View.OnClickListener, QRCodeReaderView.b {
public static String INTENT_EXTRA_QR_LOGIN_SESSION = "intent.extra.qr.login.session";
private PointsOverlayView bvK;
private String bvL;
private String bvM;
private boolean bvN;
private b bvP;
private com.m4399.gamecenter.plugin.main.controllers.qrcode.a bvQ;
private ViewfinderView bvR;
private boolean bvS;
private LinearLayout bvT;
private Collection<BarcodeFormat> bvU;
private String bvV;
private ImageView bvW;
private IntentSource bvX;
private a bvY;
private QRCodeReaderView bvZ;
private final String bvz = "gamecenter.4399.com";
private final String bvA = "a.4399.cn";
private final String bvB = "a.4399.com";
private final String bvC = "www.4399.cn";
private final String bvD = "/libao-qr-id-";
private final String bvE = "/mobile/";
private final String bvF = "/download-id-";
private final String bvG = "qrtype=activity&id=";
private final String bvH = "minigame://";
private final String bvI = "minigamedev://";
private boolean bvJ = false;
private boolean bvO = true;
@Override
public boolean getStatusBarDarkStyle() {
return false;
}
@Override
public void onCreate(Bundle bundle) {
getWindow().setFlags(1024, 1024);
getWindow().addFlags(256);
getWindow().addFlags(512);
super.onCreate(bundle);
this.bvY = new a(this);
getWindow().addFlags(128);
this.bvP = new b(this);
this.bvQ = new com.m4399.gamecenter.plugin.main.controllers.qrcode.a(this);
RxBus.register(this);
}
@Override
protected int getLayoutID() {
return R.layout.m4399_activity_qrcode_scan;
}
@Override
protected void initView(Bundle bundle) {
this.bvT = (LinearLayout) findViewById(R.id.layout_bottom);
((ImageView) findViewById(R.id.iv_album)).setOnClickListener(this);
this.bvW = (ImageView) findViewById(R.id.iv_light);
this.bvW.setOnClickListener(this);
ImageView imageView = (ImageView) findViewById(R.id.tv_my_qrcode);
imageView.setVisibility(TextUtils.isEmpty(UserCenterManager.getToken()) ? 8 : 0);
imageView.setOnClickListener(this);
findViewById(R.id.ibtn_back).setOnClickListener(this);
}
@Override
public void onResume() {
if (getWindow().getAttributes().flags != 8455552) {
getWindow().setFlags(1024, 1024);
}
super.onResume();
if (!this.bvN) {
zz();
} else {
zd();
}
zy();
}
public void zy() {
this.bvJ = false;
QRCodeReaderView qRCodeReaderView = this.bvZ;
if (qRCodeReaderView != null) {
qRCodeReaderView.startCamera();
}
PointsOverlayView pointsOverlayView = this.bvK;
if (pointsOverlayView != null) {
pointsOverlayView.setPoints(null);
}
}
private void zz() {
com.m4399.gamecenter.plugin.main.manager.permission.a.getInstance().setPermissionConfig(new a.InterfaceC0292a() {
@Override
public String getOperationTip() {
return null;
}
@Override
public String[] getPermissions() {
return new String[]{"android.permission.CAMERA"};
}
@Override
public String getDialogContent() {
return QrCodeScanActivity.this.getResources().getString(R.string.media_permission_item_desc_qrcode);
}
@Override
public String getPermissionName() {
return QrCodeScanActivity.this.getResources().getString(R.string.media_permission_item_name_camera);
}
@Override
public String getOperationText() {
return QrCodeScanActivity.this.getResources().getString(R.string.media_permissions_close);
}
@Override
public a.c getPermissionsListener() {
return new a.c() {
@Override
public void onGrantFail(boolean z, boolean z2) {
}
@Override
public void onSuccess() {
QrCodeScanActivity.this.zd();
QrCodeScanActivity.this.bvZ.tryOpenCamera();
QrCodeScanActivity.this.drawViewfinder();
}
@Override
public void showGrantMethod() {
Bundle bundle = new Bundle();
bundle.putString("intent.extra.from.key", "DownloadInstall");
bundle.putString("intent.extra.small.assistants.position", "Authorizationprocess");
GameCenterRouterManager.getInstance().openSmallAssistant(QrCodeScanActivity.this, bundle);
QrCodeScanActivity.this.finish();
}
};
}
});
if (com.m4399.gamecenter.plugin.main.manager.permission.a.getInstance().isHasAllPermissions(this)) {
zd();
} else if (this.bvO) {
this.bvO = false;
e.postDelayed(new Runnable() {
@Override
public final void run() {
QrCodeScanActivity.this.zH();
}
}, 300L);
}
}
public void zd() {
this.bvN = true;
QRCodeReaderView qRCodeReaderView = this.bvZ;
if (qRCodeReaderView != null) {
qRCodeReaderView.setIsGrantSuccess(this.bvN);
}
zD();
zE();
this.bvZ.startCamera();
com.m4399.gamecenter.plugin.main.controllers.qrcode.a aVar = this.bvQ;
if (aVar != null) {
aVar.a(this.bvZ);
}
this.bvP.onResume();
this.bvX = IntentSource.NONE;
this.bvU = null;
this.bvV = null;
if (this.bvS) {
onClick(this.bvW);
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
zD();
this.bvZ.initCameraManager();
zE();
}
@Override
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
com.m4399.gamecenter.plugin.main.manager.permission.a.getInstance().onRequestPermissionsResult(this, i, strArr, iArr);
}
public int getTopAndBottomHeight() {
return this.bvT.getHeight();
}
@Override
public void onPause() {
b bVar = this.bvP;
if (bVar != null) {
bVar.onPause();
}
com.m4399.gamecenter.plugin.main.controllers.qrcode.a aVar = this.bvQ;
if (aVar != null) {
aVar.stop();
}
QRCodeReaderView qRCodeReaderView = this.bvZ;
if (qRCodeReaderView != null) {
qRCodeReaderView.stopCamera();
}
super.onPause();
}
@Override
public void onDestroy() {
this.bvP.shutdown();
RxBus.unregister(this);
super.onDestroy();
com.m4399.gamecenter.plugin.main.manager.permission.a.getInstance().setPermissionConfig(null);
}
@Override
public boolean onKeyDown(int i, KeyEvent keyEvent) {
if (i != 4) {
if (i == 27 || i == 80 || i == 24 || i == 25) {
return true;
}
} else if (this.bvJ) {
zy();
return true;
}
return super.onKeyDown(i, keyEvent);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
if (-1 == i2) {
if (i != 101) {
if (i == 102) {
finish();
}
} else if (!TextUtils.isEmpty(this.bvL)) {
db(this.bvL);
} else if (!TextUtils.isEmpty(this.bvM)) {
zA();
}
}
super.onActivityResult(i, i2, intent);
}
private void cZ(final String str) {
new Thread(new Runnable() {
@Override
public void run() {
Result rawResult = new com.m4399.gamecenter.plugin.main.controllers.qrcode.b.a(QrCodeScanActivity.this).getRawResult(BitmapFactory.decodeFile(str));
if (rawResult != null) {
Message obtainMessage = QrCodeScanActivity.this.bvY.obtainMessage();
obtainMessage.what = 200;
obtainMessage.obj = ResultParser.parseResult(rawResult).toString();
QrCodeScanActivity.this.bvY.sendMessage(obtainMessage);
return;
}
Message obtainMessage2 = QrCodeScanActivity.this.bvY.obtainMessage();
obtainMessage2.what = 300;
QrCodeScanActivity.this.bvY.sendMessage(obtainMessage2);
}
}).start();
}
public void da(String str) {
if (TextUtils.isEmpty(str)) {
MyLog.d(this, "The scan result is null", new Object[0]);
return;
}
Log.i("QrCodeScanActivity", "=========parseResult" + str);
if (this.bvJ) {
return;
}
this.bvJ = true;
QRCodeReaderView qRCodeReaderView = this.bvZ;
if (qRCodeReaderView != null) {
qRCodeReaderView.stopCamera();
}
if (str.startsWith("minigame://")) {
dc(str);
return;
}
if (str.startsWith("minigamedev://")) {
this.bvM = str.substring(14);
if (TextUtils.isEmpty(this.bvM)) {
return;
}
zA();
return;
}
try {
URL url = new URL(str);
String host = url.getHost();
String path = url.getPath();
String ref = url.getRef();
if (str.contains("qrtype=activity&id=")) {
dd(str);
return;
}
if ("gamecenter.4399.com".equals(host)) {
S(path, str);
return;
}
if ("a.4399.cn".equals(host)) {
if (path.contains("/mobile/")) {
k(path, ref, str);
return;
} else if (path.contains("/download-id-")) {
R(path, str);
return;
} else {
dg(str);
return;
}
}
if (str.contains("://www.4399.cn/app-wap-qd-login4399.html?p=")) {
this.bvL = str.substring(str.indexOf("://www.4399.cn/app-wap-qd-login4399.html?p=") + 43);
if (TextUtils.isEmpty(this.bvL)) {
return;
}
if (!TextUtils.isEmpty(UserCenterManager.getToken())) {
db(this.bvL);
return;
} else {
GameCenterRouterManager.getInstance().openLogin(this, 101);
return;
}
}
if ("a.4399.com".equals(host)) {
if (path.contains("/download-id-")) {
R(path, str);
return;
} else {
dg(str);
return;
}
}
if ("www.4399.cn".equals(host)) {
if (path.contains("/libao-qr-id-")) {
Q(path, str);
return;
} else {
dg(str);
return;
}
}
dg(str);
} catch (MalformedURLException e) {
Log.i("QrCodeScanActivity", "=========MalformedURLException e");
e.printStackTrace();
if (TextUtils.isEmpty(str)) {
return;
}
dg(str);
}
}
private void db(String str) {
if (TextUtils.isEmpty(this.bvL) || TextUtils.isEmpty(UserCenterManager.getToken())) {
return;
}
final CommonLoadingDialog commonLoadingDialog = new CommonLoadingDialog(this);
com.m4399.gamecenter.plugin.main.providers.ah.b bVar = new com.m4399.gamecenter.plugin.main.providers.ah.b();
bVar.setSession(str);
bVar.loadData(new ILoadPageEventListener() {
@Override
public void onBefore() {
commonLoadingDialog.show("");
}
@Override
public void onSuccess() {
commonLoadingDialog.dismiss();
Bundle bundle = new Bundle();
bundle.putString(QrCodeScanActivity.INTENT_EXTRA_QR_LOGIN_SESSION, QrCodeScanActivity.this.bvL);
GameCenterRouterManager.getInstance().openQrAuthLogin(QrCodeScanActivity.this, bundle, 102);
}
@Override
public void onFailure(Throwable th, int i, String str2, int i2, JSONObject jSONObject) {
commonLoadingDialog.dismiss();
ToastUtils.showToast(QrCodeScanActivity.this, str2);
QrCodeScanActivity.this.zy();
}
});
}
private void dc(String str) {
if (TextUtils.isEmpty(str)) {
return;
}
final String replace = str.replace("minigame://", "");
UserCenterManager.checkIsLogin(this, new f<Boolean>() {
@Override
public void onChecking() {
}
@Override
public void onCheckFinish(Boolean bool, Object... objArr) {
if (bool.booleanValue()) {
Activity activity = QrCodeScanActivity.this;
if (PluginManager.getInstance().getPluginPackage(PluginConstant.PLUGIN_PACKAGE_NAME_MINIGAME) == null) {
ArrayList<Activity> cacheActivities = BaseApplication.getApplication().getCacheActivities();
if (cacheActivities.size() >= 2) {
activity = cacheActivities.get(cacheActivities.size() - 2);
}
}
MiniGamePluginLoaderHelper.openMiniGame(activity, replace);
return;
}
ToastUtils.showToast(QrCodeScanActivity.this, "请先登录!");
}
});
finish();
}
private void zA() {
if (TextUtils.isEmpty(this.bvM)) {
return;
}
UserCenterManager.checkIsLogin(this, new f<Boolean>() {
@Override
public void onChecking() {
}
@Override
public void onCheckFinish(Boolean bool, Object... objArr) {
if (bool.booleanValue()) {
Bundle bundle = new Bundle();
bundle.putString(QrCodeScanActivity.INTENT_EXTRA_QR_LOGIN_SESSION, QrCodeScanActivity.this.bvM);
GameCenterRouterManager.getInstance().openMiniGameDevAuthLogin(QrCodeScanActivity.this, bundle, 102);
return;
}
ToastUtils.showToast(QrCodeScanActivity.this, "请先登录!");
}
});
}
private void Q(String str, String str2) {
int i;
String[] split = str.split("/libao-qr-id-");
if (split.length > 1) {
String str3 = split[1];
if (str3.contains("-platform-")) {
String[] split2 = str3.split("-platform-");
if (split2.length > 1) {
String str4 = split2[0];
String str5 = split2[1];
if (str5.contains("android")) {
if (bp.isNumeric(str4)) {
i = bc.toInt(str4);
}
} else if (str5.contains("ios")) {
i = -1;
}
}
i = 0;
} else {
if (str3.contains(".")) {
String str6 = str3.split("\\.")[0];
if (bp.isNumeric(str6)) {
i = bc.toInt(str6);
}
}
i = 0;
}
if (i > 0) {
Bundle bundle = new Bundle();
bundle.putInt("intent.extra.gift.id", i);
GameCenterRouterManager.getInstance().openGiftDetail(this, bundle, new int[0]);
} else if (i < 0) {
zB();
} else {
dg(str2);
}
}
}
private void dd(String str) {
String[] split = str.split("qrtype=activity&id=");
if (split.length > 1) {
String str2 = split[1];
int i = bp.isNumeric(str2) ? bc.toInt(str2) : 0;
if (i > 0) {
Bundle bundle = new Bundle();
bundle.putInt("intent.extra.activity.id", i);
bundle.putString("intent.extra.activity.title", "");
bundle.putString("intent.extra.activity.url", str);
GameCenterRouterManager.getInstance().openActivityDetail(this, bundle);
return;
}
dg(str);
return;
}
dg(str);
}
private void R(String str, String str2) {
int i;
String[] split = str.split("/download-id-");
if (split.length > 1) {
String str3 = split[1];
if (str3.contains(".")) {
String str4 = str3.split("\\.")[0];
if (bp.isNumeric(str4)) {
i = Integer.valueOf(str4).intValue();
if (i <= 0) {
Bundle bundle = new Bundle();
bundle.putInt("intent.extra.game.id", i);
GameCenterRouterManager.getInstance().openGameDetail(this, bundle, new int[0]);
return;
}
dg(str2);
return;
}
}
}
i = 0;
if (i <= 0) {
}
}
private void S(String str, String str2) {
if (str.contains("/u/")) {
String[] split = str.split("/");
if (split.length > 3) {
String str3 = split[3];
if (bp.isNumeric(str3)) {
if (!TextUtils.isEmpty(str3)) {
com.m4399.gamecenter.plugin.main.utils.a.clearFullScreen(this);
Bundle bundle = new Bundle();
bundle.putString("intent.extra.goto.user.homepage.username", "");
bundle.putString("intent.extra.goto.user.homepage.user.ptuid", str3);
GameCenterRouterManager.getInstance().openUserHomePage(this, bundle);
return;
}
dg(str2);
return;
}
return;
}
if (split.length > 2) {
String str4 = split[2];
if (bp.isNumeric(str4)) {
if (!TextUtils.isEmpty(str4)) {
com.m4399.gamecenter.plugin.main.utils.a.clearFullScreen(this);
Bundle bundle2 = new Bundle();
bundle2.putString("intent.extra.goto.user.homepage.username", "");
bundle2.putString("intent.extra.goto.user.homepage.user.ptuid", "");
bundle2.putString("intent.extra.goto.user.homepage.user.uid.old", str4);
GameCenterRouterManager.getInstance().openUserHomePage(this, bundle2);
return;
}
dg(str2);
}
}
}
}
private void k(String str, String str2, String str3) {
int de2 = de(str);
long df = df(str2);
if (df > 0) {
Config.setValue(GameCenterConfigKey.WEB_VID, df + "");
}
if (de2 > 0) {
Bundle bundle = new Bundle();
bundle.putInt("intent.extra.game.id", de2);
GameCenterRouterManager.getInstance().openGameDetail(this, bundle, new int[0]);
return;
}
dg(str3);
}
private int de(String str) {
if (!str.contains("/mobile/")) {
return 0;
}
String[] split = str.split("/");
if (split.length <= 2) {
return 0;
}
String str2 = split[2];
if (!str2.contains(".")) {
return 0;
}
String str3 = str2.split("\\.")[0];
if (bp.isNumeric(str3)) {
return Integer.valueOf(str3).intValue();
}
return 0;
}
private long df(String str) {
if (str != null && str.contains("vid=")) {
String[] split = str.split("vid=");
if (split.length >= 2) {
String str2 = split[1];
if (str2.contains(ContainerUtils.FIELD_DELIMITER)) {
return bc.toLong(str2.split(ContainerUtils.FIELD_DELIMITER)[0]);
}
return bc.toLong(split[1]);
}
}
return 0L;
}
private void dg(final String str) {
if (str.startsWith(d.MIME_TYPE_HTTP) || str.startsWith("https://") || str.startsWith("ftp://")) {
if (!(BaseApplication.getApplication().getStartupConfig().getReleaseMode() == 1)) {
Bundle bundle = new Bundle();
bundle.putString("intent.extra.activity.url", str);
GameCenterRouterManager.getInstance().openActivitiesDetail(this, bundle, new int[0]);
return;
} else {
h hVar = new h(this);
hVar.setDialogTwoButtonTheme(R.color.media_transparent_alpha_dd, R.color.media_lv_54ba3d);
hVar.setOnDialogTwoHorizontalBtnsClickListener(new h.b() {
@Override
public void onRightBtnClick() {
QrCodeScanActivity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
}
@Override
public void onLeftBtnClick() {
QrCodeScanActivity.this.zy();
}
});
hVar.setCancelable(false);
hVar.setCanceledOnTouchOutside(false);
hVar.showDialog(getString(R.string.media_qrcode_scan_activity_open_the_link), str, getString(R.string.media_cancel), getString(R.string.media_confirm));
return;
}
}
h hVar2 = new h(this);
hVar2.setOnDialogOneButtonClickListener(new h.a() {
@Override
public void onButtonClick() {
QrCodeScanActivity.this.zy();
}
});
hVar2.setDialogOneButtonTheme(R.color.media_lv_54ba3d);
hVar2.setCancelable(false);
hVar2.setCanceledOnTouchOutside(false);
hVar2.showDialog(getString(R.string.media_qrcode_scan_activity_scan_result), str, getString(R.string.media_confirm), null);
}
private void zB() {
h hVar = new h(this);
hVar.setDialogOneButtonTheme(R.color.media_lv_54ba3d);
hVar.setOnDialogOneButtonClickListener(new h.a() {
@Override
public void onButtonClick() {
QrCodeScanActivity.this.zy();
}
});
hVar.setDialogOneButtonTheme(R.color.media_lv_54ba3d);
hVar.showDialog("", getString(R.string.media_qrcode_scan_activity_libao_platform_no_match), getString(R.string.media_confirm), "");
hVar.show();
}
public void drawViewfinder() {
this.bvR.drawViewfinder();
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.iv_album) {
zC();
return;
}
if (id == R.id.iv_light) {
QRCodeReaderView qRCodeReaderView = this.bvZ;
if (qRCodeReaderView == null) {
return;
}
if (this.bvS) {
qRCodeReaderView.setTorchEnabled(false);
this.bvS = false;
this.bvW.setImageResource(R.mipmap.m4399_png_light_nor);
} else {
qRCodeReaderView.setTorchEnabled(true);
this.bvS = true;
this.bvW.setImageResource(R.mipmap.m4399_png_light_pressed);
}
UMengEventUtils.onEvent("ad_me_scan_qrcode_photo_album", "开灯");
return;
}
if (id == R.id.tv_my_qrcode) {
ViewfinderView viewfinderView = this.bvR;
if (viewfinderView != null) {
viewfinderView.setVisibility(8);
}
GameCenterRouterManager.getInstance().openMyCard(this);
UMengEventUtils.onEvent("ad_me_scan_qrcode_photo_album", "我的二维码");
return;
}
if (id == R.id.ibtn_back) {
finish();
}
}
private void zC() {
StoragePermissionManager.INSTANCE.checkStoragePermissions(this, new StoragePermissionManager.a() {
@Override
public void onFinish(boolean z) {
if (z) {
QrCodeScanActivity.this.openAlbumList();
}
}
});
}
public void openAlbumList() {
ViewfinderView viewfinderView = this.bvR;
if (viewfinderView != null) {
viewfinderView.setVisibility(8);
}
Bundle bundle = new Bundle();
bundle.putString("intent.extra.from.key", getClass().getName());
bundle.putInt("intent.extra.max.picture.number", 1);
bundle.putInt("intent.extra.album.need.crop", 0);
GameCenterRouterManager.getInstance().openAlbumList(this, bundle);
UMengEventUtils.onEvent("ad_me_scan_qrcode_photo_album", "相册");
}
@Keep
@Subscribe(tags = {@Tag(K.rxbus.TAG_ALBUM_FINISH_SELECT)})
public void onFinishSelect(Bundle bundle) {
boolean z;
if (getClass().getName().equals(bundle.getString("intent.extra.picture.select.context.key")) && (z = bundle.getBoolean("intent.extra.picture.select.finish.status")) && z) {
ArrayList<String> stringArrayList = bundle.getStringArrayList("intent.extra.picture.select.path.array");
if (stringArrayList.size() > 0) {
cZ(stringArrayList.get(0));
}
}
}
private static class a extends Handler {
private WeakReference<QrCodeScanActivity> bwe;
public a(QrCodeScanActivity qrCodeScanActivity) {
this.bwe = new WeakReference<>(qrCodeScanActivity);
}
@Override
public void handleMessage(Message message) {
int i = message.what;
if (i == 200) {
this.bwe.get().da((String) message.obj);
} else if (i == 300) {
QrCodeScanActivity qrCodeScanActivity = this.bwe.get();
ToastUtils.showToast(qrCodeScanActivity, qrCodeScanActivity.getString(R.string.media_qrcode_scan_activity_pick_pic_failed));
}
super.handleMessage(message);
}
}
private void zD() {
this.bvZ = null;
this.bvZ = (QRCodeReaderView) findViewById(R.id.preview_view);
this.bvZ.setIsGrantSuccess(this.bvN);
this.bvZ.setAutofocusInterval(2000L);
this.bvZ.setOnQRCodeReadListener(this);
this.bvK = (PointsOverlayView) findViewById(R.id.points_overlay_view);
}
private void zE() {
this.bvR = (ViewfinderView) findViewById(R.id.capture_viewfinder_view);
this.bvR.setCameraManager(this.bvZ.getCameraManager());
this.bvR.setVisibility(0);
}
@Override
public void onQRCodeRead(String str, PointF[] pointFArr) {
this.bvP.zx();
da(str);
this.bvK.setPoints(pointFArr);
}
public void zH() {
c cVar = new c(this);
cVar.setDialogOneButtomTheme(DialogOneButtonTheme.Default);
cVar.setOnDialogOneButtonClickListener(new c.a() {
@Override
public final DialogResult onButtonClick() {
DialogResult zG;
zG = QrCodeScanActivity.this.zG();
return zG;
}
});
cVar.setCancelable(false);
cVar.setCanceledOnTouchOutside(false);
cVar.showDialog(getString(R.string.permission_apply), getString(R.string.permission_camera_apply_desc), getString(R.string.dialog_btn_txt_i_know), "");
}
public DialogResult zG() {
com.m4399.gamecenter.plugin.main.manager.permission.a.getInstance().checkPermissions(this);
return DialogResult.OK;
}
}