首页 > 解决方案 > 我如何为应用操作设置特定包(应用)

问题描述

你好,有一个应用程序可以将贴纸添加到 whatsapp。

并且有 3 个版本的 whatsapp 具有不同的包名称

com.whatsapp
com.gbwhatsapp
com.gbwhatsapp3

我希望我的应用贴纸仅将贴纸添加到 com.gbwhatsapp 并且我不想看到带有消息的复杂操作

我试图改变动作和许多事情,但应用程序崩溃了

添加贴纸的操作是:

com.whatsapp.intent.action.ENABLE_STICKER_PACK

截屏

贴纸应用程序中的代码是

new-instance v0, Landroid/content/Intent;

invoke-direct {v0}, Landroid/content/Intent;-><init>()V

const-string v1, "com.whatsapp.intent.action.ENABLE_STICKER_PACK"

invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

我可以在此之后将代码添加到特定应用程序包到 com.gbwhatsapp 以执行此操作吗?

我正在使用 apktool

标签: androidapksmaliapktool

解决方案


您可以向Intent.setPackage. 例如

const-string v1, "com.gbwhatsapp"
invoke-virtual {v0, v1}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

推荐阅读