Undelete feature + fixes

This commit is contained in:
gdlbo
2022-05-06 13:43:42 +03:00
parent 70342daf07
commit c255f1e498
7 changed files with 56 additions and 5 deletions
@@ -74,6 +74,8 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
prefs.edit().clear().commit();
VKImageLoader.b();
ImEngineProvider.a().h();
AudioMessageUtils.j();
@@ -1,12 +1,15 @@
package ru.vtosters.lite.ui.fragments.multiaccount;
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getResources;
import static ru.vtosters.lite.utils.Globals.isNetworkConnected;
import static ru.vtosters.lite.utils.Globals.restartApplication;
import static ru.vtosters.lite.utils.Themes.getTextAttr;
import static ru.vtosters.lite.utils.Themes.recolorDrawable;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.RecyclerView;
@@ -127,6 +130,8 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
VKAccount b = VKAccountManager.b();
PushSubscriber.a.a(b.b(), b.c());
AppContextHolder.a.getSharedPreferences("gcm", 0).edit().clear().apply();
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
prefs.edit().clear().commit();
restartApplication();
});
Drawable drawable = recolorDrawable(getResources().getDrawable(R.drawable.ic_list_add));
@@ -143,6 +148,8 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
VKAccount b = VKAccountManager.b();
PushSubscriber.a.a(b.b(), b.c());
AppContextHolder.a.getSharedPreferences("gcm", 0).edit().clear().apply();
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
prefs.edit().clear().commit();
restartApplication();
});
@@ -164,6 +171,8 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
VKAccount b = VKAccountManager.b();
PushSubscriber.a.a(b.b(), b.c());
AppContextHolder.a.getSharedPreferences("gcm", 0).edit().clear().apply();
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
prefs.edit().clear().commit();
restartApplication();
});
}
@@ -27,7 +27,7 @@ public class DeletedMessagesHandler {
private static List<Integer> sDeletedMessagesList = new ArrayList<>();
private static final String DELETED_PREFIX = "\uD83D\uDDD1 ";
private static final String DELETED_PREFIX = "[Удалено] ";
private static SQLiteDatabase sVKSQLiteDatabase;
private static int sBodyIndex = -1;
@@ -45,7 +45,7 @@ public class DeletedMessagesHandler {
}
public static boolean hook() {
return BooleanFalse("hook_deleted_messages");
return BooleanFalse("undeletemsg");
}
public static void setBodyDBParser(Msg msg) {
@@ -1,6 +1,7 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.migrate;
import static ru.vtosters.lite.utils.DeletedMessagesHandler.reloadMessagesList;
import static ru.vtosters.lite.utils.Globals.fixGapps;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
@@ -27,6 +28,7 @@ public class Preferences {
fixGapps();
setProxy();
migrate();
reloadMessagesList();
registerActivities(application);
}