Skip to content

Instantly share code, notes, and snippets.

@strazzere
Created May 28, 2014 19:44
Show Gist options
  • Save strazzere/9453385896d96e84330a to your computer and use it in GitHub Desktop.
Save strazzere/9453385896d96e84330a to your computer and use it in GitHub Desktop.
EasterEggs in Hangouts
.class public Lcom/google/android/apps/babel/views/EasterEggView;
.super Landroid/widget/FrameLayout;
.source "SourceFile"
# static fields
.field private static final Hi:[Ljava/lang/String;
.field private static final Hn:Ljava/util/Random;
.field private static final Hq:[I
# instance fields
.field private Hj:Ljava/lang/Runnable;
.field private Hk:Ljava/lang/Runnable;
.field private Hl:I
.field private final Hm:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Lcom/google/android/apps/babel/views/cg;",
">;"
}
.end annotation
.end field
.field private final Ho:[Ljava/lang/String;
.field private final Hp:[Ljava/lang/String;
.field private mHandler:Landroid/os/Handler;
# direct methods
.method static constructor <clinit>()V
.registers 4
.prologue
const/4 v3, 0x3
.line 50
new-array v0, v3, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "ponies"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "ponystream"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "pitchforks"
aput-object v2, v0, v1
sput-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hi:[Ljava/lang/String;
.line 201
new-instance v0, Ljava/util/Random;
invoke-direct {v0}, Ljava/util/Random;-><init>()V
sput-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hn:Ljava/util/Random;
.line 207
new-array v0, v3, [I
fill-array-data v0, :array_24
sput-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hq:[I
return-void
nop
:array_24
.array-data 4
0x7f05000e
0x7f050010
0x7f05000f
.end array-data
.end method
.method public constructor <init>(Landroid/content/Context;)V
.registers 3
.prologue
.line 214
const/4 v0, 0x0
invoke-direct {p0, p1, v0}, Lcom/google/android/apps/babel/views/EasterEggView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 215
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 5
.prologue
.line 218
invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 62
new-instance v0, Landroid/os/Handler;
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
iput-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->mHandler:Landroid/os/Handler;
.line 198
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hm:Ljava/util/List;
.line 220
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
.line 221
const v1, 0x7f10000f
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;
move-result-object v1
iput-object v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Ho:[Ljava/lang/String;
.line 222
const v1, 0x7f100010
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hp:[Ljava/lang/String;
.line 223
return-void
.end method
.method static synthetic a(Lcom/google/android/apps/babel/views/EasterEggView;)Ljava/util/List;
.registers 2
.prologue
.line 43
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hm:Ljava/util/List;
return-object v0
.end method
.method private a(Lcom/google/android/apps/babel/content/az;[Ljava/lang/String;I)V
.registers 9
.prologue
const/4 v4, 0x0
.line 231
if-nez p2, :cond_4
.line 245
:goto_3
return-void
.line 236
:cond_4
sget-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hn:Ljava/util/Random;
array-length v1, p2
invoke-virtual {v0, v1}, Ljava/util/Random;->nextInt(I)I
move-result v0
.line 238
new-instance v1, Lcom/google/android/apps/babel/util/l;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "//ssl.gstatic.com/chat/babble/ee/"
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
aget-object v0, p2, v0
invoke-virtual {v2, v0}, 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-direct {v1, v0, p1}, Lcom/google/android/apps/babel/util/l;-><init>(Ljava/lang/String;Lcom/google/android/apps/babel/content/az;)V
.line 240
invoke-virtual {v1, v4}, Lcom/google/android/apps/babel/util/l;->H(Z)Lcom/google/android/apps/babel/util/l;
.line 241
invoke-virtual {v1, v4}, Lcom/google/android/apps/babel/util/l;->I(Z)Lcom/google/android/apps/babel/util/l;
.line 242
invoke-virtual {v1, v4}, Lcom/google/android/apps/babel/util/l;->J(Z)Lcom/google/android/apps/babel/util/l;
.line 244
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hm:Ljava/util/List;
new-instance v2, Lcom/google/android/apps/babel/views/cg;
invoke-direct {v2, p0, v1, p3}, Lcom/google/android/apps/babel/views/cg;-><init>(Lcom/google/android/apps/babel/views/EasterEggView;Lcom/google/android/apps/babel/util/l;I)V
invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_3
.end method
.method static synthetic a(Lcom/google/android/apps/babel/views/EasterEggView;Lcom/google/android/apps/babel/content/az;[Ljava/lang/String;I)V
.registers 4
.prologue
.line 43
invoke-direct {p0, p1, p2, p3}, Lcom/google/android/apps/babel/views/EasterEggView;->a(Lcom/google/android/apps/babel/content/az;[Ljava/lang/String;I)V
return-void
.end method
.method public static af(Ljava/lang/String;)Ljava/lang/String;
.registers 8
.prologue
const/4 v1, 0x0
const/4 v0, 0x0
.line 73
if-eqz p0, :cond_12
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v2
if-eqz v2, :cond_12
invoke-virtual {p0, v0}, Ljava/lang/String;->charAt(I)C
move-result v2
const/16 v3, 0x2f
if-eq v2, v3, :cond_14
:cond_12
move-object v0, v1
.line 83
:cond_13
:goto_13
return-object v0
.line 77
:cond_14
sget-object v3, Lcom/google/android/apps/babel/views/EasterEggView;->Hi:[Ljava/lang/String;
array-length v4, v3
move v2, v0
:goto_18
if-ge v2, v4, :cond_39
aget-object v0, v3, v2
.line 78
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "/"
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {p0, v5}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v5
if-nez v5, :cond_13
.line 77
add-int/lit8 v0, v2, 0x1
move v2, v0
goto :goto_18
:cond_39
move-object v0, v1
.line 83
goto :goto_13
.end method
.method public static ag(Ljava/lang/String;)Z
.registers 2
.prologue
.line 93
const-string v0, "ponystream"
invoke-static {p0, v0}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_a
.line 94
const/4 v0, 0x0
.line 97
:goto_9
return v0
:cond_a
const/4 v0, 0x1
goto :goto_9
.end method
.method static synthetic b(Lcom/google/android/apps/babel/views/EasterEggView;)[Ljava/lang/String;
.registers 2
.prologue
.line 43
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Ho:[Ljava/lang/String;
return-object v0
.end method
.method static synthetic c(Lcom/google/android/apps/babel/views/EasterEggView;)Landroid/os/Handler;
.registers 2
.prologue
.line 43
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->mHandler:Landroid/os/Handler;
return-object v0
.end method
.method static synthetic d(Lcom/google/android/apps/babel/views/EasterEggView;)[Ljava/lang/String;
.registers 2
.prologue
.line 43
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hp:[Ljava/lang/String;
return-object v0
.end method
.method static synthetic e(Lcom/google/android/apps/babel/views/EasterEggView;)I
.registers 2
.prologue
.line 43
iget v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hl:I
return v0
.end method
.method static synthetic f(Lcom/google/android/apps/babel/views/EasterEggView;)I
.registers 3
.prologue
.line 43
iget v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hl:I
add-int/lit8 v1, v0, -0x1
iput v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hl:I
return v0
.end method
.method static synthetic g(Lcom/google/android/apps/babel/views/EasterEggView;)Ljava/lang/Runnable;
.registers 2
.prologue
.line 43
const/4 v0, 0x0
iput-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hk:Ljava/lang/Runnable;
return-object v0
.end method
.method static synthetic gR()Ljava/util/Random;
.registers 1
.prologue
.line 43
sget-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hn:Ljava/util/Random;
return-object v0
.end method
.method static synthetic gS()[I
.registers 1
.prologue
.line 43
sget-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hq:[I
return-object v0
.end method
# virtual methods
.method public final b(Lcom/google/android/apps/babel/content/az;Ljava/lang/String;)V
.registers 6
.prologue
.line 249
invoke-virtual {p0}, Lcom/google/android/apps/babel/views/EasterEggView;->getContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "babel_easter_eggs"
const/4 v2, 0x1
invoke-static {v0, v1, v2}, Lcom/google/android/gsf/d;->a(Landroid/content/ContentResolver;Ljava/lang/String;Z)Z
move-result v0
if-nez v0, :cond_12
.line 304
:cond_11
:goto_11
return-void
.line 256
:cond_12
const-string v0, "ponies"
invoke-static {v0, p2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_2f
.line 257
sget-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hn:Ljava/util/Random;
invoke-virtual {v0}, Ljava/util/Random;->nextBoolean()Z
move-result v0
if-eqz v0, :cond_2b
const v0, 0x7f05000d
.line 259
:goto_25
iget-object v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Ho:[Ljava/lang/String;
invoke-direct {p0, p1, v1, v0}, Lcom/google/android/apps/babel/views/EasterEggView;->a(Lcom/google/android/apps/babel/content/az;[Ljava/lang/String;I)V
goto :goto_11
.line 257
:cond_2b
const v0, 0x7f05000c
goto :goto_25
.line 260
:cond_2f
const-string v0, "ponystream"
invoke-static {v0, p2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_55
.line 261
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
if-eqz v0, :cond_46
.line 262
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
.line 263
const/4 v0, 0x0
iput-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
goto :goto_11
.line 265
:cond_46
new-instance v0, Lcom/google/android/apps/babel/views/bi;
invoke-direct {v0, p0, p1}, Lcom/google/android/apps/babel/views/bi;-><init>(Lcom/google/android/apps/babel/views/EasterEggView;Lcom/google/android/apps/babel/content/az;)V
iput-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
.line 277
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
goto :goto_11
.line 279
:cond_55
const-string v0, "pitchforks"
invoke-static {v0, p2}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_11
.line 280
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hk:Ljava/lang/Runnable;
if-nez v0, :cond_11
.line 281
sget-object v0, Lcom/google/android/apps/babel/views/EasterEggView;->Hn:Ljava/util/Random;
const/16 v1, 0x14
invoke-virtual {v0, v1}, Ljava/util/Random;->nextInt(I)I
move-result v0
add-int/lit8 v0, v0, 0x14
iput v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hl:I
.line 284
new-instance v0, Lcom/google/android/apps/babel/views/bj;
invoke-direct {v0, p0, p1}, Lcom/google/android/apps/babel/views/bj;-><init>(Lcom/google/android/apps/babel/views/EasterEggView;Lcom/google/android/apps/babel/content/az;)V
iput-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hk:Ljava/lang/Runnable;
.line 301
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hk:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
goto :goto_11
.end method
.method public final clear()V
.registers 4
.prologue
const/4 v2, 0x0
.line 307
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hm:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v1
.line 308
:goto_7
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_1a
.line 309
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/android/apps/babel/views/cg;
.line 310
invoke-virtual {v0}, Lcom/google/android/apps/babel/views/cg;->clear()V
.line 311
invoke-interface {v1}, Ljava/util/Iterator;->remove()V
goto :goto_7
.line 314
:cond_1a
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hm:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
if-nez v0, :cond_41
const/4 v0, 0x1
:goto_23
invoke-static {v0}, Lcom/google/android/videochat/util/n;->bT(Z)V
.line 316
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
if-eqz v0, :cond_33
.line 317
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
.line 318
iput-object v2, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hj:Ljava/lang/Runnable;
.line 321
:cond_33
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hk:Ljava/lang/Runnable;
if-eqz v0, :cond_40
.line 322
iget-object v0, p0, Lcom/google/android/apps/babel/views/EasterEggView;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hk:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
.line 323
iput-object v2, p0, Lcom/google/android/apps/babel/views/EasterEggView;->Hk:Ljava/lang/Runnable;
.line 325
:cond_40
return-void
.line 314
:cond_41
const/4 v0, 0x0
goto :goto_23
.end method
.method public onFinishInflate()V
.registers 1
.prologue
.line 227
invoke-super {p0}, Landroid/widget/FrameLayout;->onFinishInflate()V
.line 228
return-void
.end method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment