Mad Aces v1.2.2.3版本的 MD5 值为:f29ebd7c5808053d9f3f3722a5db1688
以下内容为反编译后的 UnityAdsProperties.java 源代码,内容仅作参考
package com.unity3d.ads.android.properties;
import android.app.Activity;
import android.content.Context;
import com.heyzap.http.AsyncHttpResponseHandler;
import com.unity3d.ads.android.UnityAdsDeviceLog;
import com.unity3d.ads.android.UnityAdsUtils;
import com.unity3d.ads.android.campaign.UnityAdsCampaign;
import com.unity3d.ads.android.data.UnityAdsDevice;
import com.unity3d.ads.android.view.UnityAdsFullscreenActivity;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.util.Map;
public class UnityAdsProperties {
public static final int MAX_BUFFERING_WAIT_SECONDS = 20;
public static final int MAX_NUMBER_OF_ANALYTICS_RETRIES = 5;
public static String CAMPAIGN_DATA_URL = "https://impact.applifier.com/mobile/campaigns";
public static String WEBVIEW_BASE_URL = null;
public static String ANALYTICS_BASE_URL = null;
public static String UNITY_ADS_BASE_URL = null;
public static String UNITY_ADS_GAME_ID = null;
public static String UNITY_ADS_GAMER_ID = null;
public static String APPFILTER_LIST = null;
public static String INSTALLED_APPS_URL = null;
public static Boolean TESTMODE_ENABLED = false;
public static WeakReference BASE_ACTIVITY = null;
public static Context APPLICATION_CONTEXT = null;
public static WeakReference CURRENT_ACTIVITY = null;
public static UnityAdsCampaign SELECTED_CAMPAIGN = null;
public static Boolean SELECTED_CAMPAIGN_CACHED = false;
public static int CAMPAIGN_REFRESH_VIEWS_COUNT = 0;
public static int CAMPAIGN_REFRESH_VIEWS_MAX = 0;
public static int CAMPAIGN_REFRESH_SECONDS = 0;
public static long CACHING_SPEED = 0;
public static String UNITY_VERSION = null;
public static String TEST_DATA = null;
public static String TEST_JAVASCRIPT = null;
public static Boolean RUN_WEBVIEW_TESTS = false;
public static Boolean UNITY_DEVELOPER_INTERNAL_TEST = false;
public static String TEST_DEVELOPER_ID = null;
public static String TEST_OPTIONS_ID = null;
private static Map a = null;
public static Boolean UNITY_ADS_READY_SENT = false;
private static Boolean b = false;
private static String c = null;
public static String getCampaignQueryUrl() {
String str;
Exception e;
Object[] objArr;
String str2;
String str3;
Object[] objArr2;
String str4;
String str5 = "?";
try {
String format = String.format("%s%s=%s", "?", "platform", "android");
String advertisingTrackingId = UnityAdsDevice.getAdvertisingTrackingId();
if (advertisingTrackingId != null) {
Object[] objArr3 = new Object[3];
objArr3[0] = format;
objArr3[1] = "trackingEnabled";
objArr3[2] = Integer.valueOf(UnityAdsDevice.isLimitAdTrackingEnabled() ? 0 : 1);
format = String.format("%s&%s=%s", String.format("%s&%s=%s", String.format("%s&%s=%d", objArr3), "advertisingTrackingId", URLEncoder.encode(UnityAdsUtils.Md5(advertisingTrackingId).toLowerCase(), AsyncHttpResponseHandler.DEFAULT_CHARSET)), "rawAdvertisingTrackingId", URLEncoder.encode(advertisingTrackingId, AsyncHttpResponseHandler.DEFAULT_CHARSET));
} else if (!UnityAdsDevice.getAndroidId(false).equals("unknown")) {
format = String.format("%s&%s=%s", String.format("%s&%s=%s", format, "androidId", URLEncoder.encode(UnityAdsDevice.getAndroidId(true), AsyncHttpResponseHandler.DEFAULT_CHARSET)), "rawAndroidId", URLEncoder.encode(UnityAdsDevice.getAndroidId(false), AsyncHttpResponseHandler.DEFAULT_CHARSET));
}
String format2 = String.format("%s&%s=%s", String.format("%s&%s=%s", String.format("%s&%s=%s", String.format("%s&%s=%s", String.format("%s&%s=%s", String.format("%s&%s=%s", format, "gameId", URLEncoder.encode(UNITY_ADS_GAME_ID, AsyncHttpResponseHandler.DEFAULT_CHARSET)), "sdkVersion", URLEncoder.encode(UnityAdsConstants.UNITY_ADS_VERSION, AsyncHttpResponseHandler.DEFAULT_CHARSET)), "softwareVersion", URLEncoder.encode(UnityAdsDevice.getSoftwareVersion(), AsyncHttpResponseHandler.DEFAULT_CHARSET)), UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_HARDWAREVERSION_KEY, URLEncoder.encode(UnityAdsDevice.getHardwareVersion(), AsyncHttpResponseHandler.DEFAULT_CHARSET)), "deviceType", Integer.valueOf(UnityAdsDevice.getDeviceType())), UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_CONNECTIONTYPE_KEY, URLEncoder.encode(UnityAdsDevice.getConnectionType(), AsyncHttpResponseHandler.DEFAULT_CHARSET));
if (UNITY_VERSION != null && UNITY_VERSION.length() > 0) {
format2 = String.format("%s&%s=%s", format2, "unityVersion", URLEncoder.encode(UNITY_VERSION, AsyncHttpResponseHandler.DEFAULT_CHARSET));
}
if (!UnityAdsDevice.isUsingWifi()) {
format2 = String.format("%s&%s=%d", format2, UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_ANDROIDNETWORKTYPE_KEY, Integer.valueOf(UnityAdsDevice.getNetworkType()));
}
if (CACHING_SPEED > 0) {
format2 = String.format("%s&%s=%d", format2, UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_CACHINGSPEED_KEY, Long.valueOf(CACHING_SPEED));
}
str5 = String.format("%s&%s=%s", format2, "screenSize", Integer.valueOf(UnityAdsDevice.getScreenSize()));
str = String.format("%s&%s=%s", str5, "screenDensity", Integer.valueOf(UnityAdsDevice.getScreenDensity()));
try {
if (APPFILTER_LIST != null) {
str = String.format("%s&%s=%s", str, UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_APPFILTER_KEY, APPFILTER_LIST);
APPFILTER_LIST = null;
}
} catch (Exception e2) {
e = e2;
UnityAdsDeviceLog.error("Problems creating campaigns query: " + e.getMessage());
if (!TESTMODE_ENABLED.booleanValue()) {
}
objArr[2] = str2;
str4 = String.format(str3, objArr2);
if (b.booleanValue()) {
}
c = str4;
return String.format("%s%s", CAMPAIGN_DATA_URL, c);
}
} catch (Exception e3) {
str = str5;
e = e3;
}
if (!TESTMODE_ENABLED.booleanValue()) {
str4 = String.format("%s&%s=%s", str, UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_TEST_KEY, "true");
if (TEST_OPTIONS_ID != null && TEST_OPTIONS_ID.length() > 0) {
str4 = String.format("%s&%s=%s", str4, "optionsId", TEST_OPTIONS_ID);
}
if (TEST_DEVELOPER_ID != null && TEST_DEVELOPER_ID.length() > 0) {
objArr = new Object[3];
objArr[0] = str4;
objArr[1] = "developerId";
str2 = TEST_DEVELOPER_ID;
str3 = "%s&%s=%s";
objArr2 = objArr;
}
if (b.booleanValue()) {
str4 = String.format("%s&%s=%s", str4, UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_SENDINTERNALDETAILS_KEY, "true");
b = false;
}
c = str4;
return String.format("%s%s", CAMPAIGN_DATA_URL, c);
}
objArr = new Object[3];
objArr[0] = str;
objArr[1] = UnityAdsConstants.UNITY_ADS_INIT_QUERYPARAM_ENCRYPTED_KEY;
if (UnityAdsUtils.isDebuggable()) {
str2 = "false";
str3 = "%s&%s=%s";
objArr2 = objArr;
} else {
str2 = "true";
str3 = "%s&%s=%s";
objArr2 = objArr;
}
objArr[2] = str2;
str4 = String.format(str3, objArr2);
if (b.booleanValue()) {
}
c = str4;
return String.format("%s%s", CAMPAIGN_DATA_URL, c);
}
public static String getCampaignQueryArguments() {
return (c == null || c.length() <= 2) ? "" : c.substring(1);
}
public static Activity getBaseActivity() {
if (BASE_ACTIVITY == null || BASE_ACTIVITY.get() == null || ((Activity) BASE_ACTIVITY.get()).isFinishing() || a((Activity) BASE_ACTIVITY.get())) {
return null;
}
return (Activity) BASE_ACTIVITY.get();
}
public static Activity getCurrentActivity() {
return (CURRENT_ACTIVITY == null || CURRENT_ACTIVITY.get() == null || ((Activity) CURRENT_ACTIVITY.get()).isFinishing() || a((Activity) CURRENT_ACTIVITY.get())) ? getBaseActivity() : (Activity) CURRENT_ACTIVITY.get();
}
private static boolean a(Activity activity) {
Method method = null;
try {
method = Activity.class.getMethod("isDestroyed", new Class[0]);
} catch (Exception e) {
UnityAdsDeviceLog.error("Couldn't get isDestroyed -method");
}
if (method != null && activity != null) {
try {
return ((Boolean) method.invoke(activity, new Object[0])).booleanValue();
} catch (Exception e2) {
UnityAdsDeviceLog.error("Error running isDestroyed -method");
}
}
return false;
}
public static boolean isAdsReadySent() {
return UNITY_ADS_READY_SENT.booleanValue();
}
public static void setAdsReadySent(boolean z) {
UNITY_ADS_READY_SENT = Boolean.valueOf(z);
}
public static boolean isShowingAds() {
return getCurrentActivity() instanceof UnityAdsFullscreenActivity;
}
}