<commit_before>package com.uber.sdk.android.core.utils;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.util.Base64;
import android.util.Pair;
import com.uber.sdk.android.core.SupportedAppType;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

import static com.uber.sdk.android.core.SupportedAppType.UBER;
import static com.uber.sdk.android.core.SupportedAppType.UBER_EATS;

public class AppProtocol {
    @VisibleForTesting
    static final String[] RIDER_PACKAGE_NAMES =
            {"com.ubercab.presidio.development", "com.ubercab.presidio.exo", "com.ubercab.presidio.app", "com.ubercab"};
    @VisibleForTesting
    static final String[] EATS_PACKAGE_NAMES =
            {"com.ubercab.eats.debug", "com.ubercab.eats.exo", "com.ubercab.eats", "com.ubercab.eats.internal", "com.ubercab.eats.nightly"};
    public static final String PLATFORM = "android";

    // Both com.ubercab.eats and com.ubercab.eats.nightly share the same hash
    private static final String UBER_EATS_HASH = "ae0b86995f174533b423067837beba13d922fbb0";
    // For com.ubercab.eats.internal
    private static final String UBER_EATS_INTERNAL_HASH = "9a715f0cbb44b01e3c41c9bda30feba107561e79";
    private static final String UBER_RIDER_HASH = "411c40b31f6d01dac68d711df99b6eafeec8e73b";
    private static final String HASH_ALGORITHM_SHA1 = "SHA-1";
    private static final int DEFAULT_MIN_VERSION = 0;

    private static final HashSet<String> validAppSignatureHashes = buildAppSignatureHashes();<commit_msg>Bring back deprecated code and change order of package names<commit_after>package com.uber.sdk.android.core.utils;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.util.Base64;
import android.util.Pair;
import com.uber.sdk.android.core.SupportedAppType;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

import static com.uber.sdk.android.core.SupportedAppType.UBER;
import static com.uber.sdk.android.core.SupportedAppType.UBER_EATS;

public class AppProtocol {
    @Deprecated
    public static final String[] UBER_PACKAGE_NAMES =
            {"com.ubercab", "com.ubercab.presidio.app", "com.ubercab.presidio.exo", "com.ubercab.presidio.development"};

    @VisibleForTesting
    static final String[] RIDER_PACKAGE_NAMES =
            {"com.ubercab.presidio.development", "com.ubercab.presidio.exo", "com.ubercab.presidio.app", "com.ubercab"};
    @VisibleForTesting
    static final String[] EATS_PACKAGE_NAMES =
            {"com.ubercab.eats.debug", "com.ubercab.eats.exo", "com.ubercab.eats.internal", "com.ubercab.eats.nightly", "com.ubercab.eats"};
    public static final String PLATFORM = "android";

    // Both com.ubercab.eats and com.ubercab.eats.nightly share the same hash
    private static final String UBER_EATS_HASH = "ae0b86995f174533b423067837beba13d922fbb0";
    // For com.ubercab.eats.internal
    private static final String UBER_EATS_INTERNAL_HASH = "9a715f0cbb44b01e3c41c9bda30feba107561e79";
    private static final String UBER_RIDER_HASH = "411c40b31f6d01dac68d711df99b6eafeec8e73b";
    private static final String HASH_ALGORITHM_SHA1 = "SHA-1";
    private static final int DEFAULT_MIN_VERSION = 0;

    private static final HashSet<String> validAppSignatureHashes = buildAppSignatureHashes();
{'fraction_non_alphanumeric': 0.10011806375442739, 'fraction_numerical': 0.0358913813459268, 'mean_word_length': 5.139130434782609, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7323279', 'n_tokens_mistral': 1505, 'n_tokens_neox': 1414, 'n_words': 262}