“私人”空间有多安全?系统进程的aidl

发布于 2024-12-09 05:01:05 字数 393 浏览 0 评论 0原文

在我的应用程序中,它使用专有的蓝牙设备,我正在努力自我纠正设备可能出现的一些问题。这些问题之一是当手机认为已配对但设备未配对时,它会拒绝连接,直到手机取消配对并重新配对。使用此处找到的答案,我在代码中很好地完成了这个工作,但我有点担心它的“安全”程度,因为我现在在我自己的源代码树中的 android.bluetooth 下有一个aidl。在我使用几部 2.2 和 2.3 手机进行的测试中,这似乎工作得很好,但我是否愿意在未来版本中重写,或者创建这个本地 aidl 是否实际上使我免受未来更改的影响?欢迎进一步阅读。

In my app, which uses a proprietary bluetooth device, I'm working on self-correcting some problems that may come up with the device. One of those problems is when the phone thinks it's paired, and the device does not, so it refuses connections until the phone unpairs and re-pairs. Using the answer found here, I got this working in code quite nicely, but I'm a bit concerned over how "safe" this is, since I now have an aidl under android.bluetooth in my own source tree. This seems to work fine in my testing with several 2.2 and 2.3 phones, but am I open to having to rewrite in future versions, or does creating this local aidl actually insulate me from future changes? Pointers to further reading are welcome.

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

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

发布评论

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

评论(1

黑色毁心梦 2024-12-16 05:01:06

您链接到的答案似乎是调用私有 API。这样做时要小心,因为它们在 Android 的未来版本中可能随时发生变化。

回答您的问题:

但是我愿意在未来的版本中重写吗?

是的,因为这些私有 API 可能会随时更改,恕不另行通知,因为它们是私有的。

创建这个本地援助真的能让我免受未来的影响吗
变化?

不,它不会让你隔离。他们可以在不通知的情况下更改 android.os.ServiceManagerandroid.bluetooth.IBluetooth 中的任何内容,并且会在较新版本的 Android 中破坏您的代码。

我听起来有点重复,但要小心私有 API,它们将来可能会咬你一口。但是,听起来这可能是您可以做到这一点的唯一方法。

It looks like the answer you linked to is calling private APIs. Be careful doing this as they could change at any time in future versions of Android.

To answer you questions:

but am I open to having to rewrite in future versions?

Yes, because those private APIs could change at anytime without any notice because they are private.

does creating this local aidl actually insulate me from future
changes?

No, it won't insulate you. They could change anything in android.os.ServiceManager or android.bluetooth.IBluetooth without notice and it would break your code in newer versions of Android.

I sound a bit repetitive, but becareful with private APIs, they might bite you in the future. However, it also sounds like this might be the only way you can do this.

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