导航菜单

页面标题

页面副标题

Cleaner for WhatsApp v2.9.6 - PremiumActivity.java 源代码

正在查看: Cleaner for WhatsApp v2.9.6 应用的 PremiumActivity.java JAVA 源代码文件

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


package com.lookandfeel.cleanerforwhatsapp;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.c;
import com.android.billingclient.api.e;
import com.android.billingclient.api.f;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.lookandfeel.cleanerforwhatsapp.PremiumActivity;
import com.lookandfeel.cleanerforwhatsapp.shared.AsyncTaskC0294k;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;

public class PremiumActivity extends androidx.appcompat.app.d implements J0.h, com.lookandfeel.cleanerforwhatsapp.shared.L {
    final String S = "kml_premium";
    int T;
    LinearLayout U;
    LinearLayout V;
    LinearLayout W;
    Button X;
    TextView Y;
    TextView Z;
    TextView a0;
    TextView b0;
    TextView c0;
    com.android.billingclient.api.a d0;
    com.android.billingclient.api.e e0;
    com.android.billingclient.api.e f0;
    com.android.billingclient.api.e g0;
    com.android.billingclient.api.e h0;

    class a implements J0.d {
        a() {
        }

        public void e(com.android.billingclient.api.d dVar, List list) {
            if (dVar.b() == 0) {
                Iterator it = list.iterator();
                while (it.hasNext()) {
                    com.android.billingclient.api.e eVar = (com.android.billingclient.api.e) it.next();
                    String b = eVar.b();
                    String a = eVar.a().a();
                    if ("lifetime".equals(b)) {
                        Log.v("kml_premium", "price :: " + a);
                        PremiumActivity.this.a0.setText(a);
                        PremiumActivity.this.h0 = eVar;
                    }
                }
            }
        }

        public void f(com.android.billingclient.api.d dVar, List list) {
            Iterator it;
            int i = 0;
            if (dVar.b() == 0) {
                Log.v("kml_premium", "size:" + list.size());
                Iterator it2 = list.iterator();
                double d = 0.0d;
                while (it2.hasNext()) {
                    com.android.billingclient.api.e eVar = (com.android.billingclient.api.e) it2.next();
                    String b = eVar.b();
                    String a = ((e.b) ((e.d) eVar.d().get(i)).b().a().get(i)).a();
                    Log.v("kml_premium", "sku:" + b + "-- proce:" + a);
                    if ("monthly_plan".equals(b)) {
                        Log.v("kml_premium", " " + a);
                        PremiumActivity.this.Y.setText(a);
                        d = (((double) ((e.b) ((e.d) eVar.d().get(i)).b().a().get(i)).b()) * 1.0d) / 1000000.0d;
                        PremiumActivity.this.f0 = eVar;
                    } else if ("yearly_plan".equals(b)) {
                        Log.v("kml_premium", " : " + a);
                        PremiumActivity.this.Z.setText(a);
                        it = it2;
                        double b2 = (((double) ((e.b) ((e.d) eVar.d().get(i)).b().a().get(i)).b()) * 1.0d) / 1000000.0d;
                        double d2 = 12.0d * d;
                        long j = (long) (((d2 - b2) * 100.0d) / d2);
                        Log.v("kml_premium", "prixMois:" + d + " - prixAn:" + b2 + " --> save:" + j);
                        StringBuilder sb = new StringBuilder();
                        sb.append("productDetails=");
                        sb.append(eVar);
                        Log.v("kml_premium", sb.toString());
                        ?? r2 = PremiumActivity.this;
                        r2.g0 = eVar;
                        r2.c0.setText(r2.getString(2131886433, Long.valueOf(j)));
                        ?? r22 = PremiumActivity.this;
                        r22.b0.setText(r22.getString(2131886487, a));
                        it2 = it;
                        i = 0;
                    }
                    it = it2;
                    it2 = it;
                    i = 0;
                }
                PremiumActivity.this.d0.d(com.android.billingclient.api.f.a().b(i3.n.A(f.b.a().b("lifetime").c("inapp").a())).a(), new J0.e() {
                    public final void a(com.android.billingclient.api.d dVar2, List list2) {
                        PremiumActivity.a.this.e(dVar2, list2);
                    }
                });
            }
        }

        public void a(com.android.billingclient.api.d dVar) {
            int b = dVar.b();
            if (b != 0) {
                if (b == 3) {
                    PremiumActivity.this.X.setEnabled(false);
                }
            } else {
                Log.v("kml_premium", "The billing client is ready");
                PremiumActivity.this.d0.d(com.android.billingclient.api.f.a().b(i3.n.B(f.b.a().b("monthly_plan").c("subs").a(), f.b.a().b("yearly_plan").c("subs").a())).a(), new J0.e() {
                    public final void a(com.android.billingclient.api.d dVar2, List list) {
                        PremiumActivity.a.this.f(dVar2, list);
                    }
                });
            }
        }

        public void b() {
            Log.v("kml_premium", "onBillingServiceDisconnected");
        }
    }

    private void u0() {
        com.android.billingclient.api.a a2 = com.android.billingclient.api.a.c(this).b().c(this).a();
        this.d0 = a2;
        a2.g(new a());
    }

    private void v0(final Purchase purchase) {
        if (purchase.c() == 1) {
            Log.v("kml_premium", purchase.f() + "");
            if (purchase.f()) {
                return;
            }
            this.d0.a(J0.a.b().b(purchase.d()).a(), new J0.b() {
                public final void a(com.android.billingclient.api.d dVar) {
                    PremiumActivity.this.w0(purchase, dVar);
                }
            });
        }
    }

    public void w0(Purchase purchase, com.android.billingclient.api.d dVar) {
        Log.v("kml_premium", "Acknowledge:" + purchase.f());
        Log.v("kml_premium", purchase.a());
        Log.v("kml_premium", "getproducts:" + purchase.b());
        if (!purchase.b().contains("monthly_plan") && !purchase.b().contains("yearly_plan")) {
            if (purchase.b().contains("lifetime")) {
                SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(this).edit();
                edit.putString("Premuim", "true");
                edit.putString("myFlag", "premium");
                edit.putString("myFlagType", "lifetime");
                edit.putLong("myFlagDate", Calendar.getInstance().getTimeInMillis());
                edit.apply();
                x0();
            }
            return;
        }
        try {
            JSONObject jSONObject = new JSONObject(purchase.a());
            String string = jSONObject.getString("orderId");
            String string2 = jSONObject.getString("packageName");
            String string3 = jSONObject.getString("productId");
            String string4 = jSONObject.getString("purchaseTime");
            String string5 = jSONObject.getString("purchaseState");
            String string6 = jSONObject.getString("purchaseToken");
            boolean z = jSONObject.getBoolean("autoRenewing");
            boolean z5 = jSONObject.getBoolean("acknowledged");
            HashMap hashMap = new HashMap();
            hashMap.put("orderId", string);
            hashMap.put("packageName", string2);
            hashMap.put("productId", string3);
            hashMap.put("purchaseTime", string4);
            hashMap.put("purchaseState", string5);
            hashMap.put("purchaseToken", string6);
            hashMap.put("autoRenewing", z ? "1" : "0");
            hashMap.put("acknowledged", z5 ? "1" : "0");
            try {
                new AsyncTaskC0294k(this, hashMap).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, "https://wpcleaner.lookfeel.me/setPurchaseData.php");
            } catch (JSONException e) {
                e = e;
                e.printStackTrace();
            }
        } catch (JSONException e2) {
            e = e2;
        }
    }

    private void x0() {
        finishAffinity();
        startActivity(new Intent(getApplicationContext(), (Class<?>) SplashscreenActivity.class));
    }

    public void closeActivity(View view) {
        finish();
    }

    @Override
    public void h(String str) {
        Log.v("kml_premium", "aa: " + str);
        if (str.equals("") || str.equals("300") || str.equals("400")) {
            return;
        }
        try {
            JSONObject jSONObject = new JSONObject(str);
            Log.v("kml_premium", jSONObject.getString("expiryTimeMillis") + "- autoRenewing: " + jSONObject.getString("autoRenewing") + " - paymentState:" + jSONObject.getString("paymentState"));
            if (Long.parseLong(jSONObject.getString("expiryTimeMillis")) > System.currentTimeMillis()) {
                SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(this).edit();
                edit.putString("Premuim", "true");
                edit.putString("expiryTimeMillis", jSONObject.getString("expiryTimeMillis"));
                edit.putString("autoRenewing", jSONObject.getString("autoRenewing"));
                edit.putString("paymentState", jSONObject.getString("paymentState"));
                edit.putString("myFlag", "premium");
                edit.putString("myFlagType", "subscription");
                edit.putLong("myFlagDate", Calendar.getInstance().getTimeInMillis());
                edit.apply();
                x0();
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void i(Integer num) {
    }

    protected void onCreate(Bundle bundle) {
        super/*androidx.fragment.app.k*/.onCreate(bundle);
        if (getResources().getBoolean(2131034118)) {
            setRequestedOrientation(0);
        } else {
            setRequestedOrientation(1);
        }
        setContentView(2131492894);
        this.U = (LinearLayout) findViewById(2131296698);
        this.V = (LinearLayout) findViewById(2131296699);
        this.W = (LinearLayout) findViewById(2131296700);
        this.Y = (TextView) findViewById(2131296618);
        this.Z = (TextView) findViewById(2131296938);
        this.a0 = (TextView) findViewById(2131296562);
        TextView textView = (TextView) findViewById(2131296449);
        this.b0 = textView;
        textView.setText(getString(2131886487, this.Z.getText().toString()));
        this.c0 = (TextView) findViewById(2131296749);
        Button button = (Button) findViewById(2131296823);
        this.X = button;
        button.setText(Html.fromHtml(getString(2131886458, 7)));
        this.V.setSelected(true);
        this.T = this.V.getId();
        u0();
        FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
        Bundle bundle2 = new Bundle();
        bundle2.putString("item_name", "PremiumActivity");
        firebaseAnalytics.a("select_content", bundle2);
    }

    public void r(com.android.billingclient.api.d dVar, List list) {
        int b = dVar.b();
        if (b == 0 && list != null) {
            Iterator it = list.iterator();
            while (it.hasNext()) {
                Purchase purchase = (Purchase) it.next();
                Log.v("kml_premium", "When every a new purchase is made:");
                v0(purchase);
            }
            return;
        }
        if (b == 1) {
            Log.v("kml_premium", "User Canceled" + b);
            return;
        }
        if (b != 7) {
            Log.v("kml_premium", "Other code" + b);
            return;
        }
        Log.v("kml_premium", "ALREADY OWNED" + b);
        this.X.setEnabled(false);
    }

    public void selectLayout(View view) {
        int i;
        View view2 = (View) view.getParent();
        view2.setSelected(true);
        if (view2.getId() == this.W.getId()) {
            this.X.setText(2131886238);
            this.b0.setText(2131886237);
        } else {
            if (view2.getId() == this.U.getId()) {
                this.b0.setText(getString(2131886295, this.Y.getText().toString()));
                i = 3;
            } else {
                String charSequence = this.Z.getText().toString();
                Log.v("kml_ppp", "-->" + charSequence);
                this.b0.setText(getString(2131886487, charSequence));
                i = 7;
            }
            this.X.setText(Html.fromHtml(getString(2131886458, Integer.valueOf(i))));
        }
        View findViewById = findViewById(this.T);
        if (findViewById != null && ((View) view.getParent()).getId() != this.T) {
            findViewById.setSelected(false);
        }
        this.T = ((View) view.getParent()).getId();
    }

    public void subscribeClick(View view) {
        String str;
        if (this.U.isSelected()) {
            Log.v("kml_premium", "p1:" + this.f0);
            this.e0 = this.f0;
            str = "p1";
        } else if (this.W.isSelected()) {
            Log.v("kml_premium", "p3:" + this.h0);
            this.e0 = this.h0;
            str = "p3";
        } else {
            Log.v("kml_premium", "p2:" + this.g0);
            this.e0 = this.g0;
            str = "p2";
        }
        Log.v("kml_premium", "SelectedskuDetails:" + this.e0);
        if (this.e0 != null) {
            String a2 = !str.equals("p3") ? ((e.d) this.e0.d().get(0)).a() : "";
            c.b.a a5 = c.b.a();
            a5.c(this.e0);
            if (!str.equals("p3")) {
                a5.b(a2);
            }
            this.d0.b(this, com.android.billingclient.api.c.a().b(i3.n.A(a5.a())).a());
        } else {
            com.lookandfeel.cleanerforwhatsapp.shared.N.d(getString(2131886206), view, this);
        }
        Log.v("kml_premium", "month click:0");
        Log.v("kml_premium", "selected: " + str);
    }

    @Override
    public void x(String str, String str2) {
    }
}