导航菜单

页面标题

页面副标题

Adobe Acrobat v15.3 - k.java 源代码

正在查看: Adobe Acrobat v15.3 应用的 k.java JAVA 源代码文件

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


package com.adobe.libs.services.d;

import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Handler;
import android.support.v4.content.LocalBroadcastManager;
import com.adobe.libs.buildingblocks.utils.BBFileUtils;
import com.adobe.libs.services.af;
import com.adobe.libs.services.ag;
import com.adobe.reader.analytics.ARDCMAnalytics;
import com.adobe.reader.filebrowser.ARFileEntry;
import com.adobe.reader.services.auth.ARServicesAccount;
import com.android.vending.billing.SkuDetails;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

public class k extends com.adobe.libs.services.n {
    static final boolean k;
    BroadcastReceiver h;
    BroadcastReceiver i;
    BroadcastReceiver j;
    private String l;
    private AlertDialog m;
    private AlertDialog n;
    private Handler o;
    private boolean p;
    private ArrayList<SkuDetails> q;

    static {
        k = !k.class.desiredAssertionStatus();
    }

    public k(Context context, ag agVar, com.adobe.libs.buildingblocks.a.b bVar, com.adobe.libs.services.h.g gVar, com.adobe.libs.a.b bVar2, boolean z) {
        super(context, agVar, bVar, gVar, bVar2);
        this.h = new n(this);
        this.i = new o(this);
        this.j = new p(this);
        this.l = null;
        this.p = false;
        this.q = null;
        this.c = new l(this, z, gVar, agVar);
    }

    public static boolean a(com.adobe.libs.services.h.g gVar) {
        p();
        String userAdobeID = com.adobe.libs.services.auth.d.getInstance().getUserAdobeID();
        if (userAdobeID == null) {
            return false;
        }
        com.adobe.libs.services.c.a.a();
        String string = com.adobe.libs.services.c.a.b().getSharedPreferences("com.adobe.libs.services.cpdf.timedoutpreferences", 0).getString("purchaseTimedOutUserIDs", null);
        if (string == null) {
            return false;
        }
        return gVar == com.adobe.libs.services.h.g.EXPORT_PDF_SUBSCRIPTION ? string.contains(new StringBuilder().append(userAdobeID).append(" ").append(com.adobe.libs.services.h.g.EXPORT_PDF_SUBSCRIPTION.h).toString()) || string.contains(new StringBuilder().append(userAdobeID).append(" ").append(com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION.h).toString()) || string.contains(new StringBuilder().append(userAdobeID).append(" ").append(com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION.h).toString()) : gVar == com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION ? string.contains(new StringBuilder().append(userAdobeID).append(" ").append(com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION.h).toString()) || string.contains(new StringBuilder().append(userAdobeID).append(" ").append(com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION.h).toString()) : gVar == com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION && string.contains(new StringBuilder().append(userAdobeID).append(" ").append(com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION.h).toString());
    }

    public static String b(String str) {
        com.adobe.libs.services.f.a.a();
        com.adobe.libs.services.h.h b = com.adobe.libs.services.f.a.b(str);
        if (b != null) {
            return b == com.adobe.libs.services.h.h.EXPORTPDF_SERVICE ? ARDCMAnalytics.EXPORT_PDF : b == com.adobe.libs.services.h.h.CREATEPDF_SERVICE ? ARDCMAnalytics.CREATE_PDF : b == com.adobe.libs.services.h.h.ACROBATPRO_SERVICE ? "Acrobat Pro" : b.toString();
        }
        return null;
    }

    static void b(k kVar) {
        if (!com.adobe.libs.services.auth.d.getInstance().isSignedIn() || com.adobe.libs.services.auth.d.getInstance().hasEntitlementInfoInKeySet()) {
            kVar.r();
        } else {
            new ad(new v(kVar)).taskExecute(new Void[0]);
        }
    }

    public void c(String str) {
        if (this.e != null) {
            HashMap<String, Object> hashMap = new HashMap<>();
            hashMap.put(ARDCMAnalytics.CONTEXT_KEY_SERVICE_TYPE, str);
            this.e.trackInAppPurchaseReport("In-App Purchase Subscribe Tapped", hashMap);
        }
    }

    private ArrayList<SkuDetails> getInAppSubscriptionList() {
        if (this.q == null) {
            com.adobe.libs.services.f.a a2 = com.adobe.libs.services.f.a.a();
            ArrayList<SkuDetails> arrayList = null;
            if (a2.g != null) {
                arrayList = new ArrayList<>(a2.g);
            } else {
                a2.b();
            }
            this.q = arrayList;
        }
        return this.q;
    }

    private int getPurchaseProcessingPageResourceID() {
        if (com.adobe.libs.services.c.a.c()) {
            if (this.f219a == com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION || this.f219a == com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION) {
                return com.adobe.libs.services.e.cpdf_processing_purchase_app_pane;
            }
            if (this.f219a == com.adobe.libs.services.h.g.EXPORT_PDF_SUBSCRIPTION) {
                return com.adobe.libs.services.e.epdf_processing_purchase_app_pane;
            }
            return -1;
        }
        if (this.f219a == com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION || this.f219a == com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION) {
            return com.adobe.libs.services.e.cpdf_processing_purchase;
        }
        if (this.f219a == com.adobe.libs.services.h.g.EXPORT_PDF_SUBSCRIPTION) {
            return com.adobe.libs.services.e.epdf_processing_purchase;
        }
        return -1;
    }

    private int getPurchaseProvisioningPageResourceID() {
        if (com.adobe.libs.services.c.a.c()) {
            if (this.f219a == com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION || this.f219a == com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION) {
                return com.adobe.libs.services.e.cpdf_wait_app_pane;
            }
            if (this.f219a == com.adobe.libs.services.h.g.EXPORT_PDF_SUBSCRIPTION) {
                return com.adobe.libs.services.e.epdf_wait_app_pane;
            }
            return -1;
        }
        if (this.f219a == com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION || this.f219a == com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION) {
            return com.adobe.libs.services.e.cpdf_wait;
        }
        if (this.f219a == com.adobe.libs.services.h.g.EXPORT_PDF_SUBSCRIPTION) {
            return com.adobe.libs.services.e.epdf_wait;
        }
        return -1;
    }

    public static void p() {
        String str = null;
        String userAdobeID = com.adobe.libs.services.auth.d.getInstance().getUserAdobeID();
        com.adobe.libs.services.c.a.a();
        SharedPreferences sharedPreferences = com.adobe.libs.services.c.a.b().getSharedPreferences("com.adobe.libs.services.cpdf.timedoutpreferences", 0);
        SharedPreferences.Editor edit = sharedPreferences.edit();
        String string = sharedPreferences.getString("purchaseTimedOutUserIDs", null);
        String string2 = sharedPreferences.getString("purchaseTimedOutTime", null);
        if (string != null) {
            String[] split = string.split(",");
            String[] split2 = string2.split(",");
            if (split.length != split2.length) {
                edit.clear();
            } else {
                String str2 = null;
                for (int i = 0; i < split.length; i++) {
                    String[] split3 = split[i].split(" ");
                    if ((userAdobeID == null || !split3[0].equals(userAdobeID) || !com.adobe.libs.services.auth.d.getInstance().isSubscriptionAvailableForService(com.adobe.libs.services.h.g.a(split3[1]))) && System.currentTimeMillis() - Long.parseLong(split2[i]) < 86400000) {
                        if (str == null) {
                            str = split[i];
                            str2 = split2[i];
                        } else {
                            str = str + "," + split[i];
                            str2 = str2 + "," + split2[i];
                        }
                    }
                }
                if (str == null) {
                    edit.clear();
                } else {
                    edit.putString("purchaseTimedOutUserIDs", str);
                    edit.putString("purchaseTimedOutTime", str2);
                }
            }
        }
        edit.apply();
    }

    public void r() {
        String string;
        Context context = getContext();
        if (a(this.f219a)) {
            c();
            try {
                int purchaseProcessingPageResourceID = getPurchaseProcessingPageResourceID();
                string = purchaseProcessingPageResourceID != -1 ? com.adobe.libs.services.h.m.a(purchaseProcessingPageResourceID) : context.getString(com.adobe.libs.services.f.IDS_ERROR_STORE_PROCESSING_PURCHASE);
            } catch (IOException e) {
                string = context.getString(com.adobe.libs.services.f.IDS_ERROR_STORE_PROCESSING_PURCHASE);
            }
            loadDataWithBaseURL("file:///android_res/raw/", string.replace("$MESSAGE_STRING$", context.getString(com.adobe.libs.services.f.IDS_ERROR_STORE_PROCESSING_PURCHASE)).replace("$SERVICE_ID$", getWebViewTitle()), BBFileUtils.j(".html"), "utf-8", ARFileEntry.DEFAULT_ENTRY_ICON_STRING);
            return;
        }
        if (this.p) {
            return;
        }
        this.p = true;
        if (!f()) {
            if (com.adobe.libs.buildingblocks.utils.i.b(getContext())) {
                this.n = new AlertDialog.Builder(getContext()).setTitle(getResources().getString(com.adobe.libs.services.f.IDS_GOOGLE_PLAY_PURCHASE_NOT_ALLOWED_DIALOG_TITLE)).setMessage(getResources().getString(com.adobe.libs.services.f.IDS_GOOGLE_PLAY_PURCHASE_NOT_ALLOWED_DIALOG_MESSAGE)).setNegativeButton(getResources().getString(com.adobe.libs.services.f.IDS_OK_STR), new s(this)).setOnCancelListener(new r(this)).show();
                return;
            } else {
                q();
                return;
            }
        }
        if (com.adobe.libs.services.auth.d.getInstance().canPurchaseService(this.f219a)) {
            setWebViewClient(new z(this, (byte) 0));
            getSettings().setJavaScriptEnabled(true);
            loadUrl(getMarketingPageURL());
        } else {
            try {
                this.n = new AlertDialog.Builder(getContext()).setTitle(getResources().getString(com.adobe.libs.services.f.IDS_PURCHASE_NOT_ALLOWED_ERROR_TITLE)).setMessage(getResources().getString(com.adobe.libs.services.f.IDS_PURCHASE_NOT_ALLOWED_ERROR_MESSAGE)).setNegativeButton(getResources().getString(com.adobe.libs.services.f.IDS_OK_STR), new u(this)).setOnCancelListener(new t(this)).show();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    static String s(k kVar) {
        kVar.l = null;
        return null;
    }

    public void s() {
        new ad(new x(this)).taskExecute(new Void[0]);
    }

    @Override
    public final void a(String str, af afVar) {
        this.p = false;
        if (this.o != null) {
            this.o.removeMessages(1);
        }
        super.a(str, afVar);
    }

    @Override
    public void destroy() {
        if (this.n != null && this.n.isShowing()) {
            this.n.dismiss();
        }
        if (this.m != null && this.m.isShowing()) {
            this.m.dismiss();
        }
        super.destroy();
    }

    @Override
    public final void e() {
        this.e = null;
    }

    @Override
    protected final boolean f() {
        if (com.adobe.libs.services.auth.d.getInstance().isSignedIn() && !com.adobe.libs.services.auth.d.getInstance().canPurchaseService(this.f219a)) {
            return true;
        }
        boolean e = com.adobe.libs.services.f.a.a().e();
        if (!e) {
            return e;
        }
        ArrayList<SkuDetails> inAppSubscriptionList = getInAppSubscriptionList();
        if (inAppSubscriptionList == null || inAppSubscriptionList.size() <= 0) {
            return false;
        }
        return e;
    }

    @Override
    protected String getMarketingPageGetStartedSignInURL() {
        return "readermobile://cpdfgetstarted";
    }

    @Override
    protected String getMarketingPageGetStartedSignUpURL() {
        return null;
    }

    @Override
    protected String getMarketingPageURL() {
        String string;
        String str;
        Context context = getContext();
        switch (q.f180a[this.f219a.ordinal()]) {
            case 1:
                if (!com.adobe.libs.services.auth.d.getInstance().isSignedIn()) {
                    string = ARServicesAccount.DEFAULT_MASTER_URI_KEY.equalsIgnoreCase(ARServicesAccount.DEFAULT_MASTER_URI_KEY) ? context.getString(com.adobe.libs.services.f.IDS_EPDF_MARKETING_PAGE_APP_PANE_SEAMLESS_URL) : context.getString(com.adobe.libs.services.f.IDS_EPDF_MARKETING_PAGE_APP_PANE_SEAMLESS_STAGE_URL);
                    break;
                } else {
                    string = ARServicesAccount.DEFAULT_MASTER_URI_KEY.equalsIgnoreCase(ARServicesAccount.DEFAULT_MASTER_URI_KEY) ? context.getString(com.adobe.libs.services.f.IDS_EPDF_MARKETING_PAGE_APP_PANE_URL) : context.getString(com.adobe.libs.services.f.IDS_EPDF_MARKETING_PAGE_APP_PANE_STAGE_URL);
                    break;
                }
            case 2:
                if (!com.adobe.libs.services.auth.d.getInstance().isSignedIn()) {
                    string = ARServicesAccount.DEFAULT_MASTER_URI_KEY.equalsIgnoreCase(ARServicesAccount.DEFAULT_MASTER_URI_KEY) ? context.getString(com.adobe.libs.services.f.IDS_CPDF_MARKETING_PAGE_APP_PANE_SEAMLESS_URL) : context.getString(com.adobe.libs.services.f.IDS_CPDF_MARKETING_PAGE_APP_PANE_SEAMLESS_STAGE_URL);
                    break;
                } else {
                    string = ARServicesAccount.DEFAULT_MASTER_URI_KEY.equalsIgnoreCase(ARServicesAccount.DEFAULT_MASTER_URI_KEY) ? context.getString(com.adobe.libs.services.f.IDS_CPDF_MARKETING_PAGE_APP_PANE_URL) : context.getString(com.adobe.libs.services.f.IDS_CPDF_MARKETING_PAGE_APP_PANE_STAGE_URL);
                    break;
                }
            case 3:
                if (!com.adobe.libs.services.auth.d.getInstance().isSignedIn()) {
                    string = ARServicesAccount.DEFAULT_MASTER_URI_KEY.equalsIgnoreCase(ARServicesAccount.DEFAULT_MASTER_URI_KEY) ? context.getString(com.adobe.libs.services.f.IDS_ACROBAT_PRO_MARKETING_PAGE_APP_PANE_SEAMLESS_URL) : context.getString(com.adobe.libs.services.f.IDS_ACROBAT_PRO_MARKETING_PAGE_APP_PANE_SEAMLESS_STAGE_URL);
                    break;
                } else {
                    string = ARServicesAccount.DEFAULT_MASTER_URI_KEY.equalsIgnoreCase(ARServicesAccount.DEFAULT_MASTER_URI_KEY) ? context.getString(com.adobe.libs.services.f.IDS_ACROBAT_PRO_MARKETING_PAGE_APP_PANE_URL) : context.getString(com.adobe.libs.services.f.IDS_ACROBAT_PRO_MARKETING_PAGE_APP_PANE_STAGE_URL);
                    break;
                }
            default:
                if (!k) {
                    throw new AssertionError();
                }
                string = null;
                break;
        }
        if (string != null) {
            com.adobe.libs.services.f.a.a();
            if (com.adobe.libs.services.f.a.c()) {
                ArrayList<SkuDetails> inAppSubscriptionList = getInAppSubscriptionList();
                if (inAppSubscriptionList == null || inAppSubscriptionList.size() <= 0) {
                    LocalBroadcastManager.getInstance(getContext()).registerReceiver(this.j, new IntentFilter("com.adobe.libs.services.inappbilling.SVInappBillingUtils.skuListPopulated"));
                } else {
                    String str2 = (string.contains("?") ? "&" : "?") + "appVersion=" + com.adobe.libs.buildingblocks.utils.n.a(getContext());
                    Iterator<SkuDetails> it = inAppSubscriptionList.iterator();
                    while (true) {
                        String str3 = str2;
                        if (!it.hasNext()) {
                            str = string + str3;
                            LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(this.j);
                            String str4 = "SVCreatePDFWebView: marketingPageURL " + str;
                            com.adobe.libs.services.h.n.g();
                            return str;
                        }
                        SkuDetails next = it.next();
                        str2 = str3 + "&product=" + next.getSku() + "+" + next.getPrice();
                    }
                }
            }
        }
        str = string;
        String str42 = "SVCreatePDFWebView: marketingPageURL " + str;
        com.adobe.libs.services.h.n.g();
        return str;
    }

    @Override
    public String getWebViewTitle() {
        Context context = getContext();
        if (this.f219a == com.adobe.libs.services.h.g.PDF_PACK_SUBSCRIPTION) {
            return context.getString(com.adobe.libs.services.f.IDS_PDF_PACK_SERVICE);
        }
        if (this.f219a == com.adobe.libs.services.h.g.EXPORT_PDF_SUBSCRIPTION) {
            return context.getString(com.adobe.libs.services.f.IDS_EXPORT_PDF_SERVICE);
        }
        if (this.f219a == com.adobe.libs.services.h.g.ACROBAT_PRO_SUBSCRIPTION) {
            return context.getString(com.adobe.libs.services.f.IDS_ACROBAT_PRO_SERVICE);
        }
        return null;
    }

    @Override
    protected final void h() {
        this.c.onSuccess();
    }

    @Override
    public final void j() {
        String b;
        if (com.adobe.libs.services.auth.d.getInstance().isSignedIn()) {
            this.c.onSuccess();
            return;
        }
        if (this.b != null) {
            this.l = Uri.parse(this.b).getQueryParameter("skuid");
            if (this.l == null) {
                com.adobe.libs.services.h.g gVar = this.f219a;
                b = getServiceType$795af651();
            } else {
                b = b(this.l);
            }
            c(b);
        }
        super.j();
    }

    public final void o() {
        String str;
        String str2;
        String string;
        SharedPreferences sharedPreferences = getContext().getSharedPreferences("com.adobe.libs.services.cpdf.timedoutpreferences", 0);
        String userAdobeID = com.adobe.libs.services.auth.d.getInstance().getUserAdobeID();
        String string2 = sharedPreferences.getString("purchaseTimedOutUserIDs", null);
        String string3 = sharedPreferences.getString("purchaseTimedOutTime", null);
        if (string2 == null) {
            str = userAdobeID + " " + this.f219a.h;
            str2 = new StringBuilder().append(System.currentTimeMillis()).toString();
        } else {
            str = string2 + "," + userAdobeID + " " + this.f219a.h;
            str2 = string3 + "," + System.currentTimeMillis();
        }
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString("purchaseTimedOutUserIDs", str);
        edit.putString("purchaseTimedOutTime", str2);
        edit.apply();
        setWebViewClient(null);
        c();
        try {
            int purchaseProvisioningPageResourceID = getPurchaseProvisioningPageResourceID();
            string = purchaseProvisioningPageResourceID != -1 ? com.adobe.libs.services.h.m.a(purchaseProvisioningPageResourceID) : getContext().getString(com.adobe.libs.services.f.IDS_ERROR_STORE_PROCESSING_PURCHASE);
        } catch (IOException e) {
            string = getContext().getString(com.adobe.libs.services.f.IDS_ERROR_STORE_PROCESSING_PURCHASE);
        }
        loadDataWithBaseURL("file:///android_res/raw/", string.replace("$PROCESSING_STRING$", getContext().getString(com.adobe.libs.services.f.IDS_ERROR_STORE_PROCESSING_PURCHASE)).replace("$SERVICE_ID$", getWebViewTitle()), BBFileUtils.j(".html"), "utf-8", ARFileEntry.DEFAULT_ENTRY_ICON_STRING);
        this.o = new w(this, System.currentTimeMillis());
        s();
    }

    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        LocalBroadcastManager.getInstance(getContext()).registerReceiver(this.h, new IntentFilter(com.adobe.libs.services.auth.d.BROADCAST_USER_ACCOUNT_REMOVED));
        LocalBroadcastManager.getInstance(getContext()).registerReceiver(this.i, new IntentFilter("com.adobe.libs.services.auth.SVInitiateServicesAccountAsyncTask.userAccountAdded"));
    }

    @Override
    public void onDetachedFromWindow() {
        if (this.o != null) {
            this.o.removeMessages(1);
        }
        LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(this.h);
        LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(this.i);
        LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(this.j);
        super.onDetachedFromWindow();
    }

    public final void q() {
        a(getContext().getString(com.adobe.libs.services.f.IDS_NETWORK_ERROR), new y(this));
    }
}