导航菜单

页面标题

页面副标题

Hyouka private v5.8.9 - StripeCreditActivity.java 源代码

正在查看: Hyouka private v5.8.9 应用的 StripeCreditActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.beint.project.stripe;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.beint.project.MainApplication;
import com.beint.project.core.model.http.ServiceResult;
import com.beint.project.core.services.impl.ZangiHTTPServices;
import com.beint.project.core.services.impl.ZangiNetworkService;
import com.beint.project.core.utils.ZangiStringUtils;
import com.beint.project.screens.BaseScreen;
import com.beint.project.screens.RatesFragmentActivity;
import com.beint.project.screens.settings.free.minutes.ScreenMyFreeMinutes;
import com.beint.project.screens.settings.more.settings.AboutCreditFragment;
import com.beint.project.screens.sms.AppModeNotifierActivity;
import com.stripe.android.view.CardInputWidget;
import java.util.Locale;
import z9.b;

public class StripeCreditActivity extends AppModeNotifierActivity {
    private static String TAG = "com.beint.project.stripe.StripeCreditActivity";
    private static double balancePrice = -1.0d;
    CardInputWidget ciW;
    LinearLayoutManager layoutManager;
    private Button payButton;
    private RelativeLayout progressBar;
    private ScrollView stripeScroll;
    private Toolbar toolbar;
    private TextView totalText;
    private final Integer tempid = 18766;
    private String K = null;
    private long amountCents = 0;
    private AsyncTask checkKeyTask = null;
    private AsyncTask makePaymentTask = null;
    private View.OnClickListener aboutCreditClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            BaseScreen.getScreenService().showFragment(AboutCreditFragment.class);
        }
    };
    private View.OnClickListener seeOurRatesOnClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (ZangiNetworkService.INSTANCE.isOnline()) {
                StripeCreditActivity.this.showZangiRates(Locale.getDefault().getLanguage());
            } else {
                BaseScreen.showCustomToast((Context) StripeCreditActivity.this, 2131887403);
            }
        }
    };
    private View.OnClickListener freeMinutesClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            BaseScreen.getScreenService().showFragment(ScreenMyFreeMinutes.class);
        }
    };

    private void cancelAsyncTasks() {
        AsyncTask asyncTask = this.checkKeyTask;
        if (asyncTask != null) {
            asyncTask.cancel(true);
            this.checkKeyTask = null;
        }
        AsyncTask asyncTask2 = this.makePaymentTask;
        if (asyncTask2 != null) {
            asyncTask2.cancel(true);
            this.makePaymentTask = null;
        }
    }

    public void checkCardAndAmountIsValid() {
        CardInputWidget cardInputWidget = this.ciW;
        if (cardInputWidget == null) {
            this.payButton.setEnabled(false);
            return;
        }
        b card = cardInputWidget.getCard();
        if (card == null || !card.s() || this.amountCents == 0) {
            this.payButton.setEnabled(false);
        } else {
            this.payButton.setEnabled(true);
        }
    }

    private void checkPublishKey() {
        this.checkKeyTask = new AsyncTask<Void, Boolean, ServiceResult<String>>() {
            @Override
            public ServiceResult<String> doInBackground(Void... voidArr) {
                return ZangiHTTPServices.getInstance().getStripeKey();
            }

            @Override
            public void onPostExecute(ServiceResult<String> serviceResult) {
                if (serviceResult == null) {
                    BaseScreen.showCustomToast((Context) StripeCreditActivity.this, 2131887053);
                    StripeCreditActivity.this.finishActivity();
                } else if (serviceResult.isOk()) {
                    StripeCreditActivity.this.K = (String) serviceResult.getBody();
                } else {
                    BaseScreen.showCustomToast((Context) StripeCreditActivity.this, 2131887053);
                    StripeCreditActivity.this.finishActivity();
                }
            }
        }.executeOnExecutor(MainApplication.Companion.getRequestServiceExecutor(), new Void[0]);
    }

    public void finishActivity() {
        finish();
    }

    public void hideProgressBar() {
        RelativeLayout relativeLayout = this.progressBar;
        if (relativeLayout != null) {
            relativeLayout.setVisibility(8);
        }
    }

    public void makeStripePayment(final String str, final long j) {
        this.makePaymentTask = new AsyncTask<Void, Boolean, ServiceResult<String>>() {
            @Override
            public ServiceResult<String> doInBackground(Void... voidArr) {
                return ZangiHTTPServices.getInstance().makeStripePayment(str, j);
            }

            @Override
            public void onPostExecute(ServiceResult<String> serviceResult) {
                StripeCreditActivity.this.hideProgressBar();
                if (serviceResult == null) {
                    BaseScreen.showCustomToast((Context) StripeCreditActivity.this, 2131887053);
                    return;
                }
                if (serviceResult.isOk()) {
                    StripeCreditActivity.this.finishActivity();
                } else if (ZangiStringUtils.isNullOrEmpty(serviceResult.getMessage())) {
                    BaseScreen.showCustomToast((Context) StripeCreditActivity.this, 2131887515);
                } else {
                    BaseScreen.showCustomToast((Context) StripeCreditActivity.this, serviceResult.getMessage());
                }
            }
        }.executeOnExecutor(MainApplication.Companion.getRequestServiceExecutor(), new Void[0]);
    }

    private void redirectToZangiWab() {
        startActivity(new Intent("android.intent.action.VIEW", Uri.parse(getString(2131886184))));
    }

    public void showProgressBar() {
        RelativeLayout relativeLayout = this.progressBar;
        if (relativeLayout != null) {
            relativeLayout.setVisibility(0);
        }
    }

    public void showZangiRates(String str) {
        Intent intent = new Intent((Context) this, (Class<?>) RatesFragmentActivity.class);
        intent.addFlags(268435456);
        startActivity(intent);
    }

    protected void hideKeyPad(View view) {
        InputMethodManager inputMethodManager = (InputMethodManager) getSystemService("input_method");
        if (view != null) {
            inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
        }
    }

    protected void onActivityResult(int i, int i7, Intent intent) {
        super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(i, i7, intent);
    }

    @Override
    protected void onCreate(android.os.Bundle r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.beint.project.stripe.StripeCreditActivity.onCreate(android.os.Bundle):void");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() == 16908332) {
            onBackPressed();
        }
        return super/*android.app.Activity*/.onOptionsItemSelected(menuItem);
    }

    @Override
    protected void onPause() {
        super.onPause();
        cancelAsyncTasks();
    }

    @Override
    protected void onResume() {
        super.onResume();
        checkPublishKey();
    }

    @Override
    protected void onStart() {
        super.onStart();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }
}