Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RepositoryManager.add_repository does not add plugins #2987

Closed
lordidiot opened this issue Feb 24, 2022 · 3 comments
Closed

RepositoryManager.add_repository does not add plugins #2987

lordidiot opened this issue Feb 24, 2022 · 3 comments
Assignees
Labels
Component: API Issue needs changes to the API State: Invalid Issue had issues and is not valid UI: Plugin Manager Issues with the Plugin Manager

Comments

@lordidiot
Copy link

Version and Platform (required):

  • Binary Ninja Version: Version 3.0.3267-dev Personal (Build ID ef8dc2f8)
  • OS: Ubuntu Linux
  • OS Version: 20.04

Bug Description:
I'm trying to test a binary ninja plugin's metadata for the plugin manager to eventually add to the community plugins repo.
However, I cannot setup the plugin to work locally using the pluginmanager module in binary ninja.

Just in order to just test the API, I tried to load the vector35 repository using the pluginmanager, but it does not work. The RepositoryManager.add_repository function returns True but the plugins are not loaded properly.

More details below.

Steps To Reproduce:
I entered the following code into the Binary Ninja python console to try loading the vector35 community repository using the API.

>>> mgr = RepositoryManager()
>>> mgr.add_repository("https://raw.githubusercontent.com/Vector35/community-plugins/master/plugins.json", "test")
True
>>> mgr.repositories
[<community>, <official>, <test>]
>>> mgr.repositories[2].plugins
[]

Notice that mgr.repositories[2].plugins is not populated with the plugins like is expected.

Expected Behavior:
After running add_repository as done in the above code snippet, the manager should be able to load all the relevant plugins, to then be installed/enabled.

Screenshots:
If applicable, please add screenshots here to help explain your problem.

Additional Information:
In case it is relevant, the ~/.binaryninja/repositories/ directory is not updated either after the API call.

(manticore) ctf@ctf:~/.binaryninja/repositories
$ ll
total 16
drwxrwxr-x 4 ctf ctf 4096 Feb 24 14:55 ./
drwxrwxr-x 5 ctf ctf 4096 Feb 23 13:31 ../
drwxrwxr-x 3 ctf ctf 4096 Feb 23 12:37 community/
drwxrwxr-x 3 ctf ctf 4096 Feb 23 12:37 official/
@psifertex
Copy link
Member

Thanks for catching this -- this is a bug caused by the directory for the repository not being created in the right order.

If you manually make the directory in that subfolder called "test" it will be a work-around until we can fix the code in the core.

@psifertex
Copy link
Member

psifertex commented Feb 28, 2022

Another solution is that you can add your test repository to the "unofficial" repository setting and that should also create it for you (and saves you from having to manually add it each time):
Screen Shot 2022-02-28 at 1 47 15 PM

@psifertex psifertex added Type: Bug Issue is a non-crashing bug with repro steps Effort: Low Issue should take < 1 week Impact: Low Issue is a papercut or has a good, supported workaround labels Feb 28, 2022
@psifertex psifertex added this to the Future milestone Feb 28, 2022
@psifertex psifertex added the UI: Plugin Manager Issues with the Plugin Manager label Jan 4, 2023
@plafosse plafosse removed this from the Future milestone May 3, 2023
@fuzyll fuzyll added the Component: UI Issue needs changes to the user interface label May 17, 2023
@ElykDeer
Copy link
Member

ElykDeer commented Jun 8, 2024

You need to call mgr.check_for_updates() for it to fetch the metadata for added repositories. I'll add a note to the docs to that effect.

@ElykDeer ElykDeer closed this as completed Jun 8, 2024
ElykDeer added a commit that referenced this issue Jun 8, 2024
ElykDeer added a commit that referenced this issue Jun 8, 2024
@ElykDeer ElykDeer self-assigned this Jun 8, 2024
@ElykDeer ElykDeer added State: Invalid Issue had issues and is not valid Component: API Issue needs changes to the API and removed Component: UI Issue needs changes to the user interface Impact: Low Issue is a papercut or has a good, supported workaround Effort: Low Issue should take < 1 week Type: Bug Issue is a non-crashing bug with repro steps labels Jun 8, 2024
ElykDeer added a commit that referenced this issue Jun 12, 2024
ElykDeer added a commit that referenced this issue Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: API Issue needs changes to the API State: Invalid Issue had issues and is not valid UI: Plugin Manager Issues with the Plugin Manager
Projects
None yet
Development

No branches or pull requests

5 participants