当用户选择从旧设备复制应用程序和数据时

发布于 2025-01-19 01:48:12 字数 538 浏览 3 评论 0原文

当用户抓住新手机并拥有现有手机并希望将应用程序和数据迁移到新手机时。 SharedPreferences/AndroidKeystore/AndroidAccountManager到底会发生什么?

即,如果新设备说的应用程序不是同一应用程序,它是否会复制共享Preference/DataStore中的所有内容?

如果新手机已经拥有同一应用程序怎么办?如果它说数据合并或替换或迁移失败并且新手机保留其数据吗?

如果应用程序的版本有所不同怎么办?选择哪个版本的应用程序在新设备上?

然后,使用AndroidAccountmanager,我的理解是,选择一个应用程序是与该帐户类型绑定的主要应用这种帐户(假设所有应用程序都具有相同的签名密钥,并且使用相同的帐户类型)。

迁移会发生什么?它会保留该应用程序 - >帐户管理器链接?还是随机的,首先是哪个应用程序?

然后,关于AndroidKeystore的硬件支持,这意味着所有钥匙都会丢失并消失了吗?这意味着,涉及它们的所有过程都需要一种方法来生成新密钥并确保迁移计划有效吗?这根本没有信号,还是仅仅是钥匙就消失了,就是这样?

When a user grabs a new phone, and has an existing phone and wishes to migrate apps and data to the new phone. What exactly happens with the SharedPreferences/AndroidKeyStore/AndroidAccountManager?

IE, if the new device has say not the same app, would it copy over everything in SharedPreferences/Datastore?

What if the new phone already have the same app? If its say the same version does the data merge or replaces or the migration fails and the new phone keeps its data?

What if the version of the apps differ? Which version of the app is chosen to be on the new device?

Then, with AndroidAccountManager, my understanding is that one app is chosen to be the main app that is tied to that account type, and if you have multiple apps all using the same account it would still be tied to the first app on the device with that kind of account (assuming IIRC all the apps have the same signing key and is using the same account type).

What happens in the migration? Would it keep that app -> AccountManager link? Or would it be random and whichever app goes first is it?

Then about AndroidKeyStore, since its hardware backed, would that mean all keys are lost and gone? And that means that all process involving them would need a way to generate new keys and to ensure a migration plan works? Would there be any signal about this at all or would it be just the keys are gone and that is it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悲喜皆因你 2025-01-26 01:48:12

默认情况下,自动备份包括系统分配给您的应用程序的大多数目录中的文件:

共享首选项文件。

保存到应用程序内部存储的文件,可通过 getFilesDir() 或 getDir(String, int) 访问。

getDatabasePath(String) 返回的目录中的文件,其中还包括使用 SQLiteOpenHelper 类创建的文件。

您可以在这里找到更多信息:
https://developer.android.com/guide/topics/data/autobackup# Android keytoer 的文件

,密钥永远无法备份
对于客户经理:旧设备上的帐户将转移到新设备,您可能不需要为这些帐户输入 2fa。
请注意,您只能在设备设置时从旧手机恢复备份,因此在此步骤之前您无法在 Android 手机上安装应用程序,但如果应用程序存在此类制造应用程序,则该应用程序尚未启动,因此它不会没有任何文件。

By default, Auto Backup includes files in most of the directories that are assigned to your app by the system:

Shared preferences files.

Files saved to your app's internal storage, accessed by getFilesDir() or getDir(String, int).

Files in the directory returned by getDatabasePath(String), which also includes files created with the SQLiteOpenHelper class.

You can find more here :
https://developer.android.com/guide/topics/data/autobackup#Files

for android keystoer, keys can never be backed up
for account manager : accounts on old device will be transfered to new device and you might not need to enter 2fa for these accounts.
notice that you are able to restore backup from old phone only at device setup, so you can't have apps installed before this step on your android phone but in case app exist such manfacture app, the app is not launched yet, so it won't have any files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文