导航菜单

页面标题

页面副标题

SpeedCash v6.5.1482 - StrukActivity.java 源代码

正在查看: SpeedCash v6.5.1482 应用的 StrukActivity.java JAVA 源代码文件

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


package com.bm.sc.bebasbayar.ui.activity;

import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import com.bm.sc.auth.ui.BottomNavigationActivity;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.helper.Affinity;
import com.bm.sc.bebasbayar.ui.BaseActivity;
import com.bm.sc.bebasbayar.ui.activity.StrukActivity;
import com.bm.sc.bebasbayar.ui.widget.InvoiceTextView;
import com.bm.sc.util.android.Imagery;
import com.bm.sc.util.format.DateTime;

public class StrukActivity extends BaseActivity {
    public String A;
    public TextView c;
    public View d;
    public View e;
    public View f;
    public boolean g;
    public double h;
    public double i;
    public double j;
    public double k;
    public double l;
    public String m;
    public String n;
    public String o;
    public String p;
    public String q;
    public String r;
    public String s;
    public String t;
    public String u;
    public String v;
    public String w;
    public String x;
    public String y;
    public String z;

    public static Bundle getPaymentBundle(String str, String str2, String str3, double d, double d2) {
        Bundle bundle = new Bundle();
        bundle.putBoolean(PaymentActivity.KEY_IS_PAYMENT, true);
        bundle.putString(PaymentActivity.KEY_TITLE, str);
        bundle.putString(PaymentActivity.KEY_STRUK, str2);
        bundle.putString(PaymentActivity.KEY_REFF_ID, str3);
        bundle.putDouble("key:nominal", d);
        bundle.putDouble(PaymentActivity.KEY_NOMINAL_VOUCHER, d2);
        return bundle;
    }

    public void v() {
        Imagery.screenShot(this.f, this.n);
    }

    public void w() {
        Imagery.screenShot(this.f, this.n);
    }

    public void x() {
        Imagery.shareImageCache(this.f, this.n);
    }

    public void y() {
        Imagery.screenShot(this.f, this.n);
    }

    public void z() {
        Imagery.shareImageCache(this.f, this.n);
    }

    @Override
    public int getLayoutResource() {
        return R.layout.activity_struk;
    }

    @Override
    public String getWikiNameSpace() {
        return null;
    }

    @Override
    public boolean isEligibleForFavorit() {
        return false;
    }

    @Override
    public void onBackPressed() {
        Bundle bundle = new Bundle();
        bundle.putString("FromReservation", "0");
        Affinity.purge(this, BottomNavigationActivity.class, bundle);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == 2131365881) {
            Bundle bundle = new Bundle();
            bundle.putString("FromReservation", "0");
            Affinity.purge(this, BottomNavigationActivity.class, bundle);
            return;
        }
        if (view.getId() == 2131362395) {
            if (Build.VERSION.SDK_INT >= 33) {
                if (Affinity.isPermissionGranted(this, "android.permission.READ_MEDIA_IMAGES")) {
                    new Handler().postDelayed(new Runnable() {
                        @Override
                        public final void run() {
                            StrukActivity.this.v();
                        }
                    }, 500L);
                    return;
                } else {
                    ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_MEDIA_IMAGES", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 444);
                    return;
                }
            }
            if (Affinity.isPermissionGranted(this, "android.permission.READ_EXTERNAL_STORAGE") || Affinity.isPermissionGranted(this, "android.permission.WRITE_EXTERNAL_STORAGE")) {
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        StrukActivity.this.w();
                    }
                }, 500L);
                return;
            } else {
                ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 444);
                return;
            }
        }
        if (view.getId() != 2131362418) {
            super.onClick(view);
            return;
        }
        if (Build.VERSION.SDK_INT >= 33) {
            ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_MEDIA_IMAGES", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 445);
        } else if (Affinity.isPermissionGranted(this, "android.permission.READ_EXTERNAL_STORAGE") || Affinity.isPermissionGranted(this, "android.permission.WRITE_EXTERNAL_STORAGE")) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public final void run() {
                    StrukActivity.this.x();
                }
            }, 500L);
        } else {
            ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, 445);
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (bundle != null) {
            u(bundle);
        } else {
            Bundle extras = getIntent().getExtras();
            if (extras != null) {
                u(extras);
            }
        }
        this.f = findViewById(R.id.struk_container);
        ((InvoiceTextView) findViewById(R.id.tf_invoice)).setInvoice(this.r.replace("\n", "<br>"));
        this.c = (TextView) findViewById(R.id.struk_back_home);
        this.d = findViewById(R.id.btn_print);
        this.e = findViewById(R.id.btn_share);
        this.c.setOnClickListener(this);
        this.e.setOnClickListener(this);
        this.d.setOnClickListener(this);
        if (this.m.isEmpty() || this.m.equalsIgnoreCase("null")) {
            setTitle("Bukti Transfer");
        } else {
            setTitle(this.m);
        }
        DateTime.convert(this.q, "yyyyMMddHHmmss", DateTime.FORMAT_DATE_DMY_SLASH_LONG);
    }

    @Override
    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        if (i == 444 && iArr.length > 0 && iArr[0] == 0) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public final void run() {
                    StrukActivity.this.y();
                }
            }, 500L);
        }
        if (i == 445 && iArr.length > 0 && iArr[0] == 0) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public final void run() {
                    StrukActivity.this.z();
                }
            }, 500L);
        }
    }

    public void onSaveInstanceState(Bundle bundle) {
        bundle.putBoolean(PaymentActivity.KEY_IS_PAYMENT, this.g);
        bundle.putString(PaymentActivity.KEY_TITLE, this.m);
        bundle.putString(PaymentActivity.KEY_REFF_ID, this.n);
        bundle.putDouble("key:nominal", this.h);
        bundle.putString("key:product:name", "");
        bundle.putDouble("key:balance", 0.0d);
        bundle.putDouble(PaymentActivity.KEY_SUBTOTAL, 0.0d);
        bundle.putDouble(PaymentActivity.KEY_ADMIN, this.k);
        bundle.putDouble("key:nominal:total", this.l);
        bundle.putString(PaymentActivity.KEY_TRANSACTION_LABEL, "0");
        bundle.putString(PaymentActivity.KEY_DATE, "");
        bundle.putString(PaymentActivity.KEY_CUSTOMER_ID, "");
        bundle.putString(PaymentActivity.KEY_STATUS, "");
        bundle.putString(PaymentActivity.KEY_IS_PULSA, "0");
        bundle.putString(PaymentActivity.KEY_IS_SCTI, "0");
        bundle.putString(PaymentActivity.KEY_BANK_NAME, "");
        bundle.putString(PaymentActivity.KEY_BANK_ACC_NAME, "");
        bundle.putString(PaymentActivity.KEY_BANK_ACC_NUMBER, "");
        bundle.putString(PaymentActivity.KEY_ID_TUJUAN, "");
        bundle.putString(PaymentActivity.KEY_OUTLET_TUJUAN, "");
        bundle.putString(PaymentActivity.KEY_STRUK, "N/A");
        super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
    }

    public final void u(Bundle bundle) {
        this.g = bundle.getBoolean(PaymentActivity.KEY_IS_PAYMENT, this.g);
        this.m = bundle.getString(PaymentActivity.KEY_TITLE, this.m);
        this.n = bundle.getString(PaymentActivity.KEY_REFF_ID, this.n);
        this.h = bundle.getDouble("key:nominal", this.h);
        this.o = bundle.getString("key:product:name", "");
        this.i = bundle.getDouble("key:balance", 0.0d);
        this.j = bundle.getDouble(PaymentActivity.KEY_SUBTOTAL, 0.0d);
        this.k = bundle.getDouble(PaymentActivity.KEY_ADMIN, 0.0d);
        this.l = bundle.getDouble("key:nominal:total", 0.0d);
        this.p = bundle.getString(PaymentActivity.KEY_TRANSACTION_LABEL, getString(R.string.transaction_nominal_pay));
        this.q = bundle.getString(PaymentActivity.KEY_DATE);
        this.s = bundle.getString(PaymentActivity.KEY_CUSTOMER_ID);
        this.t = bundle.getString(PaymentActivity.KEY_STATUS);
        this.u = bundle.getString(PaymentActivity.KEY_IS_PULSA, "0");
        this.v = bundle.getString(PaymentActivity.KEY_IS_SCTI, "0");
        this.w = bundle.getString(PaymentActivity.KEY_BANK_NAME, "");
        this.x = bundle.getString(PaymentActivity.KEY_BANK_ACC_NAME, "");
        this.y = bundle.getString(PaymentActivity.KEY_BANK_ACC_NUMBER, "");
        this.z = bundle.getString(PaymentActivity.KEY_ID_TUJUAN, "");
        this.A = bundle.getString(PaymentActivity.KEY_OUTLET_TUJUAN, "");
        this.r = bundle.getString(PaymentActivity.KEY_STRUK, "N/A");
    }
}