使用用户ID广播的ADB [英] adb broadcast with user ID

查看:130
本文介绍了使用用户ID广播的ADB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向广播接收器广播adb命令。这将是一个非常简单的任务,但是braodcast-receiver具有:

I'm trying to broadcast an adb-command to a broadcast-receiver. This would be a very simple task, but the braodcast-receiver has:


android:exported = false

android:exported="false"

在官方的android.developer网站上显示:

On the offical android.developer website, it says:


如果为 false,则广播接收者只能接收的消息是相同应用程序的组件或具有相同用户ID的应用程序发送的消息。

If "false", the only messages the broadcast receiver can receive are those sent by components of the same application or applications with the same user ID.

因此,我尝试将用户ID添加到广播中。现在,我的方法是执行以下adb命令:

So I'm trying to add the user ID to the broadcast. My approach by now is the following adb command:

> adb shell am broadcast -a com.example.action -n com.android.package/.receiverName --user "User_ID"

我得到错误:Windows下cmd中无效的int: User_ID 。此应用是系统应用,更确切地说,它是默认的电话应用。我以为Adb命令是默认情况下广播的系统。为此,我的问题是:是否可以通过广播发送用户ID或访问未导出的操作?清单的User_ID和上午广播的User_ID之间可能存在差异。预先感谢

I get Error: Invalid int: "User_ID" in the cmd under Windows. This app is a System-app, more precise, it is the default Phone-App. I thought an Adb command is a system broadcast by default. My question therefor is: Is there any way to to send the User ID with the broadcast or to access not exported actions? Is there maybe a difference between the User_ID of the manifest and the User_ID of the am broadcast. Thanks in advance

P.S:我没有任何root用户访问权限,因为它可以在很多设备上正常运行,而无需植根所有人。最终结果是,我希望将传入的视频呼叫接受为音频呼叫。

P.S: I haven't got any root access, because it should work for a lot of devices without rooting everyone. As final result I want to accept an incoming videocall as Audiocall.

推荐答案

用户完全不同。

在android网站中,第一个用户是linux系统中的用户ID,例如root,system,u0_a58(10058)。除非处于共享UID状态,否则每个APK都有其用户ID。

The first "user", in android website, is the user id in linux system, like root,system,u0_a58(10058). Every APK has it's user id, unless in share UID condition.

在am命令中,第二个用户代表使用此手机的用户,像管理员,来宾一样。

(您可以在Android Tab中添加来宾用户,但由于某些法律问题,您不能在Android手机中添加来宾用户。)

The second "user", in the am command, is the user stand for people who using this phone, like administrator, guest.
(You can add Guest user in Android Tab, but you can not do it in a Android phone, due to some legal stuff.)

答案:无法通过非根shell或第3个APK访问未导出的组件。

The answer: there is no way to access not exported component from a non-root shell or 3rd APK.

这篇关于使用用户ID广播的ADB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆