[英]Is there any way I can log network calls been triggered from the SDK/Android libraries in my app
I am developing an Android SDK/library, In here I am performing several.network calls.我正在开发一个 Android SDK/库,在这里我正在执行几个.network 调用。 But I don't want the Application developer(who uses my SDK) can log the.network calls I performed from my sdk. As It violets our user privacy.但我不希望应用程序开发人员(使用我的 SDK)可以记录我从 sdk 执行的网络调用。因为它侵犯了我们的用户隐私。
In more details, What I wanted to say, If the Application Developer add any.network interceptor with okhttpClient.更详细地说,我想说的是,如果应用程序开发人员使用 okhttpClient 添加 any.network 拦截器。 It should not log any.network calls from my SDK. Thanks in advance.它不应记录来自我的 SDK 的任何网络呼叫。提前致谢。
So far I tried to add log interceptor with my OkhttpClientBuilder but no.network calls been logged.到目前为止,我尝试用我的 OkhttpClientBuilder 添加日志拦截器,但没有记录网络调用。 But I need to be sure there is no other way the Application developer can log my.network calls.但我需要确保应用程序开发人员没有其他方法可以记录 my.network 调用。
If the Application Developer add any.network interceptor with okhttpClient.如果应用程序开发人员使用 okhttpClient 添加 any.network 拦截器。 It should not log any.network calls from my SDK它不应该记录来自我的 SDK 的任何网络呼叫
So long as you are using your own OkHttpClient
instance, rather than one that is given to you by an app using your library, you are in control of what interceptors are attached to that OkHttpClient
instance.只要您使用自己的OkHttpClient
实例,而不是使用您的库的应用程序提供给您的实例,您就可以控制附加到该OkHttpClient
实例的拦截器。
It is still possible for developers to do things to log your.network calls.开发人员仍然可以做一些事情来记录您的网络调用。 For example, they could compile their app with a modified copy of OkHttp, one that logs whatever they want.例如,他们可以使用 OkHttp 的修改副本编译他们的应用程序,一个可以记录他们想要的任何内容的副本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.