我如何为应用程序操作设置特定包(应用程序)

How i can set Specific package (app) for app action

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

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

com.whatsapp
com.gbwhatsapp
com.gbwhatsapp3

并且我希望我的应用程序贴纸仅向 com.gbwhatsapp 添加贴纸并且我不想看到带有消息的完整操作

我尝试更改操作和很多东西,但应用程序崩溃了

添加贴纸的动作是:

com.whatsapp.intent.action.ENABLE_STICKER_PACK

Screenshot

贴纸应用中的代码是

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

您可以添加对 Intent.setPackage 的呼叫。例如

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