Merge pull request #736 from alex-vit/alexv/fix/delete_account_shared_pref

Delete `id.xml` shared pref from the correct dir
This commit is contained in:
Gregory K 2023-11-13 18:07:24 +03:00 committed by GitHub
commit 34a1c7e408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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){ if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N){
MastodonApp.context.deleteSharedPreferences(id); MastodonApp.context.deleteSharedPreferences(id);
}else{ }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); sessions.remove(id);
if(lastActiveAccountID.equals(id)){ if(lastActiveAccountID.equals(id)){