AppSessionManager.smali

.class public Lcom/yctpublication/mastes/sessions/AppSessionManager;
.super Ljava/lang/Object;
.source "AppSessionManager.java"


# instance fields
.field context:Landroid/content/Context;

.field declaration:Ljava/lang/String;

.field editor:Landroid/content/SharedPreferences$Editor;

.field instruction:Ljava/lang/String;

.field name:Ljava/lang/String;

.field preferences:Landroid/content/SharedPreferences;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 4
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "context"
        }
    .end annotation

    .line 16
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "name"

    .line 12
    iput-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->name:Ljava/lang/String;

    const-string v0, "instruction"

    .line 13
    iput-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->instruction:Ljava/lang/String;

    const-string v0, "declaration"

    .line 14
    iput-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->declaration:Ljava/lang/String;

    .line 17
    iput-object p1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->context:Landroid/content/Context;

    const v0, 0x7f120021

    .line 18
    invoke-virtual {p1, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object p1

    iput-object p1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->preferences:Landroid/content/SharedPreferences;

    return-void
.end method


# virtual methods
.method public getDeclaration()Ljava/lang/String;
    .registers 4

    .line 48
    iget-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->preferences:Landroid/content/SharedPreferences;

    iget-object v1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->declaration:Ljava/lang/String;

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getInstruction()Ljava/lang/String;
    .registers 4

    .line 44
    iget-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->preferences:Landroid/content/SharedPreferences;

    iget-object v1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->instruction:Ljava/lang/String;

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getName()Ljava/lang/String;
    .registers 4

    .line 40
    iget-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->preferences:Landroid/content/SharedPreferences;

    iget-object v1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->name:Ljava/lang/String;

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public setDeclaration(Ljava/lang/String;)V
    .registers 4
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "declaration"
        }
    .end annotation

    .line 34
    iget-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->preferences:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    iput-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->editor:Landroid/content/SharedPreferences$Editor;

    .line 35
    iget-object v1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->declaration:Ljava/lang/String;

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 36
    iget-object p1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->editor:Landroid/content/SharedPreferences$Editor;

    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V

    return-void
.end method

.method public setInstruction(Ljava/lang/String;)V
    .registers 4
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "instruction"
        }
    .end annotation

    .line 28
    iget-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->preferences:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    iput-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->editor:Landroid/content/SharedPreferences$Editor;

    .line 29
    iget-object v1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->instruction:Ljava/lang/String;

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 30
    iget-object p1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->editor:Landroid/content/SharedPreferences$Editor;

    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V

    return-void
.end method

.method public setName(Ljava/lang/String;)V
    .registers 4
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "name"
        }
    .end annotation

    .line 22
    iget-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->preferences:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    iput-object v0, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->editor:Landroid/content/SharedPreferences$Editor;

    .line 23
    iget-object v1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->name:Ljava/lang/String;

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 24
    iget-object p1, p0, Lcom/yctpublication/mastes/sessions/AppSessionManager;->editor:Landroid/content/SharedPreferences$Editor;

    invoke-interface {p1}, Landroid/content/SharedPreferences$Editor;->apply()V

    return-void
.end method