将数据从免费应用程序数据库导入到付费应用程序数据库

发布于 2024-08-20 11:31:35 字数 225 浏览 6 评论 0原文

我目前在市场上有一个免费的应用程序,我也想提供它的付费版本。安装付费版本后,我想从免费版本导入数据库和共享首选项,以便用户可以卸载它而不会丢失任何内容。

问题是这样的:在我的免费版本中,我没有设置 android:sharedUserId 。如果我添加一个,系统上应用程序的 ID 就会发生变化,我将无法再访问数据。两个应用程序将使用相同的证书进行签名。如何导入数据而不弄乱免费应用程序的权限?

I currently have a free application on the market and I'd like to offer a paid version of it as well. Once the paid version is installed, I want to import the db and shared preferences from the free version so users can uninstall it without losing anything.

The problem is this: in my free version, I don't have a android:sharedUserId set. If I add one, the app's id on the system changes and I can't access the data anymore. Both apps will be signed using the same certificate. How can I import the data without messing up the permissions of the free app?

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

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

发布评论

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

评论(1

灰色世界里的红玫瑰 2024-08-27 11:31:35

不幸的是,没有简单的答案。

您可以在免费应用程序的未来版本中添加带有 AIDL 接口的 ServiceContentProvider,然后使用它将数据导入到付费应用程序中。根据数据,这可能需要一些自制的“许可”机制来确保只有您的付费应用程序才允许使用已发布的接口。

Unfortunately, there's no easy answer.

You could add a Service with an AIDL interface or a ContentProvider in a future release of the free app, then use that to import the data into the paid app. Depending on the data, that might require some homebrew "licensing" mechanism to make sure only your paid app is allowed to use the published interfaces.

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