apkfuckery/com.discord/smali/androidx/preference/PreferenceManager.smali

709 lines
20 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public Landroidx/preference/PreferenceManager;
.super Ljava/lang/Object;
.source "PreferenceManager.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/preference/PreferenceManager$SimplePreferenceComparisonCallback;,
Landroidx/preference/PreferenceManager$PreferenceComparisonCallback;,
Landroidx/preference/PreferenceManager$OnNavigateToScreenListener;,
Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;,
Landroidx/preference/PreferenceManager$OnPreferenceTreeClickListener;
}
.end annotation
# static fields
.field public static final KEY_HAS_SET_DEFAULT_VALUES:Ljava/lang/String; = "_has_set_default_values"
.field public static final STORAGE_DEFAULT:I = 0x0
.field public static final STORAGE_DEVICE_PROTECTED:I = 0x1
# instance fields
.field public mContext:Landroid/content/Context;
.field public mEditor:Landroid/content/SharedPreferences$Editor;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public mNextId:J
.field public mNoCommit:Z
.field public mOnDisplayPreferenceDialogListener:Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;
.field public mOnNavigateToScreenListener:Landroidx/preference/PreferenceManager$OnNavigateToScreenListener;
.field public mOnPreferenceTreeClickListener:Landroidx/preference/PreferenceManager$OnPreferenceTreeClickListener;
.field public mPreferenceComparisonCallback:Landroidx/preference/PreferenceManager$PreferenceComparisonCallback;
.field public mPreferenceDataStore:Landroidx/preference/PreferenceDataStore;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public mPreferenceScreen:Landroidx/preference/PreferenceScreen;
.field public mSharedPreferences:Landroid/content/SharedPreferences;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public mSharedPreferencesMode:I
.field public mSharedPreferencesName:Ljava/lang/String;
.field public mStorage:I
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 2
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const-wide/16 v0, 0x0
iput-wide v0, p0, Landroidx/preference/PreferenceManager;->mNextId:J
const/4 v0, 0x0
iput v0, p0, Landroidx/preference/PreferenceManager;->mStorage:I
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mContext:Landroid/content/Context;
invoke-static {p1}, Landroidx/preference/PreferenceManager;->getDefaultSharedPreferencesName(Landroid/content/Context;)Ljava/lang/String;
move-result-object p1
invoke-virtual {p0, p1}, Landroidx/preference/PreferenceManager;->setSharedPreferencesName(Ljava/lang/String;)V
return-void
.end method
.method public static getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;
.locals 2
invoke-static {p0}, Landroidx/preference/PreferenceManager;->getDefaultSharedPreferencesName(Landroid/content/Context;)Ljava/lang/String;
move-result-object v0
invoke-static {}, Landroidx/preference/PreferenceManager;->getDefaultSharedPreferencesMode()I
move-result v1
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p0
return-object p0
.end method
.method public static getDefaultSharedPreferencesMode()I
.locals 1
const/4 v0, 0x0
return v0
.end method
.method public static getDefaultSharedPreferencesName(Landroid/content/Context;)Ljava/lang/String;
.locals 1
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object p0
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p0, "_preferences"
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public static setDefaultValues(Landroid/content/Context;IZ)V
.locals 2
invoke-static {p0}, Landroidx/preference/PreferenceManager;->getDefaultSharedPreferencesName(Landroid/content/Context;)Ljava/lang/String;
move-result-object v0
invoke-static {}, Landroidx/preference/PreferenceManager;->getDefaultSharedPreferencesMode()I
move-result v1
invoke-static {p0, v0, v1, p1, p2}, Landroidx/preference/PreferenceManager;->setDefaultValues(Landroid/content/Context;Ljava/lang/String;IIZ)V
return-void
.end method
.method public static setDefaultValues(Landroid/content/Context;Ljava/lang/String;IIZ)V
.locals 3
2020-07-08 16:44:49 +00:00
const-string v0, "_has_set_default_values"
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const/4 v1, 0x0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
2020-05-17 12:40:10 +00:00
move-result-object v2
if-nez p4, :cond_0
2020-07-08 16:44:49 +00:00
invoke-interface {v2, v0, v1}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
2020-05-17 12:40:10 +00:00
move-result p4
if-nez p4, :cond_1
:cond_0
new-instance p4, Landroidx/preference/PreferenceManager;
invoke-direct {p4, p0}, Landroidx/preference/PreferenceManager;-><init>(Landroid/content/Context;)V
invoke-virtual {p4, p1}, Landroidx/preference/PreferenceManager;->setSharedPreferencesName(Ljava/lang/String;)V
invoke-virtual {p4, p2}, Landroidx/preference/PreferenceManager;->setSharedPreferencesMode(I)V
const/4 p1, 0x0
invoke-virtual {p4, p0, p3, p1}, Landroidx/preference/PreferenceManager;->inflateFromResource(Landroid/content/Context;ILandroidx/preference/PreferenceScreen;)Landroidx/preference/PreferenceScreen;
invoke-interface {v2}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p0
const/4 p1, 0x1
2020-07-08 16:44:49 +00:00
invoke-interface {p0, v0, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
2020-05-17 12:40:10 +00:00
move-result-object p0
invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->apply()V
:cond_1
return-void
.end method
.method private setNoCommit(Z)V
.locals 1
if-nez p1, :cond_0
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mEditor:Landroid/content/SharedPreferences$Editor;
if-eqz v0, :cond_0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
:cond_0
iput-boolean p1, p0, Landroidx/preference/PreferenceManager;->mNoCommit:Z
return-void
.end method
# virtual methods
.method public createPreferenceScreen(Landroid/content/Context;)Landroidx/preference/PreferenceScreen;
.locals 2
new-instance v0, Landroidx/preference/PreferenceScreen;
const/4 v1, 0x0
invoke-direct {v0, p1, v1}, Landroidx/preference/PreferenceScreen;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
invoke-virtual {v0, p0}, Landroidx/preference/Preference;->onAttachedToHierarchy(Landroidx/preference/PreferenceManager;)V
return-object v0
.end method
.method public findPreference(Ljava/lang/CharSequence;)Landroidx/preference/Preference;
.locals 1
.param p1 # Ljava/lang/CharSequence;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/Nullable;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Landroidx/preference/Preference;",
">(",
"Ljava/lang/CharSequence;",
")TT;"
}
.end annotation
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mPreferenceScreen:Landroidx/preference/PreferenceScreen;
if-nez v0, :cond_0
const/4 p1, 0x0
return-object p1
:cond_0
invoke-virtual {v0, p1}, Landroidx/preference/PreferenceGroup;->findPreference(Ljava/lang/CharSequence;)Landroidx/preference/Preference;
move-result-object p1
return-object p1
.end method
.method public getContext()Landroid/content/Context;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mContext:Landroid/content/Context;
return-object v0
.end method
.method public getEditor()Landroid/content/SharedPreferences$Editor;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mPreferenceDataStore:Landroidx/preference/PreferenceDataStore;
if-eqz v0, :cond_0
const/4 v0, 0x0
return-object v0
:cond_0
iget-boolean v0, p0, Landroidx/preference/PreferenceManager;->mNoCommit:Z
if-eqz v0, :cond_2
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mEditor:Landroid/content/SharedPreferences$Editor;
if-nez v0, :cond_1
invoke-virtual {p0}, Landroidx/preference/PreferenceManager;->getSharedPreferences()Landroid/content/SharedPreferences;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
iput-object v0, p0, Landroidx/preference/PreferenceManager;->mEditor:Landroid/content/SharedPreferences$Editor;
:cond_1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mEditor:Landroid/content/SharedPreferences$Editor;
return-object v0
:cond_2
invoke-virtual {p0}, Landroidx/preference/PreferenceManager;->getSharedPreferences()Landroid/content/SharedPreferences;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
return-object v0
.end method
.method public getNextId()J
.locals 4
monitor-enter p0
:try_start_0
iget-wide v0, p0, Landroidx/preference/PreferenceManager;->mNextId:J
const-wide/16 v2, 0x1
add-long/2addr v2, v0
iput-wide v2, p0, Landroidx/preference/PreferenceManager;->mNextId:J
monitor-exit p0
return-wide v0
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
.method public getOnDisplayPreferenceDialogListener()Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mOnDisplayPreferenceDialogListener:Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;
return-object v0
.end method
.method public getOnNavigateToScreenListener()Landroidx/preference/PreferenceManager$OnNavigateToScreenListener;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mOnNavigateToScreenListener:Landroidx/preference/PreferenceManager$OnNavigateToScreenListener;
return-object v0
.end method
.method public getOnPreferenceTreeClickListener()Landroidx/preference/PreferenceManager$OnPreferenceTreeClickListener;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mOnPreferenceTreeClickListener:Landroidx/preference/PreferenceManager$OnPreferenceTreeClickListener;
return-object v0
.end method
.method public getPreferenceComparisonCallback()Landroidx/preference/PreferenceManager$PreferenceComparisonCallback;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mPreferenceComparisonCallback:Landroidx/preference/PreferenceManager$PreferenceComparisonCallback;
return-object v0
.end method
.method public getPreferenceDataStore()Landroidx/preference/PreferenceDataStore;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mPreferenceDataStore:Landroidx/preference/PreferenceDataStore;
return-object v0
.end method
.method public getPreferenceScreen()Landroidx/preference/PreferenceScreen;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mPreferenceScreen:Landroidx/preference/PreferenceScreen;
return-object v0
.end method
.method public getSharedPreferences()Landroid/content/SharedPreferences;
.locals 3
invoke-virtual {p0}, Landroidx/preference/PreferenceManager;->getPreferenceDataStore()Landroidx/preference/PreferenceDataStore;
move-result-object v0
if-eqz v0, :cond_0
const/4 v0, 0x0
return-object v0
:cond_0
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mSharedPreferences:Landroid/content/SharedPreferences;
if-nez v0, :cond_2
iget v0, p0, Landroidx/preference/PreferenceManager;->mStorage:I
const/4 v1, 0x1
if-eq v0, v1, :cond_1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mContext:Landroid/content/Context;
goto :goto_0
:cond_1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mContext:Landroid/content/Context;
invoke-static {v0}, Landroidx/core/content/ContextCompat;->createDeviceProtectedStorageContext(Landroid/content/Context;)Landroid/content/Context;
move-result-object v0
:goto_0
iget-object v1, p0, Landroidx/preference/PreferenceManager;->mSharedPreferencesName:Ljava/lang/String;
iget v2, p0, Landroidx/preference/PreferenceManager;->mSharedPreferencesMode:I
invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v0
iput-object v0, p0, Landroidx/preference/PreferenceManager;->mSharedPreferences:Landroid/content/SharedPreferences;
:cond_2
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mSharedPreferences:Landroid/content/SharedPreferences;
return-object v0
.end method
.method public getSharedPreferencesMode()I
.locals 1
iget v0, p0, Landroidx/preference/PreferenceManager;->mSharedPreferencesMode:I
return v0
.end method
.method public getSharedPreferencesName()Ljava/lang/String;
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mSharedPreferencesName:Ljava/lang/String;
return-object v0
.end method
.method public inflateFromResource(Landroid/content/Context;ILandroidx/preference/PreferenceScreen;)Landroidx/preference/PreferenceScreen;
.locals 1
.annotation build Landroidx/annotation/RestrictTo;
value = {
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP_PREFIX:Landroidx/annotation/RestrictTo$Scope;
}
.end annotation
const/4 v0, 0x1
invoke-direct {p0, v0}, Landroidx/preference/PreferenceManager;->setNoCommit(Z)V
new-instance v0, Landroidx/preference/PreferenceInflater;
invoke-direct {v0, p1, p0}, Landroidx/preference/PreferenceInflater;-><init>(Landroid/content/Context;Landroidx/preference/PreferenceManager;)V
invoke-virtual {v0, p2, p3}, Landroidx/preference/PreferenceInflater;->inflate(ILandroidx/preference/PreferenceGroup;)Landroidx/preference/Preference;
move-result-object p1
check-cast p1, Landroidx/preference/PreferenceScreen;
invoke-virtual {p1, p0}, Landroidx/preference/Preference;->onAttachedToHierarchy(Landroidx/preference/PreferenceManager;)V
const/4 p2, 0x0
invoke-direct {p0, p2}, Landroidx/preference/PreferenceManager;->setNoCommit(Z)V
return-object p1
.end method
.method public isStorageDefault()Z
.locals 3
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/4 v1, 0x1
const/16 v2, 0x18
if-lt v0, v2, :cond_1
iget v0, p0, Landroidx/preference/PreferenceManager;->mStorage:I
if-nez v0, :cond_0
goto :goto_0
:cond_0
const/4 v1, 0x0
:cond_1
:goto_0
return v1
.end method
.method public isStorageDeviceProtected()Z
.locals 3
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/4 v1, 0x0
const/16 v2, 0x18
if-lt v0, v2, :cond_0
iget v0, p0, Landroidx/preference/PreferenceManager;->mStorage:I
const/4 v2, 0x1
if-ne v0, v2, :cond_0
const/4 v1, 0x1
:cond_0
return v1
.end method
.method public setOnDisplayPreferenceDialogListener(Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;)V
.locals 0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mOnDisplayPreferenceDialogListener:Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;
return-void
.end method
.method public setOnNavigateToScreenListener(Landroidx/preference/PreferenceManager$OnNavigateToScreenListener;)V
.locals 0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mOnNavigateToScreenListener:Landroidx/preference/PreferenceManager$OnNavigateToScreenListener;
return-void
.end method
.method public setOnPreferenceTreeClickListener(Landroidx/preference/PreferenceManager$OnPreferenceTreeClickListener;)V
.locals 0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mOnPreferenceTreeClickListener:Landroidx/preference/PreferenceManager$OnPreferenceTreeClickListener;
return-void
.end method
.method public setPreferenceComparisonCallback(Landroidx/preference/PreferenceManager$PreferenceComparisonCallback;)V
.locals 0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mPreferenceComparisonCallback:Landroidx/preference/PreferenceManager$PreferenceComparisonCallback;
return-void
.end method
.method public setPreferenceDataStore(Landroidx/preference/PreferenceDataStore;)V
.locals 0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mPreferenceDataStore:Landroidx/preference/PreferenceDataStore;
return-void
.end method
.method public setPreferences(Landroidx/preference/PreferenceScreen;)Z
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mPreferenceScreen:Landroidx/preference/PreferenceScreen;
if-eq p1, v0, :cond_1
if-eqz v0, :cond_0
invoke-virtual {v0}, Landroidx/preference/PreferenceGroup;->onDetached()V
:cond_0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mPreferenceScreen:Landroidx/preference/PreferenceScreen;
const/4 p1, 0x1
return p1
:cond_1
const/4 p1, 0x0
return p1
.end method
.method public setSharedPreferencesMode(I)V
.locals 0
iput p1, p0, Landroidx/preference/PreferenceManager;->mSharedPreferencesMode:I
const/4 p1, 0x0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mSharedPreferences:Landroid/content/SharedPreferences;
return-void
.end method
.method public setSharedPreferencesName(Ljava/lang/String;)V
.locals 0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mSharedPreferencesName:Ljava/lang/String;
const/4 p1, 0x0
iput-object p1, p0, Landroidx/preference/PreferenceManager;->mSharedPreferences:Landroid/content/SharedPreferences;
return-void
.end method
.method public setStorageDefault()V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x18
if-lt v0, v1, :cond_0
const/4 v0, 0x0
iput v0, p0, Landroidx/preference/PreferenceManager;->mStorage:I
const/4 v0, 0x0
iput-object v0, p0, Landroidx/preference/PreferenceManager;->mSharedPreferences:Landroid/content/SharedPreferences;
:cond_0
return-void
.end method
.method public setStorageDeviceProtected()V
.locals 2
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x18
if-lt v0, v1, :cond_0
const/4 v0, 0x1
iput v0, p0, Landroidx/preference/PreferenceManager;->mStorage:I
const/4 v0, 0x0
iput-object v0, p0, Landroidx/preference/PreferenceManager;->mSharedPreferences:Landroid/content/SharedPreferences;
:cond_0
return-void
.end method
.method public shouldCommit()Z
.locals 1
iget-boolean v0, p0, Landroidx/preference/PreferenceManager;->mNoCommit:Z
xor-int/lit8 v0, v0, 0x1
return v0
.end method
.method public showDialog(Landroidx/preference/Preference;)V
.locals 1
iget-object v0, p0, Landroidx/preference/PreferenceManager;->mOnDisplayPreferenceDialogListener:Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;
if-eqz v0, :cond_0
invoke-interface {v0, p1}, Landroidx/preference/PreferenceManager$OnDisplayPreferenceDialogListener;->onDisplayPreferenceDialog(Landroidx/preference/Preference;)V
:cond_0
return-void
.end method