.class public Lcom/mbridge/msdk/c/b/a; .super Ljava/lang/Object; .source "SourceFile" # static fields .field private static final a:Ljava/lang/String; .field private static volatile b:Lcom/mbridge/msdk/c/b/a; # instance fields .field private c:Ljava/lang/String; # direct methods .method static constructor ()V .locals 3 const-string v0, "/iphone|mac|ipad|ipod/i.test(window.navigator.userAgent.toLowerCase())&&(console={},console.log=function(e){var t=document.createElement(\"iframe\");t.setAttribute(\"src\",\"ios-log: \"+e),document.documentElement.appendChild(t),t.parentNode.removeChild(t),t=null},console.debug=console.info=console.warn=console.error=console.log),function(){var e=window.mraid={},t=window.navigator.userAgent.toLowerCase(),n=/iphone|mac|ipad|ipod/i.test(t),r=/android/i.test(t),i=window.mraidbridge={nativeSDKFiredReady:!1,nativeCallQueue:[],nativeCallInFlight:!1,lastSizeChangeProperties:null};function o(e){var t,i;N(s.INFO,\"\u975a\ufffd\ufffd\u9342\ufffd\u4cae\u761c\ufffd:\"+e),n?(t=e,(i=document.createElement(\"iframe\")).setAttribute(\"frameborder\",\"0\"),i.style.cssText=\"width:0;height:0;border:0;display:none;\",i.setAttribute(\"src\",t),setTimeout(function(){document.body.appendChild(i)},5)):r&&window.prompt(e,\"mraid:\")}i.fireChangeEvent=function(e){for(var t in e){if(e.hasOwnProperty(t))(0,A[t])(e[t])}},i.nativeCallComplete=function(e){0!==this.nativeCallQueue.length?o(this.nativeCallQueue.pop()):this.nativeCallInFlight=!1},i.executeNativeCall=function(e){var t=e.shift();if(!this.nativeSDKFiredReady)return console.log(\"rejecting \"+t+\" because mraid is not ready\"),void i.notifyErrorEvent(\"mraid is not ready\",t);for(var n,r,a=\"mraid://\"+t,s=!0,u=0;u=0});t.length>=3&&(C.major=parseInt(t[0],10),C.minor=parseInt(t[1],10),C.patch=parseInt(t[2],10),N(s.INFO,\"Set hostSDKVersion to \"+I(C)))}},P=function(e,t,n,r){if(!r){if(null===e)return N(s.ERROR,\"Required object not provided.\",n),!1;for(var i in t)if(t.hasOwnProperty(i)&&void 0===e[i])return N(s.ERROR,\"Object is missing required property: \"+i,n),!1}for(var o in e){var a=t[o],u=e[o];if(a&&!a(u))return N(s.ERROR,\"Value of property \"+o+\" is invalid: \"+u,n),!1}return!0},b={useCustomClose:function(e){return\"boolean\"==typeof e}};e.addEventListener=function(t,n){t&&n?S(t,s)?(v[t]||(v[t]=new function(t){this.event=t,this.count=0;var n={};this.add=function(e){var t=String(e);n[t]||(n[t]=e,this.count++)},this.remove=function(e){var t=String(e);return!!n[t]&&(n[t]=null,delete n[t],this.count--,!0)},this.removeAll=function(){for(var e in n)n.hasOwnProperty(e)&&this.remove(n[e])},this.broadcast=function(t){for(var r in n)n.hasOwnProperty(r)&&n[r].apply(e,t)},this.toString=function(){var e=[t,\":\"];for(var r in n)n.hasOwnProperty(r)&&e.push(\"|\",r,\"|\");return e.join(\"\")}}(t)),v[t].add(n)):N(s.ERROR,\"Unknown MRAID event: \"+t,\"addEventListener\"):N(s.ERROR,\"Both event and listener are required.\",\"addEventListener\")},e.close=function(){y===a.HIDDEN?N(s.ERROR,\"Ad cannot be closed when it is already hidden.\",\"close\"):i.executeNativeCall([\"close\"])},e.unload=function(){y===a.EXPANDED?N(s.ERROR,\"Ad cannot be unload when it is already EXPANDED.\",\"close\"):i.executeNativeCall([\"unload\"])},e.expand=function(e){if(this.getState()!==a.DEFAULT&&this.getState()!==a.RESIZED)N(s.ERROR,\"Ad can only be expanded from the default or resized state.\",\"expand\");else{var t=[\"expand\",\"shouldUseCustomClose\",!1];e&&(t=t.concat([\"url\",e])),i.executeNativeCall(t)}},e.getExpandProperties=function(){return{width:h.width,height:h.height,useCustomClose:h.useCustomClose,isModal:h.isModal}},e.getCurrentPosition=function(){return{x:d.x,y:d.y,width:d.width,height:d.height}},e.getDefaultPosition=function(){return{x:g.x,y:g.y,width:g.width,height:g.height}},e.getMaxSize=function(){return{width:p.width,height:p.height}},e.getPlacementType=function(){return w},e.getScreenSize=function(){return{width:m.width,height:m.height}},e.getState=function(){return y},e.isViewable=function(){return O},e.getVersion=function(){return e.VERSION},e.getCurrentAppOrientation=function(){return{orientation:E.orientation,locked:E.locked}},e.getAudioVolume=function(){return R},e.open=function(e){e?i.executeNativeCall([\"open\",\"url\",e]):N(s.ERROR,\"URL is required.\",\"open\")},e.removeEventListener=function(e,t){if(e){if(t){var n=!1;if(v[e]&&(n=v[e].remove(t)),!n)return void N(s.ERROR,\"Listener not currently registered for event.\",\"removeEventListener\")}else!t&&v[e]&&v[e].removeAll();v[e]&&0===v[e].count&&(v[e]=null,delete v[e])}else N(s.ERROR,\"Event is required.\",\"removeEventListener\")},e.setExpandProperties=function(e){P(e,b,\"setExpandProperties\",!0)&&e.hasOwnProperty(\"useCustomClose\")&&(h.useCustomClose=!1)},e.useCustomClose=function(e){},e.createCalendarEvent=function(e){D.initialize(e),D.parse()?i.executeNativeCall(D.arguments):N(s.ERROR,D.errors[0],\"createCalendarEvent\")},e.supports=function(e){return f[e]},e.playVideo=function(t){e.isViewable()?t?i.executeNativeCall([\"playVideo\",\"uri\",t]):N(s.ERROR,\"playVideo must be called with a valid URI\",\"playVideo\"):N(s.ERROR,\"playVideo cannot be called until the ad is viewable\",\"playVideo\")},e.storePicture=function(t){e.isViewable()?t?i.executeNativeCall([\"storePicture\",\"uri\",t]):N(s.ERROR,\"storePicture must be called with a valid URI\",\"storePicture\"):N(s.ERROR,\"storePicture cannot be called until the ad is viewable\",\"storePicture\")};var V={width:function(e){return!isNaN(e)&&e>0},height:function(e){return!isNaN(e)&&e>0},offsetX:function(e){return!isNaN(e)},offsetY:function(e){return!isNaN(e)},customClosePosition:function(e){return\"string\"==typeof e&&[\"top-right\",\"bottom-right\",\"top-left\",\"bottom-left\",\"center\",\"top-center\",\"bottom-center\"].indexOf(e)>-1},allowOffscreen:function(e){return\"boolean\"==typeof e}};e.setOrientationProperties=function(e){e.hasOwnProperty(\"allowOrientationChange\")&&(c.allowOrientationChange=e.allowOrientationChange),e.hasOwnProperty(\"forceOrientation\")&&(c.forceOrientation=e.forceOrientation);var t=[\"setOrientationProperties\",\"allowOrientationChange\",c.allowOrientationChange,\"forceOrientation\",c.forceOrientation];i.executeNativeCall(t)},e.getOrientationProperties=function(){return{allowOrientationChange:c.allowOrientationChange,forceOrientation:c.forceOrientation}},e.resize=function(){if(this.getState()!==a.DEFAULT&&this.getState()!==a.RESIZED)N(s.ERROR,\"Ad can only be resized from the default or resized state.\",\"resize\");else if(l.width&&l.height){var e=[\"resize\",\"width\",l.width,\"height\",l.height,\"offsetX\",l.offsetX||0,\"offsetY\",l.offsetY||0,\"customClosePosition\",l.customClosePosition,\"allowOffscreen\",!!l.allowOffscreen];i.executeNativeCall(e)}else N(s.ERROR,\"Must set resize properties before calling resize()\",\"resize\")},e.getResizeProperties=function(){return{width:l.width,height:l.height,offsetX:l.offsetX,offsetY:l.offsetY,customClosePosition:l.customClosePosition,allowOffscreen:l.allowOffscreen}},e.setResizeProperties=function(e){if(P(e,V,\"setResizeProperties\",!0))for(var t=[\"width\",\"height\",\"offsetX\",\"offsetY\",\"customClosePosition\",\"allowOffscreen\"],n=t.length,r=0;rreplaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object v0 const-string v1, "(?m)^//.*(?=\\n)" invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object v0 sput-object v0, Lcom/mbridge/msdk/c/b/a;->a:Ljava/lang/String; return-void .end method .method private constructor ()V .locals 0 .line 30 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method public static a()Lcom/mbridge/msdk/c/b/a; .locals 2 sget-object v0, Lcom/mbridge/msdk/c/b/a;->b:Lcom/mbridge/msdk/c/b/a; if-nez v0, :cond_1 const-class v0, Lcom/mbridge/msdk/c/b/a; .line 35 monitor-enter v0 :try_start_0 sget-object v1, Lcom/mbridge/msdk/c/b/a;->b:Lcom/mbridge/msdk/c/b/a; if-nez v1, :cond_0 .line 36 new-instance v1, Lcom/mbridge/msdk/c/b/a; invoke-direct {v1}, Lcom/mbridge/msdk/c/b/a;->()V sput-object v1, Lcom/mbridge/msdk/c/b/a;->b:Lcom/mbridge/msdk/c/b/a; goto :goto_0 :catchall_0 move-exception v1 goto :goto_1 .line 37 :cond_0 :goto_0 monitor-exit v0 goto :goto_2 :goto_1 monitor-exit v0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw v1 :cond_1 :goto_2 sget-object v0, Lcom/mbridge/msdk/c/b/a;->b:Lcom/mbridge/msdk/c/b/a; return-object v0 .end method .method public static synthetic a(Lcom/mbridge/msdk/c/b/a;Ljava/lang/String;)Ljava/lang/String; .locals 0 .line 23 iput-object p1, p0, Lcom/mbridge/msdk/c/b/a;->c:Ljava/lang/String; return-object p1 .end method .method public static synthetic b(Lcom/mbridge/msdk/c/b/a;Ljava/lang/String;)V .locals 2 .line 1115 new-instance v0, Ljava/lang/Thread; new-instance v1, Lcom/mbridge/msdk/c/b/a$2; invoke-direct {v1, p0, p1}, Lcom/mbridge/msdk/c/b/a$2;->(Lcom/mbridge/msdk/c/b/a;Ljava/lang/String;)V invoke-direct {v0, v1}, Ljava/lang/Thread;->(Ljava/lang/Runnable;)V .line 1130 invoke-virtual {v0}, Ljava/lang/Thread;->start()V return-void .end method .method private c()Ljava/lang/String; .locals 4 const-string v0, "" .line 67 :try_start_0 sget-object v1, Lcom/mbridge/msdk/foundation/same/b/c;->i:Lcom/mbridge/msdk/foundation/same/b/c; invoke-static {v1}, Lcom/mbridge/msdk/foundation/same/b/e;->a(Lcom/mbridge/msdk/foundation/same/b/c;)Ljava/lang/String; move-result-object v1 const-string v2, "mraid_js.txt" .line 69 new-instance v3, Ljava/io/File; invoke-direct {v3, v1, v2}, Ljava/io/File;->(Ljava/lang/String;Ljava/lang/String;)V .line 70 invoke-virtual {v3}, Ljava/io/File;->exists()Z move-result v1 if-eqz v1, :cond_0 invoke-virtual {v3}, Ljava/io/File;->canRead()Z move-result v1 if-eqz v1, :cond_0 .line 71 invoke-static {v3}, Lcom/mbridge/msdk/foundation/tools/ad;->b(Ljava/io/File;)Ljava/lang/String; move-result-object v0 :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 move-exception v1 const-string v2, "MraidJSController" .line 74 invoke-virtual {v1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object v1 invoke-static {v2, v1}, Lcom/mbridge/msdk/foundation/tools/af;->a(Ljava/lang/String;Ljava/lang/String;)V :cond_0 :goto_0 return-object v0 .end method # virtual methods .method public final a(Landroid/content/Context;Ljava/lang/String;)V .locals 10 if-nez p1, :cond_0 return-void .line 85 :cond_0 invoke-static {}, Lcom/mbridge/msdk/foundation/a/a/a;->a()Lcom/mbridge/msdk/foundation/a/a/a; move-result-object v0 const-string v1, "MraidJSController" invoke-virtual {v0, v1}, Lcom/mbridge/msdk/foundation/a/a/a;->a(Ljava/lang/String;)Ljava/lang/String; move-result-object v0 .line 86 invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z move-result v2 if-nez v2, :cond_1 invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_1 return-void .line 91 :cond_1 :try_start_0 new-instance v2, Lcom/mbridge/msdk/c/a/a; invoke-direct {v2, p1}, Lcom/mbridge/msdk/c/a/a;->(Landroid/content/Context;)V const/4 v3, 0x0 const/4 v5, 0x0 .line 92 new-instance v6, Lcom/mbridge/msdk/c/b/a$1; invoke-direct {v6, p0, p2}, Lcom/mbridge/msdk/c/b/a$1;->(Lcom/mbridge/msdk/c/b/a;Ljava/lang/String;)V const-string v7, "mraid_js" const-wide/32 v8, 0xea60 move-object v4, p2 invoke-virtual/range {v2 .. v9}, Lcom/mbridge/msdk/foundation/same/net/f/c;->get(ILjava/lang/String;Lcom/mbridge/msdk/foundation/same/net/f/e;Lcom/mbridge/msdk/foundation/same/net/b;Ljava/lang/String;J)V :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_0 :catch_0 move-exception p1 .line 109 invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String; move-result-object p1 invoke-static {v1, p1}, Lcom/mbridge/msdk/foundation/tools/af;->b(Ljava/lang/String;Ljava/lang/String;)V :goto_0 return-void .end method .method public final b()Ljava/lang/String; .locals 2 :try_start_0 iget-object v0, p0, Lcom/mbridge/msdk/c/b/a;->c:Ljava/lang/String; .line 45 invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z move-result v0 if-eqz v0, :cond_0 .line 46 invoke-direct {p0}, Lcom/mbridge/msdk/c/b/a;->c()Ljava/lang/String; move-result-object v0 iput-object v0, p0, Lcom/mbridge/msdk/c/b/a;->c:Ljava/lang/String; :cond_0 iget-object v0, p0, Lcom/mbridge/msdk/c/b/a;->c:Ljava/lang/String; .line 49 invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z move-result v0 if-eqz v0, :cond_2 .line 50 invoke-static {}, Lcom/mbridge/msdk/c/h;->a()Lcom/mbridge/msdk/c/h; move-result-object v0 invoke-static {}, Lcom/mbridge/msdk/foundation/controller/c;->m()Lcom/mbridge/msdk/foundation/controller/c; move-result-object v1 invoke-virtual {v1}, Lcom/mbridge/msdk/foundation/controller/a;->k()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Lcom/mbridge/msdk/c/h;->b(Ljava/lang/String;)Lcom/mbridge/msdk/c/g; move-result-object v0 if-eqz v0, :cond_1 .line 51 invoke-virtual {v0}, Lcom/mbridge/msdk/c/b;->U()Ljava/lang/String; move-result-object v1 invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z move-result v1 if-nez v1, :cond_1 .line 52 invoke-static {}, Lcom/mbridge/msdk/foundation/controller/c;->m()Lcom/mbridge/msdk/foundation/controller/c; move-result-object v1 invoke-virtual {v1}, Lcom/mbridge/msdk/foundation/controller/a;->c()Landroid/content/Context; move-result-object v1 invoke-virtual {v0}, Lcom/mbridge/msdk/c/b;->U()Ljava/lang/String; move-result-object v0 invoke-virtual {p0, v1, v0}, Lcom/mbridge/msdk/c/b/a;->a(Landroid/content/Context;Ljava/lang/String;)V :cond_1 sget-object v0, Lcom/mbridge/msdk/c/b/a;->a:Ljava/lang/String; return-object v0 :cond_2 iget-object v0, p0, Lcom/mbridge/msdk/c/b/a;->c:Ljava/lang/String; :try_end_0 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0 return-object v0 :catch_0 sget-object v0, Lcom/mbridge/msdk/c/b/a;->a:Ljava/lang/String; return-object v0 .end method