121 lines
2.7 KiB
Smali
121 lines
2.7 KiB
Smali
.class public Lcom/moji/open/BaseOpenPage;
|
|
.super Ljava/lang/Object;
|
|
.source "BaseOpenPage.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final a:Ljava/lang/String; = "BaseOpenPage"
|
|
|
|
|
|
# instance fields
|
|
.field protected b:Lorg/json/JSONObject;
|
|
|
|
.field protected c:Landroid/content/Context;
|
|
|
|
.field protected d:Lcom/moji/router/MJRouter;
|
|
|
|
.field protected e:Lcom/moji/router/Postcard;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 0
|
|
|
|
.line 23
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 24
|
|
iput-object p1, p0, Lcom/moji/open/BaseOpenPage;->c:Landroid/content/Context;
|
|
|
|
.line 25
|
|
invoke-static {}, Lcom/moji/router/MJRouter;->a()Lcom/moji/router/MJRouter;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/moji/open/BaseOpenPage;->d:Lcom/moji/router/MJRouter;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected a(Ljava/lang/String;)V
|
|
.locals 4
|
|
|
|
.line 29
|
|
iget-object v0, p0, Lcom/moji/open/BaseOpenPage;->c:Landroid/content/Context;
|
|
|
|
invoke-virtual {v0}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;
|
|
|
|
move-result-object v0
|
|
|
|
:try_start_0
|
|
const-string v1, "package.json"
|
|
|
|
.line 31
|
|
invoke-virtual {v0, v1}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;
|
|
|
|
move-result-object v0
|
|
|
|
.line 32
|
|
invoke-virtual {v0}, Ljava/io/InputStream;->available()I
|
|
|
|
move-result v1
|
|
|
|
new-array v1, v1, [B
|
|
|
|
.line 33
|
|
invoke-virtual {v0, v1}, Ljava/io/InputStream;->read([B)I
|
|
|
|
.line 34
|
|
new-instance v2, Ljava/lang/String;
|
|
|
|
const-string v3, "utf-8"
|
|
|
|
invoke-direct {v2, v1, v3}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
|
|
|
|
.line 35
|
|
invoke-virtual {v0}, Ljava/io/InputStream;->close()V
|
|
|
|
.line 36
|
|
new-instance v0, Lorg/json/JSONObject;
|
|
|
|
invoke-direct {v0, v2}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 37
|
|
invoke-virtual {v0, p1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 38
|
|
invoke-virtual {v0, p1}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/moji/open/BaseOpenPage;->b:Lorg/json/JSONObject;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 41
|
|
sget-object v0, Lcom/moji/open/BaseOpenPage;->a:Ljava/lang/String;
|
|
|
|
invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:cond_0
|
|
:goto_0
|
|
return-void
|
|
.end method
|