Cyber Surfer v5.2.5版本的 MD5 值为:db13c5fce988de393e52d2679f934b22
以下内容为反编译后的 HyBid.java 源代码,内容仅作参考
package net.pubnative.lite.sdk;
import android.app.Application;
import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Log;
import net.pubnative.lite.sdk.DeviceInfo;
import net.pubnative.lite.sdk.analytics.CrashController;
import net.pubnative.lite.sdk.analytics.Reporting;
import net.pubnative.lite.sdk.analytics.ReportingController;
import net.pubnative.lite.sdk.analytics.ReportingEvent;
import net.pubnative.lite.sdk.analytics.ReportingEventCallback;
import net.pubnative.lite.sdk.api.PNApiClient;
import net.pubnative.lite.sdk.browser.BrowserManager;
import net.pubnative.lite.sdk.db.OnDatabaseResetListener;
import net.pubnative.lite.sdk.location.HyBidLocationManager;
import net.pubnative.lite.sdk.models.AdSize;
import net.pubnative.lite.sdk.models.IntegrationType;
import net.pubnative.lite.sdk.models.PNAdRequest;
import net.pubnative.lite.sdk.models.PNAdRequestFactory;
import net.pubnative.lite.sdk.models.SkipOffset;
import net.pubnative.lite.sdk.prefs.HyBidPreferences;
import net.pubnative.lite.sdk.prefs.SessionImpressionPrefs;
import net.pubnative.lite.sdk.utils.Logger;
import net.pubnative.lite.sdk.utils.PNApiUrlComposer;
import net.pubnative.lite.sdk.utils.SkipOffsetManager;
import net.pubnative.lite.sdk.viewability.ViewabilityManager;
import net.pubnative.lite.sdk.vpaid.VideoAdCache;
import net.pubnative.lite.sdk.vpaid.enums.AudioState;
public class HyBid {
public static final String HYBID_VERSION = "2.20.0";
public static final String OMSDK_VERSION = "1.4.8";
public static final String OM_PARTNER_NAME = "pubnativenet";
private static final String TAG = "HyBid";
private static boolean isCloseVideoAfterFinish = false;
private static boolean isCloseVideoAfterFinishForRewarded = false;
private static boolean isDiagnosticsEnabled = true;
private static Boolean isEndCardEnabled = null;
private static AdCache sAdCache = null;
private static String sAge = null;
private static PNApiClient sApiClient = null;
private static String sAppToken = null;
private static String sAppVersion = null;
private static BrowserManager sBrowserManager = null;
private static String sBundleId = null;
private static String sContentAgeRating = null;
private static boolean sCoppaEnabled = false;
private static CrashController sCrashController = null;
private static String sDeveloperDomain = null;
private static DeviceInfo sDeviceInfo = null;
private static DiagnosticsManager sDiagnosticsManager = null;
private static final boolean sEventLoggingEndpointEnabled = false;
private static String sGender = null;
private static String sIabCategory = null;
private static String sIabSubcategory = null;
private static boolean sInitialized = false;
private static String sKeywords = null;
private static HyBidLocationManager sLocationManager = null;
private static boolean sLocationTrackingEnabled = true;
private static boolean sLocationUpdatesEnabled = true;
private static boolean sMraidExpandEnabled = true;
private static ReportingController sReportingController;
private static boolean sTestMode;
private static UserDataManager sUserDataManager;
private static VgiIdManager sVgiIdManager;
private static VideoAdCache sVideoAdCache;
private static ViewabilityManager sViewabilityManager;
private static SkipOffset sHtmlInterstitialSkipOffset = new SkipOffset(SkipOffsetManager.getDefaultHtmlInterstitialSkipOffset().intValue(), false);
private static SkipOffset sVideoInterstitialSkipOffset = new SkipOffset(SkipOffsetManager.getDefaultVideoWithoutEndCardSkipOffset().intValue(), false);
private static SkipOffset sEndCardCloseButtonDelay = new SkipOffset(SkipOffsetManager.getDefaultEndcardSkipOffset().intValue(), false);
private static Integer skipXmlResource = Integer.valueOf(net.pubnative.lite.sdk.core.R.mipmap.skip);
private static Integer normalCloseXmlResource = -1;
private static Integer pressedCloseXmlResource = -1;
private static InterstitialActionBehaviour sInterstitialActionBehaviour = InterstitialActionBehaviour.HB_CREATIVE;
private static CountdownStyle sCountdownStyle = CountdownStyle.PIE_CHART;
private static AudioState sVideoAudioState = AudioState.ON;
public interface InitialisationListener {
void onInitialisationFinished(boolean z);
}
public static void addReportingCallback(ReportingEventCallback reportingEventCallback) {
sReportingController.addCallback(reportingEventCallback);
}
public static boolean areLocationUpdatesEnabled() {
return sLocationUpdatesEnabled;
}
public static AdCache getAdCache() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getAdCache()");
}
return sAdCache;
}
public static String getAge() {
return sAge;
}
public static PNApiClient getApiClient() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getApiClient()");
}
return sApiClient;
}
public static synchronized String getAppToken() {
String str;
synchronized (HyBid.class) {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getAppToken()");
}
str = sAppToken;
}
return str;
}
public static String getAppVersion() {
return sAppVersion;
}
public static BrowserManager getBrowserManager() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getBrowserManager()");
}
return sBrowserManager;
}
public static String getBundleId() {
return sBundleId;
}
@Deprecated
public static boolean getCloseVideoAfterFinish() {
return isCloseVideoAfterFinish;
}
@Deprecated
public static boolean getCloseVideoAfterFinishForRewarded() {
return isCloseVideoAfterFinishForRewarded;
}
public static String getContentAgeRating() {
return sContentAgeRating;
}
@Deprecated
public static CountdownStyle getCountdownStyle() {
return sCountdownStyle;
}
public static String getCustomRequestSignalData() {
return getCustomRequestSignalData(null);
}
public static String getCustomRequestSignalData(Context context, String str) {
PNAdRequestFactory pNAdRequestFactory = new PNAdRequestFactory();
if (isInitialized()) {
return PNApiUrlComposer.getUrlQuery(getApiClient().getApiUrl(), (PNAdRequest) pNAdRequestFactory.buildRequest("", "", AdSize.SIZE_INTERSTITIAL, "", true, IntegrationType.IN_APP_BIDDING, str, 0));
}
return context == null ? "" : PNApiUrlComposer.getUrlQuery("https://api.pubnative.net/", (PNAdRequest) pNAdRequestFactory.buildRequest(context, "", "", AdSize.SIZE_INTERSTITIAL, "", true, IntegrationType.IN_APP_BIDDING, str, 0));
}
public static String getCustomRequestSignalData(String str) {
return getCustomRequestSignalData(null, str);
}
public static String getDeveloperDomain() {
return sDeveloperDomain;
}
public static DeviceInfo getDeviceInfo() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getDeviceInfo()");
}
return sDeviceInfo;
}
public static DiagnosticsManager getDiagnosticsManager() {
return sDiagnosticsManager;
}
@Deprecated
public static SkipOffset getEndCardCloseButtonDelay() {
return sEndCardCloseButtonDelay;
}
public static String getGender() {
return sGender;
}
@Deprecated
public static SkipOffset getHtmlInterstitialSkipOffset() {
return sHtmlInterstitialSkipOffset;
}
public static String getHyBidVersion() {
return "2.20.0";
}
public static String getIabCategory() {
return sIabCategory;
}
@Deprecated
public static InterstitialActionBehaviour getInterstitialClickBehaviour() {
return sInterstitialActionBehaviour;
}
public static String getKeywords() {
return sKeywords;
}
public static HyBidLocationManager getLocationManager() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getLocationManager()");
}
return sLocationManager;
}
public static Integer getNormalCloseXmlResource() {
return normalCloseXmlResource;
}
public static Integer getPressedCloseXmlResource() {
return pressedCloseXmlResource;
}
public static ReportingController getReportingController() {
return sReportingController;
}
public static String getSDKVersionInfo() {
return new DisplayManager().getDisplayManagerVersion();
}
public static Integer getSkipXmlResource() {
return skipXmlResource;
}
public static UserDataManager getUserDataManager() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getUserDataManager()");
}
return sUserDataManager;
}
public static VgiIdManager getVgiIdManager() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getVgiIdManager()");
}
return sVgiIdManager;
}
public static synchronized VideoAdCache getVideoAdCache() {
VideoAdCache videoAdCache;
synchronized (HyBid.class) {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getVideoAdCache()");
}
videoAdCache = sVideoAdCache;
}
return videoAdCache;
}
@Deprecated
public static AudioState getVideoAudioStatus() {
return sVideoAudioState;
}
@Deprecated
public static SkipOffset getVideoInterstitialSkipOffset() {
return sVideoInterstitialSkipOffset;
}
public static ViewabilityManager getViewabilityManager() {
if (!isInitialized()) {
Log.v(TAG, "HyBid SDK is not initiated yet. Please initiate it before using getViewabilityManager()");
}
return sViewabilityManager;
}
public static String getsIabSubcategory() {
return sIabSubcategory;
}
public static void initialize(String str, Application application) {
initialize(str, application, null);
}
public static void initialize(final String str, final Application application, final InitialisationListener initialisationListener) {
long currentTimeMillis;
sAppToken = str;
try {
currentTimeMillis = application.getApplicationContext().getPackageManager().getPackageInfo(application.getApplicationContext().getPackageName(), 0).firstInstallTime;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
currentTimeMillis = System.currentTimeMillis();
}
HyBidPreferences hyBidPreferences = new HyBidPreferences(application.getApplicationContext());
hyBidPreferences.setAppFirstInstalledTime(String.valueOf(currentTimeMillis));
hyBidPreferences.setSessionTimeStamp(System.currentTimeMillis(), new OnDatabaseResetListener() {
@Override
public final void onDatabaseReset() {
new SessionImpressionPrefs(application.getApplicationContext()).nukePrefs();
}
}, HyBidPreferences.TIMESTAMP.NORMAL);
sBundleId = application.getPackageName();
sApiClient = new PNApiClient(application);
if (application.getSystemService("location") != null) {
sLocationManager = new HyBidLocationManager(application);
if (isLocationTrackingEnabled() && areLocationUpdatesEnabled()) {
sLocationManager.startLocationUpdates();
}
}
sUserDataManager = new UserDataManager(application.getApplicationContext());
sAdCache = new AdCache();
sVideoAdCache = new VideoAdCache();
sBrowserManager = new BrowserManager();
sVgiIdManager = new VgiIdManager(application.getApplicationContext());
if (sReportingController == null) {
sReportingController = new ReportingController();
}
sDiagnosticsManager = new DiagnosticsManager(application.getApplicationContext(), sReportingController);
sViewabilityManager = new ViewabilityManager(application);
if (sCrashController == null) {
sCrashController = new CrashController();
}
if (sDeviceInfo == null) {
DeviceInfo deviceInfo = new DeviceInfo(application.getApplicationContext());
sDeviceInfo = deviceInfo;
deviceInfo.initialize(new DeviceInfo.Listener() {
@Override
public final void onInfoLoaded() {
HyBid.lambda$initialize$1(str, initialisationListener);
}
});
} else if (initialisationListener != null) {
initialisationListener.onInitialisationFinished(true);
}
sInitialized = true;
}
public static boolean isCoppaEnabled() {
return sCoppaEnabled;
}
public static Boolean isDiagnosticsEnabled() {
return Boolean.valueOf(isDiagnosticsEnabled);
}
@Deprecated
public static Boolean isEndCardEnabled() {
return isEndCardEnabled;
}
public static boolean isInitialized() {
return sInitialized;
}
public static boolean isLocationTrackingEnabled() {
return sLocationTrackingEnabled;
}
@Deprecated
public static boolean isMraidExpandEnabled() {
return sMraidExpandEnabled;
}
public static boolean isTestMode() {
return sTestMode;
}
public static boolean isViewabilityMeasurementActivated() {
return sViewabilityManager.isViewabilityMeasurementActivated();
}
public static void lambda$initialize$1(String str, InitialisationListener initialisationListener) {
ReportingEvent reportingEvent = new ReportingEvent();
reportingEvent.setEventType(Reporting.EventType.SDK_INIT);
reportingEvent.setAppToken(str);
sReportingController.reportEvent(reportingEvent);
if (initialisationListener != null) {
initialisationListener.onInitialisationFinished(true);
}
}
public static boolean removeReportingCallback(ReportingEventCallback reportingEventCallback) {
return sReportingController.removeCallback(reportingEventCallback);
}
public static void reportException(Exception exc) {
CrashController crashController = sCrashController;
if (crashController != null) {
ReportingEvent formatException = crashController.formatException(exc);
ReportingController reportingController = sReportingController;
if (reportingController != null) {
reportingController.reportEvent(formatException);
}
}
}
public static void reportException(Throwable th) {
sReportingController.reportEvent(sCrashController.formatException(th));
}
public static void resetSkipOffsetValues() {
sHtmlInterstitialSkipOffset = new SkipOffset(SkipOffsetManager.getDefaultHtmlInterstitialSkipOffset().intValue(), false);
sVideoInterstitialSkipOffset = new SkipOffset(SkipOffsetManager.getDefaultVideoWithoutEndCardSkipOffset().intValue(), false);
sEndCardCloseButtonDelay = new SkipOffset(SkipOffsetManager.getDefaultEndcardSkipOffset().intValue(), false);
}
public static void setAge(String str) {
sAge = str;
}
public static synchronized void setAppToken(String str) {
synchronized (HyBid.class) {
sAppToken = str;
}
}
public static void setAppVersion(String str) {
sAppVersion = str;
}
@Deprecated
public static void setCloseVideoAfterFinish(boolean z) {
isCloseVideoAfterFinish = z;
}
@Deprecated
public static void setCloseVideoAfterFinishForRewarded(boolean z) {
isCloseVideoAfterFinishForRewarded = z;
}
public static void setCloseXmlResource(Integer num, Integer num2) {
normalCloseXmlResource = num;
pressedCloseXmlResource = num2;
}
public static void setContentAgeRating(String str) {
sContentAgeRating = str;
}
public static void setCoppaEnabled(boolean z) {
sCoppaEnabled = z;
}
@Deprecated
public static void setCountdownStyle(CountdownStyle countdownStyle) {
sCountdownStyle = countdownStyle;
}
public static void setDeveloperDomain(String str) {
sDeveloperDomain = str;
}
public static void setDiagnosticsEnabled(Boolean bool) {
isDiagnosticsEnabled = bool.booleanValue();
}
@Deprecated
public static void setEndCardCloseButtonDelay(int i) {
if (i >= 0) {
sEndCardCloseButtonDelay = new SkipOffset(i, true);
}
}
@Deprecated
public static void setEndCardEnabled(boolean z) {
isEndCardEnabled = Boolean.valueOf(z);
}
public static void setGender(String str) {
sGender = str;
}
@Deprecated
public static void setHtmlInterstitialSkipOffset(Integer num) {
if (num.intValue() >= 0) {
sHtmlInterstitialSkipOffset = new SkipOffset(num.intValue(), true);
}
}
public static void setIabCategory(String str) {
sIabCategory = str;
}
public static void setIabSubcategory(String str) {
sIabSubcategory = str;
}
@Deprecated
public static void setInterstitialClickBehaviour(InterstitialActionBehaviour interstitialActionBehaviour) {
sInterstitialActionBehaviour = interstitialActionBehaviour;
}
@Deprecated
public static void setInterstitialSkipOffset(Integer num) {
setHtmlInterstitialSkipOffset(num);
setVideoInterstitialSkipOffset(num);
}
public static void setKeywords(String str) {
sKeywords = str;
}
public static void setLocationTrackingEnabled(boolean z) {
sLocationTrackingEnabled = z;
}
public static void setLocationUpdatesEnabled(boolean z) {
sLocationUpdatesEnabled = z;
}
public static void setLogLevel(Logger.Level level) {
Logger.setLogLevel(level);
}
@Deprecated
public static void setMraidExpandEnabled(boolean z) {
sMraidExpandEnabled = z;
}
public static void setSkipXmlResource(Integer num) {
skipXmlResource = num;
}
public static void setTestMode(boolean z) {
sTestMode = z;
}
@Deprecated
public static void setVideoAudioStatus(AudioState audioState) {
sVideoAudioState = audioState;
}
@Deprecated
public static void setVideoInterstitialSkipOffset(Integer num) {
if (num.intValue() >= 0) {
sVideoInterstitialSkipOffset = new SkipOffset(num.intValue(), true);
}
}
}