- rather than cloning the entire history of repos, can do a shallow clone with a [depth](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt-code--depthcodeemltdepthgtem) of 1
- this should make it more efficient, particularly when there are many commits or many large commits
- since the history is unused by regular end users, there is no need to fetch/download it
- could alternatively do a [bare](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt-code--barecode) clone to be even more efficient
- but I thought a shallow clone is a bit less intrusive for now
- and is reversible, if needed (i.e. a local shallow clone can fetch the rest of the depth)
- also add syntax highlighting to the first code block, matching the second one
1. Refactored function names for better readability and adherence to PEP 8 naming conventions. 2. Addressed several syntax and logical errors in the provided code. 3. Improved code structure and removed redundant code blocks. 4. Ensured consistent use of f-strings for string formatting. 5. Updated imports for better organization and clarity. 6. Resolved issues related to variable usage and scope. 7. Checked and fixed potential runtime errors. 8. Enhanced code comments to improve code documentation. Overall, the changes aim to improve the code's maintainability, readability, and correctness.
For analysis and reverse engineering, it can be helpful to insert a
custom CA certificate into Waydroid’s system-wide trust store.
Users used to be able to do that via Android’s settings but not anymore.
The `install mitm` command accepts a path to a file that contains a
– typically self-signed – CA certificate in PEM format.
It then renames [1] and copies the file into the overlay file system,
placing it into Waydroid’s trust store.
As a usage example, the following command lines enable your host to use
mitmproxy [2] to act as a proxy and to intercept [3] HTTP(S) connections
that come from the Waydroid container:
```sh
$ timeout --preserve-status 2 mitmdump -n # creates a CA cert in ~/.mitmproxy
$ sudo venv/bin/python3 main.py install mitm --ca-cert ~/.mitmproxy/mitmproxy-ca-cert.pem
INFO: Creating directory: /system/etc/security/cacerts
INFO: Copying /home/yourname/.mitmproxy/mitmproxy-ca-cert.pem to system trust store
INFO: Target file: /system/etc/security/cacerts/6320a7db.0
INFO: mitm installation finished
$ sudo waydroid shell -- ls -l /system/etc/security/cacerts # double-check that it worked
[…]
-rw-r--r-- 1 root root 1191 2024-01-01 00:00 6320a7db.0
[…]
$ adb shell settings put global http_proxy ${YOUR_IP_HERE?}:3128 # tell Waydroid to use the proxy
# for all connections
$ mitmproxy -p 3128 # start proxy and display a TUI
# with HTTP(S) connections
# coming from Waydroid
```
[1]: https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/#2-rename-certificate
[2]: https://mitmproxy.org/
[3]: https://docs.mitmproxy.org/stable/mitmproxytutorial-interceptrequests/
Change the MD5Sum Because trying it spams error because its invalid
Suggestion: Just add the main.zip to the Releases tag and let The script grab the 'stable' version there an just change it alongside with the python script library for update to not add issues
This is required to properly support Waydroid tool versions <=1.3.4
(which NixOS for example still has), or 1.4.0+ configured with
USE_DBUS_ACTIVATION=0 (basically non-systemd distributions which can't
supervise the container properly when it's launched via D-Bus)
Instead of resizing images directly to 6 GB , now resize as required by the add-on being installed, this should help mobile devices with limited storages