CamScanner.apk(点击下载) / WebIntentUserInfo.java


package com.intsig.tsapp.account.model;

import android.content.Intent;
import android.text.TextUtils;
import com.intsig.log.LogUtils;
import com.intsig.utils.ApplicationHelper;

public class WebIntentUserInfo {

    /* renamed from: a  reason: collision with root package name */
    public String f39479a = "";

    /* renamed from: b  reason: collision with root package name */
    public String f39480b = "";

    private static void a(String str, String str2, String str3, String[] strArr, WebIntentUserInfo webIntentUserInfo) {
        for (String str4 : strArr) {
            if (str3.startsWith(str4)) {
                String replace = str3.replace(str4, "");
                LogUtils.a("WebIntentUserInfo", "info = " + replace);
                if (replace.contains("&")) {
                    String[] split = replace.split("&");
                    for (String str5 : split) {
                        if (replace.contains("=")) {
                            Object[] split2 = str5.split("=");
                            if (str.equals(split2[0])) {
                                webIntentUserInfo.f39479a = split2[1];
                            } else if (str2.equals(split2[0])) {
                                webIntentUserInfo.f39480b = split2[1];
                            }
                        }
                    }
                } else if (replace.contains("=")) {
                    Object[] split3 = replace.substring(replace.lastIndexOf("?") + 1, replace.length()).split("=");
                    if (split3 == null || split3.length == 0) {
                        LogUtils.a("WebIntentUserInfo", "tmps is empty");
                    } else if (split3.length <= 1) {
                        LogUtils.a("WebIntentUserInfo", "tmps.length is:" + split3.length);
                    } else if (str.equals(split3[0])) {
                        webIntentUserInfo.f39479a = split3[1];
                    } else if (str2.equals(split3[0])) {
                        webIntentUserInfo.f39480b = split3[1];
                    }
                }
            }
        }
    }

    public static WebIntentUserInfo b(Intent intent) {
        WebIntentUserInfo webIntentUserInfo = new WebIntentUserInfo();
        if (intent != null) {
            String action = intent.getAction();
            LogUtils.a("WebIntentUserInfo", "action=" + action);
            if ("android.intent.action.VIEW".equals(action)) {
                String dataString = intent.getDataString();
                LogUtils.a("WebIntentUserInfo", "url = " + dataString);
                if (!TextUtils.isEmpty(dataString)) {
                    String[] strArr = new String[3];
                    if (ApplicationHelper.p()) {
                        strArr[0] = "https://www-sandbox.camscanner.com/site/mobile?";
                        strArr[1] = "https://www-sandbox.camscanner.com/site/mobile?";
                        strArr[2] = "camscannerco://site/mobile?";
                    } else {
                        strArr[0] = "https://www.camscanner.com/site/mobile?";
                        strArr[1] = "http://www.camscanner.com/site/mobile?";
                        strArr[2] = "camscannerco://site/mobile?";
                    }
                    a("account", "id", dataString, strArr, webIntentUserInfo);
                }
            }
        }
        LogUtils.a("WebIntentUserInfo", "userInfo " + webIntentUserInfo);
        return webIntentUserInfo;
    }

    public String toString() {
        return "WebIntentUserInfo [accountName=" + this.f39479a + ", accountId=" + this.f39480b + "]";
    }
}