{"id":15067248,"url":"https://github.com/patatetom/sdcard","last_synced_at":"2026-01-02T22:50:31.961Z","repository":{"id":256768572,"uuid":"856361475","full_name":"patatetom/sdcard","owner":"patatetom","description":"USB read-only access to SD card on Android system","archived":false,"fork":false,"pushed_at":"2024-11-29T13:50:50.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T16:23:05.711Z","etag":null,"topics":["adb","android","filesystems","fuse","fuse-filesystem","fuse-python","fusepy","linux","python","sdcard"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patatetom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-12T13:02:30.000Z","updated_at":"2024-11-29T13:50:53.000Z","dependencies_parsed_at":"2024-09-29T11:43:26.155Z","dependency_job_id":"7d18a99c-049e-4587-8c8b-613f7882c786","html_url":"https://github.com/patatetom/sdcard","commit_stats":null,"previous_names":["patatetom/sdcard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fsdcard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fsdcard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fsdcard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fsdcard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patatetom","download_url":"https://codeload.github.com/patatetom/sdcard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822309,"owners_count":20353498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adb","android","filesystems","fuse","fuse-filesystem","fuse-python","fusepy","linux","python","sdcard"],"created_at":"2024-09-25T01:18:46.075Z","updated_at":"2026-01-02T22:50:31.909Z","avatar_url":"https://github.com/patatetom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"🚀 [switch to fusepy](https://github.com/patatetom/sdcard/tree/fusepy)\n\n\n# sdcard\n\n**USB read-only access to SD card on Android system**\n\n`sdcard` is a Python script that uses `adb_shell`, `fuse-python` (eg. BSD/Linux/OS-X only) and `libusb` to give fast USB read-only access to the `/sdcard/` (pseudo-)folder (eg. downloads, photos, etc...) of an Android system.\n\n\u003e _**the Android system accessed must have `Developer Options` [enabled](https://developer.android.com/studio/debug/dev-options), as well as `USB Debugging`.**_\n\u003e _**the key present in the script must be authorized on the Android side.**_\n\u003e\n\u003e _another key pair can be generated if [required](https://github.com/patatetom/sdcard/blob/main/sdcard/__main__.py#L12-L16)._\n\n\n## installation\n\n\u003e _these are installation examples, other ways of doing things are possible._\n\u003e\n\u003e _Android tools (eg. `adb`) are not necessary, `adb_shell` is totally independent of them._\n\n\n### system side\n\n- Archlinux (2024.09.01)\n\n```shell\n# as root, install system dependencies if not already installed\npacman -Sy\npacman -S fuse3 python3\nln -s fusermount3 /usr/bin/fusermount\n```\n\n- Debian (12/bookworm)\n\n```shell\n# as root, install system dependencies if not already installed\napt update\napt install fuse3 libusb-1.0-0 python3 python3-venv\n```\n\n- and then, still on the system being configured...\n\n\n```shell\n# as root, install Python virtual environment\npython3 -m venv /opt/android\n/opt/android/bin/python3 -m pip install https://github.com/patatetom/sdcard/archive/main.zip\n```\n\n\n### user side\n\n\u003e _system dependencies (`fuse`, `libusb` and `python`) are still required_\n\n- manually\n\n```shell\npython3 -m venv ~/venv/android\n~/venv/android/bin/python3 -m pip install https://github.com/patatetom/sdcard/archive/main.zip\n```\n\n- pipx\n\n```shell\npipx install https://github.com/patatetom/sdcard/archive/main.zip\n```\n\n\n## usage\n\n\u003e _it's important to note that, by default, `sdcard` remembers the contents (metadata) of visited folders :_\n\u003e _in other words, modifications on the Android system side of a previously visited location will not be reflected by `sdcard`, unless you use the `-n` option._\n\u003e\n\u003e _the examples below are taken from the user side installation above._\n\n```shell\n~/venv/android/bin/sdcard --help\nUsage: sdcard [mountpoint] [options]\nOptions:\n    -h, --help             show this help message and exit\n    -o opt,[opt...]        mount options\n    -r, --root             access from / (default from /sdcard)\n    -n, --nocache          do not cache data (default cache data)\nFUSE options:\n…\n```\n```shell\nmkdir -p /tmp/mountpoint\n~/venv/android/bin/sdcard /tmp/mountpoint\nls /tmp/mountpoint/ #1\n# Alarms   Android   Audiobooks\t DCIM   Documents   Download   Movies   Music   Notifications   Pictures   Podcasts   Recordings   Ringtones   storage\nls -l /tmp/mountpoint/ #2\ntotal 0\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Alarms\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Android\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Audiobooks\n# dr-xr-x--- 2 nobody nogroup 0 Jun 11 09:31  DCIM\n# dr-xr-x--- 2 nobody nogroup 0 Aug 28 16:18  Documents\n# dr-xr-x--- 2 nobody nogroup 0 Sep 18 05:39  Download\n# dr-xr-x--- 2 nobody nogroup 0 May 19 19:14  Movies\n# dr-xr-x--- 2 nobody nogroup 0 May 20 06:53  Music\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Notifications\n# dr-xr-x--- 2 nobody nogroup 0 Aug 10 22:38  Pictures\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Podcasts\n# dr-xr-x--- 2 nobody nogroup 0 Mar 28 16:52  Recordings\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Ringtones\n# dr-xr-x--- 2 nobody nogroup 0 Sep  6 23:02  storage\ntar -C /tmp/mountpoint/ -cz . \u003e /tmp/backup.tar.gz\numount /tmp/mountpoint\n```\n\n\u003e _the second command `ls … #2` above does not reread the contents of the root folder, but uses the data cached by the first call to the command `ls … #1` : if changes have occurred on the Android system side in the meantime, these are not reflected. use the option `--nocache` to force rereading of informations._\n\n```shell\nmkdir -p /tmp/mountpoint\n~/venv/android/bin/sdcard --root /tmp/mountpoint\nls /tmp/mountpoint/\n# acct  apex  config  data  debug_ramdisk  dev  lost+found  mnt  odm  odm_dlkm  oem  proc  product  second_stage_resources  storage  sys\tsystem\tsystem_ext  vendor  vendor_dlkm\nls -l /tmp/mountpoint/\ntotal 0\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 acct\n# dr-xr-x--- 2 nobody nogroup 0 Jun 18  1973 apex\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  1970 config\n# dr-xr-x--- 2 nobody nogroup 0 Sep  8 15:34 data\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 debug_ramdisk\n# dr-xr-x--- 2 nobody nogroup 0 Sep 10 15:00 dev\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 lost+found\n# dr-xr-x--- 2 nobody nogroup 0 Jun 18  1973 mnt\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 odm\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 odm_dlkm\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 oem\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  1970 proc\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 product\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 second_stage_resources\n# dr-xr-x--- 2 nobody nogroup 0 Jun 18  1973 storage\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  1970 sys\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 system\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 system_ext\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 vendor\n# dr-xr-x--- 2 nobody nogroup 0 Jan  1  2009 vendor_dlkm\nls -l /tmp/mountpoint/storage/emulated/0/\ntotal 0\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Alarms\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Android\n# dr-xr-x--- 2 nobody nogroup 0 Mar 22 03:00  Audiobooks\n# dr-xr-x--- 2 nobody nogroup 0 Jun 11 09:31  DCIM\n…\numount /tmp/mountpoint\n```\n\n\u003e _`-r`/`--root` option gives access to the root of the Android system._\n\n\n## links\n- [adb_shell](https://github.com/JeffLIrion/adb_shell)\n- [fuse-python](https://github.com/libfuse/python-fuse)\n- [libusb](https://github.com/karpierz/libusb)\n- [pipx](https://github.com/pypa/pipx)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatatetom%2Fsdcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatatetom%2Fsdcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatatetom%2Fsdcard/lists"}