在Android 11中,应用程序如何在卸载后保留数据,而无需SAF用户交互即可选择文件/文件夹位置?
基于 Android 11 卸载应用程序后是否可以保留文件?
在 Android 11 中,似乎就像在应用程序卸载后几乎不可能在本地保留用户数据一样。 选择文件/对话框
除非我们使用需要显式用户交互的 SAF,否则要使用此系统 UI
或者,通过使用 android:hasFragileUserData="true"
标志,会弹出卸载期间显示以下 UI - https://www.xda-developers.com/android-10-manifest-flag-developers-retain-app-data-before-uninstalling/
然而,令我惊讶的是,我请注意市场上流行的应用程序,它能够干净地保留用户多个备份数据,0用户交互,并且不使用 android:hasFragileUserData="true"
标志方法。
这是一个视频,展示重新安装后如何干净地读取保留的数据(在捕获视频之前我已经进行了干净的卸载) - https://www.youtube.com/watch?v=UqG4n_0xmVI
有谁知道我如何实现这样的目标 “魔法”?
Based on Is it possible to persisit a file after app uninstall with Android 11?
In Android 11, It seems like almost impossible to retain user data locally, after app uninstallation. Unless we are using SAF, which requires explicit user interaction, to select file/ dialog using this system UI
Or, by using android:hasFragileUserData="true"
flag, which will pop up the following UI during uninstallation - https://www.xda-developers.com/android-10-manifest-flag-developers-retain-app-data-before-uninstalling/
However, to my suprise, I do notice a popular app in the market, which able to cleanly retain user multiple backup data, with 0 user interaction, and not using android:hasFragileUserData="true"
flag method.
This is a video, to show how it is able to cleanly read the retained data, after re-installation (I have already did a clean uninstall, before capturing the video) - https://www.youtube.com/watch?v=UqG4n_0xmVI
Does anyone has any idea, how I can achieve such "magic"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论