abrignoni / abrignoni/iLEAPP

Media Manager - check_in_media() Limitations

Aperta
#1,530 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.2k
Fork
303
Merge medio
4h 32m
PR unite (30g)
216

Descrizione

I am currently working on an artifact plugin for a chat app. I am trying to avoid having too permissive of a regex path search (in my case: /private/var/mobile/Containers/Shared/AppGroup/{GUID}/Attachments/{FILES}). I figured I would use `Context.seeker.search()` to get my attachments so I could avoid bringing in every app that has an Attachments folder. The problem is `check_in_media()` cannot be used with files that are not found as part of the initial regex path search in the artifact header dict. Any files found manually by calling `seeker.search()` don't get added to the Context's `_files_found` or `_filename_lookup_map`. `check_in_media()` and `_check_in_media()` both use: `Context.get_source_file_path({path})`.

I created a new static method in Context.py that I can pass the results from `seeker.search()` into for testing, which allowed me to make use of `check_in_media()` and my artifact results appear as expected in the table view and conversation view (LAVA).
```
@staticmethod
def add_files_to_context(new_files):
if not isinstance(new_files, list):
new_files = [new_files]

Context._files_found.extend(new_files)
Context._filename_lookup_map = {}
```

I don't know the best way to tackle this problem. I'm not sure if adding something to the Context is best, some change to the Media Manager would be better, or if I'm missing some other existing way to handle this.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.