13Poker by gametower unlimited gems v0.4版本的 MD5 值为:51324fc0f195c34821074948ab266846
以下内容为反编译后的 AdColony.java 源代码,内容仅作参考
package com.jirbo.adcolony;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.Toast;
import com.adsdk.sdk.Const;
import com.jirbo.adcolony.JSON;
import com.xbtsol.jynvrt161024.IConstants;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
public class AdColony {
static final String LOGTAG = "AdColony";
private static AdManager ad_manager = null;
static final String adc_version = "1.9.13";
static boolean ads_disabled = false;
static String android_id = null;
static String app_version = null;
static String available_stores = null;
static String carrier_name = null;
private static String device_id = null;
static String imei = null;
static boolean is_tablet = false;
static String language = null;
static Handler on_vc_result_handler = null;
static Handler on_vc_success_handler = null;
static String origin_store = null;
static boolean skippable = false;
static final int timeout_ms = 30000;
static AdColonyURLListener url_listener;
static boolean vc_post_popup;
private static String custom_id = "";
static ArrayList<AdColonyV4VCListener> vc_listeners = new ArrayList<>();
public static class URLS {
static final String app_stats_tracking = "http://www.adtilt.com/clients/index.php?section=tracking&action=appTrack";
static final String combined_json = "http://www.adtilt.com/clients/index.php?section=serve&action=adConfig";
static final String resource_json = "http://www.adtilt.com/clients/skins/resource_json_iphone.json";
static final String server_base = "http://www.adtilt.com/clients/";
static final String track_base = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=";
static final String track_video_continue = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=acVidContinueTrack";
static final String track_video_download = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=acVidDownloadTrack";
static final String track_video_impression = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=acVidImpressionTrack";
static final String track_video_info = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=acVidInfoTrack";
static final String track_video_request = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=acVidRequestTrack";
static final String track_video_skip = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=acVidSkipTrack";
static final String track_video_start = "http://www.adtilt.com/clients/index.php?section=tracking_1_9_6&action=acVidStartTrack";
}
public static boolean isTablet() {
return is_tablet;
}
public static void enable(boolean setting) {
ads_disabled = !setting;
if (ad_manager == null || !setting) {
return;
}
ad_manager.startRefresh();
}
public static boolean isConfigured() {
return ad_manager != null;
}
public static void configure(Activity activity, String client_options, String... ids) {
app_version = Const.PROTOCOL_VERSION;
if (client_options != null) {
try {
} catch (Exception e) {
logError("Syntax error in client_options. Options should be in the form:");
logError(" \"version:1.0,store:google\"");
logError(" \"version:1.2.1,store:amazon\"");
app_version = Const.PROTOCOL_VERSION;
origin_store = "google";
}
}
client_options = "version:1.0";
String[] options = client_options.split(",");
JSON.JSObject json = new JSON.JSObject();
for (String option : options) {
int colon = option.indexOf(58);
if (colon != -1) {
json.set(option.substring(0, colon), option.substring(colon + 1));
} else {
json.set(option, true);
}
}
app_version = json.getString("version", Const.PROTOCOL_VERSION);
origin_store = json.getString("store", "google");
skippable = json.getBoolean("skippable", false);
json.toJSON();
boolean google_available = application_exists(activity, "com.android.vending") || application_exists(activity, "com.android.market");
boolean amazon_available = application_exists(activity, "com.amazon.venezia");
available_stores = "";
if (google_available) {
available_stores = "google";
}
if (amazon_available) {
if (available_stores.length() > 0) {
available_stores += ",";
}
available_stores += "amazon";
}
if (ad_manager != null) {
if (!ad_manager.app_id.equals(ids[0])) {
trace("ADC configure() called twice");
}
ad_manager.terminate();
ad_manager = null;
}
on_vc_result_handler = new OnVCResultHandler();
on_vc_success_handler = new OnVCSuccessHandler();
vc_listeners.clear();
try {
DisplayMetrics dm = activity.getResources().getDisplayMetrics();
float screenWidth = dm.widthPixels / dm.xdpi;
float screenHeight = dm.heightPixels / dm.ydpi;
double size = Math.sqrt(Math.pow(screenWidth, 2.0d) + Math.pow(screenHeight, 2.0d));
is_tablet = size >= 6.0d;
} catch (Throwable t) {
Log.e(LOGTAG, "Failed to compute screen size", t);
}
if (!hasLargeMemory(activity)) {
ads_disabled = true;
}
TelephonyManager manager = (TelephonyManager) activity.getSystemService("phone");
carrier_name = manager.getNetworkOperatorName();
if (carrier_name.length() == 0) {
carrier_name = "unknown";
} else {
carrier_name = NetworkStatus.url_encoded(carrier_name);
}
imei = manager.getDeviceId();
if (imei == null) {
imei = "";
}
android_id = Settings.Secure.getString(activity.getContentResolver(), IConstants.ANDROID_ID);
if (android_id == null) {
android_id = "";
}
language = Locale.getDefault().getLanguage();
ad_manager = new AdManager(activity);
StateManager.configure();
ad_manager.configure(ids);
if (Analytics.instance == null) {
new Analytics();
}
Analytics.instance.configure(app_version);
ReportingManager.configure();
}
static boolean application_exists(Activity activity, String package_name) {
try {
PackageManager pm = activity.getApplication().getPackageManager();
pm.getApplicationInfo(package_name, 0);
return true;
} catch (Exception e) {
return false;
}
}
public static boolean resume(Activity activity) {
if (ad_manager == null) {
return false;
}
ad_manager.activity = activity;
ad_manager.setUpAdColonyFolder();
if (Analytics.instance != null) {
Analytics.instance.updateActiveStatus(true);
}
if (AdColonyVideo.active && AdColonyVideo.video_ad != null) {
if (is_tablet) {
activity.startActivity(new Intent(activity, AdColonyOverlay.class));
} else {
activity.startActivity(new Intent(activity, AdColonyFullscreen.class));
}
return true;
} else if (AdColonyDialog.current != null) {
AdColonyDialog cur = AdColonyDialog.current;
ViewGroup parent = (ViewGroup) cur.getParent();
if (parent != null) {
parent.removeView(cur);
}
new AdColonyDialog(cur.amount, cur.dialog_type, cur.ad);
return true;
} else {
return false;
}
}
public static void pause() {
if (Analytics.instance != null) {
Analytics.instance.updateActiveStatus(false);
}
}
public static void setURLListener(AdColonyURLListener listener) {
url_listener = listener;
}
public static void addV4VCListener(AdColonyV4VCListener listener) {
vc_listeners.add(listener);
}
public static void removeV4VCListener(AdColonyV4VCListener listener) {
vc_listeners.remove(listener);
}
public static String getDeviceID() {
if (device_id == null) {
device_id = Installation.id(activity());
}
return device_id;
}
public static void setDeviceID(String device_id2) {
device_id = device_id2;
}
public static String getCustomID() {
return custom_id;
}
public static void setCustomID(String custom_id2) {
if (custom_id2 == null) {
custom_id2 = "";
}
custom_id = custom_id2;
}
public static Activity activity() {
return adManager().activity;
}
public static FileInputStream openPrivateInputFile(String path) throws IOException {
return activity().openFileInput(path);
}
public static FileOutputStream openPrivateOutputFile(String path) throws IOException {
return activity().openFileOutput(path, 0);
}
public static AdManager adManager() {
if (ad_manager == null) {
throw new RuntimeException("AdColony.configure() must be called before any other AdColony methods.");
}
return ad_manager;
}
public static void logInfo(String message) {
Log.i(LOGTAG, message);
}
public static void logDebug(String message) {
Log.i(LOGTAG, message);
}
public static void logError(String message) {
Log.e(LOGTAG, message);
}
static void trace(String message) {
Toast.makeText(activity(), message, 0).show();
}
static boolean hasLargeMemory(Activity activity) {
try {
Class classActivityManager = Class.forName("android.app.ActivityManager");
ActivityManager mgr = (ActivityManager) activity.getSystemService("activity");
Method m_getMemoryClass = classActivityManager.getDeclaredMethod("getMemoryClass", null);
int mb = ((Integer) m_getMemoryClass.invoke(mgr, new Object[0])).intValue();
logInfo("Device memory class: " + mb + " MB");
return mb > 16;
} catch (Exception e) {
logInfo("Device memory class: 16 MB");
return false;
}
}
public static void onV4VCResult(int playcount) {
boolean success = playcount > 0;
String vc_name = AdColonyVideoAd.vc_name;
int vc_amount = AdColonyVideoAd.vc_amount;
if (!success) {
playcount = 1;
}
for (int i = 1; i <= playcount; i++) {
Iterator i$ = vc_listeners.iterator();
while (i$.hasNext()) {
AdColonyV4VCListener listener = i$.next();
listener.onV4VCResult(success, vc_name, vc_amount);
}
}
}
}