找出apk的类名

发布于 2024-11-27 06:03:30 字数 189 浏览 1 评论 0原文

我正在开发一个应用程序,应该能够启动手​​机上安装的另一个应用程序。目前,我成功启动了 facebook,因为 ActivityPackage 和 ActivityClass 是已知的。我想启动其他应用程序,例如twitter、gplus、gtalk、gmail等。如何找到相应的类名?使用packagemanager查找包名很容易,但我没有用相同的方法找到类名。

I am developing an app that should be able to launch another app installed on the phone. Currently, I am successful with launching facebook as the ActivityPackage and ActivityClass is known. I want to launch other apps such as twitter, gplus, gtalk, gmail etc. How do I find out the corresponding Class Names? Finding out the package name is easy with packagemanager, but I dont find the class name with the same method.

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

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

发布评论

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

评论(2

白鸥掠海 2024-12-04 06:03:30

I'm assuming you're not trying to do this at runtime...

android-apktool can expand the manifests of the the packages you're interested in. That will tell you what activities are available and what intent filters are applied.

花间憩 2024-12-04 06:03:30

我正在开发一个应用程序,它应该能够启动手​​机上安装的另一个应用程序。

您可以查询 PackageManager 来查找旨在启动的活动。 这是一个示例项目演示了这一点。

目前,我成功启动了 facebook,因为 ActivityPackage 和 ActivityClass 是已知的。

不要这样做。

你看,你应该意识到 Facebook 可以随时更新他们的应用程序,根据 Facebook 选择改变活动。您应该意识到,当 Facebook 这样做时,任何依赖于原始未记录的、不受支持的 Intent 结构(例如类)的代码都将被破坏。您应该意识到,损坏的应用程序会导致用户在市场上给该应用程序评分和评论较差等。

我想启动其他应用程序,例如 twitter、gplus、gtalk、gmail 等。如何找到相应的类名?

不要这样做。请根据上述示例项目使用声明为属于启动器的活动。

I am developing an app that should be able to launch another app installed on the phone.

You can query PackageManager for activities that are designed to be launched. Here is a sample project demonstrating this.

Currently, I am successful with launching facebook as the ActivityPackage and ActivityClass is known.

Don't do this.

You see, you should realize that Facebook can update their app at any time, changing around the activities as Facebook chooses. You should realize that, when Facebook does this, any code that depended on the original undocumented, unsupported Intent structure (e.g., classes) will break. You should realize that a broken app will cause users to give the app poor ratings and comments on the Market, etc.

I want to launch other apps such as twitter, gplus, gtalk, gmail etc. How do I find out the corresponding Class Names?

Don't do this. Please use the activities declared as belonging in the launcher, per the aforementioned sample project.

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