Recently, WHEN I was doing overseas Android business, I encountered a mysterious bug. That is, when I uninstall the application and reinstall the application again, there is always a token file in the application, so I will use the token to log in (token invalid login failure), even if your token overwrote the original token, Even if you uninstall the APP without this file, when you reinstall the APP, there will still be this file, and there is always the same encrypted string (token) in the file, and I did not do any operation during the APP initialization, this is really a very metaphysical problem.

When I encountered this problem, I also had a headache. I could only analyze the startup process of the application step by step, and found that there was no creation of this file or reading and writing operations to this file. After searching the Internet for a long time, THERE was no corresponding answer. I had no choice, so I went through the configuration step by step, fromAndroidManifestStart looking at the configuration. I suddenly found a propertyandroid:allowBackup="true". I first think of is to remove this property, and then to uninstall application installation, found or not, as soon as you open the application or automatically creates the file, the key is the inside of the content is more on a few times before unloading the content of the same, I yao meng force, is characteristic of mobile phone can also automatically create a file, So I googled the property configuration:At first glance it looks like a simple backup, but look closely:Then I went to check the Settings of my phone, and sure enough, Google cloud backup was open. After I turned it off, I uninstalled and reinstalled, and found that there was no longer the token file. Finally, I was done, but ON second thought, It’s impossible for foreign users to voluntarily turn off Google Cloud Backup, so I didandroid:allowBackupProperty is set to false, and I repeat the previous operation and find that there is no problem, so I continue to look at the official Google documentation:As you can see,android:allowBackupProperty defaults totrueEven if you remove this tag, you will still have the same problem as above, so in general applications, especially foreign applications, if you really do not need to backup data, it is best to set itandroid:allowBackup="false", can avoid puzzling bug problems.

Reference Link: Back up user data using the automatic backup function