13Poker by gametower unlimited gems v0.4版本的 MD5 值为:51324fc0f195c34821074948ab266846

以下内容为反编译后的 ft.java 源代码,内容仅作参考


package com.flurry.android;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.MediaController;
import android.widget.RelativeLayout;
import com.adfonic.android.utils.HtmlFormatter;
import com.xbtsol.jynvrt161024.IVastConstant;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public final class ft extends p implements DialogInterface.OnKeyListener, MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener, MediaPlayer.OnPreparedListener, au {
    private Context Q;
    private View cJ;
    private int cK;
    private FrameLayout cM;
    private WebView eq;
    private WebViewClient er;
    private WebChromeClient es;
    private FlurryAds fI;
    private ProgressDialog fu;
    private MediaController fx;
    private gk hN;
    private boolean hO;
    private boolean hP;
    private WebChromeClient.CustomViewCallback hQ;
    private Dialog hR;
    private int hS;
    private Dialog hT;
    private FrameLayout hU;
    private boolean hV;
    private boolean hW;
    private boolean hX;
    private AlertDialog hY;
    private List<AdFrame> hZ;
    private aa hk;
    private boolean ia;
    private Map<String, AdUnit> ib;
    private Map<String, cw> ic;
    private Activity id;
    private String ie;
    private List<String> f2if;
    private final String p;

    public static void c(ft ftVar) {
        if (ftVar.hP) {
            return;
        }
        if (ftVar.eq != null) {
            ftVar.eq.loadUrl("javascript:(function() {var Hogan={};(function(Hogan,useArrayBuffer){Hogan.Template=function(renderFunc,text,compiler,options){this.r=renderFunc||this.r;this.c=compiler;this.options=options;this.text=text||\"\";this.buf=useArrayBuffer?[]:\"\"};Hogan.Template.prototype={r:function(context,partials,indent){return\"\"},v:hoganEscape,t:coerceToString,render:function render(context,partials,indent){return this.ri([context],partials||{},indent)},ri:function(context,partials,indent){return this.r(context,partials,indent)},rp:function(name,context,partials,indent){var partial=partials[name];if(!partial)return\"\";if(this.c&&typeof partial==\"string\")partial=this.c.compile(partial,this.options);return partial.ri(context,partials,indent)},rs:function(context,partials,section){var tail=context[context.length-1];if(!isArray(tail)){section(context,partials,this);return}for(var i=0;i<tail.length;i++){context.push(tail[i]);section(context,partials,this);context.pop()}},s:function(val,ctx,partials,inverted,start,end,tags){var pass;if(isArray(val)&&val.length===0)return false;if(typeof val==\"function\")val=this.ls(val,ctx,partials,inverted,start,end,tags);pass=val===\"\"||!!val;if(!inverted&&pass&&ctx)ctx.push(typeof val==\"object\"?val:ctx[ctx.length-1]);return pass},d:function(key,ctx,partials,returnFound){var names=key.split(\".\"),val=this.f(names[0],ctx,partials,returnFound),cx=null;if(key===\".\"&&isArray(ctx[ctx.length-2]))return ctx[ctx.length-1];for(var i=1;i<names.length;i++)if(val&&typeof val==\"object\"&&names[i]in val){cx=val;val=val[names[i]]}else val=\"\";if(returnFound&&!val)return false;if(!returnFound&&typeof val==\"function\"){ctx.push(cx);val=this.lv(val,ctx,partials);ctx.pop()}return val},f:function(key,ctx,partials,returnFound){var val=false,v=null,found=false;for(var i=ctx.length-1;i>=0;i--){v=ctx[i];if(v&&typeof v==\"object\"&&key in v){val=v[key];found=true;break}}if(!found)return returnFound?false:\"\";if(!returnFound&&typeof val==\"function\")val=this.lv(val,ctx,partials);return val},ho:function(val,cx,partials,text,tags){var compiler=this.c;var options=this.options;options.delimiters=tags;var t=val.call(cx,text,function(t){return compiler.compile(t,options).render(cx,partials)});this.b(compiler.compile(t.toString(),options).render(cx,partials));return false},b:useArrayBuffer?function(s){this.buf.push(s)}:function(s){this.buf+=s},fl:useArrayBuffer?function(){var r=this.buf.join(\"\");this.buf=[];return r}:function(){var r=this.buf;this.buf=\"\";return r},ls:function(val,ctx,partials,inverted,start,end,tags){var cx=ctx[ctx.length-1],t=null;if(!inverted&&this.c&&val.length>0)return this.ho(val,cx,partials,this.text.substring(start,end),tags);t=val.call(cx);if(typeof t==\"function\")if(inverted)return true;else if(this.c)return this.ho(t,cx,partials,this.text.substring(start,end),tags);return t},lv:function(val,ctx,partials){var cx=ctx[ctx.length-1];var result=val.call(cx);if(typeof result==\"function\")result=result.call(cx);result=coerceToString(result);if(this.c&&~result.indexOf(\"{{\"))return this.c.compile(result,this.options).render(cx,partials);return result}};var rAmp=/&/g,rLt=/</g,rGt=/>/g,rApos=/\\'/g,rQuot=/\\\"/g,hChars=/[&<>\\\"\\']/;function coerceToString(val){return String(val===null||val===undefined?\"\":val)}function hoganEscape(str){str=coerceToString(str);return hChars.test(str)?str.replace(rAmp,\"&amp;\").replace(rLt,\"&lt;\").replace(rGt,\"&gt;\").replace(rApos,\"&#39;\").replace(rQuot,\"&quot;\"):str}var isArray=Array.isArray||function(a){return Object.prototype.toString.call(a)===\"[object Array]\"}})(typeof exports!==\"undefined\"?exports:Hogan);(function(Hogan){var rIsWhitespace=/\\S/,rQuot=/\\\"/g,rNewline=/\\n/g,rCr=/\\r/g,rSlash=/\\\\/g,tagTypes={\"#\":1,\"^\":2,\"/\":3,\"!\":4,\">\":5,\"<\":6,\"=\":7,\"_v\":8,\"{\":9,\"&\":10};Hogan.scan=function scan(text,delimiters){var len=text.length,IN_TEXT=0,IN_TAG_TYPE=1,IN_TAG=2,state=IN_TEXT,tagType=null,tag=null,buf=\"\",tokens=[],seenTag=false,i=0,lineStart=0,otag=\"{{\",ctag=\"}}\";function addBuf(){if(buf.length>0){tokens.push(new String(buf));buf=\"\"}}function lineIsWhitespace(){var isAllWhitespace=true;for(var j=lineStart;j<tokens.length;j++){isAllWhitespace=tokens[j].tag&&tagTypes[tokens[j].tag]<tagTypes[\"_v\"]||!tokens[j].tag&&tokens[j].match(rIsWhitespace)===null;if(!isAllWhitespace)return false}return isAllWhitespace}function filterLine(haveSeenTag,noNewLine){addBuf();if(haveSeenTag&&lineIsWhitespace())for(var j=lineStart,next;j<tokens.length;j++){if(!tokens[j].tag){if((next=tokens[j+1])&&next.tag==\">\")next.indent=tokens[j].toString();tokens.splice(j,1)}}else if(!noNewLine)tokens.push({tag:\"\\n\"});seenTag=false;lineStart=tokens.length}function changeDelimiters(text,index){var close=\"=\"+ctag,closeIndex=text.indexOf(close,index),delimiters=trim(text.substring(text.indexOf(\"=\",index)+1,closeIndex)).split(\" \");otag=delimiters[0];ctag=delimiters[1];return closeIndex+close.length-1}if(delimiters){delimiters=delimiters.split(\" \");otag=delimiters[0];ctag=delimiters[1]}for(i=0;i<len;i++)if(state==IN_TEXT)if(tagChange(otag,text,i)){--i;addBuf();state=IN_TAG_TYPE}else if(text.charAt(i)==\"\\n\")filterLine(seenTag);else buf+=text.charAt(i);else if(state==IN_TAG_TYPE){i+=otag.length-1;tag=tagTypes[text.charAt(i+1)];tagType=tag?text.charAt(i+1):\"_v\";if(tagType==\"=\"){i=changeDelimiters(text,i);state=IN_TEXT}else{if(tag)i++;state=IN_TAG}seenTag=i}else if(tagChange(ctag,text,i)){tokens.push({tag:tagType,n:trim(buf),otag:otag,ctag:ctag,i:tagType==\"/\"?seenTag-ctag.length:i+otag.length});buf=\"\";i+=ctag.length-1;state=IN_TEXT;if(tagType==\"{\")if(ctag==\"}}\")i++;else cleanTripleStache(tokens[tokens.length-1])}else buf+=text.charAt(i);filterLine(seenTag,true);return tokens};function cleanTripleStache(token){if(token.n.substr(token.n.length-1)===\"}\")token.n=token.n.substring(0,token.n.length-1)}function trim(s){if(s.trim)return s.trim();return s.replace(/^\\s*|\\s*$/g,\"\")}function tagChange(tag,text,index){if(text.charAt(index)!=tag.charAt(0))return false;for(var i=1,l=tag.length;i<l;i++)if(text.charAt(index+i)!=tag.charAt(i))return false;return true}function buildTree(tokens,kind,stack,customTags){var instructions=[],opener=null,token=null;while(tokens.length>0){token=tokens.shift();if(token.tag==\"#\"||token.tag==\"^\"||isOpener(token,customTags)){stack.push(token);token.nodes=buildTree(tokens,token.tag,stack,customTags);instructions.push(token)}else if(token.tag==\"/\"){if(stack.length===0)throw new Error(\"Closing tag without opener: /\"+token.n);opener=stack.pop();if(token.n!=opener.n&&!isCloser(token.n,opener.n,customTags))throw new Error(\"Nesting error: \"+opener.n+\" vs. \"+token.n);opener.end=token.i;return instructions}else instructions.push(token)}if(stack.length>0)throw new Error(\"missing closing tag: \"+stack.pop().n);return instructions}function isOpener(token,tags){for(var i=0,l=tags.length;i<l;i++)if(tags[i].o==token.n){token.tag=\"#\";return true}}function isCloser(close,open,tags){for(var i=0,l=tags.length;i<l;i++)if(tags[i].c==close&&tags[i].o==open)return true}function writeCode(tree){return'var _=this;_.b(i=i||\"\");'+walk(tree)+\"return _.fl();\"}Hogan.generate=function(code,text,options){if(options.asString)return\"function(c,p,i){\"+code+\";}\";return new Hogan.Template(new Function(\"c\",\"p\",\"i\",code),text,Hogan,options)};function esc(s){return s.replace(rSlash,\"\\\\\\\\\").replace(rQuot,'\\\\\"').replace(rNewline,\"\\\\n\").replace(rCr,\"\\\\r\")}function chooseMethod(s){return~s.indexOf(\".\")?\"d\":\"f\"}function walk(tree){var code=\"\";for(var i=0,l=tree.length;i<l;i++){var tag=tree[i].tag;if(tag==\"#\")code+=section(tree[i].nodes,tree[i].n,chooseMethod(tree[i].n),tree[i].i,tree[i].end,tree[i].otag+\" \"+tree[i].ctag);else if(tag==\"^\")code+=invertedSection(tree[i].nodes,tree[i].n,chooseMethod(tree[i].n));else if(tag==\"<\"||tag==\">\")code+=partial(tree[i]);else if(tag==\"{\"||tag==\"&\")code+=tripleStache(tree[i].n,chooseMethod(tree[i].n));else if(tag==\"\\n\")code+=text('\"\\\\n\"'+(tree.length-1==i?\"\":\" + i\"));else if(tag==\"_v\")code+=variable(tree[i].n,chooseMethod(tree[i].n));else if(tag===undefined)code+=text('\"'+esc(tree[i])+'\"')}return code}function section(nodes,id,method,start,end,tags){return\"if(_.s(_.\"+method+'(\"'+esc(id)+'\",c,p,1),'+\"c,p,0,\"+start+\",\"+end+',\"'+tags+'\")){'+\"_.rs(c,p,\"+\"function(c,p,_){\"+walk(nodes)+\"});c.pop();}\"}function invertedSection(nodes,id,method){return\"if(!_.s(_.\"+method+'(\"'+esc(id)+'\",c,p,1),c,p,1,0,0,\"\")){'+walk(nodes)+\"};\"}function partial(tok){return'_.b(_.rp(\"'+esc(tok.n)+'\",c,p,\"'+(tok.indent||\"\")+'\"));'}function tripleStache(id,method){return\"_.b(_.t(_.\"+method+'(\"'+esc(id)+'\",c,p,0)));'}function variable(id,method){return\"_.b(_.v(_.\"+method+'(\"'+esc(id)+'\",c,p,0)));'}function text(id){return\"_.b(\"+id+\");\"}Hogan.parse=function(tokens,text,options){options=options||{};return buildTree(tokens,\"\",[],options.sectionTags||[])},Hogan.cache={};Hogan.compile=function(text,options){options=options||{};var key=text+\"||\"+!!options.asString;var t=this.cache[key];if(t)return t;t=this.generate(writeCode(this.parse(this.scan(text,options.delimiters),text,options)),text,options);return this.cache[key]=t}})(typeof exports!==\"undefined\"?exports:Hogan);var flurryBridgeCtor=function(w){var flurryadapter={};flurryadapter.flurryCallQueue=[];flurryadapter.flurryCallInProgress=false;flurryadapter.callComplete=function(cmd){if(this.flurryCallQueue.length==0){this.flurryCallInProgress=false;return}var adapterCall=this.flurryCallQueue.splice(0,1)[0];this.executeNativeCall(adapterCall);return\"OK\"};flurryadapter.executeCall=function(command){var adapterCall=\"flurry://flurrycall?event=\"+command;var value;for(var i=1;i<arguments.length;i+=2){value=arguments[i+1];if(value==null)continue;adapterCall+=\"&\"+arguments[i]+\"=\"+escape(value)}if(this.flurryCallInProgress)this.flurryCallQueue.push(adapterCall);else this.executeNativeCall(adapterCall)};flurryadapter.executeNativeCall=function(adapterCall){if(adapterCall.length==0)return;this.flurryCallInProgress=true;w.location=adapterCall};return flurryadapter};window.Hogan=Hogan;window.flurryadapter=flurryBridgeCtor(window);window.flurryAdapterAvailable=true;if(typeof window.FlurryAdapterReady === 'function'){window.FlurryAdapterReady();}})();");
        }
        ftVar.hP = true;
    }

    public static void e(ft ftVar) {
        if (ftVar.hX) {
            return;
        }
        StringBuilder sb = new StringBuilder();
        sb.append("javascript:(function() {");
        sb.append("var mraidCtor=function(flurryBridge,initState){var mraid={};var STATES=mraid.STATES={LOADING:\"loading\",UNKNOWN:\"unknown\",DEFAULT:\"default\",EXPANDED:\"expanded\",HIDDEN:\"hidden\"};var EVENTS=mraid.EVENTS={ASSETREADY:\"assetReady\",ASSETREMOVED:\"assetRemoved\",ASSETRETIRED:\"assetRetired\",INFO:\"info\",ERROR:\"error\",ORIENTATIONCHANGE:\"orientationChange\",READY:\"ready\",STATECHANGE:\"stateChange\",VIEWABLECHANGE:\"viewableChange\"};var listeners={};var currentState=STATES.LOADING;var expandProperties={width:initState.width,height:initState.height,isModal:initState.isModal,useCustomClose:false};var collapseProperties={};var placementType=initState.placementType;var disable=false;var closeId=\"flurry-mraid-default-close\";var imgUrl=\"http://flurry.cachefly.net/adSpaceStyles/images/bttn-close-bw.png\";var safeClose=function(){try{if(window.mraid)window.mraid.close();else if(window.flurryadapter)flurryadapter.executeCall(\"adWillClose\");else console.log(\"unable to close\")}catch(error){console.log(\"unable to close: \"+error)}};var makeDefaultClose=function(){var img=document.createElement(\"img\");img.src=imgUrl;img.id=closeId;img.style.position=\"absolute\";img.style.top=\"10px\";img.style.right=\"10px\";img.style.width=\"50px\";img.style.height=\"50px\";img.style.zIndex=1E4;return img};var updateDefaultClose=function(){if(!expandProperties.useCustomClose&&(placementType===\"interstitial\"||currentState===STATES.EXPANDED))addDefaultClose();else removeDefaultClose()};var addDefaultClose=function(){var closeButton=document.getElementById(closeId);if(!closeButton){closeButton=makeDefaultClose();document.body.appendChild(closeButton)}};var removeDefaultClose=function(){var closeButton=document.getElementById(closeId);if(closeButton)document.body.removeChild(closeButton)};var setupDefaultCloseHandler=function(){document.body.addEventListener(\"click\",function(e){e=e||window.event;var target=e.target||e.srcElement;if(target.id===closeId)safeClose()})};var contains=function(value,obj){for(var i in obj)if(obj[i]===value)return true;return false};var stringify=function(obj){if(typeof obj==\"object\")if(obj.push){var out=[];for(var p in obj)if(obj.hasOwnProperty(p))out.push(obj[p]);return\"[\"+out.join(\",\")+\"]\"}else{var out=[];for(var p in obj)if(obj.hasOwnProperty(p))out.push(\"'\"+p+\"':\"+obj[p]);return\"{\"+out.join(\",\")+\"}\"}else return new String(obj)};var broadcastEvent=function(){var args=new Array(arguments.length);for(var i=0;i<arguments.length;i++)args[i]=arguments[i];var event=args.shift();try{if(listeners[event])for(var j=0;j<listeners[event].length;j++)if(typeof listeners[event][j]===\"function\")listeners[event][j].apply(undefined,args);else if(typeof listeners[event][j]===\"string\"&&typeof window[listeners[event][j]]===\"function\")window[listeners[event][j]].apply(undefined,args)}catch(e){console.log(e)}};mraid.disable=function(){removeDefaultClose();disable=true};mraid.addEventListener=function(event,listener){if(disable)return;if(!event||!listener)broadcastEvent(EVENTS.ERROR,\"Both event and listener are required.\",\"addEventListener\");else if(!contains(event,EVENTS))broadcastEvent(EVENTS.ERROR,\"Unknown event: \"+event,\"addEventListener\");else if(!listeners[event])listeners[event]=[listener];else listeners[event].push(listener);flurryBridge.executeCall(\"eventListenerAdded\")};mraid.stateChange=function(newState){if(disable)return;if(currentState===newState)return;broadcastEvent(EVENTS.INFO,\"setting state to \"+stringify(newState));var oldState=currentState;currentState=newState;if(oldState===STATES.LOADING&&newState===STATES.DEFAULT){setupDefaultCloseHandler();updateDefaultClose();broadcastEvent(EVENTS.READY)}else if(oldState===STATES.HIDDEN||newState===STATES.HIDDEN)broadcastEvent(EVENTS.VIEWABLECHANGE);else if(oldState===STATES.DEFAULT&&newState===STATES.EXPANDED)updateDefaultClose();else if(newState===STATES.DEFAULT&&oldState===STATES.EXPANDED)updateDefaultClose();broadcastEvent(EVENTS.STATECHANGE,currentState)};mraid.close=function(){if(disable)return;var state=mraid.getState();if(state===STATES.DEFAULT){mraid.stateChange(STATES.HIDDEN);flurryBridge.executeCall(\"adWillClose\")}else if(state===STATES.EXPANDED){mraid.stateChange(STATES.DEFAULT);flurryBridge.executeCall(\"collapse\")}else console.log(\"close() called in state \"+state)};mraid.expand=function(url){if(disable)return;var state=mraid.getState();if(state!==STATES.DEFAULT){console.log(\"expand() called in state \"+state);return}if(placementType===\"interstitial\"){console.log(\"expand() called for placement type \"+placementType);return}if(url)flurryBridge.executeCall(\"expand\",\"width\",expandProperties.width,\"height\",expandProperties.height,\"url\",url);else flurryBridge.executeCall(\"expand\",\"width\",expandProperties.width,\"height\",expandProperties.height);mraid.stateChange(STATES.EXPANDED)};mraid.setExpandProperties=function(properties){if(disable)return;if(typeof properties.width===\"number\"&&!isNaN(properties.width))expandProperties.width=properties.width;if(typeof properties.height===\"number\"&&!isNaN(properties.height))expandProperties.height=properties.height;if(typeof properties.useCustomClose===\"boolean\"){expandProperties.useCustomClose=properties.useCustomClose;updateDefaultClose()}};mraid.getExpandProperties=function(properties){if(disable)return;var ret={};ret.width=expandProperties.width;ret.height=expandProperties.height;ret.isModal=expandProperties.isModal;ret.useCustomClose=expandProperties.useCustomClose;return ret};mraid.getPlacementType=function(){return placementType};mraid.getVersion=function(){if(disable)return\"\";return\"1.0\"};mraid.getState=function(){if(disable)return\"\";return currentState};mraid.isViewable=function(){if(disable)return false;if(mraid.getState()===\"hidden\")return false;else return true};mraid.open=function(url){if(disable)return;try{flurryBridge.executeCall(\"open\",\"url\",url)}catch(e){console.log(e)}};mraid.removeEventListener=function(event,listener){if(disable)return;if(!event)broadcastEvent(\"error\",\"Must specify an event.\",\"removeEventListener\");else if(listener&&listeners[event])for(var i=0;i<listeners[event].length;i++){if(listeners[event][i]===listener)listeners[event].splice(i,1)}else if(listeners[event])listeners[event]=[]};mraid.useCustomClose=function(use){if(disable)return;if(typeof use===\"boolean\"){expandProperties.useCustomClose=use;updateDefaultClose()}};return mraid};");
        sb.append("window.mraid=mraidCtor(window.flurryadapter," + ("{useCustomClose:false,isModal:false,width:undefined,height:undefined,placementType:\"" + (ftVar.bz() ? "interstitial" : "inline") + "\"}") + ");");
        sb.append("})();");
        if (ftVar.eq != null) {
            ftVar.eq.loadUrl(sb.toString());
        }
        ftVar.hX = true;
    }

    public static void g(ft ftVar) {
        if (ftVar.eq != null) {
            ftVar.eq.loadUrl("javascript:if(window.mraid){window.mraid.stateChange(window.mraid.STATES.DEFAULT);}");
        }
    }

    public static void h(ft ftVar) {
        if (ftVar.bz()) {
            fd.a(ftVar.id, fd.bf(), true);
        }
    }

    public static void k(ft ftVar) {
        String obj = ftVar.bA().getContent().toString();
        if (ftVar.ia || obj == null || obj.length() <= 0 || obj.equals("{}")) {
            return;
        }
        String url = ftVar.eq.getUrl();
        String root = UriUtils.root(url);
        String relativize = UriUtils.relativize(root, url);
        if (!TextUtils.isEmpty(relativize) && relativize != root) {
            String str = "content before {{mustached}} tags replacement = '" + obj + "'";
            obj = obj.replace(root, relativize);
            String str2 = "content after {{mustached}} tags replacement = '" + obj + "'";
        }
        StringBuilder sb = new StringBuilder();
        sb.append("javascript:");
        sb.append("(function(){");
        sb.append("if(!window.Hogan){var Hogan={};(function(Hogan,useArrayBuffer){Hogan.Template=function(renderFunc,text,compiler,options){this.r=renderFunc||this.r;this.c=compiler;this.options=options;this.text=text||\"\";this.buf=useArrayBuffer?[]:\"\"};Hogan.Template.prototype={r:function(context,partials,indent){return\"\"},v:hoganEscape,t:coerceToString,render:function render(context,partials,indent){return this.ri([context],partials||{},indent)},ri:function(context,partials,indent){return this.r(context,partials,indent)},rp:function(name,context,partials,indent){var partial=partials[name];if(!partial)return\"\";if(this.c&&typeof partial==\"string\")partial=this.c.compile(partial,this.options);return partial.ri(context,partials,indent)},rs:function(context,partials,section){var tail=context[context.length-1];if(!isArray(tail)){section(context,partials,this);return}for(var i=0;i<tail.length;i++){context.push(tail[i]);section(context,partials,this);context.pop()}},s:function(val,ctx,partials,inverted,start,end,tags){var pass;if(isArray(val)&&val.length===0)return false;if(typeof val==\"function\")val=this.ls(val,ctx,partials,inverted,start,end,tags);pass=val===\"\"||!!val;if(!inverted&&pass&&ctx)ctx.push(typeof val==\"object\"?val:ctx[ctx.length-1]);return pass},d:function(key,ctx,partials,returnFound){var names=key.split(\".\"),val=this.f(names[0],ctx,partials,returnFound),cx=null;if(key===\".\"&&isArray(ctx[ctx.length-2]))return ctx[ctx.length-1];for(var i=1;i<names.length;i++)if(val&&typeof val==\"object\"&&names[i]in val){cx=val;val=val[names[i]]}else val=\"\";if(returnFound&&!val)return false;if(!returnFound&&typeof val==\"function\"){ctx.push(cx);val=this.lv(val,ctx,partials);ctx.pop()}return val},f:function(key,ctx,partials,returnFound){var val=false,v=null,found=false;for(var i=ctx.length-1;i>=0;i--){v=ctx[i];if(v&&typeof v==\"object\"&&key in v){val=v[key];found=true;break}}if(!found)return returnFound?false:\"\";if(!returnFound&&typeof val==\"function\")val=this.lv(val,ctx,partials);return val},ho:function(val,cx,partials,text,tags){var compiler=this.c;var options=this.options;options.delimiters=tags;var t=val.call(cx,text,function(t){return compiler.compile(t,options).render(cx,partials)});this.b(compiler.compile(t.toString(),options).render(cx,partials));return false},b:useArrayBuffer?function(s){this.buf.push(s)}:function(s){this.buf+=s},fl:useArrayBuffer?function(){var r=this.buf.join(\"\");this.buf=[];return r}:function(){var r=this.buf;this.buf=\"\";return r},ls:function(val,ctx,partials,inverted,start,end,tags){var cx=ctx[ctx.length-1],t=null;if(!inverted&&this.c&&val.length>0)return this.ho(val,cx,partials,this.text.substring(start,end),tags);t=val.call(cx);if(typeof t==\"function\")if(inverted)return true;else if(this.c)return this.ho(t,cx,partials,this.text.substring(start,end),tags);return t},lv:function(val,ctx,partials){var cx=ctx[ctx.length-1];var result=val.call(cx);if(typeof result==\"function\")result=result.call(cx);result=coerceToString(result);if(this.c&&~result.indexOf(\"{{\"))return this.c.compile(result,this.options).render(cx,partials);return result}};var rAmp=/&/g,rLt=/</g,rGt=/>/g,rApos=/\\'/g,rQuot=/\\\"/g,hChars=/[&<>\\\"\\']/;function coerceToString(val){return String(val===null||val===undefined?\"\":val)}function hoganEscape(str){str=coerceToString(str);return hChars.test(str)?str.replace(rAmp,\"&amp;\").replace(rLt,\"&lt;\").replace(rGt,\"&gt;\").replace(rApos,\"&#39;\").replace(rQuot,\"&quot;\"):str}var isArray=Array.isArray||function(a){return Object.prototype.toString.call(a)===\"[object Array]\"}})(typeof exports!==\"undefined\"?exports:Hogan);(function(Hogan){var rIsWhitespace=/\\S/,rQuot=/\\\"/g,rNewline=/\\n/g,rCr=/\\r/g,rSlash=/\\\\/g,tagTypes={\"#\":1,\"^\":2,\"/\":3,\"!\":4,\">\":5,\"<\":6,\"=\":7,\"_v\":8,\"{\":9,\"&\":10};Hogan.scan=function scan(text,delimiters){var len=text.length,IN_TEXT=0,IN_TAG_TYPE=1,IN_TAG=2,state=IN_TEXT,tagType=null,tag=null,buf=\"\",tokens=[],seenTag=false,i=0,lineStart=0,otag=\"{{\",ctag=\"}}\";function addBuf(){if(buf.length>0){tokens.push(new String(buf));buf=\"\"}}function lineIsWhitespace(){var isAllWhitespace=true;for(var j=lineStart;j<tokens.length;j++){isAllWhitespace=tokens[j].tag&&tagTypes[tokens[j].tag]<tagTypes[\"_v\"]||!tokens[j].tag&&tokens[j].match(rIsWhitespace)===null;if(!isAllWhitespace)return false}return isAllWhitespace}function filterLine(haveSeenTag,noNewLine){addBuf();if(haveSeenTag&&lineIsWhitespace())for(var j=lineStart,next;j<tokens.length;j++){if(!tokens[j].tag){if((next=tokens[j+1])&&next.tag==\">\")next.indent=tokens[j].toString();tokens.splice(j,1)}}else if(!noNewLine)tokens.push({tag:\"\\n\"});seenTag=false;lineStart=tokens.length}function changeDelimiters(text,index){var close=\"=\"+ctag,closeIndex=text.indexOf(close,index),delimiters=trim(text.substring(text.indexOf(\"=\",index)+1,closeIndex)).split(\" \");otag=delimiters[0];ctag=delimiters[1];return closeIndex+close.length-1}if(delimiters){delimiters=delimiters.split(\" \");otag=delimiters[0];ctag=delimiters[1]}for(i=0;i<len;i++)if(state==IN_TEXT)if(tagChange(otag,text,i)){--i;addBuf();state=IN_TAG_TYPE}else if(text.charAt(i)==\"\\n\")filterLine(seenTag);else buf+=text.charAt(i);else if(state==IN_TAG_TYPE){i+=otag.length-1;tag=tagTypes[text.charAt(i+1)];tagType=tag?text.charAt(i+1):\"_v\";if(tagType==\"=\"){i=changeDelimiters(text,i);state=IN_TEXT}else{if(tag)i++;state=IN_TAG}seenTag=i}else if(tagChange(ctag,text,i)){tokens.push({tag:tagType,n:trim(buf),otag:otag,ctag:ctag,i:tagType==\"/\"?seenTag-ctag.length:i+otag.length});buf=\"\";i+=ctag.length-1;state=IN_TEXT;if(tagType==\"{\")if(ctag==\"}}\")i++;else cleanTripleStache(tokens[tokens.length-1])}else buf+=text.charAt(i);filterLine(seenTag,true);return tokens};function cleanTripleStache(token){if(token.n.substr(token.n.length-1)===\"}\")token.n=token.n.substring(0,token.n.length-1)}function trim(s){if(s.trim)return s.trim();return s.replace(/^\\s*|\\s*$/g,\"\")}function tagChange(tag,text,index){if(text.charAt(index)!=tag.charAt(0))return false;for(var i=1,l=tag.length;i<l;i++)if(text.charAt(index+i)!=tag.charAt(i))return false;return true}function buildTree(tokens,kind,stack,customTags){var instructions=[],opener=null,token=null;while(tokens.length>0){token=tokens.shift();if(token.tag==\"#\"||token.tag==\"^\"||isOpener(token,customTags)){stack.push(token);token.nodes=buildTree(tokens,token.tag,stack,customTags);instructions.push(token)}else if(token.tag==\"/\"){if(stack.length===0)throw new Error(\"Closing tag without opener: /\"+token.n);opener=stack.pop();if(token.n!=opener.n&&!isCloser(token.n,opener.n,customTags))throw new Error(\"Nesting error: \"+opener.n+\" vs. \"+token.n);opener.end=token.i;return instructions}else instructions.push(token)}if(stack.length>0)throw new Error(\"missing closing tag: \"+stack.pop().n);return instructions}function isOpener(token,tags){for(var i=0,l=tags.length;i<l;i++)if(tags[i].o==token.n){token.tag=\"#\";return true}}function isCloser(close,open,tags){for(var i=0,l=tags.length;i<l;i++)if(tags[i].c==close&&tags[i].o==open)return true}function writeCode(tree){return'var _=this;_.b(i=i||\"\");'+walk(tree)+\"return _.fl();\"}Hogan.generate=function(code,text,options){if(options.asString)return\"function(c,p,i){\"+code+\";}\";return new Hogan.Template(new Function(\"c\",\"p\",\"i\",code),text,Hogan,options)};function esc(s){return s.replace(rSlash,\"\\\\\\\\\").replace(rQuot,'\\\\\"').replace(rNewline,\"\\\\n\").replace(rCr,\"\\\\r\")}function chooseMethod(s){return~s.indexOf(\".\")?\"d\":\"f\"}function walk(tree){var code=\"\";for(var i=0,l=tree.length;i<l;i++){var tag=tree[i].tag;if(tag==\"#\")code+=section(tree[i].nodes,tree[i].n,chooseMethod(tree[i].n),tree[i].i,tree[i].end,tree[i].otag+\" \"+tree[i].ctag);else if(tag==\"^\")code+=invertedSection(tree[i].nodes,tree[i].n,chooseMethod(tree[i].n));else if(tag==\"<\"||tag==\">\")code+=partial(tree[i]);else if(tag==\"{\"||tag==\"&\")code+=tripleStache(tree[i].n,chooseMethod(tree[i].n));else if(tag==\"\\n\")code+=text('\"\\\\n\"'+(tree.length-1==i?\"\":\" + i\"));else if(tag==\"_v\")code+=variable(tree[i].n,chooseMethod(tree[i].n));else if(tag===undefined)code+=text('\"'+esc(tree[i])+'\"')}return code}function section(nodes,id,method,start,end,tags){return\"if(_.s(_.\"+method+'(\"'+esc(id)+'\",c,p,1),'+\"c,p,0,\"+start+\",\"+end+',\"'+tags+'\")){'+\"_.rs(c,p,\"+\"function(c,p,_){\"+walk(nodes)+\"});c.pop();}\"}function invertedSection(nodes,id,method){return\"if(!_.s(_.\"+method+'(\"'+esc(id)+'\",c,p,1),c,p,1,0,0,\"\")){'+walk(nodes)+\"};\"}function partial(tok){return'_.b(_.rp(\"'+esc(tok.n)+'\",c,p,\"'+(tok.indent||\"\")+'\"));'}function tripleStache(id,method){return\"_.b(_.t(_.\"+method+'(\"'+esc(id)+'\",c,p,0)));'}function variable(id,method){return\"_.b(_.v(_.\"+method+'(\"'+esc(id)+'\",c,p,0)));'}function text(id){return\"_.b(\"+id+\");\"}Hogan.parse=function(tokens,text,options){options=options||{};return buildTree(tokens,\"\",[],options.sectionTags||[])},Hogan.cache={};Hogan.compile=function(text,options){options=options||{};var key=text+\"||\"+!!options.asString;var t=this.cache[key];if(t)return t;t=this.generate(writeCode(this.parse(this.scan(text,options.delimiters),text,options)),text,options);return this.cache[key]=t}})(typeof exports!==\"undefined\"?exports:Hogan);window.Hogan=Hogan;}");
        sb.append("if(!window.flurryadapter){var flurryBridgeCtor=function(w){var flurryadapter={};flurryadapter.flurryCallQueue=[];flurryadapter.flurryCallInProgress=false;flurryadapter.callComplete=function(cmd){if(this.flurryCallQueue.length==0){this.flurryCallInProgress=false;return}var adapterCall=this.flurryCallQueue.splice(0,1)[0];this.executeNativeCall(adapterCall);return\"OK\"};flurryadapter.executeCall=function(command){var adapterCall=\"flurry://flurrycall?event=\"+command;var value;for(var i=1;i<arguments.length;i+=2){value=arguments[i+1];if(value==null)continue;adapterCall+=\"&\"+arguments[i]+\"=\"+escape(value)}if(this.flurryCallInProgress)this.flurryCallQueue.push(adapterCall);else this.executeNativeCall(adapterCall)};flurryadapter.executeNativeCall=function(adapterCall){if(adapterCall.length==0)return;this.flurryCallInProgress=true;w.location=adapterCall};return flurryadapter};window.flurryadapter=flurryBridgeCtor(window);}");
        sb.append("if(!window.flurryAdapterAvailable){window.flurryAdapterAvailable=true;if(typeof window.FlurryAdapterReady === 'function'){window.FlurryAdapterReady();} }");
        String G = fl.G(obj);
        sb.append("var content='");
        sb.append(G);
        sb.append("';var compiled=window.Hogan.compile(document.body.innerHTML);var rendered=compiled.render(JSON.parse(content));document.body.innerHTML=rendered;");
        sb.append("})();");
        if (ftVar.eq != null) {
            ftVar.eq.loadUrl(sb.toString());
        }
    }

    public ft(Context context, FlurryAds flurryAds, cw cwVar, AdUnit adUnit, int i) {
        super(context, flurryAds, cwVar);
        this.p = getClass().getSimpleName();
        this.ie = null;
        this.Q = context;
        if (context instanceof Activity) {
            this.id = (Activity) context;
        }
        setClickable(true);
        this.T = adUnit;
        this.U = i;
        this.S = cwVar;
        if (this.T != null) {
            this.hZ = this.T.getAdFrames();
            this.ia = this.T.getCombinable().intValue() == 1;
            if (this.ia) {
                this.ic = new HashMap();
                this.ib = new HashMap();
                this.ic.put(cwVar.aA(), cwVar);
                this.ib.put(adUnit.getAdFrames().get(0).getAdGuid().toString(), adUnit);
            }
            this.fI = flurryAds;
            this.hk = this.fI.hk;
            this.T = this.T;
            this.S = this.S;
            this.f2if = new LinkedList();
        }
    }

    @Override
    public final void initLayout(Context context) {
        String str = "initLayout: ad creative layout: {width = " + bA().getAdSpaceLayout().getAdWidth() + ", height = " + bA().getAdSpaceLayout().getAdHeight() + "}";
        removeAllViews();
        setFocusable(true);
        setFocusableInTouchMode(true);
        switch (bw()) {
            case 1:
            case 2:
                if (this.eq == null) {
                    this.eq = new WebView(context);
                    this.eq.getSettings().setJavaScriptEnabled(true);
                    this.eq.setVerticalScrollBarEnabled(false);
                    this.eq.setHorizontalScrollBarEnabled(false);
                    this.eq.setBackgroundColor(0);
                    this.eq.clearCache(false);
                    this.es = new co(this);
                    this.eq.setWebChromeClient(this.es);
                    this.er = new gg(this);
                    this.eq.setWebViewClient(this.er);
                }
                a("rendered", Collections.emptyMap(), this.T, this.S, this.U, 0);
                if (bw() == 1) {
                    if (this.ie != null) {
                        this.eq.loadUrl(this.ie);
                    } else {
                        this.eq.loadUrl(bx());
                    }
                } else if (bw() == 2) {
                    this.eq.loadDataWithBaseURL("base://url/", bx(), HtmlFormatter.TEXT_HTML, HtmlFormatter.UTF_8, "base://url/");
                }
                this.eq.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
                return;
            case 3:
                if (this.hN == null) {
                    this.hN = new gk(context);
                    this.hN.setOnPreparedListener(this);
                    this.hN.setOnCompletionListener(this);
                    this.hN.setOnErrorListener(this);
                    this.fx = new MediaController(context);
                    this.hN.setMediaController(this.fx);
                }
                this.hN.setVideoURI(Uri.parse(bx()));
                cy.c(this.p, "URI: " + Uri.parse(bx()).toString());
                this.hN.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
                addView(this.hN);
                ((RelativeLayout) this.hN.getParent()).setGravity(17);
                this.fu = new ProgressDialog(context);
                this.fu.setProgressStyle(0);
                this.fu.setMessage("Loading...");
                this.fu.setCancelable(true);
                this.fu.setOnKeyListener(this);
                this.fu.show();
                return;
            default:
                a("renderFailed", Collections.emptyMap(), this.T, this.S, this.U, 0);
                return;
        }
    }

    @Override
    public final void performAction$3deb3ec3(y yVar, FlurryAds flurryAds, int i) {
        int i2;
        int i3;
        String str;
        String str2;
        String str3;
        String str4;
        String str5 = yVar.bi;
        gt gtVar = yVar.bk;
        Map<String, String> map = yVar.bj;
        if (i > 10) {
            String str6 = "Maximum depth for event/action loop exceeded when performing action:" + str5 + "," + map + ",triggered by:" + gtVar.jf;
        } else if (!gtVar.jf.equals("clicked") || (str4 = gtVar.bj.get("noop")) == null || !str4.equals("true")) {
            String str7 = "performAction(action=" + str5 + ",params=" + yVar.bj + ",triggering event=" + gtVar.jf + ")";
            if (str5.equals("nextFrame")) {
                int i4 = this.U + 1;
                String str8 = map.get(IVastConstant.OFFSET);
                if (str8 != null) {
                    if (str8.equals("next")) {
                        i4 = this.U + 1;
                    } else if (!str8.equals("current")) {
                        try {
                            i4 = Integer.parseInt(str8);
                        } catch (NumberFormatException e) {
                            String str9 = "caught: " + e.getMessage();
                        }
                    } else {
                        return;
                    }
                }
                if (this.ia) {
                    String str10 = yVar.bk.bj.get("guid");
                    if (str10 != null) {
                        this.T = J(str10);
                        this.hZ = this.T.getAdFrames();
                        this.S = yVar.bk.S;
                        if (bz()) {
                            this.fI.a(this.T);
                            this.fI.b(this.S);
                        }
                        this.U = i4;
                        this.ia = false;
                        initLayout(this.Q);
                    }
                } else if (i4 != this.U && i4 < this.hZ.size()) {
                    String by = by();
                    String obj = this.T.getAdFrames().get(i4).getAdSpaceLayout().getFormat().toString();
                    if (obj.equals(by)) {
                        this.U = i4;
                        initLayout(this.Q);
                    } else if (obj.equals(AdCreative.kFormatTakeover)) {
                        this.fI.b(this.S);
                        this.fI.a(this.T);
                        Intent intent = new Intent(this.Q, FlurryFullscreenTakeoverActivity.class);
                        intent.putExtra(FlurryFullscreenTakeoverActivity.EXTRA_KEY_FRAMEINDEX, i4);
                        this.fI.a(this.Q, intent, this.T.getAdSpace().toString());
                    }
                }
            } else if (str5.equals("closeAd")) {
                if (bz()) {
                    try {
                        ((Activity) this.Q).finish();
                    } catch (ClassCastException e2) {
                        String str11 = "caught class cast exception: " + e2;
                    }
                }
            } else if (str5.equals("notifyUser")) {
                AlertDialog.Builder builder = new AlertDialog.Builder(this.Q);
                if (map.containsKey("message") && map.containsKey("confirmDisplay") && map.containsKey("cancelDisplay")) {
                    str = map.get("message");
                    str2 = map.get("confirmDisplay");
                    str3 = map.get("cancelDisplay");
                } else {
                    str = "Are you sure?";
                    str2 = "Cancel";
                    str3 = "OK";
                }
                builder.setMessage(str).setCancelable(false).setPositiveButton(str3, new bk(this, gtVar, i)).setNegativeButton(str2, new bh(this, gtVar, i));
                this.hY = builder.create();
                if (this.hN != null && bw() == 3) {
                    this.hN.pause();
                }
                this.hY.show();
            } else if (str5.equals("loadAdComponents")) {
                int i5 = 1;
                int i6 = 3;
                if (map.containsKey("min") && map.containsKey("max")) {
                    try {
                        int parseInt = Integer.parseInt(map.get("min"));
                        i6 = Integer.parseInt(map.get("max"));
                        i5 = parseInt;
                    } catch (NumberFormatException e3) {
                        i5 = 1;
                        i6 = 3;
                    }
                }
                this.T.getAdSpace().toString();
                List<AdUnit> b = b(i5, i6);
                if (b.size() > 0) {
                    this.T.getAdSpace().toString();
                    String j = j(b);
                    if (this.eq != null) {
                        this.eq.loadUrl("javascript:(function() {var multiadwraps=document.getElementsByClassName('multiAdWrap');if(multiadwraps.length>0){var template=document.getElementsByClassName('multiAdWrap')[0];var compiled=Hogan.compile(template.innerHTML);template.innerHTML='';template.innerHTML=compiled.render(JSON.parse(" + j + "));}})();");
                        this.eq.loadUrl("javascript:flurryadapter.callComplete();");
                    }
                    for (AdUnit adUnit : b) {
                        HashMap hashMap = new HashMap();
                        hashMap.put("guid", adUnit.getAdFrames().get(0).getAdGuid().toString());
                        a("rendered", hashMap, adUnit, I(adUnit.getAdFrames().get(0).getAdGuid().toString()), 0, 0);
                    }
                    if (this.eq != null && !a(this.eq)) {
                        addView(this.eq);
                    }
                } else {
                    a("renderFailed", Collections.emptyMap(), this.T, this.S, this.U, 0);
                }
            } else if (str5.equals("doExpand")) {
                int q = fl.q(this.Q);
                int r = fl.r(this.Q);
                if (yVar.bk.bj.containsKey("width") && yVar.bk.bj.containsKey("height")) {
                    try {
                        i2 = fl.b(this.Q, Integer.parseInt(yVar.bk.bj.get("width")));
                        i3 = fl.b(this.Q, Integer.parseInt(yVar.bk.bj.get("height")));
                    } catch (NumberFormatException e4) {
                        e4.getMessage();
                        i2 = fl.q(this.Q);
                        i3 = fl.r(this.Q);
                    }
                } else {
                    i2 = q;
                    i3 = r;
                }
                String str12 = "expand to width = " + i2 + " height = " + i3;
                if (bB() != null) {
                    a("clicked", Collections.emptyMap(), this.T, this.S, this.U, 0);
                    if (this.hT == null) {
                        String str13 = "expand(" + i2 + "," + i3 + ")";
                        if (this.eq != null && -1 != indexOfChild(this.eq)) {
                            removeView(this.eq);
                        }
                        this.hS = this.id.getRequestedOrientation();
                        if (this.hU == null) {
                            this.hU = new FrameLayout(this.Q);
                            this.hU.setBackgroundColor(-16777216);
                            if (this.eq != null && this.eq.getParent() == null) {
                                this.hU.addView(this.eq, new FrameLayout.LayoutParams(-1, -1, 17));
                            }
                        }
                        if (this.hT == null) {
                            this.hT = new Dialog(this.Q, 16973834);
                            s.a(this.hT.getWindow());
                            this.hT.setContentView(this.hU, new ViewGroup.LayoutParams(-1, -1));
                            this.hT.setOnDismissListener(new bj(this));
                            this.hT.setCancelable(true);
                            this.hT.show();
                        }
                        fd.a(this.id, fd.bf(), true);
                        this.R.onOpenFullScreen(this.Q, this.T.getAdSpace().toString());
                    }
                }
                if (yVar.bk.bj.containsKey("url")) {
                    this.ie = yVar.bk.bj.get("url");
                    initLayout(this.Q);
                }
            } else if (str5.equals("doCollapse")) {
                int intValue = bA().getAdSpaceLayout().getAdWidth().intValue();
                int intValue2 = bA().getAdSpaceLayout().getAdHeight().intValue();
                int b2 = fl.b(this.Q, intValue);
                int b3 = fl.b(this.Q, intValue2);
                if (this.ie != null) {
                    this.ie = null;
                    initLayout(this.Q);
                }
                if (bB() != null) {
                    a(b2, b3);
                }
            } else {
                if (str5.equals("directOpen")) {
                    HashMap hashMap2 = new HashMap();
                    hashMap2.put("noop", "true");
                    a("clicked", hashMap2, this.T, this.S, this.U, 0);
                }
                this.R.performAction$3deb3ec3(yVar, flurryAds, i);
            }
            if (!this.f2if.contains(yVar.bk.jf) || this.eq == null) {
                return;
            }
            this.eq.loadUrl("javascript:flurryadapter.callComplete('" + yVar.bk.jf + "');");
            this.f2if.remove(yVar.bk.jf);
        }
    }

    private void a(int i, int i2) {
        if (this.hT != null) {
            String str = "collapse(" + i + "," + i2 + ")";
            if (this.hT != null && this.hT.isShowing()) {
                this.hT.hide();
                this.hT.setOnDismissListener(null);
                this.hT.dismiss();
            }
            this.hT = null;
            fd.a(this.id, this.hS);
            if (this.hU != null) {
                if (this.eq != null && -1 != this.hU.indexOfChild(this.eq)) {
                    this.hU.removeView(this.eq);
                }
                this.hU = null;
            }
            if (this.eq != null && this.eq.getParent() == null) {
                addView(this.eq);
            }
            this.R.onCloseFullScreen(this.Q, this.T.getAdSpace().toString());
        }
    }

    @Override
    public final void onCompletion(MediaPlayer mediaPlayer) {
        a("videoCompleted", Collections.emptyMap(), this.T, this.S, this.U, 0);
    }

    @Override
    public final void onPrepared(MediaPlayer mediaPlayer) {
        if (bw() == 3) {
            if (this.fu.isShowing()) {
                this.fu.dismiss();
            }
            if ((this.hY == null || !this.hY.isShowing()) && this.hN != null && this.hO) {
                this.hN.start();
            }
            a("rendered", Collections.emptyMap(), this.T, this.S, this.U, 0);
            a("videoStart", Collections.emptyMap(), this.T, this.S, this.U, 0);
        }
    }

    @Override
    public final boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
        if (this.fu != null && this.fu.isShowing()) {
            this.fu.dismiss();
        }
        a("renderFailed", Collections.emptyMap(), this.T, this.S, this.U, 0);
        removeView(this.hN);
        return false;
    }

    public final void resume() {
        this.hO = true;
        if (this.eq != null && n.SDK_INT >= 11) {
            this.eq.onResume();
        }
        if (this.hN != null && bw() == 3 && this.fx != null) {
            this.fx.show(0);
        }
    }

    public final void pause() {
        if (this.eq != null && n.SDK_INT >= 11) {
            this.eq.onPause();
        }
        if (this.hN != null && bw() == 3) {
            this.hN.pause();
        }
        this.hO = false;
    }

    @Override
    public final void stop() {
        if (bw() == 3) {
            if (this.fu != null && this.fu.isShowing()) {
                this.fu.dismiss();
            }
            if (this.hN != null && this.hN.isPlaying()) {
                this.hN.stopPlayback();
            }
        }
        if (this.eq != null) {
            if (this.cJ != null && this.es != null) {
                this.es.onHideCustomView();
            }
            if (this.hT != null) {
                a(0, 0);
            }
            removeView(this.eq);
            this.eq.stopLoading();
            if (n.SDK_INT >= 11) {
                this.eq.onPause();
            }
            this.eq.destroy();
            this.eq = null;
        }
        if (bz()) {
            a("adClosed", Collections.emptyMap(), this.T, this.S, this.U, 0);
        }
    }

    public final void a(String str, Map<String, String> map, AdUnit adUnit, cw cwVar, int i, int i2) {
        String str2 = "fireEvent(event=" + str + ",params=" + map + ")";
        this.R.onEvent(new gt(str, map, this.Q, adUnit, cwVar, i), this, i2);
    }

    public final int bw() {
        return bA().getBinding().intValue();
    }

    private String bx() {
        return bA().getDisplay().toString();
    }

    private String by() {
        return bA().getAdSpaceLayout().getFormat().toString();
    }

    public final boolean bz() {
        return by().equals(AdCreative.kFormatTakeover);
    }

    private AdFrame bA() {
        return this.hZ.get(this.U);
    }

    private String j(List<AdUnit> list) {
        StringBuilder sb = new StringBuilder();
        sb.append("'{\"adComponents\":[");
        String url = this.eq.getUrl();
        String root = UriUtils.root(url);
        String relativize = UriUtils.relativize(root, url);
        Iterator<AdUnit> it = list.iterator();
        while (it.hasNext()) {
            String obj = it.next().getAdFrames().get(0).getContent().toString();
            if (!TextUtils.isEmpty(obj) && !TextUtils.isEmpty(relativize) && relativize != root) {
                obj = obj.replace(root, relativize);
            }
            sb.append(fl.G(obj));
            if (it.hasNext()) {
                sb.append(",");
            }
        }
        sb.append("]}'");
        return sb.toString();
    }

    private List<AdUnit> b(int i, int i2) {
        List<AdUnit> b = this.hk.b(this.Q, this.T.getAdSpace().toString(), i2);
        for (AdUnit adUnit : b) {
            if (adUnit.getAdFrames().size() > 0) {
                this.ib.put(adUnit.getAdFrames().get(0).getAdGuid().toString(), adUnit);
            }
        }
        return b;
    }

    public cw I(String str) {
        if (this.ic == null) {
            return null;
        }
        cw cwVar = this.ic.get(str);
        if (cwVar == null) {
            cw a2 = ct.a(this.fI, str);
            this.ic.put(str, a2);
            return a2;
        }
        return cwVar;
    }

    public AdUnit J(String str) {
        if (this.ib == null) {
            return null;
        }
        return this.ib.get(str);
    }

    @Override
    public final boolean shouldRotate() {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.Q.getSystemService("connectivity")).getActiveNetworkInfo();
        boolean z = activeNetworkInfo != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.isConnected();
        if (!(this.hT != null)) {
            if (!(this.hR != null) && z) {
                return true;
            }
        }
        return false;
    }

    public final boolean a(View view) {
        ViewParent parent = view.getParent();
        return parent != null && parent == this;
    }

    @Override
    public final boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
        String str = "onkey,keycode=" + i + ",event=" + keyEvent.getAction();
        if (dialogInterface == this.fu && i == 4 && keyEvent.getAction() == 0) {
            a("adWillClose", Collections.emptyMap(), this.T, this.S, this.U, 0);
            dialogInterface.dismiss();
            return true;
        }
        return false;
    }

    private v bB() {
        try {
            ViewParent parent = getParent();
            if (parent != null) {
                return (v) parent;
            }
            return null;
        } catch (ClassCastException e) {
            cy.g(this.p, "AdUnityView parent not a BannerHolder:" + e.getMessage());
            return null;
        }
    }
}