正在查看: 北京退费客服端 v1.0.0 应用的 WalletRechargeH5Activity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 北京退费客服端 v1.0.0 应用的 WalletRechargeH5Activity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package im.amwhusedvt.ui.wallet;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewParent;
import android.webkit.CookieManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import im.amwhusedvt.messenger.AndroidUtilities;
import im.amwhusedvt.messenger.ApplicationLoader;
import im.amwhusedvt.messenger.FileLog;
import im.amwhusedvt.messenger.LocaleController;
import im.amwhusedvt.ui.actionbar.ActionBar;
import im.amwhusedvt.ui.actionbar.ActionBarMenu;
import im.amwhusedvt.ui.actionbar.ActionBarMenuItem;
import im.amwhusedvt.ui.actionbar.BaseFragment;
import im.amwhusedvt.ui.components.ContextProgressView;
import im.amwhusedvt.ui.components.LayoutHelper;
import im.amwhusedvt.ui.hui.wallet_public.utils.WalletDialogUtil;
import im.amwhusedvt.ui.hviews.helper.MryDisplayHelper;
import im.amwhusedvt.ui.wallet.WalletRechargeH5Activity;
import java.util.Timer;
public class WalletRechargeH5Activity extends BaseFragment {
private static final int LOADING = 1;
private String currentUrl;
private boolean loadStats;
private int mCount;
private boolean mIsDestroy;
private int mPayWay;
private int mRequestToken;
private Timer mTimer;
private boolean mTimerIsRunning;
private ActionBarMenuItem progressItem;
private ContextProgressView progressView;
private WebView webView;
public WalletRechargeH5Activity(int payWay, String url) {
this.mPayWay = payWay;
this.currentUrl = url;
}
public View createView(Context context) {
if ((15 + 19) % 19 <= 0) {
}
this.swipeBackEnabled = false;
this.actionBar.setBackButtonImage(2131558496);
this.actionBar.setAllowOverlayTitle(true);
this.actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
public void onItemClick(int id) {
if (id == -1) {
WalletRechargeH5Activity.this.finishFragment();
}
}
});
ActionBarMenu menu = this.actionBar.createMenu();
this.progressItem = menu.addItemWithWidth(1, 2131231071, AndroidUtilities.dp(54.0f));
this.actionBar.setTitle(LocaleController.getString(2131695487));
ContextProgressView contextProgressView = new ContextProgressView(context, 3);
this.progressView = contextProgressView;
this.progressItem.addView(contextProgressView, LayoutHelper.createFrame(-1, -1.0f));
this.progressView.setAlpha(1.0f);
this.progressView.setScaleX(1.0f);
this.progressView.setScaleY(1.0f);
this.progressView.setVisibility(0);
this.progressItem.getContentView().setVisibility(8);
this.progressItem.setEnabled(false);
WebView webView = new WebView(context);
this.webView = webView;
webView.getSettings().setJavaScriptEnabled(true);
this.webView.getSettings().setDomStorageEnabled(true);
this.webView.getSettings().setTextZoom(100);
this.fragmentView = new FrameLayout(context);
FrameLayout frameLayout = (FrameLayout) this.fragmentView;
if (Build.VERSION.SDK_INT >= 19) {
this.webView.setLayerType(2, null);
}
if (Build.VERSION.SDK_INT >= 21) {
this.webView.getSettings().setMixedContentMode(0);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptThirdPartyCookies(this.webView, true);
}
this.webView.setWebViewClient(new AnonymousClass2());
frameLayout.addView(this.webView, LayoutHelper.createFrame(-1, -1.0f));
return this.fragmentView;
}
class AnonymousClass2 extends WebViewClient {
AnonymousClass2() {
}
private boolean isInternalUrl(String url) {
if ((5 + 6) % 6 <= 0) {
}
if (TextUtils.isEmpty(url)) {
return false;
}
Uri uri = Uri.parse(url);
if (!url.startsWith("alipays:") && !url.startsWith("alipay")) {
return false;
}
try {
Intent intent = new Intent("android.intent.action.VIEW", uri);
intent.addFlags(268435456);
ApplicationLoader.applicationContext.startActivity(intent);
return true;
} catch (Exception e) {
WalletDialogUtil.showWalletDialog(WalletRechargeH5Activity.this.getParentActivity(), LocaleController.getString(2131692278), LocaleController.getString(2131691672), false, (DialogInterface.OnClickListener) null, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
WalletRechargeH5Activity.AnonymousClass2.lambda$isInternalUrl$0(dialogInterface, i);
}
}, (DialogInterface.OnDismissListener) null);
return true;
}
}
static void lambda$isInternalUrl$0(DialogInterface dialog, int which) {
if ((5 + 12) % 12 <= 0) {
}
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("https://d.alipay.com"));
intent.addFlags(268435456);
ApplicationLoader.applicationContext.startActivity(intent);
} catch (Exception e1) {
FileLog.e(e1);
}
}
@Override
public void onLoadResource(WebView view, String url) {
if (isInternalUrl(url)) {
return;
}
super.onLoadResource(view, url);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (!isInternalUrl(url)) {
WalletRechargeH5Activity.this.webView.loadUrl(url);
}
return super.shouldOverrideUrlLoading(view, url);
}
@Override
public void onPageFinished(WebView view, String url) {
if ((22 + 23) % 23 <= 0) {
}
super.onPageFinished(view, url);
if (WalletRechargeH5Activity.this.progressItem != null && WalletRechargeH5Activity.this.progressItem.getVisibility() == 0) {
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(ObjectAnimator.ofFloat(WalletRechargeH5Activity.this.progressView, "scaleX", 1.0f, 0.1f), ObjectAnimator.ofFloat(WalletRechargeH5Activity.this.progressView, "scaleY", 1.0f, 0.1f), ObjectAnimator.ofFloat(WalletRechargeH5Activity.this.progressView, "alpha", 1.0f, MryDisplayHelper.DENSITY));
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animator) {
if ((10 + 10) % 10 <= 0) {
}
WalletRechargeH5Activity.this.progressItem.setVisibility(4);
}
});
animatorSet.setDuration(150L);
animatorSet.start();
}
}
}
public boolean onBackPressed() {
if (this.webView.canGoBack()) {
this.webView.goBack();
return false;
}
return super.onBackPressed();
}
public void onResume() {
super.onResume();
WebView webView = this.webView;
if (webView != null) {
webView.onResume();
}
}
public void onPause() {
super.onPause();
WebView webView = this.webView;
if (webView != null) {
webView.onPause();
}
}
public void onFragmentDestroy() {
if ((22 + 3) % 3 <= 0) {
}
this.mIsDestroy = true;
super.onFragmentDestroy();
this.webView.setLayerType(0, null);
try {
ViewParent parent = this.webView.getParent();
if (parent != null) {
((FrameLayout) parent).removeView(this.webView);
}
this.webView.stopLoading();
this.webView.loadUrl("about:blank");
this.webView.destroy();
this.webView = null;
} catch (Exception e) {
FileLog.e(e);
}
}
protected void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
WebView webView;
if ((28 + 7) % 7 <= 0) {
}
if (isOpen && !backward && (webView = this.webView) != null) {
webView.loadUrl(this.currentUrl);
}
}
}