Shared Preferences
- onCreate method of Launcher Activity
- Increase 4 digits in registers of that method in which you put this snippets and increase 5 digits if you want to use snippet of long data
Boolean
const-string v0, "yourSPName" # Put the name of that SharedPreferences which you want to edit.
const/4 v1, 0x0
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p0
invoke-interface {p0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p0
const/4 v2, 0x1 # Boolean value, put the value as your requirement.
const-string v3, "isAppBought" # Boolean key, put your keyword that you find out.
invoke-interface {p0, v3, v2}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->apply()V
Integer
const-string v0, "yourSPName" # Put the name of that SharedPreferences which you want to edit.
const/4 v1, 0x0
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p0
invoke-interface {p0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p0
const v2, 0x7fffffff # Integer value, put the value as your requirement.
const-string v3, "userDiamonds" # Integer key, put your keyword that you find out.
invoke-interface {p0, v3, v2}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->apply()V
String
const-string v0, "yourSPName" # Put the name of that SharedPreferences which you want to edit.
const/4 v1, 0x0
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p0
invoke-interface {p0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p0
const-string v2, "active" # String value, put the value as your requirement.
const-string v3, "subStatus" # String key, put your keyword that you find out.
invoke-interface {p0, v3, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->apply()V
Long
const-string v0, "yourSPName" # Put the name of that SharedPreferences which you want to edit.
const/4 v1, 0x0
invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p0
invoke-interface {p0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object p0
const-wide v3, 0x7fffffffffffffffL # Long value, put the value as your requirement.
const-string v2, "userCoins" # Long key, put your keyword that you find out.
invoke-interface {p0, v2, v3, v4}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;
invoke-interface {p0}, Landroid/content/SharedPreferences$Editor;->apply()V