花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.bytedance.sdk.openadsdk.api.plugin;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.CSJAdError;
import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAppContextHolder;
import com.bytedance.sdk.openadsdk.TTPluginListener;
import com.bytedance.sdk.openadsdk.common.CommonListener;
import com.bytedance.sdk.openadsdk.downloadnew.core.ExitInstallListener;
import java.lang.ref.WeakReference;
import java.util.concurrent.ScheduledExecutorService;
public final class a implements TTAdManager {
static final a a = new a();
private volatile TTAdManager b;
public class AnonymousClass1 implements b<TTAdNative> {
TTAdNative a;
final WeakReference b;
AnonymousClass1(WeakReference weakReference) {
this.b = weakReference;
}
@Override
public void a(final InterfaceC0124a<TTAdNative> interfaceC0124a) {
TTAdNative tTAdNative = this.a;
if (tTAdNative != null) {
interfaceC0124a.a(tTAdNative);
} else {
a.this.call(new InterfaceC0124a<TTAdManager>() {
@Override
public void a(TTAdManager tTAdManager) {
AnonymousClass1 anonymousClass1 = AnonymousClass1.this;
anonymousClass1.a = tTAdManager.createAdNative((Context) anonymousClass1.b.get());
interfaceC0124a.a(AnonymousClass1.this.a);
}
});
}
}
}
public interface InterfaceC0124a<T> {
void a(T t);
}
public interface b<T> {
void a(InterfaceC0124a<T> interfaceC0124a);
}
private interface c<T> extends InterfaceC0124a<T> {
void a();
}
private static final class d implements TTAdNative {
private b<TTAdNative> a;
public d(b<TTAdNative> bVar) {
this.a = bVar;
}
private final void a(CommonListener commonListener, InterfaceC0124a<TTAdNative> interfaceC0124a) {
try {
this.a.a(interfaceC0124a);
} catch (Throwable th) {
if (commonListener != null) {
commonListener.onError(4202, "Load ad failed: " + th.getMessage());
}
}
}
@Override
public void loadBannerExpressAd(final AdSlot adSlot, final TTAdNative.NativeExpressAdListener nativeExpressAdListener) {
a(nativeExpressAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadBannerExpressAd(adSlot, nativeExpressAdListener);
}
});
}
@Override
public void loadDrawFeedAd(final AdSlot adSlot, final TTAdNative.DrawFeedAdListener drawFeedAdListener) {
a(drawFeedAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadDrawFeedAd(adSlot, drawFeedAdListener);
}
});
}
@Override
public void loadExpressDrawFeedAd(final AdSlot adSlot, final TTAdNative.NativeExpressAdListener nativeExpressAdListener) {
a(nativeExpressAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadExpressDrawFeedAd(adSlot, nativeExpressAdListener);
}
});
}
@Override
public void loadFeedAd(final AdSlot adSlot, final TTAdNative.FeedAdListener feedAdListener) {
a(feedAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadFeedAd(adSlot, feedAdListener);
}
});
}
@Override
public void loadFullScreenVideoAd(final AdSlot adSlot, final TTAdNative.FullScreenVideoAdListener fullScreenVideoAdListener) {
a(fullScreenVideoAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadFullScreenVideoAd(adSlot, fullScreenVideoAdListener);
}
});
}
@Override
public void loadInteractionExpressAd(final AdSlot adSlot, final TTAdNative.NativeExpressAdListener nativeExpressAdListener) {
a(nativeExpressAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadInteractionExpressAd(adSlot, nativeExpressAdListener);
}
});
}
@Override
public void loadNativeAd(final AdSlot adSlot, final TTAdNative.NativeAdListener nativeAdListener) {
a(nativeAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadNativeAd(adSlot, nativeAdListener);
}
});
}
@Override
public void loadNativeExpressAd(final AdSlot adSlot, final TTAdNative.NativeExpressAdListener nativeExpressAdListener) {
a(nativeExpressAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadNativeExpressAd(adSlot, nativeExpressAdListener);
}
});
}
@Override
public void loadRewardVideoAd(final AdSlot adSlot, final TTAdNative.RewardVideoAdListener rewardVideoAdListener) {
a(rewardVideoAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadRewardVideoAd(adSlot, rewardVideoAdListener);
}
});
}
@Override
public void loadSplashAd(final AdSlot adSlot, final TTAdNative.SplashAdListener splashAdListener, final int i2) {
a(splashAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadSplashAd(adSlot, splashAdListener, i2);
}
});
}
@Override
public void loadStream(final AdSlot adSlot, final TTAdNative.FeedAdListener feedAdListener) {
a(feedAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadStream(adSlot, feedAdListener);
}
});
}
@Override
public void loadSplashAd(final AdSlot adSlot, final TTAdNative.CSJSplashAdListener cSJSplashAdListener, final int i2) {
a(cSJSplashAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadSplashAd(adSlot, cSJSplashAdListener, i2);
}
});
}
private final void a(TTAdNative.CSJSplashAdListener cSJSplashAdListener, InterfaceC0124a<TTAdNative> interfaceC0124a) {
try {
this.a.a(interfaceC0124a);
} catch (Throwable th) {
if (cSJSplashAdListener != null) {
cSJSplashAdListener.onSplashLoadFail(new CSJAdError(4202, "Load ad failed: " + th.getMessage()));
}
}
}
@Override
public void loadSplashAd(final AdSlot adSlot, final TTAdNative.SplashAdListener splashAdListener) {
a(splashAdListener, new InterfaceC0124a<TTAdNative>() {
@Override
public void a(TTAdNative tTAdNative) {
tTAdNative.loadSplashAd(adSlot, splashAdListener);
}
});
}
}
a() {
}
public final void call(final InterfaceC0124a<TTAdManager> interfaceC0124a) {
if (this.b != null) {
try {
interfaceC0124a.a(this.b);
return;
} catch (Throwable th) {
com.bytedance.sdk.openadsdk.api.a.d("PluginDefaultAdManager", "Unexpected manager call error: " + th.getMessage());
f.a(th);
return;
}
}
ScheduledExecutorService scheduledExecutorService = g.a;
if (scheduledExecutorService != null) {
scheduledExecutorService.submit(new Runnable() {
@Override
public void run() {
try {
if (a.this.b != null) {
interfaceC0124a.a(a.this.b);
return;
}
if (interfaceC0124a instanceof c) {
((c) interfaceC0124a).a();
}
com.bytedance.sdk.openadsdk.api.a.d("PluginDefaultAdManager", "Not ready, no manager");
} catch (Throwable th2) {
com.bytedance.sdk.openadsdk.api.a.d("PluginDefaultAdManager", "Unexpected manager call error: " + th2.getMessage());
f.a(th2);
}
}
});
} else {
com.bytedance.sdk.openadsdk.api.a.d("PluginDefaultAdManager", "Not ready, no executor");
}
}
@Override
public TTAdNative createAdNative(Context context) {
return new d(new AnonymousClass1(new WeakReference(context)));
}
@Override
public String getBiddingToken(AdSlot adSlot) {
if (this.b != null) {
return this.b.getBiddingToken(adSlot);
}
return null;
}
@Override
public <T> T getExtra(final Class<T> cls, final Bundle bundle) {
if (this.b != null) {
return (T) this.b.getExtra(cls, bundle);
}
if (cls == Bundle.class && bundle != null && bundle.getInt("action", 0) == 1) {
call(new c<TTAdManager>() {
@Override
public void a() {
com.bytedance.sdk.openadsdk.api.plugin.d.a(bundle);
}
@Override
public void a(TTAdManager tTAdManager) {
tTAdManager.getExtra(cls, bundle);
}
});
return null;
}
call(new InterfaceC0124a<TTAdManager>() {
@Override
public void a(TTAdManager tTAdManager) {
tTAdManager.getExtra(cls, bundle);
}
});
return null;
}
@Override
public String getPluginVersion() {
return this.b != null ? this.b.getPluginVersion() : "";
}
@Override
public String getSDKVersion() {
return "4.9.0.4";
}
@Override
public int getThemeStatus() {
if (this.b != null) {
return this.b.getThemeStatus();
}
return 0;
}
@Override
public boolean onlyVerityPlayable(String str, int i2, String str2, String str3, String str4) {
if (this.b != null) {
return this.b.onlyVerityPlayable(str, i2, str2, str3, str4);
}
return false;
}
@Override
public void register(final Object obj) {
final Bundle bundle;
if (obj instanceof TTPluginListener) {
TTPluginListener tTPluginListener = (TTPluginListener) obj;
bundle = f.a(TTAppContextHolder.getContext()).a(tTPluginListener.packageName(), tTPluginListener.config());
} else {
bundle = obj;
}
call(new InterfaceC0124a<TTAdManager>() {
@Override
public void a(TTAdManager tTAdManager) {
tTAdManager.register(bundle);
if (obj instanceof TTPluginListener) {
f.a(TTAppContextHolder.getContext()).a((TTPluginListener) obj);
}
}
});
}
@Override
public void requestPermissionIfNecessary(final Context context) {
call(new InterfaceC0124a<TTAdManager>() {
@Override
public void a(TTAdManager tTAdManager) {
tTAdManager.requestPermissionIfNecessary(context);
}
});
}
@Override
public void setThemeStatus(final int i2) {
call(new InterfaceC0124a<TTAdManager>() {
@Override
public void a(TTAdManager tTAdManager) {
a.this.b.setThemeStatus(i2);
}
});
}
@Override
public boolean tryShowInstallDialogWhenExit(Activity activity, ExitInstallListener exitInstallListener) {
return this.b != null && this.b.tryShowInstallDialogWhenExit(activity, exitInstallListener);
}
@Override
public void unregister(final Object obj) {
call(new InterfaceC0124a<TTAdManager>() {
@Override
public void a(TTAdManager tTAdManager) {
tTAdManager.unregister(obj);
}
});
}
@Override
public String getBiddingToken(AdSlot adSlot, boolean z, int i2) {
if (this.b != null) {
return this.b.getBiddingToken(adSlot, z, i2);
}
return null;
}
public void a(TTAdManager tTAdManager) {
this.b = tTAdManager;
}
}