Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

frida.get_usb_device() can not works at first time.

オープン
#174 コメント 1 件 リアクション 12 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
devtools

調査の方向性

Python 3.9 と Frida 14.0.0 で初回呼び出し時の失敗を再現し、トレースバックをもとに frida/init.py の get_usb_device と get_device_matching メソッド、および frida/core.py:get_device_matching を調査します。完了の条件は、初回の frida.get_usb_device() 呼び出しで、再試行や sleep を必要とせずに USB デバイスが見つかることです。

索引モデルが issue の本文から書いたものです。

説明

Please check the error logs as follow: (frida --version 14.0.0)

Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import frida
>>> frida.get_usb_device()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\__init__.py", line 82, in get_usb_device
    return get_device_matching(lambda d: d.type == 'usb', timeout, **kwargs)
  File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\__init__.py", line 90, in get_device_matching
    return get_device_manager().get_device_matching(predicate, timeout, **kwargs)
  File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\core.py", line 26, in wrapper
    return f(*args, **kwargs)
  File "C:\Users\Bytedance\AppData\Local\Programs\Python\Python39\lib\site-packages\frida\core.py", line 58, in get_device_matching
    return Device(self._impl.get_device_matching(lambda d: predicate(Device(d)), raw_timeout))
frida.InvalidArgumentError: device not found
>>> frida.get_usb_device()
Device(id="89EX0A89A", name="Pixel 3", type='usb')

As you saw it, went I call frida.get_usb_device() first time it will get an error. But if you try to call it second time, it's OK!
So I try to solve this problem as follow and it works:

try:
	device = frida.get_usb_device()
except BaseException: 
	time.sleep(3)
	device = frida.get_usb_device()
主要言語
Python
スター
873
フォーク
173
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

frida/frida-python のほかの issue

frida/frida-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。