【问题标题】:How to send method call by dbus-send?如何通过 dbus-send 发送方法调用?
【发布时间】:2021-11-18 18:42:28
【问题描述】:

我正在分析 Chromium 操作系统。
我已经使用 dbus-monitor 捕获了一个 dbus 方法调用,并希望通过 dbus-send 重新显示它。
下面是我要重新出现的。

my-chromiumos ! # dbus-monitor --system "path=/org/chromium/SessionManager"
    method call time=1632639141.486152 sender=:1.325 -> destination=org.chromium.SessionManager serial=402 path=/org/chromium/SessionManager; interface=org.chromium.SessionManagerInterface; member=RestartJob
       file descriptor
             inode: 489350
             type: socket
             address family: unix
             name @
             peer @
       array [
          string "/opt/google/chrome/chrome"
          string "--gpu-sandbox-failures-fatal=no"
          string "--enable-logging"
          string "--use-cras"
          string "--use-gl=egl"
          string "--user-data-dir=/home/chronos"
          string "--vmodule=*night_light*=1,*/ash/wm/tablet_mode/*=1,wizard_controller=1,*/webui/chromeos/login/*=1,*/browser/chromeos/login/screens/*=1,enrollment_screen_handler=1,*/browser/chromeos/login/enrollment/*=1,*/ui/ozone/*=1,*/ui/display/manager/chromeos/*=1"
          string "--enable-wayland-server"
          string "--aura-legacy-power-button"
          string "--login-profile=user"
          string "--system-developer-mode"
          string "--bwsi"
          string "--homepage=chrome://newtab/"
          string "--incognito"
          string "--log-level=1"
          string "--login-user=$guest"
       ]
       uint32 0

【问题讨论】:

  • sry 我的操作系统中没有 busctl 或其他工具。

标签: dbus google-chrome-os chromium-os


【解决方案1】:

请查看dbus-send 文档了解更多详情。

dbus-send --dest=org.chromium.SessionManager \
          --print-reply \
          --type=method_call \
          /org/chromium/SessionManager \
          org.chromium.SessionManagerInterface.RestartJob

看起来上面的方法调用没有带任何参数,但你应该用可用的 API 文档确认。

另外,我找到了这个Chrome OS D-Bus Best Practices 指南,也请看一下。

【讨论】:

    猜你喜欢
    • 2015-12-04
    • 2019-01-10
    • 1970-01-01
    • 2017-09-18
    • 2016-07-10
    • 2014-09-02
    • 2013-10-08
    • 2011-10-20
    • 2017-01-23
    相关资源
    最近更新 更多