Apk Done v1.0版本的 MD5 值为:44cfb8e1ce639995aa7f0de6a3a6388b
以下内容为反编译后的 BannerJavascriptInterface.java 源代码,内容仅作参考
package com.appsgeyser.sdk.ads;
import android.text.TextUtils;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import com.appsgeyser.sdk.AppsgeyserSDK;
import com.appsgeyser.sdk.InternalEntryPoint;
import com.appsgeyser.sdk.ads.BannerJavascriptInterface;
import com.appsgeyser.sdk.configuration.Configuration;
import com.appsgeyser.sdk.hasher.Hasher;
public class BannerJavascriptInterface {
private final AdView adView;
private final AdsLoader adsLoader;
private String androidId;
public BannerJavascriptInterface(AdView adView, AdsLoader adsLoader) {
this.adView = adView;
this.adsLoader = adsLoader;
}
public class AnonymousClass1 implements Runnable {
final String val$hash;
final String val$jsCode;
AnonymousClass1(String str, String str2) {
this.val$hash = str;
this.val$jsCode = str2;
}
@Override
public void run() {
if (BannerJavascriptInterface.this.checkSecurityCode(this.val$hash)) {
BannerJavascriptInterface.this.adView.addJsCode(this.val$jsCode);
if (this.val$jsCode.equals("")) {
return;
}
AppsgeyserSDK.getAdditionalJsCode(new AppsgeyserSDK.OnAdditionalJsLoaded() {
@Override
public final void onJsLoaded(String str) {
BannerJavascriptInterface.AnonymousClass1.this.lambda$run$0$BannerJavascriptInterface$1(str);
}
});
InternalEntryPoint.getInstance().setAdditionalJsCode(this.val$jsCode);
}
}
public void lambda$run$0$BannerJavascriptInterface$1(String str) {
WebView browser = BannerJavascriptInterface.this.adView.getBrowser();
browser.loadUrl("javascript:(function(){ " + str + " })()");
}
}
@JavascriptInterface
public void addJs(String str, String str2) {
this.adView.post(new AnonymousClass1(str2, str));
}
@JavascriptInterface
public void close() {
this.adView.post(new Runnable() {
@Override
public void run() {
BannerJavascriptInterface.this.adView.hide();
}
});
}
@JavascriptInterface
public void setClickUrl(final String str, final String str2) {
this.adView.post(new Runnable() {
@Override
public void run() {
if (BannerJavascriptInterface.this.checkSecurityCode(str2)) {
BannerJavascriptInterface.this.adsLoader.setClickUrl(str);
}
}
});
}
@JavascriptInterface
public String getAndroidId(String str) {
return checkSecurityCode(str) ? this.androidId : "";
}
@JavascriptInterface
public void reload(final String str) {
this.adView.post(new Runnable() {
@Override
public void run() {
if (BannerJavascriptInterface.this.checkSecurityCode(str)) {
BannerJavascriptInterface.this.adsLoader.reload();
}
}
});
}
@JavascriptInterface
public boolean checkSecurityCode(String str) {
Configuration configuration = Configuration.getInstance(this.adView.getContext());
String applicationId = configuration.getApplicationId();
String appGuid = configuration.getAppGuid();
if (TextUtils.isEmpty(applicationId) || TextUtils.isEmpty(appGuid)) {
return false;
}
return str.equalsIgnoreCase(Hasher.md5(appGuid + applicationId));
}
@JavascriptInterface
public void forceOpenInNativeBrowser(boolean z) {
this.adsLoader.forceOpenInNativeBrowser(z);
}
@JavascriptInterface
public void setUniqId(String str) {
this.adView.setUniqueId(str);
}
@JavascriptInterface
public void proceedClick(String str) {
this.adsLoader.proceedClick(str);
}
}