PluginLayoutInflater.smali
.class public Lcom/cleanmaster/hpcommonlib/PluginLayoutInflater;
.super Ljava/lang/Object;
.source "PluginLayoutInflater.java"
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 13
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static checkBaseFactory1(Landroid/view/LayoutInflater$Factory;)Z
.registers 3
.prologue
const/4 v0, 0x1
.line 37
if-nez p0, :cond_4
.line 43
:cond_3
:goto_3
return v0
.line 40
:cond_4
instance-of v1, p0, Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;
if-eqz v1, :cond_3
.line 41
const/4 v0, 0x0
goto :goto_3
.end method
.method private static checkBaseFactory2(Landroid/view/LayoutInflater$Factory2;)Z
.registers 2
.prologue
.line 47
if-eqz p0, :cond_6
instance-of v0, p0, Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;
if-eqz v0, :cond_8
.line 48
:cond_6
const/4 v0, 0x0
.line 50
:goto_7
return v0
:cond_8
const/4 v0, 0x1
goto :goto_7
.end method
.method public static from(Landroid/content/Context;Ljava/lang/ClassLoader;)Landroid/view/LayoutInflater;
.registers 6
.prologue
.line 15
const-string v0, "layout_inflater"
.line 16
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/view/LayoutInflater;
.line 17
if-nez v0, :cond_12
.line 18
new-instance v0, Ljava/lang/AssertionError;
const-string v1, "LayoutInflater not found."
invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
throw v0
.line 21
:cond_12
invoke-virtual {v0}, Landroid/view/LayoutInflater;->getFactory2()Landroid/view/LayoutInflater$Factory2;
move-result-object v1
.line 22
invoke-virtual {v0}, Landroid/view/LayoutInflater;->getFactory()Landroid/view/LayoutInflater$Factory;
move-result-object v2
.line 25
invoke-static {v1}, Lcom/cleanmaster/hpcommonlib/PluginLayoutInflater;->checkBaseFactory2(Landroid/view/LayoutInflater$Factory2;)Z
move-result v3
if-eqz v3, :cond_29
.line 26
new-instance v2, Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;
invoke-direct {v2, v1, p1}, Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;-><init>(Landroid/view/LayoutInflater$Factory2;Ljava/lang/ClassLoader;)V
.line 27
invoke-static {v0, v2}, Lcom/cleanmaster/hpcommonlib/PluginLayoutInflater;->setFactory2(Landroid/view/LayoutInflater;Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;)V
.line 33
:cond_28
:goto_28
return-object v0
.line 28
:cond_29
invoke-static {v2}, Lcom/cleanmaster/hpcommonlib/PluginLayoutInflater;->checkBaseFactory1(Landroid/view/LayoutInflater$Factory;)Z
move-result v1
if-eqz v1, :cond_28
.line 29
new-instance v1, Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;
invoke-direct {v1, v2, p1}, Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;-><init>(Landroid/view/LayoutInflater$Factory;Ljava/lang/ClassLoader;)V
.line 30
invoke-static {v0, v1}, Lcom/cleanmaster/hpcommonlib/PluginLayoutInflater;->setFactory(Landroid/view/LayoutInflater;Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;)V
goto :goto_28
.end method
.method private static setFactory(Landroid/view/LayoutInflater;Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;)V
.registers 4
.prologue
.line 55
:try_start_0
const-class v0, Landroid/view/LayoutInflater;
const-string v1, "mFactory"
invoke-virtual {v0, v1}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v0
.line 56
const/4 v1, 0x1
invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->setAccessible(Z)V
.line 57
invoke-virtual {v0, p0, p1}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
:try_end_f
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_f} :catch_10
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_f} :catch_15
.line 63
:goto_f
return-void
.line 58
:catch_10
move-exception v0
.line 59
invoke-virtual {v0}, Ljava/lang/NoSuchFieldException;->printStackTrace()V
goto :goto_f
.line 60
:catch_15
move-exception v0
.line 61
invoke-virtual {v0}, Ljava/lang/IllegalAccessException;->printStackTrace()V
goto :goto_f
.end method
.method private static setFactory2(Landroid/view/LayoutInflater;Lcom/cleanmaster/hpcommonlib/PluginInflaterFactory;)V
.registers 4
.prologue
.line 67
:try_start_0
const-class v0, Landroid/view/LayoutInflater;
const-string v1, "mFactory2"
invoke-virtual {v0, v1}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v0
.line 68
const/4 v1, 0x1
invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->setAccessible(Z)V
.line 69
invoke-virtual {v0, p0, p1}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
:try_end_f
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_f} :catch_10
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_f} :catch_15
.line 75
:goto_f
return-void
.line 70
:catch_10
move-exception v0
.line 71
invoke-virtual {v0}, Ljava/lang/NoSuchFieldException;->printStackTrace()V
goto :goto_f
.line 72
:catch_15
move-exception v0
.line 73
invoke-virtual {v0}, Ljava/lang/IllegalAccessException;->printStackTrace()V
goto :goto_f
.end method