Delete `id.xml` shared pref from the correct dir

This commit is contained in:
Aleksandrs Vitjukovs 2023-11-13 16:52:43 +02:00 committed by alexv
parent 7bac2f206b
commit 6255221d6a
1 changed files with 5 additions and 1 deletions

View File

@ -181,7 +181,11 @@ public class AccountSessionManager{
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N){
MastodonApp.context.deleteSharedPreferences(id);
}else{
new File(MastodonApp.context.getDir("shared_prefs", Context.MODE_PRIVATE), id+".xml").delete();
String dataDir=MastodonApp.context.getApplicationInfo().dataDir;
if(dataDir!=null){
File prefsDir=new File(dataDir, "shared_prefs");
new File(prefsDir, id+".xml").delete();
}
}
sessions.remove(id);
if(lastActiveAccountID.equals(id)){