257 lines
5.5 KiB
Smali
257 lines
5.5 KiB
Smali
.class public Lcom/moji/badge/BadgeUtil;
|
|
.super Ljava/lang/Object;
|
|
.source "BadgeUtil.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final a:Ljava/lang/Object;
|
|
|
|
.field private static b:Lcom/moji/badge/BadgePreference;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 17
|
|
new-instance v0, Ljava/lang/Object;
|
|
|
|
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
|
|
|
|
sput-object v0, Lcom/moji/badge/BadgeUtil;->a:Ljava/lang/Object;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 18
|
|
sput-object v0, Lcom/moji/badge/BadgeUtil;->b:Lcom/moji/badge/BadgePreference;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 16
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Landroid/content/Context;)Ljava/util/BitSet;
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
.line 33
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/moji/badge/BadgeUtil;->b(Landroid/content/Context;)Lcom/moji/badge/BadgePreference;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
return-object v0
|
|
|
|
.line 37
|
|
:cond_1
|
|
sget-object v1, Lcom/moji/badge/BadgePreference$KeyConstant;->DISABLED_BADGE_LIST:Lcom/moji/badge/BadgePreference$KeyConstant;
|
|
|
|
const-string v2, ""
|
|
|
|
invoke-virtual {p0, v1, v2}, Lcom/moji/badge/BadgePreference;->a(Lcom/moji/badge/BadgePreference$KeyConstant;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 38
|
|
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
.line 39
|
|
new-instance v0, Lcom/google/gson/GsonBuilder;
|
|
|
|
invoke-direct {v0}, Lcom/google/gson/GsonBuilder;-><init>()V
|
|
|
|
invoke-virtual {v0}, Lcom/google/gson/GsonBuilder;->enableComplexMapKeySerialization()Lcom/google/gson/GsonBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/google/gson/GsonBuilder;->create()Lcom/google/gson/Gson;
|
|
|
|
move-result-object v0
|
|
|
|
.line 40
|
|
const-class v1, Ljava/util/BitSet;
|
|
|
|
invoke-virtual {v0, p0, v1}, Lcom/google/gson/Gson;->fromJson(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/util/BitSet;
|
|
|
|
return-object p0
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static a(Landroid/content/Context;Lcom/moji/badge/BadgeEvent$TYPE;I)V
|
|
.locals 0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 62
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/moji/badge/BadgeUtil;->b(Landroid/content/Context;)Lcom/moji/badge/BadgePreference;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
return-void
|
|
|
|
.line 66
|
|
:cond_1
|
|
invoke-virtual {p0, p1, p2}, Lcom/moji/badge/BadgePreference;->a(Lcom/moji/badge/BadgeEvent$TYPE;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Lcom/moji/badge/BadgeEvent$TYPE;)V
|
|
.locals 2
|
|
|
|
.line 81
|
|
invoke-static {}, Lorg/greenrobot/eventbus/EventBus;->a()Lorg/greenrobot/eventbus/EventBus;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/moji/badge/BadgeEvent;
|
|
|
|
invoke-direct {v1, p0}, Lcom/moji/badge/BadgeEvent;-><init>(Lcom/moji/badge/BadgeEvent$TYPE;)V
|
|
|
|
invoke-virtual {v0, v1}, Lorg/greenrobot/eventbus/EventBus;->d(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Landroid/content/Context;Lcom/moji/badge/BadgeEvent$TYPE;)Z
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 50
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/moji/badge/BadgeUtil;->a(Landroid/content/Context;)Ljava/util/BitSet;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 51
|
|
invoke-virtual {p0}, Ljava/util/BitSet;->isEmpty()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
.line 52
|
|
invoke-virtual {p1}, Lcom/moji/badge/BadgeEvent$TYPE;->ordinal()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p0, p1}, Ljava/util/BitSet;->get(I)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
:cond_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public static b(Landroid/content/Context;Lcom/moji/badge/BadgeEvent$TYPE;)I
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
return v0
|
|
|
|
.line 73
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/moji/badge/BadgeUtil;->b(Landroid/content/Context;)Lcom/moji/badge/BadgePreference;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
return v0
|
|
|
|
.line 77
|
|
:cond_1
|
|
sget-object p0, Lcom/moji/badge/BadgeUtil;->b:Lcom/moji/badge/BadgePreference;
|
|
|
|
invoke-virtual {p0, p1, v0}, Lcom/moji/badge/BadgePreference;->b(Lcom/moji/badge/BadgeEvent$TYPE;I)I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static b(Landroid/content/Context;)Lcom/moji/badge/BadgePreference;
|
|
.locals 2
|
|
|
|
.line 21
|
|
sget-object v0, Lcom/moji/badge/BadgeUtil;->a:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
.line 22
|
|
:try_start_0
|
|
sget-object v1, Lcom/moji/badge/BadgeUtil;->b:Lcom/moji/badge/BadgePreference;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 23
|
|
new-instance v1, Lcom/moji/badge/BadgePreference;
|
|
|
|
invoke-direct {v1, p0}, Lcom/moji/badge/BadgePreference;-><init>(Landroid/content/Context;)V
|
|
|
|
sput-object v1, Lcom/moji/badge/BadgeUtil;->b:Lcom/moji/badge/BadgePreference;
|
|
|
|
.line 25
|
|
:cond_0
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 26
|
|
sget-object p0, Lcom/moji/badge/BadgeUtil;->b:Lcom/moji/badge/BadgePreference;
|
|
|
|
return-object p0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 25
|
|
:try_start_1
|
|
monitor-exit v0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw p0
|
|
.end method
|