1355 lines
31 KiB
Smali
1355 lines
31 KiB
Smali
.class public Lcom/moji/api/APIManager;
|
|
.super Ljava/lang/Object;
|
|
.source "APIManager.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/moji/api/APIManager$RemoteServiceConn;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static a:Z
|
|
|
|
.field private static b:Landroid/content/Context;
|
|
|
|
.field private static c:Ljava/lang/String;
|
|
|
|
.field private static final d:Ljava/util/concurrent/ConcurrentHashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/ConcurrentHashMap<",
|
|
"Ljava/lang/String;",
|
|
"Lcom/moji/api/service/IAPInterface;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private static final e:Ljava/util/concurrent/ConcurrentHashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/ConcurrentHashMap<",
|
|
"Ljava/lang/String;",
|
|
"Landroid/content/ServiceConnection;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private static f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
.field private static g:Ljava/util/ArrayDeque;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayDeque<",
|
|
"Lcom/moji/api/actions/Action;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private static h:Z
|
|
|
|
.field private static final i:Ljava/lang/Object;
|
|
|
|
.field private static final j:Ljava/util/concurrent/ConcurrentHashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/ConcurrentHashMap<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private static k:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/moji/api/APINotFoundListener;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private static l:Landroid/content/ServiceConnection;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
.line 39
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/api/APIManager;->d:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 40
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/api/APIManager;->e:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 42
|
|
new-instance v0, Ljava/util/ArrayDeque;
|
|
|
|
const/4 v1, 0x5
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/ArrayDeque;-><init>(I)V
|
|
|
|
sput-object v0, Lcom/moji/api/APIManager;->g:Ljava/util/ArrayDeque;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 43
|
|
sput-boolean v0, Lcom/moji/api/APIManager;->h:Z
|
|
|
|
.line 44
|
|
new-instance v0, Ljava/lang/Object;
|
|
|
|
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
.line 45
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/api/APIManager;->j:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 46
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/api/APIManager;->k:Ljava/util/List;
|
|
|
|
.line 520
|
|
new-instance v0, Lcom/moji/api/APIManager$5;
|
|
|
|
invoke-direct {v0}, Lcom/moji/api/APIManager$5;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/api/APIManager;->l:Landroid/content/ServiceConnection;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 34
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/api/service/IAPIManagerInterface;)Lcom/moji/api/service/IAPIManagerInterface;
|
|
.locals 0
|
|
|
|
.line 34
|
|
sput-object p0, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic a()Ljava/lang/Object;
|
|
.locals 1
|
|
|
|
.line 34
|
|
sget-object v0, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static declared-synchronized a(Landroid/content/Context;Ljava/lang/Class;Z)V
|
|
.locals 2
|
|
|
|
const-class v0, Lcom/moji/api/APIManager;
|
|
|
|
monitor-enter v0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 61
|
|
:try_start_0
|
|
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 62
|
|
sput-object p0, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
goto :goto_0
|
|
|
|
.line 64
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
|
|
|
|
move-result-object p0
|
|
|
|
sput-object p0, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
.line 66
|
|
:goto_0
|
|
sput-boolean p2, Lcom/moji/api/APIManager;->a:Z
|
|
|
|
.line 67
|
|
invoke-static {}, Lcom/moji/api/APIManager;->f()V
|
|
|
|
.line 68
|
|
invoke-virtual {p1}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
sput-object p0, Lcom/moji/api/APIManager;->c:Ljava/lang/String;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 69
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
.line 59
|
|
:cond_1
|
|
:try_start_1
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "serviceClazz can not be null"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 56
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "context can not be null"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 54
|
|
monitor-exit v0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static declared-synchronized a(Ljava/lang/Class;Lcom/moji/api/APIListener;)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;",
|
|
"Lcom/moji/api/APIListener<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const-class v0, Lcom/moji/api/APIManager;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 182
|
|
:try_start_0
|
|
invoke-static {}, Lcom/moji/api/APIManager;->g()V
|
|
|
|
.line 183
|
|
invoke-static {}, Lcom/moji/api/APIManager;->f()V
|
|
|
|
.line 184
|
|
invoke-static {p0}, Lcom/moji/api/util/BundleHolder;->a(Ljava/lang/Class;)Lcom/moji/api/entity/APIBundle;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 186
|
|
invoke-static {}, Landroid/os/Process;->myPid()I
|
|
|
|
move-result v2
|
|
|
|
iget v3, v1, Lcom/moji/api/entity/APIBundle;->b:I
|
|
|
|
if-ne v2, v3, :cond_1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
.line 188
|
|
iget-object p0, v1, Lcom/moji/api/entity/APIBundle;->a:Ljava/lang/Object;
|
|
|
|
invoke-interface {p1, p0}, Lcom/moji/api/APIListener;->a(Ljava/lang/Object;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 190
|
|
:cond_0
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const/4 v1, 0x0
|
|
|
|
.line 193
|
|
:try_start_1
|
|
invoke-static {p0, p1, v1}, Lcom/moji/api/APIManager;->b(Ljava/lang/Class;Lcom/moji/api/APIListener;Z)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
.line 194
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 181
|
|
monitor-exit v0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method static synthetic a(Ljava/lang/Class;Lcom/moji/api/APIListener;Z)V
|
|
.locals 0
|
|
|
|
.line 34
|
|
invoke-static {p0, p1, p2}, Lcom/moji/api/APIManager;->b(Ljava/lang/Class;Lcom/moji/api/APIListener;Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static declared-synchronized a(Ljava/lang/Class;Ljava/lang/Object;)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/Class<",
|
|
"+",
|
|
"Lcom/moji/api/IAPI;",
|
|
">;",
|
|
"Ljava/lang/Object;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
const-class v0, Lcom/moji/api/APIManager;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 79
|
|
:try_start_0
|
|
invoke-static {}, Lcom/moji/api/APIManager;->g()V
|
|
|
|
.line 80
|
|
invoke-static {}, Lcom/moji/api/APIManager;->f()V
|
|
|
|
.line 81
|
|
sget-object v1, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
monitor-enter v1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
.line 82
|
|
:try_start_1
|
|
sget-object v2, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
.line 83
|
|
sget-object v2, Lcom/moji/api/APIManager;->g:Ljava/util/ArrayDeque;
|
|
|
|
new-instance v3, Lcom/moji/api/actions/RegisterAction;
|
|
|
|
invoke-direct {v3, p0, p1}, Lcom/moji/api/actions/RegisterAction;-><init>(Ljava/lang/Class;Ljava/lang/Object;)V
|
|
|
|
invoke-virtual {v2, v3}, Ljava/util/ArrayDeque;->offer(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
.line 85
|
|
:cond_0
|
|
invoke-static {p0, p1}, Lcom/moji/api/APIManager;->b(Ljava/lang/Class;Ljava/lang/Object;)Z
|
|
|
|
.line 87
|
|
:goto_0
|
|
monitor-exit v1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
.line 88
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 87
|
|
:try_start_2
|
|
monitor-exit v1
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
:try_start_3
|
|
throw p0
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception p0
|
|
|
|
.line 78
|
|
monitor-exit v0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static declared-synchronized a(Ljava/lang/Class;)Z
|
|
.locals 5
|
|
|
|
const-class v0, Lcom/moji/api/APIManager;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 97
|
|
:try_start_0
|
|
invoke-static {p0}, Lcom/moji/api/util/BundleHolder;->b(Ljava/lang/Class;)Z
|
|
|
|
move-result v1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 98
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
.line 100
|
|
:cond_0
|
|
:try_start_1
|
|
invoke-static {}, Lcom/moji/api/APIManager;->g()V
|
|
|
|
.line 101
|
|
invoke-static {}, Lcom/moji/api/APIManager;->f()V
|
|
|
|
.line 102
|
|
sget-object v1, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
monitor-enter v1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
|
|
|
.line 103
|
|
:try_start_2
|
|
sget-object v3, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
.line 105
|
|
:try_start_3
|
|
sget-object v3, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v3, v4}, Lcom/moji/api/service/IAPIManagerInterface;->b(Ljava/lang/String;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
.line 107
|
|
invoke-static {p0}, Lcom/moji/api/util/BundleHolder;->c(Ljava/lang/Class;)Lcom/moji/api/entity/APIBundle;
|
|
:try_end_3
|
|
.catch Landroid/os/RemoteException; {:try_start_3 .. :try_end_3} :catch_0
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
.line 109
|
|
:cond_1
|
|
:try_start_4
|
|
monitor-exit v1
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_0
|
|
|
|
monitor-exit v0
|
|
|
|
return v3
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
:try_start_5
|
|
const-string v3, "APIManager"
|
|
|
|
const-string v4, "RemoteException"
|
|
|
|
.line 111
|
|
invoke-static {v3, v4, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
.line 116
|
|
monitor-exit v1
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0
|
|
|
|
.line 117
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
.line 114
|
|
:cond_2
|
|
:try_start_6
|
|
monitor-exit v1
|
|
:try_end_6
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_0
|
|
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 116
|
|
:try_start_7
|
|
monitor-exit v1
|
|
:try_end_7
|
|
.catchall {:try_start_7 .. :try_end_7} :catchall_0
|
|
|
|
:try_start_8
|
|
throw p0
|
|
:try_end_8
|
|
.catchall {:try_start_8 .. :try_end_8} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception p0
|
|
|
|
.line 96
|
|
monitor-exit v0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static a(Ljava/lang/Class;Ljava/lang/String;)Z
|
|
.locals 2
|
|
|
|
.line 462
|
|
sget-object v0, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 463
|
|
:try_start_0
|
|
sget-object v1, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 465
|
|
:try_start_1
|
|
sget-object v1, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {v1, p0, p1}, Lcom/moji/api/service/IAPIManagerInterface;->a(Ljava/lang/String;Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
:try_end_1
|
|
.catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
:try_start_2
|
|
const-string p1, "APIManager"
|
|
|
|
const-string v1, "RemoteException"
|
|
|
|
.line 467
|
|
invoke-static {p1, v1, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
.line 470
|
|
:goto_0
|
|
monitor-exit v0
|
|
|
|
return p0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
monitor-exit v0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static a(Ljava/lang/String;Lcom/moji/api/APIManager$RemoteServiceConn;)Z
|
|
.locals 5
|
|
|
|
.line 475
|
|
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 480
|
|
:cond_0
|
|
:try_start_0
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
|
|
|
|
.line 481
|
|
new-instance v2, Landroid/content/ComponentName;
|
|
|
|
sget-object v3, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-direct {v2, v3, p0}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
|
|
|
|
.line 482
|
|
sget-object v2, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-virtual {v2, v0, p1, v3}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
|
|
|
|
move-result v0
|
|
:try_end_0
|
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v0
|
|
|
|
const-string v2, "APIManager"
|
|
|
|
.line 484
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v4, "connectRemoteService:"
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, " failed"
|
|
|
|
invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v2, p0, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-nez v0, :cond_2
|
|
|
|
.line 487
|
|
invoke-static {p1}, Lcom/moji/api/APIManager$RemoteServiceConn;->a(Lcom/moji/api/APIManager$RemoteServiceConn;)Ljava/lang/ref/SoftReference;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Lcom/moji/api/APIListener;
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
const/4 v1, 0x4
|
|
|
|
.line 489
|
|
invoke-interface {p0, v1}, Lcom/moji/api/APIListener;->a(I)V
|
|
|
|
.line 491
|
|
:cond_1
|
|
sget-object p0, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
invoke-virtual {p0, p1}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V
|
|
|
|
:cond_2
|
|
return v0
|
|
.end method
|
|
|
|
.method static synthetic a(Z)Z
|
|
.locals 0
|
|
|
|
.line 34
|
|
sput-boolean p0, Lcom/moji/api/APIManager;->h:Z
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method static synthetic b()Lcom/moji/api/service/IAPIManagerInterface;
|
|
.locals 1
|
|
|
|
.line 34
|
|
sget-object v0, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static b(Ljava/lang/Class;Lcom/moji/api/APIListener;)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;",
|
|
"Lcom/moji/api/APIListener<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 400
|
|
new-instance v0, Ljava/lang/Thread;
|
|
|
|
new-instance v1, Lcom/moji/api/APIManager$4;
|
|
|
|
invoke-direct {v1, p0, p1}, Lcom/moji/api/APIManager$4;-><init>(Ljava/lang/Class;Lcom/moji/api/APIListener;)V
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V
|
|
|
|
.line 420
|
|
invoke-virtual {v0}, Ljava/lang/Thread;->start()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static b(Ljava/lang/Class;Lcom/moji/api/APIListener;Z)V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">(",
|
|
"Ljava/lang/Class<",
|
|
"TT;>;",
|
|
"Lcom/moji/api/APIListener<",
|
|
"TT;>;Z)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 368
|
|
invoke-static {p0}, Lcom/moji/api/APIManager;->d(Ljava/lang/Class;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 369
|
|
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
.line 370
|
|
sget-object p2, Lcom/moji/api/APIManager;->d:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-virtual {p2, v0}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/moji/api/service/IAPInterface;
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
.line 373
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;
|
|
|
|
move-result-object v0
|
|
|
|
new-array v1, v3, [Ljava/lang/Class;
|
|
|
|
aput-object p0, v1, v2
|
|
|
|
new-instance v2, Lcom/moji/api/handler/APInvokeHandler;
|
|
|
|
invoke-direct {v2, p0, p2}, Lcom/moji/api/handler/APInvokeHandler;-><init>(Ljava/lang/Class;Lcom/moji/api/service/IAPInterface;)V
|
|
|
|
invoke-static {v0, v1, v2}, Ljava/lang/reflect/Proxy;->newProxyInstance(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {p1, p0}, Lcom/moji/api/APIListener;->a(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 376
|
|
:cond_0
|
|
new-instance p2, Lcom/moji/api/APIManager$RemoteServiceConn;
|
|
|
|
invoke-direct {p2, v0, p0, p1}, Lcom/moji/api/APIManager$RemoteServiceConn;-><init>(Ljava/lang/String;Ljava/lang/Class;Lcom/moji/api/APIListener;)V
|
|
|
|
invoke-static {v0, p2}, Lcom/moji/api/APIManager;->a(Ljava/lang/String;Lcom/moji/api/APIManager$RemoteServiceConn;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
if-nez p2, :cond_2
|
|
|
|
.line 380
|
|
invoke-static {p0, p1}, Lcom/moji/api/APIManager;->b(Ljava/lang/Class;Lcom/moji/api/APIListener;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 383
|
|
:cond_2
|
|
sget-object p0, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
monitor-enter p0
|
|
|
|
.line 384
|
|
:try_start_0
|
|
sget-object p2, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
const/4 v2, 0x1
|
|
|
|
.line 385
|
|
:cond_3
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-nez v2, :cond_4
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
const/4 p0, 0x2
|
|
|
|
.line 388
|
|
invoke-interface {p1, p0}, Lcom/moji/api/APIListener;->a(I)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
if-eqz p1, :cond_5
|
|
|
|
const/4 p0, 0x3
|
|
|
|
.line 392
|
|
invoke-interface {p1, p0}, Lcom/moji/api/APIListener;->a(I)V
|
|
|
|
:cond_5
|
|
:goto_0
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
.line 385
|
|
:try_start_1
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method static synthetic b(Ljava/lang/Class;)Z
|
|
.locals 0
|
|
|
|
.line 34
|
|
invoke-static {p0}, Lcom/moji/api/APIManager;->c(Ljava/lang/Class;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static b(Ljava/lang/Class;Ljava/lang/Object;)Z
|
|
.locals 2
|
|
|
|
.line 511
|
|
invoke-static {}, Lcom/moji/api/APIManager;->g()V
|
|
|
|
.line 512
|
|
invoke-static {}, Lcom/moji/api/APIManager;->f()V
|
|
|
|
.line 513
|
|
sget-boolean v0, Lcom/moji/api/APIManager;->a:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 514
|
|
invoke-static {p0, p1}, Lcom/moji/api/util/TypeUtil;->a(Ljava/lang/Class;Ljava/lang/Object;)V
|
|
|
|
.line 516
|
|
:cond_0
|
|
new-instance v0, Lcom/moji/api/entity/APIBundle;
|
|
|
|
invoke-static {}, Landroid/os/Process;->myPid()I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {v0, p1, v1}, Lcom/moji/api/entity/APIBundle;-><init>(Ljava/lang/Object;I)V
|
|
|
|
invoke-static {p0, v0}, Lcom/moji/api/util/BundleHolder;->a(Ljava/lang/Class;Lcom/moji/api/entity/APIBundle;)Lcom/moji/api/entity/APIBundle;
|
|
|
|
.line 517
|
|
sget-object p1, Lcom/moji/api/APIManager;->c:Ljava/lang/String;
|
|
|
|
invoke-static {p0, p1}, Lcom/moji/api/APIManager;->a(Ljava/lang/Class;Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method static synthetic c()V
|
|
.locals 0
|
|
|
|
.line 34
|
|
invoke-static {}, Lcom/moji/api/APIManager;->h()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static declared-synchronized c(Ljava/lang/Class;)Z
|
|
.locals 5
|
|
|
|
const-class v0, Lcom/moji/api/APIManager;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 306
|
|
:try_start_0
|
|
sget-object v1, Lcom/moji/api/APIManager;->j:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
sget-object v1, Lcom/moji/api/APIManager;->j:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-virtual {v1}, Ljava/util/concurrent/ConcurrentHashMap;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
goto :goto_2
|
|
|
|
.line 309
|
|
:cond_0
|
|
sget-object v1, Lcom/moji/api/APIManager;->k:Ljava/util/List;
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
sget-object v1, Lcom/moji/api/APIManager;->k:Ljava/util/List;
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 314
|
|
:cond_1
|
|
sget-object v1, Lcom/moji/api/APIManager;->j:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v1, v3}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
.line 315
|
|
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_3
|
|
|
|
.line 316
|
|
sget-object v3, Lcom/moji/api/APIManager;->k:Ljava/util/List;
|
|
|
|
invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:cond_2
|
|
:goto_0
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_3
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/moji/api/APINotFoundListener;
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
.line 318
|
|
invoke-interface {v4, p0, v1}, Lcom/moji/api/APINotFoundListener;->a(Ljava/lang/Class;Ljava/lang/String;)Z
|
|
|
|
move-result v4
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
or-int/2addr v2, v4
|
|
|
|
goto :goto_0
|
|
|
|
.line 322
|
|
:cond_3
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
.line 310
|
|
:cond_4
|
|
:goto_1
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
.line 307
|
|
:cond_5
|
|
:goto_2
|
|
monitor-exit v0
|
|
|
|
return v2
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 305
|
|
monitor-exit v0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static d(Ljava/lang/Class;)Ljava/lang/String;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/Class<",
|
|
"+",
|
|
"Lcom/moji/api/IAPI;",
|
|
">;)",
|
|
"Ljava/lang/String;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, ""
|
|
|
|
.line 437
|
|
sget-object v1, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
monitor-enter v1
|
|
|
|
.line 438
|
|
:try_start_0
|
|
sget-object v2, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 440
|
|
:try_start_1
|
|
sget-object v2, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {v2, p0}, Lcom/moji/api/service/IAPIManagerInterface;->a(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
:try_end_1
|
|
.catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
:try_start_2
|
|
const-string v2, "APIManager"
|
|
|
|
const-string v3, "RemoteException"
|
|
|
|
.line 442
|
|
invoke-static {v2, v3, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:cond_0
|
|
move-object p0, v0
|
|
|
|
.line 445
|
|
:goto_0
|
|
monitor-exit v1
|
|
|
|
return-object p0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
monitor-exit v1
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method static synthetic d()Ljava/util/concurrent/ConcurrentHashMap;
|
|
.locals 1
|
|
|
|
.line 34
|
|
sget-object v0, Lcom/moji/api/APIManager;->d:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static synthetic e()Ljava/util/concurrent/ConcurrentHashMap;
|
|
.locals 1
|
|
|
|
.line 34
|
|
sget-object v0, Lcom/moji/api/APIManager;->e:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static f()V
|
|
.locals 5
|
|
|
|
.line 347
|
|
sget-object v0, Lcom/moji/api/APIManager;->i:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 348
|
|
:try_start_0
|
|
sget-object v1, Lcom/moji/api/APIManager;->f:Lcom/moji/api/service/IAPIManagerInterface;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
sget-boolean v1, Lcom/moji/api/APIManager;->h:Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 350
|
|
:try_start_1
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
invoke-direct {v1}, Landroid/content/Intent;-><init>()V
|
|
|
|
.line 351
|
|
new-instance v2, Landroid/content/ComponentName;
|
|
|
|
sget-object v3, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
invoke-virtual {v3}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
const-class v4, Lcom/moji/api/service/APIBGService;
|
|
|
|
invoke-virtual {v4}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
|
|
|
|
.line 352
|
|
sget-object v2, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
sget-object v3, Lcom/moji/api/APIManager;->l:Landroid/content/ServiceConnection;
|
|
|
|
const/4 v4, 0x1
|
|
|
|
invoke-virtual {v2, v1, v3, v4}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
|
|
|
|
move-result v1
|
|
|
|
sput-boolean v1, Lcom/moji/api/APIManager;->h:Z
|
|
:try_end_1
|
|
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 354
|
|
:try_start_2
|
|
sput-boolean v2, Lcom/moji/api/APIManager;->h:Z
|
|
|
|
const-string v2, "APIManager"
|
|
|
|
const-string v3, "bindService main service failed"
|
|
|
|
.line 355
|
|
invoke-static {v2, v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
.line 358
|
|
:cond_0
|
|
:goto_0
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit v0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private static g()V
|
|
.locals 2
|
|
|
|
.line 362
|
|
sget-object v0, Lcom/moji/api/APIManager;->b:Landroid/content/Context;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 363
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "Should call APIManager.init(ApplicationContext) to init first"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method private static h()V
|
|
.locals 3
|
|
|
|
.line 498
|
|
:goto_0
|
|
sget-object v0, Lcom/moji/api/APIManager;->g:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->poll()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/moji/api/actions/Action;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 499
|
|
invoke-virtual {v0}, Lcom/moji/api/actions/Action;->a()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x3
|
|
|
|
if-eq v1, v2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 501
|
|
:cond_0
|
|
check-cast v0, Lcom/moji/api/actions/RegisterAction;
|
|
|
|
.line 502
|
|
iget-object v1, v0, Lcom/moji/api/actions/RegisterAction;->a:Ljava/lang/Class;
|
|
|
|
iget-object v0, v0, Lcom/moji/api/actions/RegisterAction;->b:Ljava/lang/Object;
|
|
|
|
invoke-static {v1, v0}, Lcom/moji/api/APIManager;->b(Ljava/lang/Class;Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|