英文:
Why android.jar does not contain NetworkSecurityTrustManager?
问题
我的compileSdk是33。
如果我在文件管理器中打开*/AndroidSdk/sources/android-33*,那么我可以找到android.security.net.config.NetworkSecurityTrustManager。它位于*/AndroidSdk/sources/android-33/android/security/net/config*中。
然而,如果我将*/AndroidSdk/platforms/android-33/android.jar解压到/unpacked中,那么在/unpacked中我找不到android.security.net.config.NetworkSecurityTrustManager*(我希望它在*/unpacked/android/security/net/config*中)。
看起来NetworkSecurityTrustManager存在于源代码中,但在android.jar中不存在。为什么会这样呢?
英文:
My compileSdk is 33.
If I open /AndroidSdk/sources/android-33 in file manager, then I can locate android.security.net.config.NetworkSecurityTrustManager. It resides in /AndroidSdk/sources/android-33/android/security/net/config.
However, if I unpack /AndroidSdk/platforms/android-33/android.jar into /unpacked, then within /unpacked I cannot find android.security.net.config.NetworkSecurityTrustManager (I expect it at /unpacked/android/security/net/config).
It seems that NetworkSecurityTrustManager exists in sources, but does not exist in android.jar. Why is that?
答案1
得分: 1
如果您查看源代码,您会看到它带有@hide
注释:
/**
* {@link X509ExtendedTrustManager} that implements the trust anchor and pinning for a
* given {@link NetworkSecurityConfig}.
* @hide
*/
public class NetworkSecurityTrustManager extends X509ExtendedTrustManager {
带有该注释的类不一定包含在android.jar
中,因为它们不是Android SDK的一部分。
英文:
If you look at the source code, you will see that it is marked with the @hide
annotation:
/**
* {@link X509ExtendedTrustManager} that implements the trust anchor and pinning for a
* given {@link NetworkSecurityConfig}.
* @hide
*/
public class NetworkSecurityTrustManager extends X509ExtendedTrustManager {
Classes marked with that annotation are not necessarily included in android.jar
, because they are not part of the Android SDK.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论