Application Lists (with Android adb)#68
Conversation
…lso setting friendly names
…ys and appslist.json file
zehnm
left a comment
There was a problem hiding this comment.
Thanks a lot for this addition, can't wait to use it!
Unfortunately I can't configure a new device and use ADB, there is at least one required module missing by adb-shell:
DEBUG:setup_flow:ADB is enabled, proceeding with ADB setup
ERROR:ucapi.api:Exception in setup handler, aborting setup! Exception: No module named 'async_timeout'
I've tried pip3 install -r requirements.txt --force-reinstall, but that didn't install it.
| def _get_config_root() -> Path: | ||
| config_home = Path(os.environ.get("UC_CONFIG_HOME", "./config")) | ||
| config_home.mkdir(parents=True, exist_ok=True) | ||
| return config_home | ||
|
|
||
|
|
||
| def _get_data_root() -> Path: | ||
| data_home = Path(os.environ.get("UC_DATA_HOME", "./data")) | ||
| data_home.mkdir(parents=True, exist_ok=True) | ||
| return data_home |
There was a problem hiding this comment.
These functions are now used in other files and shouldn't be "pseudo-private" anymore. Please remove the leading underscore.
TBH I don't really know the Python customs for "private things", that's all a bit weird to me :-)
| adb_cert_path = Path(os.environ.get("UC_CONFIG_HOME", "./config")) / "certs" / f"adb_{choice}" | ||
| adb_cert_path_pub = Path(os.environ.get("UC_CONFIG_HOME", "./config")) / "certs" / f"adb_{choice}.pub" | ||
| if adb_cert_path.exists(): | ||
| adb_cert_path.unlink() | ||
| if adb_cert_path_pub.exists(): | ||
| adb_cert_path_pub.unlink() | ||
| appslist_path = Path(os.environ.get("UC_CONFIG_HOME", "./config")) / f"appslist_{choice}.json" |
There was a problem hiding this comment.
Use get_config_root to retrieve the configuration directory. The UC_CONFIG_HOME env var with default path shouldn't be copy pasted to several source files. See also src/adb_tv.py
Can you try installing adb-shell in your virtual env and let me know what package you get? "pip list" shows the following for me. adb_shell 0.4.4 "pip show adb_shell" |
Ah I made a mistake in requirements.txt... I used a dash instead of an underscore..... |
|
Missing entry in requirements.txt: Is there a way to reconfigure the app-list? I've only seen it in the initial setup when adding a new device. I have to check if the "keep-alive" option for the setup-flow is working in the core & web-configurator. Then we simply have to send the "setup-is-still-alive" message while the app configuration page is shown. Otherwise the setup-screen automatically times out after 60s and the whole setup fails. For configuring a lengthy app-list, that's not user friendly. |
|
While checking the logs, there seems some URL encoding missing for retrieving the metadata after fetching the ADB app list. This might be related to the previous external metadata addition, but I haven't notices these errors before. There are also a lot of "App not found(404)" errors for well-known apps like: Time to look into the code... |
Weird. It looks like the friendly name is being used instead of the package name. Although during testing it was working so maybe I changed something that caused this unexpected behaviour. Some 404s are expected as not all apps will be found. Will need to review. |
I didn't touch the reconfiguration step as it was getting very messy to maintain. I wanted to split the views up from the logic so that things could be DRY otherwise it would have got a bit messy. |
That's something that cannot be changed quickly and requires support from the web-configurator and remote-ui.
We have to live with that at the moment. First we need to enhance the web-configurator to send additional events, that a user input screen is still shown. @thomasm789 would you like me to sync your branch with main? It diverged with the latest additions. |
Summary
Introduces python-adb, handles ADB authentication, and adds support for dynamic app selection based on installed apps (via if enabled ADB) and/or pre-defined apps list.
Features
Application Source Selection
ADB Integration
General Improvements