PSP Dragon Emulator v1.0版本的 MD5 值为:c6379fb6b63c27b6a7d2f2f6f6f51637

以下内容为反编译后的 Data.java 源代码,内容仅作参考


package com.airpush.injector.internal.common.old;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.airpush.injector.internal.common.utils.NetworkUtils;
import com.facebook.appevents.AppEventsConstants;
import com.facebook.internal.NativeProtocol;
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
import crash.io.fabric.sdk.android.services.network.HttpRequest;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Constructor;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Locale;
import org.json.JSONObject;
@Deprecated
public class Data implements Config {
    private static Context context;
    private static String token;

    public Data(Context context2) {
        try {
            String advertiser_id = Util.getAdvertiser_id(context2);
            if (advertiser_id != null) {
                advertiser_id.equals("");
            }
            token = Util.getImei() + "" + Util.getAppID() + "" + Util.getDate();
            token = Util.convertStringToMD5(token);
            setSharedPreferences();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    static boolean getDataSharedPrefrences(Context context2) throws Exception {
        SharedPreferences sharedPreferences = context2.getSharedPreferences(Config.DATA_PREFERENCE, 0);
        Util.setAppID(sharedPreferences.getInt(Config.APP_ID, 0));
        Util.setApiKey(sharedPreferences.getString(Config.APIKEY, "airpush"));
        Util.setImei(sharedPreferences.getString(Config.IMEI, ""));
        Util.setImei_sha(sharedPreferences.getString(Config.IMEI_SHA, ""));
        Util.setTestmode(sharedPreferences.getBoolean(Config.TEST_MODE, false));
        Util.setDoPush(sharedPreferences.getBoolean(Config.DO_PUSH, false));
        Util.setDoIcon(sharedPreferences.getBoolean(Config.DO_ICON, false));
        token = sharedPreferences.getString(Config.TOKEN, Config.INVALID);
        Util.setLongitude(sharedPreferences.getString(Config.LONGITUDE, AppEventsConstants.EVENT_PARAM_VALUE_NO));
        Util.setLatitude(sharedPreferences.getString(Config.LATITUDE, AppEventsConstants.EVENT_PARAM_VALUE_NO));
        Util.setIcon(sharedPreferences.getInt("icon", 17301620));
        Util.setUser_agent(sharedPreferences.getString(Config.USER_AGENT, "Default"));
        Util.setDevice_unique_type(sharedPreferences.getString(Config.DEVICE_UNIQUENESS, Config.INVALID));
        Util.setAdvertiser_id(sharedPreferences.getString(Config.ADV_ID, ""));
        Util.setAdOptOut(sharedPreferences.getBoolean("adOpt", true));
        return true;
    }

    public static HashMap<String, String> setValues(Context context2, String str, String str2) throws NullPointerException, Exception {
        HashMap<String, String> hashMap = new HashMap<>();
        if (Util.isAdOptOut(context2)) {
            String advertiser_id = Util.getAdvertiser_id(context2);
            if (advertiser_id == null || advertiser_id.equals("")) {
                throw new NullPointerException("Advertising id not available");
            }
            hashMap.put(Config.IMEI, Util.convertStringToMD5(advertiser_id));
            hashMap.put(Config.IMEI_SHA, Util.convertStringToSHA(advertiser_id));
            hashMap.put(Config.DEVICE_UNIQUENESS, "IMEI");
        } else {
            if (Util.getImei() == null || Util.getImei().isEmpty()) {
                String advertiser_id2 = Util.getAdvertiser_id(context2);
                if (advertiser_id2 == null || advertiser_id2.isEmpty()) {
                    throw new NullPointerException("Advertising id/Unique identifier not available");
                }
                hashMap.put(Config.IMEI, Util.convertStringToMD5(advertiser_id2));
                hashMap.put(Config.IMEI_SHA, Util.convertStringToSHA(advertiser_id2));
                hashMap.put(Config.DEVICE_UNIQUENESS, "IMEI");
            } else {
                hashMap.put(Config.IMEI, Util.getImei());
                hashMap.put(Config.IMEI_SHA, Util.getImei_sha());
                hashMap.put(Config.DEVICE_UNIQUENESS, "IMEI");
            }
            hashMap.put(Config.ANDROID_ID, Util.getAndroidIdinMd5(context2));
            hashMap.put(Config.ANDROID_ID_SHA, Util.getAndroidIdinSHA(context2));
            String email = Util.getEmail(context2);
            if (email != null && !email.equals("")) {
                hashMap.put("email_md5", Util.convertStringToMD5(email));
                hashMap.put("email_sha", Util.convertStringToSHA(email));
            }
            hashMap.put(Config.ZIP, "" + Util.getZipCode(context2));
        }
        hashMap.put(Config.APIKEY, str);
        hashMap.put(Config.APP_ID, str2);
        Boolean isDaaOptOutEnabled = Util.isDaaOptOutEnabled(context2);
        if (!Util.isAdOptOut(context2) || isDaaOptOutEnabled == null || !isDaaOptOutEnabled.booleanValue()) {
            hashMap.put(Config.LONGITUDE, Util.getLongitude());
            hashMap.put(Config.LATITUDE, Util.getLatitude());
            hashMap.put("locProvider", Util.getLocProvider());
            hashMap.put("locType", Util.getLocationType());
            hashMap.put("locAccuracy", Util.getAccuracy() + "");
            hashMap.put(Config.COUNTRY, Util.getCountryName(context2));
        }
        if (isDaaOptOutEnabled != null) {
            hashMap.put(Config.OPT_OUT, isDaaOptOutEnabled + "");
        }
        hashMap.put(Config.TOKEN, token);
        hashMap.put(Config.REQUEST_TIMESTAMP, Util.getDate());
        hashMap.put(Config.PACKAGE_NAME, Util.getPackageName(context2));
        hashMap.put("version", Util.getVersion());
        hashMap.put(Config.CARRIER, Util.getCarrier(context2));
        hashMap.put(Config.NETWORK_OPERATOR, Util.getNetworkOperator(context2));
        hashMap.put(Config.PHONE_MODEL, Util.getPhoneModel());
        hashMap.put(Config.MANUFACTURER, Util.getManufacturer());
        hashMap.put(Config.SDK_VERSION, Util.getSDKVersion());
        hashMap.put(Config.WIFI, "" + Util.getConnectionType(context2));
        hashMap.put(Config.USER_AGENT, NetworkUtils.getUserAgent(context2));
        hashMap.put(Config.SCREEN_SIZE, Util.getScreen_size(context2));
        hashMap.put(Config.NETWORK_SUBTYPE, Util.getNetworksubType(context2));
        hashMap.put(Config.isTABLET, String.valueOf(Util.isTablet(context2)));
        hashMap.put(Config.SCREEN_DENSITY, Util.getScreenDp(context2));
        hashMap.put(Config.isCONNECTION_FAST, "" + Util.isConnectionFast(context2));
        hashMap.put(Config.UNKNOWN_SOURCE, "" + Util.isInstallFromMarketOnly(context2));
        hashMap.put("appName", Util.getAppName(context2));
        hashMap.put("dpi", Util.getScreenDpi(context2));
        hashMap.put("src", "universal");
        hashMap.put("sessionId", Util.getSESSION_ID());
        hashMap.put(Config.LANGUAGE, Util.getLanguage());
        hashMap.put("locale", "" + Locale.getDefault());
        hashMap.put(Config.ADV_ID, Util.getAdvertiser_id(context2));
        hashMap.put("adOpt", "" + Util.isAdOptOut(context2));
        hashMap.put("orientation", "" + context2.getResources().getConfiguration().orientation);
        hashMap.put(NativeProtocol.RESULT_ARGS_PERMISSIONS, permissionArray(context2));
        return hashMap;
    }

    private static String permissionArray(Context context2) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("email", 1);
            jSONObject.put(Config.IMEI, 1);
            jSONObject.put("loc", 1);
            return jSONObject.toString();
        } catch (Exception unused) {
            return null;
        }
    }

    public static void AUTH(Context context2) {
        try {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    HttpURLConnection httpURLConnection;
                    try {
                        try {
                            httpURLConnection = (HttpURLConnection) new URL("http://apportal.airpush.com/ep/url").openConnection();
                        } catch (Exception unused) {
                            return;
                        }
                    } catch (Throwable unused2) {
                        httpURLConnection = null;
                    }
                    try {
                        httpURLConnection.setReadTimeout(BaseImageDownloader.DEFAULT_HTTP_CONNECT_TIMEOUT);
                        httpURLConnection.setConnectTimeout(BaseImageDownloader.DEFAULT_HTTP_CONNECT_TIMEOUT);
                        httpURLConnection.setRequestMethod("GET");
                        httpURLConnection.setUseCaches(false);
                        httpURLConnection.setRequestProperty(HttpRequest.HEADER_ACCEPT_CHARSET, "UTF-8");
                        httpURLConnection.connect();
                        if (httpURLConnection.getResponseCode() == 200) {
                            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
                            StringBuffer stringBuffer = new StringBuffer();
                            while (true) {
                                String readLine = bufferedReader.readLine();
                                if (readLine == null) {
                                    break;
                                }
                                stringBuffer.append(readLine);
                            }
                            bufferedReader.close();
                        }
                        if (httpURLConnection != null) {
                            httpURLConnection.disconnect();
                        }
                    } catch (Throwable unused3) {
                        if (httpURLConnection != null) {
                            httpURLConnection.disconnect();
                        }
                    }
                }
            }, "url").start();
        } catch (Exception unused) {
        }
    }

    private boolean setSharedPreferences() {
        try {
            SharedPreferences.Editor edit = context.getSharedPreferences(Config.DATA_PREFERENCE, 0).edit();
            edit.putString(Config.IMEI, Util.getImei());
            edit.putString(Config.IMEI_SHA, Util.getImei_sha());
            edit.putString(Config.LONGITUDE, Util.getLongitude());
            edit.putString(Config.LATITUDE, Util.getLatitude());
            edit.putString(Config.ANDROID_ID, Util.getAndroidIdinMd5(context));
            edit.putString(Config.ANDROID_ID_SHA, Util.getAndroidIdinSHA(context));
            edit.putString(Config.DEVICE_UNIQUENESS, Util.getDevice_unique_type());
            edit.putString(Config.APIKEY, Util.getApiKey());
            edit.putInt(Config.APP_ID, Util.getAppID());
            edit.putInt(Config.WIFI, Util.getConnectionType(context));
            edit.putString(Config.TOKEN, token);
            edit.putString(Config.REQUEST_TIMESTAMP, Util.getDate());
            edit.putString(Config.PACKAGE_NAME, Util.getPackageName(context));
            edit.putString("version", Util.getVersion());
            edit.putString(Config.CARRIER, Util.getCarrier(context));
            edit.putString(Config.NETWORK_OPERATOR, Util.getNetworkOperator(context));
            edit.putString(Config.PHONE_MODEL, Util.getPhoneModel());
            edit.putString(Config.MANUFACTURER, Util.getManufacturer());
            edit.putString(Config.SDK_VERSION, Util.getSDKVersion());
            edit.putBoolean(Config.TEST_MODE, Util.isTestmode());
            edit.putBoolean(Config.DO_PUSH, Util.isDoPush());
            edit.putBoolean(Config.DO_ICON, Util.isDoIcon());
            edit.putString(Config.SCREEN_SIZE, Util.getScreen_size(context));
            edit.putString(Config.NETWORK_SUBTYPE, Util.getNetworksubType(context));
            edit.putInt("icon", Util.getIcon());
            edit.putString(Config.USER_AGENT, Util.getUser_agent());
            edit.putString(Config.ADV_ID, Util.getAdvertiser_id(context));
            edit.putBoolean("adOpt", Util.isAdOptOut(context));
            return edit.commit();
        } catch (Exception unused) {
            return false;
        }
    }

    private String getUserAgent(Context context2) {
        if (Build.VERSION.SDK_INT > 16) {
            return WebSettings.getDefaultUserAgent(context2);
        }
        try {
            Constructor declaredConstructor = WebSettings.class.getDeclaredConstructor(Context.class, WebView.class);
            declaredConstructor.setAccessible(true);
            String userAgentString = ((WebSettings) declaredConstructor.newInstance(context2, null)).getUserAgentString();
            declaredConstructor.setAccessible(false);
            return userAgentString;
        } catch (Exception unused) {
            return new WebView(context2).getSettings().getUserAgentString();
        }
    }
}