什么jar/dex文件提供了Android.jar的真正实现

发布于 2024-12-06 00:32:45 字数 553 浏览 3 评论 0原文

编译 Android SDK 源代码后,我遇到了一些有趣的问题。我 尝试反汇编生成的android.jar,但发现大多数 该 jar 文件中包含的方法只是一个不执行任何操作的存根 不仅仅是抛出运行时异常,例如:

public void startActivityForResult(android.content.Intent, int);
Code:
0:  new #2; //class java/lang/RuntimeException
3:  dup
4:  ldc #3; //String Stub!
6:  invokespecial   #4; //Method java/lang/
RuntimeException."<init>":(Ljava/lang/String;)V
9:  athrow

我可以理解 Android.jar 可能不需要包含 Android 框架的真正实现,因为它仅充当 第三方应用程序的编译时库。但我的问题是:什么是 提供 android.jar 真正实现的 Jar 或 Dex 文件?我 假设它也应该在编译 SDK 时生成,对吗?

谢谢! 二

I ran into some interesting problem after compiling the Android SDK source. I
tried to disassemble the resulting android.jar, but found that most
methods contained in that jar file are just a stub that does nothing
more than throwing a runtime exception, for example:

public void startActivityForResult(android.content.Intent, int);
Code:
0:  new #2; //class java/lang/RuntimeException
3:  dup
4:  ldc #3; //String Stub!
6:  invokespecial   #4; //Method java/lang/
RuntimeException."<init>":(Ljava/lang/String;)V
9:  athrow

I can understand there might be no need for Android.jar to contain the
real implementations of Android Framework, given it only serves as a
compile-time library for 3rd party apps. But my question is: what is
the Jar or Dex file(s) that provides the real implementation of android.jar? I
assume it should also be generated when compiling the SDK, am I right?

Thanks!
LL

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文