text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Api</title>
<meta name="date" content="2019-04-08">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

com.google.api.server.spi.config

Annotation Type Api

@Retention(value=RUNTIME)
 @Target(value=TYPE)
public @interface Api

Annotation for API-wide configuration.

Field Summary

Fields

Modifier and Type
Fields and Description

static int
UNSPECIFIED_INT

static java.lang.String
UNSPECIFIED_STRING_FOR_LIST

Optional Element Summary

Optional Elements

Modifier and Type
Optional Element and Description

java.lang.String[]
audiences

Audience for IdTokens, applicable to all methods of the API unless overridden by
 @ApiClass#audiences or @ApiMethod#audiences.

ApiAuth
auth

Configures authentication information.

java.lang.Class<? extends Authenticator>[]
authenticators

Custom authenticators.

AuthLevel
authLevel

Set frontend auth level, applicable to all methods of the API unless overridden by
 @ApiClass#authLevel or @ApiMethod#authLevel.

java.lang.String
backendRoot

Backend root URL, e.g.

ApiCacheControl
cacheControl

Configures the Cache-Control header in the response.

java.lang.String
canonicalName

Optional name, which indicates how an API name should be split into parts.

java.lang.String[]
clientIds

Client IDs allowed to call this method, applicable to all methods of the API unless overridden
 by @ApiClass#clientIds or @ApiMethod#clientIds.

AnnotationBoolean
defaultVersion

Marks this version of an API as the default version to use when a JSON-RPC call is executed
 against the API.

java.lang.String
description

Description of this API.

AnnotationBoolean
discoverable

Whether or not the API is discoverable.

java.lang.String
documentationLink

A link to human readable documentation for the API.

ApiFrontendLimits
frontendLimits

Configures quota enforcement.

AnnotationBoolean
isAbstract

true if this API configuration is used as the base for another.

java.lang.String
name

Name of the API, e.g.

ApiNamespace
namespace

Configures namespacing for generated clients.

java.lang.Class<? extends PeerAuthenticator>[]
peerAuthenticators

Custom peer authenticators.

java.lang.String
resource

The name (in plural) of the resource collection.

java.lang.String
root

Frontend root URL, e.g.

java.lang.String[]
scopes

OAuth 2 scopes, one of which is required for calling this method, applicable to all methods
 of the API unless overridden by @ApiClass#scopes or @ApiMethod#scopes.

java.lang.String
title

The title of an API.

java.lang.Class<? extends Transformer<?,?>>[]
transformers

Custom transformers to be used for this API.

AnnotationBoolean
useDatastoreForAdditionalConfig

AnnotationBoolean.TRUE to request that overriding configuration be loaded from the
 appengine datastore for all API classes except for those classes that override using
 @ApiClass#useDatastoreForAdditionalConfig.

java.lang.String
version

Version of the API, e.g.

Field Detail

UNSPECIFIED_INT

public static final int UNSPECIFIED_INT

UNSPECIFIED_STRING_FOR_LIST

public static final java.lang.String UNSPECIFIED_STRING_FOR_LIST

Element Detail

root

public abstract java.lang.String root

Frontend root URL, e.g. "https://example.appspot.com/_ah/api". All api
 methods will be exposed below this path. This will default to
 "https://yourapp.appspot.com/_ah/api".

Default:

""

name

public abstract java.lang.String name

Name of the API, e.g. "guestbook". This is used as the prefix for all api
 methods and paths. If not set a default of "myapi" will be used.

Default:

""

canonicalName

public abstract java.lang.String canonicalName

Optional name, which indicates how an API name should be split into parts. This is useful in
 generating better client library names. For example, the API name might be "myapi" and the
 canonical name might be "My API", which indicates that the camel case name should be myApi
 while the underscore name should be my_api.

Default:

""

version

public abstract java.lang.String version

Version of the API, e.g. "v0.2". If not set a default of "v1" will be used.

Default:

""

title

public abstract java.lang.String title

The title of an API. This is the title displayed by API Explorer.

Default:

""

description

public abstract java.lang.String description

Description of this API. This will be exposed in the discovery service to
 describe your API, and may also be used to generate documentation.

Default:

""

documentationLink

public abstract java.lang.String documentationLink

A link to human readable documentation for the API. By default no link is is exposed in
 discovery.

Default:

""

backendRoot

public abstract java.lang.String backendRoot

Backend root URL, e.g. "https://example.appspot.com/_ah/spi". This is the root of all backend
 method calls. This will default to "https://yourapp.appspot.com/_ah/spi". Non-secure http URLs
 will be automatically converted to use https.

Default:

""

auth

public abstract ApiAuth auth

Configures authentication information. See ApiAuth for details.

Default:

@com.google.api.server.spi.config.ApiAuth

frontendLimits

public abstract ApiFrontendLimits frontendLimits

Configures quota enforcement. See ApiFrontendLimits for details.

Default:

@com.google.api.server.spi.config.ApiFrontendLimits

cacheControl

public abstract ApiCacheControl cacheControl

Configures the Cache-Control header in the response. See
 ApiCacheControl for details.

Default:

@com.google.api.server.spi.config.ApiCacheControl

authLevel

public abstract AuthLevel authLevel

Set frontend auth level, applicable to all methods of the API unless overridden by
 @ApiClass#authLevel or @ApiMethod#authLevel.

Default:

com.google.api.server.spi.config.AuthLevel.UNSPECIFIED

scopes

public abstract java.lang.String[] scopes

OAuth 2 scopes, one of which is required for calling this method, applicable to all methods
 of the API unless overridden by @ApiClass#scopes or @ApiMethod#scopes.

Default:

"_UNSPECIFIED_LIST_STRING_VALUE"

audiences

public abstract java.lang.String[] audiences

Audience for IdTokens, applicable to all methods of the API unless overridden by
 @ApiClass#audiences or @ApiMethod#audiences.

Default:

"_UNSPECIFIED_LIST_STRING_VALUE"

clientIds

public abstract java.lang.String[] clientIds

Client IDs allowed to call this method, applicable to all methods of the API unless overridden
 by @ApiClass#clientIds or @ApiMethod#clientIds.

Default:

"_UNSPECIFIED_LIST_STRING_VALUE"

authenticators

public abstract java.lang.Class<? extends Authenticator>[] authenticators

Custom authenticators. Applies to all methods of the API unless overridden by
 @ApiClass#authenticators or @ApiMethod#authenticators. See
 Authenticator.

Default:

com.google.api.server.spi.config.Authenticator.class

peerAuthenticators

public abstract java.lang.Class<? extends PeerAuthenticator>[] peerAuthenticators

Custom peer authenticators. Applies to all methods of the API unless overridden by
 @ApiClass#peerAuthenticators or @ApiMethod#peerAuthenticators. See
 PeerAuthenticator.

Default:

com.google.api.server.spi.config.PeerAuthenticator.class

isAbstract

public abstract AnnotationBoolean isAbstract

true if this API configuration is used as the base for another. Should be false
 for most situations.

Default:

com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

defaultVersion

public abstract AnnotationBoolean defaultVersion

Marks this version of an API as the default version to use when a JSON-RPC call is executed
 against the API.

Default:

com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

resource

public abstract java.lang.String resource

The name (in plural) of the resource collection. It is used as a part of the RESTful path and
 RPC method name. If it is left empty, a value is deduced from inspecting each endpoint method.

Default:

""

transformers

public abstract java.lang.Class<? extends Transformer<?,?>>[] transformers

Custom transformers to be used for this API.

Default:

{}

useDatastoreForAdditionalConfig

public abstract AnnotationBoolean useDatastoreForAdditionalConfig

AnnotationBoolean.TRUE to request that overriding configuration be loaded from the
 appengine datastore for all API classes except for those classes that override using
 @ApiClass#useDatastoreForAdditionalConfig.

Default:

com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

namespace

public abstract ApiNamespace namespace

Configures namespacing for generated clients. See ApiNamespace for details.

Default:

@com.google.api.server.spi.config.ApiNamespace(ownerDomain="", ownerName="")

discoverable

public abstract AnnotationBoolean discoverable

Whether or not the API is discoverable. This prevents the JavaScript client from working, and
 by extension, the API Explorer.

Default:

com.google.api.server.spi.config.AnnotationBoolean.UNSPECIFIED

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element


text:
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <link rel="stylesheet" href="css/style.css" type="text/css" />
	<title>Test SVG Renderer</title>

Drawing tool

redpajama_set_name: RedPajamaGithub


text:
This example is a bit more complex than the previous and showcases:

- adding additional validation around what types of files can be uploaded
- enabling drag and drop uploads with `useDropzone`
- uploading files to a server using
  [XHLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest)
- using the returned value from the hook to display additional information to
  the user

> Note: The server upload portion will not work once converted imported into a
> code sandbox.


text:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}

module DB.Queries.SessionToken where

import Database.Persist
import Database.Persist.Postgresql
import Data.Time
import DB.Schema
import DB.Config
import Control.Monad.Reader        (ReaderT, runReaderT)
import Control.Monad.Reader.Class
import Control.Monad.IO.Class (liftIO)
import Data.Validation
import DB.Queries.User
import qualified Data.ByteString.Char8

newSessionToken :: Key User -> App (Key SessionToken)
newSessionToken user = do
  time <- liftIO getCurrentTime
  let token = "Fucky"
  runDb $ insert $ SessionToken user token time


text:
<?php

namespace Cast\Serialize;

use Cast\CastException;

class SerializerException extends CastException
{
    protected $serializer;

    public function __construct(SerializerInterface &$serializer, $message = "", $code = 0, \Exception $previous = null)
    {
        parent::__construct($message, $code, $previous);
        $this->serializer = &$serializer;
    }

    public function getSerializer()
    {
        return $this->serializer;
    }
}


text:
import { mustBeBoolean } from '../checks/mustBeBoolean';
import { mustBeGE } from '../checks/mustBeGE';
import { mustBeInteger } from '../checks/mustBeInteger';
import { mustBeLT } from '../checks/mustBeLT';
import { BeginMode } from '../core/BeginMode';
import { readOnly } from '../i18n/readOnly';
import { numPostsForFence } from './numPostsForFence';
import { numVerticesForCurve } from './numVerticesForCurve';
import { Transform } from './Transform';
import { Vertex } from './Vertex';
import { VertexPrimitive } from './VertexPrimitive';

/**
 * @hidden
 */
export class CurvePrimitive extends VertexPrimitive {

    private _uSegments: number;

    private _uClosed: boolean;

    /**
     * @param mode
     * @param uSegments
     * @param uClosed
     */
    constructor(mode: BeginMode, uSegments: number, uClosed: boolean) {
        super(mode, numVerticesForCurve(uSegments), 1);
        mustBeInteger('uSegments', uSegments);
        mustBeGE('uSegments', uSegments, 0);
        mustBeBoolean('uClosed', uClosed);
        this._uSegments = uSegments;
        this._uClosed = uClosed;
        const uLength = this.uLength;
        for (let uIndex = 0; uIndex < uLength; uIndex++) {
            const coords = this.vertex(uIndex).coords;
            coords.setComponent(0, uIndex);
        }
    }

    get uSegments(): number {
        return this._uSegments;
    }
    set uSegments(uSegments: number) {
        mustBeInteger('uSegments', uSegments);
        throw new Error(readOnly('uSegments').message);
    }

    /**
     * uLength = uSegments + 1
     */
    get uLength(): number {
        return numPostsForFence(this._uSegments, this._uClosed);
    }
    set uLength(uLength: number) {
        mustBeInteger('uLength', uLength);
        throw new Error(readOnly('uLength').message);
    }

    public vertexTransform(transform: Transform): void {
        const iLen = this.vertices.length;
        for (let i = 0; i < iLen; i++) {
            const vertex = this.vertices[i];
            const u = vertex.coords.getComponent(0);
            transform.exec(vertex, u, 0, this.uLength, 0);
        }
    }

    public vertex(uIndex: number): Vertex {
        mustBeInteger('uIndex', uIndex);
        mustBeGE('uIndex', uIndex, 0);
        mustBeLT('uIndex', uIndex, this.uLength);
        return this.vertices[uIndex];
    }
}


text:
import urllib, re, sys
import xbmc, xbmcplugin,xbmcgui,xbmcaddon
import HTMLParser
import XbmcHelpers
import json

from urllib2 import Request, urlopen, URLError
common = XbmcHelpers

BASE_URL = 'http://www.filin.tv'
pluginhandle = int(sys.argv[1])

Addon = xbmcaddon.Addon(id='plugin.video.filin.tv')
language      = Addon.getLocalizedString
addon_icon    = Addon.getAddonInfo('icon')
addon_path    = Addon.getAddonInfo('path')

import Translit as translit
translit = translit.Translit(encoding='cp1251')

VIEW_MODES = {
    "List" : '50',
    "Big List" : '51',
    "Media Info" : '52',
    "Media Info 2" : '54',
    "Fanart" : '57',
    "Fanart 2" : '59'
}

# *** Python helpers ***
def strip_html(text):
  def fixup(m):
    text = m.group(0)
    if text[:1] == "<":
      if text[1:3] == 'br':
        return '\n'
      else:
        return ""
    if text[:2] == "&#":
      try:
        if text[:3] == "&#x":
          return chr(int(text[3:-1], 16))
        else:
          return chr(int(text[2:-1]))
      except ValueError:
        pass
    elif text[:1] == "&":
      import htmlentitydefs
      if text[1:-1] == "mdash":
        entity = " - "
      elif text[1:-1] == "ndash":
        entity = "-"
      elif text[1:-1] == "hellip":
        entity = "-"
      else:
        entity = htmlentitydefs.entitydefs.get(text[1:-1])
      if entity:
        if entity[:2] == "&#":
          try:
            return chr(int(entity[2:-1]))
          except ValueError:
            pass
        else:
          return entity
    return text
  ret =  re.sub("(?s)<[^>]*>|&#?\w+;", fixup, text)
  return re.sub("\n+", '\n' , ret)

def remove_extra_spaces(data):  # Remove more than one consecutive white space
    p = re.compile(r'\s+')
    return p.sub(' ', data)

def unescape(entity, encoding):
  if encoding == 'utf-8':
    return HTMLParser.HTMLParser().unescape(entity).encode(encoding)
  elif encoding == 'cp1251':
    return entity.decode(encoding).encode('utf-8')

def localize(string):
    return unescape(string, 'utf-8')

def colorize(string, color):
    text = "[COLOR " + color + "]" + string + "[/COLOR]"
    return text

def get_url(string):
  return re.findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+.xml', string)[0]

# *** XBMC helpers ***
def xbmcItem(url, title, mode, *args):
    item = xbmcgui.ListItem(title)
    uri = sys.argv[0] + '?mode='+ mode + '&url=' + url
    xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

def get_params():
    param=[]
    paramstring = sys.argv[2]

    if len(paramstring)>=2:
        params=sys.argv[2]
        cleanedparams=params.replace('?','')

        if (params[len(params)-1]=='/'):
            params=params[0:len(params)-2]
        pairsofparams=cleanedparams.split('&')

        param={}
        for i in range(len(pairsofparams)):
            splitparams={}
            splitparams=pairsofparams[i].split('=')
            if (len(splitparams))==2:
                param[splitparams[0]]=splitparams[1]
    return param

# *** Addon helpers ***
def beatify_title(title):
  title = unescape(title, 'cp1251').replace(language(5000).encode('utf-8'),"")
  return title.replace(language(5001).encode('utf-8'),"")

def getDescription(block):
    html = block[block.find('
'):len(block)]
    return unescape(strip_html(remove_extra_spaces(html)), 'cp1251')

    #return unescape(remove_extra_spaces(remove_html_tags(html)), 'cp1251')

def getThumbnail(block):
    thumbnail = common.parseDOM(block, "img", ret = "src")[0]
    if thumbnail[0] == '/': thumbnail = BASE_URL+thumbnail
    return thumbnail

def getTitle(block):
    title = common.parseDOM(block, "a")
    return title[len(title)-1]

def calculateRating(x):
    rating = (int(x)*100)/100
    xbmc_rating = (rating*10)/100
    return xbmc_rating

# *** UI functions ***
def search():
    kbd = xbmc.Keyboard()
    kbd.setDefault('')
    kbd.setHeading(language(2002))
    kbd.doModal()
    keyword=''

    if kbd.isConfirmed():
      keyword = kbd.getText()

    if Addon.getSetting('translit') == 'true':
      keyword = translit.rus(kbd.getText())

    path = "/do=search"

    # Advanced search: titles only
    values = {
      'beforeafter' : 'after',
      'catlist[]' : '0',
      'do' : 'search',
      'full_search' : '1',
      'replyless' : '0',
      'replylimit' : '0',
      'resorder' : 'desc',
      'result_from' : '1',
      'result_num' : '30',
      'search_start' : '1',
      'searchdate' : '0',
      'searchuser' : '',
      'showposts' : '0',
      'sortby' : 'date',
      'subaction' : 'search',
      'titleonly' : '3'
    }
    try:
        # Apple TV
        values['story'] = keyword

        data = urllib.urlencode(values)
        req = Request(BASE_URL+path, data)
    except UnicodeEncodeError:
        # Desktop
        values['story'] = keyword.encode('cp1251')

        data = urllib.urlencode(values)
        req = Request(BASE_URL+path, data)

    try:
        response = urlopen(req)
    except URLError, e:
        if hasattr(e, 'reason'):
            print 'We failed to reach a server.'
            print 'Reason: ', e.reason
        elif hasattr(e, 'code'):
            print 'The server couldn\'t fulfill the request.'
            print 'Error code: ', e.code
    else:
        response = response.read()
        content = common.parseDOM(response, "div", attrs = { "id":"dle-content" })
        blocks = common.parseDOM(content, "div", attrs = { "class":"block" })

        if len(blocks) > 1:
            result = common.parseDOM(content, "span", attrs = { "class":"sresult" })[0]
            item = xbmcgui.ListItem(colorize(unescape(result, 'cp1251'), 'FF00FFF0'))
            item.setProperty('IsPlayable', 'false')
            xbmcplugin.addDirectoryItem(pluginhandle, '', item, False)

            mainf = common.parseDOM(content, "div", attrs = { "class":"mainf" })
            titles = common.parseDOM(mainf, "a")
            links = common.parseDOM(mainf, "a", ret = "href")

            for i in range(0, len(links)):
                title = beatify_title(titles[i])
                uri = sys.argv[0] + '?mode=SHOW&url=' + links[i] + "&thumbnail="

                item = xbmcgui.ListItem(title)

                # TODO: move to "addFavorite" function
                script = "special://home/addons/plugin.video.filin.tv/contextmenuactions.py"
                params = "add|%s"%links[i] + "|%s"%title
                runner = "XBMC.RunScript(" + str(script)+ ", " + params + ")"
                item.addContextMenuItems([(localize(language(3001)), runner)])
                xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)
        else:
            item = xbmcgui.ListItem(colorize(language(2004), 'FFFF4000'))
            item.setProperty('IsPlayable', 'false')
            xbmcplugin.addDirectoryItem(pluginhandle, '', item, False)

    xbmcplugin.endOfDirectory(pluginhandle, True)

def getCategories(url):
    result = common.fetchPage({"link": url})

    if result["status"] == 200:
        content = common.parseDOM(result["content"], "div", attrs = { "class":"mcont" })
        categories = common.parseDOM(content, "option", ret="value")
        descriptions = common.parseDOM(content, "option")

        for i in range(0, len(categories)):
            uri = sys.argv[0] + '?mode=CATEGORIE&url=' + BASE_URL + '/x.php&categorie=' + categories[i]
            title = unescape(descriptions[i], 'cp1251')

            item = xbmcgui.ListItem(title)
            xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

    xbmcplugin.endOfDirectory(pluginhandle, True)

def getCategoryItems(url, categorie, page):
    print "*** getCategoryItems"
    path = url + "?onlyjanr=" + categorie
    page = int(page)

    response = common.fetchPage({"link": path})
    content = response['content']

    if response["status"] == 200:
        links = common.parseDOM(content, "a", ret="href")
        titles = common.parseDOM(content, "a")

        if page == 1:
            min=0
            max = {True: page*20, False: len(links)}[len(links) > (page*20)]
        else:
            min=(page-1)*20
            max= {True: page*20, False: len(links)}[len(links) > (page*20)]

        for i in range(min, max):
          uri = sys.argv[0] + '?mode=SHOW&url=' + links[i] + "&thumbnail="

          if titles[i] == '': titles[i] = "[Unknown]" #TODO: investigate title issue
          item = xbmcgui.ListItem(titles[i])

          # TODO: move to "addFavorite" function
          script = "special://home/addons/plugin.video.filin.tv/contextmenuactions.py"
          params = "add|%s"%links[i] + "|%s"%titles[i]
          runner = "XBMC.RunScript(" + str(script)+ ", " + params + ")"

          item.addContextMenuItems([(localize(language(3001)), runner)])
          xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

        if max >= 20 and max < len(links):
            uri = sys.argv[0] + '?mode=CNEXT&url=' + url + '&page=' + str(page+1) + '&categorie=' + categorie
            item = xbmcgui.ListItem(localize(language(3000)))
            xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

        xbmcplugin.endOfDirectory(pluginhandle, True)

def listGenres():
    genres = [
                 'http://www.filin.tv/otechestvennue/',
                 'http://www.filin.tv/detectiv/',
                 'http://www.filin.tv/romance/',
                 'http://www.filin.tv/action/',
                 'http://www.filin.tv/fantastika/',
                 'http://www.filin.tv/kriminal/',
                 'http://www.filin.tv/comedi/',
                 'http://www.filin.tv/teleshou/',
                 'http://www.filin.tv/multfilms/',
                 'http://www.filin.tv/adventure/',
                 'http://www.filin.tv/fantasy/',
                 'http://www.filin.tv/horror/',
                 'http://www.filin.tv/drama/',
                 'http://www.filin.tv/history/',
                 'http://www.filin.tv/triller/',
                 'http://www.filin.tv/mystery/',
                 'http://www.filin.tv/sport/',
                 'http://www.filin.tv/musical/',
                 'http://www.filin.tv/dokumentalnii/',
                 'http://www.filin.tv/war/'
    ]

    for i in range(0, len(genres)):
        uri = sys.argv[0] + '?&url=' + genres[i] + '/'
        item = xbmcgui.ListItem(localize(language(1000+i)))
        xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

    xbmcplugin.endOfDirectory(pluginhandle, True)

def listFavorites():
    string = Addon.getSetting('favorites')

    if len(string) == 0:
        item = xbmcgui.ListItem(language(3002))
        xbmcplugin.addDirectoryItem(pluginhandle, '', item, False)
    else:
        favorites = json.loads(string.replace('\x00', ''))
        for key in favorites:
            item = xbmcgui.ListItem(favorites[key])

            # TODO: show thumbnail (item = xbmcgui.ListItem(key, thumbnailImage=thumbnail))
            uri = sys.argv[0] + '?mode=SHOW&url=' + key + '&thumbnail='
            item.setInfo( type='Video', infoLabels={'title': favorites[key]})

            # TODO: move to "addFavorite" function
            script = "special://home/addons/plugin.video.filin.tv/contextmenuactions.py"
            params = "remove|%s" % key + "|%s" % favorites[key]
            runner = "XBMC.RunScript(" + str(script)+ ", " + params + ")"
            item.addContextMenuItems([(localize(language(3004)), runner)])
            xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

        item = xbmcgui.ListItem("[COLOR=FFFF4000]%s[/COLOR]" % language(3006))
        uri = sys.argv[0] + '?mode=RESET'
        item.setProperty('IsPlayable', 'true')
        xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

    xbmcplugin.endOfDirectory(pluginhandle, True)

def resetFavorites():
    dialog = xbmcgui.Dialog()
    answer = dialog.yesno(language(3006), language(3007))
    if answer == 1:
      Addon.setSetting('favorites', '')

# Get latest income from index page
def getRecentItems(url):

    if url==BASE_URL:
        xbmcItem('', colorize(localize('['+language(2002)+']'), "FF00FF00"), 'SEARCH')
        xbmcItem('', colorize(localize(language(2003)), "FF00FFF0"), 'FAVORITES')
        xbmcItem('', colorize(localize(language(2000)), "FF00FFF0"), 'CATEGORIES')
        xbmcItem('', colorize(localize(language(2001)), "FF00FFF0"), 'GENRES')

    getItems(url)

def getItems(url):
    print "*** getItems"

    response = common.fetchPage({"link": url})

    if response["status"] == 200:
        content = common.parseDOM(response["content"], "div", attrs = { "id":"dle-content" })
        blocknews = common.parseDOM(content, "div", attrs = { "class":"blocknews" })

        mainf = common.parseDOM(blocknews, "div", attrs = { "class":"mainf" })

        titles = common.parseDOM(mainf, "a")
        links = common.parseDOM(mainf, "a", ret="href")

        blocktext = common.parseDOM(content, "div", attrs = { "class":"block_text" })

        images = common.parseDOM(blocktext, "img", ret = "src")
        descriptions = common.parseDOM(blocktext, "td", attrs = { "style":"padding-left:10px;" })
        ratings = common.parseDOM(blocktext, "li", attrs={"class": "current-rating"})

        genres = []
        for i, g in enumerate(common.parseDOM(blocknews, "div", attrs = { "class":"categ" })):
            genres.append(" ".join(str(g) for g in common.parseDOM(g, "a")))

        for i, title in enumerate(titles):
            if images[i][0] == '/': images[i] = BASE_URL+images[i]
            title = beatify_title(title)
            genre = unescape(str(genres[i]), 'cp1251')

            description = unescape(descriptions[i].split('
')[-1], 'cp1251')
            description = common.stripTags(description.split('')[-1])

            uri = sys.argv[0] + '?mode=SHOW&url=' + links[i] + '&thumbnail=' + images[i]
            item = xbmcgui.ListItem(title, iconImage = addon_icon, thumbnailImage=images[i])
            infoLabels={'title': title, 'genre' : genre, 'plot': description}

            if calculateRating(ratings[i]) > 0:
                infoLabels['rating'] = calculateRating(ratings[i])

            # print "Rating: %s - %d" % (ratings[i], calculateRating(ratings[i]))

            item.setInfo( type='Video', infoLabels=infoLabels)
            item.setProperty( "isFolder", 'True')

            # TODO: move to "addFavorite" function
            script = "special://home/addons/plugin.video.filin.tv/contextmenuactions.py"
            params = "add|%s"%links[i] + "|%s"%title
            runner = "XBMC.RunScript(" + str(script)+ ", " + params + ")"

            item.addContextMenuItems([(localize(language(3001)), runner)])
            xbmcplugin.addDirectoryItem(pluginhandle, uri, item, True)

    next = url + '/page/2' if url.find("page") == -1 else url[:-1] + str(int(url[-1])+1)

    xbmcItem(next, localize(language(3000)), 'RNEXT')

    try:
        mode = VIEW_MODES[Addon.getSetting('seasonsViewMode')]
        xbmc.executebuiltin("Container.SetViewMode(" + mode + ")")
    except Exception, e:
        print "*** Exception"
        print e
        xbmc.executebuiltin('Container.SetViewMode(50)')

    xbmcplugin.endOfDirectory(pluginhandle, True)

def showItem(url, thumbnail):
    content = common.fetchPage({"link": url})["content"]
    mainf = common.parseDOM(content, "div", attrs = { "class":"categ" })
    block = common.parseDOM(content, "div", attrs = { "class":"ssc" })[0]

    image_container = common.parseDOM(block, "td", attrs = { 'valign':'top' })
    image = common.parseDOM(image_container, "img", ret="src")[0]
    image = image if image.startswith( 'http' ) else BASE_URL + image

    genre = unescape(" ".join(str(g) for g in common.parseDOM(mainf, "a")), 'cp1251')

    title = beatify_title(getTitle(block))
    desc = common.stripTags(getDescription(block))

    # TODO: find an alternativ way to get flashvars from javascript
    scripts = common.parseDOM(content, 'script')
    matching = [s for s in scripts if "flashvar" in s]
    playlist = (matching[0].split('pl:')[-1].split('.json')[0] + '.json').replace(' ', '').replace('"', '')

    if playlist:
        source_url = "http://kino-dom.tv/"

        if '/play/' in playlist:
          url2json = source_url+playlist
        else:
          url2json = source_url+playlist.replace('play/', '/play/')

        # multiple
        # url2json = "http://kino-dom.tv/01f551e61970b9645b5465460daccdfe/play/devushkiibombi.xml.json"

        # single
        # url2json = "http://kino-dom.tv/01f551e61970b9645b5465460daccdfe/play/sashatanja_mp4.xml.json"

        # wrong json format
        # url2json = "http://kino-dom.tv/01f551e61970b9645b5465460daccdfe/play/institutblagorodnihdevic2_mp4.xml.json"

        # http://st2.kino-dom.tv/s/c4e4f5c266109990611aadc0dedb9f55/Naciyz_lostfilm_mp4/s01e01.mp4
        # http://st2.kino-dom.tv/s/playlistJSON.php/Naciyz_lostfilm_mp4/s01e01.mp4

        code = playlist.split('/')[1]
        response = common.fetchPage({"link":url2json})["content"]

        try:
          playlist = json.loads(response)['playlist']
        except ValueError:
          print "WARNING: wrong JSON format"

          response = response.replace('\r', '').replace('\t', '').replace('\r\n', '')
          playlist = json.loads(response)['playlist']

        if 'playlist' in playlist[0]:
            print "*** This is a playlist with several seasons"

            for season in playlist:
                title = season['comment']
                episods = season['playlist']

                for episode in episods:
                    title = ('%s (%s)') % (episode['comment'], season['comment'])

                    print episode['file']

                    url = episode['file'].replace('http:/kino-dom.tv/', '').replace('playlistJSON.php', code)
                    uri = sys.argv[0] + '?mode=play&url=%s' % url

                    item = xbmcgui.ListItem(title, thumbnailImage=image)

                    overlay = xbmcgui.ICON_OVERLAY_WATCHED
                    info = {"Title": title, 'genre' : genre, "Plot": desc, "overlay": overlay, "playCount": 0}

                    item.setInfo( type='Video', infoLabels=info)
                    item.setProperty('IsPlayable', 'true')
                    xbmcplugin.addDirectoryItem(pluginhandle, uri, item, False)
        else:
            print "*** This is a playlist with one season"

            for episode in playlist:
                title = episode['comment']
                url = episode['file'].replace('http:/kino-dom.tv/', '').replace('playlistJSON.php', code)
                uri = sys.argv[0] + '?mode=play&url=%s' % url

                item = xbmcgui.ListItem(title, thumbnailImage=image)

                overlay = xbmcgui.ICON_OVERLAY_WATCHED
                info = {"Title": title, 'genre' : genre, "Plot": desc, "overlay": overlay, "playCount": 0}

                item.setInfo( type='Video', infoLabels=info)
                item.setProperty('IsPlayable', 'true')
                xbmcplugin.addDirectoryItem(pluginhandle, uri, item, False)

        # for season in json:
        #     seasonName = season['comment']
        #     for obj in season['playlist']:
        #         locations.append(obj['file'])
        #         titles.append(seasonName+" - "+obj['comment'])

        # for i in range(0, len(locations)):
        #     uri = sys.argv[0] + '?mode=PLAY&url=%s'%locations[i]
        #     item = xbmcgui.ListItem(unescape(titles[i], 'utf-8'), iconImage=addon_icon, thumbnailImage=image)

        #     print locations[i]

        #     overlay = xbmcgui.ICON_OVERLAY_WATCHED
        #     info = {"Title": title, 'genre' : genre, "Plot": desc, "overlay": overlay, "playCount": 0}
        #     item.setInfo( type='Video', infoLabels=info)
        #     item.setProperty('IsPlayable', 'true')
        #     xbmcplugin.addDirectoryItem(pluginhandle, uri, item, False)

    # set view mode to List2 (quarz3 skin)
    try:
        mode = VIEW_MODES[Addon.getSetting('episodsViewMode')]
        xbmc.executebuiltin("Container.SetViewMode(" + mode +")")
    except Exception, e:
        print "*** Exception"
        print e
        xbmc.executebuiltin('Container.SetViewMode(50)')

    xbmcplugin.endOfDirectory(pluginhandle, True)

def playItem(url):
    print url
    item = xbmcgui.ListItem(path = url)
    item.setProperty('mimetype', 'video/x-flv')
    xbmcplugin.setResolvedUrl(pluginhandle, True, item)

# MAIN()
params = get_params()

# TODO: code refactoring
url=None
mode=None
categorie=None
thumbnail=None
page=None

try:
    mode=params['mode'].upper()
except: pass
try:
    url=urllib.unquote_plus(params['url'])
except: pass
try:
    categorie=params['categorie']
except: pass
try:
    thumbnail=urllib.unquote_plus(params['thumbnail'])
except: pass
try:
    page=params['page']
except: pass

if mode == 'RNEXT':
    getRecentItems(url)
elif mode == 'CATEGORIES':
    getCategories(BASE_URL)
elif mode == 'CATEGORIE':
    getCategoryItems(url, categorie, '1')
elif mode == 'CNEXT':
    getCategoryItems(url, categorie, page)
elif mode == 'SHOW':
    showItem(url,thumbnail)
elif mode == 'PLAY':
    playItem(url)
elif mode == 'GENRES':
    listGenres();
elif mode == 'SEARCH':
    search();
elif mode == 'FAVORITES':
    listFavorites();
elif mode == 'RESET':
    resetFavorites();
elif mode == None:
    url = BASE_URL if url == None else url
    getRecentItems(url)

# View modes
# <include>CommonRootView</include>
# <include>FullWidthList</include>
# <include>ThumbnailView</include>
# <include>PosterWrapView</include>
# <include>PosterWrapView2_Fanart</include>
# <include>MediaListView3</include>
# <include>MediaListView2</include>
# <include>WideIconView</include>
# <include>MusicVideoInfoListView</include>
# <include>AddonInfoListView1</include>
# <include>AddonInfoThumbView1</include>
# <include>LiveTVView1</include>


text:
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.

#ifndef GU_SPHERE_H
#define GU_SPHERE_H
/** \addtogroup geomutils
@{
*/

#include "PxVec3.h"
#include "CmPhysXCommon.h"

namespace physx
{

/**
\brief Represents a sphere defined by its center point and radius.
*/
namespace Gu
{
	class Sphere
	{
	public:
		/**
		\brief Constructor
		*/
		PX_INLINE Sphere()
		{
		}

		/**
		\brief Constructor
		*/
		PX_INLINE Sphere(const PxVec3& _center, PxF32 _radius) : center(_center), radius(_radius)
		{
		}
		/**
		\brief Copy constructor
		*/
		PX_INLINE Sphere(const Sphere& sphere) : center(sphere.center), radius(sphere.radius)
		{
		}
		/**
		\brief Destructor
		*/
		PX_INLINE ~Sphere()
		{
		}

		PX_INLINE	void	set(const PxVec3& _center, float _radius)		{ center = _center; radius = _radius;	}

		/**
		\brief Checks the sphere is valid.

		\return		true if the sphere is valid
		*/
		PX_INLINE bool isValid() const
		{
			// Consistency condition for spheres: Radius >= 0.0f
			return radius >= 0.0f;
		}

		/**
		\brief Tests if a point is contained within the sphere.

		\param[in] p the point to test
		\return	true if inside the sphere
		*/
		PX_INLINE bool contains(const PxVec3& p) const
		{
			return (center-p).magnitudeSquared() <= radius*radius;
		}

		PxVec3	center;		//!< Sphere's center
		PxF32	radius;		//!< Sphere's radius
	};
}

}

/** @} */
#endif


text:
require_relative "../test_helper"

module ShopifyAPITest
  module Auth
    class SessionTest < Test::Unit::TestCase
      UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/

      def test_create_session_with_id
        session = ShopifyAPI::Auth::Session.new(id: "id", shop: "test-shop")
        assert_equal("id", session.id)
      end

      def test_create_session_no_id
        session = ShopifyAPI::Auth::Session.new(shop: "test-shop")
        assert(UUID_REGEX.match?(session.id))
      end

      def test_is_online_with_associated_user
        user = ShopifyAPI::Auth::AssociatedUser.new(
          id: 1,
          first_name: "first name",
          last_name: "last name",
          email: "my.email@email.com",
          email_verified: true,
          account_owner: true,
          locale: "en",
          collaborator: true
        )

        session = ShopifyAPI::Auth::Session.new(id: "id", shop: "test-shop", associated_user: user)
        assert(session.online?)
      end

      def test_temp
        session = ShopifyAPI::Auth::Session.new(shop: "test-shop1", access_token: "token1")

        ShopifyAPI::Context.activate_session(session)

        ShopifyAPI::Auth::Session.temp(shop: "test_shop2", access_token: "token2") do
          assert_equal("test_shop2", ShopifyAPI::Context.active_session.shop)
          assert_equal("token2", ShopifyAPI::Context.active_session.access_token)
        end

        assert_equal(session, ShopifyAPI::Context.active_session)
      end

      def test_temp_with_block_var
        session = ShopifyAPI::Auth::Session.new(shop: "test-shop1", access_token: "token1")

        ShopifyAPI::Context.activate_session(session)

        ShopifyAPI::Auth::Session.temp(shop: "test_shop2", access_token: "token2") do |temp_session|
          assert_equal("test_shop2", temp_session.shop)
          assert_equal("token2", temp_session.access_token)
          assert_equal(temp_session, ShopifyAPI::Context.active_session)
        end

        assert_equal(session, ShopifyAPI::Context.active_session)
      end

      def teardown
        ShopifyAPI::Context.deactivate_session
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;

namespace Atata
{
    /// <summary>
    /// Represents the builder of component attributes.
    /// </summary>
    public class ComponentAttributesAtataContextBuilder
        : AttributesAtataContextBuilder<ComponentAttributesAtataContextBuilder>
    {
        private readonly Type _componentType;

        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentAttributesAtataContextBuilder"/> class.
        /// </summary>
        /// <param name="componentType">Type of the component.</param>
        /// <param name="buildingContext">The building context.</param>
        public ComponentAttributesAtataContextBuilder(Type componentType, AtataBuildingContext buildingContext)
            : base(buildingContext) =>
            _componentType = componentType;

        /// <summary>
        /// Creates and returns the attributes builder for the property with the specified name.
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        /// <returns>An instance of <see cref="PropertyAttributesAtataContextBuilder{TNextBuilder}"/>.</returns>
        public PropertyAttributesAtataContextBuilder<ComponentAttributesAtataContextBuilder> this[string propertyName] =>
            Property(propertyName);

        /// <summary>
        /// Creates and returns the attributes builder for the property with the specified name.
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        /// <returns>An instance of <see cref="PropertyAttributesAtataContextBuilder{TNextBuilder}"/>.</returns>
        public PropertyAttributesAtataContextBuilder<ComponentAttributesAtataContextBuilder> Property(string propertyName)
        {
            propertyName.CheckNotNullOrWhitespace(nameof(propertyName));

            return new PropertyAttributesAtataContextBuilder<ComponentAttributesAtataContextBuilder>(
                _componentType,
                propertyName,
                this,
                BuildingContext);
        }

        protected override void OnAdd(IEnumerable<Attribute> attributes)
        {
            if (!BuildingContext.Attributes.ComponentMap.TryGetValue(_componentType, out var attributeSet))
            {
                attributeSet = new List<Attribute>();
                BuildingContext.Attributes.ComponentMap[_componentType] = attributeSet;
            }

            attributeSet.AddRange(attributes);
        }

        protected override ComponentAttributesAtataContextBuilder ResolveNextBuilder() => this;
    }
}


text:
//
//  SRHubInvocation.h
//  SignalR
//
//  Created by Alex Billingsley on 11/7/11.
//  Copyright (c) 2011 DyKnow LLC. (http://dyknow.com/)
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
//  documentation files (the "Software"), to deal in the Software without restriction, including without limitation
//  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
//  to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in all copies or substantial portions of
//  the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//  THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
//  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
//  DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>
#import "SRSerializable.h"
#import "SRDeserializable.h"

/**
 * An `SRHubInvocation` object defines the interface for invoking methods on the SignalR Client using a Hubs implementation
 */
@interface SRHubInvocation : NSObject <SRDeserializable, SRSerializable>

///-------------------------------
/// @name Properties
///-------------------------------

@property (strong, nonatomic, readwrite) NSString *callbackId;

/**
 * The `NSString` object corresponding to the hub to preform an invocation on
 */
@property (strong, nonatomic, readwrite) NSString *hub;

/**
 * The `NSString` object corresponding to the method to invoke on the hub
 */
@property (strong, nonatomic, readwrite) NSString *method;

/**
 * The `NSMutableArray` object corresponding to the arguments to be passed as part of the invocation
 */
@property (strong, nonatomic, readwrite) NSMutableArray *args;

/**
 * The `NSMutableDictionary` object corresponding to the client state
 */
@property (strong, nonatomic, readwrite) NSMutableDictionary *state;

@end


text:
.class public Lcom/google/android/gms/internal/zzaz;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;
.implements Landroid/view/ViewTreeObserver$OnScrollChangedListener;

# annotations
.annotation runtime Lcom/google/android/gms/internal/zzgr;
.end annotation

# instance fields
.field private zzpJ:Z

.field private final zzpd:Ljava/lang/Object;

.field private zzqM:Lcom/google/android/gms/internal/zzik;

.field private final zzqZ:Landroid/content/Context;

.field private final zzrb:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference",
            "<",
            "Lcom/google/android/gms/internal/zzhs;",
            ">;"
        }
    .end annotation
.end field

.field private zzrc:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference",
            "<",
            "Landroid/view/ViewTreeObserver;",
            ">;"
        }
    .end annotation
.end field

.field private final zzrd:Ljava/lang/ref/WeakReference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/WeakReference",
            "<",
            "Landroid/view/View;",
            ">;"
        }
    .end annotation
.end field

.field private final zzre:Lcom/google/android/gms/internal/zzax;

.field private final zzrf:Lcom/google/android/gms/internal/zzdz;

.field private final zzrg:Lcom/google/android/gms/internal/zzdz$zzd;

.field private zzrh:Z

.field private final zzri:Landroid/view/WindowManager;

.field private final zzrj:Landroid/os/PowerManager;

.field private final zzrk:Landroid/app/KeyguardManager;

.field private zzrl:Lcom/google/android/gms/internal/zzba;

.field private zzrm:Z

.field private zzrn:Z

.field private zzro:Z

.field private zzrp:Z

.field private zzrq:Landroid/content/BroadcastReceiver;

.field private final zzrr:Ljava/util/HashSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashSet",
            "<",
            "Lcom/google/android/gms/internal/zzaw;",
            ">;"
        }
    .end annotation
.end field

.field private final zzrs:Lcom/google/android/gms/internal/zzdk;

.field private final zzrt:Lcom/google/android/gms/internal/zzdk;

.field private final zzru:Lcom/google/android/gms/internal/zzdk;

# direct methods
.method public constructor <init>(Lcom/google/android/gms/ads/internal/client/AdSizeParcel;Lcom/google/android/gms/internal/zzhs;Lcom/google/android/gms/ads/internal/util/client/VersionInfoParcel;Landroid/view/View;Lcom/google/android/gms/internal/zzdz;)V
    .registers 12

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    iput-boolean v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpJ:Z

    iput-boolean v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrn:Z

    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrr:Ljava/util/HashSet;

    new-instance v0, Lcom/google/android/gms/internal/zzaz$6;

    invoke-direct {v0, p0}, Lcom/google/android/gms/internal/zzaz$6;-><init>(Lcom/google/android/gms/internal/zzaz;)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrs:Lcom/google/android/gms/internal/zzdk;

    new-instance v0, Lcom/google/android/gms/internal/zzaz$7;

    invoke-direct {v0, p0}, Lcom/google/android/gms/internal/zzaz$7;-><init>(Lcom/google/android/gms/internal/zzaz;)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrt:Lcom/google/android/gms/internal/zzdk;

    new-instance v0, Lcom/google/android/gms/internal/zzaz$8;

    invoke-direct {v0, p0}, Lcom/google/android/gms/internal/zzaz$8;-><init>(Lcom/google/android/gms/internal/zzaz;)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzru:Lcom/google/android/gms/internal/zzdk;

    iput-object p5, p0, Lcom/google/android/gms/internal/zzaz;->zzrf:Lcom/google/android/gms/internal/zzdz;

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p2}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrb:Ljava/lang/ref/WeakReference;

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p4}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrd:Ljava/lang/ref/WeakReference;

    new-instance v0, Ljava/lang/ref/WeakReference;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrc:Ljava/lang/ref/WeakReference;

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzro:Z

    new-instance v0, Lcom/google/android/gms/internal/zzik;

    const-wide/16 v2, 0xc8

    invoke-direct {v0, v2, v3}, Lcom/google/android/gms/internal/zzik;-><init>(J)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzqM:Lcom/google/android/gms/internal/zzik;

    new-instance v0, Lcom/google/android/gms/internal/zzax;

    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/UUID;->toString()Ljava/lang/String;

    move-result-object v1

    iget-object v3, p1, Lcom/google/android/gms/ads/internal/client/AdSizeParcel;->zzte:Ljava/lang/String;

    iget-object v4, p2, Lcom/google/android/gms/internal/zzhs;->zzHw:Lorg/json/JSONObject;

    invoke-virtual {p2}, Lcom/google/android/gms/internal/zzhs;->zzbY()Z

    move-result v5

    move-object v2, p3

    invoke-direct/range {v0 .. v5}, Lcom/google/android/gms/internal/zzax;-><init>(Ljava/lang/String;Lcom/google/android/gms/ads/internal/util/client/VersionInfoParcel;Ljava/lang/String;Lorg/json/JSONObject;Z)V

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrf:Lcom/google/android/gms/internal/zzdz;

    invoke-virtual {v0}, Lcom/google/android/gms/internal/zzdz;->zzdO()Lcom/google/android/gms/internal/zzdz$zzd;

    move-result-object v0

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrg:Lcom/google/android/gms/internal/zzdz$zzd;

    invoke-virtual {p4}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "window"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/WindowManager;

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzri:Landroid/view/WindowManager;

    invoke-virtual {p4}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "power"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/os/PowerManager;

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrj:Landroid/os/PowerManager;

    invoke-virtual {p4}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "keyguard"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/KeyguardManager;

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrk:Landroid/app/KeyguardManager;

    invoke-virtual {p4}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzqZ:Landroid/content/Context;

    :try_start_a7
    invoke-virtual {p0, p4}, Lcom/google/android/gms/internal/zzaz;->zzd(Landroid/view/View;)Lorg/json/JSONObject;

    move-result-object v0

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrg:Lcom/google/android/gms/internal/zzdz$zzd;

    new-instance v2, Lcom/google/android/gms/internal/zzaz$1;

    invoke-direct {v2, p0, v0}, Lcom/google/android/gms/internal/zzaz$1;-><init>(Lcom/google/android/gms/internal/zzaz;Lorg/json/JSONObject;)V

    new-instance v0, Lcom/google/android/gms/internal/zzaz$2;

    invoke-direct {v0, p0}, Lcom/google/android/gms/internal/zzaz$2;-><init>(Lcom/google/android/gms/internal/zzaz;)V

    invoke-virtual {v1, v2, v0}, Lcom/google/android/gms/internal/zzdz$zzd;->zza(Lcom/google/android/gms/internal/zzis$zzc;Lcom/google/android/gms/internal/zzis$zza;)V
    :try_end_ba
    .catch Lorg/json/JSONException; {:try_start_a7 .. :try_end_ba} :catch_ed
    .catch Ljava/lang/RuntimeException; {:try_start_a7 .. :try_end_ba} :catch_e6

    :goto_ba
    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrg:Lcom/google/android/gms/internal/zzdz$zzd;

    new-instance v1, Lcom/google/android/gms/internal/zzaz$3;

    invoke-direct {v1, p0}, Lcom/google/android/gms/internal/zzaz$3;-><init>(Lcom/google/android/gms/internal/zzaz;)V

    new-instance v2, Lcom/google/android/gms/internal/zzaz$4;

    invoke-direct {v2, p0}, Lcom/google/android/gms/internal/zzaz$4;-><init>(Lcom/google/android/gms/internal/zzaz;)V

    invoke-virtual {v0, v1, v2}, Lcom/google/android/gms/internal/zzdz$zzd;->zza(Lcom/google/android/gms/internal/zzis$zzc;Lcom/google/android/gms/internal/zzis$zza;)V

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "Tracking ad unit: "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v1}, Lcom/google/android/gms/internal/zzax;->zzbX()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zzaF(Ljava/lang/String;)V

    return-void

    :catch_e6
    move-exception v0

    const-string v1, "Failure while processing active view data."

    invoke-static {v1, v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zzb(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_ba

    :catch_ed
    move-exception v0

    goto :goto_ba
.end method

.method static synthetic zzb(Lcom/google/android/gms/internal/zzaz;)Lcom/google/android/gms/internal/zzax;
    .registers 2

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    return-object v0
.end method

.method static synthetic zzb(Lcom/google/android/gms/internal/zzaz;Z)Z
    .registers 2

    iput-boolean p1, p0, Lcom/google/android/gms/internal/zzaz;->zzrh:Z

    return p1
.end method

# virtual methods
.method protected destroy()V
    .registers 3

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzcf()V

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzca()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzro:Z

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzcc()V

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrg:Lcom/google/android/gms/internal/zzdz$zzd;

    invoke-virtual {v0}, Lcom/google/android/gms/internal/zzdz$zzd;->release()V

    monitor-exit v1

    return-void

    :catchall_16
    move-exception v0

    monitor-exit v1
    :try_end_18
    .catchall {:try_start_3 .. :try_end_18} :catchall_16

    throw v0
.end method

.method isScreenOn()Z
    .registers 2

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrj:Landroid/os/PowerManager;

    invoke-virtual {v0}, Landroid/os/PowerManager;->isScreenOn()Z

    move-result v0

    return v0
.end method

.method public onGlobalLayout()V
    .registers 2

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zzh(Z)V

    return-void
.end method

.method public onScrollChanged()V
    .registers 2

    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zzh(Z)V

    return-void
.end method

.method public pause()V
    .registers 3

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    const/4 v0, 0x1

    :try_start_4
    iput-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzpJ:Z

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zzh(Z)V

    monitor-exit v1

    return-void

    :catchall_c
    move-exception v0

    monitor-exit v1
    :try_end_e
    .catchall {:try_start_4 .. :try_end_e} :catchall_c

    throw v0
.end method

.method public resume()V
    .registers 3

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    const/4 v0, 0x0

    :try_start_4
    iput-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzpJ:Z

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zzh(Z)V

    monitor-exit v1

    return-void

    :catchall_c
    move-exception v0

    monitor-exit v1
    :try_end_e
    .catchall {:try_start_4 .. :try_end_e} :catchall_c

    throw v0
.end method

.method public stop()V
    .registers 3

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    const/4 v0, 0x1

    :try_start_4
    iput-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrn:Z

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zzh(Z)V

    monitor-exit v1

    return-void

    :catchall_c
    move-exception v0

    monitor-exit v1
    :try_end_e
    .catchall {:try_start_4 .. :try_end_e} :catchall_c

    throw v0
.end method

.method protected zza(ILandroid/util/DisplayMetrics;)I
    .registers 5

    iget v0, p2, Landroid/util/DisplayMetrics;->density:F

    int-to-float v1, p1

    div-float v0, v1, v0

    float-to-int v0, v0

    return v0
.end method

.method protected zza(Landroid/view/View;Ljava/util/Map;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/view/View;",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zzh(Z)V

    return-void
.end method

.method public zza(Lcom/google/android/gms/internal/zzaw;)V
    .registers 3

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrr:Ljava/util/HashSet;

    invoke-virtual {v0, p1}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public zza(Lcom/google/android/gms/internal/zzba;)V
    .registers 4

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iput-object p1, p0, Lcom/google/android/gms/internal/zzaz;->zzrl:Lcom/google/android/gms/internal/zzba;

    monitor-exit v1

    return-void

    :catchall_7
    move-exception v0

    monitor-exit v1
    :try_end_9
    .catchall {:try_start_3 .. :try_end_9} :catchall_7

    throw v0
.end method

.method protected zza(Lcom/google/android/gms/internal/zzbe;)V
    .registers 4

    const-string v0, "/updateActiveView"

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrs:Lcom/google/android/gms/internal/zzdk;

    invoke-interface {p1, v0, v1}, Lcom/google/android/gms/internal/zzbe;->zza(Ljava/lang/String;Lcom/google/android/gms/internal/zzdk;)V

    const-string v0, "/untrackActiveViewUnit"

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrt:Lcom/google/android/gms/internal/zzdk;

    invoke-interface {p1, v0, v1}, Lcom/google/android/gms/internal/zzbe;->zza(Ljava/lang/String;Lcom/google/android/gms/internal/zzdk;)V

    const-string v0, "/visibilityChanged"

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzru:Lcom/google/android/gms/internal/zzdk;

    invoke-interface {p1, v0, v1}, Lcom/google/android/gms/internal/zzbe;->zza(Ljava/lang/String;Lcom/google/android/gms/internal/zzdk;)V

    return-void
.end method

.method protected zza(Lorg/json/JSONObject;)V
    .registers 5

    :try_start_0
    new-instance v0, Lorg/json/JSONArray;

    invoke-direct {v0}, Lorg/json/JSONArray;-><init>()V

    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    invoke-virtual {v0, p1}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    const-string v2, "units"

    invoke-virtual {v1, v2, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrg:Lcom/google/android/gms/internal/zzdz$zzd;

    new-instance v2, Lcom/google/android/gms/internal/zzaz$9;

    invoke-direct {v2, p0, v1}, Lcom/google/android/gms/internal/zzaz$9;-><init>(Lcom/google/android/gms/internal/zzaz;Lorg/json/JSONObject;)V

    new-instance v1, Lcom/google/android/gms/internal/zzis$zzb;

    invoke-direct {v1}, Lcom/google/android/gms/internal/zzis$zzb;-><init>()V

    invoke-virtual {v0, v2, v1}, Lcom/google/android/gms/internal/zzdz$zzd;->zza(Lcom/google/android/gms/internal/zzis$zzc;Lcom/google/android/gms/internal/zzis$zza;)V
    :try_end_21
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_21} :catch_22

    :goto_21
    return-void

    :catch_22
    move-exception v0

    const-string v1, "Skipping active view message."

    invoke-static {v1, v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zzb(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_21
.end method

.method protected zzb(Ljava/util/Map;)Z
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)Z"
        }
    .end annotation

    const/4 v1, 0x0

    if-nez p1, :cond_4

    :goto_3
    return v1

    :cond_4
    const-string v0, "hashCode"

    invoke-interface {p1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_21

    iget-object v2, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v2}, Lcom/google/android/gms/internal/zzax;->zzbX()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_21

    const/4 v0, 0x1

    :goto_1f
    move v1, v0

    goto :goto_3

    :cond_21
    move v0, v1

    goto :goto_1f
.end method

.method protected zzbZ()V
    .registers 5

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrq:Landroid/content/BroadcastReceiver;

    if-eqz v0, :cond_9

    monitor-exit v1

    :goto_8
    return-void

    :cond_9
    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    const-string v2, "android.intent.action.SCREEN_ON"

    invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v2, "android.intent.action.SCREEN_OFF"

    invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    new-instance v2, Lcom/google/android/gms/internal/zzaz$5;

    invoke-direct {v2, p0}, Lcom/google/android/gms/internal/zzaz$5;-><init>(Lcom/google/android/gms/internal/zzaz;)V

    iput-object v2, p0, Lcom/google/android/gms/internal/zzaz;->zzrq:Landroid/content/BroadcastReceiver;

    iget-object v2, p0, Lcom/google/android/gms/internal/zzaz;->zzqZ:Landroid/content/Context;

    iget-object v3, p0, Lcom/google/android/gms/internal/zzaz;->zzrq:Landroid/content/BroadcastReceiver;

    invoke-virtual {v2, v3, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    monitor-exit v1

    goto :goto_8

    :catchall_28
    move-exception v0

    monitor-exit v1
    :try_end_2a
    .catchall {:try_start_3 .. :try_end_2a} :catchall_28

    throw v0
.end method

.method protected zzca()V
    .registers 4

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrq:Landroid/content/BroadcastReceiver;

    if-eqz v0, :cond_11

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzqZ:Landroid/content/Context;

    iget-object v2, p0, Lcom/google/android/gms/internal/zzaz;->zzrq:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v2}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrq:Landroid/content/BroadcastReceiver;

    :cond_11
    monitor-exit v1

    return-void

    :catchall_13
    move-exception v0

    monitor-exit v1
    :try_end_15
    .catchall {:try_start_3 .. :try_end_15} :catchall_13

    throw v0
.end method

.method public zzcb()V
    .registers 4

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzro:Z

    if-eqz v0, :cond_2d

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrp:Z
    :try_end_a
    .catchall {:try_start_3 .. :try_end_a} :catchall_36

    :try_start_a
    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzch()Lorg/json/JSONObject;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zza(Lorg/json/JSONObject;)V
    :try_end_11
    .catch Lorg/json/JSONException; {:try_start_a .. :try_end_11} :catch_2f
    .catch Ljava/lang/RuntimeException; {:try_start_a .. :try_end_11} :catch_39
    .catchall {:try_start_a .. :try_end_11} :catchall_36

    :goto_11
    :try_start_11
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Untracking ad unit: "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v2, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v2}, Lcom/google/android/gms/internal/zzax;->zzbX()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zzaF(Ljava/lang/String;)V

    :cond_2d
    monitor-exit v1

    return-void

    :catch_2f
    move-exception v0

    const-string v2, "JSON failure while processing active view data."

    invoke-static {v2, v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zzb(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_11

    :catchall_36
    move-exception v0

    monitor-exit v1
    :try_end_38
    .catchall {:try_start_11 .. :try_end_38} :catchall_36

    throw v0

    :catch_39
    move-exception v0

    :try_start_3a
    const-string v2, "Failure while processing active view data."

    invoke-static {v2, v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zzb(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_3f
    .catchall {:try_start_3a .. :try_end_3f} :catchall_36

    goto :goto_11
.end method

.method protected zzcc()V
    .registers 2

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrl:Lcom/google/android/gms/internal/zzba;

    if-eqz v0, :cond_9

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrl:Lcom/google/android/gms/internal/zzba;

    invoke-interface {v0, p0}, Lcom/google/android/gms/internal/zzba;->zza(Lcom/google/android/gms/internal/zzaz;)V

    :cond_9
    return-void
.end method

.method public zzcd()Z
    .registers 3

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v1

    :try_start_3
    iget-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzro:Z

    monitor-exit v1

    return v0

    :catchall_7
    move-exception v0

    monitor-exit v1
    :try_end_9
    .catchall {:try_start_3 .. :try_end_9} :catchall_7

    throw v0
.end method

.method protected zzce()V
    .registers 4

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrd:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/View;

    if-nez v0, :cond_b

    :cond_a
    :goto_a
    return-void

    :cond_b
    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrc:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/view/ViewTreeObserver;

    invoke-virtual {v0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    if-eq v0, v1, :cond_a

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzcf()V

    iget-boolean v2, p0, Lcom/google/android/gms/internal/zzaz;->zzrm:Z

    if-eqz v2, :cond_28

    if-eqz v1, :cond_31

    invoke-virtual {v1}, Landroid/view/ViewTreeObserver;->isAlive()Z

    move-result v1

    if-eqz v1, :cond_31

    :cond_28
    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrm:Z

    invoke-virtual {v0, p0}, Landroid/view/ViewTreeObserver;->addOnScrollChangedListener(Landroid/view/ViewTreeObserver$OnScrollChangedListener;)V

    invoke-virtual {v0, p0}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    :cond_31
    new-instance v1, Ljava/lang/ref/WeakReference;

    invoke-direct {v1, v0}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrc:Ljava/lang/ref/WeakReference;

    goto :goto_a
.end method

.method protected zzcf()V
    .registers 3

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrc:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/ViewTreeObserver;

    if-eqz v0, :cond_10

    invoke-virtual {v0}, Landroid/view/ViewTreeObserver;->isAlive()Z

    move-result v1

    if-nez v1, :cond_11

    :cond_10
    :goto_10
    return-void

    :cond_11
    invoke-virtual {v0, p0}, Landroid/view/ViewTreeObserver;->removeOnScrollChangedListener(Landroid/view/ViewTreeObserver$OnScrollChangedListener;)V

    invoke-virtual {v0, p0}, Landroid/view/ViewTreeObserver;->removeGlobalOnLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    goto :goto_10
.end method

.method protected zzcg()Lorg/json/JSONObject;
    .registers 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    const-string v1, "afmaVersion"

    iget-object v2, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v2}, Lcom/google/android/gms/internal/zzax;->zzbV()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "activeViewJSON"

    iget-object v3, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v3}, Lcom/google/android/gms/internal/zzax;->zzbW()Lorg/json/JSONObject;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "timestamp"

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzp;->zzbz()Lcom/google/android/gms/internal/zzmn;

    move-result-object v3

    invoke-interface {v3}, Lcom/google/android/gms/internal/zzmn;->elapsedRealtime()J

    move-result-wide v4

    invoke-virtual {v1, v2, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;J)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "adFormat"

    iget-object v3, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v3}, Lcom/google/android/gms/internal/zzax;->zzbU()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "hashCode"

    iget-object v3, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v3}, Lcom/google/android/gms/internal/zzax;->zzbX()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "isMraid"

    iget-object v3, p0, Lcom/google/android/gms/internal/zzaz;->zzre:Lcom/google/android/gms/internal/zzax;

    invoke-virtual {v3}, Lcom/google/android/gms/internal/zzax;->zzbY()Z

    move-result v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    return-object v0
.end method

.method protected zzch()Lorg/json/JSONObject;
    .registers 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzcg()Lorg/json/JSONObject;

    move-result-object v0

    const-string v1, "doneReasonCode"

    const-string v2, "u"

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    return-object v0
.end method

.method protected zzd(Landroid/view/View;)Lorg/json/JSONObject;
    .registers 16
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    const/4 v3, 0x2

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzp;->zzbx()Lcom/google/android/gms/internal/zzie;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/google/android/gms/internal/zzie;->isAttachedToWindow(Landroid/view/View;)Z

    move-result v1

    new-array v2, v3, [I

    new-array v0, v3, [I

    :try_start_d
    invoke-virtual {p1, v2}, Landroid/view/View;->getLocationOnScreen([I)V

    invoke-virtual {p1, v0}, Landroid/view/View;->getLocationInWindow([I)V
    :try_end_13
    .catch Ljava/lang/Exception; {:try_start_d .. :try_end_13} :catch_1ec

    :goto_13
    invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    new-instance v3, Landroid/graphics/Rect;

    invoke-direct {v3}, Landroid/graphics/Rect;-><init>()V

    const/4 v4, 0x0

    aget v4, v2, v4

    iput v4, v3, Landroid/graphics/Rect;->left:I

    const/4 v4, 0x1

    aget v2, v2, v4

    iput v2, v3, Landroid/graphics/Rect;->top:I

    iget v2, v3, Landroid/graphics/Rect;->left:I

    invoke-virtual {p1}, Landroid/view/View;->getWidth()I

    move-result v4

    add-int/2addr v2, v4

    iput v2, v3, Landroid/graphics/Rect;->right:I

    iget v2, v3, Landroid/graphics/Rect;->top:I

    invoke-virtual {p1}, Landroid/view/View;->getHeight()I

    move-result v4

    add-int/2addr v2, v4

    iput v2, v3, Landroid/graphics/Rect;->bottom:I

    new-instance v2, Landroid/graphics/Rect;

    invoke-direct {v2}, Landroid/graphics/Rect;-><init>()V

    iget-object v4, p0, Lcom/google/android/gms/internal/zzaz;->zzri:Landroid/view/WindowManager;

    invoke-interface {v4}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v4

    invoke-virtual {v4}, Landroid/view/Display;->getWidth()I

    move-result v4

    iput v4, v2, Landroid/graphics/Rect;->right:I

    iget-object v4, p0, Lcom/google/android/gms/internal/zzaz;->zzri:Landroid/view/WindowManager;

    invoke-interface {v4}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v4

    invoke-virtual {v4}, Landroid/view/Display;->getHeight()I

    move-result v4

    iput v4, v2, Landroid/graphics/Rect;->bottom:I

    new-instance v4, Landroid/graphics/Rect;

    invoke-direct {v4}, Landroid/graphics/Rect;-><init>()V

    const/4 v5, 0x0

    invoke-virtual {p1, v4, v5}, Landroid/view/View;->getGlobalVisibleRect(Landroid/graphics/Rect;Landroid/graphics/Point;)Z

    move-result v5

    new-instance v6, Landroid/graphics/Rect;

    invoke-direct {v6}, Landroid/graphics/Rect;-><init>()V

    invoke-virtual {p1, v6}, Landroid/view/View;->getLocalVisibleRect(Landroid/graphics/Rect;)Z

    move-result v7

    new-instance v8, Landroid/graphics/Rect;

    invoke-direct {v8}, Landroid/graphics/Rect;-><init>()V

    invoke-virtual {p1, v8}, Landroid/view/View;->getHitRect(Landroid/graphics/Rect;)V

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzcg()Lorg/json/JSONObject;

    move-result-object v9

    const-string v10, "windowVisibility"

    invoke-virtual {p1}, Landroid/view/View;->getWindowVisibility()I

    move-result v11

    invoke-virtual {v9, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v10

    const-string v11, "isStopped"

    iget-boolean v12, p0, Lcom/google/android/gms/internal/zzaz;->zzrn:Z

    invoke-virtual {v10, v11, v12}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    move-result-object v10

    const-string v11, "isPaused"

    iget-boolean v12, p0, Lcom/google/android/gms/internal/zzaz;->zzpJ:Z

    invoke-virtual {v10, v11, v12}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    move-result-object v10

    const-string v11, "isScreenOn"

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->isScreenOn()Z

    move-result v12

    invoke-virtual {v10, v11, v12}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    move-result-object v10

    const-string v11, "isAttachedToWindow"

    invoke-virtual {v10, v11, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    move-result-object v1

    const-string v10, "viewBox"

    new-instance v11, Lorg/json/JSONObject;

    invoke-direct {v11}, Lorg/json/JSONObject;-><init>()V

    const-string v12, "top"

    iget v13, v2, Landroid/graphics/Rect;->top:I

    invoke-virtual {p0, v13, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v13

    invoke-virtual {v11, v12, v13}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v11

    const-string v12, "bottom"

    iget v13, v2, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {p0, v13, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v13

    invoke-virtual {v11, v12, v13}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v11

    const-string v12, "left"

    iget v13, v2, Landroid/graphics/Rect;->left:I

    invoke-virtual {p0, v13, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v13

    invoke-virtual {v11, v12, v13}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v11

    const-string v12, "right"

    iget v2, v2, Landroid/graphics/Rect;->right:I

    invoke-virtual {p0, v2, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v2

    invoke-virtual {v11, v12, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v2

    invoke-virtual {v1, v10, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "adBox"

    new-instance v10, Lorg/json/JSONObject;

    invoke-direct {v10}, Lorg/json/JSONObject;-><init>()V

    const-string v11, "top"

    iget v12, v3, Landroid/graphics/Rect;->top:I

    invoke-virtual {p0, v12, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v12

    invoke-virtual {v10, v11, v12}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v10

    const-string v11, "bottom"

    iget v12, v3, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {p0, v12, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v12

    invoke-virtual {v10, v11, v12}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v10

    const-string v11, "left"

    iget v12, v3, Landroid/graphics/Rect;->left:I

    invoke-virtual {p0, v12, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v12

    invoke-virtual {v10, v11, v12}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v10

    const-string v11, "right"

    iget v3, v3, Landroid/graphics/Rect;->right:I

    invoke-virtual {p0, v3, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v3

    invoke-virtual {v10, v11, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "globalVisibleBox"

    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3}, Lorg/json/JSONObject;-><init>()V

    const-string v10, "top"

    iget v11, v4, Landroid/graphics/Rect;->top:I

    invoke-virtual {p0, v11, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v11

    invoke-virtual {v3, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v10, "bottom"

    iget v11, v4, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {p0, v11, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v11

    invoke-virtual {v3, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v10, "left"

    iget v11, v4, Landroid/graphics/Rect;->left:I

    invoke-virtual {p0, v11, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v11

    invoke-virtual {v3, v10, v11}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v10, "right"

    iget v4, v4, Landroid/graphics/Rect;->right:I

    invoke-virtual {p0, v4, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v4

    invoke-virtual {v3, v10, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "globalVisibleBoxVisible"

    invoke-virtual {v1, v2, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "localVisibleBox"

    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3}, Lorg/json/JSONObject;-><init>()V

    const-string v4, "top"

    iget v5, v6, Landroid/graphics/Rect;->top:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v4, "bottom"

    iget v5, v6, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v4, "left"

    iget v5, v6, Landroid/graphics/Rect;->left:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v4, "right"

    iget v5, v6, Landroid/graphics/Rect;->right:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "localVisibleBoxVisible"

    invoke-virtual {v1, v2, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "hitBox"

    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3}, Lorg/json/JSONObject;-><init>()V

    const-string v4, "top"

    iget v5, v8, Landroid/graphics/Rect;->top:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v4, "bottom"

    iget v5, v8, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v4, "left"

    iget v5, v8, Landroid/graphics/Rect;->left:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    const-string v4, "right"

    iget v5, v8, Landroid/graphics/Rect;->right:I

    invoke-virtual {p0, v5, v0}, Lcom/google/android/gms/internal/zzaz;->zza(ILandroid/util/DisplayMetrics;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    const-string v2, "screenDensity"

    iget v0, v0, Landroid/util/DisplayMetrics;->density:F

    float-to-double v4, v0

    invoke-virtual {v1, v2, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;D)Lorg/json/JSONObject;

    move-result-object v0

    const-string v1, "isVisible"

    invoke-virtual {p0, p1}, Lcom/google/android/gms/internal/zzaz;->zze(Landroid/view/View;)Z

    move-result v2

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    return-object v9

    :catch_1ec
    move-exception v0

    const-string v3, "Failure getting view location."

    invoke-static {v3, v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zzb(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto/16 :goto_13
.end method

.method protected zze(Landroid/view/View;)Z
    .registers 3

    invoke-virtual {p1}, Landroid/view/View;->getVisibility()I

    move-result v0

    if-nez v0, :cond_26

    invoke-virtual {p1}, Landroid/view/View;->isShown()Z

    move-result v0

    if-eqz v0, :cond_26

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->isScreenOn()Z

    move-result v0

    if-eqz v0, :cond_26

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrk:Landroid/app/KeyguardManager;

    invoke-virtual {v0}, Landroid/app/KeyguardManager;->inKeyguardRestrictedInputMode()Z

    move-result v0

    if-eqz v0, :cond_24

    invoke-static {}, Lcom/google/android/gms/ads/internal/zzp;->zzbv()Lcom/google/android/gms/internal/zzid;

    move-result-object v0

    invoke-virtual {v0}, Lcom/google/android/gms/internal/zzid;->zzgB()Z

    move-result v0

    if-eqz v0, :cond_26

    :cond_24
    const/4 v0, 0x1

    :goto_25
    return v0

    :cond_26
    const/4 v0, 0x0

    goto :goto_25
.end method

.method protected zzg(Z)V
    .registers 4

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrr:Ljava/util/HashSet;

    invoke-virtual {v0}, Ljava/util/HashSet;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_6
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_16

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/internal/zzaw;

    invoke-interface {v0, p0, p1}, Lcom/google/android/gms/internal/zzaw;->zza(Lcom/google/android/gms/internal/zzaz;Z)V

    goto :goto_6

    :cond_16
    return-void
.end method

.method protected zzh(Z)V
    .registers 5

    iget-object v2, p0, Lcom/google/android/gms/internal/zzaz;->zzpd:Ljava/lang/Object;

    monitor-enter v2

    :try_start_3
    iget-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrh:Z

    if-eqz v0, :cond_b

    iget-boolean v0, p0, Lcom/google/android/gms/internal/zzaz;->zzro:Z

    if-nez v0, :cond_d

    :cond_b
    monitor-exit v2

    :goto_c
    return-void

    :cond_d
    if-eqz p1, :cond_1c

    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzqM:Lcom/google/android/gms/internal/zzik;

    invoke-virtual {v0}, Lcom/google/android/gms/internal/zzik;->tryAcquire()Z

    move-result v0

    if-nez v0, :cond_1c

    monitor-exit v2

    goto :goto_c

    :catchall_19
    move-exception v0

    monitor-exit v2
    :try_end_1b
    .catchall {:try_start_3 .. :try_end_1b} :catchall_19

    throw v0

    :cond_1c
    :try_start_1c
    iget-object v0, p0, Lcom/google/android/gms/internal/zzaz;->zzrb:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/internal/zzhs;

    iget-object v1, p0, Lcom/google/android/gms/internal/zzaz;->zzrd:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/view/View;

    if-eqz v1, :cond_30

    if-nez v0, :cond_38

    :cond_30
    const/4 v0, 0x1

    :goto_31
    if-eqz v0, :cond_3a

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzcb()V

    monitor-exit v2
    :try_end_37
    .catchall {:try_start_1c .. :try_end_37} :catchall_19

    goto :goto_c

    :cond_38
    const/4 v0, 0x0

    goto :goto_31

    :cond_3a
    :try_start_3a
    invoke-virtual {p0, v1}, Lcom/google/android/gms/internal/zzaz;->zzd(Landroid/view/View;)Lorg/json/JSONObject;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/google/android/gms/internal/zzaz;->zza(Lorg/json/JSONObject;)V
    :try_end_41
    .catch Lorg/json/JSONException; {:try_start_3a .. :try_end_41} :catch_50
    .catch Ljava/lang/RuntimeException; {:try_start_3a .. :try_end_41} :catch_49
    .catchall {:try_start_3a .. :try_end_41} :catchall_19

    :goto_41
    :try_start_41
    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzce()V

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzaz;->zzcc()V

    monitor-exit v2

    goto :goto_c

    :catch_49
    move-exception v0

    :goto_4a
    const-string v1, "Active view update failed."

    invoke-static {v1, v0}, Lcom/google/android/gms/ads/internal/util/client/zzb;->zza(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_4f
    .catchall {:try_start_41 .. :try_end_4f} :catchall_19

    goto :goto_41

    :catch_50
    move-exception v0

    goto :goto_4a
.end method


text:
lychee.define('app.Main').requires([
	'app.net.Client',
	'app.net.Server',
	'app.state.App'
]).includes([
	'lychee.app.Main'
]).exports((lychee, global, attachments) => {

	const _app  = lychee.import('app');
	const _Main = lychee.import('lychee.app.Main');

	/*
	 * IMPLEMENTATION
	 */

	const Composite = function(data) {

		let states = Object.assign({

			input: {
				delay:       0,
				key:         false,
				keymodifier: false,
				touch:       true,
				swipe:       true
			},

			jukebox: {
				music: true,
				sound: true
			},

			renderer: {
				id:         'over-there',
				width:      null,
				height:     null,
				background: '#000000'
			},

			viewport: {
				fullscreen: false
			}

		}, data);

		_Main.call(this, states);

		states = null;

		/*
		 * INITIALIZATION
		 */

		this.bind('load', function(oncomplete) {

			this.settings.appclient = this.settings.client;
			this.settings.client    = null;

			this.settings.appserver = this.settings.server;
			this.settings.server    = null;

			oncomplete(true);

		}, this, true);

		this.bind('init', function() {

			let appclient = this.settings.appclient || null;
			if (appclient !== null) {

				this.client = new _app.net.Client(appclient, this);
				this.client.bind('connect', function() {
					this.changeState('app');
				}, this);

			}

			let appserver = this.settings.appserver || null;
			if (appserver !== null) {
				this.server = new _app.net.Server(appserver, this);
			}

			this.setState('app', new _app.state.App(this));

		}, this, true);

	};

	Composite.prototype = {

		/*
		 * ENTITY API
		 */

		// deserialize: function(blob) {},

		serialize: function() {

			let data = _Main.prototype.serialize.call(this);
			data['constructor'] = 'app.Main';

			let states = data['arguments'][0] || {};
			let blob   = data['blob'] || {};

			if (this.settings.appclient !== null) states.client = this.settings.appclient;
			if (this.settings.appserver !== null) states.server = this.settings.appserver;

			data['arguments'][0] = states;
			data['blob']         = Object.keys(blob).length > 0 ? blob : null;

			return data;

		}

	};

	return Composite;

});